Changes between Version 36 and Version 37 of FAQ
- Timestamp:
- Mar 20, 2008 8:46:24 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FAQ
v36 v37 109 109 == Integration Issues == 110 110 111 === How can I integrate third party media stack with PJSIP? === # 3rd-party-media111 === How can I integrate third party media stack with PJSIP? === #third-party-media 112 112 113 113 Please see this article: '''[wiki:3rd_Party_Media Integrating Third Party Media Stack with PJSIP]''' … … 220 220 221 221 {{{ 222 #!c 222 223 void connect_conf_bridge_to_snd_dev(pj_pool_t *pool, pjmedia_port *conf) 223 224 { … … 232 233 233 234 {{{ 235 #!c 234 236 void connect_conf_bridge_to_snd_dev2(pj_pool_t *pool, pjmedia_port *conf) 235 237 { … … 284 286 1. Create a media port structure, ''deriving'' from {{{pjmedia_port}}} structure: 285 287 {{{ 288 #!c 286 289 struct my_media_port 287 290 { … … 366 369 367 370 {{{ 371 #!c 368 372 struct my_call_data 369 373 { … … 437 441 438 442 {{{ 443 #!c 439 444 static void on_call_state(pjsua_call_id call_id, pjsip_event *e) 440 445 { … … 523 528 If by user data you mean to send custom SIP headers in outgoing SIP messages, you can put the custom headers in the [http://www.pjsip.org/pjsip/docs/html/structpjsua__msg__data.htm pjsua_msg_data] structure, which you can specify when sending SIP requests (for example, when sending INVITE, IM message, etc.). Here is a snippet on how to put a custom SIP header as ''pjsua_msg_data'': 524 529 {{{ 530 #!c 525 531 .. 526 532 pjsua_msg_data msg_data; … … 559 565 560 566 {{{ 567 #!c 561 568 const pjsip_method info_method = 562 569 { … … 626 633 627 634 You need to acquire mutexes in uniform order. Please see [wiki:PJSUA_Locks Mutex Lock Ordering in PJSUA-LIB] for more information. 635 636 === How can I configure PJSIP for IMS? === #ims 637 638 To configure PJSIP to register to an IMS/3GPP network, first declare these in your {{{config_site.h}}}: 639 640 {{{ 641 #!c 642 #define PJSIP_HAS_DIGEST_AKA_AUTH 1 643 }}} 644 645 Then configure pjsua with something like these: 646 647 {{{ 648 --id sip:alice@open-ims.test 649 --registrar sip:open-ims.test 650 --proxy sip:pcscf.open-ims.test:4060;lr 651 --realm open-ims.test 652 --username alice@open-ims.test 653 --password alice 654 --use-ims 655 }}} 656 628 657 629 658 ---- … … 716 745 1. Now that the main bridge has been stopped, we can manage the media ourselves. We can create one conference bridge for each call, and attach it to a master port to make it ''run'': 717 746 {{{ 747 #!c 718 748 struct call_data 719 749 { … … 747 777 1. Implement {{{on_stream_created()}}} callback of {{{pjsua_callback}}}. This callback notifies application when a stream has been created and about to be registered to the bridge. We'll use this callback to add the stream's media port to our own conference bridge: 748 778 {{{ 779 #!c 749 780 static void on_stream_created(pjsua_call_id call_id, 750 781 pjmedia_session *sess, … … 758 789 1. Since stream may be destroyed during a call (for example, when call is put on hold), we need to remove the stream from our conference bridge when the stream is destroyed, otherwise application will crash because the conference bridge tries to retrieve/put audio frames from/to a non-existant stream. This can be done by implementing {{{on_stream_destroyed()}}} callback: 759 790 {{{ 791 #!c 760 792 static void on_stream_destroyed(pjsua_call_id call_id, 761 793 pjmedia_session *sess, … … 767 799 1. Finally, don't forget to release the resources when the call is disconnected. 768 800 {{{ 801 #!c 769 802 static void call_media_deinit(pjsua_call_id call_id) 770 803 { … … 878 911 1. '''Transaction/dialog/call count'''. Set the maximum number of concurrent transactions/dialogs/calls with 879 912 {{{ 913 #!c 880 914 # define PJSIP_MAX_TSX_COUNT 31 881 915 # define PJSIP_MAX_DIALOG_COUNT 31 … … 884 918 1. '''Optimize pool sizes'''. These settings not only will reduce heap memory usage, but will also prevent the libraries from allocating too many large memory blocks. With the default settings, most memory pools are configured to allocate memory in 4KB blocks, and some system like Symbian will have difficulties in providing these blocks to PJSIP. Use the following setting to reduce the memory block size used by memory pools, at the expense of more calls to system's memory allocators ({{{new}}} or {{{malloc}}}) to allocate memory: 885 919 {{{ 920 #!c 886 921 # define PJSIP_POOL_LEN_ENDPT 1000 887 922 # define PJSIP_POOL_INC_ENDPT 1000 … … 960 995 1. Enable TLS transport in your '''{{{pjlib/include/pj/config_site.h}}}''': 961 996 {{{ 997 #!c 962 998 #define PJSIP_HAS_TLS_TRANSPORT 1 963 999 }}} … … 1019 1055 1020 1056 {{{ 1057 #!c 1021 1058 #define PJMEDIA_SOUND_BUFFER_COUNT 16 1022 1059 }}}