Changes between Version 22 and Version 23 of FAQ


Ignore:
Timestamp:
Jan 24, 2008 9:04:51 AM (11 years ago)
Author:
bennylp
Comment:

Added SRTP entry and fixed broken links

Legend:

Unmodified
Added
Removed
Modified
  • FAQ

    v22 v23  
    1111=== Where can I find the latest release of PJSIP? === #latest 
    1212 
    13 The latest PJSIP is always the SVN trunk version. Please find the information on how to retrieve PJSIP from SVN in the [/download.htm PJSIP Download] and [/using.htm Getting Started] page. 
     13The latest PJSIP is always the SVN trunk version. Please find the information on how to retrieve PJSIP from SVN in the [http://www.pjsip.org/download.htm PJSIP Download] and [http://www.pjsip.org/using.htm Getting Started] page. 
    1414 
    1515=== If PJSIP is said to be small footprint, then why the source is so big? === #src-large 
     
    1919=== I have downloaded PJSIP source codes, now what next? === #do 
    2020 
    21 First you'll need to build the sources, by following the instructions in [/using.htm Getting Started] page. 
    22  
    23 Then you can get yourself familiar with PJSIP features by running [/pjsua.htm pjsua] application. ''pjsua'' is the reference implementation of PJSIP and PJSUA-LIB. Although it doesn't have all the PJSIP features, it contains most of them, so it's quite useful. Please find ''pjsua'' documentation in [/pjsua.htm pjsua Manual] page. It is also good to get familiar with ''pjsua'' since if you'll ever get any problems with PJSIP, most likely we will ask to reproduce it with ''pjsua'', to determine whether the problem is PJSIP problem or the problem with the implementation. So please try this out. You may even be able to impress your mates by doing SIP calls, conference, IM, and presence from a command line application! 
     21First you'll need to build the sources, by following the instructions in [http://www.pjsip.org/using.htm Getting Started] page. 
     22 
     23Then you can get yourself familiar with PJSIP features by running [http://www.pjsip.org/pjsua.htm pjsua] application. ''pjsua'' is the reference implementation of PJSIP and PJSUA-LIB. Although it doesn't have all the PJSIP features, it contains most of them, so it's quite useful. Please find ''pjsua'' documentation in [http://www.pjsip.org/pjsua.htm pjsua Manual] page. It is also good to get familiar with ''pjsua'' since if you'll ever get any problems with PJSIP, most likely we will ask to reproduce it with ''pjsua'', to determine whether the problem is PJSIP problem or the problem with the implementation. So please try this out. You may even be able to impress your mates by doing SIP calls, conference, IM, and presence from a command line application! 
    2424 
    2525Next, I assume that you want to develop some sort of SIP applications, yes? 
    2626 
    27 At this point, you'll need to decide which API abstractions to use. If building client applications, [/pjsip/docs/html/group__PJSUA__LIB.htm PJSUA-LIB API] may be the better option to use, since this library has easy to use but yet powerful API. On the other hand, since it's a high level API, it may not provide all the flexibilities that are required by the application. Nor the [#pjsua-lib-perf performance], perhaps. Or it may just contain too many features! In this case, perhaps using [/pjsip/docs/html/index.htm PJSIP] and [/pjmedia/docs/html/index.htm PJMEDIA] directly would be a better option. They will be "slightly" more difficult to use, but they will provide the utmost flexibility, performance, and size. 
    28  
    29 Then prepare the application project, by following the instructions in [/using.htm#using Getting Started | Using PJSIP for Applications] documentation. The details would depend on what platform you're working on. 
    30  
    31 Then fill up the application features, by following the [/docs.htm Documentation] or by looking at [/pjsip/docs/html/page_pjsip_samples.htm PJSIP samples] or [/pjmedia/docs/html/page_pjmedia_samples.htm PJMEDIA samples]. In case you're using PJSIP and PJMEDIA directly, you can have a look at PJSUA-LIB source code for reference. 
     27At this point, you'll need to decide which API abstractions to use. If building client applications, [http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB.htm PJSUA-LIB API] may be the better option to use, since this library has easy to use but yet powerful API. On the other hand, since it's a high level API, it may not provide all the flexibilities that are required by the application. Nor the [#pjsua-lib-perf performance], perhaps. Or it may just contain too many features! In this case, perhaps using [http://www.pjsip.org/pjsip/docs/html/index.htm PJSIP] and [http://www.pjsip.org/pjmedia/docs/html/index.htm PJMEDIA] directly would be a better option. They will be "slightly" more difficult to use, but they will provide the utmost flexibility, performance, and size. 
     28 
     29Then prepare the application project, by following the instructions in [http://www.pjsip.org/using.htm#using Getting Started | Using PJSIP for Applications] documentation. The details would depend on what platform you're working on. 
     30 
     31Then fill up the application features, by following the [http://www.pjsip.org/docs.htm Documentation] or by looking at [http://www.pjsip.org/pjsip/docs/html/page_pjsip_samples.htm PJSIP samples] or [http://www.pjsip.org/pjmedia/docs/html/page_pjmedia_samples.htm PJMEDIA samples]. In case you're using PJSIP and PJMEDIA directly, you can have a look at PJSUA-LIB source code for reference. 
    3232 
    3333If you'll ever get into any troubles, we're ready to help in [http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org PJSIP mailing list]. So good luck then! 
     
    5858=== What about the "viral" nature of the GPL? === #gpl-viral 
    5959 
    60 People often think that using GPL-ed software means that other software linked with the GPL software have to be GPL too, hence GPL is considered as viral. '''That is not exactly true''', especially with PJSIP. When linking with PJSIP, only the application (that is based on PJSIP) has to be GPL-ed, since it is considered as derived work. Other libraries linked with PJSIP don't have to be GPL, because we specifically allow linking PJSIP with third party libraries, as long as they are listed in [/licensing.htm Third Party Software] that are allowed to be linked with PJSIP. 
     60People often think that using GPL-ed software means that other software linked with the GPL software have to be GPL too, hence GPL is considered as viral. '''That is not exactly true''', especially with PJSIP. When linking with PJSIP, only the application (that is based on PJSIP) has to be GPL-ed, since it is considered as derived work. Other libraries linked with PJSIP don't have to be GPL, because we specifically allow linking PJSIP with third party libraries, as long as they are listed in [http://www.pjsip.org/licensing.htm Third Party Software] that are allowed to be linked with PJSIP. 
    6161 
    6262 
     
    7676 - [http://localhost/licensing.htm Speex] codec (BSD-ish license) 
    7777 
    78 (the list above are not exhaustive, please see [/licensing.htm PJSIP Licensing page] for the complete list). 
     78(the list above are not exhaustive, please see [http://www.pjsip.org/licensing.htm PJSIP Licensing page] for the complete list). 
    7979 
    8080In addition, the use of iLBC is governed by [http://www.ilbcfreeware.org/documentation/gips_iLBClicense.pdf iLBC license]. Please contact [http://www.ilbcfreeware.org/ GIPS] for details! 
     
    8787=== I'm having problem building PJSIP, please help! === #build-problems 
    8888 
    89 Please check the [/using.htm Getting Started] page. 
     89Please check the [http://www.pjsip.org/using.htm Getting Started] page. 
    9090 
    9191=== I'm getting "Unable to open DSound.h error", please help! === #dsound 
    9292 
    93 You should really check the [/using.htm Getting Started] page first. 
    94  
    95 Please check the [/using.htm Getting Started] page. 
     93You should really check the [http://www.pjsip.org/using.htm Getting Started] page first. 
     94 
     95Please check the [http://www.pjsip.org/using.htm Getting Started] page. 
    9696 
    9797=== How do I build the libraries as Dynamic Link Library (DLL)? === #dll 
     
    105105=== Can I use the SIP stack with my own media stack? === 
    106106 
    107 Sure. The SIP stack (pjsip) and media stack (pjmedia) is independent from one another, and they are only integrated at the higher level user agent library (pjsua-lib). Please see the library architecture diagram on [/docs.htm PJSIP Documentation] page for reference. 
     107Sure. The SIP stack (pjsip) and media stack (pjmedia) is independent from one another, and they are only integrated at the higher level user agent library (pjsua-lib). Please see the library architecture diagram on [http://www.pjsip.org/docs.htm PJSIP Documentation] page for reference. 
    108108 
    109109So yes, the SIP stack (pjsip) can be used without pjmedia, as long as you don't use pjsua-lib. 
     
    116116=== What platforms are PJSIP known to run on? === #platforms 
    117117 
    118 PJSIP runs on many platforms, embedded or non-embedded. Please see the platforms list that it currently supports in [/sip_media_features.htm#platforms Platform features] page. Apart from the platforms that we maintain ourselves, the community have also been constantly finding new platforms that PJSIP can run on, for example on [http://libw11.free.fr/ Nintendo DS] (a cool project by Samuel Vinson), and also on various platforms based on uC-Linux and ARM processor. 
     118PJSIP runs on many platforms, embedded or non-embedded. Please see the platforms list that it currently supports in [http://www.pjsip.org/sip_media_features.htm#platforms Platform features] page. Apart from the platforms that we maintain ourselves, the community have also been constantly finding new platforms that PJSIP can run on, for example on [http://libw11.free.fr/ Nintendo DS] (a cool project by Samuel Vinson), and also on various platforms based on uC-Linux and ARM processor. 
    119119 
    120120 
     
    123123PJSIP has been designed for ultra-portability, and we have ported PJSIP to exotic platform such as Symbian (long time ago, PJSIP has also been ported to Linux kernel). People even have ported PJSIP to even more exotic platforms such as [http://libw11.free.fr/ Nintendo DS] (ported by Samuel Vinson) and Texas Instrument (TI) DSP. So there is a good chance that PJSIP will be ''port''-able to your platform. 
    124124 
    125 Please start from the [/porting.htm Porting] page. For additional information, there is also information on porting [/sip_symbian.htm PJSIP to Symbian], to emphasize that even on difficult platform like this, PJSIP is still ''port''-able. 
     125Please start from the [http://www.pjsip.org/porting.htm Porting] page. For additional information, there is also information on porting [http://www.pjsip.org/sip_symbian.htm PJSIP to Symbian], to emphasize that even on difficult platform like this, PJSIP is still ''port''-able. 
    126126 
    127127---- 
     
    186186 
    187187The easiest is to adjust the audio level in the conference bridge, using: 
    188  - [/pjmedia/docs/html/group__PJMEDIA__CONF.htm#g8895228fdc9b7d6892320aa03b198574 pjmedia_conf_adjust_rx_level()] and [/pjmedia/docs/html/group__PJMEDIA__CONF.htm#gff0b554ee974c7905071f1051eeb4479 pjmedia_conf_adjust_tx_level()], if you use PJMEDIA directly, or 
    189  - [/pjsip/docs/html/group__PJSUA__LIB__MEDIA.htm#gac62b6ef2ec5dd2f8717809548201e89 pjsua_conf_adjust_rx_level()] and [/pjsip/docs/html/group__PJSUA__LIB__MEDIA.htm#gd828a91a6ee5d361ecb07fa818e17e41 pjsua_conf_adjust_tx_level()] if you use PJSUA-API. 
     188 - [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__CONF.htm#g8895228fdc9b7d6892320aa03b198574 pjmedia_conf_adjust_rx_level()] and [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__CONF.htm#gff0b554ee974c7905071f1051eeb4479 pjmedia_conf_adjust_tx_level()], if you use PJMEDIA directly, or 
     189 - [http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB__MEDIA.htm#gac62b6ef2ec5dd2f8717809548201e89 pjsua_conf_adjust_rx_level()] and [http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB__MEDIA.htm#gd828a91a6ee5d361ecb07fa818e17e41 pjsua_conf_adjust_tx_level()] if you use PJSUA-API. 
    190190 
    191191Note that the two different APIs have different level adjustment value; PJMEDIA expects the value in integer, while PJSUA expects the value in floating point. Please see the API documentation for the details. 
     
    207207In my opinion, this should be fine, as the remote endpoint should be able to accommodate this with its ''jitter buffer''. 
    208208 
    209 If you don't like this, and rather want PJMEDIA to transmit RTP packets at good interval, you can install a [/pjmedia/docs/html/group__PJMEDIA__MASTER__PORT.htm master clock port] between sound device and conference bridge, so that the master port will drive the media clock instead. A master clock port uses an internal thread to drive the media flow, so it should provide better timing on most platforms. 
     209If you don't like this, and rather want PJMEDIA to transmit RTP packets at good interval, you can install a [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__MASTER__PORT.htm master clock port] between sound device and conference bridge, so that the master port will drive the media clock instead. A master clock port uses an internal thread to drive the media flow, so it should provide better timing on most platforms. 
    210210 
    211211The steps to install master port between sound device and conference bridge are as follows: 
    212  1. Create a [/pjmedia/docs/html/group__PJMEDIA__SPLITCOMB.htm splitter/combiner (splitcomb) port]. 
    213  1. Create a reverse phase port on the splitcomb ([/pjmedia/docs/html/group__PJMEDIA__SPLITCOMB.htm#gc59338fd9d471a14c06b0f51c2290b68 pjmedia_splitcomb_create_rev_channel()]). 
    214  1. Create the [/pjmedia/docs/html/group__PJMED__SND__PORT.htm sound device port] as usual. 
    215  1. Connect the sound device port to the splitcomb (use [/pjmedia/docs/html/group__PJMED__SND__PORT.htm#g046156b765a34e6c640b0534e6b21f9c pjmedia_snd_port_connect()]). 
    216  1. Create a [/pjmedia/docs/html/group__PJMEDIA__MASTER__PORT.htm master clock port], and specify the splitcomb's reverse channel as the ''upstream'' port, and the [/pjmedia/docs/html/group__PJMEDIA__CONF.htm conference bridge] as the ''downstream'' port. 
     212 1. Create a [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__SPLITCOMB.htm splitter/combiner (splitcomb) port]. 
     213 1. Create a reverse phase port on the splitcomb ([http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__SPLITCOMB.htm#gc59338fd9d471a14c06b0f51c2290b68 pjmedia_splitcomb_create_rev_channel()]). 
     214 1. Create the [http://www.pjsip.org/pjmedia/docs/html/group__PJMED__SND__PORT.htm sound device port] as usual. 
     215 1. Connect the sound device port to the splitcomb (use [http://www.pjsip.org/pjmedia/docs/html/group__PJMED__SND__PORT.htm#g046156b765a34e6c640b0534e6b21f9c pjmedia_snd_port_connect()]). 
     216 1. Create a [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__MASTER__PORT.htm master clock port], and specify the splitcomb's reverse channel as the ''upstream'' port, and the [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__CONF.htm conference bridge] as the ''downstream'' port. 
    217217 1. Start the master port. 
    218218 
     
    250250}}} 
    251251 
    252 (Note that with PJSUA-LIB, we can get the instance of the conference bridge by calling [/pjsip/docs/html/group__PJSUA__LIB__MEDIA.htm#g4b6ffc203b8799f08f072d0921777161 pjsua_set_no_snd_dev()]). 
    253  
    254 With the above snippet, the irregularity of the sound device clock will be ''normalized'' by the master port, so the conference bridge will be run by the ''good'' clock. Of course this means some buffering is needed to compensate the ''clock'' difference between the sound device and the master port, and this is what the ''reverse channel'' of the ''splitcomb'' is for. The ''reverse channel'' can accommodate up to [/pjmedia/docs/html/group__PJMEDIA__CONFIG.htm#ga2e53b9eb4cb76294f95a15a2a0ef8cc PJMEDIA_SOUND_BUFFER_COUNT] frames, so if the clock difference is larger than this, you will need to enlarge {{{PJMEDIA_SOUND_BUFFER_COUNT}}} to an acceptable value (32, for example). 
     252(Note that with PJSUA-LIB, we can get the instance of the conference bridge by calling [http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB__MEDIA.htm#g4b6ffc203b8799f08f072d0921777161 pjsua_set_no_snd_dev()]). 
     253 
     254With the above snippet, the irregularity of the sound device clock will be ''normalized'' by the master port, so the conference bridge will be run by the ''good'' clock. Of course this means some buffering is needed to compensate the ''clock'' difference between the sound device and the master port, and this is what the ''reverse channel'' of the ''splitcomb'' is for. The ''reverse channel'' can accommodate up to [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__CONFIG.htm#ga2e53b9eb4cb76294f95a15a2a0ef8cc PJMEDIA_SOUND_BUFFER_COUNT] frames, so if the clock difference is larger than this, you will need to enlarge {{{PJMEDIA_SOUND_BUFFER_COUNT}}} to an acceptable value (32, for example). 
    255255 
    256256 
     
    266266=== How can I add new codec to PJMEDIA? === #adding-codec 
    267267 
    268 First of all, read the [/pjmedia/docs/html/group__PJMEDIA__CODEC.htm Codec Framework] documentation. Then, the easiest is to take other codec source file in {{{pjmedia-codec}}} directory, such as [/trac/browser/pjproject/trunk/pjmedia/src/pjmedia-codec/gsm.c gsm.c], and replace GSM specific function calls with the functions that are provided by your codec library. 
     268First of all, read the [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__CODEC.htm Codec Framework] documentation. Then, the easiest is to take other codec source file in {{{pjmedia-codec}}} directory, such as [http://www.pjsip.org/trac/browser/pjproject/trunk/pjmedia/src/pjmedia-codec/gsm.c gsm.c], and replace GSM specific function calls with the functions that are provided by your codec library. 
    269269 
    270270There are two "classes" to implement: 
    271  - The codec factory ([/pjmedia/docs/html/structpjmedia__codec__factory.htm pjmedia_codec_factory]) - Codec factory will be queried by PJMEDIA to see if it can instantiate a codec instance based on a codec descriptor ([/pjmedia/docs/html/structpjmedia__codec__info.htm pjmedia_codec_info]). Codec factory also provides information about what particular codecs it supports, so that PJMEDIA can list these codecs in the local SDP capability descriptor. 
    272  - The codec itself ([/pjmedia/docs/html/structpjmedia__codec.htm pjmedia_codec]) - The codec instance provides functions to parse, encode and decode audio frames. Optionally it may provide a function to recover lost frames (known as ''Packet Lost Concealment'' feature, or PLC). 
     271 - The codec factory ([http://www.pjsip.org/pjmedia/docs/html/structpjmedia__codec__factory.htm pjmedia_codec_factory]) - Codec factory will be queried by PJMEDIA to see if it can instantiate a codec instance based on a codec descriptor ([http://www.pjsip.org/pjmedia/docs/html/structpjmedia__codec__info.htm pjmedia_codec_info]). Codec factory also provides information about what particular codecs it supports, so that PJMEDIA can list these codecs in the local SDP capability descriptor. 
     272 - The codec itself ([http://www.pjsip.org/pjmedia/docs/html/structpjmedia__codec.htm pjmedia_codec]) - The codec instance provides functions to parse, encode and decode audio frames. Optionally it may provide a function to recover lost frames (known as ''Packet Lost Concealment'' feature, or PLC). 
    273273 
    274274Once it's finished, you should end up with just two public APIs exported by the implementation: an initialization function, and a deinitialization function. The initialization function's primary task is to register the codec factory to PJMEDIA's codec manager, so that PJMEDIA knows about this new codec. While the deinitialization function is to unregister the codec factory, and to release resources, if any. 
     
    279279=== How can I manipulate audio samples directly? === #audio-man 
    280280 
    281 In PJMEDIA, audio frames are sent back and forth between what is called [/pjmedia/docs/html/group__PJMEDIA__PORT__CONCEPT.htm media port (pjmedia_port)]. So to be able to peek or manipulate audio frames, we need to implement our own media port. 
     281In PJMEDIA, audio frames are sent back and forth between what is called [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__PORT__CONCEPT.htm media port (pjmedia_port)]. So to be able to peek or manipulate audio frames, we need to implement our own media port. 
    282282 
    283283Implementing media port should be easy. Basically we just need to implement these: 
     
    292292  }; 
    293293}}} 
    294  1. Fill in the media port information to describe the media port (like, the name, clock rate, bits per sample, etc.). Use [/pjmedia/docs/html/group__PJMEDIA__PORT__INTERFACE.htm#gb3259d2924c7a2243733391f6f8f0a9a pjmedia_port_info_init()] to initialize the port into. 
     294 1. Fill in the media port information to describe the media port (like, the name, clock rate, bits per sample, etc.). Use [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__PORT__INTERFACE.htm#gb3259d2924c7a2243733391f6f8f0a9a pjmedia_port_info_init()] to initialize the port into. 
    295295 1. Implement {{{get_frame()}}} callback (of the ''pjmedia_port'') if the media port is a source (that is, the media port feed audio frames to other media ports). 
    296296 1. Implement {{{put_frame()}}} callback (of the ''pjmedia_port'') if the media port is a sink (that is, other media ports may feed audio frames to our media port). 
     
    300300 
    301301For source only media ports, samples include: 
    302  - [/trac/browser/pjproject/trunk/pjsip-apps/src/samples/playsine.c playsine.c] from the {{{pjsip-apps/samples}}} directory. 
    303  - [/trac/browser/pjproject/trunk/pjmedia/src/pjmedia/mem_player.c mem_player.c] from pjmedia (media port to playback audio from a buffer). 
    304  - [/trac/browser/pjproject/trunk/pjmedia/src/pjmedia/wav_player.c wav_player.c] from pjmedia (media port to playback audio from WAVE file). 
    305  - [/trac/browser/pjproject/trunk/pjmedia/src/pjmedia/tonegen.c tonegen.c] from pjmedia (media port to generate sine waves/DTMF/multi-frequency tones). 
     302 - [http://www.pjsip.org/trac/browser/pjproject/trunk/pjsip-apps/src/samples/playsine.c playsine.c] from the {{{pjsip-apps/samples}}} directory. 
     303 - [http://www.pjsip.org/trac/browser/pjproject/trunk/pjmedia/src/pjmedia/mem_player.c mem_player.c] from pjmedia (media port to playback audio from a buffer). 
     304 - [http://www.pjsip.org/trac/browser/pjproject/trunk/pjmedia/src/pjmedia/wav_player.c wav_player.c] from pjmedia (media port to playback audio from WAVE file). 
     305 - [http://www.pjsip.org/trac/browser/pjproject/trunk/pjmedia/src/pjmedia/tonegen.c tonegen.c] from pjmedia (media port to generate sine waves/DTMF/multi-frequency tones). 
    306306 
    307307For sink only media ports, samples include: 
    308  - [/trac/browser/pjproject/trunk/pjmedia/src/pjmedia/mem_capture.c mem_capture.c] from pjmedia (media port to save audio to a buffer). 
    309  - [/trac/browser/pjproject/trunk/pjmedia/src/pjmedia/wav_writer.c wav_writer.c] from pjmedia (media port to save audio to a WAVE file). 
     308 - [http://www.pjsip.org/trac/browser/pjproject/trunk/pjmedia/src/pjmedia/mem_capture.c mem_capture.c] from pjmedia (media port to save audio to a buffer). 
     309 - [http://www.pjsip.org/trac/browser/pjproject/trunk/pjmedia/src/pjmedia/wav_writer.c wav_writer.c] from pjmedia (media port to save audio to a WAVE file). 
    310310 
    311311For media ports that manipulates audio and provide both sink and source callbacks: 
    312  - [/trac/browser/pjproject/trunk/pjmedia/src/pjmedia/resample_port.c resample_port.c] from pjmedia (to convert sampling rate) 
    313  - [/trac/browser/pjproject/trunk/pjmedia/src/pjmedia/echo_port.c echo_port.c] from pjmedia (the AEC) 
     312 - [http://www.pjsip.org/trac/browser/pjproject/trunk/pjmedia/src/pjmedia/resample_port.c resample_port.c] from pjmedia (to convert sampling rate) 
     313 - [http://www.pjsip.org/trac/browser/pjproject/trunk/pjmedia/src/pjmedia/echo_port.c echo_port.c] from pjmedia (the AEC) 
    314314 
    315315 
     
    322322When you encounter this problem, and if upgrading the softphone doesn't solve the problem, you can report this to PJSIP mailing list. When reporting, please include the error log and the complete INVITE message and the 200/OK response (containing the SDP), so that we can analyze which endpoint is behaving badly. 
    323323 
    324  
    325 === Does PJSIP support SRTP or ZRTP? If no, how can I implement them? === #srtp-zrtp 
    326  
    327 Currently PJMEDIA doesn't support SRTP nor ZRTP, although this has been on our TODO list for sometime now. Fortunately, implementing them is not too difficult, since media transport in PJMEDIA is separated from the stream. 
    328  
    329 Have a look at: 
    330  - [/trac/browser/pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c transport_udp.c], the normal UDP media transport, and 
    331  - [/trac/browser/pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c transport_ice.c], ICE media transport. 
    332  
    333 There, it's quite easy to see where RTP/RTCP packets are received (that is in {{{on_rx_rtp()}}}/{{{on_rx_rtcp()}}} respectively) or sent (in {{{transport_send_rtp()}}}/{{{transport_send_rtcp()}}}). So these are the locations where you should call the decryption and encryption function of SRTP/ZRTP. 
    334  
    335 Alternatively, there is a cleaner way to plug in SRTP/ZRTP functionality without changing existing code. As mentioned earlier, media transport is separated from stream. They are only ''attached'' to each other in application code (or in pjsua-lib). So then one can build an ''adapter'', which is plugged between the media transport and the stream to do the SRTP/ZRTP stuffs. To the stream, this adapter will look like a media transport, and to existing media transport, this adapter will look like a stream. The benefit of this approach is we can use the same adapter for both kind of media transports, that is the UDP and ICE media transport. 
     324---- 
     325 
     326== Security Related Questions == #security 
     327 
     328=== Does PJSIP Support TLS? === #tls 
     329 
     330Yes, PJSIP supports TLS since long time ago. For a little bit more information, please see [wiki:TLS Configuring and Using PJSIP with TLS] page. 
     331 
     332=== How Can I Use TLS with PJSIP/pjsua === #pjsua-tls 
     333 
     334Please see [wiki:TLS Configuring and Using PJSIP with TLS] page. 
     335 
     336=== Does PJSIP Support Secure Media? === #srtp 
     337 
     338PJSIP supports SRTP since version 0.9, please see [wiki:SRTP SRTP Support in PJSIP] page for more info. 
     339 
     340 
    336341 
    337342---- 
     
    347352}}} 
    348353 
    349 Without receiving this capability indication, PJSIP will refuse to send RFC 2833 event, and a call to {{{pjsua_call_dial_dtmf()}}} or {{{pjmedia_session_dial_dtmf()}}} or {{{pjmedia_stream_dial_dtmf()}}} will return error code [/pjmedia/docs/html/group__PJMEDIA__ERRNO.htm#g043502be6c0961209feade822cdd79b7 PJMEDIA_RTP_EREMNORFC2833]. In this case, you can send the [#inband-dtmf DTMF tone inband] instead (see below). 
     354Without receiving this capability indication, PJSIP will refuse to send RFC 2833 event, and a call to {{{pjsua_call_dial_dtmf()}}} or {{{pjmedia_session_dial_dtmf()}}} or {{{pjmedia_stream_dial_dtmf()}}} will return error code [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__ERRNO.htm#g043502be6c0961209feade822cdd79b7 PJMEDIA_RTP_EREMNORFC2833]. In this case, you can send the [#inband-dtmf DTMF tone inband] instead (see below). 
    350355 
    351356 
    352357=== How can I send inband DTMF tones? === #inband-dtmf 
    353358 
    354 It's quite easy with [/pjsip/docs/html/group__PJSUA__LIB.htm PJSUA-LIB] API: 
    355  1. Once the call is established, create an instance of [/pjmedia/docs/html/group__PJMEDIA__MF__DTMF__TONE__GENERATOR.htm Tone Generator]. 
    356  1. Register this tone generator to pjsua's conference bridge, by calling [/pjsip/docs/html/group__PJSUA__LIB__MEDIA.htm#g833528c1019f4ab5c8fb216b4b5f788b pjsua_conf_add_port()]. 
    357  1. ''Connect'' the tone generator to the call, with [/pjsip/docs/html/group__PJSUA__LIB__MEDIA.htm#g3451304d677e013130dfb9e6b37e3ee6 pjsua_conf_connect()]. 
    358  1. Now instruct the tone generator to ''play'' some DTMF digits ([/pjmedia/docs/html/group__PJMEDIA__MF__DTMF__TONE__GENERATOR.htm#gf7920b73983e1e09dfe883cbdd2861ae pjmedia_tonegen_play_digits()]). The digits then will be streamed to the call, and remote endpoint should receive the DTMF tone inband. 
     359It's quite easy with [http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB.htm PJSUA-LIB] API: 
     360 1. Once the call is established, create an instance of [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__MF__DTMF__TONE__GENERATOR.htm Tone Generator]. 
     361 1. Register this tone generator to pjsua's conference bridge, by calling [http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB__MEDIA.htm#g833528c1019f4ab5c8fb216b4b5f788b pjsua_conf_add_port()]. 
     362 1. ''Connect'' the tone generator to the call, with [http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB__MEDIA.htm#g3451304d677e013130dfb9e6b37e3ee6 pjsua_conf_connect()]. 
     363 1. Now instruct the tone generator to ''play'' some DTMF digits ([http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__MF__DTMF__TONE__GENERATOR.htm#gf7920b73983e1e09dfe883cbdd2861ae pjmedia_tonegen_play_digits()]). The digits then will be streamed to the call, and remote endpoint should receive the DTMF tone inband. 
    359364 
    360365Here is a snippet to do it: 
     
    484489=== Does PJSIP support RFC XYZ? === #rfc 
    485490 
    486 The best way is to look at the [/sip_media_features.htm PJSIP Features] page and see if that particular feature is supported by PJSIP. 
     491The best way is to look at the [http://www.pjsip.org/sip_media_features.htm PJSIP Features] page and see if that particular feature is supported by PJSIP. 
    487492 
    488493=== I'm having problem with calling XYZ, please help! === #general-sip 
     
    490495Please report the problem to [http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org PJSIP mailing list]. Please provide the following information: 
    491496 1. Please describe in detail what are you trying to accomplish and how do you configure your equipments (for example, do you use proxy? What kind of proxy?). 
    492  1. It would be best to try to reproduce the problem with [/pjsua.htm pjsua], so that we can also try to reproduce your problem. 
     497 1. It would be best to try to reproduce the problem with [http://www.pjsip.org/pjsua.htm pjsua], so that we can also try to reproduce your problem. 
    493498 1. In any case, please provide the complete log file. If you use ''pjsua'', you can configure it to write log file with {{{--log-file}}} option. If you use your own application that is based on ''pjsua-lib'', you can write the log by setting {{{pjsua_logging_config.log_filename}}} field. 
    494499 
     
    498503Most likely this is caused by wrong credential in the configuration. The remedy depends on what error was reported by PJSIP. 
    499504 
    500 For [/pjsip/docs/html/group__PJSIP__CORE__ERRNO.htm#ga13bf24296c19bece7c0c9af051f89db PJSIP_ENOCREDENTIAL] error: 
     505For [http://www.pjsip.org/pjsip/docs/html/group__PJSIP__CORE__ERRNO.htm#ga13bf24296c19bece7c0c9af051f89db PJSIP_ENOCREDENTIAL] error: 
    501506 - This error is caused by the realm specified in the credential doesn't match the realm challenged by the server in the 401/407 response. If you use PJSIP version 0.7-trunk or PJSIP version 0.7.1 or later, you can put wildcard ("*") as the realm to make PJSIP respond to any realms challenged by the server. If you use older PJSIP, you have to match the realm in the credential with the realm in the challenge. The realm normally would be equal to the domain name, but it doesn't have to. Asterisk, for example, always set the realm to "asterisk". 
    502507 
    503 For [/pjsip/docs/html/group__PJSIP__CORE__ERRNO.htm#ga935d4205ae50ad6f18a4df98b90d2f6 PJSIP_EFAILEDCREDENTIAL] error: 
     508For [http://www.pjsip.org/pjsip/docs/html/group__PJSIP__CORE__ERRNO.htm#ga935d4205ae50ad6f18a4df98b90d2f6 PJSIP_EFAILEDCREDENTIAL] error: 
    504509 - If you encounter this error, most likely it was caused by a wrong credential. Check if the username and password combination is correct. 
    505510 
     
    509514 
    510515If user data means an application data, normally a pointer to your application data structure, to be associated with a call, which you want to retrieve later, you can attach this application data with one of these: 
    511  - For outgoing calls, specify the pointer in ''user_data'' argument when calling [/pjsip/docs/html/group__PJSUA__LIB__CALL.htm#g502b0a6449cc5f67517b72df6a88c727 pjsua_call_make_call()]. 
    512  - For incoming calls, call [/pjsip/docs/html/group__PJSUA__LIB__CALL.htm#g53b9be88398324d940bf484df371d7d2 pjsua_call_set_user_data()] in {{{on_incoming_call()}}} callback to attach your user data. 
    513  
    514 Once application data is attached to a call, you can retrieve it at any time by calling [/pjsip/docs/html/group__PJSUA__LIB__CALL.htm#gfd0bf3368f982021cd9b9d3d1735ab6c pjsua_call_get_user_data()]. 
     516 - For outgoing calls, specify the pointer in ''user_data'' argument when calling [http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB__CALL.htm#g502b0a6449cc5f67517b72df6a88c727 pjsua_call_make_call()]. 
     517 - For incoming calls, call [http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB__CALL.htm#g53b9be88398324d940bf484df371d7d2 pjsua_call_set_user_data()] in {{{on_incoming_call()}}} callback to attach your user data. 
     518 
     519Once application data is attached to a call, you can retrieve it at any time by calling [http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB__CALL.htm#gfd0bf3368f982021cd9b9d3d1735ab6c pjsua_call_get_user_data()]. 
    515520 
    516521Now for a different view on the question. 
    517522 
    518 If by user data you mean to send custom SIP headers in outgoing SIP messages, you can put the custom headers in the [/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'': 
     523If 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'': 
    519524{{{ 
    520525    .. 
     
    561566}}} 
    562567 
    563 Once you have this, you can then create an [/pjsip/docs/html/group__PJSIP__ENDPT__STATELESS.htm#g6a5dc2cd5b43a1adf869c9746593f818 independent request] or [/pjsip/docs/html/group__PJSIP__DIALOG.htm#g8e057a2b3b89d071a2027eba4321751f request within dialog] of this method and send it [/pjsip/docs/html/group__PJSIP__ENDPT__STATELESS.htm#g155a9b9dce2138e91605d6b7561d70a3 statelessly], [/pjsip/docs/html/group__PJSIP__TRANSACT__UTIL.htm#ga4c9a6482b6077351daf2f7974ae7371 statefully], or [/pjsip/docs/html/group__PJSIP__DIALOG.htm#gb2ec46bfa4a8fd5fdf96cda2bb477355 inside dialog]. The [/docs.htm Dev Guide PDF] will explain this in more detail. 
     568Once you have this, you can then create an [http://www.pjsip.org/pjsip/docs/html/group__PJSIP__ENDPT__STATELESS.htm#g6a5dc2cd5b43a1adf869c9746593f818 independent request] or [http://www.pjsip.org/pjsip/docs/html/group__PJSIP__DIALOG.htm#g8e057a2b3b89d071a2027eba4321751f request within dialog] of this method and send it [http://www.pjsip.org/pjsip/docs/html/group__PJSIP__ENDPT__STATELESS.htm#g155a9b9dce2138e91605d6b7561d70a3 statelessly], [http://www.pjsip.org/pjsip/docs/html/group__PJSIP__TRANSACT__UTIL.htm#ga4c9a6482b6077351daf2f7974ae7371 statefully], or [http://www.pjsip.org/pjsip/docs/html/group__PJSIP__DIALOG.htm#gb2ec46bfa4a8fd5fdf96cda2bb477355 inside dialog]. The [http://www.pjsip.org/docs.htm Dev Guide PDF] will explain this in more detail. 
    564569 
    565570For DTMF INFO, [http://www.pjsip.org/pjsua.htm pjsua] application supports sending INFO request with ''application/dtmf-relay'' payload, please see [http://www.pjsip.org/pjsua.htm pjsua manual] for details. Also ''pjsua'' is able to handle incoming INFO request. Please see the source code of pjsua application for more information. 
     
    618623If you have {{{pjsip_rx_data}}} object rather than {{{pjsip_event}}} object, then extracting the SIP message is easier. You can find the SIP messaging elements (the SIP message and shortcuts to important headers) in {{{msg_info}}} field of the {{{pjsip_rx_data}}} object. 
    619624 
    620 === How Can I Use TLS with PJSIP/pjsua === #tls 
    621  
    622 Please see [wiki:TLS Configuring PJSIP with TLS] page. 
    623625 
    624626---- 
     
    631633 - On the SIP side, PJSIP supports Symmetric Response Routing ({{{rport}}}) and STUN. 
    632634 - On the media side, application can choose the normal UDP media transport (with STUN support) or the ICE media transport. 
    633  - For the media, the [/pjmedia/docs/html/group__PJMED__STRM.htm media stream] will periodically transmit RTP packets during silence period, to keep NAT binding open. Also it will disable VAD for the first few hundred milliseconds after it is started, to ''hole-punch'' any NATs in between the endpoints. Please see [/pjmedia/docs/html/group__PJMEDIA__CONFIG.htm#g691ce80f0b4f2844cb9270af4665cdc8 PJMEDIA_CODEC_MAX_SILENCE_PERIOD] and [/pjmedia/docs/html/group__PJMEDIA__CONFIG.htm#gced8a0865fc8087f217067202b575f7f PJMEDIA_STREAM_VAD_SUSPEND_MSEC] settings on how to fine tune this behavior. 
     635 - For the media, the [http://www.pjsip.org/pjmedia/docs/html/group__PJMED__STRM.htm media stream] will periodically transmit RTP packets during silence period, to keep NAT binding open. Also it will disable VAD for the first few hundred milliseconds after it is started, to ''hole-punch'' any NATs in between the endpoints. Please see [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__CONFIG.htm#g691ce80f0b4f2844cb9270af4665cdc8 PJMEDIA_CODEC_MAX_SILENCE_PERIOD] and [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__CONFIG.htm#gced8a0865fc8087f217067202b575f7f PJMEDIA_STREAM_VAD_SUSPEND_MSEC] settings on how to fine tune this behavior. 
    634636 - With ICE media transport, the transport periodically sends STUN keep-alive requests to keep NAT binding open, throughout the life of the application. The transport will also update its mapped address should the binding has changed. Note that this feature is not available for UDP media transport. 
    635637 
     
    637639=== Which STUN-bis draft does PJNATH support? === #stunbis-std 
    638640 
    639 At the time of this writing, {{{draft-ietf-behave-rfc3489bis-10}}}. But since STUN-bis (rfc3489bis) is updated often, please look at [/pjnath/docs/html/index.htm PJNATH documentation] for the most up to date information. 
     641At the time of this writing, {{{draft-ietf-behave-rfc3489bis-10}}}. But since STUN-bis (rfc3489bis) is updated often, please look at [http://www.pjsip.org/pjnath/docs/html/index.htm PJNATH documentation] for the most up to date information. 
    640642 
    641643=== Which ICE draft does PJNATH support? === #ice-std 
    642644 
    643 At the time of this writing, {{{draft-ietf-mmusic-ice-18}}}. But since ICE is updated often, please look at [/pjnath/docs/html/index.htm PJNATH documentation] for the most up to date information. 
     645At the time of this writing, {{{draft-ietf-mmusic-ice-18}}}. But since ICE is updated often, please look at [http://www.pjsip.org/pjnath/docs/html/index.htm PJNATH documentation] for the most up to date information. 
    644646 
    645647=== Which TURN draft does PJNATH support? === #ice-std 
    646648 
    647 At the time of this writing, {{{draft-ietf-behave-turn-03}}}. But since TURN is updated often, please look at [/pjnath/docs/html/index.htm PJNATH documentation] for the most up to date information. 
     649At the time of this writing, {{{draft-ietf-behave-turn-03}}}. But since TURN is updated often, please look at [http://www.pjsip.org/pjnath/docs/html/index.htm PJNATH documentation] for the most up to date information. 
    648650 
    649651=== What STUN-bis features does PJNATH support? === #stun-features 
     
    705707 
    706708Some steps to accomplish this are as follow: 
    707  1. First thing we should do is to stop the PJSUA-LIB's conference bridge. This can be accomplished by calling [/pjsip/docs/html/group__PJSUA__LIB__MEDIA.htm#g4b6ffc203b8799f08f072d0921777161 pjsua_set_no_snd_dev()]. With this call, PJSUA-LIB would not connect the conference bridge to any sound devices (including NULL sound device), so basically it would not run. 
    708  1. Because the main conference bridge is no longer working, we cannot use the usual PJSUA-LIB's API to add media ports (thing such as [/pjsip/docs/html/group__PJSUA__LIB__MEDIA.htm#g90a2ec9c8516b5ad13b061a46ae1d07a pjsua_player_create()]), since these API adds the media ports to the main bridge, which no longer works of course. 
     709 1. First thing we should do is to stop the PJSUA-LIB's conference bridge. This can be accomplished by calling [http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB__MEDIA.htm#g4b6ffc203b8799f08f072d0921777161 pjsua_set_no_snd_dev()]. With this call, PJSUA-LIB would not connect the conference bridge to any sound devices (including NULL sound device), so basically it would not run. 
     710 1. Because the main conference bridge is no longer working, we cannot use the usual PJSUA-LIB's API to add media ports (thing such as [http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB__MEDIA.htm#g90a2ec9c8516b5ad13b061a46ae1d07a pjsua_player_create()]), since these API adds the media ports to the main bridge, which no longer works of course. 
    709711 1. When a call's media is established (like when the call is CONFIRMED), PJSUA-LIB will still register the call's stream to the main bridge, but we can just ignore this. The main bridge has been stopped, so although the stream is ''registered'' to it, it won't try to retrieve or send any audio to the stream. 
    710712 1. Since we're not using the main bridge anymore, the call's slot number in {{{pjsua_call_info.conf_slot}}} should not be used anymore. 
     
    917919=== How can I build PJSIP for WinCE/Windows Mobile? === #wm-build 
    918920 
    919 Have a look at this [/using.htm#evc Getting Started | Windows Mobile] page. 
     921Have a look at this [http://www.pjsip.org/using.htm#evc Getting Started | Windows Mobile] page. 
    920922 
    921923 
     
    926928=== How can I build PJSIP for Linux/uC-Linux? === #linux-build 
    927929 
    928 Have a look at this [/using.htm#gnu Getting Started | GNU] page. 
     930Have a look at this [http://www.pjsip.org/using.htm#gnu Getting Started | GNU] page. 
    929931 
    930932---- 
     
    934936=== How can I build PJSIP for MacOS X? === #osx-build 
    935937 
    936 Have a look at this [/using.htm#gnu Getting Started | GNU] page. 
     938Have a look at this [http://www.pjsip.org/using.htm#gnu Getting Started | GNU] page. 
    937939 
    938940---- 
     
    942944=== What Symbian Platforms and Development Tools are Supported by PJSIP? === 
    943945 
    944 As the supported platforms are constantly updated, please see [/sip_symbian.htm PJSIP for Symbian] page for the details. 
     946As the supported platforms are constantly updated, please see [http://www.pjsip.org/sip_symbian.htm PJSIP for Symbian] page for the details. 
    945947 
    946948=== How can I build PJSIP for Symbian? === #symbian-build 
    947949 
    948 We have provided a thorough instructions at the [/sip_symbian.htm PJSIP for Symbian] page, please check it out. In parallel, there is an even more thorough instructions on [wiki:DevelopingSymbianAppWithCarbide using PJSIP with Carbide C++ on S60 3rd Edition platform] which should cover everything including on-device debugging. 
     950We have provided a thorough instructions at the [http://www.pjsip.org/sip_symbian.htm PJSIP for Symbian] page, please check it out. In parallel, there is an even more thorough instructions on [wiki:DevelopingSymbianAppWithCarbide using PJSIP with Carbide C++ on S60 3rd Edition platform] which should cover everything including on-device debugging. 
    949951 
    950952---- 
     
    958960=== How can I use PJSIP in TCL? === #tcl 
    959961 
    960 Antonio F. Cano Damas and Mats Bengtsson have contributed TCL binding for PJSIP, please have a look in the [/contrib.htm PJSIP Contribution] page. 
    961  
     962Antonio F. Cano Damas and Mats Bengtsson have contributed TCL binding for PJSIP, please have a look in the [http://www.pjsip.org/contrib.htm PJSIP Contribution] page. 
     963