Changes between Version 5 and Version 6 of pjsip-doc/endpoint


Ignore:
Timestamp:
Feb 6, 2014 9:36:33 AM (8 years ago)
Author:
bennylp
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • pjsip-doc/endpoint

    v5 v6  
    44Endpoint 
    55************ 
    6 The ​Endpoint class is a singleton class, and application MUST create one and at most one of this class instance before it can do anything else. This class is the core class of PJSUA2, and it provides the following functions: 
     6The ​Endpoint class is a singleton class, and application MUST create one and at most one of this class instance before it can do anything else, and similarly, once this class is destroyed, application must NOT call any library API. This class is the core class of PJSUA2, and it provides the following functions: 
    77 
    88- Starting up and shutting down 
     
    2626Creating the Library 
    2727---------------------- 
    28 Create the library by calling its libCreate() method:: 
     28Create the library by calling its libCreate() method: 
     29 
     30.. code-block:: c++ 
    2931 
    3032    try { 
     
    4244 
    4345- UAConfig, to specify core SIP user agent settings. 
    44 - MediaConfig, to specify various media settings, including ICE and TURN. 
     46- MediaConfig, to specify various media *global* settings 
    4547- LogConfig, to customize logging settings. 
    4648 
    47 To customize the settings, create instance of EpConfig class and specify them during the endpoint initialization (will be explained more later), for example:: 
     49Note that some settings can be further specified on per account basis, in the AccountConfig. 
     50 
     51To customize the settings, create instance of EpConfig class and specify them during the endpoint initialization (will be explained more later), for example: 
     52 
     53.. code-block:: c++ 
    4854 
    4955    EpConfig ep_cfg; 
     
    5258    ep_cfg.mediaConfig.sndClockRate = 16000; 
    5359 
    54 Next, you can initialize the library by calling libInit():: 
     60Next, you can initialize the library by calling libInit(): 
     61 
     62.. code-block:: c++ 
    5563 
    5664    try { 
     
    6674Creating One or More Transports 
    6775-------------------------------------------------- 
    68 Application needs to create one or more ​transports before it can send or receive SIP messages:: 
     76Application needs to create one or more ​transports before it can send or receive SIP messages: 
     77 
     78.. code-block:: c++ 
    6979 
    7080    try { 
     
    8292Starting the Library 
    8393-------------------- 
    84 Now we're ready to start the library. We need to start the library to finalize the initialization phase, e.g. to complete the initial STUN address resolution, initialize/start the sound device, etc. To start the library, call ​libStart() method:: 
     94Now we're ready to start the library. We need to start the library to finalize the initialization phase, e.g. to complete the initial STUN address resolution, initialize/start the sound device, etc. To start the library, call ​libStart() method: 
     95 
     96.. code-block:: c++ 
    8597 
    8698    try { 
     
    92104Shutting Down the Library 
    93105-------------------------------------- 
    94 Once the application exits, the library needs to be shutdown so that resources can be released back to the operating system. This is done by deleting the Endpoint instance, which will internally call ​libDestroy():: 
     106Once the application exits, the library needs to be shutdown so that resources can be released back to the operating system. Although this can be done by deleting the Endpoint instance, which will internally call ​libDestroy(), it is better to call it manually because on Java or Python there are problems with garbage collection as explained earlier: 
    95107 
    96     // This will implicitly call libDestroy() 
     108.. code-block:: c++ 
     109 
     110    ep->libDestroy(); 
    97111    delete ep; 
    98112