- Timestamp:
- Jan 31, 2007 8:53:31 PM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/py_pjsua/py_pjsua.c
r916 r918 7182 7182 translate_hdr(pool, &msg_data.hdr_list, omd->hdr_list); 7183 7183 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); 7185 7185 pj_pool_release(pool); 7186 7186 } else { 7187 7187 status = pjsua_call_make_call(acc_id, &dst_uri, 7188 options, &user_data, NULL, &call_id);7188 options, (void*)user_data, NULL, &call_id); 7189 7189 } 7190 7190 … … 7339 7339 } 7340 7340 7341 status = pjsua_call_set_user_data(call_id, &user_data);7341 status = pjsua_call_set_user_data(call_id, (void*)user_data); 7342 7342 7343 7343 … … 7352 7352 { 7353 7353 int call_id; 7354 int* user_data;7354 void * user_data; 7355 7355 7356 7356 … … 7363 7363 7364 7364 7365 return Py_BuildValue("i", *user_data);7365 return Py_BuildValue("i", (int)user_data); 7366 7366 } 7367 7367 -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r911 r918 48 48 49 49 50 /** 51 * @defgroup PJSUA_LIB PJSUA API 50 PJ_BEGIN_DECL 51 52 53 /** 54 * @defgroup PJSUA_LIB PJSUA API - High Level Softphone API for C/C++ and Python 52 55 * @ingroup PJSIP 53 56 * @brief Very high level API for constructing SIP UA applications. 54 57 * @{ 55 58 * 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 57 63 * applications. It wraps together the signaling and media functionalities 58 64 * into an easy to use call API, provides account management, buddy … … 61 67 * voice recording, and so on. 62 68 * 69 * @subsection pjsua_for_c_cpp C/C++ Binding 63 70 * Application must link with <b>pjsua-lib</b> to use this API. In addition, 64 71 * this library depends on the following libraries: … … 71 78 * - <b>pjlib</b>, 72 79 * 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 75 116 * @section root_using_pjsua_lib Using PJSUA API 76 117 * 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. 78 121 */ 79 122 80 PJ_BEGIN_DECL81 82 83 /** Forward declaration */84 typedef struct pjsua_media_config pjsua_media_config;85 123 86 124 … … 90 128 91 129 /** 92 * @defgroup PJSUA_LIB_BASE BaseAPI130 * @defgroup PJSUA_LIB_BASE PJSUA-API Basic API 93 131 * @ingroup PJSUA_LIB 94 132 * @brief Basic application creation/initialization, logging configuration, etc. … … 102 140 * @subsection creating_pjsua_lib Creating PJSUA 103 141 * 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). 105 144 * 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. 107 150 * 108 151 * @subsection init_pjsua_lib Initializing PJSUA 109 152 * 110 153 * After PJSUA is created, application can initialize PJSUA by calling 111 * #pjsua_init(). This function takes several configuration settings in the112 * argument, so application normally would want to set these configuration113 * 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: 116 159 \code 117 160 … … 160 203 \endcode 161 204 * 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 211 import py_pjsua 212 213 # 214 # Initialize pjsua. 215 # 216 def 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 # 252 def err_exit(title, rc): 253 py_pjsua.perror(THIS_FILE, title, rc) 254 exit(1) 255 256 \endcode 257 258 162 259 * @subsection other_init_pjsua_lib Other Initialization 163 260 * … … 165 262 * need/want to perform the following tasks: 166 263 * 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 168 267 * @ref PJSUA_LIB_TRANSPORT section for more info. 169 268 * - 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. 171 271 * - add one or more buddies with #pjsua_buddy_add(). Please see 172 272 * @ref PJSUA_LIB_BUDDY section for more info. … … 179 279 * After all initializations have been done, application must call 180 280 * #pjsua_start() to start PJSUA. This function will check that all settings 181 * are properly configured, and apply default settings when it's not, or182 * 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. 183 283 * 184 284 * Most settings can be changed during run-time. For example, application … … 186 286 * during run-time. 187 287 * 288 * @subsubsection starting_pjsua_lib_c C Example for Starting PJSUA 188 289 * Sample code: 189 290 \code … … 210 311 } 211 312 \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 333 import thread 334 335 C_QUIT = 0 336 337 338 def 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 # 357 def 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 212 371 */ 213 372 … … 248 407 * #pjsua_init(). Application must call #pjsua_logging_config_default() to 249 408 * 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 250 417 */ 251 418 typedef struct pjsua_logging_config … … 280 447 * application specific device. This function will be called for 281 448 * 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 282 459 */ 283 460 void (*cb)(int level, const char *data, pj_size_t len); … … 291 468 * 292 469 * @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 293 476 */ 294 477 PJ_INLINE(void) pjsua_logging_config_default(pjsua_logging_config *cfg) … … 309 492 * @param dst Destination config. 310 493 * @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. 311 498 */ 312 499 PJ_INLINE(void) pjsua_logging_config_dup(pj_pool_t *pool, … … 325 512 * although definitely application would want to implement some of 326 513 * the important callbacks (such as \a on_incoming_call). 514 * 515 * \par Python Syntax: 516 * This callback structure is embedded on pjsua_config structure. 327 517 */ 328 518 typedef struct pjsua_callback … … 331 521 * Notify application when invite state has changed. 332 522 * 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. 334 524 * 335 525 * @param call_id The call index. 336 526 * @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 337 536 */ 338 537 void (*on_call_state)(pjsua_call_id call_id, pjsip_event *e); … … 345 544 * the call. 346 545 * @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 347 556 */ 348 557 void (*on_incoming_call)(pjsua_acc_id acc_id, pjsua_call_id call_id, … … 355 564 * 356 565 * @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 357 574 */ 358 575 void (*on_call_media_state)(pjsua_call_id call_id); … … 363 580 * @param call_id The call index. 364 581 * @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 365 591 */ 366 592 void (*on_dtmf_digit)(pjsua_call_id call_id, int digit); … … 378 604 * @param code Status code to be returned for the call transfer 379 605 * 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 380 617 */ 381 618 void (*on_call_transfer_request)(pjsua_call_id call_id, … … 390 627 * 391 628 * @param call_id Call ID. 392 * @param st atus_codeStatus progress of the transfer request.393 * @param st atus_textStatus progress text.629 * @param st_code Status progress of the transfer request. 630 * @param st_text Status progress text. 394 631 * @param final If non-zero, no further notification will 395 * be reported. The st atus_code specified in632 * be reported. The st_code specified in 396 633 * this callback is the final status. 397 634 * @param p_cont Initially will be set to non-zero, application … … 399 636 * to receie further notification (for example, 400 637 * 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 401 652 */ 402 653 void (*on_call_transfer_status)(pjsua_call_id call_id, 403 int st atus_code,404 const pj_str_t *st atus_text,654 int st_code, 655 const pj_str_t *st_text, 405 656 pj_bool_t final, 406 657 pj_bool_t *p_cont); … … 415 666 * should only return a final status (200-699). 416 667 * @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 417 681 */ 418 682 void (*on_call_replace_request)(pjsua_call_id call_id, … … 433 697 * @param new_call_id The new call. 434 698 * @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 435 708 */ 436 709 void (*on_call_replaced)(pjsua_call_id old_call_id, … … 444 717 * 445 718 * @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 446 727 */ 447 728 void (*on_reg_state)(pjsua_acc_id acc_id); … … 452 733 * 453 734 * @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 454 743 */ 455 744 void (*on_buddy_state)(pjsua_buddy_id buddy_id); … … 468 757 * @param mime_type MIME type of the message. 469 758 * @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 470 772 */ 471 773 void (*on_pager)(pjsua_call_id call_id, const pj_str_t *from, … … 486 788 * @param status Delivery status. 487 789 * @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 488 803 */ 489 804 void (*on_pager_status)(pjsua_call_id call_id, … … 505 820 * @param is_typing Non-zero if peer is typing, or zero if peer 506 821 * 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 507 834 */ 508 835 void (*on_typing)(pjsua_call_id call_id, const pj_str_t *from, … … 520 847 * Before setting the values, application must call #pjsua_config_default() 521 848 * 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 522 856 */ 523 857 typedef struct pjsua_config … … 602 936 * 603 937 * @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 604 946 */ 605 947 PJ_INLINE(void) pjsua_config_default(pjsua_config *cfg) … … 614 956 /** 615 957 * 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. 616 966 */ 617 967 PJ_INLINE(void) pjsip_cred_dup( pj_pool_t *pool, … … 629 979 /** 630 980 * Duplicate pjsua_config. 981 * 982 * @param pool The pool to get memory from. 983 * @param dst Destination config. 984 * @param src Source config. 631 985 */ 632 986 PJ_INLINE(void) pjsua_config_dup(pj_pool_t *pool, … … 660 1014 * Application MUST call #pjsua_msg_data_init() to initialize this 661 1015 * 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 662 1023 */ 663 1024 typedef struct pjsua_msg_data … … 665 1026 /** 666 1027 * 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 667 1036 */ 668 1037 pjsip_hdr hdr_list; … … 685 1054 * 686 1055 * @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 687 1062 */ 688 1063 PJ_INLINE(void) pjsua_msg_data_init(pjsua_msg_data *msg_data) … … 701 1076 * 702 1077 * @return PJ_SUCCESS on success, or the appropriate error code. 1078 * 1079 * \par Python: 1080 * \code 1081 status = py_pjsua.create() 1082 * \endcode 703 1083 */ 704 1084 PJ_DECL(pj_status_t) pjsua_create(void); 1085 1086 1087 /* Forward declaration */ 1088 typedef struct pjsua_media_config pjsua_media_config; 705 1089 706 1090 … … 717 1101 * 718 1102 * @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. 719 1112 */ 720 1113 PJ_DECL(pj_status_t) pjsua_init(const pjsua_config *ua_cfg, … … 731 1124 * 732 1125 * @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 733 1132 */ 734 1133 PJ_DECL(pj_status_t) pjsua_start(void); … … 747 1146 * 748 1147 * @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 749 1154 */ 750 1155 PJ_DECL(pj_status_t) pjsua_destroy(void); … … 763 1168 * @return The number of events that have been handled during the 764 1169 * 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 766 1177 */ 767 1178 PJ_DECL(int) pjsua_handle_events(unsigned msec_timeout); … … 777 1188 * 778 1189 * @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 779 1196 */ 780 1197 PJ_DECL(pj_pool_t*) pjsua_pool_create(const char *name, pj_size_t init_size, … … 789 1206 * 790 1207 * @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 791 1214 */ 792 1215 PJ_DECL(pj_status_t) pjsua_reconfigure_logging(const pjsua_logging_config *c); … … 799 1222 * 800 1223 * @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. 801 1232 */ 802 1233 PJ_DECL(pjsip_endpoint*) pjsua_get_pjsip_endpt(void); … … 807 1238 * 808 1239 * @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. 809 1248 */ 810 1249 PJ_DECL(pjmedia_endpt*) pjsua_get_pjmedia_endpt(void); … … 815 1254 * 816 1255 * @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. 817 1264 */ 818 1265 PJ_DECL(pj_pool_factory*) pjsua_get_pool_factory(void); … … 829 1276 * URL is valid, PJ_SUCCESS will be returned. 830 1277 * 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 */ 1287 PJ_DECL(pj_status_t) pjsua_verify_sip_url(const char *url); 836 1288 837 1289 … … 843 1295 * @param title Message title for the error. 844 1296 * @param status Status code. 1297 * 1298 * \par Python: 1299 * \code 1300 py_pjsua.perror(sender, title, status) 1301 * \endcode 845 1302 */ 846 1303 PJ_DECL(void) pjsua_perror(const char *sender, const char *title, … … 861 1318 862 1319 /** 863 * @defgroup PJSUA_LIB_TRANSPORT Signaling Transport1320 * @defgroup PJSUA_LIB_TRANSPORT PJSUA-API Signaling Transport 864 1321 * @ingroup PJSUA_LIB 865 1322 * @brief API for managing SIP transports 866 1323 * @{ 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 */ 873 1333 typedef int pjsua_transport_id; 874 1334 … … 910 1370 /** 911 1371 * 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. 912 1375 * 913 1376 * @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 914 1383 */ 915 1384 PJ_INLINE(void) pjsua_stun_config_default(pjsua_stun_config *cfg) … … 924 1393 * MUST call #pjsua_transport_config_default() to initialize its 925 1394 * 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 926 1402 */ 927 1403 typedef struct pjsua_transport_config … … 983 1459 * 984 1460 * @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 985 1467 */ 986 1468 PJ_INLINE(void) pjsua_transport_config_default(pjsua_transport_config *cfg) … … 997 1479 * 998 1480 * @param cfg The STUN config to be initialized. 1481 * 1482 * \par Python: 1483 * \code 1484 py_pjsua.normalize_stun_config(cfg) 1485 * \code 999 1486 */ 1000 1487 PJ_INLINE(void) pjsua_normalize_stun_config( pjsua_stun_config *cfg ) … … 1023 1510 /** 1024 1511 * 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. 1025 1520 */ 1026 1521 PJ_INLINE(void) pjsua_transport_config_dup(pj_pool_t *pool, … … 1048 1543 * This structure describes transport information returned by 1049 1544 * #pjsua_transport_get_info() function. 1545 * 1546 * \par Python: 1547 * The corresponding data type in Python is <tt>py_pjsua.Transport_Info</tt>. 1050 1548 */ 1051 1549 typedef struct pjsua_transport_info … … 1109 1607 * 1110 1608 * @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 1111 1615 */ 1112 1616 PJ_DECL(pj_status_t) pjsua_transport_create(pjsip_transport_type_e type, … … 1115 1619 1116 1620 /** 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. 1118 1624 * 1119 1625 * @param tp Transport instance. … … 1121 1627 * 1122 1628 * @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. 1123 1633 */ 1124 1634 PJ_DECL(pj_status_t) pjsua_transport_register(pjsip_transport *tp, … … 1127 1637 1128 1638 /** 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. 1130 1643 * 1131 1644 * @param id Array to receive transport ids. … … 1134 1647 * 1135 1648 * @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 1136 1655 */ 1137 1656 PJ_DECL(pj_status_t) pjsua_enum_transports( pjsua_transport_id id[], … … 1146 1665 * 1147 1666 * @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. 1148 1673 */ 1149 1674 PJ_DECL(pj_status_t) pjsua_transport_get_info(pjsua_transport_id id, … … 1161 1686 * 1162 1687 * @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 1163 1693 */ 1164 1694 PJ_DECL(pj_status_t) pjsua_transport_set_enable(pjsua_transport_id id, … … 1179 1709 * 1180 1710 * @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 1181 1716 */ 1182 1717 PJ_DECL(pj_status_t) pjsua_transport_close( pjsua_transport_id id, … … 1196 1731 1197 1732 /** 1198 * @defgroup PJSUA_LIB_ACC AccountManagement1733 * @defgroup PJSUA_LIB_ACC PJSUA-API Accounts Management 1199 1734 * @ingroup PJSUA_LIB 1200 * @brief PJSUA supports multiple accounts..1735 * @brief PJSUA Accounts management 1201 1736 * @{ 1737 * 1202 1738 * 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>. 1204 1745 * 1205 1746 * Account may or may not have client registration associated with it. … … 1207 1748 * credentials</b>, which are used when sending SIP request messages using the 1208 1749 * 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. 1211 1753 * 1212 1754 * At least one account MUST be created in the application. If no user 1213 1755 * association is required, application can create a userless account by 1214 1756 * 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. 1216 1759 * 1217 1760 * Also one account must be set as the <b>default account</b>, which is used as … … 1262 1805 * adding a new account with #pjsua_acc_add(). Application MUST initialize 1263 1806 * 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 1264 1815 */ 1265 1816 typedef struct pjsua_acc_config … … 1304 1855 /** 1305 1856 * Number of proxies in the proxy array below. 1857 * 1858 * \par Python: 1859 * Not applicable, as \a proxy is implemented as list of strings. 1306 1860 */ 1307 1861 unsigned proxy_cnt; … … 1319 1873 * then these account proxies will be placed after the global outbound 1320 1874 * proxies in the routeset. 1875 * 1876 * \par Python: 1877 * This will be list of strings. 1321 1878 */ 1322 1879 pj_str_t proxy[PJSUA_ACC_MAX_PROXIES]; … … 1330 1887 /** 1331 1888 * Number of credentials in the credential array. 1889 * 1890 * \par Python: 1891 * Not applicable, since \a cred_info is a list of credentials. 1332 1892 */ 1333 1893 unsigned cred_count; … … 1339 1899 * example when the requests are expected to be challenged by the 1340 1900 * proxies in the route set. 1901 * 1902 * \par Python: 1903 * This field is a list of credentials. 1341 1904 */ 1342 1905 pjsip_cred_info cred_info[PJSUA_ACC_MAX_PROXIES]; … … 1362 1925 * 1363 1926 * @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 1364 1934 */ 1365 1935 PJ_INLINE(void) pjsua_acc_config_default(pjsua_acc_config *cfg) … … 1376 1946 * Account info. Application can query account info by calling 1377 1947 * #pjsua_acc_get_info(). 1948 * 1949 * \par Python: 1950 * The data type in Python is <tt>py_pjsua.Acc_Info</tt>. 1378 1951 */ 1379 1952 typedef struct pjsua_acc_info … … 1435 2008 * 1436 2009 * @return Current number of accounts. 2010 * 2011 * \par Python: 2012 * \code 2013 count = py_pjsua.acc_get_count() 2014 * \endcode 1437 2015 */ 1438 2016 PJ_DECL(unsigned) pjsua_acc_get_count(void); … … 1445 2023 * 1446 2024 * @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 1447 2030 */ 1448 2031 PJ_DECL(pj_bool_t) pjsua_acc_is_valid(pjsua_acc_id acc_id); … … 1456 2039 * 1457 2040 * @return PJ_SUCCESS on success. 2041 * 2042 * \par Python: 2043 * \code 2044 status = py_pjsua.acc_set_default(acc_id) 2045 * \endcode 1458 2046 */ 1459 2047 PJ_DECL(pj_status_t) pjsua_acc_set_default(pjsua_acc_id acc_id); … … 1467 2055 * @return The default account ID, or PJSUA_INVALID_ID if no 1468 2056 * default account is configured. 2057 * 2058 * \par Python: 2059 * \code 2060 acc_id = py_pjsua.acc_get_default() 2061 * \endcode 1469 2062 */ 1470 2063 PJ_DECL(pjsua_acc_id) pjsua_acc_get_default(void); … … 1480 2073 * 1481 2074 * 1482 * @param cfgAccount configuration.2075 * @param acc_cfg Account configuration. 1483 2076 * @param is_default If non-zero, this account will be set as the default 1484 2077 * account. The default account will be used when sending … … 1490 2083 * 1491 2084 * @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 */ 2092 PJ_DECL(pj_status_t) pjsua_acc_add(const pjsua_acc_config *acc_cfg, 1494 2093 pj_bool_t is_default, 1495 2094 pjsua_acc_id *p_acc_id); … … 1511 2110 * 1512 2111 * @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 1513 2118 */ 1514 2119 PJ_DECL(pj_status_t) pjsua_acc_add_local(pjsua_transport_id tid, … … 1524 2129 * 1525 2130 * @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 1526 2136 */ 1527 2137 PJ_DECL(pj_status_t) pjsua_acc_del(pjsua_acc_id acc_id); … … 1532 2142 * 1533 2143 * @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 1537 2152 */ 1538 2153 PJ_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); 1540 2155 1541 2156 … … 1549 2164 * 1550 2165 * @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 1551 2171 */ 1552 2172 PJ_DECL(pj_status_t) pjsua_acc_set_online_status(pjsua_acc_id acc_id, … … 1566 2186 * 1567 2187 * @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 1568 2193 */ 1569 2194 PJ_DECL(pj_status_t) pjsua_acc_set_registration(pjsua_acc_id acc_id, … … 1578 2203 * 1579 2204 * @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. 1580 2211 */ 1581 2212 PJ_DECL(pj_status_t) pjsua_acc_get_info(pjsua_acc_id acc_id, … … 1595 2226 * 1596 2227 * @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 1597 2234 */ 1598 2235 PJ_DECL(pj_status_t) pjsua_enum_accs(pjsua_acc_id ids[], … … 1608 2245 * 1609 2246 * @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 1610 2253 */ 1611 2254 PJ_DECL(pj_status_t) pjsua_acc_enum_info( pjsua_acc_info info[], … … 1620 2263 * 1621 2264 * @return Account id. 2265 * 2266 * \par Python: 2267 * \code 2268 acc_id = py_pjsua.acc_find_for_outgoing(url) 2269 * \endcode 1622 2270 */ 1623 2271 PJ_DECL(pjsua_acc_id) pjsua_acc_find_for_outgoing(const pj_str_t *url); … … 1631 2279 * 1632 2280 * @return Account id. 2281 * 2282 * \par Python: 2283 * \code 2284 acc_id = py_pjsua.acc_find_for_outgoing(url) 2285 * \endcode 1633 2286 */ 1634 2287 PJ_DECL(pjsua_acc_id) pjsua_acc_find_for_incoming(pjsip_rx_data *rdata); … … 1645 2298 * 1646 2299 * @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 1647 2306 */ 1648 2307 PJ_DECL(pj_status_t) pjsua_acc_create_uac_contact( pj_pool_t *pool, … … 1663 2322 * 1664 2323 * @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 1665 2330 */ 1666 2331 PJ_DECL(pj_status_t) pjsua_acc_create_uas_contact( pj_pool_t *pool, … … 1686 2351 * 1687 2352 * @return PJ_SUCCESS on success. 2353 * 2354 * \par Python: 2355 * Not yet implemented. 1688 2356 */ 1689 2357 PJ_DECL(pj_status_t) pjsua_acc_set_transport(pjsua_acc_id acc_id, … … 1702 2370 1703 2371 /** 1704 * @defgroup PJSUA_LIB_CALL Calls2372 * @defgroup PJSUA_LIB_CALL PJSUA-API Calls Management 1705 2373 * @ingroup PJSUA_LIB 1706 2374 * @brief Call manipulation. … … 1740 2408 /** 1741 2409 * 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>. 1742 2413 */ 1743 2414 typedef struct pjsua_call_info … … 1814 2485 * 1815 2486 * @return Maximum number of calls configured. 2487 * 2488 * \par Python: 2489 * \code 2490 count = py_pjsua.call_get_max_count() 2491 * \endcode 1816 2492 */ 1817 2493 PJ_DECL(unsigned) pjsua_call_get_max_count(void); … … 1821 2497 * 1822 2498 * @return Number of currently active calls. 2499 * 2500 * \par Python: 2501 * \code 2502 count = py_pjsua.call_get_count() 2503 * \endcode 1823 2504 */ 1824 2505 PJ_DECL(unsigned) pjsua_call_get_count(void); … … 1833 2514 * 1834 2515 * @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 1835 2522 */ 1836 2523 PJ_DECL(pj_status_t) pjsua_enum_calls(pjsua_call_id ids[], … … 1852 2539 * 1853 2540 * @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. 1854 2550 */ 1855 2551 PJ_DECL(pj_status_t) pjsua_call_make_call(pjsua_acc_id acc_id, … … 1868 2564 * 1869 2565 * @return Non-zero if call is active. 2566 * 2567 * \par Python: 2568 * \code 2569 bool = py_pjsua.call_is_active(call_id) 2570 * \endcode 1870 2571 */ 1871 2572 PJ_DECL(pj_bool_t) pjsua_call_is_active(pjsua_call_id call_id); … … 1878 2579 * 1879 2580 * @return Non-zero if yes. 2581 * 2582 * \par Python: 2583 * \code 2584 bool = py_pjsua.call_has_media(call_id) 2585 * \endcode 1880 2586 */ 1881 2587 PJ_DECL(pj_bool_t) pjsua_call_has_media(pjsua_call_id call_id); … … 1889 2595 * @return Conference port ID, or PJSUA_INVALID_ID when the 1890 2596 * 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 1891 2602 */ 1892 2603 PJ_DECL(pjsua_conf_port_id) pjsua_call_get_conf_port(pjsua_call_id call_id); … … 1899 2610 * 1900 2611 * @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. 1901 2618 */ 1902 2619 PJ_DECL(pj_status_t) pjsua_call_get_info(pjsua_call_id call_id, … … 1912 2629 * 1913 2630 * @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. 1914 2637 */ 1915 2638 PJ_DECL(pj_status_t) pjsua_call_set_user_data(pjsua_call_id call_id, … … 1924 2647 * 1925 2648 * @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. 1926 2655 */ 1927 2656 PJ_DECL(void*) pjsua_call_get_user_data(pjsua_call_id call_id); … … 1941 2670 * 1942 2671 * @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. 1943 2678 */ 1944 2679 PJ_DECL(pj_status_t) pjsua_call_answer(pjsua_call_id call_id, … … 1965 2700 * 1966 2701 * @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. 1967 2708 */ 1968 2709 PJ_DECL(pj_status_t) pjsua_call_hangup(pjsua_call_id call_id, … … 1984 2725 * 1985 2726 * @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. 1986 2733 */ 1987 2734 PJ_DECL(pj_status_t) pjsua_call_set_hold(pjsua_call_id call_id, … … 2002 2749 * 2003 2750 * @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. 2004 2757 */ 2005 2758 PJ_DECL(pj_status_t) pjsua_call_reinvite(pjsua_call_id call_id, … … 2024 2777 * 2025 2778 * @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. 2026 2785 */ 2027 2786 PJ_DECL(pj_status_t) pjsua_call_xfer(pjsua_call_id call_id, … … 2052 2811 * 2053 2812 * @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. 2054 2819 */ 2055 2820 PJ_DECL(pj_status_t) pjsua_call_xfer_replaces(pjsua_call_id call_id, … … 2062 2827 * 2063 2828 * @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 2067 2837 */ 2068 2838 PJ_DECL(pj_status_t) pjsua_call_dial_dtmf(pjsua_call_id call_id, … … 2083 2853 * 2084 2854 * @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. 2085 2861 */ 2086 2862 PJ_DECL(pj_status_t) pjsua_call_send_im( pjsua_call_id call_id, … … 2101 2877 * 2102 2878 * @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. 2103 2885 */ 2104 2886 PJ_DECL(pj_status_t) pjsua_call_send_typing_ind(pjsua_call_id call_id, … … 2109 2891 * Terminate all calls. This will initiate #pjsua_call_hangup() for all 2110 2892 * currently active calls. 2893 * 2894 * \par Python: 2895 * \code 2896 py_pjsua.call_hangup_all() 2897 * \endcode 2111 2898 */ 2112 2899 PJ_DECL(void) pjsua_call_hangup_all(void); … … 2123 2910 * 2124 2911 * @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. 2125 2918 */ 2126 2919 PJ_DECL(pj_status_t) pjsua_call_dump(pjsua_call_id call_id, … … 2141 2934 2142 2935 /** 2143 * @defgroup PJSUA_LIB_BUDDY Buddy, Presence, and Instant Messaging2936 * @defgroup PJSUA_LIB_BUDDY PJSUA-API Buddy, Presence, and Instant Messaging 2144 2937 * @ingroup PJSUA_LIB 2145 2938 * @brief Buddy management, buddy's presence, and instant messaging. 2146 2939 * @{ 2940 * 2941 * This section describes PJSUA-APIs related to buddies management, 2942 * presence management, and instant messaging. 2147 2943 */ 2148 2944 … … 2160 2956 * the structure with #pjsua_buddy_config_default() to initialize this 2161 2957 * 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 2162 2966 */ 2163 2967 typedef struct pjsua_buddy_config … … 2204 3008 * This structure describes buddy info, which can be retrieved by calling 2205 3009 * #pjsua_buddy_get_info(). 3010 * 3011 * \par Python: 3012 * This structure in Python is <tt>py_pjsua.Buddy_Info</tt>. 2206 3013 */ 2207 3014 typedef struct pjsua_buddy_info … … 2249 3056 /** 2250 3057 * Set default values to the buddy config. 3058 * 3059 * \par Python: 3060 * \code 3061 buddy_cfg = py_pjsua.buddy_config_default() 3062 * \endcode 2251 3063 */ 2252 3064 PJ_INLINE(void) pjsua_buddy_config_default(pjsua_buddy_config *cfg) … … 2260 3072 * 2261 3073 * @return Number of buddies. 3074 * 3075 * \par Python: 3076 * \code 3077 buddy_count = py_pjsua.get_buddy_count() 3078 * \endcode 2262 3079 */ 2263 3080 PJ_DECL(unsigned) pjsua_get_buddy_count(void); … … 2270 3087 * 2271 3088 * @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 2272 3094 */ 2273 3095 PJ_DECL(pj_bool_t) pjsua_buddy_is_valid(pjsua_buddy_id buddy_id); … … 2285 3107 * 2286 3108 * @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 2287 3115 */ 2288 3116 PJ_DECL(pj_status_t) pjsua_enum_buddies(pjsua_buddy_id ids[], … … 2296 3124 * 2297 3125 * @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. 2298 3132 */ 2299 3133 PJ_DECL(pj_status_t) pjsua_buddy_get_info(pjsua_buddy_id buddy_id, … … 2305 3139 * session immediately. 2306 3140 * 2307 * @param cfgBuddy configuration.3141 * @param buddy)cfg Buddy configuration. 2308 3142 * @param p_buddy_id Pointer to receive buddy ID. 2309 3143 * 2310 3144 * @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 */ 3152 PJ_DECL(pj_status_t) pjsua_buddy_add(const pjsua_buddy_config *buddy_cfg, 2313 3153 pjsua_buddy_id *p_buddy_id); 2314 3154 … … 2321 3161 * 2322 3162 * @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 2323 3168 */ 2324 3169 PJ_DECL(pj_status_t) pjsua_buddy_del(pjsua_buddy_id buddy_id); … … 2335 3180 * 2336 3181 * @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 2337 3187 */ 2338 3188 PJ_DECL(pj_status_t) pjsua_buddy_subscribe_pres(pjsua_buddy_id buddy_id, … … 2344 3194 * 2345 3195 * @param verbose Yes or no. 3196 * 3197 * \par Python: 3198 * \code 3199 py_pjsua.pres_dump() 3200 * \endcode 2346 3201 */ 2347 3202 PJ_DECL(void) pjsua_pres_dump(pj_bool_t verbose); … … 2371 3226 * 2372 3227 * @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. 2373 3234 */ 2374 3235 PJ_DECL(pj_status_t) pjsua_im_send(pjsua_acc_id acc_id, … … 2391 3252 * 2392 3253 * @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. 2393 3260 */ 2394 3261 PJ_DECL(pj_status_t) pjsua_im_typing(pjsua_acc_id acc_id, … … 2410 3277 2411 3278 /** 2412 * @defgroup PJSUA_LIB_MEDIA Media3279 * @defgroup PJSUA_LIB_MEDIA PJSUA-API Media Manipulation 2413 3280 * @ingroup PJSUA_LIB 2414 3281 * @brief Media manipulation. … … 2416 3283 * 2417 3284 * PJSUA has rather powerful media features, which are built around the 2418 * PJMEDIA conference bridge. Basically, all media termination (such as2419 * 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) 2420 3287 * 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. 2424 3296 * 2425 3297 * Application connects one media termination/slot to another by calling 2426 3298 * #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 2429 3305 * the following steps: 2430 3306 * … … 2502 3378 * when calling #pjsua_init(). Application MUST initialize this structure 2503 3379 * 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 2504 3388 */ 2505 3389 struct pjsua_media_config … … 2638 3522 * 2639 3523 * @param cfg The media config to be initialized. 3524 * 3525 * \par Python: 3526 * \code 3527 media_cfg = py_pjsua.media_config_default() 3528 * \endcode 2640 3529 */ 2641 3530 PJ_INLINE(void) pjsua_media_config_default(pjsua_media_config *cfg) … … 2683 3572 * has been registered into the conference bridge. Application can query 2684 3573 * 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>. 2685 3577 */ 2686 3578 typedef struct pjsua_conf_port_info … … 2718 3610 * This structure holds information about custom media transport to 2719 3611 * be registered to pjsua. 3612 * 3613 * \par Python: 3614 * Not applicable. 2720 3615 */ 2721 3616 typedef struct pjsua_media_transport … … 2741 3636 * 2742 3637 * @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 2743 3643 */ 2744 3644 PJ_DECL(unsigned) pjsua_conf_get_max_ports(void); … … 2749 3649 * 2750 3650 * @return The number. 3651 * 3652 * \par Python: 3653 * \code 3654 count = py_pjsua.conf_get_active_ports() 3655 * \endcode 2751 3656 */ 2752 3657 PJ_DECL(unsigned) pjsua_conf_get_active_ports(void); … … 2762 3667 * 2763 3668 * @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 2764 3675 */ 2765 3676 PJ_DECL(pj_status_t) pjsua_enum_conf_ports(pjsua_conf_port_id id[], … … 2770 3681 * Get information about the specified conference port 2771 3682 * 2772 * @param idPort identification.3683 * @param port_id Port identification. 2773 3684 * @param info Pointer to store the port info. 2774 3685 * 2775 3686 * @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 */ 3694 PJ_DECL(pj_status_t) pjsua_conf_get_port_info( pjsua_conf_port_id port_id, 2778 3695 pjsua_conf_port_info *info); 2779 3696 … … 2792 3709 * 2793 3710 * @return PJ_SUCCESS on success, or the appropriate error code. 3711 * 3712 * \par Python: 3713 * Not applicable (for now) 2794 3714 */ 2795 3715 PJ_DECL(pj_status_t) pjsua_conf_add_port(pj_pool_t *pool, … … 2803 3723 * to #pjsua_conf_add_port(). 2804 3724 * 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 */ 3734 PJ_DECL(pj_status_t) pjsua_conf_remove_port(pjsua_conf_port_id port_id); 2810 3735 2811 3736 … … 2825 3750 * 2826 3751 * @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 2827 3757 */ 2828 3758 PJ_DECL(pj_status_t) pjsua_conf_connect(pjsua_conf_port_id source, … … 2837 3767 * 2838 3768 * @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 2839 3774 */ 2840 3775 PJ_DECL(pj_status_t) pjsua_conf_disconnect(pjsua_conf_port_id source, … … 2851 3786 * 2852 3787 * @return PJ_SUCCESS on success, or the appropriate error code. 3788 * 3789 * \par Python: 3790 * Not implemented (yet) 2853 3791 */ 2854 3792 PJ_DECL(pj_status_t) pjsua_conf_adjust_tx_level(pjsua_conf_port_id slot, … … 2864 3802 * 2865 3803 * @return PJ_SUCCESS on success, or the appropriate error code. 3804 * 3805 * \par Python: 3806 * Not implemented (yet) 2866 3807 */ 2867 3808 PJ_DECL(pj_status_t) pjsua_conf_adjust_rx_level(pjsua_conf_port_id slot, … … 2882 3823 * 2883 3824 * @return PJ_SUCCESS on success. 3825 * 3826 * \par Python: 3827 * Not implemented (yet) 2884 3828 */ 2885 3829 PJ_DECL(pj_status_t) pjsua_conf_get_signal_level(pjsua_conf_port_id slot, 2886 3830 unsigned *tx_level, 2887 3831 unsigned *rx_level); 2888 2889 /**2890 *2891 */2892 2893 3832 2894 3833 … … 2909 3848 * 2910 3849 * @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 2911 3856 */ 2912 3857 PJ_DECL(pj_status_t) pjsua_player_create(const pj_str_t *filename, … … 2929 3874 * 2930 3875 * @return PJ_SUCCESS on success, or the appropriate error code. 3876 * 3877 * \par Python: 3878 * Not implemented yet. 2931 3879 */ 2932 3880 PJ_DECL(pj_status_t) pjsua_playlist_create(const pj_str_t file_names[], … … 2942 3890 * 2943 3891 * @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 2944 3897 */ 2945 3898 PJ_DECL(pjsua_conf_port_id) pjsua_player_get_conf_port(pjsua_player_id id); … … 2953 3906 * 2954 3907 * @return PJ_SUCCESS on success. 3908 * 3909 * \par Python: 3910 * Not applicable. 2955 3911 */ 2956 3912 PJ_DECL(pj_status_t) pjsua_player_get_port(pjsua_recorder_id id, … … 2965 3921 * 2966 3922 * @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 2967 3928 */ 2968 3929 PJ_DECL(pj_status_t) pjsua_player_set_pos(pjsua_player_id id, … … 2977 3938 * 2978 3939 * @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 2979 3945 */ 2980 3946 PJ_DECL(pj_status_t) pjsua_player_destroy(pjsua_player_id id); … … 3009 3975 * 3010 3976 * @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. 3011 3983 */ 3012 3984 PJ_DECL(pj_status_t) pjsua_recorder_create(const pj_str_t *filename, … … 3024 3996 * 3025 3997 * @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 3026 4003 */ 3027 4004 PJ_DECL(pjsua_conf_port_id) pjsua_recorder_get_conf_port(pjsua_recorder_id id); … … 3035 4012 * 3036 4013 * @return PJ_SUCCESS on success. 4014 * 4015 * \par Python: 4016 * Not applicable. 3037 4017 */ 3038 4018 PJ_DECL(pj_status_t) pjsua_recorder_get_port(pjsua_recorder_id id, … … 3046 4026 * 3047 4027 * @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 3048 4033 */ 3049 4034 PJ_DECL(pj_status_t) pjsua_recorder_destroy(pjsua_recorder_id id); … … 3063 4048 * 3064 4049 * @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 * 3065 4058 */ 3066 4059 PJ_DECL(pj_status_t) pjsua_enum_snd_devs(pjmedia_snd_dev_info info[], … … 3080 4073 * 3081 4074 * @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 3082 4081 */ 3083 4082 PJ_DECL(pj_status_t) pjsua_get_snd_dev(int *capture_dev, … … 3093 4092 * 3094 4093 * @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 3095 4099 */ 3096 4100 PJ_DECL(pj_status_t) pjsua_set_snd_dev(int capture_dev, … … 3104 4108 * 3105 4109 * @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 3106 4115 */ 3107 4116 PJ_DECL(pj_status_t) pjsua_set_null_snd_dev(void); … … 3115 4124 * so that application can connect this to it's own 3116 4125 * sound device or master port. 4126 * 4127 * \par Python: 4128 * Not applicable (for now). 3117 4129 */ 3118 4130 PJ_DECL(pjmedia_port*) pjsua_set_no_snd_dev(void); … … 3128 4140 * 3129 4141 * @return PJ_SUCCESS on success. 4142 * 4143 * \par Python: 4144 * \code 4145 status = py_pjsua.set_ec(tail_ms, options) 4146 * \endcode 3130 4147 */ 3131 4148 PJ_DECL(pj_status_t) pjsua_set_ec(unsigned tail_ms, unsigned options); … … 3139 4156 * 3140 4157 * @return PJ_SUCCESS on success. 4158 * 4159 * \par Python: 4160 * \code 4161 tail_ms = py_pjsua.get_ec_tail() 4162 * \endcode 3141 4163 */ 3142 4164 PJ_DECL(pj_status_t) pjsua_get_ec_tail(unsigned *p_tail_ms); … … 3157 4179 * 3158 4180 * @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 3159 4187 */ 3160 4188 PJ_DECL(pj_status_t) pjsua_enum_codecs( pjsua_codec_info id[], … … 3165 4193 * Change codec priority. 3166 4194 * 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. 3168 4198 * @param priority Codec priority, 0-255, where zero means to disable 3169 4199 * the codec. 3170 4200 * 3171 4201 * @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 */ 4208 PJ_DECL(pj_status_t) pjsua_codec_set_priority( const pj_str_t *codec_id, 3174 4209 pj_uint8_t priority ); 3175 4210 … … 3178 4213 * Get codec parameters. 3179 4214 * 3180 * @param idCodec ID.4215 * @param codec_id Codec ID. 3181 4216 * @param param Structure to receive codec parameters. 3182 4217 * 3183 4218 * @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 */ 4226 PJ_DECL(pj_status_t) pjsua_codec_get_param( const pj_str_t *codec_id, 3186 4227 pjmedia_codec_param *param ); 3187 4228 … … 3190 4231 * Set codec parameters. 3191 4232 * 3192 * @param idCodec ID.4233 * @param codec_id Codec ID. 3193 4234 * @param param Codec parameter to set. 3194 4235 * 3195 4236 * @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 */ 4245 PJ_DECL(pj_status_t) pjsua_codec_set_param( const pj_str_t *codec_id, 3198 4246 const pjmedia_codec_param *param); 3199 4247 … … 3210 4258 * 3211 4259 * @return PJ_SUCCESS on success, or the appropriate error code. 4260 * 4261 * \par Python: 4262 * Not implemented yet. 3212 4263 */ 3213 4264 PJ_DECL(pj_status_t) … … 3227 4278 * 3228 4279 * @return PJ_SUCCESS on success, or the appropriate error code. 4280 * 4281 * \par Python: 4282 * Note applicable. 3229 4283 */ 3230 4284 PJ_DECL(pj_status_t) … … 3240 4294 3241 4295 4296 /** 4297 * @} 4298 */ 4299 3242 4300 PJ_END_DECL 3243 4301 3244 4302 3245 /**3246 * @}3247 */3248 3249 3250 4303 #endif /* __PJSUA_H__ */ -
pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c
r721 r918 80 80 81 81 /* Reset pool. */ 82 pj_pool_reset(pool); 82 //note: already done by caller 83 //pj_pool_reset(pool); 83 84 84 85 rdata = pj_pool_zalloc(pool, sizeof(pjsip_rx_data));
Note: See TracChangeset
for help on using the changeset viewer.