Changes between Version 36 and Version 37 of FAQ


Ignore:
Timestamp:
Mar 20, 2008 8:46:24 AM (12 years ago)
Author:
bennylp
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FAQ

    v36 v37  
    109109== Integration Issues == 
    110110 
    111 === How can I integrate third party media stack with PJSIP? === #3rd-party-media 
     111=== How can I integrate third party media stack with PJSIP? === #third-party-media 
    112112 
    113113Please see this article: '''[wiki:3rd_Party_Media Integrating Third Party Media Stack with PJSIP]''' 
     
    220220 
    221221{{{ 
     222#!c 
    222223void connect_conf_bridge_to_snd_dev(pj_pool_t *pool, pjmedia_port *conf) 
    223224{ 
     
    232233 
    233234{{{ 
     235#!c 
    234236void connect_conf_bridge_to_snd_dev2(pj_pool_t *pool, pjmedia_port *conf) 
    235237{ 
     
    284286 1. Create a media port structure, ''deriving'' from {{{pjmedia_port}}} structure: 
    285287{{{ 
     288#!c 
    286289  struct my_media_port 
    287290  { 
     
    366369 
    367370{{{ 
     371#!c 
    368372struct my_call_data 
    369373{ 
     
    437441 
    438442{{{ 
     443#!c 
    439444static void on_call_state(pjsua_call_id call_id, pjsip_event *e) 
    440445{ 
     
    523528If 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'': 
    524529{{{ 
     530#!c 
    525531    .. 
    526532    pjsua_msg_data msg_data; 
     
    559565 
    560566{{{ 
     567#!c 
    561568const pjsip_method info_method =  
    562569{ 
     
    626633 
    627634You 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 
     638To 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 
     645Then 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 
    628657 
    629658---- 
     
    716745 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'': 
    717746{{{ 
     747#!c 
    718748struct call_data 
    719749{ 
     
    747777 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: 
    748778{{{ 
     779#!c 
    749780static void on_stream_created(pjsua_call_id call_id,  
    750781                              pjmedia_session *sess, 
     
    758789 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: 
    759790{{{ 
     791#!c 
    760792static void on_stream_destroyed(pjsua_call_id call_id, 
    761793                                pjmedia_session *sess,  
     
    767799 1. Finally, don't forget to release the resources when the call is disconnected.  
    768800{{{ 
     801#!c 
    769802static void call_media_deinit(pjsua_call_id call_id) 
    770803{ 
     
    878911 1. '''Transaction/dialog/call count'''. Set the maximum number of concurrent transactions/dialogs/calls with 
    879912{{{ 
     913#!c 
    880914#   define PJSIP_MAX_TSX_COUNT          31 
    881915#   define PJSIP_MAX_DIALOG_COUNT       31 
     
    884918 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: 
    885919{{{ 
     920#!c 
    886921#   define PJSIP_POOL_LEN_ENDPT         1000 
    887922#   define PJSIP_POOL_INC_ENDPT         1000 
     
    960995 1. Enable TLS transport in your '''{{{pjlib/include/pj/config_site.h}}}''': 
    961996    {{{ 
     997    #!c 
    962998      #define PJSIP_HAS_TLS_TRANSPORT   1 
    963999    }}} 
     
    10191055 
    10201056{{{ 
     1057  #!c 
    10211058  #define PJMEDIA_SOUND_BUFFER_COUNT  16 
    10221059}}}