Hi All,
I'm trying to catch events for a failed registration (incorrect username,
password, etc). For this I do this:
void CCallManager::OnRegState (pjsua_acc_id acc_id) //handler for
on_reg_state handler
{
pjsua_acc_info acc_info;
pjsua_acc_get_info (acc_id, &acc_info);
switch (acc_info.status)
{
...
}
}
acc_info.status is showing a value of 171100 when I enter an incorrect
password, shouldn't it hold a 401? Am I missing something over here?
Between, for an un-registration request (pjsua_acc_set_registration(acc_id,
PJ_FALSE)), does PJSIP throw any events to indicate a successful
un-registration? Or it will just have a 200 in acc_info.status inside
on_reg_state handler?
Thanks.
Best Regards,
Hitesh
logan wrote:
acc_info.status is showing a value of 171100 when I enter an incorrect
password, shouldn't it hold a 401? Am I missing something over here?
Maybe it should, but it doesn't. :)
The reason why it doesn't was because this is an error situation;
the error was because the username/password is wrong
(PJSIP_EFAILEDCREDENTIAL).
Between, for an un-registration request (pjsua_acc_set_registration(acc_id,
PJ_FALSE)), does PJSIP throw any events to indicate a successful
un-registration? Or it will just have a 200 in acc_info.status inside
on_reg_state handler?
It will. The on_reg_state() callback should also be called for a
successful unregistration.
regards,
-benny
Thanks.
Best Regards,
Hitesh
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
--
Benny Prijono
http://www.pjsip.org
Hello Benny,
Thanks for the response.
If I'm not mistaken then the registration is done by pjsua_acc_add ().
And this returns a PJ_SUCCESS so how do I check for the error?
Thanks.
Best Regards,
Hitesh
On 10/4/07, Benny Prijono bennylp@pjsip.org wrote:
logan wrote:
acc_info.status is showing a value of 171100 when I enter an incorrect
password, shouldn't it hold a 401? Am I missing something over here?
Maybe it should, but it doesn't. :)
The reason why it doesn't was because this is an error situation;
the error was because the username/password is wrong
(PJSIP_EFAILEDCREDENTIAL).
Between, for an un-registration request (pjsua_acc_set_registration(acc_id,
PJ_FALSE)), does PJSIP throw any events to indicate a successful
un-registration? Or it will just have a 200 in acc_info.status inside
on_reg_state handler?
It will. The on_reg_state() callback should also be called for a
successful unregistration.
regards,
-benny
Thanks.
Best Regards,
Hitesh
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
--
Benny Prijono
http://www.pjsip.org
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
logan wrote:
Hello Benny,
Thanks for the response.
If I'm not mistaken then the registration is done by pjsua_acc_add ().
Yes, and also pjsua_acc_set_registration().
And this returns a PJ_SUCCESS so how do I check for the error?
[un]Registration will complete asynchronously, and the result will
be reported through on_reg_state() callback. In this callback, you
can get the status of the [un]registration in the pjsua_acc_info.
cheers,
-benny
Thanks.
Best Regards,
Hitesh
Hi Benny,
In pjsua_acc_get_info, shouldn't we first check for acc->reg_last_code and
set the last SIP code in info->status? This gives me the valid SIP response
401, 407, etc.
Thanks.
Best Regards,
Hitesh
----- Original Message -----
From: "Benny Prijono" bennylp@pjsip.org
To: "pjsip embedded/DSP SIP discussion" pjsip@lists.pjsip.org
Sent: Thursday, October 04, 2007 9:14 PM
Subject: Re: [pjsip] Register events
logan wrote:
acc_info.status is showing a value of 171100 when I enter an incorrect
password, shouldn't it hold a 401? Am I missing something over here?
Maybe it should, but it doesn't. :)
The reason why it doesn't was because this is an error situation;
the error was because the username/password is wrong
(PJSIP_EFAILEDCREDENTIAL).
Between, for an un-registration request
(pjsua_acc_set_registration(acc_id,
PJ_FALSE)), does PJSIP throw any events to indicate a successful
un-registration? Or it will just have a 200 in acc_info.status inside
on_reg_state handler?
It will. The on_reg_state() callback should also be called for a
successful unregistration.
regards,
-benny
Thanks.
Best Regards,
Hitesh
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
--
Benny Prijono
http://www.pjsip.org
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
logan wrote:
Hi Benny,
In pjsua_acc_get_info, shouldn't we first check for acc->reg_last_code and
set the last SIP code in info->status? This gives me the valid SIP response
401, 407, etc.
That might be true, but some applications have been depending on
current status assignment, so I'm rather reluctant to change it. In
any case, I think this only applies for 401 and 407, and for other
status you should get the status code as expected.
regards,
-benny
Thanks.
Best Regards,
Hitesh
----- Original Message -----
From: "Benny Prijono" bennylp@pjsip.org
To: "pjsip embedded/DSP SIP discussion" pjsip@lists.pjsip.org
Sent: Thursday, October 04, 2007 9:14 PM
Subject: Re: [pjsip] Register events
logan wrote:
acc_info.status is showing a value of 171100 when I enter an incorrect
password, shouldn't it hold a 401? Am I missing something over here?
Maybe it should, but it doesn't. :)
The reason why it doesn't was because this is an error situation;
the error was because the username/password is wrong
(PJSIP_EFAILEDCREDENTIAL).
Between, for an un-registration request
(pjsua_acc_set_registration(acc_id,
PJ_FALSE)), does PJSIP throw any events to indicate a successful
un-registration? Or it will just have a 200 in acc_info.status inside
on_reg_state handler?
It will. The on_reg_state() callback should also be called for a
successful unregistration.
regards,
-benny