How to call a context and return to the main context in asterisk?

混江龙づ霸主 提交于 2020-01-02 05:33:05

问题


Here is my dial plan in asterisk:

[main-context]
exten => s,1,Gosub(subcontext,s,1)
exten => s,n,NoOp(End Main)

[subcontext]
exten => s,1,NoOp(Start subcontext)
exten => s,1,NoOp(End subcontext)

The problem is that when subcontext finishes, execution doesn't return to main-context and exten => s,n,NoOp(End Main) doesn't execute. How can I solve this?


回答1:


As Karadous posted above: a GoSub routine must have a matching Return() application call.

[main-context]
exten => s,1,Gosub(subcontext,s,1)
same => n,NoOp(End Main)

[subcontext]
exten => s,1,NoOp(Start subcontext)
same => n,NoOp(End subcontext)
same => n,Return()


来源:https://stackoverflow.com/questions/11101151/how-to-call-a-context-and-return-to-the-main-context-in-asterisk

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