how to register in server? (with simpleua code)

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

 



pjsua api has complete sourcecode example for register.

below code is ok after I write a simple test program.

 pjsua_acc_id pjAccId = -1;
 pjsua_acc_config acc_cfg;
 pjsua_acc_config_default(&acc_cfg);
 acc_cfg.id = pj_str(full_sip_url);
 if (registrar_uri != NULL)
 {
  acc_cfg.reg_uri = pj_str(registrar_uri);
  if (expires > 0)
   acc_cfg.reg_timeout = expires;
 }
 if (strlen(auth_username) > 0)
 {
  acc_cfg.cred_count = 1;
  acc_cfg.cred_info[0].scheme = pj_str("Digest");
  if (realm != NULL)
   acc_cfg.cred_info[0].realm = pj_str(realm);
  else
   acc_cfg.cred_info[0].realm = pj_str("*");
  acc_cfg.cred_info[0].username = pj_str(auth_username);
  acc_cfg.cred_info[0].data_type = 0;
  acc_cfg.cred_info[0].data = pj_str(auth_password);
 }
 if (outbound_proxy != NULL)
 {
  acc_cfg.proxy[0] = pj_str(outbound_proxy);
  acc_cfg.proxy_cnt = 1;
 }
 pj_status_t status = pjsua_acc_add(&acc_cfg, (is_default?PJ_TRUE:PJ_FALSE),
&pjAccId);
 if (status != PJ_SUCCESS) {
     pjsua_perror(THIS_FILE, "ERR adding new account", status);
 }




On Fri, Nov 21, 2008 at 3:15 PM, nitu dhanurved
<nitudhanurved16 at gmail.com>wrote:

> hi,
>     i am following simpleua, which is giving in samples in pjproject, but i
> am not able to making registration (register to a server).
>
> i am adding some lines for registration that is:
> cfg.id = pj_str("sip:" SIP_USER "@" SIP_DOMAIN);
>     cfg.reg_uri = pj_str("sip:" SIP_DOMAIN);
>     cfg.cred_count = 1;
>     cfg.cred_info[0].realm = pj_str(SIP_DOMAIN);
>     cfg.cred_info[0].scheme = pj_str("digest");
>     cfg.cred_info[0].username = pj_str(SIP_USER);
>     cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD;
>     cfg.cred_info[0].data = pj_str(SIP_PASSWD);
>
> status = pjsua_acc_add(&cfg, PJ_TRUE, &acc_id);
>     PJ_ASSERT_RETURN(status == PJ_SUCCESS,1);
>
> but it is not working, can anyone explain me what should i do???
>
> Regards
> New_bie
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20081126/b3a4b8ac/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