Stop call recording through AGI

#!/usr/bin/php -v

<?php $channel = $argv[1]; $socket = fsockopen("localhost","5038", $errno, $errstr, 2); fputs($socket, "Action: Login\r\n"); fputs($socket, "UserName: ZZXXCC\r\n"); fputs($socket, "Secret: HYGFTR@#98J!\r\n\r\n"); fputs($socket, "Action: StopMonitor\r\n"); fputs($socket, "Channel: $channel\r\n\r\n"); fputs($socket, "Action: Logoff\r\n\r\n"); $wrets=fgets($socket,128); while (!feof($socket)) { $wrets .= fread($socket, 8192); } fclose($socket); ?>

can anyone help whats wrong in this AGI

Please edit your post to use 'preformatted text tags' so the forum does not reduce your script to gibberish.

Your script is AMI, not AGI.

If you read the response to each action do you get a clue?

It’s not readable, and not AGI, as already noted.

It has a potential deadlock, although I think there is enough returned to trigger that, and I think Asterisk resolves it by dropping the connection.

Hi David,

Thanks for response it might code could not get pasted in proper format, Actually I have a requirement where call gets forward from one server to other, I create recording on first server however dont want the call recording in this file once call reach on other server.

I tried with StopMonitor() and found something on our forum like someone resolved through AGI and I used the same AGI which is neither working and nor visible to you guys in correct format.

Below is the link of that closed thread. Can you please help me out now.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.