We recently ran into some issues with Snom360s. When GRUU is added to contact, 
the device stops sending PUBLISH for presence updates.

Attached is a patch for disabling the added GRUU to the contact header. The 
setting is as follow

modparam("registrar", "add_gruu_to_contact", 0)

Default value is 1.

I think the idle case would be enabling & disabling the GRUU with a PVAR.

Index: modules/registrar/reg_mod.c
===================================================================
--- modules/registrar/reg_mod.c (revision 8952)
+++ modules/registrar/reg_mod.c (working copy)
@@ -98,8 +98,8 @@
                                                 * use 0 to switch expires 
checking off */
 int max_contacts = 0;          /*!< Maximum number of contacts per AOR (0=no 
checking) */
 int retry_after = 0;                           /*!< The value of Retry-After 
HF in 5xx replies */
+int add_gruu_to_contact = 1;
 
-
 char* rcv_avp_param = 0;
 unsigned short rcv_avp_type = 0;
 int rcv_avp_name;
@@ -180,6 +180,7 @@
        {"sock_hdr_name",      STR_PARAM, &sock_hdr_name.s     },
        {"mcontact_avp",       STR_PARAM, &mct_avp_param       },
        {"gruu_secret",        STR_PARAM, &gruu_secret.s       },
+  {"add_gruu_to_contact",INT_PARAM, &add_gruu_to_contact },
        {0, 0, 0}
 };
 
Index: modules/registrar/reg_mod.h
===================================================================
--- modules/registrar/reg_mod.h (revision 8952)
+++ modules/registrar/reg_mod.h (working copy)
@@ -88,6 +88,7 @@
 extern int reg_use_domain;
 extern str realm_prefix;
 extern float def_q;
+extern int add_gruu_to_contact;
 
 extern unsigned short rcv_avp_type;
 extern int rcv_avp_name;
Index: modules/registrar/reply.c
===================================================================
--- modules/registrar/reply.c   (revision 8952)
+++ modules/registrar/reply.c   (working copy)
@@ -282,7 +282,7 @@
                                *p++ = '\"';
                        }
 
-                       if (c->instance.s) {
+                       if (add_gruu_to_contact && c->instance.s) {
                                /* build pub GRUU */
                                memcpy(p,PUB_GRUU,PUB_GRUU_SIZE);
                                p += PUB_GRUU_SIZE;
Index: modules/registrar/doc/registrar_admin.xml
===================================================================
--- modules/registrar/doc/registrar_admin.xml   (revision 8952)
+++ modules/registrar/doc/registrar_admin.xml   (working copy)
@@ -482,8 +482,27 @@
 ...
                </programlisting>
                </example>
+  </section>
+       <section>
+               <title><varname>add_gruu_to_contact</varname> (integer)</title>
+               <para>
+               If set to 1, gruu is added to the contact.
+               </para>
+               <para>
+               <emphasis>
+                       Default value is 1.
+               </emphasis>
+               </para>
+               <example>
+               <title>Set <varname>add_gruu_to_contact</varname> 
parameter</title>
+               <programlisting format="linespecific">
+...
+modparam("registrar", "add_gruu_to_contact", 0)
+...
+               </programlisting>
+               </example>
+  </section>
        </section>
-       </section>
 
        <section>
        <title>Exported Functions</title>
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to