[asterisk-users] Asterisk variable for SIP context
Mike
list at virtutel.ca
Tue Dec 9 17:57:10 CST 2008
Tilgham,
Sure, that works too, but I needed access to context taken from the sip
entry because I needed to goto(${that_context}), and that context varies
depending on the phone used.
This is when setting __TRANSFER_CONTEXT in my cookie cutter really
big/complexe/database driven extension. I get
__TRANSFER_CONTEX=transfer_context, but once in [transfer_context] I send
the call to the right specific context using a Goto cmd.
Else I would need to replicate that big extension for each of those outgoing
context, which is, from a coding perspective, error prone when modifications
are made later.
Mike
-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Tilghman
Lesher
Sent: Tuesday, December 09, 2008 17:07
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Asterisk variable for SIP context
On Tuesday 09 December 2008 13:17:18 Mike wrote:
> Say I wanted to know what context a SIP registration is using to dial out
> in my dialplan, what would I do?
>
> For example, I have phones on a "local-calls-only" context (as defined in
> sip.conf), others in "unrestricted-calls". In my dialplan, I`d like to
act
> on that knowledge.
I suspect others are making this far more complicated than it needs to be.
The typical setup is to create included contexts in your dialplan, like in:
[local-calls-only]
include => local-calls
[unrestricted-calls]
include => local-calls
include => long-distance
include => international
If you're wanting to find out the top context, even though you're in an
included context, then just use ${CONTEXT}. Your context doesn't actually
change when you're using an included context, which is why this works.
There's no need to make it any more complicated.
--
Tilghman
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
More information about the asterisk-users
mailing list