[Asterisk-Dev] Re: multiple registrations of same credentials

Mikael Magnusson mikaelmagnusson at glocalnet.net
Sat Oct 22 11:20:08 MST 2005


Olle E. Johansson wrote:
> Jason Pyeron wrote:
> 
>>> On Sat, 22 Oct 2005, Olle E. Johansson wrote:
>>> 
>>
>>>>> Jason Pyeron wrote:
>>>>>
>>>
>>>>>
>>>>> Remember that other SIP pbx's are not multiprotocol pbx's and can do
>>>>> things differently. They usually fork in the SIP layer since it's the
>>>>> same as the PBX layer. In Asterisk, those are two different layers, a
>>>>> PBX and a channel driver.
>>>>>
>>
>>> 
>>> This does make it harder to do, but not impossible. Just think
>>> DIAL(a&b&c&...).
>>> 
>>> now when DIAL(SIP/400)
>>> 
>>> gets back to chan_sip it gets corrected and replaced with an action for
>>> each registered 400 extension using the pbx framework.
>>> 
>>> 
> 
> Which means that the PBX has no idea that it is in fact calling multiple
> devices. We have to implement *two* forking schemes, which makes
> everything much harder.
> 
> Believe me, I've spent a lot of time thinking about how to make this
> work properly without breaking the Asterisk architecture.
> 

I think it can be solved by using both the peer (or AOR) and registered 
contact address in the dial string. For example:

Dial(SIP/400 at example.domain/sip:400 at a.b.c.d)

I have implemented this scheme in a SIP channel based on eXosip and the 
"forking" is done with a function (SIPPEER) which returns a dial string 
that contains all current bindings of the peer.

It can be used in the following way in the dial plan:

exten 400,1,Dial(${SIPPEER(400 at example.domain})

If both sip:400 at a.b.c.d and sip:400 at e.f.g.h have registered 
sip:400 at example.domain, then the above Dial statement will expand to

exten 
400,1,Dial(SIP/400 at example.domain/sip:400 at a.b.c.d&SIP/400 at example.domain/sip:400 at e.f.g.h)

And it will use the following request URI:s and To headers in the 
generated INVITEs.


INVITE sip:400 at a.b.c.d SIP/2.0
..
To: sip:400 at example.domain
..


INVITE sip:400 at e.f.g.h SIP/2.0
..
To: sip:400 at example.domain
..


Regards,
Mikael Magnusson




More information about the asterisk-dev mailing list