How to Dial to Originate a Call from Within the Dialplan?

安稳与你 提交于 2019-12-02 01:40:32

You could do this with the Originate application. Something like the following:

[default]
exten => 337,1,NoOp()
same => n,Originate(SIP/Y,exten,default,originated,1)
same => n,Hangup()

exten => originated,1,NoOp()
same => n,Playback(tt-monkeys)
same => n,Hangup()

The difference, of course, is that the Originate blocks the pbx_thread executing extension 337 until SIP/Y answers or otherwise fails. That being said, the actual call between SIP/Y and the application in extension originated occurs on its own thread, so once the state of SIP/Y is known, 337 will be hung up. So its fairly close to what you were looking for, and doesn't involve external mechanisms like a call file.

An idea would be to create a call file and move it to /var/spool/asterisk/outgoing/ using agi scripts.

Here is the answer. You place Answer as the first part, and end with 'hangup'. That takes care of the "busy signal".

No AGI. This works.

[from-internal]
exten => 3334,1,Goto(AngelusBell,startbell,1)


[AngelusBell]
exten => startbell,1,Answer
exten => startbell,n,System(asterisk -rx "channel originate Local/callviking@AngelusBell/n extension playbell@AngelusBell")
exten => startbell,n,Hangup

exten => callviking,1,Dial(SIP/Y,10,D(5))  ;calls my ATA to my paging box and plays 5 tone
exten => callviking,2,Hangup

exten => playbell,1,Answer
exten => playbell,2,Playback(custom/angelusbellWAV)
exten => playbell,3,Hangup
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!