Poner mensajes en cola para la API de puerta de enlace SMS

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:

while($launch_row=mysqli_fetch_assoc($launch_result))
  {
$number=$launch_row['phone_number'];
$message=$launch_row['message'];
$url="http://xxxxxxxxxxx?username=yy&password=yyy&type=0&dlr=1&destination=".urlencode($number)."&source=xxx&message=".urlencode($message);
 $ch = curl_init();
 _setopt($ch, CURLOPT_URL, $url);
 curl_setopt($ch, CURLOPT_HEADER, 0);
 $results = curl_exec($ch);
     }

preguntado el 02 de febrero de 12 a las 10:02

Without API documentation, nobody can tell you. The API may or may not support bulk messages; it's possible that API supports only multiple recipients for the same message. But you still can disable time limit on your server - try set_time_limit(0) in your script or set max_execution_time = 0 in php.ini -

Thanks...i will try that -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.