I am using jamaa-smpp
to send message. It works but the sender id was 00000 instead of the name that I wanted. I put the TON
and NPI
for enabling alphanumeric sender in the submit sm as shown in the code below but it still is 00000. I can't link the sm to the client when sending message.
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void ss_Click(object sender, EventArgs e)
{
var sm = new SubmitSm();
sm.SourceAddress.Ton = JamaaTech.Smpp.Net.Lib.TypeOfNumber.Aphanumeric;
sm.SourceAddress.Npi = JamaaTech.Smpp.Net.Lib.NumberingPlanIndicator.ISDN;
sm.DestinationAddress.Ton = JamaaTech.Smpp.Net.Lib.TypeOfNumber.International;
sm.DestinationAddress.Npi = JamaaTech.Smpp.Net.Lib.NumberingPlanIndicator.ISDN;
TextMessage msg = new TextMessage();
msg.DestinationAddress ="96565565655556"; //Receipient number
msg.SourceAddress = "NYCOMPANYNAME"; //Originating number
msg.Text = "text text text text";
msg.RegisterDeliveryNotification = true; //I want delivery notification for this message
SmppClient client = GetSmppClient();
client.BeginSendMessage(msg, SendMessageCompleteCallback, client);
}
private void client_ConnectionStateChanged(object sender, ConnectionStateChangedEventArgs e)
{
switch (e.CurrentState)
{
case SmppConnectionState.Closed:
//Connection to the remote server is lost
//Do something here
e.ReconnectInteval = 60000; //Try to reconnect after 1 min
break;
case SmppConnectionState.Connected:
//A successful connection has been established
break;
case SmppConnectionState.Connecting:
//A connection attemp is still on progress
break;
}
}
private SmppClient GetSmppClient()
{
SmppClient client = new SmppClient();
System.Threading.Thread.Sleep(9000);
SmppConnectionProperties properties = client.Properties;
properties.SystemID = "id";
properties.Password = "pass";
properties.Port = xxxxx; //IP port to use
properties.Host = "x.x.x.x"; //SMSC host name or IP Address
properties.SystemType = "SMPP";
properties.DefaultServiceType = "SMPP";
client.AutoReconnectDelay = 3000;
client.KeepAliveInterval = 15000;
client.Start();
System.Threading.Thread.Sleep(9000);
return client;
}
private static void SendMessageCompleteCallback(IAsyncResult result)
{
try
{
SmppClient client = (SmppClient)result.AsyncState;
client.EndSendMessage(result);
}
catch (Exception e)
{
}
}
}
I expect the sender name to be MYCOMPANYNAME instead of 00000000.