1

我有两个星号服务器,第一个是呼叫发起者,第二个是呼叫接收者。我想要的是第一个发起的呼叫会自动记录在第二个中。

第一台服务器的配置如下:

sip.conf

[general]  
register => AS2AS1:welcome@192.168.1.67 
[AS1AS2] 
type=friend 
disallow=all 
allow=iLBC 
secret=welcome 
host=dynamic 
context=startcall 
username=AS2AS1 
dtmfmode=rfc2833 
qualify=1000  

extensions.conf

[startcall] 
exten => 333,1,Playback(sa11)

第二台服务器的配置如下

sip.conf

[general] 
register => AS1AS2:welcome@192.168.1.66 
[AS2AS1] 
disallow=all 
allow=iLBC 
type=friend 
secret=welcome 
host=dynamic 
username=AS1AS2 
context=recordcall 
dtmfmode=rfc2833 
qualify=1000 

extensions.conf

[recordcall] 
exten => 333,1,Answer() 
exten => 333,2,Set(curtime=$(STRFTIME(,,%s)}) 
exten => 333,3,Record(/home/basma/recorded/${curtime}.wav) 
exten => 333,4,Hangup() 

呼叫文件(在呼叫发起服务器中):

Channel:SIP/AS1AS2/333
Context:startcall
Extension:333

但是当通话完成时,我在录制的目录中什么也找不到!

4

3 回答 3

0

可以是任何东西,包括“星号根本无法调用”

要查看更多信息,请使用连接到星号

asterisk -r
core set verbose 10

并在调用时查看输出。

但请注意,您调用的文件不正确。有优先权。

http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out

于 2013-07-10T01:01:37.940 回答
0

Try adding any action after Record() for example Playback(hello-world) or Wait(10)

[recordcall] 
exten => 333,1,Answer() 
exten => 333,n,Set(curtime=${STRFTIME(${EPOCH},,%s)}) 
exten => 333,n,Record(/home/basma/recorded/${curtime}.wav) 
exten => 333,n,Playback(hello-world) 
exten => 333,n,Hangup() 

The beep you hear from Record application, but after that Hangup is called and call is ended.

Also make sure asterisk or user that runs * has write permissions to /home/basma/recorded/
check which user runs * with

ps aux | grep asterisk

and then

chown -R <user>:<user> /home/basma/recorded/
于 2013-07-10T12:36:49.073 回答
0

我终于解决了这个问题,并且在发起者和接收者服务器的 extensions.conf 中进行了一些修改后生成了记录文件。

initiator server extensions.conf中如下:

[startcall]
exten => 333,1,Wait(1)
exten => 333,n,Playback(sa11)
exten => 333,n,WaitExten(10)

而在接收服务器extensions.conf是:

[recordcall]
exten => 333,1,Answer()
exten => 333,n,Set(curtime=${STRFTIME(,,%s)})
exten => 333,n,Record(/home/basma/recorded/${curtime}.wav,0,5)
exten => 333,n,Wait(3)
exten => 333,n, Hangup()
于 2013-07-12T17:23:59.543 回答