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. 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. |
| 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! |
27 | | Prepare your 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. |
28 | | |
29 | | Then you'll 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]. |
30 | | |
31 | | Good luck! |
| 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. |
| 32 | |
| 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! |
| 68 | |
| 69 | |
| 70 | === What are the licensing requirements of the third party libraries used by PJSIP? === #third-party |
| 71 | |
| 72 | Apart from the licensing requirements of PJSIP, please be aware that some third party libraries used by PJSIP put additional requirements to the end product (that is, the application using PJSIP). In particular, libraries such as these require some attribution to be put in the end product and/or the accompanying documentation: |
| 73 | - [http://www.openh323.org/ VAD by OpenH323 project] (MPL license) |
| 74 | - [http://www.portaudio.com/ PortAudio] (BSD-ish license) |
| 75 | - [http://kbs.cs.tu-berlin.de/~jutta/toast.html GSM] codec (BSD-ish license) |
| 76 | - [http://localhost/licensing.htm Speex] codec (BSD-ish license) |
| 77 | |
| 78 | (the list above are not exhaustive, please see [/licensing.htm PJSIP Licensing page] for the complete list). |
| 79 | |
| 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! |
307 | | No, because there is no ready to use G.723/G.729 codec implementation in PJMEDIA. We specifically don't include G.723/G.729 support in our code because G.723/G.729 are both patented and royalty based codecs, so we are quite nervous with the possibility that some lawyers may contact us should we include them in PJMEDIA. So our decision is to include only free and open source codec in PJMEDIA. |
308 | | |
309 | | But yes, because we can always add more codecs in PJMEDIA. Please see [#adding-codec Adding a new codec] question below for more info. |
310 | | |
311 | | === How to add new codec to PJMEDIA? === #adding-codec |
312 | | |
313 | | 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. |
314 | | |
315 | | Once it's finished, you should end up with just two public APIs exported by the codec: the initialization function, and the deinitialization function. |
316 | | |
317 | | Then register your codec to PJMEDIA in the application by calling the codec initialization function. After this, the codec should be picked up automagically by the rest of PJMEDIA framework (that is, PJSIP should advertise the codec in outgoing SDP and negotiate it with remote's SDP). |
| 322 | No, because there is no ready to use G.723/G.729 codec implementation in PJMEDIA. We specifically don't include G.723/G.729 support in our code because G.723/G.729 are both patented and royalty based codecs, so we are quite nervous with the possibility that some lawyers may contact us should we include them in PJMEDIA. So our decision is to include only free and open source codecs in PJMEDIA (such as G.711, GSM, and Speex). |
| 323 | |
| 324 | But yes, because you can always add more codecs in PJMEDIA. Please see [#adding-codec Adding a new codec] question below for more info. |
| 325 | |
| 326 | === How can I add new codec to PJMEDIA? === #adding-codec |
| 327 | |
| 328 | 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. |
| 329 | |
| 330 | There are two "classes" to implement: |
| 331 | - 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. |
| 332 | - 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). |
| 333 | |
| 334 | 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. |
| 335 | |
| 336 | Then call the codec initialization function in the application. After this, the codec should be picked up automagically by the rest of PJMEDIA framework (that is, PJSIP should advertise the codec in outgoing SDP and negotiate it with remote's SDP, and encode/decode audio frames with the codec, if the codec is selected for the session). |