[Kamailio-Users] Question about registrar lookup() and branching.

Alex Balashov abalashov at evaristesys.com
Wed Aug 6 01:55:47 CEST 2008


Greetings,

I've got a small problem with how registration lookups work.

I have several concurrent registrations from one PBX that have multiple 
contact URIs that they declare that aren't the same;  they contain the 
DIDs to route a call to.  So, for instance, in Asterisk:

   register => user:pass at registrar/DID1
   register => user:pass at registrar/DID2

Of course, lookup() doesn't care what those contacts actually are.  If 
it sees multiple contacts for one username, t_relay() will simply create 
branches for all of them and and ring them all.  I can't actually have 
that happen.

I'm looking for suggestions on how to handle this most elegantly.  The 
two options I've got in mind are:

1. Stop using lookup() and do my own URI rewrites and branch forking (if 
the contact URIs are identical) with attention to the contact.

2. Use BRANCH-ROUTEs to arrest the call leg if it is going to an RURI 
user part that does not match the user part of the contact URI, and... 
drop() the branches?

I also need to build in some other logic, such that for example if a 
user has only one contact registered and it does not match the DID, or 
none of the contacts match the DID, proceed as normal anyway.

Is it possible there is a better way?  Recommendations welcome.

Cheers,

-- Alex

-- 
Alex Balashov
Evariste Systems
Web    : http://www.evaristesys.com/
Tel    : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599




More information about the sr-users mailing list