I use Inetlab.SMPP 2.8.1 (by licence reason) to implement an SMPP gateway. SMS message with long text must be split into small parts. Therefore I follow the article and use a MessageComposer
instance to combine concatenated messages:
private void OnClientSubmitSm(object sender, SmppServerClient client, SubmitSm pdu)
{
_composer.AddMessage(pdu);
if (_composer.IsLastSegment(pdu))
{
string fullMessage = _composer.GetFullMessage(pdu);
// do something
}
}
where _composer
is a MessageComposer
.
But the code produces the following error:
System.ArgumentNullException: Value cannot be null. (Parameter 'key')
at System.Collections.Concurrent.ConcurrentDictionary`2.ThrowKeyNullException()
at System.Collections.Concurrent.ConcurrentDictionary`2.TryGetValue(TKey key, TValue& value)
at Inetlab.SMPP.Common.DefaultComposerItemStore.TryGet(String key, ComposerItem& item)
at Inetlab.SMPP.Common.MessageComposer.IsLastSegment[TSmppMessage](TSmppMessage message)
Note, the similar code works well for evDeliverSm
event. But it doesn't want to handle incoming submit_sm
PDUs.
What I do wrong? And what do I must to do to get expected result?