Soporte & Consultoria

Soporte Remoto y Consultoria skype : ambiorixg12.
Nota no se brinda ningun tipo de consulta o soporte fuera del blog de forma gratuita

miércoles, 6 de abril de 2016

Record During Dial()

record (monitor to a file) the inbound audio of incoming calls up until the point that those calls are answered. In other words, only record up until the point the dial() command finishes executing and a call is either connected/bridged or sent somewhere else (like voicemail).



:one: The dial() command should look something like this:

exten => 300,n,Dial(SIP/110,30,itTm(stdmusic)M(answered^${CHANNEL}))

:two: The macro should look something like this:

[macro-answered]
exten => s,1,AGI(stop_monitor.agi,${ARG1})

:three: The stop_monitor.agi script should look something like this:

#!/usr/bin/php -q
<?php
$channel = $argv[1];
$socket = fsockopen("localhost","5038", $errno, $errstr, 2);
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: <AMI username>\r\n");
fputs($socket, "Secret: <AMI password>\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);
?>
https://community.asterisk.org/t/record-during-dial-unusual-problem-requires-creative-solution/65974

No hay comentarios:

Publicar un comentario