Hello,
Below is my PHP file.
#!/usr/bin/php
<?php
$code ='00022489';
$domain1 = 'https://www.google.com='.$code;
function get_http_response_code($domain1) {
$headers = get_headers($domain1);
return substr($headers[0], 9, 3);
}
$get_http_response_code = get_http_response_code($domain1);
print "$get_http_response_code";
When i debug the AGI I am getting the output response code as below
-- User entered '00022489'
-- Executing [515007@testivr:5] GotoIf("SIP/8001-00000011", "1?valid:invalid") in new stack
-- Goto (ashacode,515007,6)
-- Executing [515007@testivr:6] AGI("SIP/8001-00000011", "google.php,00022489") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/google.php
<SIP/8001-00000011>AGI Tx >> agi_request: ashacodes.php
<SIP/8001-00000011>AGI Tx >> agi_channel: SIP/8001-00000011
<SIP/8001-00000011>AGI Tx >> agi_language: en
<SIP/8001-00000011>AGI Tx >> agi_type: SIP
<SIP/8001-00000011>AGI Tx >> agi_uniqueid: 1536927822.17
<SIP/8001-00000011>AGI Tx >> agi_version: 1.8.23.0-1_centos5.go RPM by
demian@goautodial.com<SIP/8001-00000011>AGI Tx >> agi_callerid: 0000000000
<SIP/8001-00000011>AGI Tx >> agi_calleridname: 8001
<SIP/8001-00000011>AGI Tx >> agi_callingpres: 0
<SIP/8001-00000011>AGI Tx >> agi_callingani2: 0
<SIP/8001-00000011>AGI Tx >> agi_callington: 0
<SIP/8001-00000011>AGI Tx >> agi_callingtns: 0
<SIP/8001-00000011>AGI Tx >> agi_dnid: 515007
<SIP/8001-00000011>AGI Tx >> agi_rdnis: unknown
<SIP/8001-00000011>AGI Tx >> agi_context: ashacode
<SIP/8001-00000011>AGI Tx >> agi_extension: 515007
<SIP/8001-00000011>AGI Tx >> agi_priority: 6
<SIP/8001-00000011>AGI Tx >> agi_enhanced: 0.0
<SIP/8001-00000011>AGI Tx >> agi_accountcode: 8001
<SIP/8001-00000011>AGI Tx >> agi_threadid: 47308491569472
<SIP/8001-00000011>AGI Tx >> agi_arg_1: 00022489
<SIP/8001-00000011>AGI Tx >>
<SIP/8001-00000011>AGI Rx << 200
<SIP/8001-00000011>AGI Tx >> 510 Invalid or unknown command
I want to capture 200 from <SIP/8001-00000011>AGI Rx << 200 and pass it to dial plan