[asterisk-users] Is there a smarter way to ban expensive calls in dial plan?

William Piper william.piper at gmail.com
Wed Aug 2 20:40:43 MST 2006


You guys are making this more complicated than it needs to be.
Set your context to dialout & do this:

[dialout]
include => blocked
include => notblocked

[blocked]
exten => _003763.,1,Congestion
exten => _003764.,1,Congestion
exten => _003765.,1,Congestion

[notblocked]
exten => _00376.,1,Dial(my iax terminiator)

This will look for a match in the "blocked" context first. If it finds a
match, then it will play congestion, if it doesn't find a match, it will go
to the "notblocked" context.

Good Luck,

bp
On 8/1/06, Andrea Spadaccini <a.spadaccini at mediatechnologies.it> wrote:
>
> Ciao Chris,
>
> > So if I try the following dial plan my pattern always matches the
> > first wild card
> >
> > Exten => _00376.,1,Dial(my iax terminiator)
> > Exten => _003763.,1,Congestion
> > Exten => _003764.,1,Congestion
> > Exten => _003765.,1,Congestion
>
> This is a common pitfall in Asterisk dialplans: Asterisk doesn't try to
> match your extensions in the order you insert them into your dialplan,
> but it sorts them out according to its own internal order.
>
> See the CLI command "show dialplan example" to discover how it sorts
> them.
>
> So, how to solve this misunderstanding?
>
> You must create other contexts, and include them in your main context.
> Asterisk will try to match current context's extensions first, and then
> extensions included from other contexts, in the order you included them.
>
> Please refer to
>
> http://www.voip-info.org/wiki/index.php?page=Asterisk+config+extensions.conf+sorting
> for further information.
>
> HTH,
>
> --
> Andrea Spadaccini
> Multimedia Technologies Institute s.r.l.
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060802/9b7902c0/attachment.htm


More information about the asterisk-users mailing list