简体   繁体   中英

Asterisk acting as SIP Client ignores extension behind dialled number

I have a block of 100 telephone numbers at a SIP-Provider. I'm trying to build a Asterisk Server which can act as a client for all those numbers and present a voicebox for every one of them.

No matter what extension I dial, Asterisk always looks for an extension named after the first 10 digits of my block - without the dialled extension.

My sip.conf looks like this:

[global]

register => [My Block]:[Password]@sip.qsc.de

[qsc]
host=sip.qsc.de
context=from-qsc
type=peer
dtmfmode=rfc2833
disallow=all
allow=alaw
allow=ulaw
insecure=invite,port
username=[My Block]
secret=[Password]
requirecalltoken=no
nat=no
qualify=yes

and my extensions.conf:

[from-qsc]
exten => 78,1,Answer()
exten => 78,n,Voicemail(78,u)
exten => 78,n,Hangup

If I dial [My Block]78 I get

[Sep 30 16:18:39] NOTICE[19878][C-00000004]: chan_sip.c:25381 handle_request_invite: Call from '[My Block]' ([Provider IP]:5060) to extension '[My Block]' rejected because extension not found in context 'from-qsc'.

If I define the extension [My Block] everything works, but I cant configure different voiceboxes for different extensions because it seems like Asterisk does not know anything about the Extension dialled.


Edit 2013-10-01:

If I change the register => line in my sip.conf and add an extension, it does not change anything. According to voip-info.org this is sometimes the case with some providers.

No matter what extension I add behind the registration, Asterisk always uses [My Block] as Extension - forgot to mention that. Updated the question.

I found a extensions.conf and a sip.conf from my provider. But using them, I just get

[Oct  1 09:02:51] WARNING[21174][C-0000000d]: ast_expr2.fl:470 ast_yyerror: ast_yyerror():  syntax error: syntax error, unexpected '<token>', expecting $end; Input:
$<{SIP_HEADER(P-Called-Party-ID)}> != ""
   ^
[Oct  1 09:02:51] WARNING[21174][C-0000000d]: ast_expr2.fl:474 ast_yyerror: If you have questions, please refer to https://wiki.asterisk.org/wiki/display/AST/Channel+Variables
[Oct  1 09:02:51] WARNING[21174][C-0000000d]: pbx.c:6390 __ast_pbx_run: Channel 'SIP/qsc-00000008' sent to invalid extension but no invalid handler: context,exten,priority=local,78,1

But the mentioned wiki-article does not help me ether :/.

I got it. It was a Syntax Error in the providers extensions.conf. I cahnged the first two lines in the extensions.conf from the provider as follows:

exten => _X.,1,ExecIf($["${SIP_HEADER(P-Called-Party-ID)}" != ""]?macro(from-sip,${SIP_HEADER(P-Called-Party-ID)}))
exten => _X.,2,ExecIf($["${SIP_HEADER(TO)}" != ""]?macro(from-sip,${SIP_HEADER(TO)}))

and that works if I specify a [local] Context with my extensions. And that works like a charm.

Use

register => [My Block]:[Password]@sip.qsc.de/78

OR create "My Block" extension in from-qsc context.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM