getting the group name to the according pri port in asterisk

匆匆过客 提交于 2019-12-05 01:39:07

As I know there are no such variables for that DAHDI groups.

In your chan_dahdi.conf you use same option "context=from-pstn", so you may easily set "context=pri-g1" for group 1 ("context=pri-g2" for group 2 and etc.) and then define in dialplan something like that:

[pri-main]
exten => s,1,NoOp(Main routine)

[pri-g1]
exten => s,1,Set(PRI_GROUP=1)
exten => s,n,GoTo(pri-main,s,1)

[pri-g2]
exten => s,1,Set(PRI_GROUP=2)
exten => s,n,GoTo(pri-main,s,1)

...

[pri-g8]
exten => s,1,Set(PRI_GROUP=8)
exten => s,n,GoTo(pri-main,s,1)

It is not as convenient for setting up as if there were channel variables, but fast for asterisk.

Just notice that in [pri-g#] exten may be not "s", but DID number or smth else - but you will see it in CLI errors very soon.

By occasion found just what you want - you can set variables in chan_dahdi.conf like that:

[channels]
...
group=1
setvar=__GROUP=1
...

group=2
setvar=__GROUP=2
...

(and so on)

After this you can use your dialplan from question.

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