Benoit Panizzon
2006-Oct-16 05:08 UTC
[asterisk-users] Multiple 'routes' to extension in different contextes. How to influence search oder?
Hi all I share my Asterisk Server with a few friends. It is connected to PSTN, and various SIP Providers. I offer Free Calls to my friends, but myself I would like to be able to make calls to non free destinations via my PSTN Line. Now I do this in my dialplan: ----------------------- [myself] ; National Destinations exten => _0z.,1,Dial(SIP/someisp/${EXTEN}); exten => _0z.,n,Dial(Zap/g1/${EXTEN}); ; International Destinations exten => _00z.,1,Dial(SIP/someisp/${EXTEN}); exten => _00z.,n,Dial(Zap/g1/${EXTEN}); include => freedestinations; [freedestinations] ; Local Free Destionations exten => _0800.,1,Dial(Zap/g1/${EXTEN}); ; International Free Destionations exten => _0049.,1,Dial(SIP/FWD/*${EXTEN}:2); ------------------------------ Now I get into this situation. I would like to call a german Free Numer: 0049800xxxxxxx This is best matched in the context [freedestinations], and also the cheapest. My Telco charges a fee to call free destionations abroad. But still: exten => _00z. is being matched. Is there a way to solve this in a clever way? I have started just copying all [freedestination] extensions into [myself] but every time I have to change anything I have to change it everywhere. Regards Benoit Panizzon -- I m p r o W a r e A G - System Services ______________________________________________________ Zurlindenstrasse 29 Tel +41 61 826 93 00 CH-4133 Pratteln Fax +41 61 826 93 01 Schweiz Web http://www.imp.ch ______________________________________________________ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 185 bytes Desc: not available Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20061016/3d4abe62/attachment.pgp
Brian Candler
2006-Oct-16 07:20 UTC
[asterisk-users] Multiple 'routes' to extension in different contextes. How to influence search oder?
On Mon, Oct 16, 2006 at 02:08:05PM +0200, Benoit Panizzon wrote:> [myself] > ; National Destinations > exten => _0z.,1,Dial(SIP/someisp/${EXTEN}); > exten => _0z.,n,Dial(Zap/g1/${EXTEN}); > > ; International Destinations > exten => _00z.,1,Dial(SIP/someisp/${EXTEN}); > exten => _00z.,n,Dial(Zap/g1/${EXTEN}); > > include => freedestinations; > > [freedestinations] > ; Local Free Destionations > exten => _0800.,1,Dial(Zap/g1/${EXTEN}); > > ; International Free Destionations > exten => _0049.,1,Dial(SIP/FWD/*${EXTEN}:2); > ------------------------------ > > Now I get into this situation. I would like to call a german Free Numer: > 0049800xxxxxxx > > This is best matched in the context [freedestinations], and also the cheapest. > My Telco charges a fee to call free destionations abroad. > But still: exten => _00z. is being matched. > > Is there a way to solve this in a clever way? I have started just copying all > [freedestination] extensions into [myself] but every time I have to change > anything I have to change it everywhere.Try moving the [myself] destinations into another context, say [pstn], then do [myself] include => freedestinations include => pstn whilst your friends' contexts only include => freedestinations Check the wiki: http://www.voip-info.org/wiki/index.php?page=Asterisk+config+extensions.conf+sorting Regards, Brian.