Hi,
My Company is intrested in pourchasing your dll, so I spent some time, testing it.
I came up with the following question:
how can I access the optional fields of the SubmitSm (like, the payload field)? (For what I've seen so far, theese fields are implemented as non public members.)
Hope this is possible and that you would be so like to answer me, as soon as poosible.
Regards, Hamid
accessing SubmitSm optional parameters
Re: accessing SubmitSm optional parameters
Hi Hamid,
you can use code
or
you can use code
Code: Select all
submitSm.Optional.AddMessagePayload(bytearray);
Code: Select all
submitSm.Optional[OptionalTags.MessagePayload] = new TLV(...);
Re: accessing SubmitSm optional parameters
since version 1.0.11 you can try code
Easiest way to send concatenated message in payload parameter is to use method SendText
Code: Select all
submitSm.Optional[OptionalTags.MessagePayload] = client.GetMessageBytes("test", DataCodings.Default);
Easiest way to send concatenated message in payload parameter is to use method SendText
Code: Select all
client.SubmitText(SubmitMode.Payload, srcTon, srcNpi, srcAddr, destTon, destNpi, destAddr, DataCodings.Default, "test");
Re: accessing SubmitSm optional parameters
Hello,
we have buy the DLL and the source code, i would like to ask to how from the server of SMPP can i take the value of Payload .. the code you have posted in the forum only show the way for set Payload in client.
Hamid Mehmood
we have buy the DLL and the source code, i would like to ask to how from the server of SMPP can i take the value of Payload .. the code you have posted in the forum only show the way for set Payload in client.
Hamid Mehmood
Re: accessing SubmitSm optional parameters
On the server side you can use code:
Code: Select all
void server_evClientSubmitSm(object sender, SmppServerClient client, Inetlab.SMPP.PDU.SubmitSm data)
{
if (data.Optional[OptionalTags.MessagePayload] != null)
{
string text = client.GetMessageText(data.Optional[OptionalTags.MessagePayload], data.DataCoding);
AddToLog(string.Format("Client {0}:{1} Received message Src:{2}, Dst:{3}, Text: {4}",
client.RemoteIP, client.RemotePort, data.DestAddr, data.SrcAddr, text));
}
else
{
AddToLog(string.Format("Client {0}:{1} Received message Src:{2}, Dst:{3}, Text: {4}",
client.RemoteIP, client.RemotePort, data.DestAddr, data.SrcAddr,
data.ShortMessage));
}
}