Thanks Bogdan,<div>Thats great !!</div><div><br></div><div>--- Jay<br><br><div class="gmail_quote">On Mon, Jun 29, 2009 at 6:18 PM, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Jayesh,<br>
<br>
I just added in 1.6 branch (devel) some more control over the registrar module behaviour - some options are now per AOR (and not global), so you can set "b" (no Branches) flag to "lookup()" function only for the users you want to use only one contact.<br>
<br>
See: <a href="http://www.opensips.org/html/docs/modules/devel/registrar.html#id271025" target="_blank">http://www.opensips.org/html/docs/modules/devel/registrar.html#id271025</a><br>
<br>
Regards,<br><font color="#888888">
Bogdan</font><div><div></div><div class="h5"><br>
<br>
Bogdan-Andrei Iancu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
HI Jayesh,<br>
<br>
You made a good point here - as all branches do have the same q, the function will actually do nothing (or almost nothing).<br>
<br>
So, what I suggest is:<br>
- adding some params to the lookup() function to be able to pass as flag (per user) if branches should be added or not<br>
- a clear_branches() function (for more generic usage) to remove any already branches.<br>
<br>
I think this will solve your problem.<br>
<br>
Best regards,<br>
Bogdan<br>
<br>
Jayesh Nambiar wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Bogdan,<br>
Thanks for your reply.<br>
This had made perfect sense to me when you suggested this solution first. The problem I ran into was even after using serialize_branches(), all the registered contacts used to get the call.<br>
What I did was: - Did a lookup location<br>
- Before calling t_relay called the function serialize_branches(1)<br>
<br>
After searching a little about serialize_branches, I got to know that it serializes based upon the q value only and contacts with same q-value will be still parelell forked.<br>
So i got stuck there :(<br>
<br>
--- Jay<br>
<br>
On Tue, Jun 23, 2009 at 2:01 PM, Bogdan-Andrei Iancu <<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a> <mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>>> wrote:<br>
<br>
Hi Jayesh,<br>
<br>
So, just to recap - you want to get use the last registered<br>
contact (per user option - for some user only the last, for others<br>
all contacts).<br>
<br>
What I suggested was to allow multiple registrations for all users<br>
and to keep the contacts sorted by time (so that the last uploaded<br>
contact will be the first to use).<br>
Now, during lookup(), fetch all branches from usrloc. At this<br>
point, what you have to do is to discard the additional branches<br>
for users you allow only one contact - and you can use the<br>
serialize_branches() function (without anything else) to discard<br>
the additional branches....<br>
<br>
Just let me know if what I said make sense to you.<br>
<br>
<br>
Regards,<br>
Bogdan<br>
<br>
Jayesh Nambiar wrote:<br>
<br>
Hi Bogdan,<br>
Tried using serialize branches with different possibilities<br>
and scenarios but it only serializes based upon the "Q" value<br>
of the contact. Tried googling a lot about it but could not<br>
find much help.<br>
Contacts with same Q value are still parallel forked as<br>
clearly mentioned in the document. Moreover clients like<br>
X-Lite and Eyebeam dont even have a q value when registered. I<br>
have alredy set desc_time_order to 1 but it does not make a<br>
difference with serialize_branches() function !!<br>
<br>
Any ideas like if we can attach q values from script before<br>
saving into location table. But for that also what should be<br>
the logic before attaching the q-value???<br>
I think I am gonna make this requirement "Not Feasible" for now !!<br>
<br>
Any more ideas or ways of achieving this would be highly<br>
appreciated.<br>
<br>
Thanks,<br>
<br>
--- Jay<br>
<br>
On Fri, Jun 19, 2009 at 1:07 PM, Bogdan-Andrei Iancu<br>
<<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a> <mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>><br>
<mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a><br>
<mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>>>> wrote:<br>
<br>
I see....Ideally we could allow control append_branch per user,<br>
but not possible right now.<br>
<br>
What can be done is to allow append_branch for all of them<br>
and to<br>
simply purge the added branches for the users with only one<br>
contact registration. If it is a hack, use serialize_branches()<br>
function to delete the additional branches added by<br>
lookup(location) (actually the function moves the branches<br>
in some<br>
AVPS, but the important part is that the branches are<br>
cleaned :) ).<br>
<br>
<br>
Regards,<br>
Bogdan<br>
<br>
Jayesh Nambiar wrote:<br>
<br>
Thank you Bogdan, for the correct approach explained.<br>
But the append branch then applies to all users right?<br>
What i<br>
was trying to do here was:<br>
1) Allow some basic users to have only one registration<br>
contact possible.<br>
2) Allow premium users to have as many contacts<br>
possible and<br>
receive calls on any of the location.<br>
<br>
Based upon certain conditions can i increase the append<br>
branch<br>
parameter after looking up location and before relaying !!!<br>
Just a thought.<br>
<br>
--- Jay<br>
<br>
On Fri, Jun 19, 2009 at 12:38 PM, Bogdan-Andrei Iancu<br>
<<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a> <mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>><br>
<mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a> <mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>>><br>
<mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a><br>
<mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>><br>
<mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a><br>
<mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>>>>> wrote:<br>
<br>
HI Jayesh,<br>
<br>
What you could do is to accept 2-3 registrations, but to<br>
actually<br>
use the last one only.<br>
<br>
So set the mac_contacts to 2 or 3, the<br>
append_branches to 0 (to<br>
use only one contact) and in usrloc module set<br>
desc_time_order to<br>
1<br>
(<a href="http://www.opensips.org/html/docs/modules/1.5.x/usrloc.html#id266565" target="_blank">http://www.opensips.org/html/docs/modules/1.5.x/usrloc.html#id266565</a>)<br>
to sort contacts based on the registration time<br>
(first used<br>
will<br>
be the last registered)<br>
<br>
Regards,<br>
Bogdan<br>
<br>
Jayesh Nambiar wrote:<br>
<br>
Hi All,<br>
I had a requirement of allowing only one<br>
registration<br>
per user<br>
in a particular scenario. I did not want to use the<br>
max_contacts parameter of registrar module as it<br>
wont work<br>
right !!! The drawback was:<br>
If device A had registered successfully and for<br>
some reason<br>
got disconnected from the internet, the device won't<br>
unregister itself. Opensips still has the record<br>
in the<br>
location table for that device, now if the internet<br>
comes back<br>
and when the device tries to register again,<br>
opensips<br>
will not<br>
allow since it already has the record in the<br>
location.<br>
The device will have to wait until the earlier<br>
registration<br>
expires in the opensips.<br>
The idea was to have a way of updating the location<br>
table if<br>
same user is trying to REGISTER from same<br>
location or<br>
different location. Meaning if user A is<br>
registered from<br>
location A and someone else using same<br>
credentials of<br>
user A<br>
tries to register from location B, the location<br>
table<br>
should<br>
only update the earlier record to location B and<br>
not keep<br>
location A and location B both for user A.<br>
<br>
Is there a way to do this. Any help will be highly<br>
appreciiated.<br>
<br>
Thanks in advance.<br>
<br>
--- Jay<br>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>><br>
<mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>>><br>
<mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>><br>
<mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>>>><br>
<br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
<br>
<br>
<br>
</blockquote>
<br>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br></div>