PJSUA account config, changes in contact_params not applied on update ( BUG )

LO
Lars Olsson
Thu, Mar 7, 2019 4:51 PM

I am setting custom parameters in pjsua_acc_config::contact_params.

When applying a change to contact_params with pjsua_acc_modify, a
reregistration is correctly triggered, but contact params are still the old
ones. (not updated)

Very simple patch is to handle it in the same way as for "forced_contact",

--- a/pjsip/src/pjsua-lib/pjsua_acc.c  Thu Mar 07 14:08:59 2019 +0100

+++ b/pjsip/src/pjsua-lib/pjsua_acc.c  Thu Mar 07 17:45:28 2019 +0100

@@ -1020,6 +1020,7 @@

    pj_strdup_with_null(acc->pool, &acc->cfg.contact_params,

                        &cfg->contact_params);

    update_reg = PJ_TRUE;
  •   unreg_first = PJ_TRUE;
    

    }

But this causes a unregistration that I do no think is needed. It should be
enough with doing a reregister.  While testing, contact rewrite feature is
disabled.

Best Regards,

Lars

I am setting custom parameters in pjsua_acc_config::contact_params. When applying a change to contact_params with pjsua_acc_modify, a reregistration is correctly triggered, but contact params are still the old ones. (not updated) Very simple patch is to handle it in the same way as for "forced_contact", *--- a/pjsip/src/pjsua-lib/pjsua_acc.c Thu Mar 07 14:08:59 2019 +0100* *+++ b/pjsip/src/pjsua-lib/pjsua_acc.c Thu Mar 07 17:45:28 2019 +0100* @@ -1020,6 +1020,7 @@ pj_strdup_with_null(acc->pool, &acc->cfg.contact_params, &cfg->contact_params); update_reg = PJ_TRUE; + unreg_first = PJ_TRUE; } But this causes a unregistration that I do no think is needed. It should be enough with doing a reregister. While testing, contact rewrite feature is disabled. Best Regards, Lars
M
Ming
Fri, Mar 8, 2019 6:57 AM

Hi Lars,

We commit the fix in r5946 (https://trac.pjsip.org/repos/changeset/5946).
Unregistration is not ideal indeed, unfortunately updating the Contact is
rather complicated, especially if the Contact address has been rewritten by
allow_contact_rewrite.

Regards,
Ming

On Fri, Mar 8, 2019 at 12:51 AM Lars Olsson lars.olsson76@gmail.com wrote:

I am setting custom parameters in pjsua_acc_config::contact_params.

When applying a change to contact_params with pjsua_acc_modify, a
reregistration is correctly triggered, but contact params are still the old
ones. (not updated)

Very simple patch is to handle it in the same way as for "forced_contact",

--- a/pjsip/src/pjsua-lib/pjsua_acc.c  Thu Mar 07 14:08:59 2019 +0100

+++ b/pjsip/src/pjsua-lib/pjsua_acc.c  Thu Mar 07 17:45:28 2019 +0100

@@ -1020,6 +1020,7 @@

     pj_strdup_with_null(acc->pool, &acc->cfg.contact_params,

                         &cfg->contact_params);

     update_reg = PJ_TRUE;
  •   unreg_first = PJ_TRUE;
    

    }

But this causes a unregistration that I do no think is needed. It should
be enough with doing a reregister.  While testing, contact rewrite feature
is disabled.

Best Regards,

Lars


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Hi Lars, We commit the fix in r5946 (https://trac.pjsip.org/repos/changeset/5946). Unregistration is not ideal indeed, unfortunately updating the Contact is rather complicated, especially if the Contact address has been rewritten by allow_contact_rewrite. Regards, Ming On Fri, Mar 8, 2019 at 12:51 AM Lars Olsson <lars.olsson76@gmail.com> wrote: > I am setting custom parameters in pjsua_acc_config::contact_params. > > When applying a change to contact_params with pjsua_acc_modify, a > reregistration is correctly triggered, but contact params are still the old > ones. (not updated) > > Very simple patch is to handle it in the same way as for "forced_contact", > > *--- a/pjsip/src/pjsua-lib/pjsua_acc.c Thu Mar 07 14:08:59 2019 +0100* > > *+++ b/pjsip/src/pjsua-lib/pjsua_acc.c Thu Mar 07 17:45:28 2019 +0100* > > @@ -1020,6 +1020,7 @@ > > pj_strdup_with_null(acc->pool, &acc->cfg.contact_params, > > &cfg->contact_params); > > update_reg = PJ_TRUE; > > + unreg_first = PJ_TRUE; > > } > > > But this causes a unregistration that I do no think is needed. It should > be enough with doing a reregister. While testing, contact rewrite feature > is disabled. > > > Best Regards, > > Lars > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >