Changeset 918


Ignore:
Timestamp:
Jan 31, 2007 8:53:31 PM (17 years ago)
Author:
bennylp
Message:

Updated PJSUA-API docs for Python and some bug fixes in Python module

Location:
pjproject/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/py_pjsua/py_pjsua.c

    r916 r918  
    71827182        translate_hdr(pool, &msg_data.hdr_list, omd->hdr_list); 
    71837183        status = pjsua_call_make_call(acc_id, &dst_uri,  
    7184                         options, &user_data, &msg_data, &call_id);       
     7184                        options, (void*)user_data, &msg_data, &call_id);         
    71857185        pj_pool_release(pool); 
    71867186    } else { 
    71877187        status = pjsua_call_make_call(acc_id, &dst_uri,  
    7188                         options, &user_data, NULL, &call_id);    
     7188                        options, (void*)user_data, NULL, &call_id);      
    71897189    } 
    71907190 
     
    73397339    }    
    73407340     
    7341     status = pjsua_call_set_user_data(call_id, &user_data); 
     7341    status = pjsua_call_set_user_data(call_id, (void*)user_data); 
    73427342     
    73437343     
     
    73527352{        
    73537353    int call_id; 
    7354     int * user_data;     
     7354    void * user_data;    
    73557355     
    73567356 
     
    73637363     
    73647364     
    7365     return Py_BuildValue("i", *user_data); 
     7365    return Py_BuildValue("i", (int)user_data); 
    73667366} 
    73677367 
  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h

    r911 r918  
    4848 
    4949 
    50 /** 
    51  * @defgroup PJSUA_LIB PJSUA API 
     50PJ_BEGIN_DECL 
     51 
     52 
     53/** 
     54 * @defgroup PJSUA_LIB PJSUA API - High Level Softphone API for C/C++ and Python 
    5255 * @ingroup PJSIP 
    5356 * @brief Very high level API for constructing SIP UA applications. 
    5457 * @{ 
    5558 * 
    56  * PJSUA API is very high level API for constructing SIP user agent 
     59 * @section pjsua_api_intro A SIP User Agent API for C/C++ and Python 
     60 * 
     61 * PJSUA API is very high level API, available for C/C++ and Python language, 
     62 * for constructing SIP multimedia user agent 
    5763 * applications. It wraps together the signaling and media functionalities 
    5864 * into an easy to use call API, provides account management, buddy 
     
    6167 * voice recording, and so on. 
    6268 * 
     69 * @subsection pjsua_for_c_cpp C/C++ Binding 
    6370 * Application must link with <b>pjsua-lib</b> to use this API. In addition, 
    6471 * this library depends on the following libraries: 
     
    7178 *  - <b>pjlib</b>,  
    7279 * 
    73  * so application must also link with these libraries as well. 
    74  * 
     80 * so application must also link with these libraries as well. For more  
     81 * information, please refer to  
     82 * <A HREF="http://www.pjsip.org/using.htm">Getting Started with PJSIP</A> 
     83 * page. 
     84 * 
     85 * @subsection pjsua_for_python Python Binding 
     86 * 
     87 * The Python binding for PJSUA-API is implemented by <b>py_pjsua</b> 
     88 * module, in <tt>pjsip-apps/py_pjsua</tt> directory. This module is 
     89 * built by building <tt>py_pjsua</tt> project in <tt>pjsip_apps</tt> 
     90 * Visual Studio workspace, or by invoking the usual <tt>setup.py</tt> 
     91 * Python installer script. 
     92 * 
     93 * The Python script then can import the PJSUA-API Python module by 
     94 * using <b>import py_pjsua</b> construct as usual. 
     95 * 
     96 * 
     97 * @section pjsua_samples 
     98 * 
     99 * Few samples are provided both in C and Python. 
     100 * 
     101  - @ref page_pjsip_sample_simple_pjsuaua_c\n 
     102    Very simple SIP User Agent with registration, call, and media, using 
     103    PJSUA-API, all in under 200 lines of code. 
     104 
     105  - @ref page_pjsip_samples_pjsua\n 
     106    This is the reference implementation for PJSIP and PJMEDIA. 
     107    PJSUA is a console based application, designed to be simple enough 
     108    to be readble, but powerful enough to demonstrate all features 
     109    available in PJSIP and PJMEDIA.\n 
     110 
     111  - Python sample\n 
     112    For a real simple Python sample application, have a look at 
     113    <A HREF="http://www.pjsip.org/trac/browser/pjproject/trunk/pjsip-apps/src/py_pjsua/pjsua_app.py"> 
     114    <tt>pjsip-apps/src/py_pjsua/pjsua_app.py</tt></A> file. 
     115 
    75116 * @section root_using_pjsua_lib Using PJSUA API 
    76117 * 
    77  * Please refer to @ref using_pjsua_lib on how to use PJSUA API. 
     118 * Please refer to @ref PJSUA_LIB_BASE on how to create and initialize the API. 
     119 * And then see the Modules on the bottom of this page for more information 
     120 * about specific subject. 
    78121 */  
    79122 
    80 PJ_BEGIN_DECL 
    81  
    82  
    83 /** Forward declaration */ 
    84 typedef struct pjsua_media_config pjsua_media_config; 
    85123 
    86124 
     
    90128 
    91129/** 
    92  * @defgroup PJSUA_LIB_BASE Base API 
     130 * @defgroup PJSUA_LIB_BASE PJSUA-API Basic API 
    93131 * @ingroup PJSUA_LIB 
    94132 * @brief Basic application creation/initialization, logging configuration, etc. 
     
    102140 * @subsection creating_pjsua_lib Creating PJSUA 
    103141 * 
    104  * Before anything else, application must create PJSUA by calling #pjsua_create(). 
     142 * Before anything else, application must create PJSUA by calling #pjsua_create() 
     143 * (or <tt>py_pjsua.create()</tt> from Python). 
    105144 * This, among other things, will initialize PJLIB, which is crucial before  
    106  * any PJLIB functions can be called. 
     145 * any PJLIB functions can be called, PJLIB-UTIL, and create a SIP endpoint. 
     146 * 
     147 * After this function is called, application can create a memory pool (with 
     148 * #pjsua_pool_create()) and read configurations from command line or file to 
     149 * build the settings to initialize PJSUA below. 
    107150 * 
    108151 * @subsection init_pjsua_lib Initializing PJSUA 
    109152 * 
    110153 * After PJSUA is created, application can initialize PJSUA by calling 
    111  * #pjsua_init(). This function takes several configuration settings in the 
    112  * argument, so application normally would want to set these configuration 
    113  * before passing them to #pjsua_init(). 
    114  * 
    115  * Sample code to initialize PJSUA: 
     154 * #pjsua_init(). This function takes several optional configuration settings  
     155 * in the argument, if application wants to set them. 
     156 * 
     157 * @subsubsection init_pjsua_lib_c_cpp PJSUA-LIB Initialization (in C) 
     158 * Sample code to initialize PJSUA in C code: 
    116159 \code 
    117160 
     
    160203 \endcode 
    161204 * 
     205 * 
     206 * @subsubsection init_pjsua_lib_python PJSUA-LIB Initialization (in Python) 
     207 * Sample code to initialize PJSUA in Python code: 
     208 
     209 \code 
     210 
     211import py_pjsua 
     212 
     213# 
     214# Initialize pjsua. 
     215# 
     216def app_init(): 
     217        # Create pjsua before anything else 
     218        status = py_pjsua.create() 
     219        if status != 0: 
     220                err_exit("pjsua create() error", status) 
     221 
     222        # We use default logging config for this sample 
     223        log_cfg = py_pjsua.logging_config_default() 
     224 
     225        # Create and initialize pjsua config 
     226        # Note: for this Python module, thread_cnt must be 0 since Python 
     227        #       doesn't like to be called from alien thread (pjsua's thread 
     228        #       in this case)        
     229        ua_cfg = py_pjsua.config_default() 
     230        ua_cfg.thread_cnt = 0 
     231        ua_cfg.user_agent = "PJSUA/Python 0.1" 
     232 
     233        # Override callbacks. At the very least application would want to 
     234        # override the call callbacks in pjsua_config 
     235        ua_cfg.cb.on_incoming_call = ... 
     236        ua_cfg.cb.on_call_state = ... 
     237 
     238        # Use default media config for this cample 
     239        med_cfg = py_pjsua.media_config_default() 
     240 
     241        # 
     242        # Initialize pjsua!! 
     243        # 
     244        status = py_pjsua.init(ua_cfg, log_cfg, med_cfg) 
     245        if status != 0: 
     246                err_exit("pjsua init() error", status) 
     247 
     248 
     249 
     250# Utility: display PJ error and exit 
     251# 
     252def err_exit(title, rc): 
     253        py_pjsua.perror(THIS_FILE, title, rc) 
     254        exit(1) 
     255 
     256 \endcode 
     257 
     258 
    162259 * @subsection other_init_pjsua_lib Other Initialization 
    163260 * 
     
    165262 * need/want to perform the following tasks: 
    166263 * 
    167  *  - create SIP transport with #pjsua_transport_create(). Please see 
     264 *  - create SIP transport with #pjsua_transport_create(). Application would 
     265 *    to call #pjsua_transport_create() for each transport types that it 
     266 *    wants to support (for example, UDP, TCP, and TLS). Please see 
    168267 *    @ref PJSUA_LIB_TRANSPORT section for more info. 
    169268 *  - create one or more SIP accounts with #pjsua_acc_add() or 
    170  *    #pjsua_acc_add_local(). Please see @ref PJSUA_LIB_ACC for more info. 
     269 *    #pjsua_acc_add_local(). The SIP account is used for registering with 
     270 *    the SIP server, if any. Please see @ref PJSUA_LIB_ACC for more info. 
    171271 *  - add one or more buddies with #pjsua_buddy_add(). Please see 
    172272 *    @ref PJSUA_LIB_BUDDY section for more info. 
     
    179279 * After all initializations have been done, application must call 
    180280 * #pjsua_start() to start PJSUA. This function will check that all settings 
    181  * are properly configured, and apply default settings when it's not, or 
    182  * report error status when it is unable to recover from missing setting. 
     281 * have been properly configured, and apply default settings when they haven't, 
     282 * or report error status when it is unable to recover from missing settings. 
    183283 * 
    184284 * Most settings can be changed during run-time. For example, application 
     
    186286 * during run-time. 
    187287 * 
     288 * @subsubsection starting_pjsua_lib_c C Example for Starting PJSUA 
    188289 * Sample code: 
    189290 \code 
     
    210311 } 
    211312 \endcode 
     313 
     314 * @subsubsection starting_pjsua_lib_python Python Example for starting PJSUA 
     315 * For Python, starting PJSUA-LIB takes one more step, that is to initialize 
     316 * Python worker thread to poll PJSUA-LIB. This step is necessary because 
     317 * Python doesn't like it when it is called by an "alien" thread (that is, 
     318 * thread that is not created using Python API). 
     319 * 
     320 * Because of this, we cannot use a worker thread in PJSUA-LIB, because then 
     321 * the Python callback will be called by an "alien" thread and this would 
     322 * crash Python (or raise assert() probably). 
     323 * 
     324 * So because worker thread is disabled, we need to create a worker thread 
     325 * in Python. Note that this may not be necessary if we're creating a 
     326 * GUI application, because then we can attach, for example, a GUI timer 
     327 * object to poll the PJSUA-LIB. But because we're creating a console  
     328 * application which will block at <tt>sys.stdin.readline()</tt>, we need 
     329 * to have a worker thread to poll PJSUA-LIB. 
     330 
     331 \code 
     332 
     333import thread 
     334 
     335C_QUIT = 0 
     336 
     337 
     338def app_start(): 
     339        # Done with initialization, start pjsua!! 
     340        # 
     341        status = py_pjsua.start() 
     342        if status != 0: 
     343                py_pjsua.destroy() 
     344                err_exit("Error starting pjsua!", status) 
     345 
     346        # Start worker thread 
     347        thr = thread.start_new(worker_thread_main, (0,)) 
     348     
     349        print "PJSUA Started!!" 
     350 
     351# 
     352# Worker thread function. 
     353# Python doesn't like it when it's called from an alien thread 
     354# (pjsua's worker thread, in this case), so for Python we must 
     355# disable worker thread in pjsua and poll pjsua from Python instead. 
     356# 
     357def worker_thread_main(arg): 
     358        global C_QUIT 
     359        thread_desc = 0 
     360        status = py_pjsua.thread_register("python worker", thread_desc) 
     361        if status != 0: 
     362                py_pjsua.perror(THIS_FILE, "Error registering thread", status) 
     363        else: 
     364                while C_QUIT == 0: 
     365                        py_pjsua.handle_events(50) 
     366                print "Worker thread quitting.." 
     367                C_QUIT = 2 
     368 
     369 
     370 \endcode 
    212371 */ 
    213372 
     
    248407 * #pjsua_init(). Application must call #pjsua_logging_config_default() to 
    249408 * initialize this structure with the default values. 
     409 * 
     410 * \par Sample Python Syntax: 
     411 * \code 
     412    # Python type: py_pjsua.Logging_Config 
     413  
     414    log_cfg = py_pjsua.logging_config_default() 
     415    log_cfg.level = 4 
     416 * \endcode 
    250417 */ 
    251418typedef struct pjsua_logging_config 
     
    280447     * application specific device. This function will be called for 
    281448     * log messages on input verbosity level. 
     449     * 
     450     * \par Sample Python Syntax: 
     451     * \code 
     452     # level:   integer 
     453     # data:    string 
     454     # len:     integer 
     455 
     456     def cb(level, data, len): 
     457            print data, 
     458     * \endcode 
    282459     */ 
    283460    void       (*cb)(int level, const char *data, pj_size_t len); 
     
    291468 * 
    292469 * @param cfg   The logging config to be initialized. 
     470 * 
     471 * \par Python Syntax: 
     472 * The Python function instantiates and initialize the logging config: 
     473 * \code 
     474 logging_cfg = py_pjsua.logging_config_default() 
     475 * \endcode 
    293476 */ 
    294477PJ_INLINE(void) pjsua_logging_config_default(pjsua_logging_config *cfg) 
     
    309492 * @param dst       Destination config. 
    310493 * @param src       Source config. 
     494 * 
     495 * \par Python Syntax: 
     496 * Not available (for now). Ideally we should be able to just assign 
     497 * one config to another, but this has not been tested. 
    311498 */ 
    312499PJ_INLINE(void) pjsua_logging_config_dup(pj_pool_t *pool, 
     
    325512 * although definitely application would want to implement some of 
    326513 * the important callbacks (such as \a on_incoming_call). 
     514 * 
     515 * \par Python Syntax: 
     516 * This callback structure is embedded on pjsua_config structure. 
    327517 */ 
    328518typedef struct pjsua_callback 
     
    331521     * Notify application when invite state has changed. 
    332522     * Application may then query the call info to get the 
    333      * detail call states. 
     523     * detail call states by calling  pjsua_call_get_info() function. 
    334524     * 
    335525     * @param call_id   The call index. 
    336526     * @param e         Event which causes the call state to change. 
     527     * 
     528     * \par Python Syntax: 
     529     * \code 
     530     # call_id: integer 
     531     # e:       an opaque object 
     532 
     533     def on_call_state(call_id, e): 
     534            return 
     535     * \endcode 
    337536     */ 
    338537    void (*on_call_state)(pjsua_call_id call_id, pjsip_event *e); 
     
    345544     *                  the call. 
    346545     * @param rdata     The incoming INVITE request. 
     546     * 
     547     * \par Python Syntax: 
     548     * \code 
     549     # acc_id:  integer 
     550     # call_id: integer 
     551     # rdata:   an opaque object 
     552 
     553     def on_incoming_call(acc_id, call_id, rdata): 
     554            return 
     555     * \endcode 
    347556     */ 
    348557    void (*on_incoming_call)(pjsua_acc_id acc_id, pjsua_call_id call_id, 
     
    355564     * 
    356565     * @param call_id   The call index. 
     566     * 
     567     * \par Python Syntax: 
     568     * \code 
     569     # call_id: integer 
     570 
     571     def on_call_media_state(call_id): 
     572            return 
     573     * \endcode 
    357574     */ 
    358575    void (*on_call_media_state)(pjsua_call_id call_id); 
     
    363580     * @param call_id   The call index. 
    364581     * @param digit     DTMF ASCII digit. 
     582     * 
     583     * \par Python Syntax: 
     584     * \code 
     585     # call_id: integer 
     586     # digit:   integer 
     587 
     588     def on_dtmf_digit(call_id, digit): 
     589            return 
     590     * \endcode 
    365591     */ 
    366592    void (*on_dtmf_digit)(pjsua_call_id call_id, int digit); 
     
    378604     * @param code      Status code to be returned for the call transfer 
    379605     *                  request. On input, it contains status code 200. 
     606     * 
     607     * \par Python Syntax: 
     608     * \code 
     609     # call_id: integer 
     610     # dst:     string 
     611     # code:    integer 
     612 
     613     def on_call_transfer_request(call_id, dst, code): 
     614            return code 
     615 
     616     * \endcode  
    380617     */ 
    381618    void (*on_call_transfer_request)(pjsua_call_id call_id, 
     
    390627     * 
    391628     * @param call_id       Call ID. 
    392      * @param status_code   Status progress of the transfer request. 
    393      * @param status_text   Status progress text. 
     629     * @param st_code       Status progress of the transfer request. 
     630     * @param st_text       Status progress text. 
    394631     * @param final         If non-zero, no further notification will 
    395      *                      be reported. The status_code specified in 
     632     *                      be reported. The st_code specified in 
    396633     *                      this callback is the final status. 
    397634     * @param p_cont        Initially will be set to non-zero, application 
     
    399636     *                      to receie further notification (for example, 
    400637     *                      after it hangs up the call). 
     638     * 
     639     * \par Python Syntax: 
     640     * \code 
     641     # call_id: integer 
     642     # st_code: integer 
     643     # st_text: string 
     644     # final:   integer 
     645     # cont:    integer 
     646 
     647     # return:  cont 
     648 
     649     def on_call_transfer_status(call_id, st_code, st_text, final, cont): 
     650            return cont 
     651     * \endcode 
    401652     */ 
    402653    void (*on_call_transfer_status)(pjsua_call_id call_id, 
    403                                     int status_code, 
    404                                     const pj_str_t *status_text, 
     654                                    int st_code, 
     655                                    const pj_str_t *st_text, 
    405656                                    pj_bool_t final, 
    406657                                    pj_bool_t *p_cont); 
     
    415666     *                      should only return a final status (200-699). 
    416667     * @param st_text       Optional status text to be set by application. 
     668     * 
     669     * \par Python Syntax: 
     670     * \code 
     671     # call_id: integer 
     672     # rdata:   an opaque object 
     673     # st_code: integer 
     674     # st_text: string 
     675 
     676     # return:  (st_code, st_text) tuple 
     677 
     678     def on_call_replace_request(call_id, rdata, st_code, st_text): 
     679            return st_code, st_text 
     680     * \endcode 
    417681     */ 
    418682    void (*on_call_replace_request)(pjsua_call_id call_id, 
     
    433697     * @param new_call_id   The new call. 
    434698     * @param rdata         The incoming INVITE with Replaces request. 
     699     * 
     700     * \par Python Syntax: 
     701     * \code 
     702     # old_call_id: integer 
     703     # new_call_id: integer 
     704 
     705     def on_call_replaced(old_call_id, new_call_id): 
     706            return 
     707     * \endcode 
    435708     */ 
    436709    void (*on_call_replaced)(pjsua_call_id old_call_id, 
     
    444717     * 
    445718     * @param acc_id        Account ID. 
     719     * 
     720     * \par Python Syntax: 
     721     * \code 
     722     # acc_id:  account ID (integer) 
     723 
     724     def on_reg_state(acc_id): 
     725            return 
     726     * \endcode 
    446727     */ 
    447728    void (*on_reg_state)(pjsua_acc_id acc_id); 
     
    452733     * 
    453734     * @param buddy_id      The buddy id. 
     735     * 
     736     * \par Python Syntax: 
     737     * \code 
     738     # buddy_id:    integer 
     739 
     740     def on_buddy_state(buddy_id): 
     741            return 
     742     * \endcode 
    454743     */ 
    455744    void (*on_buddy_state)(pjsua_buddy_id buddy_id); 
     
    468757     * @param mime_type     MIME type of the message. 
    469758     * @param body          The message content. 
     759     * 
     760     * \par Python Syntax: 
     761     * \code 
     762     # call_id:     integer 
     763     # from:        string 
     764     # to:          string 
     765     # contact:     string 
     766     # mime_type:   string 
     767     # body:        string 
     768 
     769     def on_pager(call_id, from, to, contact, mime_type, body): 
     770            return 
     771     * \endcode 
    470772     */ 
    471773    void (*on_pager)(pjsua_call_id call_id, const pj_str_t *from, 
     
    486788     * @param status        Delivery status. 
    487789     * @param reason        Delivery status reason. 
     790     * 
     791     * \par Python Syntax 
     792     * \code 
     793     # call_id:     integer 
     794     # to:          string 
     795     # body:        string 
     796     # user_data:   string 
     797     # status:      integer 
     798     # reason:      string 
     799 
     800     def on_pager_status(call_id, to, body, user_data, status, reason): 
     801            return 
     802     * \endcode 
    488803     */ 
    489804    void (*on_pager_status)(pjsua_call_id call_id, 
     
    505820     * @param is_typing     Non-zero if peer is typing, or zero if peer 
    506821     *                      has stopped typing a message. 
     822     * 
     823     * \par Python Syntax 
     824     * \code 
     825     # call_id:     string 
     826     # from:        string 
     827     # to:          string 
     828     # contact:     string 
     829     # is_typing:   integer 
     830 
     831     def on_typing(call_id, from, to, contact, is_typing): 
     832            return 
     833     * \endcode 
    507834     */ 
    508835    void (*on_typing)(pjsua_call_id call_id, const pj_str_t *from, 
     
    520847 * Before setting the values, application must call #pjsua_config_default() 
    521848 * to initialize this structure with the default values. 
     849 * 
     850 * \par Python Sample Syntax: 
     851 * The pjsua_config type in Python is <tt>py_pjsua.Config</tt>. Application 
     852 * creates the instance by calling <tt>py_pjsua.config_default()</tt>: 
     853 * \code 
     854    cfg = py_pjsua.config_default() 
     855 * \endcode 
    522856 */ 
    523857typedef struct pjsua_config 
     
    602936 * 
    603937 * @param cfg   pjsua config to be initialized. 
     938 * 
     939 * \par Python Sample Syntax: 
     940 * The corresponding Python function creates an instance of the config and 
     941 * initializes it to the default settings: 
     942 * \code 
     943    cfg = py_pjsua.config_default() 
     944 * \endcode 
     945 
    604946 */ 
    605947PJ_INLINE(void) pjsua_config_default(pjsua_config *cfg) 
     
    614956/** 
    615957 * Duplicate credential. 
     958 * 
     959 * @param pool      The memory pool. 
     960 * @param dst       Destination credential. 
     961 * @param src       Source credential. 
     962 * 
     963 * \par Python: 
     964 * Not applicable (for now). Probably we could just assign one credential 
     965 * variable to another, but this has not been tested. 
    616966 */ 
    617967PJ_INLINE(void) pjsip_cred_dup( pj_pool_t *pool, 
     
    629979/** 
    630980 * Duplicate pjsua_config. 
     981 * 
     982 * @param pool      The pool to get memory from. 
     983 * @param dst       Destination config. 
     984 * @param src       Source config. 
    631985 */ 
    632986PJ_INLINE(void) pjsua_config_dup(pj_pool_t *pool, 
     
    6601014 * Application MUST call #pjsua_msg_data_init() to initialize this 
    6611015 * structure before setting its values. 
     1016 * 
     1017 * \par Python Syntax 
     1018 * The data type in Python is <tt>py_pjsua.Msg_Data</tt>. Application is 
     1019 * recommended to instantiate the structure by using this construct: 
     1020 * \code 
     1021    msg_data = py_pjsua.msg_data_init() 
     1022 * \endcode 
    6621023 */ 
    6631024typedef struct pjsua_msg_data 
     
    6651026    /** 
    6661027     * Additional message headers as linked list. 
     1028     * 
     1029     * \par Python: 
     1030     * This field is implemented as string linked-list in Python, where each 
     1031     * string describes the header. For example: 
     1032     \code 
     1033        msg_data = py_pjsua.Msg_Data() 
     1034        msg_data.hdr_list = ["Subject: Hello py_pjsua!", "Priority: very low"] 
     1035     \endcode 
    6671036     */ 
    6681037    pjsip_hdr   hdr_list; 
     
    6851054 * 
    6861055 * @param msg_data  Message data to be initialized. 
     1056 * 
     1057 * \par Python 
     1058 * The corresponding Python function creates and initializes the structure: 
     1059 * \code 
     1060    msg_data = py_pjsua.msg_data_init() 
     1061 * \endcode 
    6871062 */ 
    6881063PJ_INLINE(void) pjsua_msg_data_init(pjsua_msg_data *msg_data) 
     
    7011076 * 
    7021077 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1078 * 
     1079 * \par Python: 
     1080 * \code 
     1081    status = py_pjsua.create() 
     1082 * \endcode 
    7031083 */ 
    7041084PJ_DECL(pj_status_t) pjsua_create(void); 
     1085 
     1086 
     1087/* Forward declaration */ 
     1088typedef struct pjsua_media_config pjsua_media_config; 
    7051089 
    7061090 
     
    7171101 * 
    7181102 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1103 * 
     1104 * \par Python: 
     1105 * The function is similar in Python: 
     1106 * \code 
     1107    status = py_pjsua.init(ua_cfg, log_cfg, media_cfg) 
     1108 * \endcode 
     1109 * Note that \a ua_cfg, \a log_cfg, and \a media_cfg are optional, and 
     1110 * the Python script may pass None if it doesn't want to configure the  
     1111 * setting. 
    7191112 */ 
    7201113PJ_DECL(pj_status_t) pjsua_init(const pjsua_config *ua_cfg, 
     
    7311124 * 
    7321125 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1126 * 
     1127 * \par Python: 
     1128 * The function is similar in Python: 
     1129 * \code 
     1130    status = py_pjsua.start() 
     1131 * \endcode 
    7331132 */ 
    7341133PJ_DECL(pj_status_t) pjsua_start(void); 
     
    7471146 * 
    7481147 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1148 * 
     1149 * \par Python: 
     1150 * The function is similar in Python: 
     1151 * \code 
     1152    status = py_pjsua.destroy() 
     1153 * \endcode 
    7491154 */ 
    7501155PJ_DECL(pj_status_t) pjsua_destroy(void); 
     
    7631168 * @return  The number of events that have been handled during the 
    7641169 *          poll. Negative value indicates error, and application 
    765  *          can retrieve the error as (err = -return_value). 
     1170 *          can retrieve the error as (status = -return_value). 
     1171 * 
     1172 * \par Python: 
     1173 * The function is similar in Python: 
     1174 * \code 
     1175    n = py_pjsua.handle_events(msec_timeout) 
     1176 * \endcode 
    7661177 */ 
    7671178PJ_DECL(int) pjsua_handle_events(unsigned msec_timeout); 
     
    7771188 * 
    7781189 * @return              The pool, or NULL when there's no memory. 
     1190 * 
     1191 * \par Python: 
     1192 * Python script may also create a pool object from the script: 
     1193 * \code 
     1194    pool = py_pjsua.pool_create(name, init_size, increment) 
     1195 * \endcode 
    7791196 */ 
    7801197PJ_DECL(pj_pool_t*) pjsua_pool_create(const char *name, pj_size_t init_size, 
     
    7891206 * 
    7901207 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1208 * 
     1209 * \par Python: 
     1210 * The function is similar in Python: 
     1211 * \code 
     1212    status = py_pjsua.reconfigure_logging(log_cfg) 
     1213 * \endcode 
    7911214 */ 
    7921215PJ_DECL(pj_status_t) pjsua_reconfigure_logging(const pjsua_logging_config *c); 
     
    7991222 *  
    8001223 * @return              SIP endpoint instance. 
     1224 * 
     1225 * \par Python: 
     1226 * Application may retrieve the SIP endpoint instance: 
     1227 * \code 
     1228    endpt = py_pjsua.get_pjsip_endpt() 
     1229 * \endcode 
     1230 * However currently the object is just an opaque object and does not have 
     1231 * any use for Python scripts. 
    8011232 */ 
    8021233PJ_DECL(pjsip_endpoint*) pjsua_get_pjsip_endpt(void); 
     
    8071238 * 
    8081239 * @return              Media endpoint instance. 
     1240 * 
     1241 * \par Python: 
     1242 * Application may retrieve the media endpoint instance: 
     1243 * \code 
     1244    endpt = py_pjsua.get_pjmedia_endpt() 
     1245 * \endcode 
     1246 * However currently the object is just an opaque object and does not have 
     1247 * any use for Python scripts. 
    8091248 */ 
    8101249PJ_DECL(pjmedia_endpt*) pjsua_get_pjmedia_endpt(void); 
     
    8151254 * 
    8161255 * @return              Pool factory currently used by PJSUA. 
     1256 * 
     1257 * \par Python: 
     1258 * Application may retrieve the pool factory instance: 
     1259 * \code 
     1260    endpt = py_pjsua.get_pool_factory() 
     1261 * \endcode 
     1262 * However currently the object is just an opaque object and does not have 
     1263 * any use for Python scripts. 
    8171264 */ 
    8181265PJ_DECL(pj_pool_factory*) pjsua_get_pool_factory(void); 
     
    8291276 * URL is valid, PJ_SUCCESS will be returned. 
    8301277 * 
    831  * @param c_url         The URL, as NULL terminated string. 
    832  * 
    833  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    834  */ 
    835 PJ_DECL(pj_status_t) pjsua_verify_sip_url(const char *c_url); 
     1278 * @param url           The URL, as NULL terminated string. 
     1279 * 
     1280 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1281 * 
     1282 * \par Python: 
     1283 * \code 
     1284    status = py_pjsua.verify_sip_url(url) 
     1285 * \endcode 
     1286 */ 
     1287PJ_DECL(pj_status_t) pjsua_verify_sip_url(const char *url); 
    8361288 
    8371289 
     
    8431295 * @param title         Message title for the error. 
    8441296 * @param status        Status code. 
     1297 * 
     1298 * \par Python: 
     1299 * \code 
     1300    py_pjsua.perror(sender, title, status) 
     1301 * \endcode 
    8451302 */ 
    8461303PJ_DECL(void) pjsua_perror(const char *sender, const char *title,  
     
    8611318 
    8621319/** 
    863  * @defgroup PJSUA_LIB_TRANSPORT Signaling Transport 
     1320 * @defgroup PJSUA_LIB_TRANSPORT PJSUA-API Signaling Transport 
    8641321 * @ingroup PJSUA_LIB 
    8651322 * @brief API for managing SIP transports 
    8661323 * @{ 
    867  * SIP transport must be created before adding an account. SIP transport is 
    868  * created by calling #pjsua_transport_create() function. 
    869  */ 
    870  
    871  
    872 /** SIP transport identification */ 
     1324 * 
     1325 * PJSUA-API supports creating multiple transport instances, for example UDP, 
     1326 * TCP, and TLS transport. SIP transport must be created before adding an  
     1327 * account. 
     1328 */ 
     1329 
     1330 
     1331/** SIP transport identification. 
     1332 */ 
    8731333typedef int pjsua_transport_id; 
    8741334 
     
    9101370/** 
    9111371 * Call this function to initialize STUN config with default values. 
     1372 * STUN config is normally embedded inside pjsua_transport_config, so 
     1373 * normally there is no need to call this function and rather just 
     1374 * call pjsua_transport_config_default() instead. 
    9121375 * 
    9131376 * @param cfg       The STUN config to be initialized. 
     1377 * 
     1378 * \par Python: 
     1379 * The corresponding Python function creates and initialize the config: 
     1380 * \code 
     1381    stun_cfg = py_pjsua.stun_config_default() 
     1382 * \endcode 
    9141383 */ 
    9151384PJ_INLINE(void) pjsua_stun_config_default(pjsua_stun_config *cfg) 
     
    9241393 * MUST call #pjsua_transport_config_default() to initialize its 
    9251394 * values with default settings. 
     1395 * 
     1396 * \par Python: 
     1397 * The data type in Python is <tt>py_pjsua.Transport_Config</tt>, 
     1398 * although application can just do this to create the instance: 
     1399 * \code 
     1400    transport_cfg = py_pjsua.transport_config_default() 
     1401 * \endcode 
    9261402 */ 
    9271403typedef struct pjsua_transport_config 
     
    9831459 * 
    9841460 * @param cfg       The UDP config to be initialized. 
     1461 * 
     1462 * \par Python: 
     1463 * The corresponding Python function is rather different: 
     1464 * \code 
     1465    transport_cfg = py_pjsua.transport_config_default() 
     1466 * \endcode 
    9851467 */ 
    9861468PJ_INLINE(void) pjsua_transport_config_default(pjsua_transport_config *cfg) 
     
    9971479 * 
    9981480 * @param cfg       The STUN config to be initialized. 
     1481 * 
     1482 * \par Python: 
     1483 * \code 
     1484    py_pjsua.normalize_stun_config(cfg) 
     1485 * \code 
    9991486 */ 
    10001487PJ_INLINE(void) pjsua_normalize_stun_config( pjsua_stun_config *cfg ) 
     
    10231510/** 
    10241511 * Duplicate transport config. 
     1512 * 
     1513 * @param pool          The pool. 
     1514 * @param dst           The destination config. 
     1515 * @param src           The source config. 
     1516 * 
     1517 * \par Python: 
     1518 * Not applicable. One should be able to just copy one variable instance 
     1519 * to another in Python. 
    10251520 */ 
    10261521PJ_INLINE(void) pjsua_transport_config_dup(pj_pool_t *pool, 
     
    10481543 * This structure describes transport information returned by 
    10491544 * #pjsua_transport_get_info() function. 
     1545 * 
     1546 * \par Python: 
     1547 * The corresponding data type in Python is <tt>py_pjsua.Transport_Info</tt>. 
    10501548 */ 
    10511549typedef struct pjsua_transport_info 
     
    11091607 * 
    11101608 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1609 * 
     1610 * \par Python: 
     1611 * The corresponding Python function returns (status,id) tuple: 
     1612 * \code 
     1613    status, transport_id = py_pjsua.transport_create(type, cfg) 
     1614 * \endcode 
    11111615 */ 
    11121616PJ_DECL(pj_status_t) pjsua_transport_create(pjsip_transport_type_e type, 
     
    11151619 
    11161620/** 
    1117  * Register transport that has been created by application. 
     1621 * Register transport that has been created by application. This function 
     1622 * is useful if application wants to implement custom SIP transport and use 
     1623 * it with pjsua. 
    11181624 * 
    11191625 * @param tp            Transport instance. 
     
    11211627 * 
    11221628 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1629 * 
     1630 * \par Python: 
     1631 * Not applicable (for now), because one cannot create a custom transport 
     1632 * from Python script. 
    11231633 */ 
    11241634PJ_DECL(pj_status_t) pjsua_transport_register(pjsip_transport *tp, 
     
    11271637 
    11281638/** 
    1129  * Enumerate all transports currently created in the system. 
     1639 * Enumerate all transports currently created in the system. This function 
     1640 * will return all transport IDs, and application may then call  
     1641 * #pjsua_transport_get_info() function to retrieve detailed information 
     1642 * about the transport. 
    11301643 * 
    11311644 * @param id            Array to receive transport ids. 
     
    11341647 * 
    11351648 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1649 * 
     1650 * \par Python: 
     1651 * The function returns list of integers representing transport ids: 
     1652 * \code 
     1653    [int] = py_pjsua.enum_transports() 
     1654 * \endcode 
    11361655 */ 
    11371656PJ_DECL(pj_status_t) pjsua_enum_transports( pjsua_transport_id id[], 
     
    11461665 * 
    11471666 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1667 * 
     1668 * \par Python: 
     1669 * \code 
     1670    transport_info = py_pjsua.transport_get_info(id) 
     1671 * \endcode 
     1672 * The Python function returns None on error. 
    11481673 */ 
    11491674PJ_DECL(pj_status_t) pjsua_transport_get_info(pjsua_transport_id id, 
     
    11611686 * 
    11621687 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1688 * 
     1689 * \par Python: 
     1690 * \code 
     1691    status = py_pjsua.transport_set_enable(id, enabled) 
     1692 * \endcode 
    11631693 */ 
    11641694PJ_DECL(pj_status_t) pjsua_transport_set_enable(pjsua_transport_id id, 
     
    11791709 * 
    11801710 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1711 * 
     1712 * \par Python: 
     1713 * \code 
     1714    status = py_pjsua.transport_close(id, force) 
     1715 * \endcode 
    11811716 */ 
    11821717PJ_DECL(pj_status_t) pjsua_transport_close( pjsua_transport_id id, 
     
    11961731 
    11971732/** 
    1198  * @defgroup PJSUA_LIB_ACC Account Management 
     1733 * @defgroup PJSUA_LIB_ACC PJSUA-API Accounts Management 
    11991734 * @ingroup PJSUA_LIB 
    1200  * @brief PJSUA supports multiple accounts.. 
     1735 * @brief PJSUA Accounts management 
    12011736 * @{ 
     1737 * 
    12021738 * PJSUA accounts provide identity (or identities) of the user who is currently 
    1203  * using the application. More than one account maybe created with PJSUA. 
     1739 * using the application. In SIP terms, the identity is used as the <b>From</b> 
     1740 * header in outgoing requests. 
     1741 * 
     1742 * PJSUA-API supports creating and managing multiple accounts. The maximum 
     1743 * number of accounts is limited by a compile time constant 
     1744 * <tt>PJSUA_MAX_ACC</tt>. 
    12041745 * 
    12051746 * Account may or may not have client registration associated with it. 
     
    12071748 * credentials</b>, which are used when sending SIP request messages using the 
    12081749 * account. An account also has presence's <b>online status</b>, which 
    1209  * will be reported to remote peer when the subscribe to the account's 
    1210  * presence. 
     1750 * will be reported to remote peer when they subscribe to the account's 
     1751 * presence, or which is published to a presence server if presence  
     1752 * publication is enabled for the account. 
    12111753 * 
    12121754 * At least one account MUST be created in the application. If no user 
    12131755 * association is required, application can create a userless account by 
    12141756 * calling #pjsua_acc_add_local(). A userless account identifies local endpoint 
    1215  * instead of a particular user. 
     1757 * instead of a particular user, and it correspond with a particular 
     1758 * transport instance. 
    12161759 * 
    12171760 * Also one account must be set as the <b>default account</b>, which is used as 
     
    12621805 * adding a new account with #pjsua_acc_add(). Application MUST initialize 
    12631806 * this structure first by calling #pjsua_acc_config_default(). 
     1807 * 
     1808 * \par Python: 
     1809 * The data type in Python is <tt>py_pjsua.Acc_Config</tt>, but normally 
     1810 * application can just use the snippet below to create and initialize 
     1811 * the account config: 
     1812 * \code 
     1813    acc_cfg = py_pjsua.acc_config_default() 
     1814 * \endcode 
    12641815 */ 
    12651816typedef struct pjsua_acc_config 
     
    13041855    /** 
    13051856     * Number of proxies in the proxy array below. 
     1857     * 
     1858     * \par Python: 
     1859     * Not applicable, as \a proxy is implemented as list of strings. 
    13061860     */ 
    13071861    unsigned        proxy_cnt; 
     
    13191873     * then these account proxies will be placed after the global outbound 
    13201874     * proxies in the routeset. 
     1875     * 
     1876     * \par Python: 
     1877     * This will be list of strings. 
    13211878     */ 
    13221879    pj_str_t        proxy[PJSUA_ACC_MAX_PROXIES]; 
     
    13301887    /**  
    13311888     * Number of credentials in the credential array. 
     1889     * 
     1890     * \par Python: 
     1891     * Not applicable, since \a cred_info is a list of credentials. 
    13321892     */ 
    13331893    unsigned        cred_count; 
     
    13391899     * example when the requests are expected to be challenged by the 
    13401900     * proxies in the route set. 
     1901     * 
     1902     * \par Python: 
     1903     * This field is a list of credentials. 
    13411904     */ 
    13421905    pjsip_cred_info cred_info[PJSUA_ACC_MAX_PROXIES]; 
     
    13621925 * 
    13631926 * @param cfg       The account config to be initialized. 
     1927 * 
     1928 * \par Python: 
     1929 * In Python, this function both creates and initializes the account 
     1930 * config: 
     1931 * \code 
     1932    acc_cfg = py_pjsua.acc_config_default() 
     1933 * \endcode 
    13641934 */ 
    13651935PJ_INLINE(void) pjsua_acc_config_default(pjsua_acc_config *cfg) 
     
    13761946 * Account info. Application can query account info by calling  
    13771947 * #pjsua_acc_get_info(). 
     1948 * 
     1949 * \par Python: 
     1950 * The data type in Python is <tt>py_pjsua.Acc_Info</tt>. 
    13781951 */ 
    13791952typedef struct pjsua_acc_info 
     
    14352008 * 
    14362009 * @return              Current number of accounts. 
     2010 * 
     2011 * \par Python: 
     2012 * \code 
     2013    count = py_pjsua.acc_get_count() 
     2014 * \endcode 
    14372015 */ 
    14382016PJ_DECL(unsigned) pjsua_acc_get_count(void); 
     
    14452023 * 
    14462024 * @return              Non-zero if account ID is valid. 
     2025 * 
     2026 * \par Python: 
     2027 * \code 
     2028    is_valid = py_pjsua.acc_is_valid(acc_id) 
     2029 * \endcode 
    14472030 */ 
    14482031PJ_DECL(pj_bool_t) pjsua_acc_is_valid(pjsua_acc_id acc_id); 
     
    14562039 * 
    14572040 * @return              PJ_SUCCESS on success. 
     2041 * 
     2042 * \par Python: 
     2043 * \code 
     2044    status = py_pjsua.acc_set_default(acc_id) 
     2045 * \endcode 
    14582046 */ 
    14592047PJ_DECL(pj_status_t) pjsua_acc_set_default(pjsua_acc_id acc_id); 
     
    14672055 * @return              The default account ID, or PJSUA_INVALID_ID if no 
    14682056 *                      default account is configured. 
     2057 * 
     2058 * \par Python: 
     2059 * \code 
     2060    acc_id = py_pjsua.acc_get_default() 
     2061 * \endcode 
    14692062 */ 
    14702063PJ_DECL(pjsua_acc_id) pjsua_acc_get_default(void); 
     
    14802073 * 
    14812074 * 
    1482  * @param cfg           Account configuration. 
     2075 * @param acc_cfg       Account configuration. 
    14832076 * @param is_default    If non-zero, this account will be set as the default 
    14842077 *                      account. The default account will be used when sending 
     
    14902083 * 
    14912084 * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1492  */ 
    1493 PJ_DECL(pj_status_t) pjsua_acc_add(const pjsua_acc_config *cfg, 
     2085 * 
     2086 * \par Python: 
     2087 * The function returns (status, account_id) tuple: 
     2088 * \code 
     2089    status, account_id = py_pjsua.acc_add(acc_cfg, is_default) 
     2090 * \endcode 
     2091 */ 
     2092PJ_DECL(pj_status_t) pjsua_acc_add(const pjsua_acc_config *acc_cfg, 
    14942093                                   pj_bool_t is_default, 
    14952094                                   pjsua_acc_id *p_acc_id); 
     
    15112110 * 
    15122111 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2112 * 
     2113 * \par Python: 
     2114 * The function returns (status, account_id) tuple: 
     2115 * \code 
     2116    status, account_id = py_pjsua.acc_add_local(tid, is_default) 
     2117 * \endcode 
    15132118 */ 
    15142119PJ_DECL(pj_status_t) pjsua_acc_add_local(pjsua_transport_id tid, 
     
    15242129 * 
    15252130 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2131 * 
     2132 * \par Python: 
     2133 * \code 
     2134    status = py_pjsua.acc_del(acc_id) 
     2135 * \endcode 
    15262136 */ 
    15272137PJ_DECL(pj_status_t) pjsua_acc_del(pjsua_acc_id acc_id); 
     
    15322142 * 
    15332143 * @param acc_id        Id of the account to be modified. 
    1534  * @param cfg           New account configuration. 
    1535  * 
    1536  * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2144 * @param acc_cfg       New account configuration. 
     2145 * 
     2146 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2147 * 
     2148 * \par Python: 
     2149 * \code 
     2150    status = py_pjsua.acc_modify(acc_id, acc_cfg) 
     2151 * \endcode 
    15372152 */ 
    15382153PJ_DECL(pj_status_t) pjsua_acc_modify(pjsua_acc_id acc_id, 
    1539                                       const pjsua_acc_config *cfg); 
     2154                                      const pjsua_acc_config *acc_cfg); 
    15402155 
    15412156 
     
    15492164 * 
    15502165 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2166 * 
     2167 * \par Python: 
     2168 * \code 
     2169    status = py_pjsua.acc_set_online_status(acc_id, is_online) 
     2170 * \endcode 
    15512171 */ 
    15522172PJ_DECL(pj_status_t) pjsua_acc_set_online_status(pjsua_acc_id acc_id, 
     
    15662186 * 
    15672187 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2188 * 
     2189 * \par Python: 
     2190 * \code 
     2191    status = py_pjsua.acc_set_registration(acc_id, renew) 
     2192 * \endcode 
    15682193 */ 
    15692194PJ_DECL(pj_status_t) pjsua_acc_set_registration(pjsua_acc_id acc_id,  
     
    15782203 * 
    15792204 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2205 * 
     2206 * \par Python: 
     2207 * \code 
     2208    acc_info = py_pjsua.acc_get_info(acc_id) 
     2209 * \endcode 
     2210 * The function returns None if account ID is not valid. 
    15802211 */ 
    15812212PJ_DECL(pj_status_t) pjsua_acc_get_info(pjsua_acc_id acc_id, 
     
    15952226 * 
    15962227 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2228 * 
     2229 * \par Python: 
     2230 * The function takes no argument and returns list of account Ids: 
     2231 * \code 
     2232  [acc_ids] = py_pjsua.enum_accs() 
     2233 * \endcode 
    15972234 */ 
    15982235PJ_DECL(pj_status_t) pjsua_enum_accs(pjsua_acc_id ids[], 
     
    16082245 * 
    16092246 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2247 * 
     2248 * \par Python: 
     2249 * The function takes no argument and returns list of account infos: 
     2250 * \code 
     2251    [acc_info] = py_pjsua.acc_enum_info() 
     2252 * \endcode 
    16102253 */ 
    16112254PJ_DECL(pj_status_t) pjsua_acc_enum_info( pjsua_acc_info info[], 
     
    16202263 * 
    16212264 * @return              Account id. 
     2265 * 
     2266 * \par Python: 
     2267 * \code 
     2268    acc_id = py_pjsua.acc_find_for_outgoing(url) 
     2269 * \endcode 
    16222270 */ 
    16232271PJ_DECL(pjsua_acc_id) pjsua_acc_find_for_outgoing(const pj_str_t *url); 
     
    16312279 * 
    16322280 * @return              Account id. 
     2281 * 
     2282 * \par Python: 
     2283 * \code 
     2284    acc_id = py_pjsua.acc_find_for_outgoing(url) 
     2285 * \endcode 
    16332286 */ 
    16342287PJ_DECL(pjsua_acc_id) pjsua_acc_find_for_incoming(pjsip_rx_data *rdata); 
     
    16452298 * 
    16462299 * @return              PJ_SUCCESS on success, other on error. 
     2300 * 
     2301 * \par Python: 
     2302 * This function is still experimental in Python: 
     2303 * \code 
     2304    uri = py_pjsua.acc_create_uac_contact(pool, acc_id, uri) 
     2305 * \endcode 
    16472306 */ 
    16482307PJ_DECL(pj_status_t) pjsua_acc_create_uac_contact( pj_pool_t *pool, 
     
    16632322 * 
    16642323 * @return              PJ_SUCCESS on success, other on error. 
     2324 * 
     2325 * \par Python: 
     2326 * This function is still experimental in Python: 
     2327 * \code 
     2328    uri = py_pjsua.acc_create_uas_contact(pool, acc_id, rdata) 
     2329 * \endcode 
    16652330 */ 
    16662331PJ_DECL(pj_status_t) pjsua_acc_create_uas_contact( pj_pool_t *pool, 
     
    16862351 * 
    16872352 * @return              PJ_SUCCESS on success. 
     2353 * 
     2354 * \par Python: 
     2355 * Not yet implemented. 
    16882356 */ 
    16892357PJ_DECL(pj_status_t) pjsua_acc_set_transport(pjsua_acc_id acc_id, 
     
    17022370 
    17032371/** 
    1704  * @defgroup PJSUA_LIB_CALL Calls 
     2372 * @defgroup PJSUA_LIB_CALL PJSUA-API Calls Management 
    17052373 * @ingroup PJSUA_LIB 
    17062374 * @brief Call manipulation. 
     
    17402408/** 
    17412409 * This structure describes the information and current status of a call. 
     2410 * 
     2411 * \par Python: 
     2412 * The type name is <tt>py_pjsua.Call_Info</tt>. 
    17422413 */ 
    17432414typedef struct pjsua_call_info 
     
    18142485 * 
    18152486 * @return              Maximum number of calls configured. 
     2487 * 
     2488 * \par Python: 
     2489 * \code 
     2490    count = py_pjsua.call_get_max_count() 
     2491 * \endcode 
    18162492 */ 
    18172493PJ_DECL(unsigned) pjsua_call_get_max_count(void); 
     
    18212497 * 
    18222498 * @return              Number of currently active calls. 
     2499 * 
     2500 * \par Python: 
     2501 * \code 
     2502    count = py_pjsua.call_get_count() 
     2503 * \endcode 
    18232504 */ 
    18242505PJ_DECL(unsigned) pjsua_call_get_count(void); 
     
    18332514 * 
    18342515 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2516 * 
     2517 * \par Python: 
     2518 * This function takes no argument and return list of call Ids. 
     2519 * \code 
     2520    [call_ids] = py_pjsua.enum_calls() 
     2521 * \endcode 
    18352522 */ 
    18362523PJ_DECL(pj_status_t) pjsua_enum_calls(pjsua_call_id ids[], 
     
    18522539 * 
    18532540 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2541 * 
     2542 * \par Python: 
     2543 * The Python function returns (status, call_id) tuple: 
     2544 * \code 
     2545    status, call_id = py_pjsua.call_make_call(acc_id, dst_uri, options,  
     2546                                              user_data, msg_data) 
     2547 * \endcode 
     2548 * Note: the \a user_data in Python function is an integer, and the  
     2549 * \a msg_data can be set to None if not required. 
    18542550 */ 
    18552551PJ_DECL(pj_status_t) pjsua_call_make_call(pjsua_acc_id acc_id, 
     
    18682564 * 
    18692565 * @return              Non-zero if call is active. 
     2566 * 
     2567 * \par Python: 
     2568 * \code 
     2569    bool = py_pjsua.call_is_active(call_id) 
     2570 * \endcode 
    18702571 */ 
    18712572PJ_DECL(pj_bool_t) pjsua_call_is_active(pjsua_call_id call_id); 
     
    18782579 * 
    18792580 * @return              Non-zero if yes. 
     2581 * 
     2582 * \par Python: 
     2583 * \code 
     2584    bool = py_pjsua.call_has_media(call_id) 
     2585 * \endcode 
    18802586 */ 
    18812587PJ_DECL(pj_bool_t) pjsua_call_has_media(pjsua_call_id call_id); 
     
    18892595 * @return              Conference port ID, or PJSUA_INVALID_ID when the  
    18902596 *                      media has not been established or is not active. 
     2597 * 
     2598 * \par Python: 
     2599 * \code 
     2600    slot = py_pjsua.call_get_conf_port(call_id) 
     2601 * \endcode 
    18912602 */ 
    18922603PJ_DECL(pjsua_conf_port_id) pjsua_call_get_conf_port(pjsua_call_id call_id); 
     
    18992610 * 
    19002611 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2612 * 
     2613 * \par Python: 
     2614 * \code 
     2615    call_info = py_pjsua.call_get_info(call_id) 
     2616 * \endcode 
     2617 * \a call_info return value will be set to None if call_id is not valid. 
    19012618 */ 
    19022619PJ_DECL(pj_status_t) pjsua_call_get_info(pjsua_call_id call_id, 
     
    19122629 * 
    19132630 * @return              The user data. 
     2631 * 
     2632 * \par Python: 
     2633 * \code 
     2634    status = py_pjsua.call_set_user_data(call_id, user_data) 
     2635 * \endcode 
     2636 * The \a user_data is an integer in the Python function. 
    19142637 */ 
    19152638PJ_DECL(pj_status_t) pjsua_call_set_user_data(pjsua_call_id call_id, 
     
    19242647 * 
    19252648 * @return              The user data. 
     2649 * 
     2650 * \par Python: 
     2651 * \code 
     2652    user_data = py_pjsua.call_get_user_data(call_id) 
     2653 * \endcode 
     2654 * The \a user_data is an integer. 
    19262655 */ 
    19272656PJ_DECL(void*) pjsua_call_get_user_data(pjsua_call_id call_id); 
     
    19412670 * 
    19422671 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2672 * 
     2673 * \par Python: 
     2674 * \code 
     2675    status = py_pjsua.call_answer(call_id, code, reason, msg_data) 
     2676 * \endcode 
     2677 * Arguments \a reason and \a msg_data may be set to None if not required. 
    19432678 */ 
    19442679PJ_DECL(pj_status_t) pjsua_call_answer(pjsua_call_id call_id,  
     
    19652700 * 
    19662701 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2702 * 
     2703 * \par Python: 
     2704 * \code 
     2705    status = py_pjsua.call_hangup(call_id, code, reason, msg_data) 
     2706 * \endcode 
     2707 * Arguments \a reason and \a msg_data may be set to None if not required. 
    19672708 */ 
    19682709PJ_DECL(pj_status_t) pjsua_call_hangup(pjsua_call_id call_id, 
     
    19842725 * 
    19852726 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2727 * 
     2728 * \par Python: 
     2729 * \code 
     2730    status = py_pjsua.call_set_hold(call_id, msg_data) 
     2731 * \endcode 
     2732 * Argument \a msg_data may be set to None if not required. 
    19862733 */ 
    19872734PJ_DECL(pj_status_t) pjsua_call_set_hold(pjsua_call_id call_id, 
     
    20022749 * 
    20032750 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2751 * 
     2752 * \par Python: 
     2753 * \code 
     2754    status = py_pjsua.call_reinvite(call_id, unhold, msg_data) 
     2755 * \endcode 
     2756 * Argument \a msg_data may be set to None if not required. 
    20042757 */ 
    20052758PJ_DECL(pj_status_t) pjsua_call_reinvite(pjsua_call_id call_id, 
     
    20242777 * 
    20252778 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2779 * 
     2780 * \par Python: 
     2781 * \code 
     2782    status = py_pjsua.call_xfer(call_id, dest, msg_data) 
     2783 * \endcode 
     2784 * Argument \a msg_data may be set to None if not required. 
    20262785 */ 
    20272786PJ_DECL(pj_status_t) pjsua_call_xfer(pjsua_call_id call_id,  
     
    20522811 * 
    20532812 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2813 * 
     2814 * \par Python: 
     2815 * \code 
     2816    status = py_pjsua.call_xfer_replaces(call_id, dest_call_id, options, msg_data) 
     2817 * \endcode 
     2818 * Argument \a msg_data may be set to None if not required. 
    20542819 */ 
    20552820PJ_DECL(pj_status_t) pjsua_call_xfer_replaces(pjsua_call_id call_id,  
     
    20622827 * 
    20632828 * @param call_id       Call identification. 
    2064  * @param digits        DTMF digits to be sent. 
    2065  * 
    2066  * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2829 * @param digits        DTMF string digits to be sent. 
     2830 * 
     2831 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2832 * 
     2833 * \par Python: 
     2834 * \code 
     2835    status = py_pjsua.call_dial_dtmf(call_id, digits) 
     2836 * \endcode 
    20672837 */ 
    20682838PJ_DECL(pj_status_t) pjsua_call_dial_dtmf(pjsua_call_id call_id,  
     
    20832853 * 
    20842854 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2855 * 
     2856 * \par Python: 
     2857 * \code 
     2858    status = py_pjsua.call_send_im(call_id, mime_type, content, msg_data, user_data) 
     2859 * \endcode 
     2860 * Note that the \a user_data argument is an integer in Python. 
    20852861 */ 
    20862862PJ_DECL(pj_status_t) pjsua_call_send_im( pjsua_call_id call_id,  
     
    21012877 * 
    21022878 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2879 * 
     2880 * \par Python: 
     2881 * \code 
     2882    status = py_pjsua.call_send_typing_ind(call_id, is_typing, msg_data) 
     2883 * \endcode 
     2884 * Argument \a msg_data may be set to None if not required. 
    21032885 */ 
    21042886PJ_DECL(pj_status_t) pjsua_call_send_typing_ind(pjsua_call_id call_id,  
     
    21092891 * Terminate all calls. This will initiate #pjsua_call_hangup() for all 
    21102892 * currently active calls.  
     2893 * 
     2894 * \par Python: 
     2895 * \code 
     2896    py_pjsua.call_hangup_all() 
     2897 * \endcode 
    21112898 */ 
    21122899PJ_DECL(void) pjsua_call_hangup_all(void); 
     
    21232910 * 
    21242911 * @return              PJ_SUCCESS on success. 
     2912 * 
     2913 * \par Python: 
     2914 * \code 
     2915    string = py_pjsua.call_dump(call_id, with_media, max_len, indent) 
     2916 * \endcode 
     2917 * The \a max_len argument is the desired maximum length to be allocated. 
    21252918 */ 
    21262919PJ_DECL(pj_status_t) pjsua_call_dump(pjsua_call_id call_id,  
     
    21412934 
    21422935/** 
    2143  * @defgroup PJSUA_LIB_BUDDY Buddy, Presence, and Instant Messaging 
     2936 * @defgroup PJSUA_LIB_BUDDY PJSUA-API Buddy, Presence, and Instant Messaging 
    21442937 * @ingroup PJSUA_LIB 
    21452938 * @brief Buddy management, buddy's presence, and instant messaging. 
    21462939 * @{ 
     2940 * 
     2941 * This section describes PJSUA-APIs related to buddies management, 
     2942 * presence management, and instant messaging. 
    21472943 */ 
    21482944 
     
    21602956 * the structure with #pjsua_buddy_config_default() to initialize this 
    21612957 * structure with default configuration. 
     2958 * 
     2959 * \par Python: 
     2960 * In Python this structure is <tt>py_pjsua.Buddy_Config</tt>. However 
     2961 * it is recommended that application instantiates the buddy config 
     2962 * by calling: 
     2963 * \code 
     2964    buddy_cfg = py_pjsua.buddy_config_default() 
     2965 * \endcode 
    21622966 */ 
    21632967typedef struct pjsua_buddy_config 
     
    22043008 * This structure describes buddy info, which can be retrieved by calling 
    22053009 * #pjsua_buddy_get_info(). 
     3010 * 
     3011 * \par Python: 
     3012 * This structure in Python is <tt>py_pjsua.Buddy_Info</tt>. 
    22063013 */ 
    22073014typedef struct pjsua_buddy_info 
     
    22493056/** 
    22503057 * Set default values to the buddy config. 
     3058 * 
     3059 * \par Python: 
     3060 * \code 
     3061    buddy_cfg = py_pjsua.buddy_config_default() 
     3062 * \endcode 
    22513063 */ 
    22523064PJ_INLINE(void) pjsua_buddy_config_default(pjsua_buddy_config *cfg) 
     
    22603072 * 
    22613073 * @return              Number of buddies. 
     3074 * 
     3075 * \par Python: 
     3076 * \code 
     3077    buddy_count = py_pjsua.get_buddy_count() 
     3078 * \endcode 
    22623079 */ 
    22633080PJ_DECL(unsigned) pjsua_get_buddy_count(void); 
     
    22703087 * 
    22713088 * @return              Non-zero if buddy ID is valid. 
     3089 * 
     3090 * \par Python: 
     3091 * \code 
     3092    is_valid = py_pjsua.buddy_is_valid(buddy_id) 
     3093 * \endcode 
    22723094 */ 
    22733095PJ_DECL(pj_bool_t) pjsua_buddy_is_valid(pjsua_buddy_id buddy_id); 
     
    22853107 * 
    22863108 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     3109 * 
     3110 * \par Python: 
     3111 * The Python function takes no argument and returns list of buddy IDs: 
     3112 * \code 
     3113    [buddy_ids] = py_pjsua.enum_buddies() 
     3114 * \endcode 
    22873115 */ 
    22883116PJ_DECL(pj_status_t) pjsua_enum_buddies(pjsua_buddy_id ids[], 
     
    22963124 * 
    22973125 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     3126 * 
     3127 * \par Python: 
     3128 * \code 
     3129    buddy_info = py_pjsua.buddy_get_info(buddy_id) 
     3130 * \endcode 
     3131 * The function returns None if buddy_id is not valid. 
    22983132 */ 
    22993133PJ_DECL(pj_status_t) pjsua_buddy_get_info(pjsua_buddy_id buddy_id, 
     
    23053139 * session immediately. 
    23063140 * 
    2307  * @param cfg           Buddy configuration. 
     3141 * @param buddy)cfg     Buddy configuration. 
    23083142 * @param p_buddy_id    Pointer to receive buddy ID. 
    23093143 * 
    23103144 * @return              PJ_SUCCESS on success, or the appropriate error code. 
    2311  */ 
    2312 PJ_DECL(pj_status_t) pjsua_buddy_add(const pjsua_buddy_config *cfg, 
     3145 * 
     3146 * \par Python: 
     3147 * The function returns (status, buddy_id) tuple: 
     3148 * \code 
     3149    status, buddy_id = py_pjsua.buddy_add(buddy_cfg) 
     3150 * \endcode 
     3151 */ 
     3152PJ_DECL(pj_status_t) pjsua_buddy_add(const pjsua_buddy_config *buddy_cfg, 
    23133153                                     pjsua_buddy_id *p_buddy_id); 
    23143154 
     
    23213161 * 
    23223162 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     3163 * 
     3164 * \par Python: 
     3165 * \code 
     3166    status = py_pjsua.buddy_del(buddy_id) 
     3167 * \endcode 
    23233168 */ 
    23243169PJ_DECL(pj_status_t) pjsua_buddy_del(pjsua_buddy_id buddy_id); 
     
    23353180 * 
    23363181 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     3182 * 
     3183 * \par Python: 
     3184 * \code 
     3185    status = py_pjsua.buddy_subscribe_pres(buddy_id, subscribe) 
     3186 * \endcode 
    23373187 */ 
    23383188PJ_DECL(pj_status_t) pjsua_buddy_subscribe_pres(pjsua_buddy_id buddy_id, 
     
    23443194 * 
    23453195 * @param verbose       Yes or no. 
     3196 * 
     3197 * \par Python: 
     3198 * \code 
     3199    py_pjsua.pres_dump() 
     3200 * \endcode 
    23463201 */ 
    23473202PJ_DECL(void) pjsua_pres_dump(pj_bool_t verbose); 
     
    23713226 * 
    23723227 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     3228 * 
     3229 * \par Python: 
     3230 * \code 
     3231    status = py_pjsua.im_send(acc_id, to, mime_type, content, msg_data, user_data) 
     3232 * \endcode 
     3233 * Arguments \a mime_type and \a msg_data may be set to None if not required. 
    23733234 */ 
    23743235PJ_DECL(pj_status_t) pjsua_im_send(pjsua_acc_id acc_id,  
     
    23913252 * 
    23923253 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     3254 * 
     3255 * \par Python: 
     3256 * \code 
     3257    status = py_pjsua.im_typing(acc_id, to, is_typing, msg_data) 
     3258 * \endcode 
     3259 * Argument \a msg_data may be set to None if not requried. 
    23933260 */ 
    23943261PJ_DECL(pj_status_t) pjsua_im_typing(pjsua_acc_id acc_id,  
     
    24103277 
    24113278/** 
    2412  * @defgroup PJSUA_LIB_MEDIA Media 
     3279 * @defgroup PJSUA_LIB_MEDIA PJSUA-API Media Manipulation 
    24133280 * @ingroup PJSUA_LIB 
    24143281 * @brief Media manipulation. 
     
    24163283 * 
    24173284 * PJSUA has rather powerful media features, which are built around the 
    2418  * PJMEDIA conference bridge. Basically, all media termination (such as 
    2419  * calls, file players, file recorders, sound device, tone generators, etc) 
     3285 * PJMEDIA conference bridge. Basically, all media "ports" (such as calls, WAV  
     3286 * players, WAV playlist, file recorders, sound device, tone generators, etc) 
    24203287 * are terminated in the conference bridge, and application can manipulate 
    2421  * the interconnection between these terminations freely. If more than 
    2422  * one media terminations are terminated in the same slot, the conference 
    2423  * bridge will mix the signal automatically. 
     3288 * the interconnection between these terminations freely.  
     3289 * 
     3290 * The conference bridge provides powerful switching and mixing functionality 
     3291 * for application. With the conference bridge, each conference slot (e.g.  
     3292 * a call) can transmit to multiple destinations, and one destination can 
     3293 * receive from multiple sources. If more than one media terminations are  
     3294 * terminated in the same slot, the conference bridge will mix the signal  
     3295 * automatically. 
    24243296 * 
    24253297 * Application connects one media termination/slot to another by calling 
    24263298 * #pjsua_conf_connect() function. This will establish <b>unidirectional</b> 
    2427  * media flow from the source termination to the sink termination. For 
    2428  * example, to stream a WAV file to remote call, application may use 
     3299 * media flow from the source termination to the sink termination. To 
     3300 * establish bidirectional media flow, application wound need to make another 
     3301 * call to #pjsua_conf_connect(), this time inverting the source and  
     3302 * destination slots in the parameter. 
     3303 * 
     3304 * For example, to stream a WAV file to remote call, application may use 
    24293305 * the following steps: 
    24303306 * 
     
    25023378 * when calling #pjsua_init(). Application MUST initialize this structure 
    25033379 * by calling #pjsua_media_config_default(). 
     3380 * 
     3381 * \par Python: 
     3382 * This data type in Python is <tt>py_pjsua.Media_Config</tt>. To create 
     3383 * an object of this type, it is recommended to call  
     3384 * <tt>py_pjsua.media_config_default()</tt> function instead: 
     3385 * \code 
     3386    media_cfg = py_pjsua.media_config_default() 
     3387 * \endcode 
    25043388 */ 
    25053389struct pjsua_media_config 
     
    26383522 * 
    26393523 * @param cfg   The media config to be initialized. 
     3524 * 
     3525 * \par Python: 
     3526 * \code 
     3527    media_cfg = py_pjsua.media_config_default() 
     3528 * \endcode 
    26403529 */ 
    26413530PJ_INLINE(void) pjsua_media_config_default(pjsua_media_config *cfg) 
     
    26833572 * has been registered into the conference bridge. Application can query 
    26843573 * this info by calling #pjsua_conf_get_port_info(). 
     3574 * 
     3575 * \par Python: 
     3576 * In Python, this type is <tt>py_pjsua.Conf_Port_Info</tt>. 
    26853577 */ 
    26863578typedef struct pjsua_conf_port_info 
     
    27183610 * This structure holds information about custom media transport to 
    27193611 * be registered to pjsua. 
     3612 * 
     3613 * \par Python: 
     3614 * Not applicable. 
    27203615 */ 
    27213616typedef struct pjsua_media_transport 
     
    27413636 * 
    27423637 * @return              Maximum number of ports in the conference bridge. 
     3638 * 
     3639 * \par Python: 
     3640 * \code 
     3641    port_count = py_pjsua.conf_get_max_ports() 
     3642 * \endcode 
    27433643 */ 
    27443644PJ_DECL(unsigned) pjsua_conf_get_max_ports(void); 
     
    27493649 * 
    27503650 * @return              The number. 
     3651 * 
     3652 * \par Python: 
     3653 * \code 
     3654    count = py_pjsua.conf_get_active_ports() 
     3655 * \endcode 
    27513656 */ 
    27523657PJ_DECL(unsigned) pjsua_conf_get_active_ports(void); 
     
    27623667 * 
    27633668 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     3669 * 
     3670 * \par Python: 
     3671 * The Python functions returns list of conference port Ids: 
     3672 * \code 
     3673    [port_ids] = py_pjsua.enum_conf_ports() 
     3674 * \endcode 
    27643675 */ 
    27653676PJ_DECL(pj_status_t) pjsua_enum_conf_ports(pjsua_conf_port_id id[], 
     
    27703681 * Get information about the specified conference port 
    27713682 * 
    2772  * @param id            Port identification. 
     3683 * @param port_id       Port identification. 
    27733684 * @param info          Pointer to store the port info. 
    27743685 * 
    27753686 * @return              PJ_SUCCESS on success, or the appropriate error code. 
    2776  */ 
    2777 PJ_DECL(pj_status_t) pjsua_conf_get_port_info( pjsua_conf_port_id id, 
     3687 * 
     3688 * \par Python: 
     3689 * \code 
     3690    port_info = py_pjsua.conf_get_port_info(port_id) 
     3691 * \endcode 
     3692 * The function will return None if \a port_id is not valid. 
     3693 */ 
     3694PJ_DECL(pj_status_t) pjsua_conf_get_port_info( pjsua_conf_port_id port_id, 
    27783695                                               pjsua_conf_port_info *info); 
    27793696 
     
    27923709 * 
    27933710 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     3711 * 
     3712 * \par Python: 
     3713 * Not applicable (for now) 
    27943714 */ 
    27953715PJ_DECL(pj_status_t) pjsua_conf_add_port(pj_pool_t *pool, 
     
    28033723 * to #pjsua_conf_add_port(). 
    28043724 * 
    2805  * @param id            The slot id of the port to be removed. 
    2806  * 
    2807  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    2808  */ 
    2809 PJ_DECL(pj_status_t) pjsua_conf_remove_port(pjsua_conf_port_id id); 
     3725 * @param port_id       The slot id of the port to be removed. 
     3726 * 
     3727 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     3728 * 
     3729 * \par Python: 
     3730 * \code 
     3731    status = py_pjsua.conf_remove_port(port_id) 
     3732 * \endcode 
     3733 */ 
     3734PJ_DECL(pj_status_t) pjsua_conf_remove_port(pjsua_conf_port_id port_id); 
    28103735 
    28113736 
     
    28253750 * 
    28263751 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     3752 * 
     3753 * \par Python: 
     3754 * \code 
     3755    status = py_pjsua.conf_connect(source, sink) 
     3756 * \endcode 
    28273757 */ 
    28283758PJ_DECL(pj_status_t) pjsua_conf_connect(pjsua_conf_port_id source, 
     
    28373767 * 
    28383768 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     3769 * 
     3770 * \par Python: 
     3771 * \code 
     3772    status = py_pjsua.conf_disconnect(source, sink) 
     3773 * \endcode 
    28393774 */ 
    28403775PJ_DECL(pj_status_t) pjsua_conf_disconnect(pjsua_conf_port_id source, 
     
    28513786 * 
    28523787 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     3788 * 
     3789 * \par Python: 
     3790 * Not implemented (yet) 
    28533791 */ 
    28543792PJ_DECL(pj_status_t) pjsua_conf_adjust_tx_level(pjsua_conf_port_id slot, 
     
    28643802 * 
    28653803 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     3804 * 
     3805 * \par Python: 
     3806 * Not implemented (yet) 
    28663807 */ 
    28673808PJ_DECL(pj_status_t) pjsua_conf_adjust_rx_level(pjsua_conf_port_id slot, 
     
    28823823 * 
    28833824 * @return              PJ_SUCCESS on success. 
     3825 * 
     3826 * \par Python: 
     3827 * Not implemented (yet) 
    28843828 */ 
    28853829PJ_DECL(pj_status_t) pjsua_conf_get_signal_level(pjsua_conf_port_id slot, 
    28863830                                                 unsigned *tx_level, 
    28873831                                                 unsigned *rx_level); 
    2888  
    2889 /** 
    2890  *  
    2891  */ 
    2892  
    28933832 
    28943833 
     
    29093848 * 
    29103849 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     3850 * 
     3851 * \par Python: 
     3852 * The function returns (status, id) tuple: 
     3853 * \code 
     3854    status, id = py_pjsua.player_create(filename, options) 
     3855 * \endcode 
    29113856 */ 
    29123857PJ_DECL(pj_status_t) pjsua_player_create(const pj_str_t *filename, 
     
    29293874 * 
    29303875 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     3876 * 
     3877 * \par Python: 
     3878 * Not implemented yet. 
    29313879 */ 
    29323880PJ_DECL(pj_status_t) pjsua_playlist_create(const pj_str_t file_names[], 
     
    29423890 * 
    29433891 * @return              Conference port ID associated with this player. 
     3892 * 
     3893 * \par Python: 
     3894 * \code 
     3895    port_id = py_pjsua.player_get_conf_port(id) 
     3896 * \endcode 
    29443897 */ 
    29453898PJ_DECL(pjsua_conf_port_id) pjsua_player_get_conf_port(pjsua_player_id id); 
     
    29533906 * 
    29543907 * @return              PJ_SUCCESS on success. 
     3908 * 
     3909 * \par Python: 
     3910 * Not applicable. 
    29553911 */ 
    29563912PJ_DECL(pj_status_t) pjsua_player_get_port(pjsua_recorder_id id, 
     
    29653921 * 
    29663922 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     3923 * 
     3924 * \par Python: 
     3925 * \code 
     3926    status = py_pjsua.player_set_pos(id, samples) 
     3927 * \endcode 
    29673928 */ 
    29683929PJ_DECL(pj_status_t) pjsua_player_set_pos(pjsua_player_id id, 
     
    29773938 * 
    29783939 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     3940 * 
     3941 * \par Python: 
     3942 * \code 
     3943    status = py_pjsua.player_destroy(id) 
     3944 * \endcode 
    29793945 */ 
    29803946PJ_DECL(pj_status_t) pjsua_player_destroy(pjsua_player_id id); 
     
    30093975 * 
    30103976 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     3977 * 
     3978 * \par Python: 
     3979 * \code 
     3980    status, id = py_pjsua.recorder_create(filename, enc_type, enc_param, max_size, options) 
     3981 * \endcode 
     3982 * The \a enc_param is a string in Python. 
    30113983 */ 
    30123984PJ_DECL(pj_status_t) pjsua_recorder_create(const pj_str_t *filename, 
     
    30243996 * 
    30253997 * @return              Conference port ID associated with this recorder. 
     3998 * 
     3999 * \par Python: 
     4000 * \code 
     4001    port_id = py_pjsua.recorder_get_conf_port(id) 
     4002 * \endcode 
    30264003 */ 
    30274004PJ_DECL(pjsua_conf_port_id) pjsua_recorder_get_conf_port(pjsua_recorder_id id); 
     
    30354012 * 
    30364013 * @return              PJ_SUCCESS on success. 
     4014 * 
     4015 * \par Python: 
     4016 * Not applicable. 
    30374017 */ 
    30384018PJ_DECL(pj_status_t) pjsua_recorder_get_port(pjsua_recorder_id id, 
     
    30464026 * 
    30474027 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     4028 * 
     4029 * \par Python: 
     4030 * \code 
     4031    status = py_pjsua.recorder_destroy(id) 
     4032 * \endcode 
    30484033 */ 
    30494034PJ_DECL(pj_status_t) pjsua_recorder_destroy(pjsua_recorder_id id); 
     
    30634048 * 
    30644049 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     4050 * 
     4051 * 
     4052 * \par Python: 
     4053 * The function returns list of sound device info: 
     4054 * \code 
     4055    [dev_infos] = py_pjsua.enum_snd_devs() 
     4056 * \endcode 
     4057 * 
    30654058 */ 
    30664059PJ_DECL(pj_status_t) pjsua_enum_snd_devs(pjmedia_snd_dev_info info[], 
     
    30804073 * 
    30814074 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     4075 * 
     4076 * \par Python: 
     4077 * The function takes no argument and return a tuple: 
     4078 * \code 
     4079    capture_dev, playback_dev = py_pjsua.get_snd_dev() 
     4080 * \endcode 
    30824081 */ 
    30834082PJ_DECL(pj_status_t) pjsua_get_snd_dev(int *capture_dev, 
     
    30934092 * 
    30944093 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     4094 * 
     4095 * \par Python: 
     4096 * \code 
     4097    status = py_pjsua.set_snd_dev(capture_dev, playback_dev) 
     4098 * \endcode 
    30954099 */ 
    30964100PJ_DECL(pj_status_t) pjsua_set_snd_dev(int capture_dev, 
     
    31044108 * 
    31054109 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     4110 * 
     4111 * \par Python: 
     4112 * \code 
     4113    status = py_pjsua.set_null_snd_dev() 
     4114 * \endcode 
    31064115 */ 
    31074116PJ_DECL(pj_status_t) pjsua_set_null_snd_dev(void); 
     
    31154124 *                      so that application can connect this to it's own 
    31164125 *                      sound device or master port. 
     4126 * 
     4127 * \par Python: 
     4128 * Not applicable (for now). 
    31174129 */ 
    31184130PJ_DECL(pjmedia_port*) pjsua_set_no_snd_dev(void); 
     
    31284140 * 
    31294141 * @return              PJ_SUCCESS on success. 
     4142 * 
     4143 * \par Python: 
     4144 * \code 
     4145    status = py_pjsua.set_ec(tail_ms, options) 
     4146 * \endcode 
    31304147 */ 
    31314148PJ_DECL(pj_status_t) pjsua_set_ec(unsigned tail_ms, unsigned options); 
     
    31394156 * 
    31404157 * @return              PJ_SUCCESS on success. 
     4158 * 
     4159 * \par Python: 
     4160 * \code 
     4161    tail_ms = py_pjsua.get_ec_tail() 
     4162 * \endcode 
    31414163 */ 
    31424164PJ_DECL(pj_status_t) pjsua_get_ec_tail(unsigned *p_tail_ms); 
     
    31574179 * 
    31584180 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     4181 * 
     4182 * \par Python: 
     4183 * This function takes no argument and returns list of codec infos: 
     4184 * \code 
     4185    [codec_info] = py_pjsua.enum_codecs() 
     4186 * \endcode 
    31594187 */ 
    31604188PJ_DECL(pj_status_t) pjsua_enum_codecs( pjsua_codec_info id[], 
     
    31654193 * Change codec priority. 
    31664194 * 
    3167  * @param id            Codec ID. 
     4195 * @param codec_id      Codec ID, which is a string that uniquely identify 
     4196 *                      the codec (such as "speex/8000"). Please see pjsua 
     4197 *                      manual or pjmedia codec reference for details. 
    31684198 * @param priority      Codec priority, 0-255, where zero means to disable 
    31694199 *                      the codec. 
    31704200 * 
    31714201 * @return              PJ_SUCCESS on success, or the appropriate error code. 
    3172  */ 
    3173 PJ_DECL(pj_status_t) pjsua_codec_set_priority( const pj_str_t *id, 
     4202 * 
     4203 * \par Python: 
     4204 * \code 
     4205    status = py_pjsua.codec_set_priority(codec_id, priority) 
     4206 * \endcode 
     4207 */ 
     4208PJ_DECL(pj_status_t) pjsua_codec_set_priority( const pj_str_t *codec_id, 
    31744209                                               pj_uint8_t priority ); 
    31754210 
     
    31784213 * Get codec parameters. 
    31794214 * 
    3180  * @param id            Codec ID. 
     4215 * @param codec_id      Codec ID. 
    31814216 * @param param         Structure to receive codec parameters. 
    31824217 * 
    31834218 * @return              PJ_SUCCESS on success, or the appropriate error code. 
    3184  */ 
    3185 PJ_DECL(pj_status_t) pjsua_codec_get_param( const pj_str_t *id, 
     4219 * 
     4220 * \par Python: 
     4221 * The Python function is experimental: 
     4222 * \code 
     4223    codec_param = py_pjsua.codec_get_param(codec_id) 
     4224 * \endcode 
     4225 */ 
     4226PJ_DECL(pj_status_t) pjsua_codec_get_param( const pj_str_t *codec_id, 
    31864227                                            pjmedia_codec_param *param ); 
    31874228 
     
    31904231 * Set codec parameters. 
    31914232 * 
    3192  * @param id            Codec ID. 
     4233 * @param codec_id      Codec ID. 
    31934234 * @param param         Codec parameter to set. 
    31944235 * 
    31954236 * @return              PJ_SUCCESS on success, or the appropriate error code. 
    3196  */ 
    3197 PJ_DECL(pj_status_t) pjsua_codec_set_param( const pj_str_t *id, 
     4237 * 
     4238 * \par Python: 
     4239 * The Python function is experimental: 
     4240 * \code 
     4241    status = py_pjsua.codec_set_param(codec_id, param) 
     4242 * \endcode 
     4243 
     4244 */ 
     4245PJ_DECL(pj_status_t) pjsua_codec_set_param( const pj_str_t *codec_id, 
    31984246                                            const pjmedia_codec_param *param); 
    31994247 
     
    32104258 * 
    32114259 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     4260 * 
     4261 * \par Python: 
     4262 * Not implemented yet. 
    32124263 */ 
    32134264PJ_DECL(pj_status_t)  
     
    32274278 * 
    32284279 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     4280 * 
     4281 * \par Python: 
     4282 * Note applicable. 
    32294283 */ 
    32304284PJ_DECL(pj_status_t)  
     
    32404294 
    32414295 
     4296/** 
     4297 * @} 
     4298 */ 
     4299 
    32424300PJ_END_DECL 
    32434301 
    32444302 
    3245 /** 
    3246  * @} 
    3247  */ 
    3248  
    3249  
    32504303#endif  /* __PJSUA_H__ */ 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c

    r721 r918  
    8080 
    8181    /* Reset pool. */ 
    82     pj_pool_reset(pool); 
     82    //note: already done by caller 
     83    //pj_pool_reset(pool); 
    8384 
    8485    rdata = pj_pool_zalloc(pool, sizeof(pjsip_rx_data)); 
Note: See TracChangeset for help on using the changeset viewer.