Support forum
Hello Alf,
The name of the connector where the message comes from is not available by default in the standard script of the Scripting Gateway, but it is easy to add.
First change the 'OnMessagePacket' function in the script to the following code:
public void OnMessagePacket(Hashtable messagePacket)
{
if (GetPacketString(messagePacket, "PacketName", "") == "MessageOut") {
OnMessageToSend(GetPacketString(messagePacket, "RecordId", ""),
GetPacketString(messagePacket, "To", ""),
GetPacketString(messagePacket, "From", ""),
GetPacketString(messagePacket, "Message", ""),
GetPacketString(messagePacket, "MessageType", ""),
GetPacketString(messagePacket, "ConnectorName", ""));
}
else if (GetPacketString(messagePacket, "PacketName", "") == "StatusRequest") {
OnStatusRequest(GetPacketString(messagePacket, "MessageId", ""));
}
}
{
if (GetPacketString(messagePacket, "PacketName", "") == "MessageOut") {
OnMessageToSend(GetPacketString(messagePacket, "RecordId", ""),
GetPacketString(messagePacket, "To", ""),
GetPacketString(messagePacket, "From", ""),
GetPacketString(messagePacket, "Message", ""),
GetPacketString(messagePacket, "MessageType", ""),
GetPacketString(messagePacket, "ConnectorName", ""));
}
else if (GetPacketString(messagePacket, "PacketName", "") == "StatusRequest") {
OnStatusRequest(GetPacketString(messagePacket, "MessageId", ""));
}
}
And then change the header of the 'OnMessageToSend' function to:
private void OnMessageToSend(string recordId, string toAddress, string fromAddress,
string message, string messageType, string connectorName)
string message, string messageType, string connectorName)
After these changes you can use the 'connectorName' variable in the 'OnMessageToSend' function to determine where the message comes from.
Regards, Henk
Forum Timezone: Europe/Amsterdam
Most Users Ever Online: 529
Currently Online:
Guest(s) 5
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
Member Stats:
Guest Posters: 694
Members: 0
Moderators: 0
Admins: 1
Forum Stats:
Groups: 2
Forums: 3
Topics: 1183
Posts: 4038
Newest Members:
, Henk HelmantelAdministrators: Henk Helmantel: 1553
Add Reply
Add Topic
Offline
Quote