Execute MS SQL stored procedure upon DTMF selection, PHPAGI

Hi,

This is my 3rd attempt here at this forum, hope someone finds this reasonable :smile:

I am trying to run a stored procedure from ms sql server after user dtmf tone in PHPAGI, however it seems that the SP is never triggered. Any ideas or suggestions would be highly appreciated. Thanks

Required:

$press1 = $agi->get_data('please-select-menu',300, 1);
$press1dtmf = $press1['result'];
if ($press1dtmf=="1"){
//run ms sql stored procedure;  
$agi->stream_file('thank-you');
$agi->hangup();
}

Tried & Not Working Method:

$press1 = $agi->get_data('please-select-menu',300, 1);
$press1dtmf = $press1['result'];
if ($press1dtmf=="1"){
$sql_statement =  mssql_init("sp_name '$value1' ,'$value2', '$value3'", $conn);
$result=mssql_execute($sql_statement);
mssql_free_statement($sql_statement);
$agi->stream_file('thank-you');
$agi->hangup();
}

added mssql_free_result($result); to the code and everything worked out. just thought of posting the ans, so that it might help someone in future.

Thanks jeet,

i appreciate it

sohaib khan