DeliverSm, DeliverSmComplete and DataSm events not firing.

.NET library for SMPP protocol
Locked
tyagi2k
Posts: 2
Joined: Tue Apr 30, 2013 8:19 am

DeliverSm, DeliverSmComplete and DataSm events not firing.

Post by tyagi2k » Tue Apr 30, 2013 11:27 am

Unable to get delivery report because any of the event(DeliverSm, DeliverSmComplete and DataSm) is not firing. Following is the code, please check and let me know where I am wrong.


client.Connect("182.156.191.75", 9081);

client.evDeliverSm += new Inetlab.SMPP.Common.DeliverSmEventHandler(client_evDeliverSm);
client.evDeliverSmComplete += new Inetlab.SMPP.Common.DeliverSmEventHandler(client_evDeliverSmComplete);
client.evDataSm += new Inetlab.SMPP.Common.DataSmEventHandler(client_evDataSm);


if (client.Status == Inetlab.SMPP.Common.ConnectionStatus.Open)
{
client.Bind("mobiquest", "mobi123", Inetlab.SMPP.Common.ConnectionMode.Transceiver);
if (client.Status == Inetlab.SMPP.Common.ConnectionStatus.Bound)
{
List<SubmitSm> req = client.PrepareSubmit(Inetlab.SMPP.Common.SubmitMode.ShortMessage, byte.Parse("5"), byte.Parse("9"), "MQUEST", byte.Parse("1"), byte.Parse("1"), "919891331123", DataCodings.Default, "Hi This is test message.");

foreach (SubmitSm sm in req)
{
sm.RegisteredDelivery = 1;
}


List<SubmitSmResp> respList = client.Submit(req);


if (respList.Count > 0 && respList[0].Status == Inetlab.SMPP.Common.CommandStatus.ESME_ROK)
{
foreach (SubmitSmResp resp in respList)
{
objCreateLogFiles.UpdateLog("SMS sent: RowId-->" + strRowId + " Mobile-->" + strMobileNo + " MessageId-->" + resp.MessageId + " Status-->" + resp.Status + " Sequence-->" + resp.Sequence);
}

}
else
{
objCreateLogFiles.UpdateLog("message count 0");
}

objCreateLogFiles.UpdateLog("---------------------------------------------------------------------------");
}

client.UnBind();
}
else
objCreateLogFiles.UpdateLog("Connection status unbound.");
client.Disconnect();
}




private void client_evDataSm(object sender, Inetlab.SMPP.PDU.DataSm data)
{
string messageText = data.Client.GetMessageText(data.UserDataPdu.ShortMessage, data.DataCoding);
}



private void client_evDeliverSm(object sender, Inetlab.SMPP.PDU.DeliverSm data)
{
string messageText = data.Client.GetMessageText(data.UserDataPdu.ShortMessage, data.DataCoding);
}


private void client_evDeliverSmComplete(object sender, Inetlab.SMPP.PDU.DeliverSm data)
{
string messageText = data.Client.GetMessageText(data.UserDataPdu.ShortMessage, data.DataCoding);
}
tyagi2k
Posts: 2
Joined: Tue Apr 30, 2013 8:19 am

Re: DeliverSm, DeliverSmComplete and DataSm events not firin

Post by tyagi2k » Wed May 01, 2013 7:19 am

Please reply, its very urgent for me.

Is there any way to get delivery report in end of the day by the filter of source address or date or both? Means I want to send sms by one application and get delivery report by another application.
alt
Site Admin
Posts: 918
Joined: Tue Apr 25, 2006 9:45 am

Re: DeliverSm, DeliverSmComplete and DataSm events not firin

Post by alt » Fri May 03, 2013 7:32 pm

If you use same SMPP account in several applications you must bind only one application in ConnectionMode = Receiver or Transceiver.
And other applications should bind with Transmitter mode. Otherwise SMPP server can send delivery receipt to any application where you don't expect it.
Locked