Missing segments in 999 file generated by BizTalk - biztalk

I have a query related to the 999 ack file being created when an 820 EDI message gets processed in one of the BizTalk applications in my org.
The generated 999 file does contain a code R for the AK9 segment which means the file has been rejected. However it does not contain the IK3 and IK4 segments which would have given more details about the reasons for the rejection of the file.
Have you experienced this scenario? If yes could you please share your understanding?

BizTalk will definitely not generate IK3 or IK4 segments if there's a terminal error with the file, such as an error in the functional group (GS/GE) or sometimes even an error in the ST/SE pair(s).
The TR3 specifies that IK3 and IK4 should be sent "if the sender knows" what segments/elements were in error. So even if there are no errors at the functional or transaction set enveloping levels, it's possible that the errors are just not trackable properly by the EDI Disassembler and it doesn't report them.
If you'd like to add these in for certain scenarios where your partner expects them (despite what the TR3 says), you'd have to do some custom work to capture the 999 and modify it.

Related

Stop getting response from LTE module using AT command

When the number is dialed from any of the number to LTE module, I got automatic responses from that module for e.g.
[2018-07-02 15:43:30:997_R:] DSR:0 CTS:1 (RI:0) DCD:0
[2018-07-02 15:43:30:997_R:] DSR:0 CTS:1 (RI:1) DCD:0
[2018-07-02 15:43:31:012_R:] NO CARRIER .
These are autogenerated responses without firing AT commands to the module. So I
don't want these responses. Please suggest me any AT command to stop this.
These responses are called unsolicited result codes because they are triggered by events other than AT commands.
To learn more about the different types of responses read chapter 5.7.1 Responses in the ITU V.250 specification. V.250 is one of the most important AT command documents and you should really read all of chapter 5.
Some of the unsolicited result codes can be individually disabled, but some (e.g. NO CARRIER) cannot, so you must write your modem software to handle them. There is no way around.

Exit status convention in Unix programs

Consider a Unix command foo that reads a file (or stdin) on a line-by-line basis where each line is expected to adhere to a specific format, for an example the /etc/passwd format.
If any of the lines are incorrect (but not all), should the termination status be EXIT_SUCCESS or EXIT_FAILURE?
I have tried referring to the standard,
C11 Standard: 7.20.4.3 The exit function
Para 5
Finally, control is returned to the host environment. If the value of status is zero or
EXIT_SUCCESS, an implementation-defined form of the status successful termination is
returned. If the value of status is EXIT_FAILURE , an implementation-defined form
of the status unsuccessful termination is returned. Otherwise the status returned is
implementation-defined.
My interpretation of the above is that "implementation-defined" means that the decision is left to the implementer. Is this interpretation correct?
The term "implementation defined" in the C standard means the platform implementation, and not the programmer of an individual application.
What this sentence means is that different platforms can have different conventions on how success or failure is transmitted to the environment, e.g to a shell. Implementations may also provide means to distinguish different codes for failure, depending on the reasons that lead to it. But then such codes may not be portable between different systems.
For the semantics of what you as a programmer consider to be success or failure, you are completely free to do whatever is appropriate for your application.
You’re correct that the decision is left up to the implementer. It depends on how the program is to be used.
For example, if foo terminates with a failure when it encounters incorrectly formatted input, a user of foo could write a shell script that checks its exit status and alerts her with an email containing the contents of stderr. If foo terminates successfully, there would be no need for an email to be sent.

Is it possible that both TA1 and 999 missing in BizTalk when inbounding a bad formatted X12 file?

This is the 1st time I meet this.
Normally when we received an inbound X12 file. A 999 will always be generated (by configuration in BizTalk) and in case of interchange level error occurs, a TA1 will be created.
But today I got a X12 file with some formatting errors, the error popup in BizTalk is :
Delimiters are not unique, field and component seperator are the same.
The sequence number of the suspended message is 1.
I am expecting to have a 999 or TA1 generated to reject the inbound file. but none of these 2 files created.
My question:
What file shall I expect to created for this kind of error? 999 or
TA1?
Is this a bug or normal behavior for BizTalk?
If this is normal, what is the best mechanism to catch this error and
response back to trading partner.
You should definitely not expect a 999 (which would be transaction set specific), because this error prevents BizTalk from parsing the transaction set at all - it doesn't have a reliable way to determine what kind of transaction it is.
A TA1 could be appropriate, but this seems like a grey area - might be worth contacting Microsoft support about. The documentation indicates that an invalid ISA should result in a negative TA1, but the error codes for TA1 don't list this particular scenario as one that's support (or at all).
A possible work around would be capturing this kind of message, generating a TA1 for it, and routing it back to the TP. However, having non-unique delimiters may make it impossible to determine the TP from the message itself, even though you might be able to determine it from context (but maybe not if multiple trading partners use the same ports/locations). My guess is that's why BizTalk isn't handling it properly out of the box. To be honest, unless this happens fairly frequently it'd probably be easier/more realible to deal with it on an exception basis with human intervention.
As far as capturing the message, I'm thinking you'd need a custom pipeline component - perhaps even subclassing the EdiDisassembler so you can catch this particular exception and deal with it.

Setting EDIFACT delimiters in party agreement

I am currently implementing an EDI solution in BizTalk Server 2010.
This is the scenario:
BizTalk is responsible for the correct message routing between a X.400 mailbox and the customer's ERP software. It is also used to put information about the exchanged message into a SharePoint site using the SharePoint webservices.
I am using Role Links and the BizTalk party management to apply the correct settings (send ports, password in UNB6 segment, etc.).
Now I have the following question:
When I try to fetch an outgoing INVOIC message from the customer's ERP system, extract the relevant information in an orchestration and write it into the SharePoint site, the receive port using the EDI receive pipeline gets suspended with the following error message:
An output message of the component "EDI disassembler" in receive pipeline
"**********.Pipelines.FileNamePromotionEDIReceivePipeline, **********.Pipelines,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=****************" is suspended
due to the following error:
Error: 1 (Miscellaneous error)
33: Invalid occurence outside message, package or group.
The sequence number of the suspended message is 1.
This happens because the message uses a CR and LF as suffix after each segment delimiter. Now I could add the ASCII-hex-codes for CR and LF to the "EfactDelimiters" setting of the pipeline, but the problem is that there are other messages without the CR and LF, which then could not be received using the same pipeline. By the way, when I fetch one of those messages without CR and LF using the pipeline also without CR and LF set as delimiters, the receive port also gets suspended, this time with an error message resulting from the usage of dots instead of commas as decimal separator (although I have enabled the option "UseDotAsDecimalSeparator" in the pipeline). Again, only changing the EfactDelimiters helps.
I thought that the "Character set and separators" page in the party agreement was supposed to make exactly that possible: To set the delimiters individually for each business party. But the changes I make in these settings seem to have no effect whatsoever. I set the "UNA6 Suffix" to "CR LF" and the "Decimal Notation (UNA3)" to ".(Decimal)", restart the host instance... same problem.
Can anyone help?
I never used biztalk, but I know my EDIFACT, and as far as I know, those messages containing CR/LF are syntactically wrong. The UNA6 Suffix seems to be an addition by Microsoft, as I can find no trace of it in the official documents on EDIFACT at UNECE.
Normally, the chars you want to use as special chars in an EDIFACT message are set by the special (optinal) UNA segment, which always comes first. When you write, you set the separators / delimiters, I don't really know, what you mean by that, as it could refer either to setting the options for the created message (what delimiters are used in the message), setting the delimiters used for parsing by the receiving program, or it could refer to the chars that are printed in the UNA segment.
Know, in the UNA segment, there is no way that I know of, to indicate the use of any UNA6 suffix (as stated quite explicitly in the documents, the UNA segment has to be exactly 9 characters of length, see 8.3 Interchange formatting rules). That leads me to the conclusion, that you set the options for the created messages. I would not advise to use a UNA6 suffix, if you can avoid it. It might be nice for humans to read the message, but it does not belong there and is not useful for the machine to read.
If the receiving program has no option to allow optional occurrence of CR/LF, and you can not avoid a mix of those to kind of messages, I see no other way for you other than somehow insert a small program that gets rid of the CR/LF.
The most important principle is of course, to make the sending and the receiving program talk in the same syntax, otherwise it can't work. The same thing goes for the problem with the decimal separator. As of Syntax rules, 10.1, either the comma or the dot is allowed, which is a quite loose definition. If you want to be on the save side, send an UNA segment, specifying which one you use, and then only use that one.
I'm not really sure, how much this helps you with the specific problem, as it might be a thing that's only a question on how to configure biztalk, but I thing some background information should be useful.

Getting the extension number on which a call was received within a function - asterisk

I have an asterisk server set up as a telephone exchange. I have, on it, a 100 extensions, from 00 - 99. I am running specific functions on each of those extensions. Some of these functions may need the extension on which the call was received to be available. How can I access the same? For example,
Say a call comes in on extension 55.
55 has a function associated with it. That function must take in 55 as an input parameter. How do I do this?
I have tried the following:
exten => 0,n,Verbose(1, "Call on ${EXTEN}-${CHANNEL}")
Output is : Call on 0-DAHDI/20-1
Thanks,
Sriram Shankar.
The answer you are looking for is dependent upon the path that the call is taking through your system. The easiest way to determine the answer to your question is to place the call and then run the following commands from within the Asterisk CLI:
> core show channels
This will show you what channels are active. Find the channel name of your call.
core show channel [channel-name]
This will output an array of channel details, including different variables that are set and their corresponding values. Look for the extension number you are trying to grab in the value fields and then look to see what the corresponding variable name is. It could be ${CALLERID(num)}, ${CALLERID(dnid)}, something under the ${CDR} variable, or even elsewhere.
If you don't find it in the output produced by "core show channel [channel-name]", you may have to trace the dialplan path that the call is taking and try setting the variable early on when the DID information is still available.

Resources