[asterisk-users] Rejecting a call as if the extension does not exist.

John Kiniston johnkiniston at gmail.com
Thu Feb 6 18:14:02 CST 2014

I'm trying to address a problem with users transferring to invalid

In my sip peer I'm setting both __FORWARD_CONTEXT and __TRANSFER_CONTEXT to
a context with a extension defined below to set some CDR variables before
the call is transferred.

exten => _X.,1,Progress()
exten => _X.,n,Gosub(do-billing,s,1${EXTEN}))
exten => _X,n,Goto(customer-internal,${EXTEN},1)

Now if my user Dials an invalid extension, Say '9595' from their sip phone
they get back an 'Address Incomplete' message from their phone because it's
not a valid extension defined in my dialplan.

If my user  Transfers a call to '9595' the call gets transferred and then
hung up on as there's no '9595' destination.

I'd like to reject the calls in my customer-foward context that do not
exist in my customer-internal context.

I've tried doing something like:

exten => _X.,1,Progress()
same => n,ExecIf($[${DIALPLAN_EXISTS(customer-internal,${EXTEN},1)} =

But that's still accepting the call as the _X makes it a Valid extension.

I'm looking for suggestions or ideas on a better way to do this.

A human being should be able to change a diaper, plan an invasion, butcher
a hog, conn a ship, design a building, write a sonnet, balance accounts,
build a wall, set a bone, comfort the dying, take orders, give orders,
cooperate, act alone, solve equations, analyze a new problem, pitch manure,
program a computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20140206/6faafb62/attachment.html>

More information about the asterisk-users mailing list