我最近开始阅读有关 Asterisk 的内容,我真的很喜欢使用 GoSub() 函数的想法,但由于一些我不知道的原因,我似乎没有安装它:
我使用星号 11.5.1
下面是我的 extensions.conf 文件:
[default]
exten => _.,1,Hangup()
[internal]
exten => 101,1,Noop(Going to internal contex exten:${EXTEN})
same => n,GoSub(sub-logger,start,1())
same => Dial(SIP/stefan)
exten => 102,1,Noop(Going to internal contex exten:${EXTEN})
same => n,GoSub(sub-logger,start,1())
same => n,Dial(SIP/nasko)
exten => 103,1,Noop(Na babati fyr4iloto)
exten => _9.,1,Dial(SIP/${EXTEN:1}@planet-phone)
exten => _.,1,Hangup()
[external]
exten => _.,1,Hangup()
[sub-logger]
exten => start,1,Noop(inside the subroutine)
;same => n,Noop(Channel : ${CHANNEL})
;same => n,Noop(Context : ${CONTEXT})
;same => n,Noop(Extensions : ${EXTEN})
;same => n,Noop(Date/time call : ${DATETIME})
same => n,Return()
当我注册并尝试拨打 101 或 102 时,我在控制台中收到以下信息:
== Using SIP RTP CoS mark 5
-- Executing [101@internal:1] NoOp("SIP/nasko-00000033", "Going to internal contex exten:101") in new stack
[Sep 22 19:47:41] WARNING[18071][C-00000025]: pbx.c:4621 pbx_extension_helper:No application 'GoSub' for extension (internal, 101, 2)
== Spawn extension (internal, 101, 2) exited non-zero on 'SIP/nasko-00000033'
-- Executing [h@internal:1] Hangup("SIP/nasko-00000033", "") in new stack
== Spawn extension (internal, h, 1) exited non-zero on 'SIP/nasko-00000033'
我在谷歌上搜索了很多,但我找不到这个问题的任何解释。如果有人有任何想法,请在这里分享!谢谢!