简体   繁体   中英

Mix asterisk call recording using PHP-AGI (AGI_AsteriskManager::Monitor)

I am using PHP-AGI for asterisk call recording. It provides a method Monitor in class AGI_AsteriskManager . Now I don't want input and output recording separately, I just want one single file containing the complete call record. I used the code below :

...
$agiAsteriskManager = new AGI_AsteriskManager();
$agiAsteriskManager->Monitor($mychannel,$myfile, "wav", true);
...

The last parameter as mentioned in docs is $mix which i guess is either for creating single file ($mix=false) or two separate files ($mix=true) [source] .

I have tried both the $mix options but it creates two files in either case. Can anyone help me figure this out ? Where am I going wrong, as I could not find detailed documentation regarding the same?

That is normal.

It do create two files, after that convert to one

Dependency: sox package.

$agiAsteriskManager->Monitor($mychannel,$myfile, "wav", true);

This will save a the call recording into a single file 1.wav

$agiAsteriskManager->Monitor($mychannel,$myfile, "wav", false);

The above mentioned statement will save the call recording into 2 files. It will save the input and output separately.

'arheops' has rightly mentioned in the previous comment that SOX is required if you want to save the recording into a single file. Installing SOX on the PBX server will solve the issue.

Initially asterisk creates separate in and out files while the call monitoring is on and call is in progress. Once the call monitoring is stopped the two recordings are automatically merged with the help of SOX.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM