当用户在Asterisk中挂断时,记录的文件丢失 [英] Recorded files lost when user hangs up in Asterisk

查看:124
本文介绍了当用户在Asterisk中挂断时,记录的文件丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个语音应用程序,我想在其中保存录制的声音文件。我的代码是:

I have one voice application in which I want to save a recorded sound file. My code is:

$record_file= $dir_path . "recordfile_".$file_count;
$this->obj_agi->exec("Record","$record_file.wav,5,$maxsecs");

每次在录音过程中挂断电话,录音应用程序都无法执行并挂断呼叫。

Whenever I hang up during recording, the recording application can not execute and hangup the call.

有人在挂机时有任何想法如何管理此记录功能吗?

Does anyone have any idea how to manage this record function while hanging up?

推荐答案

即使在您挂断电话时,记录应用程序也会正常处理记录。

The record application process the record normally even when you hangup.

但是,在AGI中,捕获挂断的最佳方法是捕获从Asterisk发送到您的信号AGI流程。
通过捕获SIGHUP,您可以执行所需的任何操作(计费,触摸文件,在DB中插入等)。

However, inside AGI, the best way to trap hangup is to trap the signal sent from Asterisk to your AGI process. By trapping your SIGHUP, you can do whatever you want (billing, touch files, insert in DB, etc).

默认情况下,SIGHUP将是

By default, a SIGHUP will be sent.

以获取更多信息,这是核心显示应用程序AGI的输出(来自CLI)

to get more infos, here's an output from the core show application AGI (from the CLI)

     A locally executed AGI script will receive SIGHUP
     on hangup from the channel except when using DeadAGI. A fast AGI server will
     correspondingly receive a HANGUP inline with the command dialog. Both of theses
     signals may be disabled by setting the ${AGISIGHUP} channel variable to 'no'
     before executing the AGI application. Alternatively, if you would like the
     AGI application to exit immediately after a channel hangup is detected, set
     the ${AGIEXITONHANGUP} variable to 'yes'.

这篇关于当用户在Asterisk中挂断时,记录的文件丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆