Hi Daniel, On Montag, 5. Juni 2017 21:45:01 Daniel Tryba wrote: > On Mon, Jun 05, 2017 at 06:10:50PM +0200, Hans-Peter Jansen wrote: > > ; matches 12345678099, too > > exten => _1234567800,1,Dial(SIP/int) > > > > Except from SIP invite with tcpdump: > > > > INVITE sip:123456780000@provider:5060 SIP/2.0 > > From: <sip:013579246800@provider>;tag=as6bc7cbbc > > To: <sip:1234567800099@other:5060> > > 12345678099 doesn't match _1234567800. The problem is the other side is > setting the R-URI to sip:123456780000@provider for any number, so the > EXTEN matched in the dialplan is 123456780000. Ask them to fix this > problem.
Will do. > > I wonder, if I really need to grab the extension with > > Set(DN=${SIP_HEADER(TO):5}) or something similar? > > Yes, something like if they can't fix the R-URI: > exten => X_.,n,Set(TO=${CUT(SIP_HEADER(To),@,1)}) > exten => X_.,n,Set(TO=${CUT(TO,:,2)}) > exten => X_.,n,Goto(somewhereelsetopreventloops${TO},1) Sorry for the silly question, but how do I feed the TO variable back to the usual pattern matching? Assign to $EXTEN? > > Another issue is, that I don't like asterisk to decline foreign INVITE > > requests. Any best practices from within asterisk on how to ignore SIP > > invitations, that don't match certain criteria (neither local nor from sip > > provider)? > > Don't enable guest access, or send any unknown/guest to a context that > will just hangup. Hmm, tried allowguest=no in general sip.conf section, but this results in asterisk responding with <SIP/2.0 401 Unauthorized> on INVITE from provider, and (valid) calls get blocked. Thanks, Pete -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users