PHP AGI Wrong value returned


I have asterisk server with SIP provider (Trunk OVH, french provider).

I use PHP AGI to ask user for getting post number. When I use iPhone, I encounter a problem with DTMF, the number are duplicated. But it is not the same problem. PHP AGI seems not reconize response of asterisk.

In the CLI i can see

>AGI Rx << GET DATA /var/lib/asterisk/agi-bin/sos_v4/audio/common/intro 3000
>AGI Tx >> 200 result=10466 (timeout)
>AGI Rx << VERBOSE "INPUT DTMF: timeout" 1
>AGI Tx >> 200 result=1
>AGI Tx >> 200 result=1

The result in CLI is 10466 (1046 is the real value entered). But the var returned by PHP AGI (verbose bellow) is define on -1. So asterisk has get the value from user, but PHP AGI not return the good value in the result var.

$partner_id_response = $agi->get_data($common_path.'intro', 3000); 
if ($sdebug) $agi->verbose('INPUT DTMF: ' . $partner_id_response['data']);
if ($sdebug) $agi->verbose('INPUT CODE: ' . $partner_id_response['result']);

Any idea about this behavior?

I tryed with G722 auto and G729 inband but no change.


You can pass DTMF values to php using the $argv array

Thanks, but this not work. $argv is empty

The array is empty if you dont pass the DTMF value as parameter from Asterisk to PHP. Assuming it is the only value you re passing will be available on $argv[1]

Time out value is coming which means DTMF is not received at server. Another issue will be DTMF setting in sip.conf.

I would start with a simple DTMF test plan. You can find the one I use here.

If it does not work, then you need to check the DTMF settings in sip.conf.