* [1]Main Page
     * [2]Related Pages
     * [3]Namespaces
     * [4]Data Structures
     * [5]Files
     * [6]Directories
     * [7]Examples

How to set up a simple proxy for trying out and using SEMS


   This text describes how one can set up a simple SIP proxy in order to
   try out services in SEMS.

   We will use the Kamailio 3.0 default proxy installation, and add a
   route SERVICES which adds the application name, and forwards the call
   to SEMS. The same configuration can be used with the original SER
   (iptel.org/ser), sip-router (sip-router.org) or other SER derivatives,
   like OpenSIPS (opensips.org).

Installing Kamailio

   To install Kamailio 3.0, there is excellent documentation on the
   [8]Kamailio website. In debain lenny, or for example in Ubuntu 9.10,
   one can install Kamailio with
    $ wget http://www.kamailio.org/pub/kamailio/latest/packages/debian-lenny/kam
    $ dpkg -i kamailio_3.0.1_i386.deb

   To activate kamailio, one needs to set RUN_KAMAILIO=yes in

Adding a service route

   Kamailio processes all requests according to the logic that is set in
   the route section of its configuration file, which is a very flexible
   one. In order to have services executed when some special numebrs are
   called (e.g. 200 and 300), we add another route to
   route[SERVICES] {
        if ($rU=~"^200.*") {
                append_hf("P-App-Name: echo\r\n");
                $ru = "sip:" + $rU + "@" + "";
        if ($rU=~"^300.*") {
                append_hf("P-App-Name: conference\r\n");
                $ru = "sip:" + $rU + "@" + "";

   This route block can be added anywhere, for example at the end, or
   between the PSTN and the SERVICES routes.

   Then, in the main route section, which is the one marked with the
   comment # main request routing logic, we call our SERVICES-route,
   preferably before (or after) the PSTN route:
        if ($rU==$null) {
                # request with no Username in RURI
                sl_send_reply("484","Address Incomplete");



        # apply DB based aliases (uncomment to enable)

        if (!lookup("location")) {

   Now, if we register a phone to the server, and call the 200 or the 300
   number, the INVITE gets sent to, with the application
   that is to be called, added as header to the INVITE.

Setting up SEMS to select the application

   If we load several applications in SEMS, we can select which
   application to execute by the P-App-Name header. In sems.conf we set
   application= so that SEMS looks into the P-App-Name header to determine
   which application to run:

          in this simple case, we could also have set application= and
          used regular expression mapping in app_mapping.conf

    Generated on Thu Feb 3 02:29:25 2011 for SEMS by  [9]doxygen 1.6.1


   1. file://localhost/home/stefan/devel/sems/sems/doc/doxygen_doc/html/index.html
   2. file://localhost/home/stefan/devel/sems/sems/doc/doxygen_doc/html/pages.html
   3. file://localhost/home/stefan/devel/sems/sems/doc/doxygen_doc/html/namespaces.html
   4. file://localhost/home/stefan/devel/sems/sems/doc/doxygen_doc/html/annotated.html
   5. file://localhost/home/stefan/devel/sems/sems/doc/doxygen_doc/html/files.html
   6. file://localhost/home/stefan/devel/sems/sems/doc/doxygen_doc/html/dirs.html
   7. file://localhost/home/stefan/devel/sems/sems/doc/doxygen_doc/html/examples.html
   8. http://www.kamailio.org/dokuwiki/doku.php#setup
   9. http://www.doxygen.org/index.html