Curl and Sending query string to SMPP server 
November 15th, 2008, 03:45 AM
| | |
Hi,
I am trying to send some querysting using cURL. This is the working
API http://smpp4.routesms.com:8080/bulks...ge=testmessage.
The infomation given by Routesms.com:
Port: 2345
Server: SMPPHTTP
This is my code:
$ch = curl_init();
$url = "http://smpp4.routesms.com:8080/bulksms/bulksms?
username=xxxxxx&password=xxxxxxx&type=0&dlr=0&dest ination=94xxxxxxxxx&source=testing&message=testmes sage";
curl_setopt($ch,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
if(!$result){
echo "Failed<br>";
}
Following results are expected.
1701 = Success
1702 = Invalid URL Error
1703 = Invalid value in username or password field
1704 = Invalid value in "type" field
1705 = Invalid Message
1706 = Invalid Destination
1707 = Invalid Source (Sender)
1708 = Invalid value for "DLR" field
1709 = User validation failed
1710 = Internal Error
1025 = Insufficient Credit
Bu nothing is coming other than Failed.
Pls help me. Thank you in advance.
Lakmarket | 
November 15th, 2008, 04:25 AM
| | | | re: Curl and Sending query string to SMPP server
lakmarket wrote: Quote:
Hi,
>
I am trying to send some querysting using cURL. This is the working
API
> http://smpp4.routesms.com:8080/bulks...ge=testmessage.
>
The infomation given by Routesms.com:
>
Port: 2345
Server: SMPPHTTP
>
This is my code:
>
$ch = curl_init();
$url = "http://smpp4.routesms.com:8080/bulksms/bulksms?
username=xxxxxx&password=xxxxxxx&type=0&dlr=0&dest ination=94xxxxxxxxx&source=testing&message=testmes sage";
curl_setopt($ch,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
if(!$result){
echo "Failed<br>";
}
>
Following results are expected.
>
1701 = Success
1702 = Invalid URL Error
1703 = Invalid value in username or password field
1704 = Invalid value in "type" field
1705 = Invalid Message
1706 = Invalid Destination
1707 = Invalid Source (Sender)
1708 = Invalid value for "DLR" field
1709 = User validation failed
1710 = Internal Error
1025 = Insufficient Credit
>
Bu nothing is coming other than Failed.
>
Pls help me. Thank you in advance.
>
Lakmarket
| What does curl_error() show?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex@attglobal.net
================== | 
November 15th, 2008, 04:45 AM
| | | | re: Curl and Sending query string to SMPP server
On Nov 15, 1:17*pm, Jerry Stuckle <jstuck...@attglobal.netwrote: Quote:
lakmarket wrote:> Quote:
I am trying to *send some querysting *using cURL. This is the working
API
| >> Quote: |
The infomation given by Routesms.com:
| > Quote:
Port: 2345
Server: SMPPHTTP
| >> Quote:
$ch = curl_init();
$url = "http://smpp4.routesms.com:8080/bulksms/bulksms?
username=xxxxxx&password=xxxxxxx&type=0&dlr=0&dest ination=94xxxxxxxxx&source=testing&message=testmes sage";
curl_setopt($ch,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
if(!$result){
echo "Failed<br>";
}
| > Quote: |
Following results are expected.
| > Quote:
*1701 = Success
*1702 = Invalid URL Error
*1703 = Invalid value in username or password field
*1704 = Invalid value in "type" field
*1705 = Invalid Message
*1706 = Invalid Destination
*1707 = Invalid Source (Sender)
*1708 = Invalid value for "DLR" field
*1709 = User validation failed
*1710 = Internal Error
*1025 = Insufficient Credit
| > Quote: |
Bu nothing is coming other than Failed.
| > Quote: |
Pls help me. * Thank you in advance.
| >>
What does curl_error() show?
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
| The only message display on the screen is "Failed". Do I have to
insert curl_error() somewhere in the code?
Thank you | 
November 15th, 2008, 08:25 AM
| | | | re: Curl and Sending query string to SMPP server
On Nov 15, 6:37 am, lakmarket <lakmar...@gmail.comwrote: Quote:
On Nov 15, 1:17 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>
>
>> Quote: Quote:
I am trying to send some querysting using cURL. This is the working
API
| | >> Quote: Quote: |
The infomation given by Routesms.com:
| | > Quote: Quote:
Port: 2345
Server: SMPPHTTP
| | >> Quote: Quote:
$ch = curl_init();
$url = "http://smpp4.routesms.com:8080/bulksms/bulksms?
username=xxxxxx&password=xxxxxxx&type=0&dlr=0&dest ination=94xxxxxxxxx&source=testing&message=testmes sage";
curl_setopt($ch,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
if(!$result){
echo "Failed<br>";
}
| | > Quote: Quote: |
Following results are expected.
| | > Quote: Quote:
1701 = Success
1702 = Invalid URL Error
1703 = Invalid value in username or password field
1704 = Invalid value in "type" field
1705 = Invalid Message
1706 = Invalid Destination
1707 = Invalid Source (Sender)
1708 = Invalid value for "DLR" field
1709 = User validation failed
1710 = Internal Error
1025 = Insufficient Credit
| | > Quote: Quote: |
Bu nothing is coming other than Failed.
| | > Quote: Quote: |
Pls help me. Thank you in advance.
| | >> Quote: |
What does curl_error() show?
| > Quote:
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
| >
The only message display on the screen is "Failed". Do I have to
insert curl_error() somewhere in the code?
>
Thank you
| No, when you incurr curl_error() you will get what curl is saying is
wrong. | 
November 15th, 2008, 09:15 AM
| | | | re: Curl and Sending query string to SMPP server
On Nov 15, 5:24*pm, Michael Gooden <m...@michael-gooden.infowrote: Quote:
On Nov 15, 6:37 am, lakmarket <lakmar...@gmail.comwrote:
>
>
> Quote: |
On Nov 15, 1:17 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
| >> Quote: Quote:
I am trying to *send some querysting *using cURL. This is the working
API
| | >> Quote: Quote: |
The infomation given by Routesms.com:
| | > Quote: Quote:
Port: 2345
Server: SMPPHTTP
| | >> Quote: Quote:
$ch = curl_init();
$url = "http://smpp4.routesms.com:8080/bulksms/bulksms?
username=xxxxxx&password=xxxxxxx&type=0&dlr=0&dest ination=94xxxxxxxxx&source=testing&message=testmes sage";
curl_setopt($ch,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
if(!$result){
echo "Failed<br>";
}
| | > Quote: Quote: |
Following results are expected.
| | > Quote: Quote:
*1701 = Success
*1702 = Invalid URL Error
*1703 = Invalid value in username or password field
*1704 = Invalid value in "type" field
*1705 = Invalid Message
*1706 = Invalid Destination
*1707 = Invalid Source (Sender)
*1708 = Invalid value for "DLR" field
*1709 = User validation failed
*1710 = Internal Error
*1025 = Insufficient Credit
| | > Quote: Quote: |
Bu nothing is coming other than Failed.
| | > Quote: Quote: |
Pls help me. * Thank you in advance.
| | >> Quote: Quote: |
What does curl_error() show?
| | > Quote: Quote:
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
| | > Quote:
The only message display on the screen is "Failed". Do I have to
insert curl_error() somewhere in the code?
| >>
No, when you incurr curl_error() you will get what curl is saying is
wrong.
| Thanks for the information
curl_error() message is: No URL set!
If somebody willing to help I can email the test account username and
password.
Regards,
Lakmarket | 
November 15th, 2008, 10:45 AM
| | | | re: Curl and Sending query string to SMPP server
Hi,
I did some corrections of the program.
$url = "http://smpp4.routesms.com:8080/bulksms/bulksms?
username=xxxxxxx&password=xxxxx&type=0&dlr=0&desti nation=xxxxxx&source=xxxxxx&message=testscriptold" ;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if(!curl_exec($ch))
{
echo 'Curl error: ' . curl_error($ch);
}
else
{
echo 'Operation completed without any errors';
}
Now the output is Curl error: couldn't connect to host
Thanks | 
November 15th, 2008, 02:15 PM
| | | | re: Curl and Sending query string to SMPP server
lankansoft wrote: Quote:
Hi,
>
I did some corrections of the program.
>
$url = "http://smpp4.routesms.com:8080/bulksms/bulksms?
username=xxxxxxx&password=xxxxx&type=0&dlr=0&desti nation=xxxxxx&source=xxxxxx&message=testscriptold" ;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>
>
if(!curl_exec($ch))
{
echo 'Curl error: ' . curl_error($ch);
}
else
{
echo 'Operation completed without any errors';
}
>
Now the output is Curl error: couldn't connect to host
>
Thanks
| That's because "http://smpp4.routesms.com:8080/bulksms/bulksms?
username=xxxxxxx&password=xxxxx&type=0&dlr=0&desti nation=xxxxxx&source=xxxxxx&message=testscriptold" ;
is not a URL. It is a URL and a query parameter list.
Only the URL is passed in CURLOPT_URL. The parameter list is passed in
CURLOPT_POSTFIELDS.
I'd recommend you google for a CURL tutorial. It will help you a lot.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex@attglobal.net
================== |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,689 network members.
|