Mirth Connect - get sent from destination - mirth

I have 2 destinations in my channel. One is an http sender, the 2nd gets the response from the http sender but I would also like to pull what was sent from that destination also. Can't seem to find the command if one exists to grab that.

I understand your question like this:
You want to know what was sent from the second destination?
My guess is like you can fetch the output of transformer on the destination end.
Inside tranformer i used connectorMessage.getEncodedData() or on the destination we can use the channel map variable ${message.encodedData} both of them works in the same way it pulls what comes out of your destination.
You can try same connectorMessage functionality in the destination transformer or on destination writer to pull the output of what comes from the destination. Hope it works.

Related

Needing Log pcap for MAP_OPEN_REQ and MAP_OPEN_DELIMITER_REQ messages

Similar the question I asked before in enter link description here, I also need a Log pcap for MAP_OPEN_REQ and MAP_OPEN_DELIMITER_REQ messages.
As I found pcap files containing MAP/TCAP/SCCP protocols enter link description here and enter link description here, but there is no log Pcap for MAP_OPEN_REQ there.
How can I get that?
You won't find MAP-OPEN and MAP-DELIMITER in the pcaps because they are not sent over the wire.
These are common services/primitives used between the MAP service-user and the MAP service-provider. See 3GPP 29.002 - "7 General on MAP services" and "7.5 General rules for mapping of services onto TC".
The inbound roamer IMSI is sent as a parameter in the MAP send authentication info request message from the VPLMN MSC/VLR to the HPLMN HLR as component portion of TCAP dialogue. Here TCAP is MAP provider to transfer MAP service user data to destination MAP service user which is the HLR. In order to send mentioned MAP operation and receive its response, you need to implement whole SS7 layers; TCAP, SCCP and M3UA. You can not send only MAP message without adding other SS7 layers to route your message to target HLR entity. I would propose using Sigtran Softstack solutions to address all issues at once.

mirth connect stop message propagation through destinations

I am using Mirth Connect 3.5.0.8232.
I have a Database Reader as source connector and a JavaScript writer as destination connector. I decided to put some fancy code in the destination, doing four separate things, which should follow one after the other. Basically I just wrote the code and it seemed to me that it was too long and too clumsy, so I decided to split it into 4 destinations that would be daisy-chained, via the "Wait for previous destination" option.
The question is : How do I interrupt this chain of execution if an error occurs on one of the destinations?
I found a JIRA issue from 2013 saying that actually the errors that would occur in the body of the Destination Connector would not prevent the message from going to all other Destinations. And it states that the 2.X version behavior is still current, i.e. an error that would occur in the Destination Transformer, will actually stop the message from propagating.
I tried throwing errors in both the Destination body, and in Destination Response Transformer, and in both cases the message would continue to other Destinations. I also tried returning ResponseFactory.getErrorResponse from the Destination body with no luck. I also tried setting responseStatus to ERROR in Destination Response Transformer to no avail. Did they mean the normal Transformer/Filter?
Also - maybe my particular solution of splitting a task into 4 distinct destinations was NOT the reason why the destinations were created in the first place? I think that the documentation states that destinations are basically what the actual word Destination stands for.
If the above case is true, maybe there are better ways of organizing the code functionally in Mirth? I think including external JS files is not allowed in JavaScript writer - even if it were, i would prefer everything to sit inside the Channel itself and be exportable/importable as a single file.
Thank you.
Yep, when an error is thrown from a filter/transformer, it's considered truly "exceptional" and so message flow is stopped (subsequent destinations in the same chain are not executed).
If an error is thrown from the actual destination dispatcher or from the response transformer, that destination is marked as ERROR, but subsequent destinations will still be executed.
You can still stop the message flow if you want though. Use filters on your subsequent destinations:

Add query params to an Icecast relay mount source

I am trying to relay a audio stream but besides the mount point /mount_source I need to pass query params so It would look like this:
/mount_source?option1=a&option2=b
Is there a way to do this? I tried specifying in my config file under exactly what I described above but that does not work.
my exact setup is
<relay>
<server>stream.com</server>
<port>8000</port>
<mount>/fm?option1=123&option2=456</mount>
<local-mount>/localfm</local-mount>
<on-demand>0</on-demand>
<relay-shoutcast-metadata>1</relay-shoutcast-metadata>
</relay>
If i type in the address with the query options in the browser I will get the correct stream. But without the params I get a place holder stream which is basicly saying it is out of service. And that is what is happening in icecast too. It is getting the mount point but not passing the query options.

how to notice if a mail is a forwarded mail?

I have a very special problem.
If we create a mail in Outlook, we add a UserProperty which contains a DataBase-ID of our System, so we can Link the mail to the representing DataBase-Item. On the service which reads the mails in each Mailbox and imports them automatically I can read this property by using ExtendedPropertyDefinitions. So far everything is fine...
If the User now forwards the message in Outlook, Olk copies the UserProperty to the new message. And now my problems beginn. Now my Service thinks the new message is also linked to our database and updates DB-Entry with the new Body and new Subject.
So does anyone now how to find out if a message is a forwarded one or how to tell Outlook not to copy the userproperty to the forwarded (new) message?
thx. Jay
What we thought about, but isnt working for our case
- a second userproperty containing a simple tag linke "fromSystem". Cause this would be copied too.
- a second userproperty containing a hashsum calculated from subject and Body. Cause both could be changed by the user. We just create the message, add all properties and Display it. from this Point on we no longer have control what is Happening to the mail until the Service handles it.
Your service consuming EWS should check the ConversationIndex and only update the database if it's 22 bytes long (original source message). Forward emails and reply emails keep appending 5 bytes (10 chars) to the ConversationIndex extending it beyond 22 bytes.
Sample ConversationIndexes
Original: 01CDD15D80E51C1D4522172840ACA96287DA28A15D97
Reply: 01CDD15D80E51C1D4522172840ACA96287DA28A15D970000018630
Forward: 01CDD15D80E51C1D4522172840ACA96287DA28A15D970000018630000000FC30
ConversationIndex represents the sequential ordering of the ConversationTopic (essentially GUID + timestamp). See Working with Conversations on MSDN. ConversationIndex is explicitly defined on MSDN here.
if (message.ConversationIndex.Length == 22)
{
// update DB body, subject, etc.
}
Also make sure you load the EmailMessageSchema.ConversationIndex before trying to access its value.

Mirth: overwriting msg object with contents in an XML object

The task is to send an XML object from Channel-A to Channel-B
<MyMessage>
<ID>42</ID>
<hl7v2>
MSH|^~\&|LAB|....
PID|1|....
</hl7v2>
</MyMessage>
The steps of the channel communication:
in the Channel-B's source transformer, extract the HL7v2 contents
OVERWRITE the current msg object in Channel-B with the extracted contents
continue in the other Channel-B source transformers and expecting to reference msg['PID']['PID.5'] as normal.
The good news is that I can extract the HL7v2 'payload' into a variable. The problem or difficulty is resetting the msg object, or any other object to be able to reference the HL7 properties as expected.
When I create a new variable with the SerializerFactory.getHL7Serializer, it wraps with the tags <HL7Message>.
channelMap.put('MessageID', msg['ID']); //successful
channelMap.put('v2payload',msg['HL7v2']); //also looks good
var v2Msg = SerializerFactory.getHL7Serializer(false,false,true).toXML(msg['HL7v2']);
channelMap.put('v2Msg', v2Msg );
link to full size image
Question: Do you have any suggestions on how to overwrite the msg object?
How can I start referencing the msg as such:
msg['PID']['PID.5']
Current Conditions
the receiving channel's input type is XML
the need is to take extract all the properties from that XML object; ID is a database PK to be used later in the destination.
I'm sorry my original answer was bogged down with the peculiarities of my own scenario. I have reworked and tested to ensure that this works in your scenario.
Sending Channel - wraps the raw hl7 into your xml structure, and forwards to a channel called ReceiveXML. I have coded this in the Source Transformer, but you should code it where it works for you.
var wrappedHL7 = <MyMessage><ID>123</ID>
<hl7v2>{messageObject.getRawData()}</hl7v2>
</MyMessage>;
router.routeMessage("ReceiveXML", wrappedHL7);
Receiving Channel - extracts the hl7 from the xml, converts it to xml, and assigns back to the msg object. I have coded this in the source Filter - hence "return true;"
msg = new XML(SerializerFactory.getHL7Serializer(false,false,true).toXML(msg['hl7v2'].toString()));
return true;
All you have to do is put your incoming xml message into the inbound template area in mirth and then use the message tree to drag and drop the info from the XML that you need to the javascript section of the connector.