How can I give SourceAddress.Npi and DestinationAddress.Npi

Jul 30, 2013 at 4:54 PM
I was given the below 4 properties by the sms gateway provider.
  1. DestinationAddress.Npi
  2. DestinationAddress.Ton
  3. SourceAddress.Npi
  4. SourceAddress.Ton
    Only the AddressNpi & AddressTon properites are shown in the SmppConnectionProperties .How do I add the above properties to the SmppConnectionProperties so that I can use the SmppClient to send and recieve sms.
Aug 20, 2013 at 6:33 AM
Hello niroshana1234..


This method is available in TextMessage.cs Class

protected override IEnumerable<SendSmPDU> GetPDUs(DataCoding defaultEncoding)
    {

        int maxLength = GetMaxMessageLength(defaultEncoding, false);
        byte[] bytes = SMPPEncodingUtil.GetBytesFromString(vText, defaultEncoding);
        Check message size
       if (bytes.Length > maxLength)
        {
            throw new InvalidOperationException(string.Format(
                "Encoding '{0}' does not support messages of length greater than '{1}' charactors",
               defaultEncoding, maxLength));
        }
        SubmitSm sm = new SubmitSm();
        sm.SetMessageBytes(bytes);
        sm.SourceAddress.Address = vSourceAddress;
        sm.DestinationAddress.Address = vDestinatinoAddress;
        sm.DestinationAddress.Npi = // here you can set Destination Npi.
        sm.DestinationAddress.Ton = // here you can set Destination Ton
        sm.DataCoding = defaultEncoding;
        if (vRegisterDeliveryNotification) { sm.RegisteredDelivery = RegisteredDelivery.DeliveryReceipt; }
        yield return sm;


    }
Aug 20, 2013 at 3:29 PM
Thanks shaji499 . It's working perfectly.
I hope these issues will be fixed in the next release as we has to recompile the dlls.
Aug 27, 2013 at 9:08 AM
Welcome :)