Runtime error with PJSIP_HAS_DIGEST_AKA_AUTH

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

 



Hi
I'm new to pjsip and am trying to see how pjsip works. I've written a
program:


...
> pj_bzero(&info, sizeof info);
>     info.scheme = pj_str("Digest");
>     info.realm = pj_str("*");
>     info.username =  user;
>     info.data_type = PJSIP_CRED_DATA_EXT_AKA;
>     info.data = pj_str("");
>     info.ext.aka.k=pass;
>     info.ext.aka.cb = &pjsip_auth_create_aka_response;
>         if (pjsip_endpt_create_tdata(endpt, &txdata)!=PJ_SUCCESS)
>     {
>         printf("Error in creating tdata buffer\n");
>         exit(1);
>     }
>     if(pjsip_regc_create(endpt, NULL, &register_callback,
> &reg_mod)!=PJ_SUCCESS)
>     {
>         printf("Error in creation of Registration\n");
>         return 1;
>     }
>
>     if( (status = pjsip_regc_init(
>                         reg_mod,
> //pjsip_regc struct
>                         &serverurl,            //server
> url
>                         &fromurl,    //from url
>                         &tourl,    //to url
>                         1,                                     //no of
> contacts
>                         &contact,                             //contact
>                         PJSIP_REGC_EXPIRATION_NOT_SPECIFIED
>
>                         ))!=PJ_SUCCESS)
>     {
>         printf("Error in Initializing Regc: %d \n", status);
>         if (status == PJSIP_EINVALIDURI)
>             printf("PJSIP_EINVALIDURI error\n");
>         else printf("some other\n");
>         return 2;
>     }
>
>     if (pjsip_regc_set_credentials(reg_mod, 1, &info)!=PJ_SUCCESS)
>     {
>         printf("Error in setting credentials to Register Request\n");
>         return 2;
>     }
>
> ...
>
It compiles without error but when running the program I get the following
error.

../src/pjsip/sip_auth_client.c:561: pjsip_auth_clt_set_credentials:
> Assertion `!"PJSIP_HAS_DIGEST_AKA_AUTH is not enabled"' failed.
>

When I include the line:

> #define PJSIP_HAS_DIGEST_AKA_AUTH 1
>
I got a compiler warning:

In file included from ../pjproject-2.0.1/pjsip/include/pjsip/sip_auth.h:28,
> from sock.c:5:
> /home/aalfreds/cprogs/pjproject-2.0.1/pjsip/include/pjsip/sip_config.h:827:1:
> warning: this is the location of the previous definition
>

And when running, the program aborted and gave the message:

sock: ../src/pjsip/sip_auth_client.c:561: pjsip_auth_clt_set_credentials:
> Assertion `!"PJSIP_HAS_DIGEST_AKA_AUTH is not enabled"' failed.
> Aborted
>


I need some help with this. Also what is the correct method to generate a
REGISTER request and start a Dialog.

Regards,
Abhishek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20130305/bf5eb528/attachment-0001.html>


[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