problem with sample program ? (status = pjsua_acc_add(&cfg, PJ_TRUE, &acc_id); )

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

 



Hi,

status = pjsua_acc_add(&cfg, PJ_TRUE, &acc_id);
Add this account and make it the default account. acc_id is the index returned for the account added successfully.

PJSUA supports multiple accounts.  The id is required for almost everything u want to do - register, make call, etc. If u only have 1 account enable then u dont have to worry about the id - as its mostly will be 0, or u can use pjsua_get_default(). But when u have multiple accounts and wants to work with a non default account, thats when u will need to "remember" which of the ids to use.

best,
Nigel

From: humc@xxxxxxxxxxxxx
To: pjsip at lists.pjsip.org
Date: Thu, 20 Nov 2008 16:30:14 +0800
Subject: Re: problem with sample program ? (status =	pjsua_acc_add(&cfg, PJ_TRUE, &acc_id); )

Hi,

    There is  source code in pjsua_acc.c. 



271    for (id=0; id < PJ_ARRAY_SIZE(pjsua_var.acc); ++id)
{

272    if (pjsua_var.acc[id].valid == PJ_FALSE)

273        break;

            }

and 



317    if (p_acc_id)

318    *p_acc_id = id;



 I  think we get the value  by this way.But i don't
sure.



 









20/11/08 16:20:29, nitu dhanurved <nitudhanurved16 at gmail.com>:

hi,

   can any one explain me what is the
meaning of  this line: 

status = pjsua_acc_add(&cfg, PJ_TRUE, &acc_id);

 from where it is getting value for  acc_id.

because in sample program we are defining the configuration for the account
(cfg) but not the id, from where it will get the value??



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




_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20081120/c91a5201/attachment.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