Changes between Version 22 and Version 23 of FAQ
- Timestamp:
- Jan 24, 2008 9:04:51 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FAQ
v22 v23 11 11 === Where can I find the latest release of PJSIP? === #latest 12 12 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.13 The 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. 14 14 15 15 === If PJSIP is said to be small footprint, then why the source is so big? === #src-large … … 19 19 === I have downloaded PJSIP source codes, now what next? === #do 20 20 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!21 First you'll need to build the sources, by following the instructions in [http://www.pjsip.org/using.htm Getting Started] page. 22 23 Then 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! 24 24 25 25 Next, I assume that you want to develop some sort of SIP applications, yes? 26 26 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.27 At 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 29 Then 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 31 Then 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. 32 32 33 33 If 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! … … 58 58 === What about the "viral" nature of the GPL? === #gpl-viral 59 59 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.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 [http://www.pjsip.org/licensing.htm Third Party Software] that are allowed to be linked with PJSIP. 61 61 62 62 … … 76 76 - [http://localhost/licensing.htm Speex] codec (BSD-ish license) 77 77 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). 79 79 80 80 In 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! … … 87 87 === I'm having problem building PJSIP, please help! === #build-problems 88 88 89 Please check the [ /using.htm Getting Started] page.89 Please check the [http://www.pjsip.org/using.htm Getting Started] page. 90 90 91 91 === I'm getting "Unable to open DSound.h error", please help! === #dsound 92 92 93 You should really check the [ /using.htm Getting Started] page first.94 95 Please check the [ /using.htm Getting Started] page.93 You should really check the [http://www.pjsip.org/using.htm Getting Started] page first. 94 95 Please check the [http://www.pjsip.org/using.htm Getting Started] page. 96 96 97 97 === How do I build the libraries as Dynamic Link Library (DLL)? === #dll … … 105 105 === Can I use the SIP stack with my own media stack? === 106 106 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.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 [http://www.pjsip.org/docs.htm PJSIP Documentation] page for reference. 108 108 109 109 So yes, the SIP stack (pjsip) can be used without pjmedia, as long as you don't use pjsua-lib. … … 116 116 === What platforms are PJSIP known to run on? === #platforms 117 117 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.118 PJSIP 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. 119 119 120 120 … … 123 123 PJSIP 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. 124 124 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.125 Please 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. 126 126 127 127 ---- … … 186 186 187 187 The 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, or189 - [ /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. 190 190 191 191 Note 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. … … 207 207 In my opinion, this should be fine, as the remote endpoint should be able to accommodate this with its ''jitter buffer''. 208 208 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.209 If 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. 210 210 211 211 The 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. 217 217 1. Start the master port. 218 218 … … 250 250 }}} 251 251 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 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 [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). 255 255 256 256 … … 266 266 === How can I add new codec to PJMEDIA? === #adding-codec 267 267 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.268 First 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. 269 269 270 270 There 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). 273 273 274 274 Once 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. … … 279 279 === How can I manipulate audio samples directly? === #audio-man 280 280 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.281 In 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. 282 282 283 283 Implementing media port should be easy. Basically we just need to implement these: … … 292 292 }; 293 293 }}} 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. 295 295 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). 296 296 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). … … 300 300 301 301 For 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). 306 306 307 307 For 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). 310 310 311 311 For 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) 314 314 315 315 … … 322 322 When 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. 323 323 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 330 Yes, 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 334 Please see [wiki:TLS Configuring and Using PJSIP with TLS] page. 335 336 === Does PJSIP Support Secure Media? === #srtp 337 338 PJSIP supports SRTP since version 0.9, please see [wiki:SRTP SRTP Support in PJSIP] page for more info. 339 340 336 341 337 342 ---- … … 347 352 }}} 348 353 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).354 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 [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). 350 355 351 356 352 357 === How can I send inband DTMF tones? === #inband-dtmf 353 358 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.359 It'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. 359 364 360 365 Here is a snippet to do it: … … 484 489 === Does PJSIP support RFC XYZ? === #rfc 485 490 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.491 The 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. 487 492 488 493 === I'm having problem with calling XYZ, please help! === #general-sip … … 490 495 Please report the problem to [http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org PJSIP mailing list]. Please provide the following information: 491 496 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. 493 498 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. 494 499 … … 498 503 Most likely this is caused by wrong credential in the configuration. The remedy depends on what error was reported by PJSIP. 499 504 500 For [ /pjsip/docs/html/group__PJSIP__CORE__ERRNO.htm#ga13bf24296c19bece7c0c9af051f89db PJSIP_ENOCREDENTIAL] error:505 For [http://www.pjsip.org/pjsip/docs/html/group__PJSIP__CORE__ERRNO.htm#ga13bf24296c19bece7c0c9af051f89db PJSIP_ENOCREDENTIAL] error: 501 506 - 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". 502 507 503 For [ /pjsip/docs/html/group__PJSIP__CORE__ERRNO.htm#ga935d4205ae50ad6f18a4df98b90d2f6 PJSIP_EFAILEDCREDENTIAL] error:508 For [http://www.pjsip.org/pjsip/docs/html/group__PJSIP__CORE__ERRNO.htm#ga935d4205ae50ad6f18a4df98b90d2f6 PJSIP_EFAILEDCREDENTIAL] error: 504 509 - If you encounter this error, most likely it was caused by a wrong credential. Check if the username and password combination is correct. 505 510 … … 509 514 510 515 If 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 519 Once 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()]. 515 520 516 521 Now for a different view on the question. 517 522 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'':523 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'': 519 524 {{{ 520 525 .. … … 561 566 }}} 562 567 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.568 Once 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. 564 569 565 570 For 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. … … 618 623 If 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. 619 624 620 === How Can I Use TLS with PJSIP/pjsua === #tls621 622 Please see [wiki:TLS Configuring PJSIP with TLS] page.623 625 624 626 ---- … … 631 633 - On the SIP side, PJSIP supports Symmetric Response Routing ({{{rport}}}) and STUN. 632 634 - 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. 634 636 - 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. 635 637 … … 637 639 === Which STUN-bis draft does PJNATH support? === #stunbis-std 638 640 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.641 At 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. 640 642 641 643 === Which ICE draft does PJNATH support? === #ice-std 642 644 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.645 At 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. 644 646 645 647 === Which TURN draft does PJNATH support? === #ice-std 646 648 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.649 At 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. 648 650 649 651 === What STUN-bis features does PJNATH support? === #stun-features … … 705 707 706 708 Some 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. 709 711 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. 710 712 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. … … 917 919 === How can I build PJSIP for WinCE/Windows Mobile? === #wm-build 918 920 919 Have a look at this [ /using.htm#evc Getting Started | Windows Mobile] page.921 Have a look at this [http://www.pjsip.org/using.htm#evc Getting Started | Windows Mobile] page. 920 922 921 923 … … 926 928 === How can I build PJSIP for Linux/uC-Linux? === #linux-build 927 929 928 Have a look at this [ /using.htm#gnu Getting Started | GNU] page.930 Have a look at this [http://www.pjsip.org/using.htm#gnu Getting Started | GNU] page. 929 931 930 932 ---- … … 934 936 === How can I build PJSIP for MacOS X? === #osx-build 935 937 936 Have a look at this [ /using.htm#gnu Getting Started | GNU] page.938 Have a look at this [http://www.pjsip.org/using.htm#gnu Getting Started | GNU] page. 937 939 938 940 ---- … … 942 944 === What Symbian Platforms and Development Tools are Supported by PJSIP? === 943 945 944 As the supported platforms are constantly updated, please see [ /sip_symbian.htm PJSIP for Symbian] page for the details.946 As the supported platforms are constantly updated, please see [http://www.pjsip.org/sip_symbian.htm PJSIP for Symbian] page for the details. 945 947 946 948 === How can I build PJSIP for Symbian? === #symbian-build 947 949 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.950 We 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. 949 951 950 952 ---- … … 958 960 === How can I use PJSIP in TCL? === #tcl 959 961 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 962 Antonio 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