[asterisk-users] SIP Context Confusion

Martin asterisklist at callthem.info
Fri Apr 3 12:14:40 CDT 2009


He's already using domain feature but its logic is to override the
user's context even if it was predefined in sip.conf

Martin

On Fri, Apr 3, 2009 at 3:14 AM, Olle E. Johansson <oej at edvina.net> wrote:
> Or you could use the domain feature, where you set a default context
> per domain, that overrides the one in the general section.
>
> /Olle
>
> 3 apr 2009 kl. 07.08 skrev Martin:
>
>> Hi,
>>
>> It took me a while to understand what you were saying ... more clarity
>> to your emails!
>>
>> I see where the code says " If we have a context defined, overwrite
>> the original context" and after consideration
>> I agree with you ... the only problem is that even if you don't define
>> the "context=blah" for the user... that user
>> inherits the "default" context
>>
>> However since you did find it in the source code I'm sure you can fix
>> it for yourself. Just check against the "default_context"
>> and do not overwrite the user's context if it's default.
>>
>> Or add another flag to the user's definition for example
>> is_context_set that would be NULL if no context keyword is processed
>> from the sip.conf etc.
>> That is easier to check instead of comparing against default_context
>>
>> Martin
>>
>> On Wed, Apr 1, 2009 at 2:45 PM, Anthony Plack <tony at plack.net> wrote:
>>> Okay, I am not understanding if I have this correct or not.
>>>
>>> I have a requirement to allow guests into a PBX from different
>>> domains.  However, I can not allow the guests into the default
>>> context because each domain has its own IVR.  So I end up setting
>>> the domain context.  I also need to provide separate contexts for
>>> different sip users (different dial groups).  Small system, few
>>> users, so it doesn't make sense to create separate Asterisk boxes
>>> (cost wise and support) and some of the prompts are similar.  Same
>>> company, different micro departments and web domains.  Should need
>>> to either.
>>>
>>> If I set the user context to "user1" and have set a domain context
>>> set to "guests1" in sip.conf, the system is ignoring the "user1"
>>> context.  An incoming call (from the code) will be force the
>>> context to "guests1" and not have the "user1".  I quote:
>>>
>>>        /* If we have a context defined, overwrite the original
>>> context */
>>>
>>> For example, in sip.conf:
>>>
>>>        [general]
>>>        context=fromsip
>>>        domain=domain1.tld,guests1
>>>        domain=domain2.tld,guests2
>>>
>>>        [userA]
>>>        context=user1
>>>
>>> It would seem to me, that if the context was NOT set in the SIP
>>> entry, and a domain context was available, only then would you
>>> replace the context.
>>>
>>> To me, I would go from micro to macro definition and not jump
>>> around.  So we would have peer, domain, general in the SIP context
>>> hierarchy.  Instead we have domain, peer, general.
>>>
>>> What am I missing about why this is setup this way (other than that
>>> is the way it has always been)?
>>>
>>> Looking for some instruction here to wrap my head around this better.
>>>
>>> As stands now, I believe I have to set all the phones up to a
>>> domain without a context to allow the local context to be used.  Is
>>> that correct?
>>>
>>> _______________________________________________
>>> -- 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
>>>
>>
>> _______________________________________________
>> -- 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
>
> ---
> * Olle E Johansson - oej at edvina.net
> * Cell phone +46 70 593 68 51, Office +46 8 96 40 20, Sweden
>
>
>
>
> _______________________________________________
> -- 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