XML Statistics for individual SMSC Connection | Search |
NowSMS Support Forums ⬆ NowSMS Support - SMS Issues ⬆ Archive through May 19, 2016 ⬆ |
◄ ► |
Author | Message | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 5428 Registered: 08-2008 |
From the support mailbox...
This question references the PHP example at http://www.nowsms.com/nowsms-status-query-with-php And the XML status query interface described at http://www.nowsms.com/xml-status-query-for-smsc-connection-status-and-statistics The PHP example loads the current status via HTTP into a simple XML element with the following two lines of code: $xmldata = file_get_contents ("http://127.0.0.1:8800/admin/xmlstatus?user=adminuser&password=adminpass"); Once loaded, various statistics can be easily extracted from the XML. For example, to retrieve the number of SMS messages sent today, the following syntax can be used: $xml->SMSSent->MessagesToday Statistics are also available for each SMSC and MMS connection. In the XML, each SMSC connection has a separate <SMSCStatus> element, like this: <SMSCStatus> To retrieve the statistics for an individual connection, it is necessary to iterate through the XML using the foreach directive. The following is a simple example that outputs total messages sent today, then outputs the number of messages sent by each connection: echo "SMS Sent Today = " . $xml->SMSSent->MessagesToday . "<br/>\r\n"; -- Des NowSMS Support |