Binding to the SMPP Server as TX

Jan 28, 2012 at 10:32 AM

Hi everyone.

I'm having problems in binding the Jamaa client to the SMPP server as TX, it seems that when the connection is stablished, for some reason the client get the bind as RX, but never as a TX.

Is there a way to force or to specify the type of binding?

So far I was following the examples o the documentation page.

 

I've attached below a piece of log from the smpp server at the moment that it receives my sms.

2012-01-27 12:34:32,982 DEBUG [gateway:gateway] SMSCSession got request (bindreq: (pdu: 38 9 0 1) kkkk1 cccc1 smpp 52 (addrrang: 2 1 ) )
2012-01-27 12:34:32,982 DEBUG [gateway:gateway] [MAS - MyProcessor]    Receiving Client Request: null <- (bindreq: (pdu: 38 9 0 1) kkkk1 cccc1 smpp 52 (addrrang: 2 1 ) )
2012-01-27 12:34:32,982 DEBUG [gateway:gateway] [MAS - MyProcessor]    Checking identity 'kkkk1/cccc1'
2012-01-27 12:34:32,983 DEBUG [gateway:gateway] [MAS - MyProcessor]    Server Response: kkkk1_r -> (bindresp: (pdu: 0 80000009 0 1) MAS SMSC 4.3.1)
2012-01-27 12:34:33,866 DEBUG [gateway:gateway] [MAS - MyProcessor]    Receiving Client Request: kkkk1_r <- (submit: (pdu: 68 4 0 2) (addr: 1 1 80811)  (addr: 1 1 3534183272)  (sm: msg: JA enviar SMS test 1 msg_hex: 4a 41 20 65 6e 76 69 61 72 20 53 4d 53 20 74 65 73 74 20 31)  (opt: ) )
2012-01-27 12:34:33,866 DEBUG canSendMessage sysId=kkkk1_r, origin=80811, valid=*
2012-01-27 12:34:33,866 DEBUG [gateway:gateway] [MAS - MyProcessor]    SubmitSM to kkkk1_r
2012-01-27 12:34:33,866 DEBUG [gateway:gateway] [MAS - MyProcessor]    Server Response: kkkk1_r -> (submit_resp: (pdu: 0 80000004 0 2) 4b4fd736 )
2012-01-27 12:34:34,628 DEBUG [gateway:SMPPFilter] Running filter for SMPP Userkkkk1_r
2012-01-27 12:34:34,628 ERROR [gateway:SMPPFilter] No defined transmitter for SMPP User kkkk1_r. Message to 3534183272 rejected
2012-01-27 12:34:37,408  INFO [gateway:gateway] kkkk1_r: Active
tail: `system.log' has been replaced;  following end of new file
2012-01-27 12:34:53,125 DEBUG [gateway:gateway] [MAS - MyProcessor]    Receiving Client Request: kkkk1_r <- (enquirelink: (pdu: 16 15 0 3) )
2012-01-27 12:34:53,125 DEBUG [gateway:gateway] [MAS - MyProcessor]    Server Response: kkkk1_r -> (enquirelink_resp: (pdu: 0 80000015 0 3) )
tail: `system.log' has been replaced;  following end of new file
2012-01-27 12:35:13,124 DEBUG [gateway:gateway] [MAS - MyProcessor]    Receiving Client Request: kkkk1_r <- (enquirelink: (pdu: 16 15 0 4) )
2012-01-27 12:35:13,124 DEBUG [gateway:gateway] [MAS - MyProcessor]    Server Response: kkkk1_r -> (enquirelink_resp: (pdu: 0 80000015 0 4) )
tail: `system.log' has been replaced;  following end of new file 


Coordinator
Jan 29, 2012 at 6:45 AM

I am not so sure what could be causing this. Are you using SMPP 3.3?

Jan 30, 2012 at 10:30 AM

yep, the smpp version is 3.4, but for some reason, it won't bind a session as TX and RX, but I made it work by starting a session for TX only; here is the snippet of code used.

//start client
SmppClient mmclient = new SmppClient(); // init he client

                SmppConnectionProperties properties = mmclient.Properties;
                properties.SystemType = "smpp";
                properties.DefaultServiceType = "smpp";
                properties.AddressNpi = JamaaTech.Smpp.Net.Lib.NumberingPlanIndicator.ISDN;//1
                properties.AddressTon = JamaaTech.Smpp.Net.Lib.TypeOfNumber.National;//2
                properties.DefaultEncoding = JamaaTech.Smpp.Net.Lib.DataCoding.SMSCDefault;
                properties.InterfaceVersion = JamaaTech.Smpp.Net.Lib.InterfaceVersion.v34;
                properties.SystemID = systemid;
                properties.Password = pwd;
                properties.Port = port; //IP port to use
                properties.Host = host; //SMSC host name or IP Address
                properties.SourceAddress = marcacion;

                mmclient.Start();
                
//bind the session
 int timeOut = 20000;
                    //sesion TX
                    SmppClientSession vTrans = null;
                    SessionBindInfo bindInfo = new SessionBindInfo();
                    bindInfo.AllowReceive = false;
                    bindInfo.AllowTransmit = true;
                    bindInfo.AddressNpi = NumberingPlanIndicator.ISDN;
                    bindInfo.AddressTon = TypeOfNumber.National;
                    bindInfo.InterfaceVersion = InterfaceVersion.v34;
                    bindInfo.Password = pwd;
                    bindInfo.Port = port;
                    bindInfo.ServerName = host;
                    bindInfo.SystemID = systemid;
                    bindInfo.SystemType = "smpp";
                    vTrans = SmppClientSession.Bind(bindInfo, timeOut);
                    Console.WriteLine("***** se abrio sesion TX *****");
//send SMS
DateTime start = DateTime.Now;
                        SubmitSm mSubmitSM = new SubmitSm(); // init the submitsm method
                        //Populate SubmitSm properties as required
                        mSubmitSM.SourceAddress.Address = "80XXX"; // alphanumeric sender
                        mSubmitSM.DestinationAddress.Address = "3535555272"; // destination MSISDN
                        mSubmitSM.DestinationAddress.Npi = NumberingPlanIndicator.ISDN; // destionation NPI
                        mSubmitSM.DestinationAddress.Ton = TypeOfNumber.National; // destionation TON
                        mSubmitSM.SourceAddress.Npi = NumberingPlanIndicator.Unknown; // source NPI
                        mSubmitSM.SourceAddress.Ton = TypeOfNumber.National; // and here the important setting: TON - 5 (alphanumeric) - works for me :-)
                        mSubmitSM.EsmClass = EsmClass.Default; // esm class
                        mSubmitSM.RegisteredDelivery = RegisteredDelivery.DeliveryReceipt; //reg_del to 1
                        mSubmitSM.ServiceType = "CMT"; // service type cellular messaging, - not mandatory to set, you can leave it
                        mSubmitSM.SetMessageText("test send  " , DataCoding.SMSCDefault); // send msg - all OK, message
                        ResponsePDU resp = vTrans.SendPdu(mSubmitSM);

Coordinator
Jan 30, 2012 at 10:56 AM

javalis,

You can only use one library at the same time. What you are doing here is using two separate libraries which ultimately creates two different sessions.

Please go through our documentation where everything is explained.

I recommend you use the wrapper library which is easier to use and well tested. The low level library has not be documented here an requires good background knowledge of the SMPP protocol.

The SmppClient is a wrapper class around the core libraries. You can either choose to use the wrapper class or the low level core classes at a time. If you want to use the wrapper class and still have access to the low level features, we suggest you download the source code and add your own custom methods that gives you access to the instances of the wrapped classes.

Ben

Jan 31, 2012 at 8:30 PM

yep, U R absolutely right!!

My confusion during the tests was actually due to a limitation of the provider, whose SMPP server has the limitation that even though it is using smpp 3.4 it requires to stablish different sessions for TX and RX, therefore I've modified the SmppClient wrapper by forcing the bool param to TRUE when invoking the following method.

private void OpenSession(SessionBindInfo bindInfo, bool useSeparateConnections, int

timeOut) 

 

thanks a lot for your promt response.

 

Coordinator
Feb 1, 2012 at 4:28 AM

javalis,

You are welcome. Let me know if there is anything else I can help you with.

Have you considered rating our library?

Mar 18, 2015 at 11:31 AM
Edited Mar 18, 2015 at 11:47 AM
Please help me in this regard.

i am using jamaa smpp client which sends and receives SMS and i have set thread which executes the code every 10 sec save to the database.
but i am receiving duplicate of single sms untile the sms is expired on the server.
what to do to remove this problem from the system. with following code.

TextMessage msg = e.ShortMessage as TextMessage;
db_Connection.Msavesms(msg.Text;);


thanks cooperation.
Mar 18, 2015 at 11:37 AM
Edited Mar 18, 2015 at 11:47 AM
Please help me in this regard.

i am using jamaa smpp client which sends and receives SMS and i have set thread which executes the code every 10 sec save to the database.
but i am receiving duplicate of single sms untile the sms is expired on the server.
what to do to remove this problem from the system. with following code.

TextMessage msg = e.ShortMessage as TextMessage;
db_Connection.Msavesms(msg.Text;);


thanks cooperation.
Mar 18, 2015 at 11:46 AM
Please help me in this regard.

i am using jamaa smpp client which sends and receives SMS and i have set thread which executes the code every 10 sec save to the database.
but i am receiving duplicate of single sms untile the sms is expired on the server.
what to do to remove this problem from the system. with following code.

TextMessage msg = e.ShortMessage as TextMessage;
db_Connection.Msavesms(msg.Text;);


thanks cooperation.