Error printed when deleting a registered pj::Account

BC
b17 c0de
Fri, Oct 7, 2016 9:07 AM

Hi,
When I delete a pj::Account that is registered, the following is
printed in the console:

endpoint.cpp !..Error: cannot find Account instance for account id X
in on_reg_started()

This happens because Account::~Account() does:

pjsua_acc_set_user_data(id, NULL);
pjsua_acc_del(id);

and pjsua_acc_del(id) calls Endpoint::on_reg_started(id, PJ_FALSE)

This appears to be harmless. Should the error print simply be removed?
Or is there a better solution to avoiding this error?

Thanks,
Kal

Hi, When I delete a pj::Account that is registered, the following is printed in the console: endpoint.cpp !..Error: cannot find Account instance for account id X in on_reg_started() This happens because Account::~Account() does: pjsua_acc_set_user_data(id, NULL); pjsua_acc_del(id); and pjsua_acc_del(id) calls Endpoint::on_reg_started(id, PJ_FALSE) This appears to be harmless. Should the error print simply be removed? Or is there a better solution to avoiding this error? Thanks, Kal
BC
b17 c0de
Fri, Oct 7, 2016 9:14 AM

Note, as a workaround I also tried to always call
Account::setRegistration(false) before Account::~Account() is called.
But then this error is always printed:

pjsua_acc.c  ..Unable to create/send REGISTER: Object is busy
(PJSIP_EBUSY) [status=171001]

On Fri, Oct 7, 2016 at 11:07 AM, b17 c0de b17c0de@gmail.com wrote:

Hi,
When I delete a pj::Account that is registered, the following is
printed in the console:

endpoint.cpp !..Error: cannot find Account instance for account id X
in on_reg_started()

This happens because Account::~Account() does:

pjsua_acc_set_user_data(id, NULL);
pjsua_acc_del(id);

and pjsua_acc_del(id) calls Endpoint::on_reg_started(id, PJ_FALSE)

This appears to be harmless. Should the error print simply be removed?
Or is there a better solution to avoiding this error?

Thanks,
Kal

Note, as a workaround I also tried to always call Account::setRegistration(false) before Account::~Account() is called. But then this error is always printed: pjsua_acc.c ..Unable to create/send REGISTER: Object is busy (PJSIP_EBUSY) [status=171001] On Fri, Oct 7, 2016 at 11:07 AM, b17 c0de <b17c0de@gmail.com> wrote: > Hi, > When I delete a pj::Account that is registered, the following is > printed in the console: > > endpoint.cpp !..Error: cannot find Account instance for account id X > in on_reg_started() > > This happens because Account::~Account() does: > > pjsua_acc_set_user_data(id, NULL); > pjsua_acc_del(id); > > and pjsua_acc_del(id) calls Endpoint::on_reg_started(id, PJ_FALSE) > > This appears to be harmless. Should the error print simply be removed? > Or is there a better solution to avoiding this error? > > Thanks, > Kal
NI
Nanang Izzuddin
Fri, Oct 21, 2016 7:41 AM

Hi Kal,

The easiest fix seems to be removing this line:

pjsua_acc_set_user_data(id, NULL);

This seems to be harmless as acc->valid is set to FALSE immediately by
pjsua_acc_del(). Just checked in this to SVN trunk at
https://trac.pjsip.org/repos/changeset/5466.

Thank you for the report.

BR,
nanang

On Fri, Oct 7, 2016 at 4:14 PM, b17 c0de b17c0de@gmail.com wrote:

Note, as a workaround I also tried to always call
Account::setRegistration(false) before Account::~Account() is called.
But then this error is always printed:

pjsua_acc.c  ..Unable to create/send REGISTER: Object is busy
(PJSIP_EBUSY) [status=171001]

On Fri, Oct 7, 2016 at 11:07 AM, b17 c0de b17c0de@gmail.com wrote:

Hi,
When I delete a pj::Account that is registered, the following is
printed in the console:

endpoint.cpp !..Error: cannot find Account instance for account id X
in on_reg_started()

This happens because Account::~Account() does:

pjsua_acc_set_user_data(id, NULL);
pjsua_acc_del(id);

and pjsua_acc_del(id) calls Endpoint::on_reg_started(id, PJ_FALSE)

This appears to be harmless. Should the error print simply be removed?
Or is there a better solution to avoiding this error?

Thanks,
Kal

Hi Kal, The easiest fix seems to be removing this line: -- pjsua_acc_set_user_data(id, NULL); -- This seems to be harmless as acc->valid is set to FALSE immediately by pjsua_acc_del(). Just checked in this to SVN trunk at https://trac.pjsip.org/repos/changeset/5466. Thank you for the report. BR, nanang On Fri, Oct 7, 2016 at 4:14 PM, b17 c0de <b17c0de@gmail.com> wrote: > Note, as a workaround I also tried to always call > Account::setRegistration(false) before Account::~Account() is called. > But then this error is always printed: > > pjsua_acc.c ..Unable to create/send REGISTER: Object is busy > (PJSIP_EBUSY) [status=171001] > > On Fri, Oct 7, 2016 at 11:07 AM, b17 c0de <b17c0de@gmail.com> wrote: > > Hi, > > When I delete a pj::Account that is registered, the following is > > printed in the console: > > > > endpoint.cpp !..Error: cannot find Account instance for account id X > > in on_reg_started() > > > > This happens because Account::~Account() does: > > > > pjsua_acc_set_user_data(id, NULL); > > pjsua_acc_del(id); > > > > and pjsua_acc_del(id) calls Endpoint::on_reg_started(id, PJ_FALSE) > > > > This appears to be harmless. Should the error print simply be removed? > > Or is there a better solution to avoiding this error? > > > > Thanks, > > Kal > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >