Page 1 of 1

check user information when binding

Posted: Sun Nov 25, 2012 9:43 am
by mobilyws
Dear ALT,

hope you are doing well,,

currently i want to develop an smpp server that accepts connections from customer,
i want to know how i can return to the customer that your user name is wrong or your password is long

and just check the information server_evbind or there is another event

best regards

Re: check user information when binding

Posted: Tue Nov 27, 2012 10:53 am
by alt
Following code shows how you can return non-OK status to client.

Code: Select all

_server.evClientBind += server_evClientBind;

private void server_evClientBind(object sender, Inetlab.SMPP.Common.SmppServerClient client, Inetlab.SMPP.PDU.Bind data)
{

   data.Response.ChangeSystemId("My SMPP Server");

  //Check SMPP access, and if it is wrong retund Bind Failed.
   if (data.SystemId == "")
   {
         data.Response.Status = CommandStatus.ESME_RINVSYSID; 
         return;
   }
   if (data.Password == "")
   {
        data.Response.Status = CommandStatus.ESME_RINVPASWD; 
        return;
   }
}
Also you can use another statuses such as ESME_RALYBND, ESME_RBINDFAIL