[Users] Question on re-writing From uri when ser forwards to Asterisk

Barry Flanagan barryf-lists at flanagan.ie
Fri Jan 20 15:29:52 CET 2006


Arek Bekiersz wrote:
> Mike, Barry,
> 
> 
> Domain support for SIP was present long time earlier.
> I.e. it works fine with Asterisk 1.1.x.
> 
> Just use something like this in your Asterisk extensions.conf:


Thanks for the reply Arek. My problem is with SIP authentication. I need 
to get around the flat SIP users namespace - i.e. user at domain1 and 
user at domain2 both end up looking to asterisk as [user]

Regards,

-Barry


> 
> exten => s,1,SetVar(mod_domain=$[${SIPDOMAIN} : '([a-zA-Z0-9.]+)'])
> exten => s,2,Ringing
> exten => s,3,Wait,2
> exten => s,4,Answer
> exten => s,5,Wait,2
> exten => s,6,Voicemail(u${MACRO_EXTEN}@${mod_domain})
> exten => s,7,Playback(vm-goodbye)
> exten => s,8,Wait,2
> exten => s,9,Hangup
> 
> 
> Note: 'mod_domain' variable will contain SIP domain of SIP request.
> 
> 
> -- 
> Regards,
> Arek Bekiersz
> 
> 
> 
> 
> Barry Flanagan wrote:
> 
>> Mike Williams wrote:
>>
>>> If I'm not mistaken, Asterisk supports SIP domains as of 1.2.0. I 
>>> think that the [context] now works as [domainhere] when this option 
>>> is enabled with a global flag.
>>>
>>
>> I can't find any docs on this feature. I am running 1.2.1
>>
>> -Barry
>>
>>
>>> ---Mike
>>>
>>>
>>>> Hi,
>>>>
>>>> I am using asterisk as PSTN gateway for users registered with OpenSER.
>>>> Everything is working well for a single domain, but I will have 
>>>> problems
>>>> with this when I add extra domains.
>>>>
>>>> I will have multiple domains using the OpenSER server, all using the
>>>> same set of Asterisk servers for PSTN. My problem is that when
>>>> user at domain1 gets sent to Asterisk, they are authenticated as just
>>>> "user" (i.e. the domain portion is stripped off) and they get 
>>>> registered
>>>> under the [user] sip name in Asterisk.
>>>>
>>>> Now, when I add the second domain, and user at domain2 goes to Asterisk,
>>>> they also will appear to Asterisk to be [user]
>>>>
>>>> I think what I need to do is rewrite the From: URI to be user_domain1
>>>> and user_domain2 and then set them up in Asterisk as [user_domain1] and
>>>> [user_domain2] so that they are unique
>>>>
>>>> So, my questions are: is this the correct/only way to do this, and if
>>>> so, what do I need to do to achieve this?
>>>>
>>>> Many thanks.
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at openser.org
>>> http://openser.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
>>


-- 

-Barry Flanagan




More information about the Users mailing list