Getting Registration Status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Am 26.04.2011 09:44, schrieb Ogla Sungutay:
> I'm using the on_reg_state2 callback. That will give you additional
> registration information, specifically code and status.
> 
> On Tue, Apr 26, 2011 at 7:43 AM, anilgpt <anilgpt at yahoo.com
> <mailto:anilgpt at yahoo.com>> wrote:
> 
>     Hi,
> 
>     I have compiled a sample application and need to know how to handle
>     on_reg_state. I need to get information whether the account
>     registration succeeded or failed. For the purpose, i googled and
>     found that using pjsua_acc_get_info(...), we can get the status of
>     registration. This is what i have done..
> 
>     static void on_reg_state(pjsua_acc_id acc_id)
>     {
>       PJ_UNUSED_ARG(acc_id);
>       pjsua_acc_info acc_info;
>       pj_status_t status;
>       status = pjsua_acc_get_info(acc_id, &acc_info);
>       if (status != PJ_SUCCESS)
>         return;
> 
>      MessageBox(NULL,acc_info.status_test.ptr,"Test",MB_OK);
>     }
> 
>     Using the above block, even when registration failed or registration
>     succeeded, it gives acc_info.status_test.ptr as OK (200) and
>     acc_info.status gives 200.
> 
>     But going through wireshark capture, it gave "200 Auth Failed" for
>     failed registration and "200 OK" for successful registration.

If the server sends "200 Auth Failed" then the server is strange: 200
means OK, regardless of the reason string after the response code.

regards
klaus



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux