Asterisk抱怨一个扩展不存在:
[Mar 14 11:07:22] NOTICE[28139]: chan_sip.c:22622 handle_request_invite: Call from 'sippartner1' (99.23.69.31:5060) to extension 'iax2partner69#4000' rejected because extension not found in context 'carriers'.
但是我确实在上下文carriers
中定义了这个模式:
pbx1*CLI> dialplan show @carriers
'_iax2.' => 1. Set(exten=${EXTEN:5}) [pbx_config]
2. Set(iax2partner=${CUT(exten,#,1)}) [pbx_config]
3. Set(iax2exten=${CUT(exten,#,2)}) [pbx_config]
4. Log(NOTICE,EXTEN=${EXTEN} exten=${exten} iax2partner=${iax2partner} iax2exten=${iax2exten}) [pbx_config]
5. Dial(IAX2/${iax2partner}/${iax2exten}) [pbx_config]
这是载体的来源:
[carriers]
...
exten => _iax2.,1,Set(exten=${EXTEN:5})
exten => _iax2.,n,Set(iax2partner=${CUT(exten,#,1)})
exten => _iax2.,n,Set(iax2exten=${CUT(exten,#,2)})
exten => _iax2.,n,Log(NOTICE,EXTEN=${EXTEN} exten=${exten} iax2partner=${iax2partner} iax2exten=${iax2exten})
exten => _iax2.,n,Dial(IAX2/${iax2partner}/${iax2exten})
为什么星号不匹配模式_iax2.
快捷方式
exten => _[i][a][x][2].,1,Set(exten=${EXTEN:5})
same=>n,Set(iax2partner=${CUT(exten,#,1)})
same=>n,Set(iax2exten=${CUT(exten,#,2)})
same=>n,Log(NOTICE,EXTEN=${EXTEN} exten=${exten} iax2partner=${iax2partner} iax2exten=${iax2exten})
same=>n,Dial(IAX2/${iax2partner}/${iax2exten})