Closed mtfash closed 6 years ago
I parsed TCP stream captured, I got all of them are OK. Look below (ordered as you wrote) :
as You can see: your user_message_reference is 100
1: EnquireLink -- AllowedSource:Any AllowedSession:Transceiver HasResponse:True Header:EnquireLink Tlv:[] SmppEncodingService:JamaaTech.Smpp.Net.Lib.SmppEncodingService
2: EnquireLinkResp -- AllowedSource:Any AllowedSession:Transceiver Header:EnquireLinkResp Tlv:[] SmppEncodingService:JamaaTech.Smpp.Net.Lib.SmppEncodingService
3: SubmitSm -- AllowedSource:ESME AllowedSession:Transmitter ProtocolID:0 PriorityFlag:Level0 ScheduleDeliveryTime: ValidityPeriod: ReplaceIfPresent:False SmDefaultMessageId:0 DestinationAddress:{Address:93700225375, Ton:International, Npi:ISDN} ServiceType: EsmClass:Default RegisteredDelivery:DeliveryReceipt DataCoding:UCS2 SourceAddress:{Address:512, Ton:International, Npi:ISDN} HasResponse:True Header:SubmitSm Tlv:[user_message_reference:100 ] SmppEncodingService:JamaaTech.Smpp.Net.Lib.SmppEncodingService
4: SubmitSmResp -- AllowedSource:SMSC AllowedSession:Transmitter MessageID: Header:SubmitSmResp Tlv:[] SmppEncodingService:JamaaTech.Smpp.Net.Lib.SmppEncodingService
5: EnquireLink -- AllowedSource:Any AllowedSession:Transceiver HasResponse:True Header:EnquireLink Tlv:[] SmppEncodingService:JamaaTech.Smpp.Net.Lib.SmppEncodingService
6: EnquireLinkResp -- AllowedSource:Any AllowedSession:Transceiver Header:EnquireLinkResp Tlv:[] SmppEncodingService:JamaaTech.Smpp.Net.Lib.SmppEncodingService
Can you give me more details, like
Thanks Adham for taking the time. The exception that I am getting is this:
An unhandled exception occurred while processing the request.
SmppException: Exception of type 'JamaaTech.Smpp.Net.Lib.SmppException' was thrown.
JamaaTech.Smpp.Net.Client.SmppClient.SendMessage(ShortMessage message, int timeOut) in SmppClient.cs, line 186
Currently I am using the version 1.5.6 of the library. Below screenshots are Wireshark capture of the request and response. The wireshark shows the request as a malformed packet.
private static void client_MessageDelivered(object sender, MessageEventArgs e) { var client = (SmppClient)sender; //Console.WriteLine("SMPP client {0} Message Delivered to: {1}", client.Name, e.ShortMessage.DestinationAddress); Console.WriteLine("SMPP client {0} - Message Delivered: MessageId is : {1},UserMessageReference {2} ",
client.Name, e.ShortMessage.ReceiptedMessageId, e.ShortMessage.UserMessageReference);
}
e.ShortMessage.ReceiptedMessageId and e.ShortMessage.UserMessageReference return empty value in MessageDelivered event
while debug I seen PduReceivedEventHander set empty value to this fields
message.ReceiptedMessageId = pdu.GetOptionalParamString(Tag.receipted_message_id); message.UserMessageReference = pdu.GetOptionalParamString(Tag.user_message_reference);
I think this is from Wireshrak, I tried it with my client and I noted that: Wireshrak try to figure another TLV paramater (additional to user_message_reference
) and actually there is only one. The process succeeded without any error.
This parameter is partially from user_message_reference
, I have no idea why Wireshark behave like that.
Thank you for valuable time. Is there any other idea to store user_message_reference value with message delivery status in Database
Hi @shridhartpatil , you are welcome. This depends on your application. In my case I'm using this:
1 - Save message to DB using EF with state Queued
.
2 - Use generated ID
from DB to user_message_reference
and Send sms.
3 - Update state to Sent
when success or DELAY RETRY with Polly.
4 - Update state to Delivered
when received client_MessageDelivered
Yes I need to update state Delivered using user_message_reference but in client_MessageDelivered I get user_message_reference value empty
Thanks Adham
I as well getting same error of 'Invalid parameter length'..I am using Jamaa Library 1.5.3 and using below code for sending SMS ... TextMessage msg = new TextMessage { DestinationAddress = smsDetails.ToMobile, SourceAddress = smppConfig.SourceAddress, Text = smsDetails.Message, RegisterDeliveryNotification = true, //UserMessageReference = smsDetails.RequestId.ToString() }; clientSMPP.SendMessage(msg); Here I commented User MessageReference as Service Provider doesn't support TLV ...When we send few Messages , SMS getting delivered successfully but when we send messages continuously around 10 nos./sec, Service Provider receives below error .... Invalid parameter length:[105] max:[20] safe_value:[ABC FAILURE ALERT(Ge] ' Invalid parameter length:[102] max:[16] safe_value:[ FAILURE ALERT(G]
Kindly let me know what could be reason for this error ...................
Whenever I set the
UserMessageReference
I receive an Invalid Parameter Length exception. It doesn't matter which version of the library I am using or which telecom operator I am connecting to. I have tried this with 3 telecom operators and in all of them I receive this error. I also tried to change the format of theUserMessageReference
but It also doesn't make any difference.Here is the raw capture of the TCP stream of Submit_SM command.