Hi
I have this dialplan below. My problem is that if the phone that dials 313 hangup, the script “call_multiple_numbers.php” will stop execution, and eventually end a loop that calls multiple numbers. Is it possible for the php script to continue running even if the caller who dials 313 hangup the call?
The problem lies within the script, but you haven’t provided us with its contents!
I have assumed that you meant that the caller was hung up by Asterisk, when it should not have been. Obviously, if the caller themselves hangs up, there is no way they can continue calling anyone else. That’s a fundamental telephony thing and not something imposed by Asterisk.
Hi @david551 thanks for the reply.
The caller actually does not talk to the thousands of recipients, he only issue the call to record a message and get the script to run and call each number from the database and playback the recorded message to the recipient.
Below is the content of call_multiple_numbers.php
#!/usr/bin/php -q
<?php
ini_set( "include_path", "/var/lib/asterisk/agi-bin/" );
require('phpagi.php');
$agi = new AGI();
$agi->answer();
$stmta2 = $mysqli->prepare("SELECT phone FROM receipients");
$stmta2->bind_param('i',$vaal);
$stmta2->execute();
$stmta2->store_result();
$stmta2->bind_result($phone_number);
while($stmta2->fetch()){ '
include('/var/www/callout.php'); //uses fsockopen() to connect to AMI and cal a number
}
?>
Please explain in detail what you are trying to accomplish.
It sounds like you want to start an AGI by calling an extension and then hang up while the AGI calls multiple numbers. Odd, but if you trap the SIGHUP Asterisk sends to the AGI on hangup, I guess you could do that. I think there’s a setting to ask Asterisk to not send SIGHUP as well.
Is $agi used by callout.php?
I don’t see any question marks to tell MySQL where to bind $vaal.
For this use case, i want the the callout to be initiated by someone using his cell phone.
Also the thousands of people who receive the call, should have the option to press a key end the end of the message, to listen to the message again. I don’t think this can be achieved with call files?
Thanks, i will read about DeadAGI and try to use it.