Hi,

I've made a patch for the registrar module (and it's documentation) in order to remove this parameter (attached).
I suggest we should remove this parameter in the next version...

Carsten

Carsten Bock schrieb:
Hi,

After testing this, it works if you set the desc_time_order Parameter in the usrloc module instead of in the registrar module. Now it even works properly after restarting the proxy. I think, the desc_time_order Parameter should be removed from the registrar module, since it does not work as described in the manual.

Carsten

Carsten Bock schrieb:
Hi,

Actually i thought, this might be a good solution, but unfortunately it did not work out properly. What i found out was, that:

a) The Contacts however are not sorted at startup => Upon reload not the newest one is used but the first one loaded. b) The desc_time_order seems only to work with maximum two contacts per user (if the third contact gets updated, it seems like it is only pushed to the second entry and not to the first)

Am i correct, that really the registrar module was meant? The usrloc module also has a parameter (desc_time_order, http://openser.org/docs/modules/1.1.x/usrloc.html#AEN219) and from my point of view it make more sense to have this functionality in usrloc more than in the registrar. I'll test this.

Carsten

Bogdan-Andrei Iancu schrieb:
of course there is contact timeout as each contact is registered for a limited time period.

a more elegant solution is to use the "desc_time_order" and "append_branches" module parameter in order to retrieve from usrloc only the latest contact. See:
   http://openser.org/docs/modules/1.1.x/registrar.html

regards,
bogdan

Steve Blair wrote:


You could also get creative and upon successful registration exec a script that will examine the location table and remove (or manipulate as you want) specific registrations. If these moves happen often this approach will not scale well. If you only need one registration per user then setting the max_contacts parameter is the easiest way to accomplish this goal.

_Steve

Max Gregorian wrote:

Perhaps implement Registration Timeouts.
If the aim is to stop the user from connecting using that IP address, then you could, on OpenSER, do something along the lines of:
   if(src_ip==192.168.0.55 <http://192.168.0.55/>)
   {
      sl_send_reply("404", "User not found..");

   };


On 9/28/06, *Bogdan-Andrei Iancu* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Hi Javier,

    that must be done by the phone.

    regards,
    bogdan

    Javier wrote:

    > can I unregister the the firsth register ?
    >
    >
    >     ----- Original Message -----
    >     *From:* Daniel-Constantin Mierla
    <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
    >     *To:* Javier Ramirez <mailto: [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>>
    >     *Cc:* users <mailto:[email protected]
    <mailto:[email protected]>>
    >     *Sent:* Saturday, September 23, 2006 5:36 PM
    >     *Subject:* Re: [Users] UN-REGISTER
    >
    >     If the user closes the sip client on 0.55, then the client
    should
> automatically un-register. If not, then the user will have two
    >     contacts
    >     and both phones will ring.
    >
    >     If you want to limit the number of registered contacts, you
    can do it
    >     via max_contacts parameter of registrar module:
    >
> http://www.openser.org/docs/modules/1.1.x/registrar.html#AEN233
    >
    >     Cheers,
    >     Daniel
    >
    >
    >     On 09/22/06 23:47, Javier Ramirez wrote:
    >     > Hi, I have a question:
    >     >
> > the user A is register, the ip of register is 192.168.0.55
    <http://192.168.0.55>.
    >     > the user change PC, and this PC have the ip 192.168.0.66
    <http://192.168.0.66>
    >     >
    >     > the user register again, in the new machine, but, how to
    unregister
    >     > the firsth registration from 192.168.0.55
    <http://192.168.0.55> ?
    >     >
    >     > best regards
    >     > Javier
    >     >



_______________________________________________
Users mailing list
[email protected]
http://openser.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[email protected]
http://openser.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[email protected]
http://openser.org/cgi-bin/mailman/listinfo/users


--- /usr/src/orig/openser-1.1.0-tls/modules/registrar/doc/registrar_faq.sgml    
2005-06-13 18:47:44.000000000 +0200
+++ registrar_faq.sgml  2006-10-04 16:01:21.000000000 +0200
@@ -60,6 +60,16 @@
                </para>
            </answer>
        </qandaentry>
+       <qandaentry>
+           <question>
+               <para>What happened to the desc_time_order parameter?</para>
+           </question>
+           <answer>
+               <para>
+                       It was removed, since it did only work for updated 
contacts and for not more than two contacts.         
+               </para>
+           </answer>
+       </qandaentry>
     </qandaset>
 </chapter>
 
--- /usr/src/orig/openser-1.1.0-tls/modules/registrar/doc/registrar_user.sgml   
2006-04-13 18:44:04.000000000 +0200
+++ registrar_user.sgml 2006-10-04 16:01:21.000000000 +0200
@@ -364,28 +364,6 @@
        </section>
 
        <section>
-               <title><varname>desc_time_order</varname> (integer)</title>
-               <para>
-               If set to 1 then all contacts will be ordered in descending 
-               modification time order. In this case the most recently 
-               updated/created contact will be used.
-               </para>
-               <para>
-               <emphasis>
-                       Default value is 0.
-               </emphasis>
-               </para>
-               <example>
-               <title>Set <varname>desc_time_order</varname> parameter</title>
-               <programlisting format="linespecific">
-...
-modparam("registrar", "desc_time_order", 1)
-...
-</programlisting>
-               </example>
-       </section>
-
-       <section>
                <title><varname>received_avp</varname> (integer)</title>
                <para>
                Registrar will store the value of the AVP configured by this 
--- /usr/src/orig/openser-1.1.0-tls/modules/registrar/reg_mod.c 2006-04-13 
18:44:04.000000000 +0200
+++ reg_mod.c   2006-10-04 15:59:16.000000000 +0200
@@ -29,6 +29,9 @@
  *              <[EMAIL PROTECTED]> (janakj)
  *  2005-07-11  added sip_natping_flag for nat pinging with SIP method
  *              instead of UDP package (bogdan)
+ *  2006-10-04  removed the "desc_time_order" parameter, since it does not
+ *              work as described and the "desc_time_order" parameter is also
+ *              available in the usrloc module. (Carsten Bock, BASIS AudioNet 
GmbH)
  */
 
 #include <stdio.h>
@@ -63,8 +66,6 @@
 int append_branches = 1;
 /* If set to 1, username in aor will be case sensitive */
 int case_sensitive  = 0;
-/* By default do not order according to the descending modification time */
-int desc_time_order = 0;
 /* flag marking contacts behind NAT */
 int nat_flag        = -1;
 /* if the TCP connection should be kept open */
@@ -145,7 +146,6 @@
        {"default_q",          INT_PARAM, &default_q           },
        {"append_branches",    INT_PARAM, &append_branches     },
        {"case_sensitive",     INT_PARAM, &case_sensitive      },
-       {"desc_time_order",    INT_PARAM, &desc_time_order     },
        {"nat_flag",           INT_PARAM, &nat_flag            },
        {"sip_natping_flag",   INT_PARAM, &sip_natping_flag    },
        {"tcp_persistent_flag",INT_PARAM, &tcp_persistent_flag },
--- /usr/src/orig/openser-1.1.0-tls/modules/registrar/reg_mod.h 2006-04-13 
18:44:04.000000000 +0200
+++ reg_mod.h   2006-10-04 15:51:00.000000000 +0200
@@ -54,7 +54,6 @@
 extern qvalue_t default_q;
 extern int append_branches;
 extern int case_sensitive;
-extern int desc_time_order;
 extern int nat_flag;
 extern int sip_natping_flag;
 extern int tcp_persistent_flag;
--- /usr/src/orig/openser-1.1.0-tls/modules/registrar/save.c    2006-07-04 
12:58:32.000000000 +0200
+++ save.c      2006-10-04 15:51:00.000000000 +0200
@@ -60,41 +60,6 @@
 static int mem_only = 0;
 int_str rcv_avp;
 
-void remove_cont(urecord_t* _r, ucontact_t* _c)
-{
-       if (_c->prev) {
-               _c->prev->next = _c->next;
-               if (_c->next) {
-                       _c->next->prev = _c->prev;
-               }
-       } else {
-               _r->contacts = _c->next;
-               if (_c->next) {
-                       _c->next->prev = 0;
-               }
-       }
-}
-
-
-void move_on_top(urecord_t* _r, ucontact_t* _c)
-{
-       ucontact_t* prev;
-
-       if (!_r->contacts) return;
-       if (_c->prev == 0) return;
-
-       prev = _c->prev;
-
-       remove_cont(_r, _c);
-       
-       _c->next = _r->contacts;
-       _c->prev = 0;
-
-       _r->contacts->prev = _c;
-       _r->contacts = _c;
-}
-
-
 /*
  * Process request that contained a star, in that case, 
  * we will remove all bindings with the given username 
@@ -670,10 +635,6 @@
                                                "update contact\n");
                                        goto error;
                                }
-
-                               if (desc_time_order) {
-                                       move_on_top(_r, c);
-                               }
                        }
                }
 #ifdef USE_TCP
_______________________________________________
Users mailing list
[email protected]
http://openser.org/cgi-bin/mailman/listinfo/users

Reply via email to