473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Queing Messages For SMS Gateway API

6
I am developing an application that sends different messages to different recipients.The phone numbers and messages are stored in a table,and i use the curl function in a loop to call the API url.The issue is that after the first 10 (or so numbers),the maximum execution time parameter is exceeded,and not all numbers are sent.The support staff of the gateway company said i should try queuing the messages so that i could send them in bulk instead of looping.From the API i know that i can send messages to multiple recipients by separating each number with a comma,so i figure that issue is handled if i implode the array containing the phone numbers.The issue is how to handle the messages in the message array to deliver different messages to different numbers.Or rather,how do i que the numbers and messages so that everything is delivered in bulk to the API?. Below is an excerpt from my code:

Expand|Select|Wrap|Line Numbers
  1. while($launch_row=mysqli_fetch_assoc($launch_result))
  2.   {
  3. $number=$launch_row['phone_number'];
  4. $message=$launch_row['message'];
  5. $url="http://xxxxxxxxxxx?username=yy&password=yyy&type=0&dlr=1&destination=".urlencode($number)."&source=xxx&message=".urlencode($message);
  6.  $ch = curl_init();
  7.  _setopt($ch, CURLOPT_URL, $url);
  8.  curl_setopt($ch, CURLOPT_HEADER, 0);
  9.  $results = curl_exec($ch);
  10.      }
  11.  
Feb 2 '12 #1
1 1481
YarrOfDoom
1,247 Expert 1GB
As it looks now, it seems your code waits for the API request to finish before continuing on to the next number. By creating all requests first then executing them all at once this problem would be eliminated.

I believe the curl_multi_* functions can help you with this.
Feb 16 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Giobibo | last post by:
I use the following code to send e-mails with PHP: if(@mail(....)) { //Send OK } else { //Send Bad } But how can I verify that a message was really sent (in case of "Sent
0
by: Grant Edwards | last post by:
Could whoever is gatewaying this group to a mailing list PLEASE fix whatever problem is causing Usenet posters to receive bounce messages and out-of-office messages from subscribers to your...
0
by: Administrator | last post by:
Hello guys Just wanted to let you know that we added a new web gateway t *mailing.database.mysql* at TechieGroups.co From our web site you can read and reply to messages posted in thi group...
1
by: yoshitha | last post by:
Hi i've to send SMS message to a mobile phone from Pc (using asp.net application) i dont know which namespaces to include and what requirements i need in order to full fill this requirement ...
6
by: Ed Leafe | last post by:
I've been approached by a local business that has been advised that they need to start capturing and archiving their instant messaging in order to comply with Sarbanes-Oxley. The company is largely...
1
by: Alberto A. Villa | last post by:
Dear SQL MS-Access Programmers, can You help me? I must append a table in MS-Access 2000 to another, because the new table has new data with same formats imported from an excel file, that...
1
by: lazukars | last post by:
I am developing a website with Ruby that will integrate SMS messaging. Let's say the site is called http://www.example.com for clarity sake. The primary function of example.com will be accepting...
18
by: Grant Edwards | last post by:
Could whoever is responsible for the gateway that is grabbing my postings off of Usenet and e-mailing them out please fix the headers in the mail messages so that I don't get the bounce messages?...
1
by: vensriram | last post by:
I am working for BUSINESS TO BUSINESS concepts project. It has been mentioned that the messages are transmitted through protocols like AS1, AS2, AS3 and there is also a gateway. 1. What is the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.