XML Status Query for SMSC Connection Status and Statistics

Posted by on Feb 16, 2009 in Support Blog

Topic Keywords: , ,

NowSMS 2008 added an XML-based status query interface that reports information similar to what is reported on the “Status” page of the NowSMS configuration dialog. The query results include information about SMSC connection status, the number of messages processed via the different connections, and the number of messages pending in the queues, among other information.

The XML-based status interface can be accessed on the web port of the SMS gateway using a URL of “/ADMIN/XMLSTATUS” (not case sensitive). To enable access to this interface, “Enable Web Account Administration” must be enabled on the “Web” tab of the NowSMS administrative interface. The Admin User Name and Password can either be sent in an HTTP “Authorization:” header, or using “&User=username&Password=password” in the URL request.

(Note: The “Enable Web Account Administration” option has been removed in newer versions of NowSMS. Instead of a system-wide admin account, admin access can be enabled for SMS user accounts. Any SMS user account configured with “Enable Admin Access” can be used to initiate this query.)

An example will help better illustrate the information that is available.

Connect to the NowSMS server with the following URL: http://127.0.0.1:8800/admin/xmlstatus?user=adminuser&password=adminpass Substitute in your appropriate IP address and port … and the appropriate “adminuser” and “adminpass” values. The XML formatted information is quite readable, so a good way to get started is to make the request to your own NowSMS server via a web browser to see what information is returned.

Here’s an example of the XML response from one of our testing servers (I’ve added some line breaks for readability):

<NowSMSStatus>

<SMSCStatus>
<Name>SMPP – xps5:9000</Name>
<Status>OK</Status>
<MessagesToday>44640</MessagesToday>
<MessagesLast7Days>44640</MessagesLast7Days>
<MessagesLast30Days>44640</MessagesLast30Days>
</SMSCStatus>

<SMSCStatus>
<Name>SMPP – xps5:9001</Name>
<Status>OK</Status>
<MessagesToday>43369</MessagesToday>
<MessagesLast7Days>43369</MessagesLast7Days>
<MessagesLast30Days>43369</MessagesLast30Days>
</SMSCStatus>

<SMSCStatus>
<Name>SMPP – xps5#2:9000</Name>
<Status>OK</Status>
<MessagesToday>45308</MessagesToday>
<MessagesLast7Days>45308</MessagesLast7Days>
<MessagesLast30Days>45308</MessagesLast30Days>
</SMSCStatus>

<SMSCStatus>
<Name>SMPP – xps5#2:9001</Name>
<Status>OK</Status>
<MessagesToday>48856</MessagesToday>
<MessagesLast7Days>48856</MessagesLast7Days>
<MessagesLast30Days>48856</MessagesLast30Days>
</SMSCStatus>

<SMSOUTQ>92833</SMSOUTQ>
<SMSINQ>0</SMSINQ>
<SMSRCPTQ>0</SMSRCPTQ>

<SMSSubmitted>
<MessagesToday>275006</MessagesToday>
<MessagesLast7Days>275006</MessagesLast7Days>
<MessagesLast30Days>275006</MessagesLast30Days>
</SMSSubmitted>

<SMSSent>
<MessagesToday>182173</MessagesToday>
<MessagesLast7Days>182173</MessagesLast7Days>
<MessagesLast30Days>182173</MessagesLast30Days>
</SMSSent>

<SMSReceived>
<MessagesToday>73786</MessagesToday>
<MessagesLast7Days>73786</MessagesLast7Days>
<MessagesLast30Days>73786</MessagesLast30Days>
</SMSReceived>

<SMSFailed>
<MessagesToday>0</MessagesToday>
<MessagesLast7Days>0</MessagesLast7Days>
<MessagesLast30Days>0</MessagesLast30Days>
</SMSFailed>

<SMSRetried>
<MessagesToday>0</MessagesToday>
<MessagesLast7Days>0</MessagesLast7Days>
<MessagesLast30Days>0</MessagesLast30Days>
</SMSRetried>

<MMSProcessedUser>
<MessagesToday>0</MessagesToday>
<MessagesLast7Days>0</MessagesLast7Days>
<MessagesLast30Days>0</MessagesLast30Days>
</MMSProcessedUser>

<MMSProcessedVASP>
<MessagesToday>0</MessagesToday>
<MessagesLast7Days>0</MessagesLast7Days>
<MessagesLast30Days>0</MessagesLast30Days>
</MMSProcessedVASP>

<MMSSentMMSC>
<MessagesToday>0</MessagesToday>
<MessagesLast7Days>0</MessagesLast7Days>
<MessagesLast30Days>0</MessagesLast30Days>
</MMSSentMMSC>

<MMSSentVASP>
<MessagesToday>0</MessagesToday>
<MessagesLast7Days>0</MessagesLast7Days> <MessagesLast30Days>0</MessagesLast30Days>
</MMSSentVASP>

<MMSRetrieved>
<MessagesToday>0</MessagesToday>
<MessagesLast7Days>0</MessagesLast7Days>
<MessagesLast30Days>0</MessagesLast30Days>
</MMSRetrieved>

<SMPPClientList>

<ActiveConnectionCount>2</ActiveConnectionCount>
<ActiveConnection>
<Name>micro</Name>
<ConnectionType>S</ConnectionType>
<IPAddress >192.168.1.114</IPAddress>
</ActiveConnection>

<ActiveConnection>
<Name>micro</Name>
<ConnectionType>R</ConnectionType>
<IPAddress >192.168.1.114</IPAddress>
</ActiveConnection>

</SMPPClientList>

</NowSMSStatus>

Most of this information directly correlates to statistics that are displayed on the NowSMS configuration dialog.

For comments and further discussion, please click here to visit the NowSMS Technical Forums (Discussion Board)...

2 Responses to “XML Status Query for SMSC Connection Status and Statistics”

  1. Brett Warthen says:

    Additional information regarding this interface was posted in another article:

    http://blog.nowsms.com/2010/02/xml-status-query-for-smsc-connection.html

  2. From the discussion board …

    Here’s a useful tip on how to parse individual elements from the XML status query:

    https://nowsms.com/discus/messages/1/60149.html

    The script in this example retrieves the size of the outbound SMS message queue.