I think i need to pass the SMSC variable , how do I do this in XML POST?
On Monday, December 1, 2014 4:50 PM, michael osakede <[email protected]>
wrote:
Thanks
Now i get "Not routable. Do not try again."
Can you share your send-sms config?
Regards,Michael
On Monday, December 1, 2014 4:34 PM, Tapan Kumar Thapa
<[email protected]> wrote:
Here is the one to many working example.
<?php
$url = http://xxxx:13013/cgi-bin/sendsms';
$xml = '<?xml version="1.0"?>
<message>
<submit>
<da><number>919871701375</number></da>
<da><number>919871701375</number></da>
<da><number>919871701375</number></da>
<da><number>919871701375</number></da>
<from>
<username>xxx</username>
<password>xxx</password>
</from>
</submit>
</message>';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_POSTFIELDS, $xml);
$result = curl_exec($curl);
//$info = curl_getinfo($curl);
curl_close($curl);
echo $result;
On Mon, Dec 1, 2014 at 8:44 PM, michael osakede <[email protected]> wrote:
Hello All,
I keep getting "Authorization failed for sendsms".
My Send SMS config#---------------------------------------------# SEND-SMS
USERS## These users are used when Kannel smsbox sendsms interface is used to#
send PUSH sms messages, i.e. calling URL like#
http://kannel.machine:13013/cgi-bin/sendsms?username=tester&password=foobar...
group = sendsms-userusername = testerpassword = foobardlr-url =
"http://localhost/dlr.php?action=recvdlr&originator=%p&destination=%P&message=%a&dlrvalue=%d×tamp=%t&smscid=%i&operator=%o&billing=%O"omit-empty
= truemax-messages = 1000
My PHP Code:<?php
$xml = '<?xml version="1.0" encoding="UTF-8"?><message> <submit>
<da><number>2348098009386</number></da>
<oa><number>747</number></oa> <ud>Test Message</ud>
<statusrequest> <dlr-mask>31</dlr-mask>
<dlr-url>
http://127.0.0.1/delivery-report.php?send_history_id=13853217&to_number=91XXXXXXXXXX&type=%d
</dlr-url> </statusrequest>
<from> <username>tester</user>
<password>foobar</password> <account>precin</account>
<smsc-id>precin</smsc-id>
<binfo>MO</binfo> </form> <to>precin</to>
</submit></message>';
//echo $xml;$xml=urlencode($xml);$url =
"http://localhost:13013/cgi-bin/sendsms";
$username="tester";$password="foobar";
$ch = curl_init($url);curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch,
CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));curl_setopt($ch,
CURLOPT_USERPWD, "$username:$password");curl_setopt($ch, CURLOPT_POSTFIELDS,
"$xml");curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);$output =
curl_exec($ch);curl_close($ch);echo $output."RES";?>
Any idea what could be wrong?