Asterisk how check if a number is busy before dialing it

廉价感情. 提交于 2019-12-11 04:21:49

问题


As a beginner that just installed his first asterix server I came across a small issue. i want to check if a number that i dial is busy or not before actually dialing it.

So for example I would call 0904 => number busy => redirect to 0905

However I don't want it to dial 0904 first if its busy but just instantly redirect it to 0905 instead.

I have a very basic setup with just 3 users. 2 of them are in a queue "support" one of them is in the queue "admin"

I have seen and read a little about checking if a channel is available but i didn't fully understand that and I'm not sure if it could be done easier.

Here is my simple dialplan, if i call *12 my simple python script will just execute the Dial command to the 0904.

exten => *12,1,Answer()
same => n,set(PHONE_EXTEN=0904)
same => n,AGI(test-agi.py,${PHONE_EXTEN})
same => n,Hangup()

回答1:


There is no way know if external number is busy.

If number is your extension, you can count calls using GROUP/GROUP_COUNT or you can check extensions states and hints, like described in docs

https://wiki.asterisk.org/wiki/display/AST/Extension+State+and+Hints

https://wiki.asterisk.org/wiki/display/AST/Device+State



来源:https://stackoverflow.com/questions/54948596/asterisk-how-check-if-a-number-is-busy-before-dialing-it

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