h1. Debug SMPP protocol in Asterisk Let's suppose, you want to see which SMPP messages come from user _user001_ and which responses are sent back. For this perform next actions: 1. [[How to acquire root access|Acquire _root_ access]]. 2. Turn on SMPP debug for user _user001_:
# asterisk -rx "smpp set debug peer user001"
To capture this way Asterisk should know IP address of a user. Thus, user should be either registered, or user's IP address should be configured in user's settings. In case if you know IP address of a user, but don't know, under which peer it's registered/configured, you can capture dump, using IP address:
# asterisk -rx "smpp set debug ip 192.168.1.1"
In case if you need to debug all SMPP messages (and not from/to specific peer/IP address), execute following:
# asterisk -rx "smpp set debug on"
3. You can watch results either in Asterisk console or in log file. Asterisk console is convenient to use to quickly check if any messages come from client. However console doesn't allow to perform text search. Log file is convenient to use, if you wish to perform search inside of big amount of messages. Also file is more convenient to use, if you use SMPP debugging together with [[Debug Asterisk|Asterisk debugging]] * *Asterisk console* Enter console mode:
  # asterisk -r
  
After this you'll see SMPP messages arriving on the console. *Warning!* Messages amount could be big and might hang your terminal application. Use search in log file in this case. * *log file* Perform search for IP address of a client, or time, or message type, for example, SUBMIT_SM, in file /var/log/asterisk/messages. Then check if there any error messages after receiving the message and if the response is sent. Principle of working with log files is described in section [[How to work with log file]] 4. To prevent from disk space overflow turn off debugging once you've finished:
# asterisk -rx "smpp set debug off"
[[Отладка SMPP протокола в Asterisk|Русский перевод]]