Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

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


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
johnkiniston at gmail.com
Guest





PostPosted: Thu Feb 06, 2014 7:12 pm    Post subject: [asterisk-users] Rejecting a call as if the extension does n Reply with quote

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


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. 


[customer-forward]

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)} = 0]?Hangup(2Cool)


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.
---Heinlein
Back to top
asterisk_list at earth...
Guest





PostPosted: Fri Feb 07, 2014 4:16 am    Post subject: [asterisk-users] Rejecting a call as if the extension does n Reply with quote

On Friday 07 February 2014, John Kiniston wrote:
Quote:
I'm trying to address a problem with users transferring to invalid
destinations.

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.

[customer-forward]
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)} =
0]?Hangup(2Cool)

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.

You are suffering from classic Namespace Pollution.

You need to put the extensions for which you are testing into their own
separate context, e.g. "customer-realexts"; and include -that- context into
your customer-internal context. That way, your DIALPLAN_EXISTS() function
call won't see the _X. (which necessarily must be in customer-internal) to
match against.


--
AJS

Answers come *after* questions.

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
johnkiniston at gmail.com
Guest





PostPosted: Fri Feb 07, 2014 4:09 pm    Post subject: [asterisk-users] Rejecting a call as if the extension does n Reply with quote

On Fri, Feb 7, 2014 at 2:16 AM, A J Stiles <asterisk_list@earthshod.co.uk (asterisk_list@earthshod.co.uk)> wrote:
Quote:

You are suffering from classic Namespace Pollution.

You need to put the extensions for which you are testing into their own
separate context, e.g. "customer-realexts"; and include -that- context into
your customer-internal context.  That way, your DIALPLAN_EXISTS() function
call won't see the _X.  (which necessarily must be in customer-internal)  to
match against.
--



My customer-internal context doesn't have a _X. in it actually, only the customer-fwd context does.

customer-internal contains a bunch of includes for internal extensions and for routes for long-distance,local, toll calls etc.

It's only the forward that has and needs the wildcard match as I need the billing code in that context to be executed before the call goes into the customer-internal context.


I suppose I could replace the _X. with a bunch of NXXX rules in customer-forward but it seems needlessly complex to do so there as customer-internal already controls what can be dialed/forwarded/transferred to by the customer.

--
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.
---Heinlein
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services