Hello,
I have a problem with my dialplan. I`m guessing that the PHP its not sending to the right context. When i use it with the US phone number, it generate calls to US, EU and AUS. But when i change the SIP with the number from AUS, it sends in US, but in Australia it gives me an error.
– PJSIP/signalwire-00000000 is making progress
– PJSIP/signalwire-00000000 answered
[Nov 28 04:34:10] WARNING[2220][C-00000001]: pbx.c:4510 __ast_pbx_run: Channel ‘PJSIP/signalwire-00000000’ sent to invalid extension but no invalid handler: context,exten,priority=ivrsystem,+61730406348,1
[Nov 28 04:34:10] NOTICE[2220][C-00000001]: pbx_spool.c:463 attempt_thread: Call completed to PJSIP/+61730406348@signalwire
[Nov 28 04:40:47] NOTICE[2338]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request ‘INVITE’ from ‘sip:1000001001620224100:5060@162.0.224.100’ failed for ‘89.163.241.34:56435’ (callid: 1804508809-368541849-1353322689) - No matching endpoint found
Who made the PHP made it for USA, but i`m trying to call AUS and Europa.
When i call from US number, it takes the dialplan perfectly.
I will upload the PHP here, maybe someone can help me fix it. I would appreciate it.
Thank you.
<?php $handle = fopen("./leads.txt", "r"); $channelname="signalwire"; //$channelname="voiceplus5"; // remove double slash if you want to use voiceplus5 and add double slash infront of above line $nextcallinseconds=10; $callerid="+61280034164"; if ($handle) { while (($buffer = fgets($handle)) !== false) { $phonenumber = rtrim($buffer); $contents = "Channel: PJSIP/".$phonenumber."@".$channelname."".PHP_EOL."Callerid: ".$callerid.PHP_EOL."MaxRetries: 0".PHP_EOL."RetryTime: 300".PHP_EOL."WaitTime: 18".PHP_EOL."Context:ivrsystem".PHP_EOL."Extension: ".$phonenumber.PHP_EOL."Priority: 1".PHP_EOL; //print_r($txt); $callfile = $phonenumber.".call"; if(!is_file($callfile)){ file_put_contents($callfile, $contents); shell_exec("mv ".$phonenumber.".call /var/spool/asterisk/outgoing/"); echo "--- Calling " .$phonenumber ; echo "\r\n"; sleep($nextcallinseconds); } } if (!feof($handle)) { echo "Error: unexpected fgets() fail\n"; } fclose($handle); } ?>