Query NowSMS Server Status

Starting with the NowSMS 2008 release, an XML-based status query interface is available which 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 with line breaks added for improved 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>
<MMSCRouteStatus>
<Name>mm7test</Name>
<Status>OK</Status>
<MessagesToday>0</MessagesToday>
<MessagesLast7Days>5</MessagesLast7Days>
<MessagesLast30Days>5</MessagesLast30Days>
</MMSCRouteStatus>
<SMSOUTQ>92833</SMSOUTQ>
<SMSINQ>0</SMSINQ>
<SMSRCPTQ>0</SMSRCPTQ>
<MMSOUTQ>0</MMSOUTQ>
<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 the above information directly correlates to statistics that are displayed on the NowSMS configuration dialog.

An XSD file that describes the XML schema of the status query response is available at the following link:  https://nowsms.com/download/xmlstatus.xsd.txt

<?xml version="1.0" encoding="utf-8"?>

<xs:schema elementFormDefault="unqualified" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="NowSMSStatus">

    <xs:complexType>

      <xs:sequence>



        <xs:element name="SMSCStatus">

           <xs:complexType>

              <xs:sequence>

                 <xs:element name="Name" type="xs:string" />

                 <xs:element name="Status">

                    <xs:simpleType>

                       <xs:restriction base="xs:string">

                          <xs:enumeration value="OK" />

                          <xs:enumeration value="ERROR" />

                       </xs:restriction>

                    </xs:simpleType>

                 </xs:element>

                 <xs:element name="StatusDetail" type="xs:string" />

                 <xs:element name="MessagesToday" type="xs:integer" />

                 <xs:element name="MessagesLast7Days" type="xs:integer" />

                 <xs:element name="MessagesLast30Days" type="xs:integer" />

              </xs:sequence>

           </xs:complexType>

        </xs:element>



        <xs:element name="MMSCRouteStatus">

           <xs:complexType>

              <xs:sequence>

                 <xs:element name="Name" type="xs:string" />

                 <xs:element name="Status">

                    <xs:simpleType>

                       <xs:restriction base="xs:string">

                          <xs:enumeration value="OK" />

                          <xs:enumeration value="ERROR" />

                       </xs:restriction>

                    </xs:simpleType>

                 </xs:element>

                 <xs:element name="StatusDetail" type="xs:string" />

                 <xs:element name="MessagesToday" type="xs:integer" />

                 <xs:element name="MessagesLast7Days" type="xs:integer" />

                 <xs:element name="MessagesLast30Days" type="xs:integer" />

              </xs:sequence>

           </xs:complexType>

        </xs:element>



        <xs:element name="SMSOUTQ" type="xs:integer" />

        <xs:element name="SMSINQ" type="xs:integer" />

        <xs:element name="SMSRCPTQ" type="xs:integer" />

        <xs:element name="MMSOUTQ" type="xs:integer" />



        <xs:element name="SMSSubmitted">

           <xs:complexType>

              <xs:sequence>

                 <xs:element name="MessagesToday" type="xs:integer" />

                 <xs:element name="MessagesLast7Days" type="xs:integer" />

                 <xs:element name="MessagesLast30Days" type="xs:integer" />

              </xs:sequence>

           </xs:complexType>

        </xs:element>



        <xs:element name="SMSSent">

           <xs:complexType>

              <xs:sequence>

                 <xs:element name="MessagesToday" type="xs:integer" />

                 <xs:element name="MessagesLast7Days" type="xs:integer" />

                 <xs:element name="MessagesLast30Days" type="xs:integer" />

              </xs:sequence>

           </xs:complexType>

        </xs:element>



        <xs:element name="SMSReceived">

           <xs:complexType>

              <xs:sequence>

                 <xs:element name="MessagesToday" type="xs:integer" />

                 <xs:element name="MessagesLast7Days" type="xs:integer" />

                 <xs:element name="MessagesLast30Days" type="xs:integer" />

              </xs:sequence>

           </xs:complexType>

        </xs:element>



        <xs:element name="SMSFailed">

           <xs:complexType>

              <xs:sequence>

                 <xs:element name="MessagesToday" type="xs:integer" />

                 <xs:element name="MessagesLast7Days" type="xs:integer" />

                 <xs:element name="MessagesLast30Days" type="xs:integer" />

              </xs:sequence>

           </xs:complexType>

        </xs:element>



        <xs:element name="SMSRetried">

           <xs:complexType>

              <xs:sequence>

                 <xs:element name="MessagesToday" type="xs:integer" />

                 <xs:element name="MessagesLast7Days" type="xs:integer" />

                 <xs:element name="MessagesLast30Days" type="xs:integer" />

              </xs:sequence>

           </xs:complexType>

        </xs:element>



        <xs:element name="MMSProcessedUser">

           <xs:complexType>

              <xs:sequence>

                 <xs:element name="MessagesToday" type="xs:integer" />

                 <xs:element name="MessagesLast7Days" type="xs:integer" />

                 <xs:element name="MessagesLast30Days" type="xs:integer" />

              </xs:sequence>

           </xs:complexType>

        </xs:element>



        <xs:element name="MMSProcessedVASP">

           <xs:complexType>

              <xs:sequence>

                 <xs:element name="MessagesToday" type="xs:integer" />

                 <xs:element name="MessagesLast7Days" type="xs:integer" />

                 <xs:element name="MessagesLast30Days" type="xs:integer" />

              </xs:sequence>

           </xs:complexType>

        </xs:element>



        <xs:element name="MMSSentMMSC">

           <xs:complexType>

              <xs:sequence>

                 <xs:element name="MessagesToday" type="xs:integer" />

                 <xs:element name="MessagesLast7Days" type="xs:integer" />

                 <xs:element name="MessagesLast30Days" type="xs:integer" />

              </xs:sequence>

           </xs:complexType>

        </xs:element>



        <xs:element name="MMSSentVASP">

           <xs:complexType>

              <xs:sequence>

                 <xs:element name="MessagesToday" type="xs:integer" />

                 <xs:element name="MessagesLast7Days" type="xs:integer" />

                 <xs:element name="MessagesLast30Days" type="xs:integer" />

              </xs:sequence>

           </xs:complexType>

        </xs:element>



        <xs:element name="MMSRetrieved">

           <xs:complexType>

              <xs:sequence>

                 <xs:element name="MessagesToday" type="xs:integer" />

                 <xs:element name="MessagesLast7Days" type="xs:integer" />

                 <xs:element name="MessagesLast30Days" type="xs:integer" />

              </xs:sequence>

           </xs:complexType>

        </xs:element>



        <xs:element name="SMPPClientList">

           <xs:complexType>

              <xs:sequence>

                 <xs:element name="ActiveConnectionCount" type="xs:integer" />

                 <xs:element name="ActiveConnection">

                    <xs:element name="Name" type="xs:string" />

                    <xs:element name="ConnectionType">

                       <xs:simpleType>

                          <xs:restriction base="xs:string">

                             <xs:enumeration value="S" />

                             <xs:enumeration value="R" />

                             <xs:enumeration value="T" />

                          </xs:restriction>

                       </xs:simpleType>

                    </xs:element>

                    <xs:element name="IPAddress" type="xs:string" />

                 </xs:element>

              </xs:sequence>

           </xs:complexType>

        </xs:element>



      </xs:sequence>

    </xs:complexType>

  </xs:element>

</xs:schema>