Changes between Version 6 and Version 7 of pjsip-doc/account


Ignore:
Timestamp:
Feb 10, 2014 8:54:18 AM (8 years ago)
Author:
bennylp
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • pjsip-doc/account

    v6 v7  
    6262Creating Userless Accounts 
    6363-------------------------- 
    64 A userless account identifies a particular SIP endpoint rather than a particular user. Some other SIP softphones may call this peer-to-peer mode, which means that we are calling another computer via its address rather than calling a particular user ID. 
     64A userless account identifies a particular SIP endpoint rather than a particular user. Some other SIP softphones may call this peer-to-peer mode, which means that we are calling another computer via its address rather than calling a particular user ID. For example, we might identify ourselves as "sip:192.168.0.15" (a userless account) rather than, say, "sip:alice@pjsip.org". 
    6565 
    66 So for example, we might identify ourselves as "sip:192.168.0.15" (a userless account) rather than, say, "sip:alice@pjsip.org". 
     66In the lower layer PJSUA-LIB API, a userless account is associated with a SIP transport, and is created with ``pjsua_acc_add_local()`` API. This concept has been deprecated in PJSUA2, and rather, a userless account is a "normal" account with a userless ID URI (e.g. "sip:192.168.0.15") and without registration. Thus creating a userless account is exactly the same as creating "normal" account. 
    6767 
    68 In pjsua, a userless account corresponds to a particular transport. Creating userless account is very simple, all we need is the transport ID which is returned by ​Endpoint.transportCreate() method as explained in previous chapter. 
    69  
    70 Here's a snippet:: 
    71  
    72     AccountConfig acc_cfg; 
    73     acc_cfg.sipConfig.transportId = tid; 
    74     MyAccount *acc = new MyAccount; 
    75     try { 
    76         acc->create(acc_cfg); 
    77     } catch(Error& err) { 
    78         cout << "Account creation error: " << err.info() << endl; 
    79     } 
    80  
    81 Once the account is created, you can use the instance as a normal account. More will be explained later. 
    82  
    83 Accounts created this way will have its URI derived from the transport address. For example, if the transport address is "192.168.0.15:5080", then the account's URI for UDP transport will be "sip:192.168.0.15:5080", or "sip:192.168.0.15:5080;transport=tcp" for TCP transport. 
    8468 
    8569Creating Account 
    8670---------------- 
    87 For the "normal" account, we need to configure ​AccountConfig and call ​Account.create() to create the account. 
     71We need to configure ​AccountConfig and call ​Account.create() to create the account. At the very minimum, pjsua only requires the account's ID, which is an URI to identify the account (or in SIP terms, it's called Address of Record/AOR). Here's a snippet: 
    8872 
    89 At the very minimum, pjsua only requires the account's ID, which is an URI to identify the account (or in SIP terms, it's called Address of Record/AOR). Here's a snippet:: 
     73.. code-block:: c++ 
    9074 
    9175    AccountConfig acc_cfg; 
    9276    acc_cfg.idUri = "sip:test1@pjsip.org"; 
     77 
    9378    MyAccount *acc = new MyAccount; 
    9479    try { 
     
    10085The account created above doesn't do anything except to provide identity in the "From:" header for outgoing requests. The account will not register to SIP server or anything. 
    10186 
    102 Typically you will want the account to authenticate and register to your SIP server so that you can receive incoming calls. To do that you will need to configure some more settings in your ​AccountConfig, something like this:: 
     87Typically you will want the account to authenticate and register to your SIP server so that you can receive incoming calls. To do that you will need to configure some more settings in your ​AccountConfig, something like this: 
     88 
     89.. code-block:: c++ 
    10390 
    10491    AccountConfig acc_cfg; 
    10592    acc_cfg.idUri = "sip:test1@pjsip.org"; 
    10693    acc_cfg.regConfig.registrarUri = "sip:pjsip.org"; 
    107     acc_cfg.sipConfig.authCreds.push_back( AuthCredInfo("digest", "*", "test1", 0, "test1") ); 
     94    acc_cfg.sipConfig.authCreds.push_back( AuthCredInfo("digest", "*", "test1", 0, "secret1") ); 
     95 
    10896    MyAccount *acc = new MyAccount; 
    10997    try { 
     
    132120Some of the operations to the ​Account object: 
    133121 
    134 - add buddy objects 
    135 - set account's presence online status 
    136 - stop/start SIP registration 
     122- manage registration 
     123- manage buddies/contacts 
     124- manage presence online status 
    137125 
    138126Please see the reference documentation for Account for more info. Calls, presence, and buddy will be explained in later chapters.