[Pkg-voip-commits] [kamailio] 01/04: Imported Upstream version 4.1.5

Victor Seva Lopez maniac-guest at moszumanska.debian.org
Sun Aug 10 07:15:35 UTC 2014


This is an automated email from the git hooks/post-receive script.

maniac-guest pushed a commit to branch master
in repository kamailio.

commit ee9aba27364a51de5bf384f555ae06c8a639c1bb
Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Date:   Thu Aug 7 21:13:07 2014 +0200

    Imported Upstream version 4.1.5
---
 ChangeLog                                          | 1671 ++++++++++++++++++++
 INSTALL                                            |    2 -
 Makefile.defs                                      |    2 +-
 autover.h                                          |    4 +-
 cfg.y                                              |    3 +-
 cfg/cfg.c                                          |    3 +
 cfg/cfg_ctx.c                                      |    6 +-
 cfg/cfg_struct.c                                   |    2 +-
 cfg_parser.c                                       |    3 +-
 core_cmd.c                                         |    2 +-
 dns_cache.c                                        |   12 +-
 doc/stylesheets/dbschema_k/bookinfo.xml            |    8 +-
 forward.h                                          |    2 +
 io_wait.h                                          |    2 +-
 lib/srdb1/db.c                                     |    2 +
 lib/srdb1/db_res.c                                 |   12 +-
 lib/srdb1/db_res.h                                 |   12 +-
 lib/srdb1/db_row.c                                 |    4 +-
 lib/srdb1/db_row.h                                 |    4 +-
 lib/srdb1/schema/Makefile                          |   44 +
 lib/srutils/tmrec.c                                |    1 +
 main.c                                             |   12 +
 mem/f_malloc.c                                     |   18 +-
 mem/mem.h                                          |   21 +-
 mem/q_malloc.c                                     |    6 +-
 modparam.c                                         |    4 +
 modules/acc/acc_cdr.c                              |    2 +-
 modules/acc/acc_logic.c                            |   18 +-
 modules/acc/acc_mod.c                              |    3 +
 modules/app_java/Makefile                          |   13 +-
 modules/app_java/doc/app_java.xml                  |   10 +-
 modules/app_java/doc/app_java_admin.xml            |  136 +-
 modules/app_perl/app_perl_mod.c                    |    6 +-
 modules/auth/README                                |  210 +--
 modules/auth/auth_mod.c                            |    3 +-
 modules/auth/doc/auth_functions.xml                |   12 +-
 modules/auth_db/authorize.c                        |   28 +-
 modules/auth_diameter/authorize.c                  |    4 +-
 modules/auth_diameter/tcp_comm.c                   |    2 +-
 modules/auth_diameter/user_in.c                    |    7 +-
 modules/auth_radius/sterman.c                      |    2 +-
 modules/avpops/avpops_impl.c                       |    2 +
 modules/benchmark/benchmark.c                      |   29 +-
 modules/call_control/call_control.c                |   10 +-
 modules/carrierroute/Makefile                      |   17 -
 modules/carrierroute/cr_config.c                   |  437 +++--
 modules/carrierroute/doc/carrierroute_admin.xml    |   15 -
 modules/carrierroute/parser_carrierroute.c         |  411 +++++
 modules/carrierroute/parser_carrierroute.h         |   92 ++
 modules/cnxcc/cnxcc.c                              |    6 +-
 modules/cnxcc/cnxcc.h                              |    6 +-
 modules/cnxcc/cnxcc_check.c                        |   30 +-
 modules/cnxcc/cnxcc_mod.c                          |  208 ++-
 modules/cnxcc/cnxcc_select.c                       |    4 +-
 modules/ctl/binrpc_run.c                           |    9 +-
 modules/db_flatstore/km_flat_con.c                 |    1 +
 modules/db_mysql/km_dbase.c                        |   13 +-
 modules/db_mysql/km_res.c                          |    2 +
 modules/db_mysql/my_uri.c                          |    2 +
 modules/db_text/dbt_res.c                          |    6 +-
 modules/db_unixodbc/Makefile                       |   22 +-
 modules/db_unixodbc/dbase.c                        |    3 +
 modules/debugger/debugger_api.c                    |    2 +-
 modules/dialog/dialog.c                            |    6 +
 modules/dialog/dlg_handlers.c                      |   16 +-
 modules/dialog/dlg_hash.c                          |   14 +-
 modules/dialog/dlg_profile.c                       |    2 +-
 modules/dialog/dlg_var.c                           |   25 +-
 modules/dialplan/dp_db.c                           |    3 +-
 modules/dialplan/dp_db.h                           |    2 +-
 modules/drouting/drouting.c                        |    2 +-
 modules/exec/exec_hf.c                             |    1 +
 modules/geoip/geoip_pv.c                           |    4 +
 modules/htable/htable.c                            |    2 +-
 modules/ipops/ipops_pv.c                           |    1 +
 modules/json/Makefile                              |   19 +-
 modules/jsonrpc-c/Makefile                         |   19 +-
 modules/maxfwd/README                              |    2 +-
 modules/maxfwd/doc/maxfwd_admin.xml                |    2 +-
 modules/maxfwd/maxfwd.c                            |    2 +-
 modules/mi_rpc/mi_rpc_mod.c                        |    2 +-
 modules/mqueue/mqueue_api.c                        |   13 +-
 modules/msilo/msilo.c                              |   13 +-
 modules/msrp/msrp_parser.c                         |   42 +-
 modules/mtree/mtree_mod.c                          |   27 +-
 modules/nathelper/nathelper.c                      |    5 +-
 modules/permissions/README                         |    2 +-
 modules/permissions/doc/permissions_admin.xml      |    2 +-
 modules/pipelimit/pipelimit.c                      |    2 +-
 modules/presence_dialoginfo/notify_body.c          |    6 +-
 modules/pua/pua.c                                  |    2 +-
 modules/pua_xmpp/simple2xmpp.h                     |    2 +-
 modules/pv/pv_core.c                               |   30 +-
 modules/pv/pv_shv.c                                |    2 +-
 modules/pv/pv_trans.c                              |   10 +-
 modules/registrar/save.c                           |    7 +-
 modules/rls/list.h                                 |   10 +-
 modules/rls/notify.c                               |    2 +-
 modules/rls/subscribe.c                            |    2 +
 modules/rls/utils.h                                |    2 +-
 modules/rr/record.c                                |    3 +-
 modules/rtimer/rtimer_mod.c                        |    6 +
 modules/sctp/sctp_mod.c                            |    4 +
 modules/sipcapture/sipcapture.c                    |    6 +-
 modules/sipt/ss7_parser.c                          |    2 +-
 modules/siputils/checks.c                          |    2 +-
 modules/siputils/sipops.c                          |   15 +-
 modules/sqlops/README                              |   20 +-
 modules/sqlops/doc/sqlops_admin.xml                |   27 +-
 modules/textops/textops.c                          |    7 +-
 modules/textopsx/textopsx.c                        |   10 +-
 modules/tls/README                                 |   11 +-
 modules/tls/doc/tls.xml                            |   15 +
 modules/tls/tls_config.c                           |  271 ++--
 modules/tls/tls_domain.c                           |   91 ++
 modules/tls/tls_mod.c                              |   15 +-
 modules/tm/h_table.c                               |   19 +-
 modules/tm/h_table.h                               |    2 +
 modules/tm/t_cancel.c                              |    7 +-
 modules/tm/t_reply.c                               |   13 +-
 modules/tm/t_serial.c                              |   27 +-
 modules/tm/timer.c                                 |    1 +
 modules/tm/tm.c                                    |    3 +
 modules/tmrec/period.h                             |    2 +-
 modules/tmx/t_var.c                                |    6 +-
 modules/tmx/tmx_mod.c                              |   21 +-
 modules/topoh/th_msg.c                             |    2 +-
 modules/uac/replace.c                              |    4 +-
 modules/uac/uac.c                                  |   10 +-
 modules/uac/uac_reg.c                              |   27 +
 modules/usrloc/ucontact.c                          |    8 +-
 modules/usrloc/ul_mi.c                             |   27 +-
 modules/usrloc/ul_rpc.c                            |    2 +-
 modules/websocket/ws_conn.c                        |  180 ++-
 modules/websocket/ws_conn.h                        |    8 +
 modules/websocket/ws_frame.c                       |  182 ++-
 modules/websocket/ws_handshake.c                   |    4 +-
 modules/xhttp/xhttp_mod.c                          |    2 +-
 modules/xhttp_pi/xhttp_pi_fnc.c                    |   14 +-
 modules/xlog/xlog.c                                |    1 +
 modules/xmlrpc/xmlrpc.c                            |    2 +-
 msg_translator.c                                   |   12 +-
 parser/contact/parse_contact.c                     |   15 +-
 parser/sdp/sdp.c                                   |    3 +-
 parser/sdp/sdp_helpr_funcs.c                       |   34 +-
 pkg/kamailio/centos/6/README                       |   27 +
 pkg/kamailio/centos/6/kamailio.init                |  134 ++
 pkg/kamailio/centos/6/kamailio.spec                | 1179 ++++++++++++++
 pkg/kamailio/centos/6/kamailio.sysconfig           |   30 +
 pkg/kamailio/deb/debian/backports/jessie           |   19 +
 pkg/kamailio/deb/debian/backports/precise          |   32 +
 pkg/kamailio/deb/debian/backports/squeeze          |   78 +
 pkg/kamailio/deb/debian/backports/trusty           |   19 +
 pkg/kamailio/deb/debian/backports/wheezy           |   38 +
 pkg/kamailio/deb/debian/changelog                  |  118 ++
 pkg/kamailio/deb/debian/compat                     |    1 +
 pkg/kamailio/deb/debian/control                    |  570 +++++++
 pkg/kamailio/deb/debian/copyright                  |  335 ++++
 .../kamailio-autheph-modules.lintian-overrides     |    1 +
 pkg/kamailio/deb/debian/kamailio-berkeley-bin.dirs |    1 +
 .../kamailio-dnssec-modules.lintian-overrides      |    1 +
 .../kamailio-outbound-modules.lintian-overrides    |    1 +
 .../debian/kamailio-tls-modules.lintian-overrides  |    1 +
 .../kamailio-websocket-modules.lintian-overrides   |    1 +
 pkg/kamailio/deb/debian/kamailio.README.Debian     |   39 +
 pkg/kamailio/deb/debian/kamailio.default           |   28 +
 pkg/kamailio/deb/debian/kamailio.examples          |    2 +
 pkg/kamailio/deb/debian/kamailio.init              |  162 ++
 pkg/kamailio/deb/debian/kamailio.lintian-overrides |    2 +
 pkg/kamailio/deb/debian/kamailio.postinst          |   24 +
 pkg/kamailio/deb/debian/rules                      |  220 +++
 pkg/kamailio/deb/debian/source.lintian-overrides   |    1 +
 pkg/kamailio/deb/debian/source/format              |    1 +
 pkg/kamailio/deb/debian/watch                      |    3 +
 pkg/kamailio/deb/jessie/changelog                  |  118 ++
 pkg/kamailio/deb/jessie/compat                     |    1 +
 pkg/kamailio/deb/jessie/control                    |  569 +++++++
 pkg/kamailio/deb/jessie/copyright                  |  335 ++++
 .../kamailio-autheph-modules.lintian-overrides     |    1 +
 pkg/kamailio/deb/jessie/kamailio-berkeley-bin.dirs |    1 +
 .../kamailio-dnssec-modules.lintian-overrides      |    1 +
 .../kamailio-outbound-modules.lintian-overrides    |    1 +
 .../jessie/kamailio-tls-modules.lintian-overrides  |    1 +
 .../kamailio-websocket-modules.lintian-overrides   |    1 +
 pkg/kamailio/deb/jessie/kamailio.README.Debian     |   39 +
 pkg/kamailio/deb/jessie/kamailio.default           |   28 +
 pkg/kamailio/deb/jessie/kamailio.examples          |    2 +
 pkg/kamailio/deb/jessie/kamailio.init              |  162 ++
 pkg/kamailio/deb/jessie/kamailio.lintian-overrides |    2 +
 pkg/kamailio/deb/jessie/kamailio.postinst          |   24 +
 pkg/kamailio/deb/jessie/rules                      |  220 +++
 pkg/kamailio/deb/jessie/source.lintian-overrides   |    1 +
 pkg/kamailio/deb/jessie/source/format              |    1 +
 pkg/kamailio/deb/jessie/watch                      |    3 +
 pkg/kamailio/deb/precise/changelog                 |  118 ++
 pkg/kamailio/deb/precise/compat                    |    1 +
 pkg/kamailio/deb/precise/control                   |  556 +++++++
 pkg/kamailio/deb/precise/copyright                 |  335 ++++
 .../kamailio-autheph-modules.lintian-overrides     |    1 +
 .../deb/precise/kamailio-berkeley-bin.dirs         |    1 +
 .../kamailio-dnssec-modules.lintian-overrides      |    1 +
 .../kamailio-outbound-modules.lintian-overrides    |    1 +
 .../precise/kamailio-tls-modules.lintian-overrides |    1 +
 .../kamailio-websocket-modules.lintian-overrides   |    1 +
 pkg/kamailio/deb/precise/kamailio.README.Debian    |   39 +
 pkg/kamailio/deb/precise/kamailio.default          |   28 +
 pkg/kamailio/deb/precise/kamailio.examples         |    2 +
 pkg/kamailio/deb/precise/kamailio.init             |  162 ++
 .../deb/precise/kamailio.lintian-overrides         |    2 +
 pkg/kamailio/deb/precise/kamailio.postinst         |   24 +
 pkg/kamailio/deb/precise/rules                     |  219 +++
 pkg/kamailio/deb/precise/source.lintian-overrides  |    1 +
 pkg/kamailio/deb/precise/source/format             |    1 +
 pkg/kamailio/deb/precise/watch                     |    3 +
 pkg/kamailio/deb/squeeze/changelog                 |  118 ++
 pkg/kamailio/deb/squeeze/compat                    |    1 +
 pkg/kamailio/deb/squeeze/control                   |  456 ++++++
 pkg/kamailio/deb/squeeze/copyright                 |  335 ++++
 .../kamailio-autheph-modules.lintian-overrides     |    1 +
 .../deb/squeeze/kamailio-berkeley-bin.dirs         |    1 +
 .../kamailio-dnssec-modules.lintian-overrides      |    1 +
 .../kamailio-outbound-modules.lintian-overrides    |    1 +
 .../squeeze/kamailio-tls-modules.lintian-overrides |    1 +
 .../kamailio-websocket-modules.lintian-overrides   |    1 +
 pkg/kamailio/deb/squeeze/kamailio.README.Debian    |   39 +
 pkg/kamailio/deb/squeeze/kamailio.default          |   28 +
 pkg/kamailio/deb/squeeze/kamailio.examples         |    2 +
 pkg/kamailio/deb/squeeze/kamailio.init             |  162 ++
 .../deb/squeeze/kamailio.lintian-overrides         |    2 +
 pkg/kamailio/deb/squeeze/kamailio.postinst         |   24 +
 pkg/kamailio/deb/squeeze/rules                     |  216 +++
 pkg/kamailio/deb/squeeze/source.lintian-overrides  |    1 +
 pkg/kamailio/deb/squeeze/source/format             |    1 +
 pkg/kamailio/deb/squeeze/watch                     |    3 +
 pkg/kamailio/deb/trusty/changelog                  |  118 ++
 pkg/kamailio/deb/trusty/compat                     |    1 +
 pkg/kamailio/deb/trusty/control                    |  569 +++++++
 pkg/kamailio/deb/trusty/copyright                  |  335 ++++
 .../kamailio-autheph-modules.lintian-overrides     |    1 +
 pkg/kamailio/deb/trusty/kamailio-berkeley-bin.dirs |    1 +
 .../kamailio-dnssec-modules.lintian-overrides      |    1 +
 .../kamailio-outbound-modules.lintian-overrides    |    1 +
 .../trusty/kamailio-tls-modules.lintian-overrides  |    1 +
 .../kamailio-websocket-modules.lintian-overrides   |    1 +
 pkg/kamailio/deb/trusty/kamailio.README.Debian     |   39 +
 pkg/kamailio/deb/trusty/kamailio.default           |   28 +
 pkg/kamailio/deb/trusty/kamailio.examples          |    2 +
 pkg/kamailio/deb/trusty/kamailio.init              |  162 ++
 pkg/kamailio/deb/trusty/kamailio.lintian-overrides |    2 +
 pkg/kamailio/deb/trusty/kamailio.postinst          |   24 +
 pkg/kamailio/deb/trusty/rules                      |  220 +++
 pkg/kamailio/deb/trusty/source.lintian-overrides   |    1 +
 pkg/kamailio/deb/trusty/source/format              |    1 +
 pkg/kamailio/deb/trusty/watch                      |    3 +
 pkg/kamailio/deb/wheezy/changelog                  |  118 ++
 pkg/kamailio/deb/wheezy/compat                     |    1 +
 pkg/kamailio/deb/wheezy/control                    |  542 +++++++
 pkg/kamailio/deb/wheezy/copyright                  |  335 ++++
 .../kamailio-autheph-modules.lintian-overrides     |    1 +
 pkg/kamailio/deb/wheezy/kamailio-berkeley-bin.dirs |    1 +
 .../kamailio-dnssec-modules.lintian-overrides      |    1 +
 .../kamailio-outbound-modules.lintian-overrides    |    1 +
 .../wheezy/kamailio-tls-modules.lintian-overrides  |    1 +
 .../kamailio-websocket-modules.lintian-overrides   |    1 +
 pkg/kamailio/deb/wheezy/kamailio.README.Debian     |   39 +
 pkg/kamailio/deb/wheezy/kamailio.default           |   28 +
 pkg/kamailio/deb/wheezy/kamailio.examples          |    2 +
 pkg/kamailio/deb/wheezy/kamailio.init              |  162 ++
 pkg/kamailio/deb/wheezy/kamailio.lintian-overrides |    2 +
 pkg/kamailio/deb/wheezy/kamailio.postinst          |   24 +
 pkg/kamailio/deb/wheezy/rules                      |  219 +++
 pkg/kamailio/deb/wheezy/source.lintian-overrides   |    1 +
 pkg/kamailio/deb/wheezy/source/format              |    1 +
 pkg/kamailio/deb/wheezy/watch                      |    3 +
 pkg/kamailio/fedora/17/README                      |   67 +
 pkg/kamailio/fedora/17/kamailio-build.appl         |   49 +
 pkg/kamailio/fedora/17/kamailio.appl               |   42 +
 pkg/kamailio/fedora/17/kamailio.service            |   14 +
 pkg/kamailio/fedora/17/kamailio.spec               | 1328 ++++++++++++++++
 pkg/kamailio/fedora/17/kamailio.sysconfig          |   12 +
 pkg/kamailio/fedora/18/README                      |    1 +
 pkg/kamailio/fedora/18/kamailio-build.appl         |   49 +
 pkg/kamailio/fedora/18/kamailio.appl               |   42 +
 pkg/kamailio/fedora/18/kamailio.service            |    1 +
 pkg/kamailio/fedora/18/kamailio.spec               |    1 +
 pkg/kamailio/fedora/18/kamailio.sysconfig          |    1 +
 pkg/kamailio/freebsd/Makefile                      |  201 +++
 pkg/kamailio/freebsd/distinfo                      |    3 +
 pkg/kamailio/freebsd/files/patch-Makefile          |   78 +
 pkg/kamailio/freebsd/files/patch-Makefile-mysql    |   11 +
 pkg/kamailio/freebsd/files/patch-Makefile.defs     |   42 +
 pkg/kamailio/freebsd/files/pkg-deinstall.in        |   24 +
 pkg/kamailio/freebsd/files/pkg-install.in          |   12 +
 pkg/kamailio/freebsd/pkg-descr                     |   13 +
 pkg/kamailio/gentoo                                |    1 +
 pkg/kamailio/netbsd/COMMENT                        |    1 +
 pkg/kamailio/netbsd/DESCR                          |   18 +
 pkg/kamailio/netbsd/Makefile                       |   42 +
 pkg/kamailio/netbsd/PLIST                          |  120 ++
 pkg/kamailio/netbsd/distinfo                       |    1 +
 pkg/kamailio/openbsd/Makefile                      |  154 ++
 pkg/kamailio/openbsd/distinfo                      |    5 +
 .../openbsd/patches/patch-etc_kamailio_cfg         |   13 +
 .../openbsd/patches/patch-modules_perl_Makefile    |   15 +
 .../openbsd/patches/patch-scripts_kamctlrc         |   12 +
 pkg/kamailio/openbsd/pkg/COMMENT                   |    1 +
 pkg/kamailio/openbsd/pkg/DESCR                     |   18 +
 pkg/kamailio/openbsd/pkg/DESCR-berkeleydb          |    1 +
 pkg/kamailio/openbsd/pkg/DESCR-carrierroute        |    1 +
 pkg/kamailio/openbsd/pkg/DESCR-ldap                |    1 +
 pkg/kamailio/openbsd/pkg/DESCR-main                |    7 +
 pkg/kamailio/openbsd/pkg/DESCR-mysql               |    1 +
 pkg/kamailio/openbsd/pkg/DESCR-perl                |    1 +
 pkg/kamailio/openbsd/pkg/DESCR-postgresql          |    1 +
 pkg/kamailio/openbsd/pkg/DESCR-radius              |    1 +
 pkg/kamailio/openbsd/pkg/DESCR-snmpstats           |    1 +
 pkg/kamailio/openbsd/pkg/DESCR-xcap_client         |    1 +
 pkg/kamailio/openbsd/pkg/DESCR-xmlrpc              |    1 +
 pkg/kamailio/openbsd/pkg/PFRAG.shared-berkeleydb   |    2 +
 pkg/kamailio/openbsd/pkg/PFRAG.shared-carrierroute |    2 +
 pkg/kamailio/openbsd/pkg/PFRAG.shared-ldap         |    3 +
 pkg/kamailio/openbsd/pkg/PFRAG.shared-main         |   68 +
 pkg/kamailio/openbsd/pkg/PFRAG.shared-mysql        |    2 +
 pkg/kamailio/openbsd/pkg/PFRAG.shared-perl         |    3 +
 pkg/kamailio/openbsd/pkg/PFRAG.shared-postgresql   |    2 +
 pkg/kamailio/openbsd/pkg/PFRAG.shared-radius       |    6 +
 pkg/kamailio/openbsd/pkg/PFRAG.shared-snmpstats    |    2 +
 pkg/kamailio/openbsd/pkg/PFRAG.shared-xcap_client  |    2 +
 pkg/kamailio/openbsd/pkg/PFRAG.shared-xmlrpc       |    2 +
 pkg/kamailio/openbsd/pkg/PLIST                     |  120 ++
 pkg/kamailio/openbsd/pkg/PLIST-berkeleydb          |   47 +
 pkg/kamailio/openbsd/pkg/PLIST-carrierroute        |    3 +
 pkg/kamailio/openbsd/pkg/PLIST-ldap                |    4 +
 pkg/kamailio/openbsd/pkg/PLIST-main                |  186 +++
 pkg/kamailio/openbsd/pkg/PLIST-mysql               |   32 +
 pkg/kamailio/openbsd/pkg/PLIST-perl                |   30 +
 pkg/kamailio/openbsd/pkg/PLIST-postgresql          |   32 +
 pkg/kamailio/openbsd/pkg/PLIST-radius              |    8 +
 pkg/kamailio/openbsd/pkg/PLIST-snmpstats           |   10 +
 pkg/kamailio/openbsd/pkg/PLIST-xcap_client         |    3 +
 pkg/kamailio/openbsd/pkg/PLIST-xmlrpc              |    3 +
 pkg/kamailio/rpm/kamailio.default                  |   30 +
 pkg/kamailio/rpm/kamailio.init                     |  128 ++
 pkg/kamailio/rpm/kamailio.init.SuSE                |  133 ++
 pkg/kamailio/rpm/kamailio.spec-4.1                 |  403 +++++
 pkg/kamailio/rpm/kamailio.spec.CenOS               |  742 +++++++++
 pkg/kamailio/rpm/kamailio.spec.SuSE                |  383 +++++
 pkg/kamailio/solaris/kamailio-manifest.xml         |   43 +
 pkg/kamailio/solaris/pkginfo                       |    9 +
 pkg/kamailio/solaris/prototype                     |  132 ++
 pkg/ser/deb/debian/changelog                       |  156 ++
 pkg/ser/deb/debian/compat                          |    1 +
 pkg/ser/deb/debian/control                         |  117 ++
 pkg/ser/deb/debian/copyright                       |   19 +
 pkg/ser/deb/debian/cron.d.ex                       |    4 +
 pkg/ser/deb/debian/ex.package.doc-base             |   22 +
 pkg/ser/deb/debian/manpage.1.ex                    |   60 +
 pkg/ser/deb/debian/manpage.sgml.ex                 |  152 ++
 pkg/ser/deb/debian/postinst                        |  182 +++
 pkg/ser/deb/debian/postrm                          |   13 +
 pkg/ser/deb/debian/preinst.ex                      |   44 +
 pkg/ser/deb/debian/prerm                           |   14 +
 pkg/ser/deb/debian/prerm.ex                        |   39 +
 pkg/ser/deb/debian/rules                           |  243 +++
 pkg/ser/deb/debian/ser-oob.config                  |   81 +
 pkg/ser/deb/debian/ser-oob.postinst                |  286 ++++
 pkg/ser/deb/debian/ser-oob.postrm                  |    6 +
 pkg/ser/deb/debian/ser-oob.prerm                   |   14 +
 pkg/ser/deb/debian/ser-oob.templates               |  191 +++
 pkg/ser/deb/debian/ser.config                      |   29 +
 pkg/ser/deb/debian/ser.default                     |   44 +
 pkg/ser/deb/debian/ser.examples                    |   15 +
 pkg/ser/deb/debian/ser.init                        |  125 ++
 pkg/ser/deb/debian/ser.templates                   |   59 +
 pkg/ser/deb/debian/shlibs.local                    |    0
 pkg/ser/deb/debian/watch                           |    7 +
 pkg/ser/freebsd/000.ser.sh                         |   24 +
 pkg/ser/freebsd/Makefile                           |   55 +
 pkg/ser/freebsd/distinfo                           |    1 +
 pkg/ser/freebsd/pkg-comment                        |    1 +
 pkg/ser/freebsd/pkg-descr                          |   15 +
 pkg/ser/freebsd/pkg-plist                          |  104 ++
 pkg/ser/gentoo/ChangeLog                           |   78 +
 pkg/ser/gentoo/Manifest                            |   16 +
 pkg/ser/gentoo/files/ser.confd                     |   16 +
 pkg/ser/gentoo/files/ser.initd                     |   34 +
 pkg/ser/gentoo/metadata.xml                        |    9 +
 pkg/ser/gentoo/sip-router-3.1.5.ebuild             |  250 +++
 pkg/ser/gentoo/sip-router-3.1.6.ebuild             |  251 +++
 pkg/ser/gentoo/sip-router-3.2.3.ebuild             |  251 +++
 pkg/ser/gentoo/sip-router-3.2.4.ebuild             |  251 +++
 pkg/ser/gentoo/sip-router-3.3.1.ebuild             |  255 +++
 pkg/ser/gentoo/sip-router-3.3.2.ebuild             |  255 +++
 pkg/ser/netbsd/COMMENT                             |    1 +
 pkg/ser/netbsd/DESCR                               |   16 +
 pkg/ser/netbsd/Makefile                            |   50 +
 pkg/ser/netbsd/PLIST                               |  102 ++
 pkg/ser/netbsd/distinfo                            |    1 +
 pkg/ser/openbsd/Makefile                           |   54 +
 pkg/ser/openbsd/distinfo                           |    1 +
 pkg/ser/openbsd/pkg/COMMENT                        |    1 +
 pkg/ser/openbsd/pkg/DESCR                          |   15 +
 pkg/ser/openbsd/pkg/PLIST                          |  106 ++
 pkg/ser/opensuse/ser.init.SuSE                     |  136 ++
 pkg/ser/opensuse/ser.spec                          |  333 ++++
 pkg/ser/rpm/ser.init                               |   72 +
 pkg/ser/rpm/ser.spec-4.1                           |  328 ++++
 pkg/ser/rpm/ser.spec.fedora                        |  296 ++++
 pkg/ser/solaris/pkginfo                            |    9 +
 pkg/ser/solaris/prototype                          |  106 ++
 pkg/ser/suse/ser.init                              |  136 ++
 pkg/ser/suse/ser.spec                              |  341 ++++
 pvapi.c                                            |    4 +-
 re.c                                               |    2 +-
 resolve.c                                          |    2 +-
 route.c                                            |   12 +-
 rpc_lookup.h                                       |    2 +-
 rvalue.c                                           |    1 +
 select.c                                           |    4 +
 stats.h                                            |    2 +-
 switch.c                                           |    4 +-
 tcp_main.c                                         |   21 +-
 utils/kamctl/kamctl                                |    2 +-
 utils/kamctl/kamdbctl.base                         |    5 +-
 utils/pdbt/debian/control                          |    1 -
 utils/sercmd/sercmd.c                              |   21 +-
 426 files changed, 25431 insertions(+), 1086 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 74ada31..4cf82ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,1674 @@
+===================== 2014-08-06 Version 4.1.5 Released =====================
+
+===================== Changes Since Version 4.1.4 ===========================
+
+commit 97f5a9a1c6485816913b0c2c3d4af6be466c4b77
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed Aug 6 17:19:07 2014 +0200
+
+    Makefile.defs: version set to 4.1.5
+
+commit 830c24891a293a8b48b49ce5ebb684f8f2734132
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed Aug 6 16:58:47 2014 +0200
+
+    pkg/rpm: set version to 4.1.5 for rpm specs
+
+commit e3113d7b820dd339f6533e816450a20d01b3f584
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed Aug 6 16:56:43 2014 +0200
+
+    pkg/deb: version set to 4.1.5 in debian specs
+
+commit 190eb31d662462b6d3a44d81389500f935d28a70
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Tue Aug 5 13:10:34 2014 +0200
+
+    pua_xmpp: fixed wrong define guardian id
+    
+    (cherry picked from commit 6b833a82cb8c0978fae54afa086eff6d5479fa17)
+
+commit f83b5bc97f991bf357545b2fe10fa84725d24f9e
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Tue Aug 5 13:09:16 2014 +0200
+
+    pua: solved warning on comparing unsigned expression
+    
+    (cherry picked from commit 55b42c5ba9e78b1d6662d45f1b68898bc67548c9)
+
+commit 80ea39b93278e99b32e6d16f6bb76fefad3d691f
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Jul 21 10:10:45 2014 +0200
+
+    msilo: check if the register has contacts with positive expires value
+    
+    - otherwise is un-registration and no new contact to dump messages
+    - reported by Anthony Messina
+    
+    (cherry picked from commit 6559c4383858d472637807c6ec4dd1e0616507fa)
+
+commit 8671ba9b2c1626247d777c1d6fcbe25966d465da
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu Jul 17 19:13:42 2014 +0200
+
+    usrloc: refresh call-id value in case of update of location record
+    
+    - related to FS#448
+    
+    (cherry picked from commit c2b334bf41cbe6fa7b7e15d825dca1fa36c33770)
+
+commit 20a01c50c8a144c7edc838bea003b665469f4120
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Fri Jul 4 13:46:35 2014 +0200
+
+    usrloc: generate callid at startup and increase cseq for records added via mi
+    
+    - should fix FS#448, reported by Savolainen Dmitri
+    
+    (cherry picked from commit 66c497fdf4ac1c3b889a7c3b50c3e5fed770cf0b)
+
+commit 9a0d01daf296cbe78b29e8db00f0d4b3e9c6cdca
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Jun 30 14:37:40 2014 +0200
+
+    tmx: handle branch_route for $T_reply_code
+    
+    - use latest sent reply code
+    - related to the log message reported in FS#445
+    
+    (cherry picked from commit 2e28163f2f3e756c89f8cc43df0644be38c5e06f)
+
+commit 4b731cbb8426799377552c96f240a56ec528ef70
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Jun 30 12:34:24 2014 +0200
+
+    kamctl: use DEFAULT_Q variable in ul_add command
+    
+    (cherry picked from commit 8fac19ba52345a4dd10480ef4efb62012bbbbff6)
+
+commit a427c0ac7973c0321b9b6e2d7f70dd3fee5b5414
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Jun 30 12:11:45 2014 +0200
+
+    geoip: free allocated pointers at startup in case of error
+    
+    - cleaner shut down
+    
+    (cherry picked from commit 5db25855613f922059b53d7149e97b4985120de0)
+
+commit eb3f7cbc27fd678891910a14377ef0c5a3477bb0
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Jun 30 12:05:19 2014 +0200
+
+    core: reset cur_opt shortcut after use, it points to local variable
+    
+    - safety to prevent invalid access on future extensions
+    
+    (cherry picked from commit 1faf19fa7d34528b6cc15ffcb1ec91a6c6074e90)
+
+commit 4eb7b5b0d4b2d914f488d15d637e4448102d6d63
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Fri Jun 13 12:00:21 2014 +0200
+
+    dialog: backup and restore exiting route type when executing dialog event_route blocks
+    
+    - reported by Nuno Miguel Reis
+    
+    (cherry picked from commit 4fab97fb54334a55b1fce4e0d2f417fda5727c3a)
+
+commit 19b5458e616e4dde1bb7b23cfbae0388849539ee
+Author: Hugh Waite <hugh.waite at acision.com>
+Date:   Sat Jul 26 01:18:50 2014 +0100
+
+    tm: Generate synonym_id based on original request
+    
+    - Prevent allocating pkg memory in a shm-alloc'd copy
+    - Prevents a crash that can occur in requests with pre-3261 branch tags
+    (cherry picked from commit c5afbe15361bbf7e9493ad02dcabfd4c6d420109)
+
+commit 84c1ff056abf33c0ed8ed666d81d9e3e80cfaabb
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Jun 30 11:06:41 2014 +0200
+
+    uac: print new and old uri in log message in case of error
+    
+    (cherry picked from commit 6feeb886b58f4cd1cefeef132245c009bf8ca07f)
+
+commit 33d91eafaba5066ead247a61c76b18747a08da57
+Author: Ovidiu Sas <osas at voipembedded.com>
+Date:   Tue Jun 17 13:08:02 2014 -0400
+
+    auth: README regenerated
+
+commit b8cfbb2e5bb36f117cb0756339b58f71a97b70c0
+Author: Ovidiu Sas <osas at voipembedded.com>
+Date:   Tue Jun 17 11:47:50 2014 -0400
+
+    auth: document '-8' return code for pv_www_authenticate
+    (cherry picked from commit c9c8f8d71fdad33caebaea07922901618bcd7825)
+
+commit 77019552cf3e1d88b98620eedad2ce7fb4bbb469
+Author: Hugh Waite <hugh.waite at acision.com>
+Date:   Mon Jun 16 11:53:11 2014 +0100
+
+    registrar: Add check for contact header before checking outbound support
+    
+    - Fixes crash when processing REGISTER without a contact
+    (cherry picked from commit c9301c99d3c9acb663023cf02393d0e7ed74c133)
+
+commit 0f9258881ceceadabe57782ab5eb8f535b026f44
+Author: Victor Seva <linuxmaniac at torreviejawireless.org>
+Date:   Sun Jun 15 11:09:46 2014 +0200
+
+    pkg/kamailio/deb: Add Ubuntu trusty support
+
+commit 1710d4e1d80b712a00c93ae759efde22dea35f17
+Author: Victor Seva <linuxmaniac at torreviejawireless.org>
+Date:   Sat Jun 14 18:50:56 2014 +0200
+
+    pkg/kamailio/deb: Use gcj-jdk
+    
+    (cherry picked from commit 8d7d72add168c2fa592214853470f4a31515c510)
+
+commit c24508f80449a01165e65d4592cf77303054c36a
+Author: Victor Seva <linuxmaniac at torreviejawireless.org>
+Date:   Sat Jun 14 18:20:06 2014 +0200
+
+    app_java: Use generic libgcj
+    
+    (cherry picked from commit 00d2c27cbd0c36fd8979d5b92a3f860a5e657c60)
+
+commit 2198cb5d508055f495af29866045d51c1098d5cc
+Author: Ovidiu Sas <osas at voipembedded.com>
+Date:   Thu Jun 12 12:46:39 2014 -0400
+
+    core: fix crash related to core sockets_list  command
+     - reported by Nuno Reis <nreis at wavecom.pt>
+    (cherry picked from commit 1c715b1a2a66a4a15d1a8def33ef369212712bb1)
+
+
+===================== 2014-06-12 Version 4.1.4 Released =====================
+
+===================== Changes Since Version 4.1.3 ===========================
+
+commit d521dff2563ddd1f64fb0c93e7cbd7a6ad254159
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu Jun 12 15:57:57 2014 +0200
+
+    Makefile.defs: version set to 4.1.4
+
+commit a4f11987cd7fcabb68c377a6c61ab4238ec2cecc
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu Jun 12 15:56:58 2014 +0200
+
+    pkg/deb: version set to 4.1.4 in deb specs
+
+commit bd7e64b5c38db50f37bae250911e82808060a262
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu Jun 12 15:53:36 2014 +0200
+
+    pkg: updated version in fedora and centos specs
+
+commit a2bffd8aa6f97c2496c15c26fcb487f514b347de
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu Jun 12 15:51:17 2014 +0200
+
+    pkg/rpm: version set to 4.1.4 in rpm specs
+
+commit b634dbace0d0f8ecf061252423374a24288f9fe2
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu Jun 12 12:12:02 2014 +0200
+
+    acc: clear new parsed headers when evaluating acc attributes
+    
+    - the structures are in pkg, while request is taken from shm clone, can
+      cause reference to the space of another process
+    - reported by Igor Potjevlesch
+    
+    (cherry picked from commit e6c0c2f9871eab5a73371d48dfa24e4ece2512d8)
+
+commit 6c3c5b977941c605aa1be2ce582b3b843dbfcafe
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu Jun 12 11:48:01 2014 +0200
+
+    acc: allow recording to the rest of backends even when setting db table fails
+    
+    - such error doesn't affect radius or custom backends
+    
+    (cherry picked from commit 655711330b2ffd82dc84330ef0e0fbbad82a9160)
+
+commit be8fb6fa8a1492259a26abe4825653f1f66ff0d8
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu Jun 12 11:39:55 2014 +0200
+
+    auth: proper fixup for optional method parameter in pv_www_authenticate()
+    
+    - reported by Muhammad Shahzad
+    
+    (cherry picked from commit dd00819f7cca976e699a20960956abff760df957)
+
+commit b1ab677fe8977656c65112b558661673fdeb9f52
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu Jun 12 09:59:44 2014 +0200
+
+    core: sync definition of destroy_rpcs()
+    
+    - reported by Victor Seva
+    
+    (cherry picked from commit 28be6c3c79c02600f03a51b2393b289fbe8c9bd9)
+
+commit fbe73477eae716693a35615df1375dc16d7e65bb
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed Jun 11 17:12:37 2014 +0200
+
+    dialog: execute internal event_route blocks under local_route type
+    
+    - request_route type triggers additional script callbacks that could
+      reset the transaction and can cause crashing
+    - reported by  Nuno Miguel Reis, FS#440
+    
+    (cherry picked from commit 88a9ffee284338d536b6f7e072e5c99b29d983ee)
+
+commit fc7f840a91394d5896d54ad534d8b6c9c61ec553
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Fri May 30 13:34:08 2014 +0200
+
+    core/parse/sdp: proper parsing of a=rtpmap line
+    
+    - error handling when malformed line, avoiding crash to due to invalid
+      offsetting when clockrate is missing
+    - reported by  Michael Ricordeau, FS#435
+    
+    (cherry picked from commit c842bda9dac46724c58b734d092391c79867f2fb)
+
+commit c81c360315105e47f5fdd762ffb6490691c3c675
+Author: Olle E. Johansson <oej at edvina.net>
+Date:   Fri May 30 09:20:49 2014 +0100
+
+    auth_radius: Improve error message to simplify debugging
+    
+    (cherry picked from commit 6e51019b0a2c60178b9ca03b9bb2a5fef49ca7ba)
+
+commit 2f8f293242b7982b1ad843f5bfbcea22bf35027d
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed May 28 15:47:10 2014 +0200
+
+    pkg/rpm: use pkg memory size when checking config in init script
+    
+    - for large configs, check can fail due to low memory
+    
+    (cherry picked from commit 91a362e2f1bae90e2564491560aff8bad5b04564)
+
+commit 177723a58ee12b3cb239d993a28a063d694f3b02
+Author: Konstantin Mosesov <ez at voipgroup.org.ua>
+Date:   Sat May 24 05:58:19 2014 +0400
+
+    Fixed misstypes and indents in docs.
+    
+    (cherry picked from commit 5bede9a9a77ad01e06d849485d6ce4274eca3fd4)
+
+commit 8375c7f308a812b1e85768a663e039e9f2a70d1e
+Author: Konstantin Mosesov <ez at voipgroup.org.ua>
+Date:   Sat May 24 05:57:16 2014 +0400
+
+    Fixed bug with JAVA_HOME detection.
+    
+    (cherry picked from commit 5a05370f35bdeb7277b2f53f5c3e95fb672d4024)
+
+commit f2afd026ff9509151612c3b180b3d813e95484dc
+Author: Carsten Bock <carsten at ng-voice.com>
+Date:   Thu May 22 21:07:17 2014 +0200
+
+    Core: Bugfix: Do not reset tcp_listeners: We may only listen on TCP.
+    
+    (cherry picked from commit 9b9d15875aa09a5574ff0754309f4f77161d3194)
+
+commit 4267ba4cb15da135d4cd5543fb7f8d5f2f02ef9c
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed May 21 09:55:46 2014 +0200
+
+    core: allow listening on tls without listening on tcp
+    
+    - reported in FS#425
+    
+    (cherry picked from commit eea7f9d04090a736c8a0f2b2a350c08635cc8e39)
+
+commit 7453f5e3b10b4a257eb2e1e1650bfabc5f381ec5
+Author: Juha Heinanen <jh at tutpro.com>
+Date:   Tue May 20 16:22:58 2014 +0300
+
+    modules/siputils:  generate error message if parsing of is_gruu() uri fails
+    
+    (cherry picked from commit 365a60772de9c1d2f19ecf52b12f6d75b348e996)
+
+commit 93fb970b87216ea5f63b077f02bbe1c085ddc45c
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Tue May 20 09:16:01 2014 +0200
+
+    core: print number of parameters used for searching cfg function
+    
+    (cherry picked from commit a313a8d33afdee6c7eb70cd57161aef8e70c5bcf)
+
+commit a008e0f7d0920d061892819a121d1f07ba4b2a70
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu May 15 12:48:04 2014 +0200
+
+    core: use port 5061 for checking self when uri has transport tls
+    
+    - 5060 was used, failing to match myself condition
+    
+    (cherry picked from commit 2e55d7bd218c9f954da7d289ec1be090bb4d88b0)
+
+commit fdea08a522ed6d1e30b6b8eab0e74bc47078d57d
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu May 15 12:46:14 2014 +0200
+
+    topoh: match on all ports if none is in the uri for checking self
+    
+    - forcing default 5060 can fail for multi-listen case and tls
+    
+    (cherry picked from commit 1d90f4de94dfc887cc6129624fd5e6ad989abd37)
+
+commit a768ffa5a083bbddc35db59b2686046c000c0482
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed May 14 23:37:54 2014 +0200
+
+    kamcmd: proper size for memset, based on malloc
+    
+    (cherry picked from commit 7134959725011baa504a027c4561e0054dd907ae)
+
+commit 3c7e14f849884d5d145a7ab9c942acbbc9c5d282
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed May 14 23:12:33 2014 +0200
+
+    rls: proper header define guard and check of null returned value
+    
+    (cherry picked from commit 4f2da3e025fa281f88e80bb841a51d6546219ae8)
+
+commit 164b17f8677c3c877ffd697ec5fb40d0d81e12f8
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed May 14 23:08:06 2014 +0200
+
+    ipops: free dns pv structure on invalid pv name
+    
+    (cherry picked from commit e53c715c74fb5b58f4f68b81acb60de66b19b8cc)
+
+commit 386ef2f61d18966ceb70916869389f2690e0a6ef
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed May 14 23:03:19 2014 +0200
+
+    db_flatstore: free result before returning null on no more pkg
+    
+    - partial allocation when doing an incomplete new connection
+    
+    (cherry picked from commit 74743d6ef3bf74c1226ba5a1b6bebfbe19b06b93)
+
+commit c5c1002be8c4f3e24d1b79b77856db2879b97c72
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed May 14 22:56:37 2014 +0200
+
+    core: free previous allocated variable if no more pkg to build rve struct
+    
+    - cleaner shut down if not enough memory at startup
+    
+    (cherry picked from commit ace56c6bd2221920b965185c1c9a5997cd3f2768)
+
+commit 8c47852eff1b42727d56f9791a28525a23b25599
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed May 14 22:53:35 2014 +0200
+
+    pv: proper length for line transformation when handling last line of value
+    
+    (cherry picked from commit f1a09e44268c77641216a78878f2c73c6e5a4d66)
+
+commit 12a0a927aa3ad6dfbb18ab3fcf1927bf51098925
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon May 12 22:54:54 2014 +0200
+
+    dialog: if sending BYE fails at timeout, unref dialog
+    
+    - destroy dialog structures
+    
+    (cherry picked from commit e39a90e11bfed2b4445c37db1532488aa9e3e725)
+
+commit 3457dc459acd7eba96a0cb77e7d50cfc349c303e
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Sat May 3 21:06:34 2014 +0200
+
+    mem/q_malloc: free old pointer if allocation in realloc fails
+    
+    (cherry picked from commit 8c2888fcd33bee45cb4654222da619e70ed44ecc)
+
+commit ce46f5482f56378beba16c68d1e5af5e5d593008
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Sat May 3 21:03:34 2014 +0200
+
+    mem/f_malloc: free old pointer if allocation in realloc fails
+    
+    (cherry picked from commit 41a37b570758445d723d4d78b9786f8e6cb5722c)
+
+commit 2cfb00b4a24f24cd9462305f4518797706b8f6f1
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Fri May 2 23:58:12 2014 +0200
+
+    mem/f_malloc: check returned pointer for bitmask index
+    
+    - if null, reset slot and search on bigger chunks slots
+    
+    (cherry picked from commit 892a24f7256e60e2a0116655e0052c284479b7d2)
+
+commit 6e17d6e92c1e4b76fbea4b4b5d925ed67e4fdac7
+Author: Carlos Ruiz Diaz <carlos.ruizdiaz at gmail.com>
+Date:   Sun Apr 27 21:22:49 2014 -0500
+
+    cnxcc: fixed deadlock when call gets terminated under certain conditions
+    
+    - fixed some indentation problems introduced by Eclipse IDE
+    
+    (cherry picked from commit d0f0ba702bd44524bc9f52e07341db03267b15f7)
+
+commit 3997dcccf36579442cb92222fe0868accd64b537
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed Jun 11 19:01:17 2014 +0200
+
+    auth: enhanced log message when method param fails to be retrieved
+    
+    (cherry picked from commit 35329870fe22115fd24a396b743e4814278ce46a)
+
+commit 94ebfb5d5973ed59de84ca0e0c87052b4c80f9de
+Author: Torrey Searle <tsearle at gmail.com>
+Date:   Mon Jun 2 19:51:19 2014 +0200
+
+    srdb1: fix memory leak in db-id
+    
+    - When getting an existing connection from the pool, free the newly
+      created db-id as the pool connection already has a reference to the
+      existing one.  Fixes FS#436
+    (cherry picked from commit 69de17d3bb1d032f9a41752362194d718336e20d)
+
+commit 642428cf8be1c7355f91b14276e888ec505cd69a
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon May 19 08:56:38 2014 +0200
+
+    dialog: add wait-for-ack callback before response unref
+    
+    - in case of a sipral for ending in a negative response from initial
+      state, ack to second iteration can unref prematurely the dialog
+    - reported by Pawel Sternal, FS#427
+    
+    (cherry picked from commit d81fd1bf067b78b55ad348db2531c4ba9b10dddb)
+
+commit 7bdaca008e1bddbe9ab4db9d70e835ba45f6a5ff
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu May 29 17:06:13 2014 +0200
+
+    pv: safety check for PAI header parsed structure
+    
+    - reported by Igor Potjevlesch
+    
+    (cherry picked from commit e633ca6b7e748a77825d3208e86bf9bce18944a5)
+
+commit ad5235229f59ba5d1f4216e144291e110fee0211
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed May 14 23:28:24 2014 +0200
+
+    parser/sdp: assign stream var only if session is not null
+    
+    (cherry picked from commit 1cefc0c5f83eb4b7b6ffefc6ab383d7aae6de07f)
+
+commit 5cd3bd3a1bbcc9edffe31c0b1fdf11da43023b2c
+Author: Hugh Waite <hugh.waite at acision.com>
+Date:   Tue May 27 15:42:08 2014 +0100
+
+    rls: Fix memory leak with duplicate entries in lists
+    
+    - When duplicate detection is requested, free the string and container
+    - When duplicate detection is not requested, insert the duplicate anyway
+
+commit af4f84b84ca7601bd8124fe2e82d0718c7975313
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Tue May 27 12:07:42 2014 +0200
+
+    db_mysql: proper handling of mysql_next_result(...) return code
+    
+    - it indicates the presence of another result if return is 0
+    - reported by  Maxim (simax), FS#434
+    
+    (cherry picked from commit 37f0964278e925d5530563b38c82a57de1f7fa59)
+
+commit 9a697d04e7bb041e1ec6748727a418866dc0ba54
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon May 26 14:47:37 2014 +0200
+
+    auth_db: auth_check() to get the auth header from the used api
+    
+    - this avoids using a different auth header that might be in the request
+      before checking usernames in from/to headers against auth user
+    
+    (cherry picked from commit 4992519eed88d94847d742c52e882082b1b41264)
+
+commit 47a00936695c46176c3c047e0ab141b4127d08dc
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Sun May 18 19:07:38 2014 +0200
+
+    mtree: replace tree structure even there are no records in db table
+    
+    - reload didn't replaced old tree if no records in db table
+    - reported by Juha Heinanen
+    
+    (cherry picked from commit c36f326d3c7372b149592d438df75f3d7b0a0233)
+
+commit f44415eee52d5c17a9b6c5e16175bd84455e9867
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu May 15 13:59:03 2014 +0200
+
+    siputils: allocate enough space to hold ending zero for tel uri in tel2sip()
+    
+    - reported by Juha Heinanen
+    
+    (cherry picked from commit 7992a2b8d42bb7e8bcf1738cf042013ed126a47a)
+
+commit 9c15e8444e99f33ca2f0c920d3cbb846d407f596
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed May 14 09:58:50 2014 +0200
+
+    presence_dialoginfo: get rid of unused variables warning
+    
+    - priority and winning_priority are used in an alternative winning node
+      selection which is disabled now
+    - reported by Jua Heinanen
+    
+    (cherry picked from commit 4f4641ea2a4018a72558c40d4878e9af7053be2d)
+
+commit 402e2122d1aa353ee8c10321aa1eb9315a81cd81
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed Apr 16 19:43:45 2014 +0200
+
+    db_mysql: properly free db result structure if db_mysql_convert_result() fails
+    
+    - reported by Torrey Searle, FS#420
+    
+    (cherry picked from commit 37983c9f57536c57c5d34ce2d8a1c8f411e61e39)
+
+commit 74c1bd884ec2a3418dee3cbf358ab8bb7e899d7a
+Author: Vitaliy Aleksandrov <vitalik.voip at gmail.com>
+Date:   Thu May 8 15:01:02 2014 +0100
+
+    websocket: Fix crash in websocket module
+    
+    - Avoid race condition by maintaining a connection reference count
+    - Fixes FS#406
+
+commit cc4a7c67f24d105a119ea492ce53f017369af296
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu May 8 08:40:28 2014 +0200
+
+    presence_dialoginfo: interetate through all 'dialog' nodes of xml document
+    
+    - PUBLISH request can carry info for many dialogs
+    - reported and patch by Klaus Feichtinger
+    
+    (cherry picked from commit 7a827a612f93b9dd938f9b78c0de3ac2d98a0c77)
+
+commit b76eb77a36a5e751d792cb7e0d60f4750976e322
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Fri May 2 21:50:14 2014 +0200
+
+    dialog: copy dlg var value locally on get operation
+    
+    - reference to shared memory exposes risk on accessing an invalid
+      pointer if anothe process updates it
+    - reported by Dragos Oancea
+    
+    (cherry picked from commit bb3eed8aabea9f63c9922f71714aea242771db02)
+
+commit c5781b28cd92360cf163a84312fa72c08c4737b5
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Tue Apr 29 20:02:19 2014 +0200
+
+    rtmier: reset avps and xavp lists after route blocks execution
+    
+    - avoid leaks if someone is using avp/xavp with rtimer - there is a fake
+      message used there, thus not the normal sip message routing that
+      resets avps/xavps
+    
+    (cherry picked from commit 159978cf2a98748f3225155d8946bcbd768b51e3)
+
+commit 4455a13e8d31416dc44af455710fd7a7ff37ec11
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 28 13:51:56 2014 +0200
+
+    acc: no request is needed for setting end time on dialog termination
+    
+    - callback function cdr_on_end() doesn't use it at all
+    - reported by Eduardo Lejarreta, FS#256
+    
+    (cherry picked from commit 8fcdd23aaa49cb6c1ecb34c4c6b4a88078a860f7)
+
+commit 70f1b7479f80ca4f5e3a45fcf772785c110d0b57
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed Apr 30 21:46:55 2014 +0200
+
+    core: compute the len for dns srv name
+    
+    - fixes dns srv for cache, reported by Rob Eijgenraam, FS#426
+    
+    (cherry picked from commit b834cde74f8a4b41ec24ceb8332adff8bb3922bb)
+
+commit a9a3cebc7688dcaea7539c067c4b1bf3463040ce
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu Apr 24 18:02:34 2014 +0200
+
+    drouting: removed old contraint on route index
+    
+    (cherry picked from commit c3386295d7607a58d37a65b6822bf5f98b3fefa0)
+
+commit ee692ab89f1321ccfb24316c30fce5a90e6a9764
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 28 09:51:42 2014 +0200
+
+    pipelimit: run timer at 1000ms
+    
+    - proper execution on timer_interval
+    - reported by Julia <juliabo at gmail.com>
+    
+    (cherry picked from commit f9d95734ba7c04a0188077914161395c2e94f3eb)
+
+
+===================== 2014-04-24 Version 4.1.3 Released =====================
+
+===================== Changes Since Version 4.1.2 ===========================
+
+commit f6d59f24879de7f38e836e5d1fc58e3197ab7b07
+Author: Carsten Bock <carsten at ng-voice.com>
+Date:   Thu Mar 13 14:59:58 2014 +0100
+
+    carrierroute: Minor typo in previous fix
+    
+    (cherry picked from commit b17de9bdc53ae3474341e632f7faa89d69b667c8)
+
+commit 41c6b1d3f9bb874fd830c45976943439feaafda8
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu Apr 24 10:57:16 2014 +0200
+
+    pkg/rpm: set version to 4.1.3 in spec files
+
+commit c89716d8828f73c83cf91a4f03f0a16f3c6dd64e
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu Apr 24 10:56:41 2014 +0200
+
+    pkg/deb: set version to 4.1.3 in spec files
+
+commit a9898c08235d43353ff93ad20ab180ce2a40b745
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu Apr 24 10:56:04 2014 +0200
+
+    Makefile.defs: version set to 4.1.3
+
+commit f32354f9aae3afadca98e5a1cf254d9286a3a985
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed Apr 23 22:12:48 2014 +0200
+
+    tm: reset local lock reply status after functions that do unlock
+    
+    (cherry picked from commit 5943a8005baf8ce1239d2cf728373cb26975483a)
+
+commit be187e135b0b9b28136817c3569ab5c0abcc5b3f
+Author: Victor Seva <linuxmaniac at torreviejawireless.org>
+Date:   Fri Apr 18 22:15:31 2014 +0200
+
+    pkg/kamailio/deb: use libjson-c-dev when possible.
+    
+    (cherry picked from commit 118d3051bd1c84ba725c719dd6d86e8335d9c274)
+
+commit 080ad14a64834b7621bab3a0aa00e82d8de4490a
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Tue Apr 22 20:51:31 2014 +0200
+
+    sercmd: refactored reading the rest from socket on reply too long
+    
+    - patch by by Savolainen Dmitri, FS#422
+    
+    (cherry picked from commit fe9c519ca6ef6625f0b0d9c7027158641c636087)
+
+commit ef31388e6654a6006d680fd1363f95ae6f1e2f80
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Fri Apr 18 17:22:43 2014 +0200
+
+    sercmd: read the rest from socket if message was too big for rcv buffer
+    
+    - reported by Savolainen Dmitri, FS#422
+    
+    (cherry picked from commit 5bc9e43eb6827220468f526c3df9d4c775311e51)
+
+commit 73003a01e9cb1ed49b5fdb6f1758a988cd77f9bc
+Author: Carsten Bock <carsten at ng-voice.com>
+Date:   Thu Mar 13 14:52:49 2014 +0100
+
+    carrierroute: Remove dependency on libconfuse, based on the patch by Lucian Balaceanu with the Comments based on Marius Zbihlei
+
+commit bf2c130744a0d43767bb0745defd6a06073957c0
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Tue Apr 22 10:19:02 2014 +0200
+
+    sctp: enclose pre-init static function in between ifdef USE_SCTP
+    
+    - it is not used otherwise and some compilers can throw warnings
+    - reported by Juha Heinanen
+    
+    (cherry picked from commit 68f511f4972b8ac294b7429aadb27b22f2dfd554)
+
+commit f2df24d92707c89cd9e3d3c8e26dccdd1fa96cf8
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Tue Apr 22 10:12:21 2014 +0200
+
+    avpops: switched from initialize struct with {0} to memset
+    
+    - apparently gcc doesn't like it although it should be the standard
+    - clang is ok with it
+    - reported by Juha Heinanen
+    
+    (cherry picked from commit f0e8c293e28b3761d0f13e2c604eb1cfbbad7ace)
+
+commit ca2245a5526a88a02b5f9fc46f3f00bd6ed32929
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 21:53:27 2014 +0200
+
+    exec: free local variable if there is no more memory in next attempt
+    
+    (cherry picked from commit 314ea152c51cd8d4b46a49c05a3fed564c81c0ea)
+
+commit d7bdb23dcfa29a8883c5c2552ffe91bbef15a28f
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 21:52:16 2014 +0200
+
+    htable: init allocated memory after checking parameter
+    
+    - avoid useless operation and extra check for leak
+    
+    (cherry picked from commit 9f042bb2798f29d476148ab2887a05709d5258fc)
+
+commit 6c37ed696c6ce2ca4771dbd53afdad54480b7ecd
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 21:50:17 2014 +0200
+
+    mi_rpc: don't access fields in structure after free in mi_rpc_async_close()
+    
+    (cherry picked from commit f619a813ef46c76dd25c50b86f8af6cd768ac38f)
+
+commit 008e8bd7ce64ca2684c7145539342fe8898972b7
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 21:49:27 2014 +0200
+
+    nathelper: free local variable if getting anchor for contact header fails
+    
+    (cherry picked from commit f2d95b0e8326ae7d61b31288d3b695e1db85ec77)
+
+commit 90bcf7d040a599c251ff701244abf45d94051250
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 21:47:06 2014 +0200
+
+    rr: free forgotten allocated local variable trans in case of error
+    
+    (cherry picked from commit ed60b891f915017b385a722f2a9c0bf171802eab)
+
+commit 5cad9c8f2e933ffa097e9dfd2ca2fd2f2f7925e0
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 21:45:46 2014 +0200
+
+    sipcapture: free proper db_url field and destroy capture mode data list
+    
+    (cherry picked from commit 0a1acc7cbf21e2332ca25d94bb320a3b8708357c)
+
+commit 44f6bab76c83a48b4a827ab07ce35881ea3f4f56
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 21:44:42 2014 +0200
+
+    pv: removed mistaken pkg_malloc() left for $cnt()
+    
+    (cherry picked from commit b6b023038452a7cb1ded28bf82f81622b34ce201)
+
+commit 99aae469bedf5048f8651ab1b67da6acab1d103f
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 21:43:59 2014 +0200
+
+    textops: cleanup on error parsing methods at startup
+    
+    (cherry picked from commit cee4b58e1728be7de2c15ae25c4c1be0dd3088fb)
+
+commit f8be610bacc61ecd94741c33ea9fb7a9f2c5e231
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 21:43:05 2014 +0200
+
+    tls: free the file path clone when all went ok
+    
+    (cherry picked from commit 5fe289cae2ece412eeaec4efefcb411a7ed434aa)
+
+commit f1d15ec03ea2a4ad795a6e323770dc289017107a
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 21:41:59 2014 +0200
+
+    tm: clean contacts in case of failure in t_load_contacts()
+    
+    (cherry picked from commit 09ebe81a4ccb4346af778cc21c789b0db0e193d9)
+
+commit 66b646163a822b93ff3f4adf71308051e5079568
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 21:41:00 2014 +0200
+
+    xhttp: wrong variable was used for checking memory allocation
+    
+    (cherry picked from commit 8589936aac4a6341b4d56bfe2ed7d4d90a169d56)
+
+commit b1affbf3bb2686a9bb24ecde2742cd137cd53ada
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 21:40:15 2014 +0200
+
+    xlog: clean exit at startup in case on error looking up facility
+    
+    (cherry picked from commit 9f8f66c44f5d44f945bba3b63160967a19044b8b)
+
+commit 4d8d08dfba59a4a1d244d84bae020502d4cb5184
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 21:39:07 2014 +0200
+
+    core: proper destroy of tcp connection at shutdown
+    
+    - don't access connection fields after freeing structure
+    
+    (cherry picked from commit b3d312bc3795f394e5907ac54bb59560e829e38b)
+
+commit 94744ef0505268ea7e52a259f0f4636cb530e488
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:57:09 2014 +0200
+
+    core: safety check accessing variables in dbg message during fixup operation
+    
+    (cherry picked from commit 0bda1dc8238f6be5bc83711e0439dabff39c9120)
+
+commit ccba274c28bdc2c789d79a7c962bc76586dd62f1
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:56:01 2014 +0200
+
+    core: link regex before replacement field allocation can fail
+    
+    - regex will be freed properly if there was an error for replacement
+    
+    (cherry picked from commit 511de7f5dc047368799e18d028e1e3f2864e05ac)
+
+commit 90d00499d8a0786a0a62ad2e0b9990ffe3ca1b80
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:54:26 2014 +0200
+
+    core: check if proto is not null before setting it
+    
+    - coherent checking across no_naptr_srv_sip_resolvehost()
+    
+    (cherry picked from commit 3257da4abf7ea9cc64676ee66b6f70d600ac5c58)
+
+commit 7a1f99285d6c6b5eeeaf463923c4f9ff7ccff5e4
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:52:53 2014 +0200
+
+    core: safety check for freeing either pkg or shm values for var, when applicable
+    
+    - just an improvement to avoid doing both operations by mistake
+    
+    (cherry picked from commit 256b1e17e5449ef844b885d542a9c1f66fad044a)
+
+commit b418eaaadfda9be8acfe03342c584032a9d66884
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:52:07 2014 +0200
+
+    core: safety checks for pointer in dbg message printed inside dns cache
+    
+    (cherry picked from commit 2abbeb8fd31e41a34a013ff65eada197f171f321)
+
+commit 39290d29a46fb29e3030dead34e260ac4c663ff5
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:50:53 2014 +0200
+
+    core: free allocated memory in case of failing to get more for modparams
+    
+    - keep shutdown at startup error clean
+    
+    (cherry picked from commit b1106fb492a3e6e8ab73d37912b9a86d14373e75)
+
+commit 24ba3f86d29ffb250663e32c3d60592bb1f15c86
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:50:09 2014 +0200
+
+    core: safety check when declaring a cfg structure with empty content
+    
+    (cherry picked from commit 6f47c9ee24adea03df58e84d296e9682e5f81286)
+
+commit 5fbbdfb2d9632f0286d151d02a43ca81c5584956
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:48:16 2014 +0200
+
+    core: free line_buf in case of error building via
+    
+    - free buf in a very unlikely error converting src_ip to str in static
+      buffer
+    - coherent checking of msg pointer in the function
+    
+    (cherry picked from commit 3c062c1299dabd76e8461389b67506a25d1fcc02)
+
+commit 71165758575b606bea73c0caf55f861b9223ced9
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:46:36 2014 +0200
+
+    srutils/tmrec: reset pointer after free to avoid double deallocation
+    
+    (cherry picked from commit 69d43fbacdf121b6c3ab22686f9089d9c7859591)
+
+commit f10ffb4b3c2d1fb04f116ddf523caebbde9b561d
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:45:52 2014 +0200
+
+    db_text: fixed access after free and proper size for allocated memory
+    
+    (cherry picked from commit 6a82b6121f771b6b847aecf4c5a0c42d0388c5d0)
+
+commit b6f3b4dfca4640b9ade55a18013134e9f7785ee6
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:44:34 2014 +0200
+
+    call_control: replaced dynamic str* a local variable
+    
+    - it was freed afterwards and could leak in case of error hanling
+    
+    (cherry picked from commit af81862f5930d4c33639c204a7d88aeb484d3f0d)
+
+commit a3022d5525265e9cf41a41dc9f0d01a8865a922c
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:43:47 2014 +0200
+
+    avpops: initialize local variable to avoid warning on db ops function
+    
+    (cherry picked from commit 98bb8c7e5166d2ff494daa9c488073d16dcfb405)
+
+commit 376f909a7230a6dc8916c38964f99bda71252085
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:43:00 2014 +0200
+
+    acc: avoid memleak at startup when failing to initialize a custome accounting  engine
+    
+    (cherry picked from commit 33d001a91fae080546755f63101c9b05fdf49b22)
+
+commit 1b57ebef122f300bf3c5d10bc9e95f437287cf4a
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:42:04 2014 +0200
+
+    tls: avoid leaking duplicated file name on re-iteration
+    
+    - reset file name pointer to avoid double free in case of error handling
+    
+    (cherry picked from commit 74ae88f55dd4c1ed395bbb32a6c7a835de5775ee)
+
+commit 3fe7975909d577c015c94705b56e1c7647d51b22
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:40:27 2014 +0200
+
+    mem: remove trailing ; to allow using as single instruction in conditinal blocks
+    
+    - this is for system malloc with extra debug for private memory
+    
+    (cherry picked from commit 53642d60ff2a680f724d5f439cf2b868bd082c3e)
+
+commit 020572ade53a19815c9e05edc6e8eb77873ca465
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:39:50 2014 +0200
+
+    benchmark: avoid memory leaks when dealing with invalid mi commands
+    
+    (cherry picked from commit 89c48cda56a67bd99288f6f390802f14b340e6da)
+
+commit adb8ba7986f8ffda8cac44f573b7e0df6a7875b3
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:38:19 2014 +0200
+
+    auth_diameter: avoid double free in case of error and don't access freed pointer
+    
+    (cherry picked from commit d2f71f30011cb885f494e5d7d82ffdd15ff5dc7b)
+
+commit 340768948df423e25812d083fcdf09396ef763e3
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:36:01 2014 +0200
+
+    db_mysql: reset prev_token to avoid double free in case of url parse error
+    
+    - when db api v2 is used (ser modules)
+    
+    (cherry picked from commit f65bf2c37bfaae740dd3cd8d686308cfa44b42f2)
+
+commit 045b6ead1eace226ec316e3ae776f7bc35e54341
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:35:39 2014 +0200
+
+    db_mysql: remove line accessing freed result
+    
+    (cherry picked from commit e114105450d8a5152448afd28de16e290297e38d)
+
+commit 89b6c07409a81b88f131e14f9fcca1928b34347e
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:34:24 2014 +0200
+
+    debugger: check for define of PKG_MEMORY to execute pkg checks
+    
+    - allow compilation with system malloc for private memory
+    
+    (cherry picked from commit 17cc9b0054bd071cad478534e8615ba73c65cc29)
+
+commit ec542b2ae46391635032c4fe705dc05a2a5eebe4
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:30:40 2014 +0200
+
+    tm: release re for t_check_status(pv)
+    
+    - the canse when parameter is a variable and it contains a bad regex
+    
+    (cherry picked from commit 2f01858d0be09cecd5e21e3e10fdd9d6425be028)
+
+commit 773ee22645ecbf042a871b510fff77b967bccc4d
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 17:29:15 2014 +0200
+
+    tm: fixed typo in previous commit related to name of struct contact variable
+    
+    (cherry picked from commit 387c369a11730afe680fb32138b93d4024f5b88d)
+
+commit 8c2d3609a9300e8168dd6d8d8acdccfb41f2f150
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 14:08:10 2014 +0200
+
+    mem: DBG_SYS_MALLOC can be set to get verbose mem ops with system allocator
+    
+    - PKG_MEMORY has to be undefined in Makefile.defs
+    
+    (cherry picked from commit d8e242c64d6c3d167c5a2b326ec77727d6d38217)
+
+commit cde022bf36af39d6c5ad0e9f991a5db1a85933ef
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Apr 21 11:12:23 2014 +0200
+
+    tm: free struct contacts in case of error retrieving r-uri in t_load_contacts()
+    
+    (cherry picked from commit 770434e87ec14b9662314e8a13d587f547e876cb)
+
+commit ad169fc1c3a207670c4f3615258e3637127982d5
+Author: Timo Teräs <timo.teras at iki.fi>
+Date:   Mon Apr 21 10:57:11 2014 +0300
+
+    core: fix some #includes to be posix compliant
+    
+    sys/poll.h and sys/fcntl.h are GNUisms and might not exist on
+    strictly posix compliant systems. This fixes to use the posix
+    specified standard locations of these headers.
+    
+    E.g musl c-library will give warnings on using these non-standard
+    glibc 'internal' headers.
+    
+    (cherry picked from commit 2c74ba02c843349a6ad30f7e668a7a194dac679c)
+
+commit 59f1bb0a700a5b8d39ac56b76dc640a08fec86dc
+Author: Victor Seva <linuxmaniac at torreviejawireless.org>
+Date:   Sat Apr 19 11:06:48 2014 +0200
+
+    json|jsonrpc-c: fix detection of json-c lib
+    
+    (cherry picked from commit c290e58b7f50bdd7f9d691c4890baf1c9f74cb0d)
+
+commit 5a10b16b781806279756bb4b6bad5a79e3b689ec
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Sat Apr 19 00:35:57 2014 +0200
+
+    usrloc: fixed c&p error for variable name in ul_rpc_add()
+    
+    (cherry picked from commit c6246840abe0c75df03c603aa8e56f70a4799bce)
+
+commit 5fe5e4b337e665a8de1b763bc6310edfebdb51bc
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Sat Apr 19 00:35:00 2014 +0200
+
+    tmx: check if t is null or undefined for returning branch index
+    
+    (cherry picked from commit 37b0bea4ea6dcad3fbe1a2a93229bb1441ab8679)
+
+commit 577536ede7321f8aea31806e825738f19ff0a948
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Sat Apr 19 00:34:23 2014 +0200
+
+    tls: test if conection is still active for peer verification
+    
+    (cherry picked from commit 458b803efa2de5b1a3bcdd83400f6ef7c6fad2a0)
+
+commit 531c8459f700692a2a5b7e10d011cb5a32539f28
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Sat Apr 19 00:32:17 2014 +0200
+
+    textops: use local variable to copute the offset in buffer for hdr ops helper function
+    
+    - when a prefix was given (e.g., append_uri_hf()), it could have led to
+      usage of invalid value
+    
+    (cherry picked from commit 110882edfee749679e0b05528bd4e1bcfd2321b3)
+
+commit 01452997058ae07ee27f5e5e152a0f72d80a1dd8
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Sat Apr 19 00:31:23 2014 +0200
+
+    rr: coherent check for optional user part of advertised rr
+    
+    (cherry picked from commit 48c42830f8d9f5927453dc091765c2434845c725)
+
+commit 74f6b0e6493b30c53144c6ee157305e14e75a75a
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Sat Apr 19 00:30:02 2014 +0200
+
+    registrar: test returned value for socket when socket flag is set and xavp is used to hold it
+    
+    (cherry picked from commit 4dd1387aad64bc9380eeac744eb0ad07d5a591d4)
+
+commit 47b428cefd78e094c3ed4f86591072577236e5b3
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Sat Apr 19 00:28:56 2014 +0200
+
+    pv: return error if shm is not initialized when $shv() is used
+    
+    (cherry picked from commit bf6cb8e2dfedb5b8c6cc367ff6e8355a8313d887)
+
+commit ae0a3f7534c797b12188c650287a5ccc1fe4483f
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Sat Apr 19 00:27:54 2014 +0200
+
+    msilo: check to be sure len is positive before trying to copy string
+    
+    (cherry picked from commit a6cf59395c472b999d5cc4197de80cd9385dfd11)
+
+commit a6a8cf02373df4fe4e3afdd1f76dfb5e435fa4a8
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Sat Apr 19 00:26:53 2014 +0200
+
+    mqueue: use static var to return pointer to dynamic queue name
+    
+    (cherry picked from commit 6626f9a73700f9af8d46945e250fc8ab88f5aefe)
+
+commit cb9e54adabb51bd21402d6889e3169b919f14909
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Sat Apr 19 00:25:21 2014 +0200
+
+    dialplan: fixed typo in define for guarding .h file
+    
+    - init local variable to avoid warning
+    
+    (cherry picked from commit 53f67e60f491bb5b9f56ce010410de8eff23430a)
+
+commit 0b75d7263ffc3282572d60637c287771c8223f0d
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Sat Apr 19 00:24:16 2014 +0200
+
+    dialog: detect the param value type for setting by routing block
+    
+    (cherry picked from commit 69d67c01e03d1363948b3597bb2afdf3cd0145a2)
+
+commit 15f11641e58090f2a405d2231e6e15dfeaa4a231
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Sat Apr 19 00:22:52 2014 +0200
+
+    ctl: free allocated pointer in case of error
+    
+    (cherry picked from commit ccd1593834a47973bddeea94037fe8d3fd862cdd)
+
+commit 0d175cf7c20394d99a0c00602d3d19348da29a9f
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Sat Apr 19 00:21:50 2014 +0200
+
+    parser/contact: cleaned log messages and safety check for invalid iterator call
+    
+    (cherry picked from commit c1feccdba8f4c4b624b948595f9166b83e65ed6a)
+
+commit 5f28fd8637f7a0fa1ab866a96fd3564e9c14d7dd
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Sat Apr 19 00:21:09 2014 +0200
+
+    core: safety check for finding select final node
+    
+    (cherry picked from commit 58acedef5a7748310b1032b534c3174f1e3d1a62)
+
+commit c7ce1e3563f3eebe6960d619264e23982135e13b
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Sat Apr 19 00:20:19 2014 +0200
+
+    core: print rdata pointer and wrap null condition around it in dbg message
+    
+    (cherry picked from commit fcc6dbd6d9b50bdbee7ba22c22f8f06a98bfb2ca)
+
+commit e335fefcafac7c6403496638cf781a52d0959bed
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Fri Apr 18 19:01:22 2014 +0200
+
+    uac: safe initialization of vars and debug message for uac_replace_to()
+    
+    (cherry picked from commit a7251ba4140df3fa9b4fd3ea6a4d48ffbe156597)
+
+commit 9e47733d7346b2feddcfaf25eb61413ed4e0e48d
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Fri Apr 18 18:51:33 2014 +0200
+
+    textops: init s field of uri str structure for proper evaluation
+    
+    - otherwise can get uninitialized to last if block of
+      get_uri_and_skip_until_params()
+    
+    (cherry picked from commit a2513a2bc820f935c62f14749ddaefaf77951891)
+
+commit df4991af5bc1458b7781cfd36b95940cbc1cc4de
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Fri Apr 18 18:38:53 2014 +0200
+
+    textopsx: init local variable to avoid testing invalid value
+    
+    (cherry picked from commit f0186bf375d4653b5354df35a9a8d065b56522ee)
+
+commit 2375b7a8d4bc4a97ad6e749a51425f8be0ab446f
+Author: Victor Seva <linuxmaniac at torreviejawireless.org>
+Date:   Fri Apr 18 22:07:47 2014 +0200
+
+    json|jsonrpc-c: use new naming json-c lib if available
+    
+    (cherry picked from commit 679833f9f098e1ebc5e2b66978a5535af557924c)
+
+commit 135ff6c9e91747be42c957685ca5b3ebafb974ea
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Fri Apr 18 18:11:38 2014 +0200
+
+    core: added some safety checks for cfg framework pointers
+    
+    - avoid dereferencing null in corner cases
+    
+    (cherry picked from commit bf7b6c25cdefc2a6a473c6fe8f496c858e05d020)
+
+commit 3c686813c88ad575e7085351297f4d0ae4f2cfe1
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Fri Apr 18 10:49:24 2014 +0200
+
+    tm: lock replies before restoring flags for onreply_route
+    
+    (cherry picked from commit ac2e49b41840e0b05750b20c367a6c380caa983a)
+
+commit 75c75a5d2d4046276883c2677df1ef3cf0e29fb8
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu Apr 17 16:16:04 2014 +0200
+
+    tmx: properly receive the branch index for $T(...) in the branch_failure_route
+    
+    (cherry picked from commit 27c383c9224055e3d1b01238ff47785449e4057c)
+
+commit da5beb9839ea5a6a2e27dbe2fff8866b2d4d69ca
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu Apr 17 15:49:36 2014 +0200
+
+    dialog: set lower limit for dlg_ka_interval parameter to 30 sec
+    
+    - avoid many keepalives in shorter interval than retransmission timeout
+      could be
+    - an improvement would be to export the fr_timer value from tm and have
+      condition based on it
+    - reported by FS#417, Bill Radis
+    
+    (cherry picked from commit 5c5b587d44a46b3a4d48c7e7926c42a44cd4d8c8)
+
+commit 07c25fe8bf8425cdc7f909ea5b16670a65254ff9
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed Apr 16 08:41:51 2014 +0200
+
+    maxfwd: max_limit default value set to 70
+    
+    - recommended value by RFC
+    - lower value can create issues when terminating to PSTN/ISUP where
+      can be used to set the Hop Counter
+    - patch by Sebastian Damm, FS#418
+    
+    (cherry picked from commit 73c440e87fc256cda99ab572c0a259c13acac700)
+
+commit 3d8df518f78eefd706b6c98f1dd90e739d2fec39
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Sun Apr 13 22:19:15 2014 +0200
+
+    pv: use pv cache to lookup avp name for $cnt(...)
+    
+    (cherry picked from commit eb5b9c6965d1da46f8cb45d3ac2eb6598b3b6dea)
+
+commit 810fc8eb64ce9992e3b6fac668a442e92f7309dc
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Fri Apr 11 16:21:27 2014 +0200
+
+    tmrec: fixed typo in header file guard define
+    
+    (cherry picked from commit 3d9040bb5494bafe3411744da17bf43de6a22604)
+
+commit 3cbb00ecde32696c334384462b9e06b924d13244
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Fri Apr 11 16:18:59 2014 +0200
+
+    srdb1: removed extern inline function prototypes
+    
+    - the .c files are not linked against modules code, thus inline
+      replacing request cannot be resolved by compilers, the strict ones
+      (e.g., llvm) throw error
+    
+    (cherry picked from commit 5beb495d47fa16ed94c36e340011c09de50db9c7)
+
+commit 4b5683401a6521e4d80665112eb6bc35ee75baec
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Fri Apr 11 16:14:06 2014 +0200
+
+    cnxcc: inline functions defined in other objects throw warning in llvm
+    
+    - an option would be defining whole function inside the .h file
+    
+    (cherry picked from commit da0fe20153eb9fc4b8f79a2f5260cb871bb3fc0d)
+
+commit df80c0aa34fd5edf6c9fbcbf1e5e53b4fa0d7b2d
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Fri Apr 11 16:11:05 2014 +0200
+
+    srdb1: get rid of llvm warnings related to extern inline definitions
+    
+    (cherry picked from commit 4cb7abe093ce0c56a4661377f9792fc417f83786)
+
+commit adac3876d273ac2d32d684778d30f3aa36cc914d
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Fri Apr 11 16:04:24 2014 +0200
+
+    tmx: allow spanning over second for fetching stats
+    
+    - try to catch the same snapshot for all tm stats
+    - re-enabled stats for received and relayed replies, computed from what
+      is relayed and was was local reply
+    - todo: check if drops replies are caught later or is ok
+    
+    (cherry picked from commit 82e742fcdd7c22391cae8e3b36d42f23d684dee8)
+
+commit 64a1d6f6811870f7a148df24f09266917fe50d38
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu Apr 10 08:56:13 2014 +0200
+
+    tm: avoid tryin to mitigate relaying 487 for local canceling branches when a reply is forced from config
+    
+    - it can result in deadlock if there is a local retransmission timeout
+      and the response code is overwritten by admin in failure route with a
+      t_reply()
+    - reported by Jason Penton
+    
+    (cherry picked from commit 198e123e89c849da39efec1973c25c3c25a2be89)
+
+commit 4514fb1da03d0dfc006cbbe38ac3f4a78bd8fc4b
+Author: Fred Posner <fred at palner.com>
+Date:   Tue Apr 8 21:54:43 2014 +0200
+
+    sqlops: note about return value of query functions
+    
+    (cherry picked from commit 5ac454af6aedb91265c3359a523354541cabd161)
+
+commit e4ff5dac04eb09191e5185dae6146100e8772bef
+Author: Olle E. Johansson <oej at edvina.net>
+Date:   Thu Mar 27 17:31:51 2014 +0100
+
+    permissions: peer_tag_mode is integer, not string
+    
+    Fixing example in doc file
+    
+    (cherry picked from commit b745f5869e86bc7cce774dc4b54be9a1be90e3e5)
+
+commit e2adc92219884ca6efa56ecbc6f13911a9f52e77
+Author: Elena-Ramona Modroiu <ramona at asipto.com>
+Date:   Tue Mar 25 12:05:56 2014 +0100
+
+    kamdbctl: added rtpproxy table to the extra group
+    
+    - it was not listed at all, thus not created
+    
+    (cherry picked from commit 193431802ed1407bb66b722fbf6a5cc89d690a40)
+
+commit ca4cbf7e2929bd368f15bac148ffa6cbc9abb2d1
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Mar 24 22:53:22 2014 +0100
+
+    dialog: lock for updating the cseq
+    
+    - race can happen on processing two requests at the same time within
+      same dialog
+    
+    (cherry picked from commit 2376c833aad92bf8661f985d5917d952874a7509)
+
+commit 63afdda4fcf20156ad5db1be02481ab47404a602
+Author: Ovidiu Sas <osas at voipembedded.com>
+Date:   Mon Mar 24 16:01:44 2014 -0400
+
+    ctl: fix crash when listing in struc format
+     - example: kamcmd core.sockets_list
+    
+    (cherry picked from commit a95cae3fb6a62120b7fe2770fb565195178bb6f7)
+
+commit caf4111471f67eac2091b6a7be7b906a8ff964ad
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Mar 24 10:12:26 2014 +0100
+
+    db_unixodbc: free local variables in case of errors or no result
+    
+    - reported by Alex Villacís Lasso
+    
+    (cherry picked from commit edc78dfb148c22f0d256485193bbdb0185b76d2f)
+
+commit bbb2e1d021dfdb2b8499a614fda8d8e86e6d58e3
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Mon Mar 24 10:11:59 2014 +0100
+
+    db_unixodbc: use odbc_config to find paths for include and libs
+    
+    (cherry picked from commit a0ef714c12d9d9ae4cf152d6a62bd8a7d6bb5c34)
+
+commit e3b20d2d3753ed590c23cad1fe99bee3fa4501bc
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Tue Mar 18 17:10:56 2014 +0100
+
+    mtree: safety checks for column types and values
+    
+    - following the report FS#412 by adeel
+    
+    (cherry picked from commit 6c0370b806aebcdd6c7c000536be3d9ae6154837)
+
+commit bf9d5ab36fae1cd2b9a46357bde234b9b0a3e7cc
+Author: Richard Good <richard.good at smilecoms.com>
+Date:   Mon Mar 10 14:26:29 2014 +0200
+
+    modules/textopx: Prevent msg_apply_changes() from adding the router header if path is set.
+    	This avoids adding router header twice when calling msg_apply_changes
+    
+    (cherry picked from commit 45e6878a398f7ba75ce253a7bfcbb66bc7a5c088)
+
+commit 943a9ac9031aa69f7743accd68ab1268b3df1160
+Author: Luis Martin Gil <martingil.luis at gmail.com>
+Date:   Thu Apr 17 12:56:11 2014 +0000
+
+    Merge branch 'luismartingil/msrp_crash'
+    (cherry picked from commit 4a9a98a07869a2415b82b70b23907ccd490d6c12)
+
+commit a8b3660d0048fe81f2d8961c967fb839558c465a
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed Apr 16 12:14:44 2014 +0200
+
+    app_perl: print return code if perl_parse() failes
+    
+    (cherry picked from commit 6c5ebff42c1ee702ab4a859ffdd5ffeccbf8e11d)
+
+commit bebffc9a3a51083b0f93d664f27bd1d1afdc351a
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Tue Apr 15 18:53:34 2014 +0200
+
+    tm: fix condition added in previous commit testing xavp list addition to core
+    
+    (cherry picked from commit 09d136d053cde9a59c6f2937b8e1fa56f590fad0)
+
+commit 1c28c45facf8c87e805aff62e7f4da1a03c9aa8a
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Tue Apr 15 18:19:19 2014 +0200
+
+    tm: safety check for cases when xavps for serial forking fail to be added to root list
+    
+    - in error cases remove xavp group from the root list instead of local destroy, otherwise it
+      stays linked in root list and can cause invalid memory access
+    - discovered on investigating memory leak issue reported by Geoffrey M.
+    
+    (cherry picked from commit 4f95cfa6266bd66a1516629ed3445d98da433b2b)
+
+commit d921b452687a31ab49b7c5c4420c0c6134916140
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Tue Apr 15 17:50:52 2014 +0200
+
+    tm: free extra attributes stored in uac branch
+    
+    - credits to Geoffrey M. for reporting and giving access for
+      troubleshooting
+    
+    (cherry picked from commit c5e0bda5e20adeaa2a899fcc55ad12cf4678cf39)
+
+commit 2eed3023870f793b6824d091b75099bc9a82edf9
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Fri Apr 11 23:03:05 2014 +0200
+
+    dialog: proper detection of keepalive flag for destination
+    
+    - credit to Bill Radis, FS#416, for report and fix
+    
+    (cherry picked from commit 933a621f40eaa31b193e76f162f9cc016b49aeac)
+
+commit 35d83b91a8654a2218bf1ba900d7486fad189851
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Wed Apr 9 18:49:32 2014 +0200
+
+    uac: safety check to be sure the reg hash table is initialized
+    
+    - reported by Alex Villacís Lasso
+    
+    (cherry picked from commit b1900f66cc4acd254f1e6750538f31a3653fcd7f)
+
+commit d9f256f123a903b54a45122de99e59a9475dd272
+Author: Torrey Searle <tsearle at gmail.com>
+Date:   Mon Apr 7 09:43:11 2014 +0200
+
+    modules/sipt: Fix a bug in updating calling party
+    (cherry picked from commit 2da4dc5b0054f0182f67560fe15958565c0e360b)
+
+commit 66ca4828e9a04068410fb7d2137e6f0d4a7bf965
+Author: Juha Heinanen <jh at tutpro.com>
+Date:   Sat Apr 5 11:50:11 2014 +0300
+
+    Revert "modules/sdpops: added sdp_with_transport_like() function"
+    
+    This reverts commit a9b6cf96644589b462f02d009df768fece7e5c03.
+
+commit a9b6cf96644589b462f02d009df768fece7e5c03
+Author: Juha Heinanen <jh at tutpro.com>
+Date:   Sat Apr 5 11:28:34 2014 +0300
+
+    modules/sdpops: added sdp_with_transport_like() function
+
+commit 714413bf8f11bca5ff4966fcef12d5a03ae64ca2
+Author: Ovidiu Sas <osas at voipembedded.com>
+Date:   Tue Apr 1 18:34:28 2014 -0400
+
+    xhttp_pi: fix escaping
+    (cherry picked from commit dd004947906628784ffdf15a0fe5cf4421040ddc)
+
+commit 73ea61efec6b97fac7e2117dcde969b2cd549291
+Author: Carsten Bock <carsten at ng-voice.com>
+Date:   Sat Mar 22 16:49:20 2014 +0100
+
+    tls: Added note to docs about OpenSSL requirement for Elliptic Curve Diffie Hellman (ECDH)
+
+commit f8430785ec9c46b2535b2d29898853ee50cc76e0
+Author: Carsten Bock <carsten at ng-voice.com>
+Date:   Sat Mar 22 15:30:27 2014 +0100
+
+    tls: Add support for Elliptic-Curve Diffie-Hellman Ciphers (ECDH)
+
+commit 6245e35a43d68e074064ded56333d7784478b8c2
+Author: Ovidiu Sas <osas at voipembedded.com>
+Date:   Wed Mar 19 22:36:47 2014 -0400
+
+    xhttp_pi: fix copy/paste error that can lead to a crash when 'order_by_cols' are used
+    (cherry picked from commit 216faa86af3d6db70fae9186ab2776efc27a5f55)
+
+commit d6110528600bb6780e8be3b62b291fcecb60b02e
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu Mar 20 00:28:23 2014 +0100
+
+    doc: updated year and removed unused revhistory from bookinfo.xml
+    
+    (cherry picked from commit a99e71e609c9f703458ac4304d80c7078f46a129)
+
+commit d21e7fafc8384058d52d18147c96ef1fdcbee53f
+Author: Daniel-Constantin Mierla <miconda at gmail.com>
+Date:   Thu Mar 20 00:12:14 2014 +0100
+
+    lib/srdb1/schema: added docbook-xml target to Makefile
+    
+    - generate docbook for dbschema in xml format
+    
+    (cherry picked from commit 509570a29bbecd6839fcd858c17a20dc04383f23)
+
+commit 7cedfb5ee0bcc39113d3e3cea13d3fafa52ea2a0
+Author: Victor Seva <linuxmaniac at torreviejawireless.org>
+Date:   Thu Mar 13 00:14:47 2014 +0100
+
+    pkg/kamailio/deb: new kamailio-extra-modules package.
+    
+    Adding gzcompress module to extra.
+    
+    (cherry picked from commit a1de51c55d7bf31c7e9a793ec898073ab158b3cf)
+
+commit 376ee52aba344bfc8c617f6290ac15df48c83fe7
+Author: Henning Westerholt <hw at kamailio.org>
+Date:   Mon Feb 24 11:10:22 2014 +0100
+
+    pdb: remove internal reference, pointed out from Carsten Bock
+
+commit e397c90cb1cbc950b8d9166d57153f3790140f91
+Author: Henning Westerholt <hw at kamailio.org>
+Date:   Mon Feb 24 11:22:50 2014 +0100
+
+    pdb: move gitignore to own directory
+
+commit f828bbbac1e4e4e6650c3ef5732de6189d405b14
+Author: Henning Westerholt <hw at kamailio.org>
+Date:   Mon Feb 24 11:23:17 2014 +0100
+
+    pdb: remove pdb from global gitignore
+
+commit dfcaf12b49c0fefac9785306d2e57c80a6173103
+Author: Henning Westerholt <hw at kamailio.org>
+Date:   Mon Feb 24 11:23:42 2014 +0100
+
+    pdb: add debian init file
+
+commit 9ce73e20b7042c6a1249de39fd1fdf5489e01ab4
+Author: Corey Edwards <tensai at zmonkey.org>
+Date:   Sat Mar 8 11:28:36 2014 -0500
+
+    kamailio.init: fix typo: s/log_faiulre_msg/log_failure_msg/
+    (cherry picked from commit e22293d865926a200e336293692886f983904275)
+
+commit 18376e35ebbc1ba82fcce78c4eaa7f7b04e00aa8
+Author: Juha Heinanen <jh at tutpro.com>
+Date:   Fri Mar 7 23:54:05 2014 +0200
+
+    modules/xmlrpc: xmlrpc scalar <int> value can be positive or negative
+    (cherry picked from commit 67c2101fc60e4a963a6133f7a71f5faf510ca214)
+
+
 ===================== 2014-03-06 Version 4.1.2 Released =====================
 
 ===================== Changes Since Version 4.1.1 ===========================
diff --git a/INSTALL b/INSTALL
index 053b88a..b69b409 100644
--- a/INSTALL
+++ b/INSTALL
@@ -126,8 +126,6 @@ Requirements:
 - libsnmp9 - libs and devel headers - if you want SNMP client functionality 
   (SNMP AgentX subagent) for Kamailio
 - libldap libs and devel headers v2.1 or greater - if you want LDAP support
-- libconfuse and devel headers - if you want to compile the carrierroute
-  module
 - libpcre libs and devel headers - if you want to compile the lcr and dialplan
   modules
 - libsctp devel headers - if you want to compile the SCTP transport in the core
diff --git a/Makefile.defs b/Makefile.defs
index 37d921d..1bb0bdd 100644
--- a/Makefile.defs
+++ b/Makefile.defs
@@ -164,7 +164,7 @@ INSTALL_FLAVOUR=$(FLAVOUR)
 # version number
 VERSION = 4
 PATCHLEVEL = 1
-SUBLEVEL = 2
+SUBLEVEL = 5
 EXTRAVERSION =
 
 # memory manager switcher
diff --git a/autover.h b/autover.h
index 9b7256f..92ec53e 100644
--- a/autover.h
+++ b/autover.h
@@ -2,6 +2,6 @@
  * DO NOT EDIT IT
  */
 
-#define REPO_VER "6fa599"
-#define REPO_HASH "6fa599"
+#define REPO_VER "2b3d4b"
+#define REPO_HASH "2b3d4b"
 #define REPO_STATE ""
diff --git a/cfg.y b/cfg.y
index 195593b..04326e0 100644
--- a/cfg.y
+++ b/cfg.y
@@ -3269,7 +3269,8 @@ cmd:
 					LOG(L_ERR, "misused command %s\n", $1);
 					yyerror("Command cannot be used in the block\n");
 			} else {
-				LOG(L_ERR, "cfg. parser: failed to find command %s\n", $1);
+				LOG(L_ERR, "cfg. parser: failed to find command %s (params %ld)\n",
+						$1, mod_func_action->val[1].u.number);
 				yyerror("unknown command, missing loadmodule?\n");
 			}
 			free_mod_func_action(mod_func_action);
diff --git a/cfg/cfg.c b/cfg/cfg.c
index 0c4d404..a51d06b 100644
--- a/cfg/cfg.c
+++ b/cfg/cfg.c
@@ -46,6 +46,9 @@ int cfg_declare(char *group_name, cfg_def_t *def, void *values, int def_size,
 	cfg_group_t	*group;
 	int types;
 
+	if(def==NULL || def[0].name==NULL)
+		return -1;
+
 	/* check the number of the variables */
 	for (num=0; def[num].name; num++);
 
diff --git a/cfg/cfg_ctx.c b/cfg/cfg_ctx.c
index e0a18e7..1bf65b4 100644
--- a/cfg/cfg_ctx.c
+++ b/cfg/cfg_ctx.c
@@ -1068,7 +1068,7 @@ int cfg_commit(cfg_ctx_t *ctx)
 			group = changed->group;
 		}
 
-		if (!changed->group_id_set && changed->var->def->on_set_child_cb) {
+		if (changed->group && !changed->group_id_set && changed->var->def->on_set_child_cb) {
 			s.s = changed->group->name;
 			s.len = changed->group->name_len;
 			s2.s = changed->var->def->name;
@@ -1135,12 +1135,12 @@ int cfg_commit(cfg_ctx_t *ctx)
 
 				group_inst = NULL; /* fore the look-up of group_inst */
 			}
-			if (!group_inst || (group_inst->id != changed->group_id)) {
+			if (group && (!group_inst || (group_inst->id != changed->group_id))) {
 				group_inst = cfg_find_group(CFG_GROUP_META(block, group),
 								group->size,
 								changed->group_id);
 			}
-			if (!group_inst) {
+			if (group && !group_inst) {
 				LOG(L_ERR, "ERROR: cfg_commit(): global group instance %.*s[%u] is not found\n",
 					group->name_len, group->name, changed->group_id);
 				goto error;
diff --git a/cfg/cfg_struct.c b/cfg/cfg_struct.c
index 13c3c23..69b5235 100644
--- a/cfg/cfg_struct.c
+++ b/cfg/cfg_struct.c
@@ -1003,7 +1003,7 @@ error:
 	else
 		LOG(L_ERR, "ERROR: new_add_var(): failed to add the additional variable instance: %.*s[%u].%.*s\n",
 			group_name->len, group_name->s, group_id,
-			var_name->len, var_name->s);
+			(var_name)?var_name->len:0, (var_name&&var_name->s)?var_name->s:"");
 
 	if (add_var)
 		pkg_free(add_var);
diff --git a/cfg_parser.c b/cfg_parser.c
index fa8721b..594eb8e 100644
--- a/cfg_parser.c
+++ b/cfg_parser.c
@@ -732,7 +732,8 @@ int sr_cfg_parse(cfg_parser_t* st)
 			}
 
 			st->cur_opt = &t;
-			if (process_option(st, opt) < 0) return -1;
+			if (process_option(st, opt) < 0) { st->cur_opt = 0; return -1; }
+			st->cur_opt = 0;
 			break;
 
 		case '[': 
diff --git a/core_cmd.c b/core_cmd.c
index 304c49d..52150e9 100644
--- a/core_cmd.c
+++ b/core_cmd.c
@@ -936,7 +936,7 @@ static void core_sockets_list(rpc_t* rpc, void* c)
 						"proto", get_proto_name(proto),
 						"address", si->name.s);
 				if (!si->flags & SI_IS_IP)
-					rpc->struct_add(ha, "ss",
+					rpc->struct_add(ha, "s",
 						"ipaddress", si->address_str.s);
 				rpc->struct_add(ha, "sss",
 						"proto", si->port_no_str.s,
diff --git a/dns_cache.c b/dns_cache.c
index 41c93d8..029b445 100644
--- a/dns_cache.c
+++ b/dns_cache.c
@@ -2367,10 +2367,12 @@ retry:
 found:
 #ifdef DNS_CACHE_DEBUG
 	DBG("dns_srv_get_nxt_rr(%p, %lx, %d, %u): selected %d/%d in grp. %d"
-			" (rand_w=%d, rr=%p p=%d w=%d rsum=%d)\n",
+			" (rand_w=%d, rr=%p rd=%p p=%d w=%d rsum=%d)\n",
 		e, (unsigned long)*tried, *no, now, i, idx, n, rand_w, r_sums[i].rr,
-		((struct srv_rdata*)r_sums[i].rr->rdata)->priority,
-		((struct srv_rdata*)r_sums[i].rr->rdata)->weight, r_sums[i].r_sum);
+		(r_sums[i].rr)?r_sums[i].rr->rdata:0,
+		(r_sums[i].rr&&r_sums[i].rr->rdata)?((struct srv_rdata*)r_sums[i].rr->rdata)->priority:0,
+		(r_sums[i].rr&&r_sums[i].rr->rdata)?((struct srv_rdata*)r_sums[i].rr->rdata)->weight:0,
+		r_sums[i].r_sum);
 #endif
 	/* i is the winner */
 	*no=n; /* grp. start */
@@ -2654,7 +2656,6 @@ struct hostent* dns_srv_sip_resolvehost(str* name, unsigned short* port,
 	struct hostent* he;
 	struct ip_addr* ip;
 	static char tmp[MAX_DNS_NAME]; /* tmp. buff. for SRV lookups */
-	int len;
 	str srv_name;
 	char srv_proto;
 
@@ -2662,7 +2663,6 @@ struct hostent* dns_srv_sip_resolvehost(str* name, unsigned short* port,
 		/* not init or off => use normal, non-cached version */
 		return _sip_resolvehost(name, port, proto);
 	}
-	len=0;
 	if (proto){ /* makes sure we have a protocol set*/
 		if (*proto==0)
 			*proto=srv_proto=PROTO_UDP; /* default */
@@ -2706,7 +2706,7 @@ struct hostent* dns_srv_sip_resolvehost(str* name, unsigned short* port,
 			}
 
 			srv_name.s=tmp;
-			srv_name.len=len;
+			srv_name.len=strlen(tmp);
 			if ((he=dns_srv_get_he(&srv_name, port, dns_flags))!=0)
 				return he;
 		}
diff --git a/doc/stylesheets/dbschema_k/bookinfo.xml b/doc/stylesheets/dbschema_k/bookinfo.xml
index 936f648..68320ff 100644
--- a/doc/stylesheets/dbschema_k/bookinfo.xml
+++ b/doc/stylesheets/dbschema_k/bookinfo.xml
@@ -23,13 +23,7 @@
 		</editor>
 	</authorgroup>
 	<copyright>
-		<year>2007</year>
+		<year>2014</year>
 		<holder>&kamailio; development Team</holder>
 	</copyright>
-	<revhistory>
-		<revision>
-			<revnumber>$Revision: 4594 $</revnumber>
-			<date>$Date: 2008-08-06 12:08:33 +0200 (Mi, 06 Aug 2008) $</date>
-		</revision>
-	</revhistory>
 </bookinfo>
diff --git a/forward.h b/forward.h
index 4680a8e..f377546 100644
--- a/forward.h
+++ b/forward.h
@@ -84,6 +84,8 @@ inline static struct socket_info* get_send_socket(struct sip_msg* msg,
 }
 
 
+#define GET_URI_PORT(uri) ((uri)->port_no?(uri)->port_no:(((uri)->proto==PROTO_TLS)?SIPS_PORT:SIP_PORT))
+
 struct socket_info* get_out_socket(union sockaddr_union* to, int proto);
 typedef int (*check_self_f)(str* host, unsigned short port,
 		unsigned short proto);
diff --git a/io_wait.h b/io_wait.h
index b7ae925..8129842 100644
--- a/io_wait.h
+++ b/io_wait.h
@@ -63,7 +63,7 @@
 #endif
 
 #define _GNU_SOURCE  /* for POLLRDHUP on linux */
-#include <sys/poll.h>
+#include <poll.h>
 #include <fcntl.h>
 
 #ifdef HAVE_EPOLL
diff --git a/lib/srdb1/db.c b/lib/srdb1/db.c
index 3eea708..f717464 100644
--- a/lib/srdb1/db.c
+++ b/lib/srdb1/db.c
@@ -325,6 +325,8 @@ db1_con_t* db_do_init2(const str* url, void* (*new_connection)(), db_pooling_t p
 		pool_insert((struct pool_con*)con);
 	} else {
 		LM_DBG("connection %p found in pool\n", id);
+		free_db_id(id); // free the new id, as we use the pool instead
+		id = 0;
 	}
 
 	res->tail = (unsigned long)con;
diff --git a/lib/srdb1/db_res.c b/lib/srdb1/db_res.c
index 8d2146e..aa4b026 100644
--- a/lib/srdb1/db_res.c
+++ b/lib/srdb1/db_res.c
@@ -41,7 +41,7 @@
 /*
  * Release memory used by rows
  */
-inline int db_free_rows(db1_res_t* _r)
+int db_free_rows(db1_res_t* _r)
 {
 	int i;
 
@@ -70,7 +70,7 @@ inline int db_free_rows(db1_res_t* _r)
 /*
  * Release memory used by columns
  */
-inline int db_free_columns(db1_res_t* _r)
+int db_free_columns(db1_res_t* _r)
 {
 	int col;
 
@@ -106,7 +106,7 @@ inline int db_free_columns(db1_res_t* _r)
 /*
  * Create a new result structure and initialize it
  */
-inline db1_res_t* db_new_result(void)
+db1_res_t* db_new_result(void)
 {
 	db1_res_t* r = NULL;
 	r = (db1_res_t*)pkg_malloc(sizeof(db1_res_t));
@@ -123,7 +123,7 @@ inline db1_res_t* db_new_result(void)
 /*
  * Release memory used by a result structure
  */
-inline int db_free_result(db1_res_t* _r)
+int db_free_result(db1_res_t* _r)
 {
 	if (!_r)
 	{
@@ -143,7 +143,7 @@ inline int db_free_result(db1_res_t* _r)
  * Allocate storage for column names and type in existing
  * result structure.
  */
-inline int db_allocate_columns(db1_res_t* _r, const unsigned int cols)
+int db_allocate_columns(db1_res_t* _r, const unsigned int cols)
 {
 	RES_NAMES(_r) = (db_key_t*)pkg_malloc(sizeof(db_key_t) * cols);
 	if (!RES_NAMES(_r)) {
@@ -173,7 +173,7 @@ inline int db_allocate_columns(db1_res_t* _r, const unsigned int cols)
  * \param _res result set
  * \return zero on success, negative on errors
  */
-inline int db_allocate_rows(db1_res_t* _res)
+int db_allocate_rows(db1_res_t* _res)
 {
 	int len = sizeof(db_row_t) * RES_ROW_N(_res);
 	RES_ROWS(_res) = (struct db_row*)pkg_malloc(len);
diff --git a/lib/srdb1/db_res.h b/lib/srdb1/db_res.h
index 62fc11c..d802cc3 100644
--- a/lib/srdb1/db_res.h
+++ b/lib/srdb1/db_res.h
@@ -88,7 +88,7 @@ typedef struct db1_res {
  * \param _r the result that should be released
  * \return zero on success, negative on errors
  */
-extern inline int db_free_rows(db1_res_t* _r);
+int db_free_rows(db1_res_t* _r);
 
 
 /**
@@ -98,20 +98,20 @@ extern inline int db_free_rows(db1_res_t* _r);
  * \param _r the result that should be released
  * \return zero on success, negative on errors
  */
-extern inline int db_free_columns(db1_res_t* _r);
+int db_free_columns(db1_res_t* _r);
 
 
 /**
  * Create a new result structure and initialize it.
  * \return a pointer to the new result on success, NULL on errors
  */
-extern inline db1_res_t* db_new_result(void);
+db1_res_t* db_new_result(void);
 
 /**
  * Release memory used by a result structure.
  * \return zero on success, negative on errors
  */
-extern inline int db_free_result(db1_res_t* _r);
+int db_free_result(db1_res_t* _r);
 
 /**
  * Allocate storage for column names and type in existing result structure.
@@ -121,7 +121,7 @@ extern inline int db_free_result(db1_res_t* _r);
  * \param cols number of columns
  * \return zero on success, negative on errors
  */
-extern inline int db_allocate_columns(db1_res_t* _r, const unsigned int cols);
+int db_allocate_columns(db1_res_t* _r, const unsigned int cols);
 
 
 /**
@@ -129,6 +129,6 @@ extern inline int db_allocate_columns(db1_res_t* _r, const unsigned int cols);
  * \param _res result set
  * \return zero on success, negative on errors
  */
-extern inline int db_allocate_rows(db1_res_t* _res);
+int db_allocate_rows(db1_res_t* _res);
 
 #endif /* DB1_RES_H */
diff --git a/lib/srdb1/db_row.c b/lib/srdb1/db_row.c
index f832411..46cb893 100644
--- a/lib/srdb1/db_row.c
+++ b/lib/srdb1/db_row.c
@@ -39,7 +39,7 @@
 /*
  * Release memory used by row
  */
-inline int db_free_row(db_row_t* _r)
+int db_free_row(db_row_t* _r)
 {
 	int col;
 	db_val_t* _val;
@@ -108,7 +108,7 @@ inline int db_free_row(db_row_t* _r)
  * \param _row filled row
  * \return zero on success, negative on errors
  */
-inline int db_allocate_row(const db1_res_t* _res, db_row_t* _row)
+int db_allocate_row(const db1_res_t* _res, db_row_t* _row)
 {
 	int len = sizeof(db_val_t) * RES_COL_N(_res);
 	ROW_VALUES(_row) = (db_val_t*)pkg_malloc(len);
diff --git a/lib/srdb1/db_row.h b/lib/srdb1/db_row.h
index 6bee889..f41ad32 100644
--- a/lib/srdb1/db_row.h
+++ b/lib/srdb1/db_row.h
@@ -62,7 +62,7 @@ typedef struct db_row {
  * \param _r row that should be released
  * \return zero on success, negative on error
  */
-extern inline int db_free_row(db_row_t* _r);
+int db_free_row(db_row_t* _r);
 
 
 /**
@@ -71,6 +71,6 @@ extern inline int db_free_row(db_row_t* _r);
  * \param _row filled row
  * \return zero on success, negative on errors
  */
-extern inline int db_allocate_row(const db1_res_t* _res, db_row_t* _row);
+int db_allocate_row(const db1_res_t* _res, db_row_t* _row);
 
 #endif /* DB1_ROW_H */
diff --git a/lib/srdb1/schema/Makefile b/lib/srdb1/schema/Makefile
index b84ffb2..3bc39d2 100644
--- a/lib/srdb1/schema/Makefile
+++ b/lib/srdb1/schema/Makefile
@@ -195,6 +195,50 @@ db_sqlite:
 db_sqlite_clean:
 	- at rm -f $(SCHEME)/db_sqlite/*
 
+.PHONY: docbook-xml
+docbook-xml:
+	for FILE in $(TABLES); do \
+		XML_CATALOG_FILES=$(CATALOG) $(XSLTPROC) $(XSLTPROC_FLAGS) \
+		--stringparam dir "$(ROOT)/doc/databases/kamailio" \
+		--stringparam prefix "$$FILE-" \
+		$(DOCBOOK_XSL) kamailio-"$$FILE".xml ; \
+	done
+	# link all documents to one file, to get nicer output
+	echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" \
+		> "$(ROOT)/doc/databases/kamailio/tables.xml"
+	echo "<!DOCTYPE book PUBLIC \"-//OASIS//DTD DocBook XML V4.4//EN\"" \
+		>> "$(ROOT)/doc/databases/kamailio/tables.xml"
+	echo "        \"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd\" [" \
+		>> "$(ROOT)/doc/databases/kamailio/tables.xml"
+	#Include general documentation entities
+	echo "    <!ENTITY % docentities SYSTEM \"../../../docbook/entities.xml\">" \
+		>> "$(ROOT)/doc/databases/kamailio/tables.xml"
+	echo "    %docentities;" \
+		>> "$(ROOT)/doc/databases/kamailio/tables.xml"
+	echo "]>" \
+		>> "$(ROOT)/doc/databases/kamailio/tables.xml"
+	echo "<book xmlns:xi=\"http://www.w3.org/2001/XInclude\">" \
+		>> "$(ROOT)/doc/databases/kamailio/tables.xml"
+	# add bookinfo
+	cat "$(ROOT)/doc/stylesheets/dbschema_k/bookinfo.xml" | tail -n +2 \
+		>> "$(ROOT)/doc/databases/kamailio/tables.xml"
+	# actually include the entities
+	for FILE in $(wildcard $(ROOT)/doc/databases/kamailio/*-dbschema.xml); do \
+		echo "    <xi:include href=\"$$FILE\" />" \
+			>> "$(ROOT)/doc/databases/kamailio/tables.xml" ; \
+	done
+	echo "</book>" \
+		>> "$(ROOT)/doc/databases/kamailio/tables.xml"
+	# generate makefile
+	echo "docs = tables.xml" \
+		> "$(ROOT)/doc/databases/kamailio/Makefile"
+	echo \
+		>> "$(ROOT)/doc/databases/kamailio/Makefile"
+	echo "docbook_dir = ../../../docbook" \
+		>> "$(ROOT)/doc/databases/kamailio/Makefile"
+	echo "include \$$(docbook_dir)/Makefile" \
+		>> "$(ROOT)/doc/databases/kamailio/Makefile"
+
 .PHONY: docbook docbook_clean
 docbook:
 	for FILE in $(TABLES); do \
diff --git a/lib/srutils/tmrec.c b/lib/srutils/tmrec.c
index 78c2fc3..63e8373 100644
--- a/lib/srutils/tmrec.c
+++ b/lib/srutils/tmrec.c
@@ -343,6 +343,7 @@ int tr_byxxx_init(tr_byxxx_t *_bxp, int _nr)
 	if(!_bxp->req)
 	{
 		pkg_free(_bxp->xxx);
+		_bxp->xxx = NULL;
 		return -1;
 	}
 	
diff --git a/main.c b/main.c
index 05d431e..d8a3f89 100644
--- a/main.c
+++ b/main.c
@@ -1785,6 +1785,18 @@ static int calc_proc_no(void)
 			 tcp_e_listeners = tcp_cfg_children_no;
 	}
 	tcp_listeners += tcp_e_listeners;
+#ifdef USE_TLS
+	tcp_e_listeners = 0;
+	for (si=tls_listen, tcp_e_listeners=0; si; si=si->next) {
+		if(si->workers>0)
+			tcp_listeners += si->workers;
+		else {
+			if(tcp_listeners==0)
+				tcp_e_listeners = tcp_cfg_children_no;
+		}
+	}
+	tcp_listeners += tcp_e_listeners;
+#endif
 	tcp_children_no = tcp_listeners;
 #endif
 #ifdef USE_SCTP
diff --git a/mem/f_malloc.c b/mem/f_malloc.c
index 7a0e115..73918cf 100644
--- a/mem/f_malloc.c
+++ b/mem/f_malloc.c
@@ -375,9 +375,17 @@ void* fm_malloc(struct fm_block* qm, unsigned long size)
 	if (likely(hash>=0)){
 		if (likely(hash<=F_MALLOC_OPTIMIZE/ROUNDTO)) { /* return first match */
 			f=&(qm->free_hash[hash].first);
-			goto found;
+			if(likely(*f)) goto found;
+#ifdef DBG_F_MALLOC
+			MDBG(" block %p hash %d empty but no. is %lu\n", qm,
+					hash, qm->free_hash[hash].no);
+#endif
+			/* reset slot and try next hash */
+			qm->free_hash[hash].no=0;
+			fm_bmp_reset(qm, hash);
+			hash++;
 		}
-		/* if we are here we are searching for a "big" fragment
+		/* if we are here we are searching next hash slot or a "big" fragment
 		   between F_MALLOC_OPTIMIZE/ROUNDTO+1
 		   and F_MALLOC_OPTIMIZE/ROUNDTO + (32|64) - F_MALLOC_OPTIMIZE_FACTOR
 		   => 18 hash buckets on 32 bits and 50 buckets on 64 bits
@@ -692,12 +700,12 @@ void* fm_realloc(struct fm_block* qm, void* p, unsigned long size)
 			if (ptr){
 				/* copy, need by libssl */
 				memcpy(ptr, p, orig_size);
+			}
 	#ifdef DBG_F_MALLOC
-				fm_free(qm, p, file, func, line);
+			fm_free(qm, p, file, func, line);
 	#else
-				fm_free(qm, p);
+			fm_free(qm, p);
 	#endif
-			}
 			p=ptr;
 		}
 	}else{
diff --git a/mem/mem.h b/mem/mem.h
index 15bce11..65ea670 100644
--- a/mem/mem.h
+++ b/mem/mem.h
@@ -126,22 +126,29 @@
 #	endif
 #elif defined(SHM_MEM) && defined(USE_SHM_MEM)
 #	include "shm_mem.h"
-#	define pkg_malloc(s) shm_malloc((s))
-#	define pkg_free(p)   shm_free((p))
-#	define pkg_status()  shm_status()
-#	define pkg_sums()    shm_sums()
+#	define pkg_malloc(s)	shm_malloc((s))
+#	define pkg_relloc(p, s)	shm_malloc((p), (s))
+#	define pkg_free(p)		shm_free((p))
+#	define pkg_status()		shm_status()
+#	define pkg_sums()		shm_sums()
 #else
 #	include <stdlib.h>
 #	include "memdbg.h"
+#	ifdef DBG_SYS_MALLOC
 #	define pkg_malloc(s) \
 	(  { void *____v123; ____v123=malloc((s)); \
-	   MDBG("malloc %p size %lu end %p\n", ____v123, (unsigned long)(s), (char*)____v123+(s));\
+	   MDBG("malloc %p size %lu end %p (%s:%d)\n", ____v123, (unsigned long)(s), (char*)____v123+(s), __FILE__, __LINE__);\
 	   ____v123; } )
 #	define pkg_realloc(p, s) \
 	(  { void *____v123; ____v123=realloc(p, s); \
-	   MDBG("realloc %p size %lu end %p\n", ____v123, (unsigned long)(s), (char*)____v123+(s));\
+	   MDBG("realloc %p size %lu end %p (%s:%d)\n", ____v123, (unsigned long)(s), (char*)____v123+(s), __FILE__, __LINE__);\
 	    ____v123; } )
-#	define pkg_free(p)  do{ MDBG("free %p\n", (p)); free((p)); }while(0);
+#	define pkg_free(p)  do{ MDBG("free %p (%s:%d)\n", (p), __FILE__, __LINE__); free((p)); }while(0)
+#	else
+#	define pkg_malloc(s)		malloc((s))
+#	define pkg_realloc(p, s)	realloc((p), (s))
+#	define pkg_free(p)			free((p))
+#	endif
 #	define pkg_status()
 #	define pkg_sums()
 #endif
diff --git a/mem/q_malloc.c b/mem/q_malloc.c
index 8c36d03..ad0eaaa 100644
--- a/mem/q_malloc.c
+++ b/mem/q_malloc.c
@@ -653,12 +653,12 @@ void* qm_realloc(struct qm_block* qm, void* p, unsigned long size)
 				if (ptr){
 					/* copy, need by libssl */
 					memcpy(ptr, p, orig_size);
+				}
 	#ifdef DBG_QM_MALLOC
-					qm_free(qm, p, file, func, line);
+				qm_free(qm, p, file, func, line);
 	#else
-					qm_free(qm, p);
+				qm_free(qm, p);
 	#endif
-				}
 				p=ptr;
 			}
 	}else{
diff --git a/modparam.c b/modparam.c
index 01b91ce..c7fd1ac 100644
--- a/modparam.c
+++ b/modparam.c
@@ -124,6 +124,8 @@ int set_mod_param_regex(char* regex, char* name, modparam_t type, void* val)
 							*((char**)ptr) = pkg_malloc(strlen((char*)val2)+1);
 							if (!*((char**)ptr)) {
 								LOG(L_ERR, "set_mod_param_regex(): No memory left\n");
+								regfree(&preg);
+								pkg_free(reg);
 								return -1;
 							}
 							strcpy(*((char**)ptr), (char*)val2);
@@ -133,6 +135,8 @@ int set_mod_param_regex(char* regex, char* name, modparam_t type, void* val)
 							((str*)ptr)->s = pkg_malloc(((str*)val2)->len+1);
 							if (!((str*)ptr)->s) {
 								LOG(L_ERR, "set_mod_param_regex(): No memory left\n");
+								regfree(&preg);
+								pkg_free(reg);
 								return -1;
 							}
 							memcpy(((str*)ptr)->s, ((str*)val2)->s, ((str*)val2)->len);
diff --git a/modules/acc/acc_cdr.c b/modules/acc/acc_cdr.c
index 68792e9..3cab762 100644
--- a/modules/acc/acc_cdr.c
+++ b/modules/acc/acc_cdr.c
@@ -569,7 +569,7 @@ static void cdr_on_end( struct dlg_cell* dialog,
                         int type,
                         struct dlg_cb_params* params)
 {
-    if( !dialog || !params || !params->req)
+    if( !dialog || !params)
     {
         LM_ERR("invalid values\n!");
         return;
diff --git a/modules/acc/acc_logic.c b/modules/acc/acc_logic.c
index 18437fc..fa6cd8c 100644
--- a/modules/acc/acc_logic.c
+++ b/modules/acc/acc_logic.c
@@ -426,6 +426,7 @@ static inline void acc_onreply( struct cell* t, struct sip_msg *req,
 {
 	str new_uri_bk;
 	int br = -1;
+	hdr_field_t *hdr;
 
 	/* acc_onreply is bound to TMCB_REPLY which may be called
 	   from _reply, like when FR hits; we should not miss this
@@ -466,9 +467,9 @@ static inline void acc_onreply( struct cell* t, struct sip_msg *req,
 	if (is_db_acc_on(req)) {
 		if(acc_db_set_table_name(req, db_table_acc_data, &db_table_acc)<0) {
 			LM_ERR("cannot set acc db table name\n");
-			return;
+		} else {
+			acc_db_request(req);
 		}
-		acc_db_request(req);
 	}
 #endif
 #ifdef RAD_ACC
@@ -488,6 +489,19 @@ static inline void acc_onreply( struct cell* t, struct sip_msg *req,
 		req->new_uri = new_uri_bk;
 		req->parsed_uri_ok = 0;
 	}
+
+	/* free header's parsed structures that were added by resolving acc attributes */
+	for( hdr=req->headers ; hdr ; hdr=hdr->next ) {
+		if ( hdr->parsed && hdr_allocs_parse(hdr) &&
+		(hdr->parsed<(void*)t->uas.request ||
+		hdr->parsed>=(void*)t->uas.end_request)) {
+			/* header parsed filed doesn't point inside uas.request memory
+			 * chunck -> it was added by resolving acc attributes -> free it as pkg */
+			DBG("removing hdr->parsed %d\n", hdr->type);
+			clean_hdr_field(hdr);
+			hdr->parsed = 0;
+		}
+	}
 }
 
 
diff --git a/modules/acc/acc_mod.c b/modules/acc/acc_mod.c
index 2fb9258..7b30e4c 100644
--- a/modules/acc/acc_mod.c
+++ b/modules/acc/acc_mod.c
@@ -847,7 +847,10 @@ static int acc_register_engine(acc_engine_t *eng)
 	memcpy(e, eng, sizeof(acc_engine_t));
 
 	if(acc_init_engine(e)<0)
+	{
+		pkg_free(e);
 		return -1;
+	}
 
 	e->next = _acc_engines;
 	_acc_engines = e;
diff --git a/modules/app_java/Makefile b/modules/app_java/Makefile
index 68b8f8a..ca854ed 100644
--- a/modules/app_java/Makefile
+++ b/modules/app_java/Makefile
@@ -17,8 +17,17 @@ LIBS += $(shell pkg-config libgcj-4.4 --cflags) -L$(JVM_PATH) -ljvm
 else
 # try to detect JAVA_HOME
 JAVA_HOME ?= $(shell readlink -f /usr/bin/javac | sed "s:bin/javac::")
-DEFS += $(shell pkg-config libgcj12 --cflags) -I$(JAVA_HOME)/include
-LIBS += $(shell pkg-config libgcj12 --libs) -L$(JAVA_HOME)/lib  -ljvm
+DEFS += $(shell pkg-config libgcj --cflags) -I$(JAVA_HOME)/include
+LIBS += $(shell pkg-config libgcj --libs) -L$(JAVA_HOME)/lib  -ljvm
+
+# On Debian 7.5 there is a bug with JAVA_HOME detection.
+# $(shell readlink -f /usr/bin/javac | sed "s:bin/javac::") points to perl wrapper script (/usr/bin/gcj-wrapper-4.7)
+# whereas the real compiler is at /usr/bin/gcj-4.7. As the result, JAVA_HOME will not be a directory, that is incorrect.
+# At this point I don't see any universal method as explicit setting this variable at the compile phase.
+# -- ez
+ifeq ($(shell [ -d "${JAVA_HOME}" -a -f "$(JAVA_HOME)/include/jni.h" -a -f "$(JAVA_HOME)/lib/libjvm.so" ] && echo 1 || echo 0),0)
+    $(error Can't locate Java Development Kit. You have to specify environment JAVA_HOME to build app_java)
+endif
 
 ifeq ($(OS), freebsd)
 LIBS+=-pthread
diff --git a/modules/app_java/doc/app_java.xml b/modules/app_java/doc/app_java.xml
index 0360392..17800cc 100644
--- a/modules/app_java/doc/app_java.xml
+++ b/modules/app_java/doc/app_java.xml
@@ -6,7 +6,6 @@
 <!-- Include general documentation entities -->
 <!ENTITY % docentities SYSTEM "../../../docbook/entities.xml">
 %docentities;
-
 ]>
 
 <book xmlns:xi="http://www.w3.org/2001/XInclude">
@@ -15,8 +14,8 @@
 	<productname class="trade">&kamailioname;</productname>
 	<authorgroup>
 	    <author>
-			<firstname>Konstantin</firstname>
-			<surname>Mosesov</surname>
+		<firstname>Konstantin</firstname>
+		<surname>Mosesov</surname>
 	    </author>
 	    <editor>
 	    	<firstname>Konstantin</firstname>
@@ -25,11 +24,12 @@
 	</authorgroup>
 	<copyright>
 	    <year>2013</year>
-		<holder>Konstantin Mosesov</holder>
+	    <year>2014</year>
+	    <holder>Konstantin Mosesov</holder>
 	</copyright>
     </bookinfo>
     <toc></toc>
     
-	<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="app_java_admin.xml"/>
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="app_java_admin.xml"/>
     
 </book>
diff --git a/modules/app_java/doc/app_java_admin.xml b/modules/app_java/doc/app_java_admin.xml
index f69f8ee..43f9fa1 100644
--- a/modules/app_java/doc/app_java_admin.xml
+++ b/modules/app_java/doc/app_java_admin.xml
@@ -88,8 +88,8 @@
 	<section>
 		<title>Java runtime</title>
 		<section>
-			<title/>
-			<para>Java runtime library (JRE or JDK) is required to use this module.</para>
+			<title>JRE or JDK is required to use this module</title>
+			<para>Java runtime library (JRE and JDK for building app_java) is required to use this module.</para>
 		</section>
 	</section>
 	<!-- end of section Java Runtime -->
@@ -166,7 +166,9 @@ modparam("app_java", "java_options", "-Djava.compiler=NONE")
 				<programlisting format="linespecific">
 ...
 # Assumes "application java folder" is located at /opt/kamailio/java
-modparam("app_java", "java_options", "-Djava.compiler=NONE -Djava.class.path=/path/to/kamailio/modules:/opt/kamailio/java:/opt/kamailio/java/kamailio.jar")
+modparam("app_java", "java_options", "-Djava.compiler=NONE 
+    -Djava.class.path=/path/to/kamailio/modules:/opt/kamailio/java:
+    /opt/kamailio/java/kamailio.jar")
 ...
 </programlisting>
 			</example>
@@ -175,7 +177,9 @@ modparam("app_java", "java_options", "-Djava.compiler=NONE -Djava.class.path=/pa
 				<programlisting format="linespecific">
 ...
 # Assumes "application java folder" is located at /opt/kamailio/java
-modparam("app_java", "java_options", "-verbose:gc,class,jni -Djava.compiler=NONE -Djava.class.path=/path/to/kamailio/modules:/opt/kamailio/java:/opt/kamailio/java/kamailio.jar")
+modparam("app_java", "java_options", "-verbose:gc,class,jni 
+    -Djava.compiler=NONE -Djava.class.path=/path/to/kamailio/modules:
+    /opt/kamailio/java:/opt/kamailio/java/kamailio.jar")
 ...
 </programlisting>
 			</example>
@@ -184,7 +188,9 @@ modparam("app_java", "java_options", "-verbose:gc,class,jni -Djava.compiler=NONE
 				<programlisting format="linespecific">
 ...
 # Assumes "application java folder" is located at /opt/kamailio/java
-modparam("app_java", "java_options", "-Xdebug -verbose:gc,class,jni -Djava.compiler=NONE -Djava.class.path=/path/to/kamailio/modules:/opt/kamailio/java:/opt/kamailio/java/kamailio.jar")
+modparam("app_java", "java_options", "-Xdebug -verbose:gc,class,jni 
+    -Djava.compiler=NONE -Djava.class.path=/path/to/kamailio/modules:
+    /opt/kamailio/java:/opt/kamailio/java/kamailio.jar")
 ...
 </programlisting>
 			</example>
@@ -240,7 +246,8 @@ modparam("app_java", "force_cmd_exec", 1)
 		object       L 
 		short        S 
 		void         V 
-		Note that to specify an object, the "L" is followed by the object's class name and ends with a semi-colon, ';' .
+		Note that to specify an object, the "L" is followed by the 
+		object's class name and ends with a semi-colon, ';' .
     			</programlisting>
 			</para>
     		<para> app_java supports the following signatures:
@@ -263,7 +270,8 @@ modparam("app_java", "force_cmd_exec", 1)
 	Parameters are optional, ommitting a parameter meant the passed value is NULL.
 	Parameters count should be exactly the same as signature count.
 	Note 1: Arrays representation (symbol '[') is not supported yet.
-	Note 2: You shall use a correct signature, e.g. the following examples of combinations are invalid:    
+	Note 2: You shall use a correct signature, e.g. the following examples of
+	combinations are invalid:
     	java_method_exec("ExampleMethod", "ZI", "False");
         java_method_exec("ExampleMethod", "LI", "something", "5");
 </programlisting>
@@ -293,8 +301,8 @@ java_method_exec("ExampleMethod", "V");
 # Java
 public int ExampleMethod()
 {
-		... do something;
-		return 1;
+    ... do something;
+    return 1;
 }
 </programlisting>
 			    	</example>
@@ -316,8 +324,8 @@ java_method_exec("ExampleMethod", "Ljava/lang/String;I", "$mb", "$ml");
 # Java
 public int ExampleMethod(String SipMessageBuffer, int SipMessageLenght)
 {
-		... do something with buffer;
-		return 1;
+    ... do something with buffer;
+    return 1;
 }
 </programlisting>
 	    			</example>
@@ -339,11 +347,12 @@ java_method_exec("ExampleMethod", "ZB", "true", "0x05");
 # Java
 public int ExampleMethod(boolean flagSet, byte bFlag);
 {
-		if (flagSet)
-		{
-			... do something with flags;
-		}
-		return 1;
+    if (flagSet)
+    {
+        ... do something with flags;
+    }
+
+    return 1;
 }
 </programlisting>
     				</example>
@@ -373,8 +382,8 @@ java_staticmethod_exec("ExampleMethod", "V");
 # Java
 public static int ExampleMethod()
 {
-		... do something;
-		return 1;
+    ... do something;
+    return 1;
 }
 </programlisting>
     				</example>
@@ -396,8 +405,8 @@ java_staticmethod_exec("ExampleMethod", "Ljava/lang/String;I", "$mb", "$ml");
 # Java
 public static int ExampleMethod(String SipMessageBuffer, int SipMessageLenght)
 {
-		... do something with buffer;
-		return 1;
+    ... do something with buffer;
+    return 1;
 }
 </programlisting>
     				</example>
@@ -419,11 +428,12 @@ java_staticmethod_exec("ExampleMethod", "ZB", "true", "0x05");
 # Java
 public static int ExampleMethod(boolean flagSet, byte bFlag);
 {
-		if (flagSet)
-		{
-			... do something with flags;
-		}
-		return 1;
+    if (flagSet)
+    {
+        ... do something with flags;
+    }
+
+    return 1;
 }
 </programlisting>
     				</example>
@@ -454,8 +464,8 @@ java_s_method_exec("ExampleMethod", "V");
 # Java
 public synchronized int ExampleMethod()
 {
-		... do something;
-		return 1;
+    ... do something;
+    return 1;
 }
 </programlisting>
     				</example>
@@ -477,8 +487,8 @@ java_s_method_exec("ExampleMethod", "Ljava/lang/String;I", "$mb", "$ml");
 # Java
 public synchronized int ExampleMethod(String SipMessageBuffer, int SipMessageLenght)
 {
-		... do something with buffer;
-		return 1;
+    ... do something with buffer;
+    return 1;
 }
 </programlisting>
     				</example>
@@ -500,11 +510,12 @@ java_s_method_exec("ExampleMethod", "ZB", "true", "0x05");
 # Java
 public synchronized int ExampleMethod(boolean flagSet, byte bFlag);
 {
-		if (flagSet)
-		{
-			... do something with flags;
-		}
-		return 1;
+    if (flagSet)
+    {
+        ... do something with flags;
+    }
+
+    return 1;
 }
 </programlisting>
     				</example>
@@ -535,8 +546,8 @@ java_s_staticmethod_exec("ExampleMethod", "V");
 # Java
 public static synchronized int ExampleMethod()
 {
-		... do something;
-		return 1;
+    ... do something;
+    return 1;
 }
 </programlisting>
     				</example>
@@ -558,8 +569,8 @@ java_s_staticmethod_exec("ExampleMethod", "Ljava/lang/String;I", "$mb", "$ml");
 # Java
 public static synchronized int ExampleMethod(String SipMessageBuffer, int SipMessageLenght)
 {
-		... do something with buffer;
-		return 1;
+    ... do something with buffer;
+    return 1;
 }
 </programlisting>
     				</example>
@@ -581,11 +592,12 @@ java_s_staticmethod_exec("ExampleMethod", "ZB", "true", "0x05");
 # Java
 public static synchronized int ExampleMethod(boolean flagSet, byte bFlag);
 {
-		if (flagSet)
-		{
-			... do something with flags;
-		}
-		return 1;
+    if (flagSet)
+    {
+        ... do something with flags;
+    }
+
+    return 1;
 }
 </programlisting>
     				</example>
@@ -616,25 +628,25 @@ import org.siprouter.NativeInterface.*;
 
 public class Kamailio extends NativeMethods
 {
-		/* Here you should specify a full path to app_java.so */
-		static
-		{
-				System.load("/opt/kamailio/lib/kamailio/modules/app_java.so");
-		}
-
-		/* Constructor. Do not remove !!! */
-		public Kamailio()
-		{
-		}
-
-		/*
-		This method should be executed for each children process, immediately after forking.
-		Required. Do not remove !!!
-		*/
-		public int child_init(int rank)
-		{
-				return 1;
-		}
+    /* Here you should specify a full path to app_java.so */
+    static
+    {
+        System.load("/opt/kamailio/lib/kamailio/modules/app_java.so");
+    }
+
+    /* Constructor. Do not remove !!! */
+    public Kamailio()
+    {
+    }
+
+    /*
+        This method should be executed for each children process, immediately after forking.
+	Required. Do not remove !!!
+    */
+    public int child_init(int rank)
+    {
+	return 1;
+    }
 }
 </programlisting>
     		</example>
diff --git a/modules/app_perl/app_perl_mod.c b/modules/app_perl/app_perl_mod.c
index 3948bbe..625fec3 100644
--- a/modules/app_perl/app_perl_mod.c
+++ b/modules/app_perl/app_perl_mod.c
@@ -209,6 +209,7 @@ PerlInterpreter *parser_init(void) {
 	int modpathset_start = 0;
 	int modpathset_end = 0;
 	int i;
+	int pr;
 
 	new_perl = perl_alloc();
 
@@ -249,8 +250,9 @@ PerlInterpreter *parser_init(void) {
 	argv[argc] = filename; /* The script itself */
 	argc++;
 
-	if (perl_parse(new_perl, xs_init, argc, argv, NULL)) {
-		LM_ERR("failed to load perl file \"%s\".\n", argv[argc-1]);
+	pr=perl_parse(new_perl, xs_init, argc, argv, NULL);
+	if (pr) {
+		LM_ERR("failed to load perl file \"%s\" with code %d.\n", argv[argc-1], pr);
 		if (modpathset_start) {
 			for (i = modpathset_start; i <= modpathset_end; i++) {
 				pkg_free(argv[i]);
diff --git a/modules/auth/README b/modules/auth/README
index 76d2992..ef54125 100644
--- a/modules/auth/README
+++ b/modules/auth/README
@@ -15,46 +15,46 @@ Daniel-Constantin Mierla
    asipto.com
    <miconda at gmail.com>
 
-   Copyright � 2002, 2003 FhG FOKUS
+   Copyright © 2002, 2003 FhG FOKUS
      __________________________________________________________________
 
    Table of Contents
 
    1. Admin Guide
 
-        1. Overview
-        2. Dependencies
-        3. Parameters
-
-              3.1. auth_checks_register (flags)
-              3.2. auth_checks_no_dlg (flags)
-              3.3. auth_checks_in_dlg (flags)
-              3.4. qop (string)
-              3.5. nonce_count (boolean)
-              3.6. one_time_nonce (boolean)
-              3.7. nid_pool_no (integer)
-              3.8. nc_array_size (integer)
-              3.9. nc_array_order (integer)
-              3.10. otn_in_flight_no (integer)
-              3.11. otn_in_flight_order (integer)
-              3.12. secret (string)
-              3.13. nonce_expire (integer)
-              3.14. nonce_auth_max_drift (integer)
-              3.15. force_stateless_reply (boolean)
-              3.16. realm_prefix (string)
-              3.17. use_domain (boolean)
-
-        4. Functions
-
-              4.1. consume_credentials()
-              4.2. has_credentials(realm)
-              4.3. www_challenge(realm, flags)
-              4.4. proxy_challenge(realm, flags)
-              4.5. auth_challenge(realm, flags)
-              4.6. pv_www_authenticate(realm, passwd, flags [, method])
-              4.7. pv_proxy_authenticate(realm, passwd, flags)
-              4.8. pv_auth_check(realm, passwd, flags, checks)
-              4.9. auth_get_www_authenticate(realm, flags, pvdest)
+        1.1. Overview
+        1.2. Dependencies
+        1.3. Parameters
+
+              1.3.1. auth_checks_register (flags)
+              1.3.2. auth_checks_no_dlg (flags)
+              1.3.3. auth_checks_in_dlg (flags)
+              1.3.4. qop (string)
+              1.3.5. nonce_count (boolean)
+              1.3.6. one_time_nonce (boolean)
+              1.3.7. nid_pool_no (integer)
+              1.3.8. nc_array_size (integer)
+              1.3.9. nc_array_order (integer)
+              1.3.10. otn_in_flight_no (integer)
+              1.3.11. otn_in_flight_order (integer)
+              1.3.12. secret (string)
+              1.3.13. nonce_expire (integer)
+              1.3.14. nonce_auth_max_drift (integer)
+              1.3.15. force_stateless_reply (boolean)
+              1.3.16. realm_prefix (string)
+              1.3.17. use_domain (boolean)
+
+        1.4. Functions
+
+              1.4.1. consume_credentials()
+              1.4.2. has_credentials(realm)
+              1.4.3. www_challenge(realm, flags)
+              1.4.4. proxy_challenge(realm, flags)
+              1.4.5. auth_challenge(realm, flags)
+              1.4.6. pv_www_authenticate(realm, passwd, flags [, method])
+              1.4.7. pv_proxy_authenticate(realm, passwd, flags)
+              1.4.8. pv_auth_check(realm, passwd, flags, checks)
+              1.4.9. auth_get_www_authenticate(realm, flags, pvdest)
 
    List of Examples
 
@@ -85,43 +85,7 @@ Daniel-Constantin Mierla
 
 Chapter 1. Admin Guide
 
-   Table of Contents
-
-   1. Overview
-   2. Dependencies
-   3. Parameters
-
-        3.1. auth_checks_register (flags)
-        3.2. auth_checks_no_dlg (flags)
-        3.3. auth_checks_in_dlg (flags)
-        3.4. qop (string)
-        3.5. nonce_count (boolean)
-        3.6. one_time_nonce (boolean)
-        3.7. nid_pool_no (integer)
-        3.8. nc_array_size (integer)
-        3.9. nc_array_order (integer)
-        3.10. otn_in_flight_no (integer)
-        3.11. otn_in_flight_order (integer)
-        3.12. secret (string)
-        3.13. nonce_expire (integer)
-        3.14. nonce_auth_max_drift (integer)
-        3.15. force_stateless_reply (boolean)
-        3.16. realm_prefix (string)
-        3.17. use_domain (boolean)
-
-   4. Functions
-
-        4.1. consume_credentials()
-        4.2. has_credentials(realm)
-        4.3. www_challenge(realm, flags)
-        4.4. proxy_challenge(realm, flags)
-        4.5. auth_challenge(realm, flags)
-        4.6. pv_www_authenticate(realm, passwd, flags [, method])
-        4.7. pv_proxy_authenticate(realm, passwd, flags)
-        4.8. pv_auth_check(realm, passwd, flags, checks)
-        4.9. auth_get_www_authenticate(realm, flags, pvdest)
-
-1. Overview
+1.1. Overview
 
    This is a generic module that itself doesn't provide all functions
    necessary for authentication but provides functions that are needed by
@@ -135,39 +99,21 @@ Chapter 1. Admin Guide
    functionality. This also allows us to avoid unnecessary dependencies in
    the binary packages.
 
-2. Dependencies
+1.2. Dependencies
 
    The module does not depend on any other module.
 
-3. Parameters
-
-   3.1. auth_checks_register (flags)
-   3.2. auth_checks_no_dlg (flags)
-   3.3. auth_checks_in_dlg (flags)
-   3.4. qop (string)
-   3.5. nonce_count (boolean)
-   3.6. one_time_nonce (boolean)
-   3.7. nid_pool_no (integer)
-   3.8. nc_array_size (integer)
-   3.9. nc_array_order (integer)
-   3.10. otn_in_flight_no (integer)
-   3.11. otn_in_flight_order (integer)
-   3.12. secret (string)
-   3.13. nonce_expire (integer)
-   3.14. nonce_auth_max_drift (integer)
-   3.15. force_stateless_reply (boolean)
-   3.16. realm_prefix (string)
-   3.17. use_domain (boolean)
-
-3.1. auth_checks_register (flags)
+1.3. Parameters
+
+1.3.1. auth_checks_register (flags)
 
    See description of parameter auth_checks_in_dlg.
 
-3.2. auth_checks_no_dlg (flags)
+1.3.2. auth_checks_no_dlg (flags)
 
    See description of parameter auth_checks_in_dlg.
 
-3.3. auth_checks_in_dlg (flags)
+1.3.3. auth_checks_in_dlg (flags)
 
    These three module parameters control which optional integrity checks
    will be performed on the SIP message carrying digest response during
@@ -252,7 +198,7 @@ modparam("auth", "auth_checks_in_dlg", 15)
 
 ...
 
-3.4. qop (string)
+1.3.4. qop (string)
 
    If set, enable qop for challenges: each challenge will include a qop
    parameter. This is the recommended way, but some older non rfc3261
@@ -274,7 +220,7 @@ modparam("auth", "auth_checks_in_dlg", 15)
 modparam("auth", "qop", "auth")   # set qop=auth
 ...
 
-3.5. nonce_count (boolean)
+1.3.5. nonce_count (boolean)
 
    If enabled the received nc value is remembered and checked against the
    older value (for a successful authentication the received nc must be
@@ -370,7 +316,7 @@ route{
         }
 ...
 
-3.6. one_time_nonce (boolean)
+1.3.6. one_time_nonce (boolean)
 
    If set to 1 nonce reuse is disabled: each nonce is allowed only once,
    in the first reponse to a challenge. All the messages will be
@@ -414,7 +360,7 @@ modparam("auth", "one_time_nonce", 1)
 # Note: stateful mode should be used, see the nonce_count example
 ...
 
-3.7. nid_pool_no (integer)
+1.3.7. nid_pool_no (integer)
 
    Controls the number of partitions for the nonce_count and
    one_time_nonce arrays (it's common to both of them to reduce the nonce
@@ -450,7 +396,7 @@ modparam("auth", "one_time_nonce", 1)
 modparam("auth", "nid_pool_no", 4)
 ...
 
-3.8. nc_array_size (integer)
+1.3.8. nc_array_size (integer)
 
    Maximum number of in-flight nonces for nonce_count. It represents the
    maximum nonces for which state will be kept. When this number is
@@ -474,7 +420,7 @@ modparam("auth", "nid_pool_no", 4)
 modparam("auth", "nc_array_size", 4194304)   # 4Mb
 ...
 
-3.9. nc_array_order (integer)
+1.3.9. nc_array_order (integer)
 
    Equivalent to nc_array_size, but instead of directly specifying the
    size, its value is the power at which 2 should be raised
@@ -491,7 +437,7 @@ modparam("auth", "nc_array_size", 4194304)   # 4Mb
 modparam("auth", "nc_array_order", 22)   # 4Mb
 ...
 
-3.10. otn_in_flight_no (integer)
+1.3.10. otn_in_flight_no (integer)
 
    Maximum number of in-flight nonces for one_time_nonce. It represents
    the maximum number of nonces remembered for the one-time-nonce check.
@@ -517,7 +463,7 @@ modparam("auth", "nc_array_order", 22)   # 4Mb
 modparam("auth", "otn_in_flight_no", 8388608)   # 8 Mb (1Mb memory)
 ...
 
-3.11. otn_in_flight_order (integer)
+1.3.11. otn_in_flight_order (integer)
 
    Equivalent to otn_in_flight_no, but instead of directly specifying the
    size, its value is the power at which 2 should be raised
@@ -535,7 +481,7 @@ modparam("auth", "otn_in_flight_no", 8388608)   # 8 Mb (1Mb memory)
 modparam("auth", "otn_in_flight_order", 23)   # 8 Mb (1Mb memory)
 ...
 
-3.12. secret (string)
+1.3.12. secret (string)
 
    Secret phrase used to calculate the nonce value used to challenge the
    client for authentication.
@@ -555,7 +501,7 @@ modparam("auth", "otn_in_flight_order", 23)   # 8 Mb (1Mb memory)
 modparam("auth", "secret", "johndoessecretphrase")
 ...
 
-3.13. nonce_expire (integer)
+1.3.13. nonce_expire (integer)
 
    Nonces have limited lifetime. After a given period of time nonces will
    be considered invalid. This is to protect replay attacks. Credentials
@@ -572,7 +518,7 @@ modparam("auth", "secret", "johndoessecretphrase")
 modparam("auth", "nonce_expire", 600)   # Set nonce_expire to 600s
 ...
 
-3.14. nonce_auth_max_drift (integer)
+1.3.14. nonce_auth_max_drift (integer)
 
    Maximum difference in seconds between a nonce creation time and the
    current time, if the nonce creation time appears to be in the future.
@@ -594,7 +540,7 @@ modparam("auth", "nonce_expire", 600)   # Set nonce_expire to 600s
 modparam("auth", "nonce_auth_max_drift", 1)   # set max drift to 1 s
 ...
 
-3.15. force_stateless_reply (boolean)
+1.3.15. force_stateless_reply (boolean)
 
    If set to 1, www_challenge() and proxy_challenge() functions send reply
    statelessly no matter if transaction exists or not. If set to 0
@@ -606,13 +552,13 @@ modparam("auth", "nonce_auth_max_drift", 1)   # set max drift to 1 s
 modparam("auth", "force_stateless_reply", 1)
 ...
 
-3.16. realm_prefix (string)
+1.3.16. realm_prefix (string)
 
    Prefix to be automatically strip from realm. As an alternative to SRV
    records (not all SIP clients support SRV lookup), a subdomain of the
    master domain can be defined for SIP purposes (like sip.mydomain.net
    pointing to same IP address as the SRV record for mydomain.net). By
-   ignoring the realm_prefix "sip.", at authentication, sip.mydomain.net
+   ignoring the realm_prefix “sip.”, at authentication, sip.mydomain.net
    will be equivalent to mydomain.net .
 
    Default value is empty string.
@@ -620,7 +566,7 @@ modparam("auth", "force_stateless_reply", 1)
    Example 1.14. realm_prefix parameter example
 modparam("auth", "realm_prefix", "sip.")
 
-3.17. use_domain (boolean)
+1.3.17. use_domain (boolean)
 
    If set to 1, pv_auth_check() uses domain parts of the URIs to check
    user identity.
@@ -630,19 +576,9 @@ modparam("auth", "realm_prefix", "sip.")
 modparam("auth", "use_domain", 1)
 ...
 
-4. Functions
-
-   4.1. consume_credentials()
-   4.2. has_credentials(realm)
-   4.3. www_challenge(realm, flags)
-   4.4. proxy_challenge(realm, flags)
-   4.5. auth_challenge(realm, flags)
-   4.6. pv_www_authenticate(realm, passwd, flags [, method])
-   4.7. pv_proxy_authenticate(realm, passwd, flags)
-   4.8. pv_auth_check(realm, passwd, flags, checks)
-   4.9. auth_get_www_authenticate(realm, flags, pvdest)
+1.4. Functions
 
-4.1. consume_credentials()
+1.4.1. consume_credentials()
 
    This function removes previously authorized credential headers from the
    message being processed by the server. That means that the downstream
@@ -659,7 +595,7 @@ if (www_authenticate("realm", "subscriber")) {
 };
 ...
 
-4.2. has_credentials(realm)
+1.4.2. has_credentials(realm)
 
    This function returns true of the request has Autorization or
    Proxy-Authorization header with provided realm. The parameter can be
@@ -672,7 +608,7 @@ if (has_credentials("myrealm")) {
 }
 ...
 
-4.3. www_challenge(realm, flags)
+1.4.3.  www_challenge(realm, flags)
 
    The function challenges a user agent. It will generate a WWW-Authorize
    header field containing a digest challenge, it will put the header
@@ -686,7 +622,7 @@ if (has_credentials("myrealm")) {
      * realm - Realm is a opaque string that the user agent should present
        to the user so he can decide what username and password to use.
        Usually this is domain of the host the server is running on.
-       It must not be empty string "". In case of REGISTER requests, the
+       It must not be empty string “”. In case of REGISTER requests, the
        To header field domain (e.g., variable $td) can be used (because
        this header field represents the user being registered), for all
        other messages From header field domain can be used (e.g., variable
@@ -709,7 +645,7 @@ if (!www_authenticate("$td", "subscriber")) {
 }
 ...
 
-4.4. proxy_challenge(realm, flags)
+1.4.4.  proxy_challenge(realm, flags)
 
    The function challenges a user agent. It will generate a
    Proxy-Authorize header field containing a digest challenge, it will put
@@ -731,7 +667,7 @@ if (!proxy_authenticate("$fd", "subscriber")) {
 };
 ...
 
-4.5. auth_challenge(realm, flags)
+1.4.5.  auth_challenge(realm, flags)
 
    The function challenges a user agent for authentication. It combines
    the functions www_challenge() and proxy_challenge(), by calling
@@ -750,7 +686,7 @@ if (!auth_check("$fd", "subscriber", "1")) {
 };
 ...
 
-4.6. pv_www_authenticate(realm, passwd, flags [, method])
+1.4.6.  pv_www_authenticate(realm, passwd, flags [, method])
 
    The function verifies credentials according to RFC2617. If the
    credentials are verified successfully then the function will succeed
@@ -761,20 +697,22 @@ if (!auth_check("$fd", "subscriber", "1")) {
 
    Negative codes may be interpreted as follows:
      * -1 (generic error) - some generic error occurred and no reply was
-       sent out;
-     * -2 (invalid password) - wrong password;
-     * -3 (invalid user) - authentication user does not exist.
+       sent out
+     * -2 (invalid password) - wrong password
+     * -3 (invalid user) - authentication user does not exist
      * -4 (nonce expired) - the nonce has expired
      * -5 (no credentials) - request does not contain an Authorization
-       header with the correct realm.
+       header with the correct realm
      * -6 (nonce reused) - the nonce has already been used to authenticate
        a previous request
+     * -8 (auth user mismatch) - the auth user is different then the
+       From/To user
 
    Meaning of the parameters is as follows:
      * realm - Realm is a opaque string that the user agent should present
        to the user so he can decide what username and password to use.
        Usually this is domain of the host the server is running on.
-       It must not be empty string "". In case of REGISTER requests To
+       It must not be empty string “”. In case of REGISTER requests To
        header field domain (e.g., varibale $td) can be used (because this
        header field represents a user being registered), for all other
        messages From header field domain can be used (e.g., varibale $fd).
@@ -803,7 +741,7 @@ if (!pv_www_authenticate("$td", "123abc", "0")) {
 };
 ...
 
-4.7. pv_proxy_authenticate(realm, passwd, flags)
+1.4.7.  pv_proxy_authenticate(realm, passwd, flags)
 
    The function verifies credentials according to RFC2617. If the
    credentials are verified successfully then the function will succeed
@@ -826,7 +764,7 @@ if (!pv_proxy_authenticate("$fd", "$avp(password)", "0")) {
 };
 ...
 
-4.8. pv_auth_check(realm, passwd, flags, checks)
+1.4.8.  pv_auth_check(realm, passwd, flags, checks)
 
    The function combines the functionalities of pv_www_authenticate and
    pv_proxy_authenticate, first being exectuted if the SIP request is a
@@ -851,7 +789,7 @@ if (!pv_auth_check("$fd", "$avp(password)", "0", "1")) {
 };
 ...
 
-4.9. auth_get_www_authenticate(realm, flags, pvdest)
+1.4.9.  auth_get_www_authenticate(realm, flags, pvdest)
 
    Build WWW-Authentication header and set the resulting value in 'pvdest'
    pseudo-variable parameter.
diff --git a/modules/auth/auth_mod.c b/modules/auth/auth_mod.c
index cdfe459..e0ed083 100644
--- a/modules/auth/auth_mod.c
+++ b/modules/auth/auth_mod.c
@@ -687,7 +687,7 @@ static int pv_www_authenticate2(struct sip_msg *msg, char* realm,
 	}
 
 	if (get_str_fparam(&smethod, msg, (fparam_t*)method) < 0) {
-		LM_ERR("failed to get method value\n");
+		LM_ERR("failed to get method value from msg %p var %p\n", msg, method);
 		goto error;
 	}
 
@@ -830,6 +830,7 @@ static int fixup_pv_auth(void **param, int param_no)
 	switch(param_no) {
 		case 1:
 		case 2:
+		case 4:
 			return fixup_var_pve_str_12(param, 1);
 		case 3:
 			return fixup_var_int_12(param, 1);
diff --git a/modules/auth/doc/auth_functions.xml b/modules/auth/doc/auth_functions.xml
index 0ab616a..ec33324 100644
--- a/modules/auth/doc/auth_functions.xml
+++ b/modules/auth/doc/auth_functions.xml
@@ -198,26 +198,30 @@ if (!auth_check("$fd", "subscriber", "1")) {
 		<itemizedlist>
 			<listitem><para>
 			<emphasis>-1 (generic error)</emphasis> - some generic error
-			occurred and no reply was sent out;
+			occurred and no reply was sent out
 			</para></listitem>
 			<listitem><para>
-			<emphasis>-2 (invalid password)</emphasis> - wrong password;
+			<emphasis>-2 (invalid password)</emphasis> - wrong password
 			</para></listitem>
 			<listitem><para>
 			<emphasis>-3 (invalid user)</emphasis> - authentication user does
-			not exist.
+			not exist
 			</para></listitem>
 			<listitem><para>
 			<emphasis>-4 (nonce expired)</emphasis> - the nonce has expired
 			</para></listitem>
 			<listitem><para>
 			<emphasis>-5 (no credentials)</emphasis> - request does not contain
-			an Authorization header with the correct realm.
+			an Authorization header with the correct realm
 			</para></listitem>
 			<listitem><para>
 			<emphasis>-6 (nonce reused)</emphasis> - the nonce has already been
 			used to authenticate a previous request
 			</para></listitem>
+			<listitem><para>
+			<emphasis>-8 (auth user mismatch)</emphasis> - the auth user is different
+			then the From/To user
+			</para></listitem>
 		</itemizedlist>
 		<para>Meaning of the parameters is as follows:</para>
 		<itemizedlist>
diff --git a/modules/auth_db/authorize.c b/modules/auth_db/authorize.c
index cf97a8f..e2b0f4f 100644
--- a/modules/auth_db/authorize.c
+++ b/modules/auth_db/authorize.c
@@ -223,10 +223,10 @@ static int generate_avps(struct sip_msg* msg, db1_res_t* db_res)
 
 
 /*
- * Authorize digest credentials
+ * Authorize digest credentials and set the pointer to used hdr
  */
-static int digest_authenticate(struct sip_msg* msg, str *realm,
-				str *table, hdr_types_t hftype, str *method)
+static int digest_authenticate_hdr(sip_msg_t* msg, str *realm,
+				str *table, hdr_types_t hftype, str *method, hdr_field_t **ahdr)
 {
 	char ha1[256];
 	int res;
@@ -277,6 +277,7 @@ static int digest_authenticate(struct sip_msg* msg, str *realm,
 	}
 
 	cred = (auth_body_t*)h->parsed;
+	if(ahdr!=NULL) *ahdr = h;
 
 	res = get_ha1(&cred->digest.username, realm, table, ha1, &result);
 	if (res < 0) {
@@ -315,6 +316,15 @@ end:
 	return ret;
 }
 
+/*
+ * Authorize digest credentials
+ */
+static int digest_authenticate(sip_msg_t* msg, str *realm,
+				str *table, hdr_types_t hftype, str *method)
+{
+	return digest_authenticate_hdr(msg, realm, table, hftype, method, NULL);
+}
+
 
 /*
  * Authenticate using Proxy-Authorize header field
@@ -475,15 +485,15 @@ int auth_check(struct sip_msg* _m, char* _realm, char* _table, char *_flags)
 	LM_DBG("realm [%.*s] table [%.*s] flags [%d]\n", srealm.len, srealm.s,
 			stable.len,  stable.s, iflags);
 
+	hdr = NULL;
 	if(_m->REQ_METHOD==METHOD_REGISTER)
-		ret = digest_authenticate(_m, &srealm, &stable, HDR_AUTHORIZATION_T,
-						&_m->first_line.u.request.method);
+		ret = digest_authenticate_hdr(_m, &srealm, &stable, HDR_AUTHORIZATION_T,
+						&_m->first_line.u.request.method, &hdr);
 	else
-		ret = digest_authenticate(_m, &srealm, &stable, HDR_PROXYAUTH_T,
-						&_m->first_line.u.request.method);
+		ret = digest_authenticate_hdr(_m, &srealm, &stable, HDR_PROXYAUTH_T,
+						&_m->first_line.u.request.method, &hdr);
 
-	if(ret==AUTH_OK && (iflags&AUTH_CHECK_ID_F)) {
-		hdr = (_m->proxy_auth==0)?_m->authorization:_m->proxy_auth;
+	if(ret==AUTH_OK && hdr!=NULL && (iflags&AUTH_CHECK_ID_F)) {
 		srealm = ((auth_body_t*)(hdr->parsed))->digest.username.user;
 			
 		if((furi=parse_from_uri(_m))==NULL)
diff --git a/modules/auth_diameter/authorize.c b/modules/auth_diameter/authorize.c
index 6660057..7a42b3c 100644
--- a/modules/auth_diameter/authorize.c
+++ b/modules/auth_diameter/authorize.c
@@ -478,9 +478,9 @@ int diameter_authorize(struct hdr_field* hdr, str* p_method, struct sip_uri uri,
 	{
 		port_flag = 1;	
 		memcpy(user_name.s+ruri.user.len+ruri.host.len+1, ":", 1);
-	}	
-	memcpy(user_name.s+ruri.user.len+ruri.host.len+name_flag+port_flag, 
+		memcpy(user_name.s+ruri.user.len+ruri.host.len+name_flag+port_flag, 
 					ruri.port.s, ruri.port.len);
+	}
 #ifdef DEBUG
 	LM_DBG(": AVP_Resource=%.*s\n", user_name.len, user_name.s);
 #endif
diff --git a/modules/auth_diameter/tcp_comm.c b/modules/auth_diameter/tcp_comm.c
index 95d1a4b..4f40600 100644
--- a/modules/auth_diameter/tcp_comm.c
+++ b/modules/auth_diameter/tcp_comm.c
@@ -310,7 +310,7 @@ next:
 				break;
 			}
 			rb->chall_len=avp->data.len;
-			rb->chall = (unsigned char*)pkg_malloc(avp->data.len*sizeof(char));
+			rb->chall = (unsigned char*)pkg_malloc(avp->data.len*sizeof(unsigned char));
 			if(rb->chall == NULL)
 			{
 				LM_ERR("no more pkg memory\n");
diff --git a/modules/auth_diameter/user_in.c b/modules/auth_diameter/user_in.c
index 3605348..7b0fa8d 100644
--- a/modules/auth_diameter/user_in.c
+++ b/modules/auth_diameter/user_in.c
@@ -103,6 +103,7 @@ int diameter_is_user_in(struct sip_msg* _m, char* _hf, char* _group)
 	AAA_AVP *avp; 
 	int ret;
 	unsigned int tmp;
+	char *p = NULL;
 
 	grp = (str*)_group; /* via fixup */
 
@@ -174,12 +175,13 @@ int diameter_is_user_in(struct sip_msg* _m, char* _hf, char* _group)
 		if(user_name.len>0)
 		{
 			user_name.len++;
-			user_name.s = (char*)pkg_malloc(user_name.len);
-			if (!user_name.s) 
+			p = (char*)pkg_malloc(user_name.len);
+			if (!p)
 			{
 				LM_ERR("no pkg memory left\n");
 				return -6;
 			}
+			user_name.s = p;
 		
 			memcpy(user_name.s, user.s, user.len);
 			if(user.len>0)
@@ -198,6 +200,7 @@ int diameter_is_user_in(struct sip_msg* _m, char* _hf, char* _group)
 	if ( (req=AAAInMessage(AA_REQUEST, AAA_APP_NASREQ))==NULL)
 	{
 		LM_ERR("can't create new AAA message!\n");
+		if(p) pkg_free(p);
 		return -1;
 	}
 	
diff --git a/modules/auth_radius/sterman.c b/modules/auth_radius/sterman.c
index be4dcf3..93cd416 100644
--- a/modules/auth_radius/sterman.c
+++ b/modules/auth_radius/sterman.c
@@ -409,7 +409,7 @@ int radius_authorize_sterman(struct sip_msg* _msg, dig_cred_t* _cred, str* _meth
                         goto err;
                 }
 #endif 
-		LM_ERR("authorization failed\n");
+		LM_ERR("authorization failed. RC auth returned %d\n", i);
 	}
 
  err:
diff --git a/modules/avpops/avpops_impl.c b/modules/avpops/avpops_impl.c
index ecf31b0..c3fc69a 100644
--- a/modules/avpops/avpops_impl.c
+++ b/modules/avpops/avpops_impl.c
@@ -299,6 +299,8 @@ int ops_dbload_avps (struct sip_msg* msg, struct fis_param *sp,
 		goto error;
 	}
 
+	memset(&xvalue, 0, sizeof(pv_value_t));
+
 	/* get uuid from avp */
 	if (sp->opd&AVPOPS_VAL_PVAR)
 	{
diff --git a/modules/benchmark/benchmark.c b/modules/benchmark/benchmark.c
index 5708339..56033cf 100644
--- a/modules/benchmark/benchmark.c
+++ b/modules/benchmark/benchmark.c
@@ -524,27 +524,36 @@ struct mi_root* mi_bm_enable_timer(struct mi_root *cmd, void *param)
 		return init_mi_tree( 400, MI_MISSING_PARM_S, MI_MISSING_PARM_LEN);
 
 	p1 = pkg_strndup(node->value.s, node->value.len);
+	p2 = pkg_strndup(node->next->value.s, node->next->value.len);
+	if(!p1 || !p2)
+		goto error;
 
 	if(_bm_register_timer(p1, 0, &id)!=0)
 	{
 		pkg_free(p1);
+		pkg_free(p2);
 		return init_mi_tree( 400, MI_BAD_PARM_S, MI_BAD_PARM_LEN);
 	}
-	p2 = pkg_strndup(node->next->value.s, node->next->value.len);
 	v2 = strtol(p2, &e2, 0);
 	
 	pkg_free(p1);
-	pkg_free(p2);
 
-	if (*e2 != '\0' || *p2 == '\0')
+	if (*e2 != '\0' || *p2 == '\0') {
+		pkg_free(p2);
 		return init_mi_tree( 400, MI_BAD_PARM_S, MI_BAD_PARM_LEN);
+	}
 
+	pkg_free(p2);
 	if ((v2 < 0) || (v2 > 1))
 		return init_mi_tree( 400, MI_BAD_PARM_S, MI_BAD_PARM_LEN);
 
 	bm_mycfg->timers[id].enabled = v2;
 
 	return init_mi_tree( 200, MI_OK_S, MI_OK_LEN);
+error:
+	if(p1) pkg_free(p1);
+	if(p2) pkg_free(p2);
+	return init_mi_tree(500, MI_INTERNAL_ERR_S, MI_INTERNAL_ERR_LEN);
 }
 
 struct mi_root* mi_bm_granularity(struct mi_root *cmd, void *param)
@@ -563,10 +572,13 @@ struct mi_root* mi_bm_granularity(struct mi_root *cmd, void *param)
 
 	v1 = strtol(p1, &e1, 0);
 
-	pkg_free(p1);
-
 	if ((*e1 != '\0') || (*p1 == '\0'))
+	{
+		pkg_free(p1);
 		return init_mi_tree( 400, MI_BAD_PARM_S, MI_BAD_PARM_LEN);
+	}
+
+	pkg_free(p1);
 
 	if (v1 < 1)
 		return init_mi_tree( 400, MI_BAD_PARM_S, MI_BAD_PARM_LEN);
@@ -592,10 +604,13 @@ struct mi_root* mi_bm_loglevel(struct mi_root *cmd, void *param)
 
 	v1 = strtol(p1, &e1, 0);
 	
-	pkg_free(p1);
-
 	if ((*e1 != '\0') || (*p1 == '\0'))
+	{
+		pkg_free(p1);
 		return init_mi_tree( 400, MI_BAD_PARM_S, MI_BAD_PARM_LEN);
+	}
+
+	pkg_free(p1);
 
 	if ((v1 < -3) || (v1 > 4)) /* Maximum log levels */
 		return init_mi_tree( 400, MI_BAD_PARM_S, MI_BAD_PARM_LEN);
diff --git a/modules/call_control/call_control.c b/modules/call_control/call_control.c
index 725d638..4470b73 100644
--- a/modules/call_control/call_control.c
+++ b/modules/call_control/call_control.c
@@ -244,7 +244,7 @@ int
 parse_param(void *val, AVP_List** avps) {
 
     char *p;
-    str *s, content;
+    str s, content;
     AVP_List *mp = NULL;
 
     //LM_DBG("%.*s\n", content.len, content.s);
@@ -259,8 +259,6 @@ parse_param(void *val, AVP_List** avps) {
     p[content.len] = '\0';
     memcpy(p, content.s, content.len);
 
-    s = (str*) pkg_malloc(sizeof(str));
-    CHECK_ALLOC(s);
 
     for (;*p != '\0';) {
 
@@ -289,10 +287,10 @@ parse_param(void *val, AVP_List** avps) {
         for (; isspace(*p); p++);
         CHECK_COND(*p != '\0' && *p == '$');
 
-        s->s = p;
-        s->len = strlen(p);
+        s.s = p;
+        s.len = strlen(p);
 
-        p = pv_parse_spec(s, mp->pv);
+        p = pv_parse_spec(&s, mp->pv);
 
         for (; isspace(*p); p++);
         *avps = mp;
diff --git a/modules/carrierroute/Makefile b/modules/carrierroute/Makefile
index b06441a..4117bbb 100644
--- a/modules/carrierroute/Makefile
+++ b/modules/carrierroute/Makefile
@@ -9,23 +9,6 @@ include ../../Makefile.defs
 auto_gen=
 NAME=carrierroute.so
 
-ifeq ($(CROSS_COMPILE),)
-CONFUSE_BUILDER = $(shell \
-	if which confuse-config &>/dev/null;then \
-		echo 'confuse-config'; \
-	elif pkg-config --exists libconfuse; then \
-		echo 'pkg-config libconfuse'; \
-	fi)
-endif
-
-ifeq ($(CONFUSE_BUILDER),)
-	DEFS += -I$(LOCALBASE)/include
-	LIBS += -L$(LOCALBASE)/lib -lconfuse
-else
-	DEFS += $(shell $(CONFUSE_BUILDER) --cflags)
-	LIBS += $(shell $(CONFUSE_BUILDER) --libs)
-endif
-
 DEFS+=-DKAMAILIO_MOD_INTERFACE
 
 SERLIBPATH=../../lib
diff --git a/modules/carrierroute/cr_config.c b/modules/carrierroute/cr_config.c
index 92f96a9..d07c5c0 100644
--- a/modules/carrierroute/cr_config.c
+++ b/modules/carrierroute/cr_config.c
@@ -20,14 +20,13 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-/**
+/*!
  * \file cr_config.c
  * \brief Functions for load and save routing data from a config file.
  * \ingroup carrierroute
  * - Module; \ref carrierroute
  */
 
-#include <confuse.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
@@ -42,87 +41,76 @@
 #include "cr_rule.h"
 #include "cr_domain.h"
 #include "cr_carrier.h"
+#include "parser_carrierroute.h"
 
+enum target_opt_ids { TO_ID_COMMENT = 0, TO_ID_STRIP, TO_ID_REWR_PREFIX, TO_ID_PROB, TO_ID_HASH_INDEX,
+					  TO_ID_REWR_SUFFIX, TO_ID_STATUS, TO_ID_BACKED_UP, TO_ID_BACKUP, TO_MAX_IDS };
+enum prefix_opt_ids { PO_MAX_TARGETS = 0, PO_MAX_IDS };
 
-/**
- * reports errors during config file parsing using LOG macro
- *
- * @param cfg points to the current config data structure
- * @param fmt a format string
- * @param ap format arguments
- */
-static void conf_error(cfg_t *cfg, const char * fmt, va_list ap) {
-	int ret;
-	static char buf[1024];
-
-	ret = vsnprintf(buf, sizeof(buf), fmt, ap);
-	if (ret < 0 || ret >= sizeof(buf)) {
-		LM_ERR("could not print error message\n");
-	} else {
-		// FIXME this don't seems to work reliable in all cases, charset 
-		// problems
-		LM_GEN1(L_ERR, "%s", buf);
+option_description target_options[TO_MAX_IDS];
+option_description prefix_options[PO_MAX_IDS];
+
+static void reset_opts(option_description * opts, int size){
+	int i;
+	if ( NULL == opts){
+		LM_ERR("Trying to init a NULL pointer location \n");
+		return;
 	}
+	for (i=0; i < size; i++){
+		memset(&(opts[i].value),'\0', sizeof(union opt_data));
+		opts[i].visited = 0;
+		opts[i].no_elems = 0;
+		if ( CFG_STR == opts[i].type ){
+			opts[i].value.string_data.s = opts[i].str_buf;
+			strcpy(opts[i].str_buf,"");
+			opts[i].value.string_data.len = 0;
+		}
+	}
+	return;
 }
 
-
-/**
- * Parses the config file
- *
- * @return a pointer to the configuration data structure, NULL on failure
- */
-static cfg_t * parse_config(void) {
-	cfg_t * cfg = NULL;
-
-	cfg_opt_t target_opts[] = {
-	                              CFG_STR("comment", 0, CFGF_NONE),
-	                              CFG_INT("strip", 0, CFGF_NONE),
-	                              CFG_STR("rewrite_prefix", 0, CFGF_NONE),
-	                              CFG_FLOAT("prob", 0, CFGF_NONE),
-	                              CFG_INT("hash_index", 0, CFGF_NONE),
-	                              CFG_STR("rewrite_suffix", 0, CFGF_NONE),
-	                              CFG_INT("status", 1, CFGF_NONE),
-	                              CFG_INT_LIST("backed_up", NULL, CFGF_NONE),
-	                              CFG_INT("backup", -1, CFGF_NONE),
-	                              CFG_END()
-	                          };
-
-	cfg_opt_t prefix_opts[] = {
-	                              CFG_SEC("target", target_opts, CFGF_MULTI | CFGF_TITLE),
-	                              CFG_INT("max_targets", -1, CFGF_NONE),
-	                              CFG_END()
-	                          };
-
-	cfg_opt_t domain_opts[] = {
-	                              CFG_SEC("prefix", prefix_opts, CFGF_MULTI | CFGF_TITLE),
-	                              CFG_END()
-	                          };
-
-	cfg_opt_t opts[] = {
-	                       CFG_SEC("domain", domain_opts, CFGF_MULTI | CFGF_TITLE),
-	                       CFG_END()
-	                   };
-
-	cfg = cfg_init(opts, CFGF_NONE);
-	if (cfg == NULL) {
-		LM_ERR("could not initialize configuration\n");
-		return NULL;
+static int init_target_opts(option_description * opts){
+	if ( NULL == opts){
+		LM_DBG("Trying to init a NULL pointer location \n");
+		return -1;
 	}
+	memset(opts, '\0', sizeof(option_description) * TO_MAX_IDS);
+
+	strcpy((char*)(opts[TO_ID_COMMENT].name),    "comment");
+	strcpy((char*)(opts[TO_ID_STRIP].name),      "strip");
+	strcpy((char*)(opts[TO_ID_REWR_PREFIX].name),"rewrite_prefix");
+	strcpy((char*)(opts[TO_ID_PROB].name),       "prob");
+	strcpy((char*)(opts[TO_ID_HASH_INDEX].name), "hash_index");
+	strcpy((char*)(opts[TO_ID_REWR_SUFFIX].name),"rewrite_suffix");
+	strcpy((char*)(opts[TO_ID_STATUS].name),     "status");
+	strcpy((char*)(opts[TO_ID_BACKED_UP].name),  "backed_up");
+	strcpy((char*)(opts[TO_ID_BACKUP].name),     "backup");
+
+	opts[TO_ID_COMMENT    ].type=CFG_STR;
+	opts[TO_ID_STRIP      ].type=CFG_INT;
+	opts[TO_ID_REWR_PREFIX].type=CFG_STR;
+	opts[TO_ID_PROB       ].type=CFG_FLOAT;
+	opts[TO_ID_HASH_INDEX ].type=CFG_INT;
+	opts[TO_ID_REWR_SUFFIX].type=CFG_STR;
+	opts[TO_ID_STATUS     ].type=CFG_INT;
+	opts[TO_ID_BACKED_UP  ].type=CFG_INT_LIST;
+	opts[TO_ID_BACKUP     ].type=CFG_INT;
+
+	reset_opts(opts, TO_MAX_IDS);
+	return 0;
+}
 
-	cfg_set_error_function(cfg, conf_error);
-
-	switch (cfg_parse(cfg, config_file)) {
-		case CFG_FILE_ERROR: LM_ERR("file not found: %s\n", config_file);
-			return NULL;
-		case CFG_PARSE_ERROR: LM_ERR("error while parsing %s in line %i, section %s\n",
-			                          cfg->filename, cfg->line, cfg->name);
-			return NULL;
-		case CFG_SUCCESS: break;
+static int init_prefix_opts(option_description * opts){
+	if ( NULL == opts){
+		LM_DBG("Trying to init a NULL pointer location \n");
+		return -1;
 	}
-	return cfg;
+	memset(opts, '\0', sizeof(option_description) * PO_MAX_IDS);
+	strcpy((char*)(opts[PO_MAX_TARGETS].name), "max_targets");
+	opts[PO_MAX_TARGETS].type=CFG_INT;
+	return 0;
 }
 
-
 static int backup_config(void) {
 	FILE * from, * to;
 	char * backup_file, ch;
@@ -188,10 +176,11 @@ errout:
 	return -1;
 }
 
-
 /**
  * Loads the routing data from the config file given in global
  * variable config_data and stores it in routing tree rd.
+ * The function mixes code parsing calls with rd structure
+ * completion.
  *
  * @param rd Pointer to the route data tree where the routing data
  * shall be loaded into
@@ -200,173 +189,277 @@ errout:
  *
  */
 int load_config(struct route_data_t * rd) {
-	cfg_t * cfg = NULL;
-	int m, o, i, j, k,l, status, hash_index, max_targets, strip;
-	cfg_t * d, * p, * t;
+	FILE * file;
+
+	int ret_domain, ret_prefix, ret_target, ret_prefix_opts, ret_target_opts;
+	int domain_id, allocated_domain_num = DEFAULT_DOMAIN_NUM;
+	str domain_name, prefix_name, rewrite_host;
+	char domain_buf[CR_MAX_LINE_SIZE], prefix_buf[CR_MAX_LINE_SIZE],  rewrite_buf[CR_MAX_LINE_SIZE];
+
+	str rewrite_prefix, rewrite_suffix, comment;
+	struct domain_data_t *domain_data = NULL;
 	struct carrier_data_t * tmp_carrier_data;
-	int domain_id;
-	str domain, prefix, rewrite_prefix, rewrite_suffix, rewrite_host, comment;
+	int hash_index, max_targets = 0, strip;
 	double prob;
 	int * backed_up = NULL;
-	int backed_up_size, backup;
-	backed_up_size = backup = 0;
+	int backed_up_size = 0, backup = 0, status;
+	void* p_realloc;
+	int i=0, l, k;
+
+	domain_name.s = domain_buf; domain_name.len = CR_MAX_LINE_SIZE;
+	prefix_name.s = prefix_buf; prefix_name.len = CR_MAX_LINE_SIZE;
+	rewrite_host.s = rewrite_buf; rewrite_host.len = CR_MAX_LINE_SIZE;
 
-	if ((cfg = parse_config()) == NULL) {
+	/* open configuration file */
+	if ((file = fopen(config_file, "rb"))==NULL) {
+		LM_ERR("Cannot open source file.\n");
 		return -1;
 	}
 
 	rd->carrier_num = 1;
 	rd->first_empty_carrier = 0;
-	rd->domain_num = cfg_size(cfg, "domain");
+	rd->domain_num = 0;
 
 	if ((rd->carriers = shm_malloc(sizeof(struct carrier_data_t *))) == NULL) {
 		SHM_MEM_ERROR;
-		return -1;
+		goto errclose;
 	}
 	memset(rd->carriers, 0, sizeof(struct carrier_data_t *));
 
 	/* Create carrier map */
 	if ((rd->carrier_map = shm_malloc(sizeof(struct name_map_t))) == NULL) {
 		SHM_MEM_ERROR;
-		return -1;
+		goto errclose;
 	}
+
 	memset(rd->carrier_map, 0, sizeof(struct name_map_t));
 	rd->carrier_map[0].id = 1;
 	rd->carrier_map[0].name.len = default_tree.len;
 	rd->carrier_map[0].name.s = shm_malloc(rd->carrier_map[0].name.len);
+
 	if (rd->carrier_map[0].name.s == NULL) {
 		SHM_MEM_ERROR;
-		return -1;
+		goto errclose;
 	}
 	memcpy(rd->carrier_map[0].name.s, default_tree.s, rd->carrier_map[0].name.len);
 
 	/* Create domain map */
-	if ((rd->domain_map = shm_malloc(sizeof(struct name_map_t) * rd->domain_num)) == NULL) {
+	if ((rd->domain_map = shm_malloc(sizeof(struct name_map_t) * allocated_domain_num)) == NULL) {
 		SHM_MEM_ERROR;
-		return -1;
+		goto errclose;
 	}
-	memset(rd->domain_map, 0, sizeof(struct name_map_t) * rd->domain_num);
-	for (i=0; i<rd->domain_num; i++) {
-		d = cfg_getnsec(cfg, "domain", i);
-		domain.s = (char *)cfg_title(d);
-		if (domain.s==NULL) domain.s="";
-		domain.len = strlen(domain.s);
-		rd->domain_map[i].id = i+1;
-		rd->domain_map[i].name.len = domain.len;
-		rd->domain_map[i].name.s = shm_malloc(rd->domain_map[i].name.len);
-		if (rd->domain_map[i].name.s == NULL) {
-			SHM_MEM_ERROR;
-			return -1;
-		}
-		memcpy(rd->domain_map[i].name.s, domain.s, rd->domain_map[i].name.len);
-	}
-	/* sort domain map by id for faster access */
-	qsort(rd->domain_map, rd->domain_num, sizeof(rd->domain_map[0]), compare_name_map);
+	memset(rd->domain_map, 0, sizeof(struct name_map_t) * allocated_domain_num);
 
 	/* Create and insert carrier data structure */
-	tmp_carrier_data = create_carrier_data(1, &rd->carrier_map[0].name, rd->domain_num);
+	tmp_carrier_data = create_carrier_data(1, &rd->carrier_map[0].name, allocated_domain_num);
+	tmp_carrier_data->domain_num = 0;
+	tmp_carrier_data->id = 1;
+	tmp_carrier_data->name = &(rd->carrier_map[0].name);
+
 	if (tmp_carrier_data == NULL) {
 		LM_ERR("can't create new carrier\n");
-		return -1;
+		goto errclose;
 	}
 	if (add_carrier_data(rd, tmp_carrier_data) < 0) {
 		LM_ERR("couldn't add carrier data\n");
 		destroy_carrier_data(tmp_carrier_data);
-		return -1;
+		goto errclose;
 	}
 
-	/* add all routes */
-	for (i = 0; i < rd->domain_num; i++) {
-		d = cfg_getnsec(cfg, "domain", i);
-		domain.s = (char *)cfg_title(d);
-		if (domain.s==NULL) domain.s="";
-		domain.len = strlen(domain.s);
-		m = cfg_size(d, "prefix");
-
-		LM_INFO("loading domain %.*s\n", domain.len, domain.s);
-		for (j = 0; j < m; j++) {
-			p = cfg_getnsec(d, "prefix", j);
-			prefix.s = (char *)cfg_title(p);
-			if (prefix.s==NULL) prefix.s="";
-			prefix.len = strlen(prefix.s);
-			if (str_strcasecmp(&prefix, &CR_EMPTY_PREFIX) == 0) {
-				prefix.s = "";
-				prefix.len = 0;
+	init_prefix_opts(prefix_options);
+	init_target_opts(target_options);
+
+	/* add all routes by parsing the route conf file */
+	/* while there are domain structures, get name and parse the structure*/
+	while ((ret_domain = parse_struct_header(file, "domain", &domain_name))
+			== SUCCESSFUL_PARSING) {
+
+		domain_id = ++rd->domain_num;
+		tmp_carrier_data->domain_num++;
+
+		/* (re)allocate memory for a maximum of MAX_DOMAIN_NUM domains
+		 rd is not fully allocated from the start as this would require the preparsing
+		 of the entire route file */
+		if ( rd->domain_num > allocated_domain_num){
+
+			if (MAX_DOMAIN_NUM <= allocated_domain_num){
+				LM_ERR("Maximum number of domains reached");
+				break;
 			}
 
-			LM_INFO("loading prefix %.*s\n", prefix.len, prefix.s);
-			max_targets = cfg_getint(p, "max_targets");
-			o = cfg_size(p, "target");
-			for (k = 0; k < o; k++) {
-				t = cfg_getnsec(p, "target", k);
-				rewrite_host.s = (char *)cfg_title(t);
-				if (rewrite_host.s==NULL) rewrite_host.s="";
-				rewrite_host.len = strlen(rewrite_host.s);
+			LM_INFO("crt_alloc_size=%d must be increased \n", allocated_domain_num);
+			allocated_domain_num *= 2;
+
+			if ( ( p_realloc = shm_realloc(rd->domain_map,
+					sizeof(struct name_map_t) * allocated_domain_num) ) == NULL)
+			{
+				SHM_MEM_ERROR;
+				goto errclose;
+			}
+
+			rd->domain_map = (struct name_map_t *)p_realloc;
+
+			if (( p_realloc = shm_realloc( rd->carriers[0]->domains,
+					sizeof(struct domain_data_t *) * allocated_domain_num)) == NULL) {
+				SHM_MEM_ERROR;
+				goto errclose;
+			}
+			rd->carriers[0]->domains = (struct domain_data_t **)p_realloc;
+
+			for (i=0; i<rd->domain_num-1; i++){
+				rd->carriers[0]->domains[i]->name = &(rd->domain_map[i].name);
+			}
+		}// end of mem (re)allocation for domains
+
+		/*insert domain in domain map*/
+		rd->domain_map[domain_id-1].id = domain_id;
+		rd->domain_map[domain_id-1].name.len = domain_name.len;
+		rd->domain_map[domain_id-1].name.s = shm_malloc(rd->domain_map[domain_id-1].name.len);
+		if (rd->domain_map[domain_id-1].name.s == NULL) {
+			SHM_MEM_ERROR;
+			goto errclose;
+		}
+		memcpy(rd->domain_map[domain_id-1].name.s, domain_name.s, rd->domain_map[domain_id-1].name.len);
+
+		/* create new domain data */
+		if ((domain_data = create_domain_data(domain_id,&(rd->domain_map[domain_id-1].name))) == NULL) {
+			LM_ERR("could not create new domain data\n");
+			goto errclose;
+		}
+
+		if (add_domain_data(tmp_carrier_data, domain_data, domain_id-1) < 0) {
+			LM_ERR("could not add domain data\n");
+			destroy_domain_data(domain_data);
+			goto errclose;
+		}
+		LM_DBG("added domain %d '%.*s' to carrier %d '%.*s'\n",
+				domain_id, domain_name.len, domain_name.s,
+				tmp_carrier_data->id, tmp_carrier_data->name->len, tmp_carrier_data->name->s);
+
+		/* while there are prefix structures, get name and parse the structure */
+		while ((ret_prefix = parse_struct_header(file, "prefix", &prefix_name))
+				== SUCCESSFUL_PARSING) {
+
+			reset_opts(prefix_options, PO_MAX_IDS);
+			if (str_strcasecmp(&prefix_name, &CR_EMPTY_PREFIX) == 0) {
+				prefix_name.s[0] = '\0';
+				prefix_name.len = 0;
+			}
+
+			/* look for max_targets = value which is described in prefix_options */
+			if ((ret_prefix_opts = parse_options(file, prefix_options,
+					PO_MAX_IDS, "target")) != SUCCESSFUL_PARSING) {
+				LM_ERR("Error in parsing \n");
+				goto errclose;
+			}
+
+			max_targets = prefix_options[PO_MAX_TARGETS].value.int_data;
+			/* look for max_targets target structures */
+			for ( k = 0; k < max_targets; k++) {
+				/* parse the target header, get name and continue*/
+				ret_target = parse_struct_header(file, "target", &rewrite_host);
+				if (ret_target != SUCCESSFUL_PARSING) {
+					LM_ERR("Error in parsing \n");
+					goto errclose;
+				}
+
+				reset_opts(target_options, TO_MAX_IDS);
+				/* look for the target options: prob, hash index, status, etc*/
+				ret_target_opts = parse_options(file, target_options, TO_MAX_IDS, "}");
+				if ( SUCCESSFUL_PARSING == ret_target_opts ){
+					/* parsing target structure closing bracket*/
+					parse_struct_stop(file);
+				}else{
+					LM_ERR("Error in parsing in target options \n");
+					goto errclose;
+				}
+				/* intermediary variables for more lisibility */
 				if (str_strcasecmp(&rewrite_host, &CR_EMPTY_PREFIX) == 0) {
-					rewrite_host.s = "";
+					rewrite_host.s[0] = '\0';
 					rewrite_host.len = 0;
 				}
-
-				LM_INFO("loading target %.*s\n", rewrite_host.len, rewrite_host.s);
-				prob = cfg_getfloat(t, "prob");
-				strip = cfg_getint(t, "strip");
-				rewrite_prefix.s = (char *)cfg_getstr(t, "rewrite_prefix");
-				if (rewrite_prefix.s==NULL) rewrite_prefix.s="";
-				rewrite_prefix.len = strlen(rewrite_prefix.s);
-				rewrite_suffix.s = (char *)cfg_getstr(t, "rewrite_suffix");
-				if (rewrite_suffix.s==NULL) rewrite_suffix.s="";
-				rewrite_suffix.len = strlen(rewrite_suffix.s);
-				hash_index = cfg_getint(t, "hash_index");
-				comment.s = (char *)cfg_getstr(t, "comment");
-				if (comment.s==NULL) comment.s="";
-				comment.len = strlen(comment.s);
-				status = cfg_getint(t, "status");
-
-				if ((backed_up_size = cfg_size(t, "backed_up")) > 0) {
+				LM_DBG("loading target %.*s\n", rewrite_host.len, rewrite_host.s);
+				prob = target_options[TO_ID_PROB].value.float_data;
+				strip = target_options[TO_ID_STRIP].value.int_data;
+				rewrite_prefix.s = target_options[TO_ID_REWR_PREFIX].value.string_data.s;
+				rewrite_prefix.len = target_options[TO_ID_REWR_PREFIX].value.string_data.len;
+				rewrite_suffix.s = target_options[TO_ID_REWR_SUFFIX].value.string_data.s;
+				rewrite_suffix.len = target_options[TO_ID_REWR_SUFFIX].value.string_data.len;
+				hash_index = target_options[TO_ID_HASH_INDEX].value.int_data;
+				comment.s = target_options[TO_ID_COMMENT].value.string_data.s;
+				comment.len = target_options[TO_ID_COMMENT].value.string_data.len;
+				status = target_options[TO_ID_STATUS].value.int_data;
+
+				if ( (backed_up_size = target_options[TO_ID_BACKED_UP].no_elems) > 0){
 					if ((backed_up = pkg_malloc(sizeof(int) * (backed_up_size + 1))) == NULL) {
 						PKG_MEM_ERROR;
-						return -1;
+						goto errclose;
 					}
 					for (l = 0; l < backed_up_size; l++) {
-						backed_up[l] = cfg_getnint(t, "backed_up", l);
+						backed_up[l] = target_options[TO_ID_BACKED_UP].value.int_list[l];
 					}
 					backed_up[backed_up_size] = -1;
 				}
-				backup = cfg_getint(t, "backup");
-
-				domain_id = map_name2id(rd->domain_map, rd->domain_num, &domain);
-				if (domain_id < 0) {
-					LM_ERR("cannot find id for domain '%.*s'", domain.len, domain.s);
-					if (backed_up) {
-						pkg_free(backed_up);
-					}
-					return -1;
-				}
-
-				LM_INFO("adding route for prefix %.*s, to host %.*s, prob %f, backed up: %i, backup: %i\n",
-				    prefix.len, prefix.s, rewrite_host.len, rewrite_host.s, prob, backed_up_size, backup);
-				if (add_route(rd, 1, domain_id, &prefix, 0, 0, max_targets, prob, &rewrite_host,
-				              strip, &rewrite_prefix, &rewrite_suffix, status,
-				              hash_index, backup, backed_up, &comment) < 0) {
+				backup = target_options[TO_ID_BACKUP].value.int_data;
+
+				LM_ERR("\n Adding route to tree <'%.*s'>: prefix_name:%s\n,"
+						" max_targets =%d\n, prob=%f\n, rewr_host=%s\n,"
+						" strip=%i\n, rwr_prefix=%s\n, rwr_suff=%s\n,"
+						" status=%i\n, hash_index=%i\n, comment=%s \n",
+						domain_data->name->len, domain_data->name->s, prefix_name.s,
+						max_targets, prob, rewrite_host.s, strip, rewrite_prefix.s,
+						rewrite_suffix.s, status, hash_index, comment.s);
+
+				if (add_route_to_tree(domain_data->tree, &prefix_name, 0, 0,
+						&prefix_name, max_targets, prob, &rewrite_host,
+						strip, &rewrite_prefix, &rewrite_suffix, status,
+						hash_index, backup, backed_up, &comment) < 0) {
 					LM_INFO("Error while adding route\n");
 					if (backed_up) {
 						pkg_free(backed_up);
 					}
-					return -1;
+					goto errclose;
 				}
+
 				if (backed_up) {
 					pkg_free(backed_up);
 				}
 				backed_up = NULL;
 			}
+
+			if (k != prefix_options[0].value.int_data ) {
+				LM_ERR("Error in parsing: max_targets =%i, actual targets =%i \n",
+						prefix_options[0].value.int_data, i);
+				goto errclose;
+			}
+			/* parsing prefix structure closing bracket */
+			if (parse_struct_stop(file) != SUCCESSFUL_PARSING) {
+				LM_ERR("Error in parsing targets, expecting } \n");
+				goto errclose;
+
+			}
+		} // END OF PREFIX part
+
+		/* parsing domain structure closing bracket */
+		if (parse_struct_stop(file) != SUCCESSFUL_PARSING) {
+			LM_ERR("Error in parsing targets, expecting } \n");
+			goto errclose;
 		}
+	}
 
+	if (EOF_REACHED != ret_domain){
+		LM_ERR("Error appeared while parsing domain header \n");
+		goto errclose;
 	}
-	cfg_free(cfg);
+
+	LM_ERR("File parsed successfully \n");
+	fclose(file);
 	return 0;
+errclose:
+	fclose(file);
+	return -1;
 }
 
-
 /**
  * Does the work for save_config, traverses the routing data tree
  * and writes each rule to file.
diff --git a/modules/carrierroute/doc/carrierroute_admin.xml b/modules/carrierroute/doc/carrierroute_admin.xml
index 11c1b6a..2780114 100644
--- a/modules/carrierroute/doc/carrierroute_admin.xml
+++ b/modules/carrierroute/doc/carrierroute_admin.xml
@@ -95,21 +95,6 @@
 	    	</itemizedlist>
 	    </para>
 	</section>
-	<section>
-	    <title>External Libraries or Applications</title>
-	    <para>
-		The following libraries or applications must be installed before running
-		&kamailio; with this module loaded:
-		<itemizedlist>
-		    <listitem>
-			<para>
-				<emphasis>libconfuse</emphasis>, a configuration file parser library.
-				( http://www.nongnu.org/confuse/ )
-			</para>
-		    </listitem>
-		</itemizedlist>
-	    </para>
-	</section>
     </section>
     <section>
 	<title>Parameters</title>
diff --git a/modules/carrierroute/parser_carrierroute.c b/modules/carrierroute/parser_carrierroute.c
new file mode 100644
index 0000000..55beb93
--- /dev/null
+++ b/modules/carrierroute/parser_carrierroute.c
@@ -0,0 +1,411 @@
+/*
+ * $Id$
+ *
+ * Copyright (C) 1&1 Internet AG
+ *
+ * This file is part of SIP-router, a free SIP server.
+ *
+ * SIP-router is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version
+ *
+ * SIP-router is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/*!
+ * \file parser_carrierroute.c
+ * \brief Functions for parsing the config file of cr when using file mode.
+ * \ingroup carrierroute
+ * - Module; \ref carrierroute
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <float.h>
+#include <math.h>
+#include <errno.h>
+#include "parser_carrierroute.h"
+
+#include "../../ut.h"
+#include "../../trim.h"
+
+#define assert_not_null(s) do { \
+	if ( NULL == (s) ){ \
+		LM_INFO("Unexpected null option \n"); \
+		return ERROR_IN_PARSING;\
+	} \
+} while (0)
+
+
+/**
+ * Gets index of given option inside option list
+ *
+ * @param opt_name    name of option
+ * @param opt_list    points to the option list
+ * @param no_options  size of option list
+ *
+ * @return index of option inside option list, -1 not found
+ */
+int get_option_position(const char* opt_name, const option_description* opt_list, int no_options){
+	int i;
+	for (i = 0; i<no_options; i++){
+		if (strcmp(opt_name, opt_list[i].name) == 0){
+			return i;
+		}
+	}
+	return -1;
+}
+
+
+/**
+ * Fills special structure with params from src string
+ *
+ * @param int_list    string of type {INT_VAL [, INT_VAL]*}
+ * @param opts        destination option_description variable
+ *
+ * @return number of integers in int_list, on success
+ *         ERROR_IN_PARSING, on error
+ */
+int parse_int_list(char *int_list, option_description* opts){
+	char *pch, *endptr;
+	long val;
+
+	pch = strtok (int_list,", \t");
+
+	while ( pch != NULL )
+	{
+		LM_DBG("Parsing [%s] \n", pch);
+		if ( INT_LIST_MAX_SIZE == opts->no_elems){
+			LM_ERR("INT LIST exceeds max allowed size of: %d \n", INT_LIST_MAX_SIZE);
+			return ERROR_IN_PARSING;
+		}
+
+		endptr = NULL;
+		val = strtol(pch, &endptr, 10);
+
+		if ( val < 0 || val> INT_MAX){
+			LM_ERR("Parsed value is out of bounds \n");
+			return ERROR_IN_PARSING;
+		}
+
+		if (*endptr != '\0'){
+			LM_ERR("Parsed value is not integer \n");
+			return ERROR_IN_PARSING;
+		}
+
+		opts->value.int_list[opts->no_elems] = (int) val;
+		opts->no_elems ++;
+		pch = strtok (NULL, ", \t");
+	}
+
+	if ( 0 == opts->no_elems ){
+		LM_ERR("The number of int elements cannot be 0 \n");
+		return ERROR_IN_PARSING;
+	}
+	return opts->no_elems;
+}
+
+/**
+ * Tries to parse right value string into an option
+ *
+ * @param src   str source
+ * @param opt   the option to be filled
+ *
+ * @return SUCCESSFUL_PARSING, ERROR_IN_PARSING
+ */
+int parse_rv_option(str src, option_description* opt){
+	long l_val;
+	double d_val;
+	char* endptr;
+	int i, ret = ERROR_IN_PARSING;
+
+	switch (opt->type)
+	{
+		case CFG_INT:
+			l_val = strtol(src.s, &endptr, 10);
+
+			if (errno == ERANGE && (l_val == LONG_MAX || l_val == LONG_MIN)) {
+					LM_ERR("Conversion error for %s\n", src.s);
+			}else
+			if (*endptr != '\0'){
+				LM_ERR("Value is not integer \n");
+			}else
+			if ( l_val < 0 || l_val> INT_MAX){
+				LM_ERR("The number is out of bounds \n");
+			}
+			else{// successful rv conversion
+				opt->value.int_data = l_val;
+				LM_DBG("Key=<%s>, value=<%i> \n", opt->name, opt->value.int_data);
+				ret = SUCCESSFUL_PARSING;
+			}
+			break;
+		case CFG_FLOAT:
+			d_val = strtod(src.s, &endptr);
+
+			if (errno == ERANGE && (d_val == -HUGE_VAL || d_val == HUGE_VAL)) {
+				LM_ERR("Conversion error for %s\n", src.s);
+			}else
+			if (*endptr != '\0'){
+				LM_ERR("Value is not float \n");
+			}else
+			if ( d_val < 0.0 || d_val> FLT_MAX){
+				LM_ERR("The number is out of bounds \n");
+			}else{
+				opt->value.float_data = d_val;
+				LM_DBG("Key=<%s>, value=<%f> \n", opt->name, opt->value.float_data);
+				ret = SUCCESSFUL_PARSING;
+			}
+			break;
+		case CFG_STR:
+			if ((src.s[0] != '"') && (src.s[src.len-1] != '"')){
+				LM_ERR("Not a string \n");
+			}
+			else{
+				// we now expect a string with NO " inside
+				for (i=1; i< src.len-2; i++)
+					if (src.s[i] == '"') {
+						LM_ERR("Not a string \n");
+						return ERROR_IN_PARSING;
+					}
+				strcpy( opt->value.string_data.s, src.s);
+				opt->value.string_data.len = src.len;
+				LM_DBG("String Key=<%s>, value=<%s> \n", opt->name, opt->value.string_data.s);
+				ret = SUCCESSFUL_PARSING;
+			}
+			break;
+		case CFG_INT_LIST:
+			// int list looks like: lv = {NO1 [,NO]*}
+			if ((src.len == 2) || ((src.s[0] != '{') && (src.s[src.len-1] != '}'))){
+				LM_ERR("Not an int list \n");
+			}
+			else{
+				src.s[src.len-1]='\0';src.s++; src.len = src.len-2;
+				//parse a list of comma separated integers
+				if ( parse_int_list(src.s, opt) != ERROR_IN_PARSING ){
+					// dbg printing of parsed values
+					LM_DBG("The number of elements in int_list: %d \n", opt->no_elems);
+					for ( i =0; i< opt->no_elems; i++ ){
+						LM_DBG("	value=<%d> \n", opt->value.int_list[i]);
+					}
+					ret = SUCCESSFUL_PARSING;
+				}
+			}
+			break;
+		default:
+			break;
+	}
+
+	opt->visited = VISITED;
+	return ret;
+}
+
+/**
+ * Parses the options part in a file and populates a destination structure.
+ * The end of the options part should be signaled by end_str string.
+ *
+ * @param file pointer to source file
+ * @param opts destiation option structure to be populated
+ * @param no_options expected number of options
+ * @param end_str the delimiter that signals end of options zone
+ *
+ * @return  SUCCESSFUL_PARSING on success, ERROR_IN_PARSING on error
+ */
+int parse_options(FILE* file, option_description* opts, int no_options, char* end_str){
+	str  data, lv_str, rv_str;
+	char *pch, buf[CR_MAX_LINE_SIZE], lv[CR_MAX_LINE_SIZE], rv[CR_MAX_LINE_SIZE];
+	int opt_pos, full_line_len, ret;
+
+	ret = ERROR_IN_PARSING;
+	data.s = buf;
+
+	/* refactor data.s = buf using get_non_blank_line */
+	while ( get_non_blank_line( &data, CR_MAX_LINE_SIZE, file, &full_line_len) == 0  ) /* read a line */
+	{
+		LM_DBG("Parsing line: %.*s \n", data.len, data.s);
+
+		/* parsing stops when end_str is reached: e.g: }, target */
+		if ( strncmp(data.s, end_str, strlen(end_str)) == 0){
+			LM_DBG("End of options list received \n");
+			fseek(file, -full_line_len, SEEK_CUR);
+			ret = SUCCESSFUL_PARSING;
+			break;
+		}
+
+		/* Line must be of type lv = rv */
+		if ( (pch =  strchr(data.s,'=')) == NULL){
+			LM_ERR("Parsed line does not contain = delimiter \n");
+			break;
+		}
+		else{ /* parse lv, rv */
+			strncpy(lv, data.s, pch-data.s); lv[pch-data.s]='\0';
+			strncpy(rv, pch+1, CR_MAX_LINE_SIZE-1); rv[CR_MAX_LINE_SIZE-1]='\0';
+			LM_DBG("lv=%s, rv=%s\n", lv, rv);
+			lv_str.s=lv; lv_str.len=(int)strlen(lv); trim(&lv_str); lv_str.s[lv_str.len] = '\0';
+			rv_str.s=rv; rv_str.len=(int)strlen(rv); trim(&rv_str); rv_str.s[rv_str.len] = '\0';
+
+			if ( (lv_str.len == 0) || (rv_str.len == 0)){
+				LM_ERR("String is not lv = rv \n");
+				break;
+			}
+
+			/* Parsing lv */
+			if ( (opt_pos = get_option_position(lv_str.s, opts, no_options )) < 0){
+				LM_ERR("Unexpected option received: %s \n", lv);
+				break;
+			}
+
+			if ( VISITED == opts[opt_pos].visited ){
+				LM_ERR("Duplicate option definition %s \n", opts[opt_pos].name);
+				break;
+			}
+
+			/* Parsing rv: this is the only case the options parsing continues */
+			if ( (rv_str.len != 0 ) && (parse_rv_option(rv_str, &opts[opt_pos]) == ERROR_IN_PARSING ))
+			{
+				LM_ERR("Error in parsing rv value \n");
+				break;
+			}
+		}
+	}
+	return ret;
+}
+
+
+/**
+ * Searches for next content line in the src file
+ *
+ * @param data the destination trimmed non blank line
+ * @param size maximum accepted line length
+ * @param file source file
+ * @param p_full_len initial lenght of contents line
+ *
+ * @return  0 on success, -1 on error, 1 on EOF
+ */
+int get_non_blank_line(str* line, int size, FILE* file, int* pFull_len ){
+	char* buf = line->s;
+
+	while ( line->s = buf, fgets( line->s, size, file) != NULL ) /* read a line */
+	{
+		*pFull_len = line->len = strlen(line->s);
+		LM_DBG("line is %s ", line->s);
+		/*  missing newline indicates the line length was too big */
+		if ( line->s[line->len-1] != '\n' ){
+			LM_ERR("Unaccepted line length \n");
+			return -1;
+		}
+		trim(line);
+		if( line->len != 0 ){ /* we have a non blank line */
+			line->s[line->len] = '\0'; /* just mark end of string*/
+			return 0;
+		}
+	}
+	//EOF
+	return 1;
+}
+
+
+/**
+ * Parses the header of structure part in the source file and retrieves name.
+ *
+ * @param file pointer to source file
+ * @param expected_struct_type name of expected structure
+ * @param struct_name the parsed name of the structure.
+ *
+ * @return SUCCESSFUL_PARSING, EOF_REACHED, ERROR_IN_PARSING
+ */
+int parse_struct_header(FILE* file, char* expected_struct_type, str* struct_name){
+	str data;
+	char buf[CR_MAX_LINE_SIZE], name[CR_MAX_LINE_SIZE];
+	char str2[CR_MAX_LINE_SIZE], format[CR_MAX_LINE_SIZE];
+	int no_toks, full_line_len, ret;
+
+	ret = ERROR_IN_PARSING;
+
+	data.s = buf;
+	if( get_non_blank_line( &data, CR_MAX_LINE_SIZE, file, &full_line_len) == 1 ) {/* read a line */
+		LM_DBG("Graceful exit out of parse struct \n");
+		return EOF_REACHED;
+	}
+
+	snprintf(format, CR_MAX_LINE_SIZE-1, " %s %%s %%s %%*s", expected_struct_type);
+	no_toks = sscanf(data.s, format, name, str2);
+	LM_DBG("no_tok=<%d>, name=<%s> , delim=<%s>\n", no_toks, name, str2);
+
+	switch (no_toks) {
+	/* With 1 token parsed, correct is: "domain_name" OR "domain_name{" */
+	case 1:
+		if ( name[strlen(name)-1] == '{' ) {
+			if (strlen(name) > 1) {
+				name[strlen(name)-1]='\0';
+				ret = SUCCESSFUL_PARSING;
+			}
+			else {
+				LM_ERR("Domain name seems to be empty \n");
+			}
+		}
+		else{ /* is the following non blank line a "{" ? */
+			str new_line;
+			char new_line_buf[CR_MAX_LINE_SIZE];
+			new_line.s = new_line_buf;
+
+			if ( get_non_blank_line(&new_line, CR_MAX_LINE_SIZE, file, &full_line_len) != 0 ) {
+				LM_ERR("Unexpected end of file while waiting for { \n");
+			} else
+			if ( strncmp(new_line.s, "{", 1) != 0) {
+				LM_ERR("Unexpected token while waiting for { \n");
+			}
+			else
+				ret = SUCCESSFUL_PARSING;
+		}
+		break;
+	/* with 2 tokens parsed, the second must be "{" */
+	case 2:
+		if (( strncmp(str2, "{", 1) != 0))
+			LM_ERR("Wrongly formatted line: %s\n", data.s);
+		else
+			ret = SUCCESSFUL_PARSING;
+		break;
+	default:
+		LM_ERR("Wrong number of tokens in line: %s\n", data.s);
+	}
+
+	if ( SUCCESSFUL_PARSING == ret ){
+		LM_DBG( "Sucessfully parsed struct %s - <%s> header\n", expected_struct_type, name);
+		struct_name->len = strlen(name);
+		memcpy(struct_name->s, name, struct_name->len);
+		struct_name->s[struct_name->len]='\0';
+	}
+	else
+		fseek(file, -full_line_len, SEEK_CUR);
+
+	return ret;
+}
+
+int parse_struct_stop(FILE* file){
+	char buf[CR_MAX_LINE_SIZE];
+	str data;
+	int full_line_len;
+	data.s = buf;
+
+	if ( get_non_blank_line(&data, CR_MAX_LINE_SIZE, file, &full_line_len) == -1 )	{
+		LM_INFO("EOF received \n");
+		return ERROR_IN_PARSING;
+	}
+
+	if (strcmp(data.s, "}") != 0){
+		LM_INFO("Unexpected <%s> while waiting for } \n", data.s);
+		return ERROR_IN_PARSING;
+	}
+	return SUCCESSFUL_PARSING;
+}
diff --git a/modules/carrierroute/parser_carrierroute.h b/modules/carrierroute/parser_carrierroute.h
new file mode 100644
index 0000000..9af0b1d
--- /dev/null
+++ b/modules/carrierroute/parser_carrierroute.h
@@ -0,0 +1,92 @@
+/*
+ * $Id$
+ *
+ * Copyright (C) 1&1 Internet AG
+ *
+ * This file is part of SIP-router, a free SIP server.
+ *
+ * SIP-router is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version
+ *
+ * SIP-router is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/*!
+ * \file parser_carrierroute.h
+ * \brief Functions for parsing the config file of cr when using file mode.
+ * \ingroup carrierroute
+ * - Module; \ref carrierroute
+ */
+
+#ifndef PARSER_CARRIERROUTE_H_
+#define PARSER_CARRIERROUTE_H_
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <float.h>
+#include <math.h>
+#include <errno.h>
+#include "../../str.h"
+#include "../../mem/shm_mem.h"
+#include "../../mem/mem.h"
+
+#define CR_MAX_LINE_SIZE 256
+#define MAX_FIELD_NAME 60
+#define INT_LIST_MAX_SIZE 10
+
+#define NOT_VISITED 0
+#define VISITED 1
+
+#define EXPECTED_END_OF_OPTS 0
+#define ERROR_IN_PARSING  -1
+#define SUCCESSFUL_PARSING 1
+#define EOF_REACHED 2
+
+#define DEFAULT_DOMAIN_NUM 16
+#define MAX_DOMAIN_NUM 64 // must be a power of 2
+
+enum opt_type { CFG_STR=0, CFG_INT, CFG_FLOAT, CFG_INT_LIST, MAX_OPTS};
+
+union opt_data{
+	int int_data;
+	float float_data;
+	str string_data;
+	int  int_list[INT_LIST_MAX_SIZE];
+};
+
+typedef struct {
+	char           	name[MAX_FIELD_NAME];
+	enum opt_type	type;
+	union opt_data	value;
+	int         	visited;
+	int 		no_elems; // TBD: name should suggest int_list_no_elems
+	char		str_buf[CR_MAX_LINE_SIZE];
+} option_description;
+
+int get_non_blank_line(str* data, int size, FILE* file, int* full_line_len);
+
+int get_option_position(const char* opt_name, const option_description* opt_list, int no_options);
+
+int parse_options(FILE* file, option_description* opts, int no_options, char* end_str);
+
+int parse_struct_header(FILE* file, char* expected_struct_type, str* struct_name);
+
+int next_token_is_eof(FILE* file);
+
+int next_token_is_struct_stop(FILE* file);
+
+int parse_struct_stop(FILE* file);
+
+#endif /* PARSER_CARRIERROUTE_H_ */
diff --git a/modules/cnxcc/cnxcc.c b/modules/cnxcc/cnxcc.c
index e869af4..cf9619f 100644
--- a/modules/cnxcc/cnxcc.c
+++ b/modules/cnxcc/cnxcc.c
@@ -28,17 +28,17 @@
 
 #include "cnxcc.h"
 
-inline void get_datetime(str *dest)
+void get_datetime(str *dest)
 {
 	timestamp2isodt(dest, get_current_timestamp());
 }
 
-inline unsigned int get_current_timestamp()
+unsigned int get_current_timestamp()
 {
 	return time(NULL);
 }
 
-inline int timestamp2isodt(str *dest, unsigned int timestamp)
+int timestamp2isodt(str *dest, unsigned int timestamp)
 {
 	time_t  		tim;
 	struct tm 		*tmPtr;
diff --git a/modules/cnxcc/cnxcc.h b/modules/cnxcc/cnxcc.h
index 9454e16..86bcbe3 100644
--- a/modules/cnxcc/cnxcc.h
+++ b/modules/cnxcc/cnxcc.h
@@ -31,9 +31,9 @@
 #define DATETIME_LENGTH		DATETIME_SIZE - 1
 
 
-inline void get_datetime(str *dest);
-inline unsigned int get_current_timestamp();
-inline int timestamp2isodt(str *dest, unsigned int timestamp);
+void get_datetime(str *dest);
+unsigned int get_current_timestamp();
+int timestamp2isodt(str *dest, unsigned int timestamp);
 double str2double(str *string);
 
 #endif /* _CNXCC_H */
diff --git a/modules/cnxcc/cnxcc_check.c b/modules/cnxcc/cnxcc_check.c
index eb58899..a5b7c93 100644
--- a/modules/cnxcc/cnxcc_check.c
+++ b/modules/cnxcc/cnxcc_check.c
@@ -36,18 +36,17 @@ extern data_t _data;
 void check_calls_by_money(unsigned int ticks, void *param)
 {
 	struct str_hash_entry *h_entry 	= NULL,
-						  *tmp		= NULL;
-	call_t *tmp_call				= NULL;
+			  *tmp		= NULL;
+	call_t *tmp_call		= NULL;
 	int i;
 
 	lock_get(&_data.money.lock);
-
 	if (_data.money.credit_data_by_client->table)
 		for(i = 0; i < _data.money.credit_data_by_client->size; i++)
 			clist_foreach_safe(&_data.money.credit_data_by_client->table[i], h_entry, tmp, next)
 			{
 				credit_data_t *credit_data	= (credit_data_t *) h_entry->u.p;
-				call_t *call				= NULL;
+				call_t *call			= NULL;
 				double total_consumed_money	= 0;
 
 				if (i > SAFE_ITERATION_THRESHOLD)
@@ -55,7 +54,6 @@ void check_calls_by_money(unsigned int ticks, void *param)
 					LM_ERR("Too many iterations for this loop: %d", i);
 					break;
 				}
-
 				lock_get(&credit_data->lock);
 
 				clist_foreach_safe(credit_data->call_list, call, tmp_call, next)
@@ -65,7 +63,7 @@ void check_calls_by_money(unsigned int ticks, void *param)
 					if (!call->confirmed)
 						continue;
 
-					consumed_time 				= get_current_timestamp() - call->start_timestamp;
+					consumed_time 		= get_current_timestamp() - call->start_timestamp;
 
 					if (consumed_time > call->money_based.initial_pulse)
 					{
@@ -91,7 +89,7 @@ void check_calls_by_money(unsigned int ticks, void *param)
 																			call->consumed_amount
 																			);
 				}
-
+				
 				if (credit_data->concurrent_calls == 0)
 				{
 					lock_release(&credit_data->lock);
@@ -107,9 +105,10 @@ void check_calls_by_money(unsigned int ticks, void *param)
 
 				if (credit_data->consumed_amount >= credit_data->max_amount)
 				{
+					lock_release(&_data.money.lock);
 					terminate_all_calls(credit_data);
 					lock_release(&credit_data->lock);
-					break;
+					return;
 				}
 
 				lock_release(&credit_data->lock);
@@ -121,8 +120,8 @@ void check_calls_by_money(unsigned int ticks, void *param)
 void check_calls_by_time(unsigned int ticks, void *param)
 {
 	struct str_hash_entry *h_entry 	= NULL,
-						  *tmp		= NULL;
-	call_t *tmp_call				= NULL;
+			*tmp		= NULL;
+	call_t *tmp_call		= NULL;
 	int i;
 
 	lock_get(&_data.time.lock);
@@ -132,7 +131,7 @@ void check_calls_by_time(unsigned int ticks, void *param)
 			clist_foreach_safe(&_data.time.credit_data_by_client->table[i], h_entry, tmp, next)
 			{
 				credit_data_t *credit_data	= (credit_data_t *) h_entry->u.p;
-				call_t *call				= NULL;
+				call_t *call			= NULL;
 				int total_consumed_secs		= 0;
 
 				lock_get(&credit_data->lock);
@@ -150,8 +149,8 @@ void check_calls_by_time(unsigned int ticks, void *param)
 					if (!call->confirmed)
 						continue;
 
-					call->consumed_amount		= get_current_timestamp() - call->start_timestamp;
-					total_consumed_secs			+= call->consumed_amount;
+					call->consumed_amount	= get_current_timestamp() - call->start_timestamp;
+					total_consumed_secs	+= call->consumed_amount;
 
 					if (call->consumed_amount > call->max_amount)
 					{
@@ -180,10 +179,11 @@ void check_calls_by_time(unsigned int ticks, void *param)
 																									(int) credit_data->max_amount);
 
 				if (credit_data->consumed_amount >= credit_data->max_amount)
-				{
+				{				
+					lock_release(&_data.time.lock);
 					terminate_all_calls(credit_data);
 					lock_release(&credit_data->lock);
-					break;
+					return;
 				}
 
 				lock_release(&credit_data->lock);
diff --git a/modules/cnxcc/cnxcc_mod.c b/modules/cnxcc/cnxcc_mod.c
index 808df1f..22330cc 100644
--- a/modules/cnxcc/cnxcc_mod.c
+++ b/modules/cnxcc/cnxcc_mod.c
@@ -68,12 +68,12 @@
 
 MODULE_VERSION
 
-#define HT_SIZE						229
-#define MODULE_NAME					"cnxcc"
-#define NUMBER_OF_TIMERS			2
+#define HT_SIZE			229
+#define MODULE_NAME		"cnxcc"
+#define NUMBER_OF_TIMERS	2
 
-#define TRUE						1
-#define FALSE						0
+#define TRUE			1
+#define FALSE			0
 
 data_t _data;
 struct dlg_binds _dlgbinds;
@@ -154,7 +154,7 @@ static cmd_export_t cmds[] =
 
 static param_export_t params[] =
 {
-	{"dlg_flag",  				INT_PARAM,			&_data.ctrl_flag	},
+	{"dlg_flag",  			INT_PARAM,			&_data.ctrl_flag	},
 	{"credit_check_period",  	INT_PARAM,			&_data.check_period	},
 	{ 0, 0, 0 }
 };
@@ -198,17 +198,17 @@ select_row_t sel_declaration[] = {
 struct module_exports exports =
 {
 	MODULE_NAME,
-	DEFAULT_DLFLAGS, 	/* dlopen flags */
+	DEFAULT_DLFLAGS,/* dlopen flags */
 	cmds,
 	params,
-	0,          		/* exported statistics */
-	0, 		    		/* exported MI functions */
-	mod_pvs,  			/* exported pseudo-variables */
-	0,          		/* extra processes */
-	mod_init,   		/* module initialization function */
+	0,          	/* exported statistics */
+	0, 	    	/* exported MI functions */
+	mod_pvs,	/* exported pseudo-variables */
+	0,          	/* extra processes */
+	mod_init,   	/* module initialization function */
 	0,
 	0,
-	child_init          /* per-child init function */
+	child_init	/* per-child init function */
 };
 
 static int fixup_par(void** param, int param_no)
@@ -261,7 +261,7 @@ static int mod_init(void)
 	_data.channel.credit_data_by_client	= shm_malloc(sizeof(struct str_hash_table));
 	_data.channel.call_data_by_cid 		= shm_malloc(sizeof(struct str_hash_table));
 
-	_data.stats							= (stats_t *) shm_malloc(sizeof(stats_t));
+	_data.stats				= (stats_t *) shm_malloc(sizeof(stats_t));
 
 	if (!_data.stats)
 	{
@@ -269,9 +269,9 @@ static int mod_init(void)
 		return -1;
 	}
 
-	_data.stats->active		= 0;
+	_data.stats->active	= 0;
 	_data.stats->dropped	= 0;
-	_data.stats->total		= 0;
+	_data.stats->total	= 0;
 
 	if (init_hashtable(_data.time.credit_data_by_client) != 0)
 		return -1;
@@ -336,8 +336,7 @@ static int child_init(int rank)
 		return -1;
 	}
 
-	if(fork_dummy_timer(PROC_TIMER, "CNXCC MB TIMER", 1,
-								check_calls_by_time, NULL, _data.check_period) < 0)
+	if(fork_dummy_timer(PROC_TIMER, "CNXCC MB TIMER", 1, check_calls_by_time, NULL, _data.check_period) < 0)
 	{
 		LM_ERR("failed to register MB TIMER routine as process\n");
 		return -1;
@@ -423,11 +422,11 @@ static void notify_call_termination(str *callid, str *from_tag, str *to_tag)
 int try_get_credit_data_entry(str *client_id, credit_data_t **credit_data)
 {
 	struct str_hash_entry *cd_entry	= NULL;
-	hash_tables_t *hts				= NULL;
-	*credit_data					= NULL;
+	hash_tables_t *hts		= NULL;
+	*credit_data			= NULL;
 
 	/* by money */
-	hts					= &_data.money;
+	hts				= &_data.money;
 	lock_get(&hts->lock);
 
 	cd_entry			= str_hash_get(hts->credit_data_by_client, client_id->s, client_id->len);
@@ -442,7 +441,7 @@ int try_get_credit_data_entry(str *client_id, credit_data_t **credit_data)
 	lock_release(&hts->lock);
 
 	/* by time */
-	hts					= &_data.time;
+	hts				= &_data.time;
 	lock_get(&hts->lock);
 
 	cd_entry			= str_hash_get(hts->credit_data_by_client, client_id->s, client_id->len);
@@ -457,7 +456,7 @@ int try_get_credit_data_entry(str *client_id, credit_data_t **credit_data)
 	lock_release(&hts->lock);
 
 	/* by channel */
-	hts					= &_data.channel;
+	hts				= &_data.channel;
 	lock_get(&hts->lock);
 
 	cd_entry			= str_hash_get(hts->credit_data_by_client, client_id->s, client_id->len);
@@ -477,11 +476,10 @@ int try_get_credit_data_entry(str *client_id, credit_data_t **credit_data)
 int try_get_call_entry(str *callid, call_t **call, hash_tables_t **hts)
 {
 	struct str_hash_entry *call_entry	= NULL;
-
 	*call					= NULL;
 
 	/* by money */
-	*hts					= &_data.money;
+	*hts				= &_data.money;
 	lock_get(&(*hts)->lock);
 
 	call_entry			= str_hash_get((*hts)->call_data_by_cid, callid->s, callid->len);
@@ -531,9 +529,9 @@ int try_get_call_entry(str *callid, call_t **call, hash_tables_t **hts)
 static void stop_billing(str *callid)
 {
 	struct str_hash_entry *cd_entry		= NULL;
-	call_t *call						= NULL;
-	hash_tables_t *hts					= NULL;
-	credit_data_t *credit_data			= NULL;
+	call_t *call				= NULL;
+	hash_tables_t *hts			= NULL;
+	credit_data_t *credit_data		= NULL;
 
 	/*
 	 * Search call data by call-id
@@ -557,11 +555,10 @@ static void stop_billing(str *callid)
 	}
 
 	lock_get(&hts->lock);
-
 	/*
 	 * Search credit_data by client_id
 	 */
-	cd_entry			= str_hash_get(hts->credit_data_by_client, call->client_id.s, call->client_id.len);
+	cd_entry	= str_hash_get(hts->credit_data_by_client, call->client_id.s, call->client_id.len);
 
 	if (cd_entry == NULL)
 	{
@@ -580,12 +577,12 @@ static void stop_billing(str *callid)
 	}
 
 	lock_release(&hts->lock);
-
 	/*
 	 * Update calls statistics
 	 */
 	lock_get(&_data.lock);
 
+;
 	_data.stats->active--;
 	_data.stats->total--;
 
@@ -831,7 +828,7 @@ exit:
 void terminate_all_calls(credit_data_t *credit_data)
 {
 	call_t 	*call 	= NULL,
-			*tmp 	= NULL;
+		*tmp 	= NULL;
 
 	clist_foreach_safe(credit_data->call_list, call, tmp, next)
 	{
@@ -855,15 +852,15 @@ static void free_call(call_t *call)
 
 	LM_DBG("Freeing call [%.*s]\n", call->sip_data.callid.len, call->sip_data.callid.s);
 
-	e			= str_hash_get(_data.money.call_data_by_cid, call->sip_data.callid.s, call->sip_data.callid.len);
+	e 	= str_hash_get(_data.money.call_data_by_cid, call->sip_data.callid.s, call->sip_data.callid.len);
 
 	if (e == NULL)
 	{
-		e			= str_hash_get(_data.time.call_data_by_cid, call->sip_data.callid.s, call->sip_data.callid.len);
+		e	= str_hash_get(_data.time.call_data_by_cid, call->sip_data.callid.s, call->sip_data.callid.len);
 
 		if (e == NULL)
 		{
-			e			= str_hash_get(_data.channel.call_data_by_cid, call->sip_data.callid.s, call->sip_data.callid.len);
+			e	= str_hash_get(_data.channel.call_data_by_cid, call->sip_data.callid.s, call->sip_data.callid.len);
 
 			if (e == NULL)
 			{
@@ -910,21 +907,21 @@ static int shm_str_hash_alloc(struct str_hash_table *ht, int size)
 static credit_data_t *get_or_create_credit_data_entry(str *client_id, credit_type_t type)
 {
 	struct str_hash_table *ht	= NULL;
-	gen_lock_t *lock			= NULL;
+	gen_lock_t *lock		= NULL;
 	struct str_hash_entry *e	= NULL;
 
 	switch(type)
 	{
 	case CREDIT_MONEY:
-		ht		= _data.money.credit_data_by_client;
+		ht	= _data.money.credit_data_by_client;
 		lock	=  &_data.money.lock;
 		break;
 	case CREDIT_TIME:
-		ht		= _data.time.credit_data_by_client;
+		ht	= _data.time.credit_data_by_client;
 		lock	=  &_data.time.lock;
 		break;
 	case CREDIT_CHANNEL:
-		ht		= _data.channel.credit_data_by_client;
+		ht	= _data.channel.credit_data_by_client;
 		lock	=  &_data.channel.lock;
 		break;
 	default:
@@ -934,7 +931,7 @@ static credit_data_t *get_or_create_credit_data_entry(str *client_id, credit_typ
 
 
 	lock_get(lock);
-	e							= str_hash_get(ht, client_id->s, client_id->len);
+	e		= str_hash_get(ht, client_id->s, client_id->len);
 	lock_release(lock);
 
 	/*
@@ -947,7 +944,7 @@ static credit_data_t *get_or_create_credit_data_entry(str *client_id, credit_typ
 	else
 	{
 		credit_data_t *credit_data	= NULL;
-		e							= shm_malloc(sizeof(struct str_hash_entry));
+		e				= shm_malloc(sizeof(struct str_hash_entry));
 
 		if (e == NULL)
 		{
@@ -961,9 +958,9 @@ static credit_data_t *get_or_create_credit_data_entry(str *client_id, credit_typ
 			return NULL;
 		}
 
-		e->flags					= 0;
-		e->u.p						= (void *) shm_malloc(sizeof(credit_data_t));
-		credit_data					= (credit_data_t *) e->u.p;
+		e->flags			= 0;
+		e->u.p				= (void *) shm_malloc(sizeof(credit_data_t));
+		credit_data			= (credit_data_t *) e->u.p;
 
 		lock_init(&credit_data->lock);
 
@@ -975,13 +972,13 @@ static credit_data_t *get_or_create_credit_data_entry(str *client_id, credit_typ
 			return NULL;
 		}
 
-		credit_data->max_amount					= 0;
+		credit_data->max_amount				= 0;
 		credit_data->concurrent_calls			= 0;
 		credit_data->consumed_amount			= 0;
-		credit_data->ended_calls_consumed_amount= 0;
+		credit_data->ended_calls_consumed_amount	= 0;
 		credit_data->number_of_calls			= 0;
 
-		credit_data->type						= type;
+		credit_data->type				= type;
 
 		/*
 		 * Copy the client_id value to the root of the calls list.
@@ -1018,7 +1015,7 @@ int terminate_call(call_t *call)
 
 	struct mi_root *root, *result	= NULL;
 	struct mi_node *node, *node1	= NULL;
-	struct mi_cmd *end_dlg_cmd		= NULL;
+	struct mi_cmd *end_dlg_cmd	= NULL;
 
 	root	= init_mi_tree(0, 0, 0);
 	if (root == NULL)
@@ -1062,7 +1059,7 @@ int terminate_call(call_t *call)
 		LM_DBG("dlg_end_dlg sent to call [%.*s]\n", call->sip_data.callid.len, call->sip_data.callid.s);
 		free_mi_tree(root);
 		free_mi_tree(result);
-
+		
 		notify_call_termination(&call->sip_data.callid, &call->sip_data.from_tag, &call->sip_data.to_tag);
 
 		return 0;
@@ -1076,8 +1073,7 @@ error:
 	return -1;
 }
 
-static call_t *alloc_new_call_by_money(credit_data_t *credit_data,
-										struct sip_msg *msg, double credit, double cost_per_second, int initial_pulse, int final_pulse)
+static call_t *alloc_new_call_by_money(credit_data_t *credit_data, struct sip_msg *msg, double credit, double cost_per_second, int initial_pulse, int final_pulse)
 {
 	call_t *call		= NULL;
 
@@ -1089,7 +1085,7 @@ static call_t *alloc_new_call_by_money(credit_data_t *credit_data,
 		goto error;
 	}
 
-	call 				= shm_malloc(sizeof(call_t));
+	call 			= shm_malloc(sizeof(call_t));
 	if (call == NULL)
 	{
 		LM_ERR("No shared memory left\n");
@@ -1106,11 +1102,11 @@ static call_t *alloc_new_call_by_money(credit_data_t *credit_data,
 	call->sip_data.to_tag.s		= NULL;
 	call->sip_data.to_tag.len 	= 0;
 	call->sip_data.from_tag.s	= NULL;
-	call->sip_data.from_tag.len = 0;
+	call->sip_data.from_tag.len 	= 0;
 
 	call->consumed_amount		= initial_pulse * cost_per_second;
-	call->confirmed				= FALSE;
-	call->max_amount			= credit;
+	call->confirmed			= FALSE;
+	call->max_amount		= credit;
 
 	call->money_based.cost_per_second	= cost_per_second;
 	call->money_based.initial_pulse		= initial_pulse;
@@ -1174,17 +1170,17 @@ static call_t *alloc_new_call_by_time(credit_data_t *credit_data, struct sip_msg
 	call->sip_data.to_tag.s		= NULL;
 	call->sip_data.to_tag.len 	= 0;
 	call->sip_data.from_tag.s	= NULL;
-	call->sip_data.from_tag.len = 0;
+	call->sip_data.from_tag.len 	= 0;
 
 	call->consumed_amount		= 0;
-	call->confirmed				= FALSE;
-	call->max_amount			= max_secs;
+	call->confirmed			= FALSE;
+	call->max_amount		= max_secs;
 
 	/*
 	 * Reference the client_id from the root of the list
 	 */
-	call->client_id.s			= credit_data->call_list->client_id.s;
-	call->client_id.len			= credit_data->call_list->client_id.len;
+	call->client_id.s		= credit_data->call_list->client_id.s;
+	call->client_id.len		= credit_data->call_list->client_id.len;
 
 	/*
 	 * Insert the newly created call to the list of calls
@@ -1211,7 +1207,7 @@ error:
 
 static call_t *alloc_new_call_by_channel(credit_data_t *credit_data, struct sip_msg *msg, int max_chan)
 {
-	call_t *call		= NULL;
+	call_t *call	= NULL;
 
 	lock_get(&credit_data->lock);
 
@@ -1221,7 +1217,7 @@ static call_t *alloc_new_call_by_channel(credit_data_t *credit_data, struct sip_
 		goto error;
 	}
 
-	call 				= shm_malloc(sizeof(call_t));
+	call 		= shm_malloc(sizeof(call_t));
 	if (call == NULL)
 	{
 		LM_ERR("No shared memory left\n");
@@ -1238,17 +1234,17 @@ static call_t *alloc_new_call_by_channel(credit_data_t *credit_data, struct sip_
 	call->sip_data.to_tag.s		= NULL;
 	call->sip_data.to_tag.len 	= 0;
 	call->sip_data.from_tag.s	= NULL;
-	call->sip_data.from_tag.len = 0;
+	call->sip_data.from_tag.len 	= 0;
 
 	call->consumed_amount		= 0;
-	call->confirmed				= FALSE;
-	call->max_amount			= max_chan;
+	call->confirmed			= FALSE;
+	call->max_amount		= max_chan;
 
 	/*
 	 * Reference the client_id from the root of the list
 	 */
-	call->client_id.s			= credit_data->call_list->client_id.s;
-	call->client_id.len			= credit_data->call_list->client_id.len;
+	call->client_id.s		= credit_data->call_list->client_id.s;
+	call->client_id.len		= credit_data->call_list->client_id.len;
 
 	/*
 	 * Insert the newly created call to the list of calls
@@ -1277,21 +1273,21 @@ error:
 static int add_call_by_cid(str *cid, call_t *call, credit_type_t type)
 {
 	struct str_hash_table *ht	= NULL;
-	gen_lock_t *lock			= NULL;
+	gen_lock_t *lock		= NULL;
 	struct str_hash_entry *e	= NULL;
 
 	switch(type)
 	{
 	case CREDIT_MONEY:
-		ht		= _data.money.call_data_by_cid;
+		ht	= _data.money.call_data_by_cid;
 		lock	=  &_data.money.lock;
 		break;
 	case CREDIT_TIME:
-		ht		= _data.time.call_data_by_cid;
+		ht	= _data.time.call_data_by_cid;
 		lock	=  &_data.time.lock;
 		break;
 	case CREDIT_CHANNEL:
-		ht		= _data.channel.call_data_by_cid;
+		ht	= _data.channel.call_data_by_cid;
 		lock	=  &_data.channel.lock;
 		break;
 	default:
@@ -1343,7 +1339,7 @@ static int add_call_by_cid(str *cid, call_t *call, credit_type_t type)
 		return -1;
 	}
 
-	e->u.p		= call;
+	e->u.p	= call;
 
 	lock_get(lock);
 	str_hash_add(ht, e);
@@ -1373,30 +1369,30 @@ static inline int get_pv_value(struct sip_msg* msg, pv_spec_t* spec, pv_value_t*
 }
 
 static int set_max_credit(struct sip_msg* msg,
-							char *str_pv_client,
-							char *str_pv_credit, char *str_pv_cps,
-							char *str_pv_inip, char *str_pv_finp)
+				char *str_pv_client,
+				char *str_pv_credit, char *str_pv_cps,
+				char *str_pv_inip, char *str_pv_finp)
 {
 	credit_data_t *credit_data 	= NULL;
-	call_t *call				= NULL;
+	call_t *call			= NULL;
 
-	pv_spec_t *client_id_spec		= (pv_spec_t *) str_pv_client,
-			  *credit_spec			= (pv_spec_t *) str_pv_credit,
-			  *cps_spec				= (pv_spec_t *) str_pv_cps,
+	pv_spec_t *client_id_spec	= (pv_spec_t *) str_pv_client,
+			  *credit_spec	= (pv_spec_t *) str_pv_credit,
+			  *cps_spec	= (pv_spec_t *) str_pv_cps,
 			  *initial_pulse_spec	= (pv_spec_t *) str_pv_inip,
-			  *final_pulse_spec		= (pv_spec_t *) str_pv_finp;
+			  *final_pulse_spec	= (pv_spec_t *) str_pv_finp;
 
 	pv_value_t client_id_val,
-				credit_val,
-				cps_val,
-				initial_pulse_val,
-				final_pulse_val;
+			credit_val,
+			cps_val,
+			initial_pulse_val,
+			final_pulse_val;
 
-	double credit					= 0,
-		   cost_per_second			= 0;
+	double credit		= 0,
+		cost_per_second	= 0;
 
-	unsigned int initial_pulse		= 0,
-			final_pulse				= 0;
+	unsigned int initial_pulse	= 0,
+			final_pulse	= 0;
 
 	if (msg->first_line.type == SIP_REQUEST && msg->first_line.u.request.method_value == METHOD_INVITE)
 	{
@@ -1539,10 +1535,10 @@ static int get_channel_count(struct sip_msg* msg, char* str_pv_client, char* str
 {
 	credit_data_t *credit_data 	= NULL;
 	pv_spec_t *chan_count_spec	= (pv_spec_t *) str_pv_chan_count,
-			  *client_id_spec	= (pv_spec_t *) str_pv_client;
+		  *client_id_spec	= (pv_spec_t *) str_pv_client;
 
 	pv_value_t chan_count_val, client_id_val;
-	int value					= -1;
+	int value			= -1;
 
 	if (pv_get_spec_value(msg, client_id_spec, &client_id_val) != 0)
 	{
@@ -1556,14 +1552,14 @@ static int get_channel_count(struct sip_msg* msg, char* str_pv_client, char* str
 		return -1;
 	}
 
-	if (try_get_credit_data_entry(&client_id_val.rs, &credit_data) == 0)
+	if (try_get_credit_data_entry(&client_id_val.rs, &credit_data) == 0) 
 		value	= credit_data->number_of_calls;
 	else
 		LM_ALERT("[%.*s] not found\n", msg->callid->body.len, msg->callid->body.s);
 
 	if (!pv_is_w(chan_count_spec))
 	{
-		LM_ERR("pvar is not writable");
+		LM_ERR("pvar is not writable\n");
 		return -1;
 	}
 
@@ -1575,7 +1571,7 @@ static int get_channel_count(struct sip_msg* msg, char* str_pv_client, char* str
 		chan_count_val.rs.s 	= int2str(value, &chan_count_val.rs.len);
 	else
 	{
-		char buff[2]			= { '-', '1' };
+		char buff[2]		= { '-', '1' };
 		chan_count_val.rs.s 	= buff;
 		chan_count_val.rs.len	= 2;
 	}
@@ -1592,11 +1588,11 @@ static int get_channel_count(struct sip_msg* msg, char* str_pv_client, char* str
 static int set_max_channels(struct sip_msg* msg, char* str_pv_client, char* str_pv_max_chan)
 {
 	credit_data_t *credit_data 	= NULL;
-	call_t *call				= NULL;
+	call_t *call			= NULL;
 	pv_spec_t *max_chan_spec	= (pv_spec_t *) str_pv_max_chan,
-			  *client_id_spec	= (pv_spec_t *) str_pv_client;
+		  *client_id_spec	= (pv_spec_t *) str_pv_client;
 	pv_value_t max_chan_val, client_id_val;
-	int max_chan				= 0;
+	int max_chan			= 0;
 
 	set_ctrl_flag(msg);
 
@@ -1640,8 +1636,8 @@ static int set_max_channels(struct sip_msg* msg, char* str_pv_client, char* str_
 		}
 
 		LM_DBG("Setting up new call for client [%.*s], max-chan[%d], call-id[%.*s]\n", client_id_val.rs.len, client_id_val.rs.s,
-																		max_chan,
-																		msg->callid->body.len, msg->callid->body.s);
+												max_chan,
+												msg->callid->body.len, msg->callid->body.s);
 
 		if ((credit_data = get_or_create_credit_data_entry(&client_id_val.rs, CREDIT_CHANNEL)) == NULL)
 		{
@@ -1650,7 +1646,7 @@ static int set_max_channels(struct sip_msg* msg, char* str_pv_client, char* str_
 		}
 
 		if (credit_data->number_of_calls + 1 > max_chan)
-			return -2; // you have, between calls being setup plus those established, more than you maximum quota
+			return -2; // you have, among calls being setup plus those established, more than you maximum quota
 
 		if (credit_data->concurrent_calls + 1 > max_chan)
 			return -3; // you have the max amount of established calls already
@@ -1679,11 +1675,11 @@ static int set_max_channels(struct sip_msg* msg, char* str_pv_client, char* str_
 static int set_max_time(struct sip_msg* msg, char* str_pv_client, char* str_pv_maxsecs)
 {
 	credit_data_t *credit_data 	= NULL;
-	call_t *call				= NULL;
+	call_t *call			= NULL;
 	pv_spec_t *max_secs_spec	= (pv_spec_t *) str_pv_maxsecs,
-			  *client_id_spec	= (pv_spec_t *) str_pv_client;
+		  *client_id_spec	= (pv_spec_t *) str_pv_client;
 	pv_value_t max_secs_val, client_id_val;
-	int max_secs				= 0;
+	int max_secs			= 0;
 
 	set_ctrl_flag(msg);
 
@@ -1812,7 +1808,7 @@ static int update_max_time(struct sip_msg* msg, char* str_pv_client, char* str_p
 	       *tmp_call		= NULL;
 
 	lock_get(&_data.time.lock);
-	e							= str_hash_get(ht, client_id_val.rs.s, client_id_val.rs.len);
+	e				= str_hash_get(ht, client_id_val.rs.s, client_id_val.rs.len);
 	lock_release(&_data.time.lock);
 
 	if (e == NULL)
@@ -1821,13 +1817,13 @@ static int update_max_time(struct sip_msg* msg, char* str_pv_client, char* str_p
 		return -1;
 	}
 		
-	credit_data					= (credit_data_t *) e->u.p;
+	credit_data			= (credit_data_t *) e->u.p;
 
 	lock_get(&credit_data->lock);
 
 	LM_DBG("Updating max-secs for [%.*s] from [%f] to [%f]\n", e->key.len, e->key.s, credit_data->max_amount, credit_data->max_amount + secs);
 	
-	credit_data->max_amount				+= secs;
+	credit_data->max_amount		+= secs;
 
 	if (credit_data->number_of_calls > 0)
 		update_fraction	= secs / credit_data->number_of_calls;
@@ -1840,7 +1836,7 @@ static int update_max_time(struct sip_msg* msg, char* str_pv_client, char* str_p
 		call->max_amount	+= update_fraction;
 	}
 
-//redit_data->consumed_amount			= 0;
+//redit_data->consumed_amount		= 0;
 
 
 	lock_release(&credit_data->lock);
diff --git a/modules/cnxcc/cnxcc_select.c b/modules/cnxcc/cnxcc_select.c
index 99b6d1f..46eb568 100644
--- a/modules/cnxcc/cnxcc_select.c
+++ b/modules/cnxcc/cnxcc_select.c
@@ -46,7 +46,7 @@ int sel_channels_count(str* res, select_t* s, struct sip_msg* msg)
 	LM_DBG("sel_channels_count for [%.*s]",  s->params[2].v.s.len, s->params[2].v.s.s);
 
 	credit_data_t *credit_data	= NULL;
-	int value					= 0;
+	int value			= 0;
 
 	if (s->params[2].v.s.len <= 0)
 	{
@@ -54,7 +54,7 @@ int sel_channels_count(str* res, select_t* s, struct sip_msg* msg)
 		return -1;
 	}
 
-	if (try_get_credit_data_entry(&s->params[2].v.s, &credit_data) >= 0)
+	if (try_get_credit_data_entry(&s->params[2].v.s, &credit_data) == 0)
 		value = credit_data->number_of_calls;
 	else
 		LM_DBG("Client [%.*s] not found", s->params[2].v.s.len, s->params[2].v.s.s);
diff --git a/modules/ctl/binrpc_run.c b/modules/ctl/binrpc_run.c
index e114c18..f0ee510 100644
--- a/modules/ctl/binrpc_run.c
+++ b/modules/ctl/binrpc_run.c
@@ -804,6 +804,7 @@ inline static str* binrpc_val_conv_str(struct binrpc_ctx* ctx,
 			s=int2str(v->u.intval, &len);
 			ret=ctl_malloc(sizeof(*ret)+len+1);
 			if (ret==0 || binrpc_gc_track(ctx, ret)!=0){
+				if(ret!=0) ctl_free(ret);
 				*err=E_BINRPC_OVERFLOW;
 				return 0;
 			}
@@ -1055,11 +1056,12 @@ static int rpc_struct_add(struct rpc_struct_l* s, char* fmt, ...)
 	struct binrpc_val avp;
 	struct rpc_struct_l* rs;
 	
-	memset(&avp, 0, sizeof(struct binrpc_val));
 	va_start(ap, fmt);
 	for (;*fmt; fmt++){
+		memset(&avp, 0, sizeof(struct binrpc_val));
 		avp.name.s=va_arg(ap, char*);
-		avp.name.len=strlen(avp.name.s);
+		if (avp.name.s)
+			avp.name.len=strlen(avp.name.s);
 		switch(*fmt){
 			case 'd':
 			case 't':
@@ -1070,7 +1072,8 @@ static int rpc_struct_add(struct rpc_struct_l* s, char* fmt, ...)
 			case 's': /* asciiz */
 				avp.type=BINRPC_T_STR;
 				avp.u.strval.s=va_arg(ap, char*);
-				avp.u.strval.len=strlen(avp.u.strval.s);
+				if (avp.u.strval.s)
+					avp.u.strval.len=strlen(avp.u.strval.s);
 				break;
 			case 'S': /* str */
 				avp.type=BINRPC_T_STR;
diff --git a/modules/db_flatstore/km_flat_con.c b/modules/db_flatstore/km_flat_con.c
index c4f38bb..5a6ae40 100644
--- a/modules/db_flatstore/km_flat_con.c
+++ b/modules/db_flatstore/km_flat_con.c
@@ -115,6 +115,7 @@ struct flat_con* flat_new_connection(struct flat_id* id)
 	fn = get_name(id);
 	if (fn==0){
 		LM_ERR("get_name() failed\n");
+		pkg_free(res);
 		return 0;
 	}
 
diff --git a/modules/db_mysql/km_dbase.c b/modules/db_mysql/km_dbase.c
index e486e5f..688d433 100644
--- a/modules/db_mysql/km_dbase.c
+++ b/modules/db_mysql/km_dbase.c
@@ -190,25 +190,24 @@ static int db_mysql_store_result(const db1_con_t* _h, db1_res_t** _r)
 	if (db_mysql_convert_result(_h, *_r) < 0) {
 		LM_ERR("error while converting result\n");
 		LM_DBG("freeing result set at %p\n", _r);
-		pkg_free(*_r);
-		*_r = 0;
 		/* all mem on Kamailio API side is already freed by
 		 * db_mysql_convert_result in case of error, but we also need
-		 * to free the mem from the mysql lib side */
-		mysql_free_result(RES_RESULT(*_r));
+		 * to free the mem from the mysql lib side, internal pkg for it
+		 * and *_r */
+		db_mysql_free_result(_h, *_r);
+		*_r = 0;
 #if (MYSQL_VERSION_ID >= 40100)
-		while( mysql_more_results(CON_CONNECTION(_h)) && mysql_next_result(CON_CONNECTION(_h)) > 0 ) {
+		while( mysql_more_results(CON_CONNECTION(_h)) && mysql_next_result(CON_CONNECTION(_h)) == 0 ) {
 			MYSQL_RES *res = mysql_store_result( CON_CONNECTION(_h) );
 			mysql_free_result(res);
 		}
 #endif
-		RES_RESULT(*_r) = 0;
 		return -4;
 	}
 
 done:
 #if (MYSQL_VERSION_ID >= 40100)
-	while( mysql_more_results(CON_CONNECTION(_h)) && mysql_next_result(CON_CONNECTION(_h)) > 0 ) {
+	while( mysql_more_results(CON_CONNECTION(_h)) && mysql_next_result(CON_CONNECTION(_h)) == 0 ) {
 		MYSQL_RES *res = mysql_store_result( CON_CONNECTION(_h) );
 		mysql_free_result(res);
 	}
diff --git a/modules/db_mysql/km_res.c b/modules/db_mysql/km_res.c
index 965e6dc..3f1ca26 100644
--- a/modules/db_mysql/km_res.c
+++ b/modules/db_mysql/km_res.c
@@ -69,6 +69,7 @@ int db_mysql_get_columns(const db1_con_t* _h, db1_res_t* _r)
 	}
 	
 	if (db_allocate_columns(_r, RES_COL_N(_r)) != 0) {
+		RES_COL_N(_r) = 0;
 		LM_ERR("could not allocate columns\n");
 		return -3;
 	}
@@ -173,6 +174,7 @@ static inline int db_mysql_convert_rows(const db1_con_t* _h, db1_res_t* _r)
 
 	if (db_allocate_rows(_r) < 0) {
 		LM_ERR("could not allocate rows");
+		RES_ROW_N(_r) = 0;
 		return -2;
 	}
 
diff --git a/modules/db_mysql/my_uri.c b/modules/db_mysql/my_uri.c
index b4c5a51..1f98135 100644
--- a/modules/db_mysql/my_uri.c
+++ b/modules/db_mysql/my_uri.c
@@ -175,12 +175,14 @@ static int parse_mysql_uri(struct my_uri* res, str* uri)
 			case '@':
 				st = ST_HOST;
 				res->username = prev_token;
+				prev_token = 0;
 				if (dupl_string(&res->password, begin, uri->s + i) < 0) goto err;
 				begin = uri->s + i + 1;
 				break;
 
 			case '/':
 				res->host = prev_token;
+				prev_token = 0;
 				res->port = str2s(begin, uri->s + i - begin, 0);
 				if (dupl_string(&res->database, uri->s + i + 1, uri->s + uri->len) < 0) goto err;
 				return 0;
diff --git a/modules/db_text/dbt_res.c b/modules/db_text/dbt_res.c
index 429c0fa..698e83b 100644
--- a/modules/db_text/dbt_res.c
+++ b/modules/db_text/dbt_res.c
@@ -113,6 +113,7 @@ int dbt_result_free(dbt_result_p _dres)
 	while(_rp)
 	{
 		_rp0=_rp;
+		_rp=_rp->next;
 		if(_rp0->fields)
 		{
 			for(i=0; i<_dres->nrcols; i++)
@@ -125,7 +126,6 @@ int dbt_result_free(dbt_result_p _dres)
 			pkg_free(_rp0->fields);
 		}
 		pkg_free(_rp0);
-		_rp=_rp->next;
 	}
 	if(_dres->colv)
 	{
@@ -557,7 +557,7 @@ int dbt_parse_orderbyclause(db_key_t **_o_k, char **_o_op, int *_o_n, db_key_t _
 	memcpy(_po, _o->s, _o->len);
 	*(_po+_o->len) = '\0';
 
-	*_o_op = pkg_malloc(sizeof(db_op_t) * _n);
+	*_o_op = pkg_malloc(sizeof(char) * _n);
 	if (!*_o_op)
 	{
 		pkg_free(*_o_k);
@@ -747,7 +747,7 @@ int dbt_sort_result(dbt_result_p _dres, int *_o_l, char *_o_op, int _o_n, int *_
 	}
 
 	/* rewrite linked list to array */
-	_a = pkg_malloc(sizeof(dbt_row_t) * _dres->nrrows);
+	_a = pkg_malloc(sizeof(dbt_row_p) * _dres->nrrows);
 	if (!_a)
 		return -1;
 	for (_el=_dres->rows, _i=0; _el != NULL; _el=_el->next, _i++)
diff --git a/modules/db_unixodbc/Makefile b/modules/db_unixodbc/Makefile
index 3754d4e..6661a65 100644
--- a/modules/db_unixodbc/Makefile
+++ b/modules/db_unixodbc/Makefile
@@ -6,12 +6,24 @@ include ../../Makefile.defs
 auto_gen=
 NAME=db_unixodbc.so
 
-# sql.h locations (freebsd,openbsd  solaris)
-DEFS += -I$(LOCALBASE)/include
+ifeq ($(CROSS_COMPILE),)
+ODBCCFG=$(shell which odbc_config)
+endif
 
-# libodbc locations on RH/Suse, Solaris /OpenBSD, FreeBSD
-# (Debian does the right thing and puts it in /usr/lib)
-LIBS= -L$(LOCALBASE)/lib -lodbc
+ifneq ($(ODBCCFG),)
+
+	DEFS += $(shell $(ODBCCFG) --cflags )
+	LIBS += $(shell $(ODBCCFG) --libs)
+
+else
+
+	# sql.h locations (freebsd,openbsd  solaris)
+	DEFS += -I$(LOCALBASE)/include
+
+	# libodbc locations on RH/Suse, Solaris /OpenBSD, FreeBSD
+	# (Debian does the right thing and puts it in /usr/lib)
+	LIBS= -L$(LOCALBASE)/lib -lodbc
+endif
 
 DEFS+=-DKAMAILIO_MOD_INTERFACE
 
diff --git a/modules/db_unixodbc/dbase.c b/modules/db_unixodbc/dbase.c
index 61300a3..c37253f 100644
--- a/modules/db_unixodbc/dbase.c
+++ b/modules/db_unixodbc/dbase.c
@@ -332,6 +332,7 @@ int db_unixodbc_fetch_result(const db1_con_t* _h, db1_res_t** _r, const int nrow
 	len = sizeof(db_row_t) * nrows;
 	RES_ROWS(*_r) = (struct db_row*)pkg_malloc(len);
 	if (!RES_ROWS(*_r)) {
+		pkg_free(temp_row);
 		LM_ERR("no memory left\n");
 		return -5;
 	}
@@ -359,6 +360,7 @@ int db_unixodbc_fetch_result(const db1_con_t* _h, db1_res_t** _r, const int nrow
 
 		if (db_unixodbc_list_insert(&rowstart, &rows, columns, temp_row) < 0) {
 			LM_ERR("SQL result row insert failed\n");
+			pkg_free(RES_ROWS(*_r));
 			pkg_free(temp_row);
 			temp_row= NULL;
 			pkg_free(*_r);
@@ -380,6 +382,7 @@ int db_unixodbc_fetch_result(const db1_con_t* _h, db1_res_t** _r, const int nrow
 	RES_ROW_N(*_r) = row_n;
 	if (!row_n) {
 		LM_DBG("no more rows to process for db fetch");
+		pkg_free(RES_ROWS(*_r));
 		RES_ROWS(*_r) = 0;
 		return 0;
 	}
diff --git a/modules/debugger/debugger_api.c b/modules/debugger/debugger_api.c
index 56d2975..e6e5f54 100644
--- a/modules/debugger/debugger_api.c
+++ b/modules/debugger/debugger_api.c
@@ -309,7 +309,7 @@ int dbg_cfg_trace(void *data)
 
 	if(_dbg_cfgpkgcheck!=0)
 	{
-#ifdef q_malloc_h
+#if defined (PKG_MEMORY) && defined (q_malloc_h)
 		LM_DBG("checking pkg memory before action %.*s (line %d)\n",
 				an->len, an->s, a->cline);
 		qm_check(mem_block);
diff --git a/modules/dialog/dialog.c b/modules/dialog/dialog.c
index 8d7be33..bcf8af0 100644
--- a/modules/dialog/dialog.c
+++ b/modules/dialog/dialog.c
@@ -448,6 +448,12 @@ static int mod_init(void)
 {
 	unsigned int n;
 
+	if(dlg_ka_interval!=0 && dlg_ka_interval<30) {
+		LM_ERR("ka interval too low (%d), has to be at least 30\n",
+				dlg_ka_interval);
+		return -1;
+	}
+
 	dlg_event_rt[DLG_EVENTRT_START] = route_lookup(&event_rt, "dialog:start");
 	dlg_event_rt[DLG_EVENTRT_END] = route_lookup(&event_rt, "dialog:end");
 	dlg_event_rt[DLG_EVENTRT_FAILED] = route_lookup(&event_rt, "dialog:failed");
diff --git a/modules/dialog/dlg_handlers.c b/modules/dialog/dlg_handlers.c
index 9393d7f..778f97b 100644
--- a/modules/dialog/dlg_handlers.c
+++ b/modules/dialog/dlg_handlers.c
@@ -543,6 +543,8 @@ static void dlg_onreply(struct cell* t, int type, struct tmcb_params *param)
 		LM_DBG("dialog %p failed (negative reply)\n", dlg);
 		/* dialog setup not completed (3456XX) */
 		run_dlg_callbacks( DLGCB_FAILED, dlg, req, rpl, DLG_DIR_UPSTREAM, 0);
+		if(dlg_wait_ack==1)
+			dlg_set_tm_waitack(t, dlg);
 		/* do unref */
 		if (unref)
 			dlg_unref(dlg, unref);
@@ -551,8 +553,6 @@ static void dlg_onreply(struct cell* t, int type, struct tmcb_params *param)
 
 		if_update_stat(dlg_enable_stats, failed_dlgs, 1);
 
-		if(dlg_wait_ack==1)
-			dlg_set_tm_waitack(t, dlg);
 		goto done;
 	}
 
@@ -1353,7 +1353,8 @@ void dlg_ontimeout(struct dlg_tl *tl)
 
 		if(dlg->iflags&DLG_IFLAG_TIMEOUTBYE)
 		{
-			dlg_bye_all(dlg, NULL);
+			if(dlg_bye_all(dlg, NULL)<0)
+				dlg_unref(dlg, 1);
 			/* run event route for end of dlg */
 			dlg_run_event_route(dlg, NULL, dlg->state, DLG_STATE_DELETED);
 			dlg_unref(dlg, 1);
@@ -1453,6 +1454,7 @@ void dlg_run_event_route(dlg_cell_t *dlg, sip_msg_t *msg, int ostate, int nstate
 {
 	sip_msg_t *fmsg;
 	int rt;
+	int bkroute;
 
 	if(dlg==NULL)
 		return;
@@ -1477,16 +1479,18 @@ void dlg_run_event_route(dlg_cell_t *dlg, sip_msg_t *msg, int ostate, int nstate
 	else
 		fmsg = msg;
 
-	if (exec_pre_script_cb(fmsg, REQUEST_CB_TYPE)>0)
+	if (exec_pre_script_cb(fmsg, LOCAL_CB_TYPE)>0)
 	{
 		dlg_ref(dlg, 1);
 		dlg_set_ctx_iuid(dlg);
 		LM_DBG("executing event_route %d on state %d\n", rt, nstate);
-		set_route_type(REQUEST_ROUTE);
+		bkroute = get_route_type();
+		set_route_type(LOCAL_ROUTE);
 		run_top_route(event_rt.rlist[rt], fmsg, 0);
 		dlg_reset_ctx_iuid();
-		exec_post_script_cb(fmsg, REQUEST_CB_TYPE);
+		exec_post_script_cb(fmsg, LOCAL_CB_TYPE);
 		dlg_unref(dlg, 1);
+		set_route_type(bkroute);
 	}
 }
 
diff --git a/modules/dialog/dlg_hash.c b/modules/dialog/dlg_hash.c
index d8b2759..0ec9c36 100644
--- a/modules/dialog/dlg_hash.c
+++ b/modules/dialog/dlg_hash.c
@@ -132,7 +132,7 @@ int dlg_ka_add(dlg_cell_t *dlg)
 
 	if(dlg_ka_interval<=0)
 		return 0;
-	if(!(dlg->iflags & (DLG_IFLAG_KA_SRC | DLG_IFLAG_KA_SRC)))
+	if(!(dlg->iflags & (DLG_IFLAG_KA_SRC | DLG_IFLAG_KA_DST)))
 		return 0;
 
 	dka = (dlg_ka_t*)shm_malloc(sizeof(dlg_ka_t));
@@ -585,7 +585,12 @@ int dlg_set_leg_info(struct dlg_cell *dlg, str* tag, str *rr, str *contact,
  * \return 0 on success, -1 on failure
  */
 int dlg_update_cseq(struct dlg_cell * dlg, unsigned int leg, str *cseq)
-{
+{	dlg_entry_t *d_entry;
+
+	d_entry = &(d_table->entries[dlg->h_entry]);
+
+	dlg_lock(d_table, d_entry);
+
 	if ( dlg->cseq[leg].s ) {
 		if (dlg->cseq[leg].len < cseq->len) {
 			shm_free(dlg->cseq[leg].s);
@@ -602,9 +607,12 @@ int dlg_update_cseq(struct dlg_cell * dlg, unsigned int leg, str *cseq)
 	memcpy( dlg->cseq[leg].s, cseq->s, cseq->len );
 	dlg->cseq[leg].len = cseq->len;
 
-	LM_DBG("cseq is %.*s\n", dlg->cseq[leg].len, dlg->cseq[leg].s);
+	LM_DBG("cseq of leg[%d] is %.*s\n", leg,
+			dlg->cseq[leg].len, dlg->cseq[leg].s);
+	dlg_unlock(d_table, d_entry);
 	return 0;
 error:
+	dlg_unlock(d_table, d_entry);
 	LM_ERR("not more shm mem\n");
 	return -1;
 }
diff --git a/modules/dialog/dlg_profile.c b/modules/dialog/dlg_profile.c
index aad87a3..b2af30e 100644
--- a/modules/dialog/dlg_profile.c
+++ b/modules/dialog/dlg_profile.c
@@ -802,7 +802,7 @@ int	dlg_set_timeout_by_profile(struct dlg_profile_table *profile,
 				}
 
 				ph = ph->next;
-			} while(ph != profile->entries[i].first);
+			} while(ph && ph != profile->entries[i].first);
 		}
 
 		lock_release(&profile->lock);
diff --git a/modules/dialog/dlg_var.c b/modules/dialog/dlg_var.c
index 0d8a1c7..4b2ca89 100644
--- a/modules/dialog/dlg_var.c
+++ b/modules/dialog/dlg_var.c
@@ -284,6 +284,7 @@ int pv_get_dlg_variable(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
 {
 	dlg_cell_t *dlg;
 	str * value;
+	str spv;
 
 	if (param==NULL || param->pvn.type!=PV_NAME_INTSTR
 			|| param->pvn.u.isname.type!=AVP_NAME_STR
@@ -306,6 +307,19 @@ int pv_get_dlg_variable(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
 	/* dcm: todo - the value should be cloned for safe usage */
 	value = get_dlg_variable_unsafe(dlg, &param->pvn.u.isname.name.s);
 
+	spv.s = NULL;
+	if(value) {
+		spv.len = pv_get_buffer_size();
+		if(spv.len<value->len+1) {
+			LM_ERR("pv buffer too small (%d) - needed %d\n", spv.len, value->len);
+		} else {
+			spv.s = pv_get_buffer();
+			strncpy(spv.s, value->s, value->len);
+			spv.len = value->len;
+			spv.s[spv.len] = '\0';
+		}
+	}
+
 	print_lists(dlg);
 
 	/* unlock dialog */
@@ -314,8 +328,8 @@ int pv_get_dlg_variable(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
 		dlg_release(dlg);
 	}
 
-	if (value)
-		return pv_get_strval(msg, param, res, value);
+	if (spv.s)
+		return pv_get_strval(msg, param, res, &spv);
 
 
 	return pv_get_null(msg, param, res);
@@ -430,9 +444,8 @@ int pv_set_dlg_ctx(struct sip_msg* msg, pv_param_t *param,
 	if(param==NULL)
 		return -1;
 
-	if(val==NULL)
-		n = 0;
-	else
+	n = 0;
+	if(val!=NULL && val->flags&PV_VAL_INT)
 		n = val->ri;
 
 	switch(param->pvn.u.isname.name.n)
@@ -447,7 +460,7 @@ int pv_set_dlg_ctx(struct sip_msg* msg, pv_param_t *param,
 			_dlg_ctx.to_bye = n;
 		break;
 		case 4:
-			if(val->flags&PV_VAL_STR) {
+			if(val && val->flags&PV_VAL_STR) {
 				if(val->rs.s[val->rs.len]=='\0'
 						&& val->rs.len<DLG_TOROUTE_SIZE) {
 					_dlg_ctx.to_route = route_lookup(&main_rt, val->rs.s);
diff --git a/modules/dialplan/dp_db.c b/modules/dialplan/dp_db.c
index bc82af9..bd3bb49 100644
--- a/modules/dialplan/dp_db.c
+++ b/modules/dialplan/dp_db.c
@@ -360,7 +360,8 @@ dpl_node_t * build_rule(db_val_t * values)
 	struct subst_expr *repl_comp;
 	dpl_node_t * new_rule;
 	str match_exp, subst_exp, repl_exp, attrs;
-	int matchop, cap_cnt;
+	int matchop;
+	int cap_cnt=0;
 
 	matchop = VAL_INT(values+2);
 
diff --git a/modules/dialplan/dp_db.h b/modules/dialplan/dp_db.h
index 190b7b3..0078354 100644
--- a/modules/dialplan/dp_db.h
+++ b/modules/dialplan/dp_db.h
@@ -32,7 +32,7 @@
  */
 
 #ifndef _DP_DB_H_
-#define _DP_DB_H
+#define _DP_DB_H_
 
 #include "../../str.h"
 #include "../../lib/srdb1/db.h"
diff --git a/modules/drouting/drouting.c b/modules/drouting/drouting.c
index 60006b1..4322a7e 100644
--- a/modules/drouting/drouting.c
+++ b/modules/drouting/drouting.c
@@ -754,7 +754,7 @@ again:
 		}
 	}
 
-	if (rt_info->route_idx>0 && rt_info->route_idx<RT_NO) {
+	if (rt_info->route_idx>0 && main_rt.rlist[rt_info->route_idx]!=NULL) {
 		ret = run_top_route(main_rt.rlist[rt_info->route_idx], msg, 0);
 		if (ret<1) {
 			/* drop the action */
diff --git a/modules/exec/exec_hf.c b/modules/exec/exec_hf.c
index 37eaf27..3bc761b 100644
--- a/modules/exec/exec_hf.c
+++ b/modules/exec/exec_hf.c
@@ -363,6 +363,7 @@ environment_t *replace_env(struct hf_wrapper *list)
 	new_env=pkg_malloc((var_cnt+1)*sizeof(char *));
 	if (!new_env) {
 		LM_ERR("no pkg mem\n");
+		pkg_free(backup_env);
 		return 0;
 	}
 	/* put all var pointers into new environment */
diff --git a/modules/geoip/geoip_pv.c b/modules/geoip/geoip_pv.c
index 6a18461..d2aaf7c 100644
--- a/modules/geoip/geoip_pv.c
+++ b/modules/geoip/geoip_pv.c
@@ -107,6 +107,7 @@ sr_geoip_item_t *sr_geoip_add_item(str *name)
 	if(it->pvclass.s==NULL)
 	{
 		LM_ERR("no more pkg.\n");
+		pkg_free(it);
 		return NULL;
 	}
 	memcpy(it->pvclass.s, name->s, name->len);
@@ -220,6 +221,9 @@ int pv_parse_geoip_name(pv_spec_p sp, str *in)
 	return 0;
 
 error:
+	if(gpv!=NULL)
+		pkg_free(gpv);
+
 	LM_ERR("error at PV geoip name: %.*s\n", in->len, in->s);
 	return -1;
 }
diff --git a/modules/htable/htable.c b/modules/htable/htable.c
index ab2ecea..d9de343 100644
--- a/modules/htable/htable.c
+++ b/modules/htable/htable.c
@@ -266,12 +266,12 @@ static int fixup_ht_key(void** param, int param_no)
 	pv_spec_t *sp;
 	str s;
 
-	sp = (pv_spec_t*)pkg_malloc(sizeof(pv_spec_t));
 	if(param_no != 1)
 	{
 		LM_ERR("invalid parameter number %d\n", param_no);
 		return -1;
 	}
+	sp = (pv_spec_t*)pkg_malloc(sizeof(pv_spec_t));
 	if (sp == 0)
 	{
 		LM_ERR("no pkg memory left\n");
diff --git a/modules/ipops/ipops_pv.c b/modules/ipops/ipops_pv.c
index 08be1fe..fcf0620 100644
--- a/modules/ipops/ipops_pv.c
+++ b/modules/ipops/ipops_pv.c
@@ -261,6 +261,7 @@ int pv_parse_dns_name(pv_spec_t *sp, str *in)
 
 error:
 	LM_ERR("error at PV dns name: %.*s\n", in->len, in->s);
+	if(dpv) pkg_free(dpv);
 	return -1;
 }
 
diff --git a/modules/json/Makefile b/modules/json/Makefile
index cf14a08..2ee06ef 100644
--- a/modules/json/Makefile
+++ b/modules/json/Makefile
@@ -8,15 +8,26 @@ include ../../Makefile.defs
 auto_gen=
 NAME=json.so
 LIBS=
+JLIB=json
 
 BUILDER = $(shell which pkg-config)
 ifeq ($(BUILDER),)
-	DEFS+=-I/usr/include/json -I$(LOCALBASE)/include/json \
+	JSONC=$(shell ls $(SYSBASE)/include/lib/libjson*.so $(LOCALBASE)/lib/libjson*.so 2>/dev/null | grep json-c)
+else
+	JSONC=$(shell pkg-config --libs json-c 2>/dev/null | grep json-c)
+endif
+
+ifneq ($(JSONC),)
+	JLIB=json-c
+endif
+
+ifeq ($(BUILDER),)
+	DEFS+=-I/usr/include/$(JLIB) -I$(LOCALBASE)/include/$(JLIB) \
        -I$(LOCALBASE)/include
-	LIBS+=-L$(SYSBASE)/include/lib -L$(LOCALBASE)/lib -ljson
+	LIBS+=-L$(SYSBASE)/include/lib -L$(LOCALBASE)/lib -l$(JLIB)
 else
-	DEFS+= $(shell pkg-config --cflags json)
-	LIBS+= $(shell pkg-config --libs json)
+	DEFS+= $(shell pkg-config --cflags $(JLIB))
+	LIBS+= $(shell pkg-config --libs $(JLIB))
 endif
 DEFS+=-DKAMAILIO_MOD_INTERFACE
 
diff --git a/modules/jsonrpc-c/Makefile b/modules/jsonrpc-c/Makefile
index fdb0024..171eb27 100644
--- a/modules/jsonrpc-c/Makefile
+++ b/modules/jsonrpc-c/Makefile
@@ -8,15 +8,26 @@ include ../../Makefile.defs
 auto_gen=
 NAME=jsonrpc-c.so
 LIBS=-lm
+JLIB=json
 
 BUILDER = $(shell which pkg-config)
 ifeq ($(BUILDER),)
-	DEFS+=-I/usr/include/json -I$(LOCALBASE)/include/json \
+	JSONC=$(shell ls $(SYSBASE)/include/lib/libjson*.so $(LOCALBASE)/lib/libjson*.so 2>/dev/null | grep json-c)
+else
+	JSONC=$(shell pkg-config --libs json-c 2>/dev/null | grep json-c)
+endif
+
+ifneq ($(JSONC),)
+	JLIB=json-c
+endif
+
+ifeq ($(BUILDER),)
+	DEFS+=-I/usr/include/$(JLIB) -I$(LOCALBASE)/include/$(JLIB) \
        -I$(LOCALBASE)/include
-	LIBS+=-L$(SYSBASE)/include/lib -L$(LOCALBASE)/lib -levent -ljson
+	LIBS+=-L$(SYSBASE)/include/lib -L$(LOCALBASE)/lib -levent -l$(JLIB)
 else
-	DEFS+= $(shell pkg-config --cflags json)
-	LIBS+= $(shell pkg-config --libs json)
+	DEFS+= $(shell pkg-config --cflags $(JLIB))
+	LIBS+= $(shell pkg-config --libs $(JLIB))
 	DEFS+= $(shell pkg-config --cflags libevent)
 	LIBS+= $(shell pkg-config --libs libevent)
 endif
diff --git a/modules/maxfwd/README b/modules/maxfwd/README
index 764f8f5..f381e66 100644
--- a/modules/maxfwd/README
+++ b/modules/maxfwd/README
@@ -107,7 +107,7 @@ Chapter 1. Admin Guide
    MAX-FORWARDS value allowed by RFC 3261. The value can be changed at
    runtime.
 
-   Default value is "16".
+   Default value is "70".
 
    Example 1.1. Set max_limit parameter
 ...
diff --git a/modules/maxfwd/doc/maxfwd_admin.xml b/modules/maxfwd/doc/maxfwd_admin.xml
index f0f3463..3e5812b 100644
--- a/modules/maxfwd/doc/maxfwd_admin.xml
+++ b/modules/maxfwd/doc/maxfwd_admin.xml
@@ -78,7 +78,7 @@
 		</para>
 		<para>
 		<emphasis>
-			Default value is <quote>16</quote>.
+			Default value is <quote>70</quote>.
 		</emphasis>
 		</para>
 		<example>
diff --git a/modules/maxfwd/maxfwd.c b/modules/maxfwd/maxfwd.c
index 371a1aa..c835610 100644
--- a/modules/maxfwd/maxfwd.c
+++ b/modules/maxfwd/maxfwd.c
@@ -55,7 +55,7 @@ struct cfg_group_maxfwd {
 };
 
 static struct cfg_group_maxfwd default_maxfwd_cfg = {
-	.max_limit=16
+	.max_limit=70
 };
 
 static void *maxfwd_cfg = &default_maxfwd_cfg;
diff --git a/modules/mi_rpc/mi_rpc_mod.c b/modules/mi_rpc/mi_rpc_mod.c
index 7a9bd77..c1a6f2a 100644
--- a/modules/mi_rpc/mi_rpc_mod.c
+++ b/modules/mi_rpc/mi_rpc_mod.c
@@ -323,8 +323,8 @@ static void mi_rpc_async_close(struct mi_root* mi_rpl,
 		if (dctx==0){
 			BUG("null dctx\n");
 			shm_free(mi_h->param);
-			shm_free(mi_h);
 			mi_h->param=0;
+			shm_free(mi_h);
 			goto error;
 		}
 		mode=((struct mi_rpc_handler_param*)mi_h->param)->mode;
diff --git a/modules/mqueue/mqueue_api.c b/modules/mqueue/mqueue_api.c
index 4a36909..4be71d8 100644
--- a/modules/mqueue/mqueue_api.c
+++ b/modules/mqueue/mqueue_api.c
@@ -364,15 +364,14 @@ int pv_parse_mq_name(pv_spec_t *sp, str *in)
 
 str *pv_get_mq_name(sip_msg_t *msg, str *in)
 {
-	str *queue;
+	static str queue;
+	pv_spec_t *pvs;
+	pv_value_t pvv;
 
 	if (in->s[0] != '$')
-		queue = in;
+		return in;
 	else
 	{
-		pv_spec_t *pvs;
-		pv_value_t pvv;
-
 		if (pv_locate_name(in) != in->len)
 		{
 			LM_ERR("invalid pv [%.*s]\n", in->len, in->s);
@@ -396,10 +395,10 @@ str *pv_get_mq_name(sip_msg_t *msg, str *in)
 			return NULL;
 		}
 
-		queue = &pvv.rs;
+		queue = pvv.rs;
 	}
 
-	return queue;
+	return &queue;
 }
 
 /**
diff --git a/modules/msilo/msilo.c b/modules/msilo/msilo.c
index efa49f1..e535491 100644
--- a/modules/msilo/msilo.c
+++ b/modules/msilo/msilo.c
@@ -1122,7 +1122,8 @@ static int m_dump(struct sip_msg* msg, str* owner_s)
 				msg_list_set_flag(ml, mid, MS_MSG_ERRO);
 				goto error;
 			}
-			memcpy(tmp_extra_hdrs.s, extra_hdrs_str.s, extra_hdrs_str.len);
+			if(extra_hdrs_str.len>0)
+				memcpy(tmp_extra_hdrs.s, extra_hdrs_str.s, extra_hdrs_str.len);
 			memcpy(tmp_extra_hdrs.s+extra_hdrs_str.len, str_vals[4].s, str_vals[4].len);
 		} else {
 			tmp_extra_hdrs.len = 0;
@@ -1347,7 +1348,8 @@ void m_send_ontimer(unsigned int ticks, void *param)
 	str puri;
 	time_t ttime;
 	uac_req_t uac_r;
-	str str_vals[4], hdr_str, body_str, extra_hdrs_str;
+	str str_vals[4], hdr_str, body_str;
+	str extra_hdrs_str = {0};
 	time_t stime;
 
 	if(ms_reminder.s==NULL)
@@ -1532,6 +1534,7 @@ int check_message_support(struct sip_msg* msg)
 	str *methods_body;
 	unsigned int methods;
 	int expires;
+	int posexp = 0;
 
 	/* Parse all headers in order to see all Allow headers */
 	if (parse_headers(msg, HDR_EOH_F, 0) == -1)
@@ -1585,6 +1588,7 @@ int check_message_support(struct sip_msg* msg)
 		/* skip contacts with zero expires */
 		if (expires > 0)
 		{
+			posexp = 1;
 			if (c->methods)
 			{
 				methods_body = &(c->methods->body);
@@ -1612,6 +1616,11 @@ int check_message_support(struct sip_msg* msg)
 			return -1;
 		}
 	}
+
+	/* no positivie expires header */
+	if(posexp==0)
+		return -1;
+
 	/* no Allow header and no methods in Contact => dump MESSAGEs */
 	if(allow_hdr==0)
 		return 0;
diff --git a/modules/msrp/msrp_parser.c b/modules/msrp/msrp_parser.c
index d7a2ced..fc81798 100644
--- a/modules/msrp/msrp_parser.c
+++ b/modules/msrp/msrp_parser.c
@@ -81,7 +81,7 @@ int msrp_parse_frame(msrp_frame_t *mf)
 	}
 	if(msrp_parse_headers(mf)<0)
 	{
-		LM_ERR("unable to parse first line\n");
+		LM_ERR("unable to parse headers\n");
 		return -1;
 	}
 	return 0;
@@ -220,6 +220,9 @@ int msrp_parse_headers(msrp_frame_t *mf)
 	char *s; /* start for search */
 	msrp_hdr_t *hdr;
 	msrp_hdr_t *last;
+	int fpath = 0; /* From path set */
+	int tpath = 0; /* To path set */
+	int any = 0; /* Any header set */
 
 	/* already parsed?!? */
 	if(mf->headers != NULL)
@@ -290,13 +293,48 @@ int msrp_parse_headers(msrp_frame_t *mf)
 			last = hdr;
 		}
 		msrp_hdr_set_type(hdr);
-	
+
+		/* Checking for well-formed MSRP rfc4975 messages */
+		if (hdr->htype == MSRP_HDR_TO_PATH) {
+			if (tpath) {
+				LM_ERR("broken msrp frame message, Multiple To-Path not allowed.\n");
+				return -1;				
+			} else if (fpath || any) {
+				LM_ERR("broken msrp frame message, To-Path must be the first header.\n");
+				return -1;
+			} else {
+				tpath = 1;
+			}
+		} else if (hdr->htype == MSRP_HDR_FROM_PATH) {
+			if (fpath) {
+				LM_ERR("broken msrp frame message, Multiple From-Path not allowed.\n");
+				return -1;
+			} else if (!tpath || any) {
+				LM_ERR("broken msrp frame message, From-Path must be after To-Path.\n");
+				return -1;
+			} else {
+				fpath = 1;
+			}
+		} else {
+			if (!tpath || !fpath) {
+				LM_ERR("broken msrp frame message, To-Path and From-Path must be defined before any header.\n");
+				return -1;
+			} else {
+				any = 1;
+			}
+		}
+		
 		LM_DBG("MSRP Header: (%p) [%.*s] [%d] [%.*s]\n",
 				hdr, hdr->name.len, hdr->name.s, hdr->htype,
 				hdr->body.len, hdr->body.s);
 		s = l + 1;
 	}
 
+	if (!tpath || !fpath) {
+		LM_ERR("broken msrp frame message, To-Path and From-Path must be defined.\n");
+		return -1;
+	}
+
 ateoh:
 	if(mf->mbody.s!=NULL)
 	{
diff --git a/modules/mtree/mtree_mod.c b/modules/mtree/mtree_mod.c
index dbdc256..96e6479 100644
--- a/modules/mtree/mtree_mod.c
+++ b/modules/mtree/mtree_mod.c
@@ -546,13 +546,11 @@ static int mt_load_db(m_tree_t *pt)
 		if(mt_dbf.fetch_result(db_con, &db_res, mt_fetch_rows)<0)
 		{
 			LM_ERR("Error while fetching result\n");
-			if (db_res)
-				mt_dbf.free_result(db_con, db_res);
 			goto error;
 		} else {
 			if(RES_ROW_N(db_res)==0)
 			{
-				return 0;
+				goto dbreloaded;
 			}
 		}
 	} else {
@@ -560,25 +558,36 @@ static int mt_load_db(m_tree_t *pt)
 						pt->multi, 2, 0, &db_res))!=0
 				|| RES_ROW_N(db_res)<=0 )
 		{
-			mt_dbf.free_result(db_con, db_res);
-			if( ret==0)
+			if(ret==0)
 			{
-				return 0;
+				goto dbreloaded;
 			} else {
 				goto error;
 			}
 		}
 	}
 
+	if(RES_ROW_N(db_res)>0)
+	{
+		if(RES_ROWS(db_res)[0].values[0].type != DB1_STRING
+				|| RES_ROWS(db_res)[0].values[1].type != DB1_STRING)
+		{
+			LM_ERR("wrond column types in db table (%d / %d)\n",
+					RES_ROWS(db_res)[0].values[0].type,
+					RES_ROWS(db_res)[0].values[1].type);
+			goto error;
+		}
+	}
+
 	do {
 		for(i=0; i<RES_ROW_N(db_res); i++)
 		{
 			/* check for NULL values ?!?! */
 			tprefix.s = (char*)(RES_ROWS(db_res)[i].values[0].val.string_val);
-			tprefix.len = strlen(tprefix.s);
+			tprefix.len = strlen(ZSW(tprefix.s));
 
 			tvalue.s = (char*)(RES_ROWS(db_res)[i].values[1].val.string_val);
-			tvalue.len = strlen(tvalue.s);
+			tvalue.len = strlen(ZSW(tvalue.s));
 
 			if(tprefix.s==NULL || tvalue.s==NULL
 					|| tprefix.len<=0 || tvalue.len<=0)
@@ -606,6 +615,8 @@ static int mt_load_db(m_tree_t *pt)
 			break;
 		}
 	}  while(RES_ROW_N(db_res)>0);
+
+dbreloaded:
 	mt_dbf.free_result(db_con, db_res);
 
 
diff --git a/modules/nathelper/nathelper.c b/modules/nathelper/nathelper.c
index c34beee..9a76550 100644
--- a/modules/nathelper/nathelper.c
+++ b/modules/nathelper/nathelper.c
@@ -906,8 +906,10 @@ set_contact_alias_f(struct sip_msg* msg, char* str1, char* str2)
 
 	offset = c->uri.s - msg->buf;
 	anchor = del_lump(msg, offset, c->uri.len, HDR_CONTACT_T);
-	if (anchor == 0)
+	if (anchor == 0) {
+		pkg_free(buf);
 		return -1;
+	}
 
 	if (insert_new_lump_after(anchor, buf, len, HDR_CONTACT_T) == 0) {
 		pkg_free(buf);
@@ -2350,6 +2352,7 @@ add_rcv_param_f(struct sip_msg* msg, char* str1, char* str2)
 		}
 		if (anchor == NULL) {
 			LM_ERR("anchor_lump failed\n");
+			pkg_free(param);
 			return -1;
 		}		
 
diff --git a/modules/permissions/README b/modules/permissions/README
index 9835af6..6f44727 100644
--- a/modules/permissions/README
+++ b/modules/permissions/README
@@ -627,7 +627,7 @@ modparam("permissions", "peer_tag_avp", "$avp(i:707)")
 
    Example 1.19. Set peer_tag_mode parameter
 ...
-modparam("permissions", "peer_tag_mode", "1")
+modparam("permissions", "peer_tag_mode", 1)
 ...
 
 4. Functions
diff --git a/modules/permissions/doc/permissions_admin.xml b/modules/permissions/doc/permissions_admin.xml
index c955d2a..a6da004 100644
--- a/modules/permissions/doc/permissions_admin.xml
+++ b/modules/permissions/doc/permissions_admin.xml
@@ -699,7 +699,7 @@ modparam("permissions", "peer_tag_avp", "$avp(i:707)")
 		<title>Set <varname>peer_tag_mode</varname> parameter</title>
 		<programlisting format="linespecific">
 ...
-modparam("permissions", "peer_tag_mode", "1")
+modparam("permissions", "peer_tag_mode", 1)
 ...
 </programlisting>
 		</example>
diff --git a/modules/pipelimit/pipelimit.c b/modules/pipelimit/pipelimit.c
index 77d2796..5aeb071 100644
--- a/modules/pipelimit/pipelimit.c
+++ b/modules/pipelimit/pipelimit.c
@@ -308,7 +308,7 @@ static int mod_init(void)
 		return -1;
 	}
 	timer_init(pl_timer, pl_timer_handle, 0, F_TIMER_FAST);
-	timer_add(pl_timer, MS_TO_TICKS(1500)); /* Start it after 1500ms */
+	timer_add(pl_timer, MS_TO_TICKS(1000)); /* Start it after 1000ms */
 
 	/* bind the SL API */
 	if (sl_load_api(&slb)!=0) {
diff --git a/modules/presence_dialoginfo/notify_body.c b/modules/presence_dialoginfo/notify_body.c
index 7f74b1f..92ece0a 100644
--- a/modules/presence_dialoginfo/notify_body.c
+++ b/modules/presence_dialoginfo/notify_body.c
@@ -101,7 +101,7 @@ str* agregate_xmls(str* pres_user, str* pres_domain, str** body_array, int n)
 	xmlDocPtr  doc = NULL;
 	xmlNodePtr root_node = NULL;
 	xmlNsPtr   namespace = NULL;
-	int winner_priority = -1, priority;
+	/*int winner_priority = -1, priority;*/
 
 	xmlNodePtr p_root= NULL;
 	xmlDocPtr* xml_array ;
@@ -111,6 +111,7 @@ str* agregate_xmls(str* pres_user, str* pres_domain, str** body_array, int n)
 	xmlNodePtr confirmed_node = NULL;
 	xmlNodePtr proceed_node = NULL;
 	xmlNodePtr trying_node = NULL;
+	xmlNodePtr next_node = NULL;
 
 
 	char *state = NULL;
@@ -214,7 +215,8 @@ str* agregate_xmls(str* pres_user, str* pres_domain, str** body_array, int n)
 			goto error;
 		}
 		if (p_root->children) {
-			for (node = p_root->children; node; node = node->next) {
+			for (node = p_root->children; node; node = next_node) {
+				next_node = node->next;
 				if (node->type == XML_ELEMENT_NODE) {
 					LM_DBG("node type: Element, name: %s\n", node->name);
 					/* we do not copy the node, but unlink it and then add it ot the new node
diff --git a/modules/pua/pua.c b/modules/pua/pua.c
index 900e582..1e85938 100644
--- a/modules/pua/pua.c
+++ b/modules/pua/pua.c
@@ -993,7 +993,7 @@ static void db_update(unsigned int ticks,void *param)
 		p = HashT->p_records[i].entity->next;
 		while(p)
 		{
-			if(p->expires - (int)time(NULL)< 0)	
+			if((int)p->expires - (int)time(NULL)< 0)	
 			{
 				p= p->next;
 				continue;
diff --git a/modules/pua_xmpp/simple2xmpp.h b/modules/pua_xmpp/simple2xmpp.h
index 2178e0a..d38acf5 100644
--- a/modules/pua_xmpp/simple2xmpp.h
+++ b/modules/pua_xmpp/simple2xmpp.h
@@ -27,7 +27,7 @@
  */
 
 #ifndef SIP_XMPP_PRES_H
-#define SIP_XMPP__PRES_H
+#define SIP_XMPP_PRES_H
 
 #include "../pua/pua_bind.h"
 
diff --git a/modules/pv/pv_core.c b/modules/pv/pv_core.c
index 0afd9b1..59a3539 100644
--- a/modules/pv/pv_core.c
+++ b/modules/pv/pv_core.c
@@ -991,6 +991,11 @@ int pv_get_pai(struct sip_msg *msg, pv_param_t *param,
 	}
 
 	pai_body = get_pai(msg);
+	if(pai_body==NULL || pai_body->id==NULL)
+	{
+		LM_DBG("no P-Asserted-Identity header or empty body\n");
+		return pv_get_null(msg, param, res);
+	}
 	pai_uri = &pai_body->id[0];
 	cur_id = 0;
 	i = 0;
@@ -2593,6 +2598,9 @@ int pv_set_xto_attr(struct sip_msg* msg, pv_param_t *param,
 			LM_ERR("failed to set xto attribute %d\n", type);
 			goto error;
 		}
+	} else {
+		if(buf.s!=0)
+			pkg_free(buf.s);
 	}
 	return 0;
 
@@ -2779,30 +2787,20 @@ int pv_parse_cnt_name(pv_spec_p sp, str *in)
 	if(in->s==NULL || in->len<=0)
 		return -1;
 
-	pv = (pv_spec_t*)pkg_malloc(sizeof(pv_spec_t));
-	if(pv==NULL)
+	pv = pv_cache_get(in);
+	if(pv==NULL) {
+		LM_ERR("cannot find pv name [%.*s]\n", in->len, in->s);
 		return -1;
+	}
 
-	memset(pv, 0, sizeof(pv_spec_t));
-
-	if(pv_parse_spec(in, pv)==NULL)
-		goto error;
-
-	if(pv->type!=PVT_AVP)
-	{
+	if(pv->type!=PVT_AVP) {
 		LM_ERR("expected avp name instead of [%.*s]\n", in->len, in->s);
-		goto error;
+		return -1;
 	}
 
 	sp->pvp.pvn.u.dname = (void*)pv;
 	sp->pvp.pvn.type = PV_NAME_PVAR;
 	return 0;
-
-error:
-	LM_ERR("invalid pv name [%.*s]\n", in->len, in->s);
-	if(pv!=NULL)
-		pkg_free(pv);
-	return -1;
 }
 
 
diff --git a/modules/pv/pv_shv.c b/modules/pv/pv_shv.c
index dc0109f..f51bc6c 100644
--- a/modules/pv/pv_shv.c
+++ b/modules/pv/pv_shv.c
@@ -775,7 +775,7 @@ int param_set_xvar( modparam_t type, void* val, int mode)
 	if(!shm_initialized()!=0)
 	{
 		LM_ERR("shm not initialized - cannot set value for PVs\n");
-		goto error;
+		return -1;
 	}
 
 	s.s = (char*)val;
diff --git a/modules/pv/pv_trans.c b/modules/pv/pv_trans.c
index 7c75deb..b2561e2 100644
--- a/modules/pv/pv_trans.c
+++ b/modules/pv/pv_trans.c
@@ -126,13 +126,13 @@ static int urlencode_param(str *sin, str *sout)
 {
 	char *at, *p;
 
-	at = sout->s;
-	p  = sin->s;
-
 	if (sin==NULL || sout==NULL || sin->s==NULL || sout->s==NULL ||
 			sin->len<0 || sout->len < 3*sin->len+1)
 		return -1;
 
+	at = sout->s;
+	p  = sin->s;
+
 	while (p < sin->s+sin->len) {
 		if (isalnum(*p) || *p == '-' || *p == '_' || *p == '.' || *p == '~')
 			*at++ = *p;
@@ -1625,7 +1625,7 @@ int tr_eval_line(struct sip_msg *msg, tr_param_t *tp, int subtype,
 					if(p==NULL)
 					{
 						/* last line */
-						mv.len = (val->rs.s + val->rs.len) - p;
+						mv.len = (val->rs.s + val->rs.len) - mv.s;
 					} else {
 						mv.len = p - mv.s;
 					}
@@ -1707,7 +1707,7 @@ int tr_eval_line(struct sip_msg *msg, tr_param_t *tp, int subtype,
 					if(p==NULL)
 					{
 						/* last line */
-						mv.len = (val->rs.s + val->rs.len) - p;
+						mv.len = (val->rs.s + val->rs.len) - mv.s;
 					} else {
 						mv.len = p - mv.s;
 					}
diff --git a/modules/registrar/save.c b/modules/registrar/save.c
index caa81df..70b868b 100644
--- a/modules/registrar/save.c
+++ b/modules/registrar/save.c
@@ -171,11 +171,9 @@ static struct socket_info *get_sock_val(struct sip_msg *msg)
 	} else {
 		/* xavp */
 		if(reg_xavp_cfg.s!=NULL)
-		{
 			vavp = xavp_get_child_with_sval(&reg_xavp_cfg, &xsockname);
-			if(vavp==NULL || vavp->val.v.s.len<=0)
-				return 0;
-		}
+		if(vavp==NULL || vavp->val.v.s.len<=0)
+			return 0;
 		socks = vavp->val.v.s;
 	}
 	if (parse_phostport( socks.s, &hosts.s, &hosts.len,
@@ -912,6 +910,7 @@ int save(struct sip_msg* _m, udomain_t* _d, int _cflags, str *_uri)
 	}
 
 	if (reg_outbound_mode != REG_OUTBOUND_NONE
+			&& _m->contact && _m->contact->parsed
 			&& !(parse_headers(_m, HDR_VIA2_F, 0) == -1 || _m->via2 == 0
 				|| _m->via2->error != PARSE_OK)) {
 		/* Outbound supported on server, and more than one Via: - not the first hop */
diff --git a/modules/rls/list.h b/modules/rls/list.h
index c9904aa..8c13b4d 100644
--- a/modules/rls/list.h
+++ b/modules/rls/list.h
@@ -41,8 +41,11 @@ static inline list_entry_t *list_insert(str *strng, list_entry_t *list, int *dup
 	if (cmp == 0)
 	{
 		if (duplicate != NULL)
+		{
 			*duplicate = 1;
-		return list;
+			pkg_free(p);
+			return list;
+		}
 	}
 	if (cmp > 0)
 	{
@@ -58,8 +61,11 @@ static inline list_entry_t *list_insert(str *strng, list_entry_t *list, int *dup
 		if (cmp == 0)
 		{
 			if (duplicate != NULL)
+			{
 				*duplicate = 1;
-			return list;
+				pkg_free(p);
+				return list;
+			}
 		}
 
 		p->next = q->next;
diff --git a/modules/rls/notify.c b/modules/rls/notify.c
index eb6a0e1..a8f3dd5 100644
--- a/modules/rls/notify.c
+++ b/modules/rls/notify.c
@@ -1366,7 +1366,7 @@ int rls_get_resource_list(str *rl_uri, str *username, str *domain,
 	{
 		/* No path specified - use all resource-lists. */
 		*rl_node = XMLDocGetNodeByName(*xmldoc,"resource-lists", NULL);
-		if(rl_node==NULL)
+		if(*rl_node==NULL)
 		{
 			LM_ERR("no resource-lists node in XML document\n");
 			goto error;
diff --git a/modules/rls/subscribe.c b/modules/rls/subscribe.c
index d15a601..7c45908 100644
--- a/modules/rls/subscribe.c
+++ b/modules/rls/subscribe.c
@@ -1037,6 +1037,8 @@ int send_resource_subs(char* uri, void* param)
 		LM_WARN("%.*s has %.*s multiple times in the same resource list\n",
 			s->watcher_uri->len, s->watcher_uri->s,
 			s->pres_uri->len, s->pres_uri->s);
+		pkg_free(tmp_str->s);
+		pkg_free(tmp_str);
 		return 1;
 	}
 
diff --git a/modules/rls/utils.h b/modules/rls/utils.h
index 4b245e7..7918a9d 100644
--- a/modules/rls/utils.h
+++ b/modules/rls/utils.h
@@ -21,7 +21,7 @@
  *
  */
 
-#ifndef RLS_URILS_H
+#ifndef RLS_UTILS_H
 #define RLS_UTILS_H
 
 #include "../../ut.h"
diff --git a/modules/rr/record.c b/modules/rr/record.c
index c160e98..3ccd452 100644
--- a/modules/rr/record.c
+++ b/modules/rr/record.c
@@ -651,7 +651,7 @@ static inline int build_advertised_rr(struct lump* _l, struct lump* _l2, str *_d
 	memcpy(p, rr_prefix, rr_prefix_len);
 	p += rr_prefix_len;
 
-	if (user->len) {
+	if (user && user->len) {
 		memcpy(p, user->s, user->len);
 		p += user->len;
 		*p = '@';
@@ -714,6 +714,7 @@ static inline int build_advertised_rr(struct lump* _l, struct lump* _l2, str *_d
 	return 1;
 lump_err:
 	if (hdr) pkg_free(hdr);
+	if (trans) pkg_free(trans);
 	if (suffix) pkg_free(suffix);
 	if (term) pkg_free(term);
 	if (r2) pkg_free(r2);
diff --git a/modules/rtimer/rtimer_mod.c b/modules/rtimer/rtimer_mod.c
index 03a002d..271b888 100644
--- a/modules/rtimer/rtimer_mod.c
+++ b/modules/rtimer/rtimer_mod.c
@@ -37,6 +37,8 @@
 #include "../../socket_info.h"
 #include "../../dset.h"
 #include "../../pt.h"
+#include "../../usr_avp.h"
+#include "../../xavp.h"
 #include "../../timer_proc.h"
 #include "../../script_cb.h"
 #include "../../parser/parse_param.h"
@@ -190,6 +192,10 @@ void stm_timer_exec(unsigned int ticks, void *param)
 		set_route_type(REQUEST_ROUTE);
 		run_top_route(main_rt.rlist[rt->route], fmsg, 0);
 		exec_post_script_cb(fmsg, REQUEST_CB_TYPE);
+		reset_avps();
+#ifdef WITH_XAVP
+		xavp_reset_list();
+#endif
 	}
 }
 
diff --git a/modules/sctp/sctp_mod.c b/modules/sctp/sctp_mod.c
index 1469e6d..9b33177 100644
--- a/modules/sctp/sctp_mod.c
+++ b/modules/sctp/sctp_mod.c
@@ -37,7 +37,9 @@
 MODULE_VERSION
 
 static int mod_init(void);
+#ifdef USE_SCTP
 static int sctp_mod_pre_init(void);
+#endif
 
 
 static cmd_export_t cmds[]={
@@ -122,6 +124,7 @@ static int mod_init(void)
 #endif /* USE_SCTP */
 }
 
+#ifdef USE_SCTP
 static int sctp_mod_pre_init(void)
 {
 	sctp_srapi_t api;
@@ -143,3 +146,4 @@ static int sctp_mod_pre_init(void)
 	}
 	return 0;
 }
+#endif
diff --git a/modules/sipcapture/sipcapture.c b/modules/sipcapture/sipcapture.c
index dc46ab8..a4eed22 100644
--- a/modules/sipcapture/sipcapture.c
+++ b/modules/sipcapture/sipcapture.c
@@ -1054,15 +1054,17 @@ static void destroy(void)
 
 	/*free content from the linked list*/
 	_capture_mode_data_t * c;
+	_capture_mode_data_t * c0;
 
 	c = capture_modes_root;
 
 	while (c){
+		c0 = c;
 		if (c->name.s){
 			pkg_free(c->name.s);
 		}
 		if (c->db_url.s){
-			pkg_free(c->name.s);
+			pkg_free(c->db_url.s);
 		}
 		if (c->db_con){
 			c->db_funcs.close(c->db_con);
@@ -1072,7 +1074,7 @@ static void destroy(void)
 		}
 
 		pkg_free(c);
-		c = c->next;
+		c = c0->next;
 	}
 
 	if (capture_on_flag)
diff --git a/modules/sipt/ss7_parser.c b/modules/sipt/ss7_parser.c
index 3c6d8ff..528e10d 100644
--- a/modules/sipt/ss7_parser.c
+++ b/modules/sipt/ss7_parser.c
@@ -415,7 +415,7 @@ int isup_update_calling(struct sdp_mangler * mangle, char * origin, int nai, int
 				case ISUP_PARM_CALLING_PARTY_NUM:
 					res2 = encode_calling_party(origin, nai, presentation, screening, &new_party[1], 255-1);
 					new_party[0] = (char)res2;
-					replace_body_segment(mangle, offset+1,(int)buf[offset+1],new_party, res2+1);
+					replace_body_segment(mangle, offset+1,(int)buf[offset+1]+1,new_party, res2+1);
 
 					has_calling = 1;
 					break;
diff --git a/modules/siputils/checks.c b/modules/siputils/checks.c
index a1a9344..7f50cfc 100644
--- a/modules/siputils/checks.c
+++ b/modules/siputils/checks.c
@@ -354,7 +354,7 @@ int tel2sip(struct sip_msg* _msg, char* _uri, char* _hostpart, char* _res)
     if (strncasecmp(uri.s, "tel:", 4) != 0) return 1;
     
     /* reserve memory for clean tel uri */
-    tel_uri.s = pkg_malloc(uri.len);
+    tel_uri.s = pkg_malloc(uri.len+1);
     if (tel_uri.s == 0) {
 	LM_ERR("no more pkg memory\n");
 	return -1;
diff --git a/modules/siputils/sipops.c b/modules/siputils/sipops.c
index 357d92c..5394458 100644
--- a/modules/siputils/sipops.c
+++ b/modules/siputils/sipops.c
@@ -92,7 +92,7 @@ int w_cmp_aor(struct sip_msg *msg, char *uri1, char *uri2)
 
 int w_is_gruu(sip_msg_t *msg, char *uri1, char *p2)
 {
-	str s1;
+        str s1, *s2;
 	sip_uri_t turi;
 	sip_uri_t *puri;
 
@@ -103,12 +103,17 @@ int w_is_gruu(sip_msg_t *msg, char *uri1, char *p2)
 			LM_ERR("cannot get first parameter\n");
 			return -8;
 		}
-		if(parse_uri(s1.s, s1.len, &turi)!=0)
-			return -1;
+		if(parse_uri(s1.s, s1.len, &turi)!=0) {
+		    LM_ERR("parsing of uri '%.*s' failed\n", s1.len, s1.s);
+		    return -1;
+		}
 		puri = &turi;
 	} else {
-		if(parse_sip_msg_uri(msg)<0)
-			return -1;
+  	        if(parse_sip_msg_uri(msg)<0) {
+		    s2 = GET_RURI(msg);
+  		    LM_ERR("parsing of uri '%.*s' failed\n", s2->len, s2->s);
+		    return -1;
+		}
 		puri = &msg->parsed_uri;
 	}
 	if(puri->gr.s!=NULL)
diff --git a/modules/sqlops/README b/modules/sqlops/README
index 52f0171..5be7274 100644
--- a/modules/sqlops/README
+++ b/modules/sqlops/README
@@ -170,7 +170,13 @@ modparam("sqlops", "sqlres", "ra")
    4.3. sql_pvquery(connection, query, result)
    4.4. sql_result_free(result)
 
-4.1.  sql_query(connection, query[, result])
+   Note that sql_query(), sql_xquery() and sql_pvquery() functions have
+   the following return values:
+     * -1 - error in parameters or query execution
+     * 1 - query successful, at least one row in resultset (for SELECTs)
+     * 2 - query successful, no rows returned
+
+4.1. sql_query(connection, query[, result])
 
    Make an SQL query using 'connection' and store data in 'result'.
      * connection - the name of the connection to be used for the query
@@ -193,7 +199,7 @@ xlog("number of rows in table domain: $dbr(ra=>rows)\n");
 sql_result_free("ra");
 ...
 
-4.2.  sql_xquery(connection, query, result)
+4.2. sql_xquery(connection, query, result)
 
    Make an SQL query using 'connection' and store data in 'result' xavp.
      * connection - the name of the connection to be used for the query
@@ -209,10 +215,14 @@ sql_result_free("ra");
 modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
 ...
 sql_xquery("ca", "select * from domain", "ra");
-  xlog("first domain: $xavp(ra=>domain) with id: $xavp(ra=>domain_id)\n");
+xlog("first domain: $xavp(ra=>domain) with id: $xavp(ra=>domain_id)\n");
 ...
+if (sql_xquery("ca", "select * from domain", "ra") == 1) {
+    xlog("domain: $xavp(ra=>domain) with id: $xavp(ra=>domain_id)\n");
+}
+..
 
-4.3.  sql_pvquery(connection, query, result)
+4.3. sql_pvquery(connection, query, result)
 
    Make an SQL query using 'connection' and store data in arbitrary pseudo
    variables specified by 'result' parameter.
@@ -244,7 +254,7 @@ sql_pvquery("ca", "select 'col1', 2, NULL, 'sip:test at example.com'",
         "$var(a), $avp(col2), $xavp(item[0]=>s), $ru");
 ...
 
-4.4.  sql_result_free(result)
+4.4. sql_result_free(result)
 
    Free data in SQL 'result'.
 
diff --git a/modules/sqlops/doc/sqlops_admin.xml b/modules/sqlops/doc/sqlops_admin.xml
index f7c5510..b11f7e2 100644
--- a/modules/sqlops/doc/sqlops_admin.xml
+++ b/modules/sqlops/doc/sqlops_admin.xml
@@ -178,6 +178,27 @@ modparam("sqlops", "sqlres", "ra")
 	</section>
 	<section>
 	<title>Functions</title>
+	<para>
+		Note that sql_query(), sql_xquery() and sql_pvquery() functions have
+		the following return values:
+	</para>
+	<itemizedlist>
+		<listitem>
+		<para>
+			<emphasis>-1</emphasis> - error in parameters or query execution
+		</para>
+		</listitem>
+		<listitem>
+		<para>
+			<emphasis>1</emphasis> - query successful, at least one row in resultset (for SELECTs)
+		</para>
+		</listitem>
+		<listitem>
+		<para>
+			<emphasis>2</emphasis> - query successful, no rows returned
+		</para>
+		</listitem>
+	</itemizedlist>
 	<section>
 		<title>
 		<function moreinfo="none">sql_query(connection, query[, result])</function>
@@ -260,8 +281,12 @@ sql_result_free("ra");
 modparam("sqlops","sqlcon","ca=>&exampledb;")
 ...
 sql_xquery("ca", "select * from domain", "ra");
-  xlog("first domain: $xavp(ra=>domain) with id: $xavp(ra=>domain_id)\n");
+xlog("first domain: $xavp(ra=>domain) with id: $xavp(ra=>domain_id)\n");
 ...
+if (sql_xquery("ca", "select * from domain", "ra") == 1) {
+    xlog("domain: $xavp(ra=>domain) with id: $xavp(ra=>domain_id)\n");
+}
+..
 </programlisting>
 		</example>
 	</section>
diff --git a/modules/textops/textops.c b/modules/textops/textops.c
index 1085019..12bcf88 100644
--- a/modules/textops/textops.c
+++ b/modules/textops/textops.c
@@ -1553,8 +1553,8 @@ int add_hf_helper(struct sip_msg* msg, str *str1, str *str2,
 	}
 
 	if (str2) {
-		memcpy(s+str1->len, REQ_LINE(msg).uri.s, REQ_LINE(msg).uri.len);
-		memcpy(s+str1->len+REQ_LINE(msg).uri.len, str2->s, str2->len );
+		memcpy(s+s0.len, REQ_LINE(msg).uri.s, REQ_LINE(msg).uri.len);
+		memcpy(s+s0.len+REQ_LINE(msg).uri.len, str2->s, str2->len );
 	}
 
 	if (insert_new_lump_before(anchor, s, len, 0) == 0) {
@@ -1740,6 +1740,7 @@ static int fixup_method(void** param, int param_no)
 		{
 			LM_ERR("unknown method in list [%.*s/%d] - must be only defined methods\n",
 				s->len, s->s, method);
+			pkg_free(s);
 			return E_UNSPEC;
 		}
 		LM_DBG("using id for methods [%.*s/%d]\n",
@@ -2235,7 +2236,7 @@ static int subst_hf_f(struct sip_msg *msg, char *str_hf, char *subst, char *flag
 	char* begin;
 	struct subst_expr* se;
 	int off;
-	int nmatches;
+	int nmatches=0;
 	str body;
 	hdr_field_t *hf;
 	hdr_field_t *hfl = NULL;
diff --git a/modules/textopsx/textopsx.c b/modules/textopsx/textopsx.c
index 2a7273d..629681c 100644
--- a/modules/textopsx/textopsx.c
+++ b/modules/textopsx/textopsx.c
@@ -166,7 +166,7 @@ static int msg_apply_changes_f(sip_msg_t *msg, char *str1, char *str2)
 	} else {
 		obuf.s = build_req_buf_from_sip_req(msg,
 				(unsigned int*)&obuf.len, &dst,
-				BUILD_NO_LOCAL_VIA|BUILD_NO_VIA1_UPDATE);
+				BUILD_NO_PATH|BUILD_NO_LOCAL_VIA|BUILD_NO_VIA1_UPDATE);
 	}
 	if(obuf.s == NULL)
 	{
@@ -1040,8 +1040,9 @@ static void get_uri_and_skip_until_params(str *param_area, str *name, str *uri)
 
 	name->len = 0;
 	uri->len = 0;
+	uri->s = 0;
 	uri_done = 0;
-        name->s = param_area->s;
+    name->s = param_area->s;
 	for (i=0; i<param_area->len && param_area->s[i]!=';'; ) {	/* [ *(token LSW)/quoted-string ] "<" addr-spec ">" | addr-spec */
 		/* skip name */
 		for (quoted=0, uri_pos=i; i<param_area->len; i++) {
@@ -1078,7 +1079,7 @@ static void get_uri_and_skip_until_params(str *param_area, str *name, str *uri)
 			}
 		}
 	}
-        param_area->s+= i;
+    param_area->s+= i;
 	param_area->len-= i;
 	if (uri->s == name->s)
 		name->len = 0;
@@ -1200,7 +1201,8 @@ static int assign_hf_process2_params(struct sip_msg* msg, struct hdr_field* hf,
 static int insupddel_hf_value_f(struct sip_msg* msg, char* _hname, char* _val) {
 	struct hname_data* hname = (void*) _hname;
 	struct hdr_field* hf;
-	str val, hval1, hval2;
+	str val = {0};
+	str hval1, hval2;
 	int res;
 
 	if (_val) {
diff --git a/modules/tls/README b/modules/tls/README
index cdd3493..fbf1762 100644
--- a/modules/tls/README
+++ b/modules/tls/README
@@ -4,7 +4,13 @@ Andrei Pelinescu-Onciul
 
    iptelorg GmbH
 
-   Copyright � 2007 iptelorg GmbH
+Carsten Bock
+
+   ng-voice GmbH
+
+   Copyright © 2007 iptelorg GmbH
+
+   Copyright © 2014 ng-voice GmbH
      __________________________________________________________________
 
    Table of Contents
@@ -274,6 +280,9 @@ make TLS_EXTRA_LIBS="-lkrb5 -lz" all include_modules=tls
    when trying to load the tls module (check the log), it means some
    needed library was not linked and it must be added to TLS_EXTRA_LIBS
 
+   Elliptic Curve Diffie-Hellman (EDCH)-Ciphers are only supported in
+   OpenSSL 1.0.0e and later.
+
 5. TLS and Low Memory
 
    The openssl library doesn't handle very well low memory situations. If
diff --git a/modules/tls/doc/tls.xml b/modules/tls/doc/tls.xml
index 4f41780..4302cc5 100644
--- a/modules/tls/doc/tls.xml
+++ b/modules/tls/doc/tls.xml
@@ -20,11 +20,23 @@
 			<email>andrei at iptel.org</email>
 		</address>
 		</author>
+		<author>
+		<firstname>Carsten</firstname>
+		<surname>Bock</surname>
+		<affiliation><orgname>ng-voice GmbH</orgname></affiliation>
+		<address>
+			<email>carsten at ng-voice.com</email>
+		</address>
+		</author>
 	</authorgroup>
 	<copyright>
 		<year>2007</year>
 		<holder>iptelorg GmbH</holder>
 	</copyright>
+	<copyright>
+		<year>2014</year>
+		<holder>ng-voice GmbH</holder>
+	</copyright>
 	</bookinfo>
 	<toc></toc>
 
@@ -112,6 +124,9 @@ make TLS_EXTRA_LIBS="-lkrb5 -lz" all include_modules=tls
 		<para>
 			In general, if Kamailio fails to start with a symbol not found error when trying to load the tls module (check the log), it means some needed library was not linked and it must be added to <emphasis>TLS_EXTRA_LIBS</emphasis>
 		</para>
+		<para>
+<ulink url="http://wiki.openssl.org/index.php/Elliptic_Curve_Diffie_Hellman">Elliptic Curve Diffie-Hellman (EDCH)</ulink>-Ciphers are only supported in OpenSSL 1.0.0e and later.
+		</para>
 	</section>
 
 	<section id="tls.low_memory">
diff --git a/modules/tls/tls_config.c b/modules/tls/tls_config.c
index 7937876..fa52800 100644
--- a/modules/tls/tls_config.c
+++ b/modules/tls/tls_config.c
@@ -45,7 +45,7 @@ static tls_domains_cfg_t* cfg = NULL;
 static tls_domain_t* domain = NULL;
 
 static int parse_ipv6(struct ip_addr* ip, cfg_token_t* token, 
-					  cfg_parser_t* st)
+		cfg_parser_t* st)
 {
 	int ret;
 	cfg_token_t t;
@@ -66,15 +66,15 @@ static int parse_ipv6(struct ip_addr* ip, cfg_token_t* token,
 	*ip = *ipv6;
 	return 0;
 
- err:
+err:
 	ERR("%s:%d:%d: Invalid IPv6 address\n", 
-	    st->file, token->start.line, token->start.col);
+			st->file, token->start.line, token->start.col);
 	return -1;
 }
 
 
 static int parse_ipv4(struct ip_addr* ip, cfg_token_t* token, 
-					  cfg_parser_t* st)
+		cfg_parser_t* st)
 {
 	int ret, i;
 	cfg_token_t  t;
@@ -92,7 +92,7 @@ static int parse_ipv4(struct ip_addr* ip, cfg_token_t* token,
 		ret = cfg_get_token(&t, st, 0);
 		if (ret < 0) return -1;
 		if (ret > 0 || t.type != '.')  goto err;
-		
+
 		ret = cfg_get_token(&t, st, 0);
 		if (ret < 0) return -1;
 		if (ret > 0 || t.type != CFG_TOKEN_ALPHA) goto err;
@@ -102,9 +102,9 @@ static int parse_ipv4(struct ip_addr* ip, cfg_token_t* token,
 	}
 
 	return 0;
- err:
+err:
 	ERR("%s:%d:%d: Invalid IPv4 address\n", 
-	    st->file, token->start.line, token->start.col);
+			st->file, token->start.line, token->start.col);
 	return -1;
 }
 
@@ -182,17 +182,17 @@ static void update_opt_variables(void)
 
 
 static int parse_hostport(int* type, struct ip_addr* ip, unsigned int* port, 
-						  cfg_token_t* token, cfg_parser_t* st)
+		cfg_token_t* token, cfg_parser_t* st)
 {
 	int ret;
 	cfg_token_t t;
-    cfg_option_t* opt;
+	cfg_option_t* opt;
 
 	ret = cfg_get_token(&t, st, 0);
 	if (ret < 0) return -1;
 	if (ret > 0) {
 		ERR("%s:%d:%d: Missing IP address\n", st->file, 
-			token->start.line, token->start.col);
+				token->start.line, token->start.col);
 		return -1;
 	}
 
@@ -202,44 +202,44 @@ static int parse_hostport(int* type, struct ip_addr* ip, unsigned int* port,
 		opt = cfg_lookup_token(token_default, &t.val);
 		if (opt) {
 			*type = TLS_DOMAIN_DEF;
-			     /* Default domain */
+			/* Default domain */
 			return 0;
 		} else {
 			if (parse_ipv4(ip, &t, st) < 0) return -1;
 		}
 	} else {
 		ERR("%s:%d:%d: Syntax error, IP address expected\n", 
-		    st->file, t.start.line, t.start.col);
+				st->file, t.start.line, t.start.col);
 		return -1;
 	}
 	*type = 0;
 
-	     /* Parse port */
+	/* Parse port */
 	ret = cfg_get_token(&t, st, 0);
 	if (ret < 0) return -1;
 	if (ret > 0) {
 		ERR("%s:%d:%d: Syntax error, ':' expected\n", st->file, st->line, 
-			st->col);
+				st->col);
 		return -1;
 	}
-	
+
 	if (t.type != ':') {
 		ERR("%s:%d:%d: Syntax error, ':' expected\n", 
-		    st->file, t.start.line, t.start.col);
+				st->file, t.start.line, t.start.col);
 		return -1;
 	}	
-	
+
 	ret = cfg_get_token(&t, st, 0);
 	if (ret < 0) return -1;
 	if (ret > 0) {
 		ERR("%s:%d:%d: Premature end of file, port number missing\n", 
-		    st->file, t.start.line, t.start.col);
+				st->file, t.start.line, t.start.col);
 		return -1;
 	}
-	
+
 	if (t.type != CFG_TOKEN_ALPHA || (str2int(&t.val, port) < 0)) {
 		ERR("%s:%d:%d: Invalid port number '%.*s'\n", 
-		    st->file, t.start.line, t.start.col, STR_FMT(&t.val));
+				st->file, t.start.line, t.start.col, STR_FMT(&t.val));
 		return -1;
 	}		
 	return 0;
@@ -262,27 +262,27 @@ static int parse_domain(void* param, cfg_parser_t* st, unsigned int flags)
 	if (ret < 0) return -1;
 	if (ret > 0) {
 		ERR("%s:%d:%d: TLS domain type missing\n", 
-		    st->file, st->line, st->col);
+				st->file, st->line, st->col);
 		return -1;
 	}
 
 	if (t.type != CFG_TOKEN_ALPHA || 
-	    ((opt = cfg_lookup_token(domain_types, &t.val)) == NULL)) {
+			((opt = cfg_lookup_token(domain_types, &t.val)) == NULL)) {
 		ERR("%s:%d:%d: Invalid TLS domain type %d:'%.*s'\n", 
-		    st->file, t.start.line, t.start.col, t.type, STR_FMT(&t.val));
+				st->file, t.start.line, t.start.col, t.type, STR_FMT(&t.val));
 		return -1;
 	}
-	
+
 	ret = cfg_get_token(&t, st, 0);
 	if (ret < 0) return -1;
 	if (ret > 0) {
 		ERR("%s:%d:%d: TLS domain IP address missing\n", 
-		    st->file, st->line, st->col);
+				st->file, st->line, st->col);
 		return -1;
 	}
 	if (t.type != ':') {
 		ERR("%s:%d:%d: Syntax error, ':' expected\n", 
-		    st->file, t.start.line, t.start.col);
+				st->file, t.start.line, t.start.col);
 		return -1;
 	}	
 
@@ -293,12 +293,12 @@ static int parse_domain(void* param, cfg_parser_t* st, unsigned int flags)
 	if (ret < 0) return -1;
 	if (ret > 0) {
 		ERR("%s:%d:%d: Closing ']' missing\n", 
-		    st->file, st->line, st->col);
+				st->file, st->line, st->col);
 		return -1;
 	}
 	if (t.type != ']') {
 		ERR("%s:%d:%d: Syntax error, ']' expected\n", 
-		    st->file, t.start.line, t.start.col);
+				st->file, t.start.line, t.start.col);
 		return -1;
 	}
 
@@ -312,16 +312,16 @@ static int parse_domain(void* param, cfg_parser_t* st, unsigned int flags)
 	ret = tls_add_domain(cfg, domain);
 	if (ret < 0) {
 		ERR("%s:%d: Error while creating TLS domain structure\n", st->file, 
-			st->line);
+				st->line);
 		tls_free_domain(domain);
 		return -1;
 	} else if (ret == 1) {
 		ERR("%s:%d: Duplicate TLS domain (appears earlier in the config file)\n", 
-		    st->file, st->line);
+				st->file, st->line);
 		tls_free_domain(domain);
 		return -1;
 	}
-	
+
 	update_opt_variables();
 	cfg_set_options(st, options);
 	return 0;
@@ -333,106 +333,109 @@ static int parse_domain(void* param, cfg_parser_t* st, unsigned int flags)
  */
 tls_domains_cfg_t* tls_load_config(str* filename)
 {
-    cfg_parser_t* parser;
-    str empty;
-    struct stat file_status;
-    char tmp_name[13] = "configXXXXXX";
-    str filename_str;
-    DIR *dir;
-    struct dirent *ent;
-    int out_fd, in_fd, filename_is_directory;
-    char *file_path, ch;
-
-    parser = NULL;
-    memset(&file_status, 0, sizeof(struct stat));
-    dir = (DIR *)NULL;
-    in_fd = out_fd = filename_is_directory = 0;
-    file_path = (char *)0;
-
-    if ((cfg = tls_new_cfg()) == NULL) goto error;
-
-    if (stat(filename->s, &file_status) != 0) {
-	LOG(L_ERR, "cannot stat config file %s\n", filename->s);
-	goto error;
-    }
-    if (S_ISDIR(file_status.st_mode)) {
-	filename_is_directory = 1;
-	dir = opendir(filename->s);
-	if (dir == NULL) {
-	    LOG(L_ERR, "cannot open directory file %s\n", filename->s);
-	    goto error;
-	}
-	out_fd = mkstemp(&(tmp_name[0]));
-	if (out_fd == -1) {
-	    LOG(L_ERR, "cannot make tmp file %s\n", &(tmp_name[0]));
-	    goto error;
-	}
-	while ((ent = readdir(dir)) != NULL) {
-	    file_path = pkg_malloc(filename->len + 1 + 256);
-	    memcpy(file_path, filename->s, filename->len);
-	    file_path[filename->len] = '/';
-	    strcpy(file_path + filename->len + 1, ent->d_name);
-	    if (stat(file_path, &file_status) != 0) {
-		LOG(L_ERR, "cannot get status of config file %s\n",
-		    file_path);
+	cfg_parser_t* parser;
+	str empty;
+	struct stat file_status;
+	char tmp_name[13] = "configXXXXXX";
+	str filename_str;
+	DIR *dir;
+	struct dirent *ent;
+	int out_fd, in_fd, filename_is_directory;
+	char *file_path, ch;
+
+	parser = NULL;
+	memset(&file_status, 0, sizeof(struct stat));
+	dir = (DIR *)NULL;
+	in_fd = out_fd = filename_is_directory = 0;
+	file_path = (char *)0;
+
+	if ((cfg = tls_new_cfg()) == NULL) goto error;
+
+	if (stat(filename->s, &file_status) != 0) {
+		LOG(L_ERR, "cannot stat config file %s\n", filename->s);
 		goto error;
-	    }
-	    if (S_ISREG(file_status.st_mode)) {
-		in_fd = open(file_path, O_RDONLY);
-		if (in_fd == -1) {
-		    LOG(L_ERR, "cannot open config file %s\n",
-			file_path);
-		    goto error;
+	}
+	if (S_ISDIR(file_status.st_mode)) {
+		filename_is_directory = 1;
+		dir = opendir(filename->s);
+		if (dir == NULL) {
+			LOG(L_ERR, "cannot open directory file %s\n", filename->s);
+			goto error;
 		}
-		pkg_free(file_path);
-		while (read(in_fd, &ch, 1)) {
-		    write(out_fd, &ch, 1);
+		out_fd = mkstemp(&(tmp_name[0]));
+		if (out_fd == -1) {
+			LOG(L_ERR, "cannot make tmp file %s\n", &(tmp_name[0]));
+			goto error;
 		}
-		close(in_fd);
-		in_fd = 0;
-		ch = '\n';
-		write(out_fd, &ch, 1);
-	    }
+		while ((ent = readdir(dir)) != NULL) {
+			if(file_path) pkg_free(file_path);
+			file_path = pkg_malloc(filename->len + 1 + 256);
+			memcpy(file_path, filename->s, filename->len);
+			file_path[filename->len] = '/';
+			strcpy(file_path + filename->len + 1, ent->d_name);
+			if (stat(file_path, &file_status) != 0) {
+				LOG(L_ERR, "cannot get status of config file %s\n",
+						file_path);
+				goto error;
+			}
+			if (S_ISREG(file_status.st_mode)) {
+				in_fd = open(file_path, O_RDONLY);
+				if (in_fd == -1) {
+					LOG(L_ERR, "cannot open config file %s\n",
+							file_path);
+					goto error;
+				}
+				pkg_free(file_path);
+				file_path = NULL;
+				while (read(in_fd, &ch, 1)) {
+					write(out_fd, &ch, 1);
+				}
+				close(in_fd);
+				in_fd = 0;
+				ch = '\n';
+				write(out_fd, &ch, 1);
+			}
+		}
+		closedir(dir);
+		close(out_fd);
+		dir = (DIR *)NULL;
+		out_fd = 0;
 	}
-	closedir(dir);
-	close(out_fd);
-	dir = (DIR *)NULL;
-	out_fd = 0;
-    }
-
-    empty.s = 0;
-    empty.len = 0;
-    if (filename_is_directory) {
-	filename_str.s = &(tmp_name[0]);
-	filename_str.len = strlen(&(tmp_name[0]));
-	if ((parser = cfg_parser_init(&empty, &filename_str)) == NULL) {
-	    ERR("tls: Error while initializing configuration file parser.\n");
-	    unlink(&(tmp_name[0]));
-	    goto error;
+
+	empty.s = 0;
+	empty.len = 0;
+	if (filename_is_directory) {
+		filename_str.s = &(tmp_name[0]);
+		filename_str.len = strlen(&(tmp_name[0]));
+		if ((parser = cfg_parser_init(&empty, &filename_str)) == NULL) {
+			ERR("tls: Error while initializing configuration file parser.\n");
+			unlink(&(tmp_name[0]));
+			goto error;
+		}
+		unlink(&(tmp_name[0]));
+	} else {
+		if ((parser = cfg_parser_init(&empty, filename)) == NULL) {
+			ERR("tls: Error while initializing configuration file parser.\n");
+			goto error;
+		}	
 	}
-	unlink(&(tmp_name[0]));
-    } else {
-	if ((parser = cfg_parser_init(&empty, filename)) == NULL) {
-	    ERR("tls: Error while initializing configuration file parser.\n");
-	    goto error;
-	}	
-    }
-
-    cfg_section_parser(parser, parse_domain, NULL);
-    if (sr_cfg_parse(parser)) goto error;
-    cfg_parser_close(parser);
-    return cfg;
-
- error:
-    if (dir) closedir(dir);
-    if (out_fd > 0) {
-	close(out_fd);
-	unlink(&(tmp_name[0]));
-    }
-    if (file_path) pkg_free(file_path);
-    if (parser) cfg_parser_close(parser);
-    if (cfg) tls_free_cfg(cfg);
-    return 0;
+
+	cfg_section_parser(parser, parse_domain, NULL);
+	if (sr_cfg_parse(parser)) goto error;
+	cfg_parser_close(parser);
+	if (file_path) pkg_free(file_path);
+	return cfg;
+
+error:
+	if (dir) closedir(dir);
+	if (out_fd > 0) {
+		close(out_fd);
+		unlink(&(tmp_name[0]));
+	}
+	if (file_path) pkg_free(file_path);
+	if (parser) cfg_parser_close(parser);
+	if (cfg) tls_free_cfg(cfg);
+	return 0;
 }
 
 
@@ -441,15 +444,15 @@ tls_domains_cfg_t* tls_load_config(str* filename)
  */
 int tls_parse_method(str* method)
 {
-    cfg_option_t* opt;
+	cfg_option_t* opt;
 
-    if (!method) {
-        BUG("Invalid parameter value\n");
-        return -1;
-    }
+	if (!method) {
+		BUG("Invalid parameter value\n");
+		return -1;
+	}
 
-    opt = cfg_lookup_token(methods, method);
-    if (!opt) return -1;
+	opt = cfg_lookup_token(methods, method);
+	if (!opt) return -1;
 
 #if OPENSSL_VERSION_NUMBER < 0x1000100fL
 	if(opt->val == TLS_USE_TLSv1_1) {
@@ -466,5 +469,5 @@ int tls_parse_method(str* method)
 	}
 #endif
 
-    return opt->val;
+	return opt->val;
 }
diff --git a/modules/tls/tls_domain.c b/modules/tls/tls_domain.c
index b832c63..a814818 100644
--- a/modules/tls/tls_domain.c
+++ b/modules/tls/tls_domain.c
@@ -42,6 +42,91 @@
 #include "tls_domain.h"
 #include "tls_cfg.h"
 
+/*
+ * ECDHE is enabled only on OpenSSL 1.0.0e and later.
+ * See http://www.openssl.org/news/secadv_20110906.txt
+ * for details.
+ */
+#ifndef OPENSSL_NO_ECDH
+static void setup_ecdh(SSL_CTX *ctx)
+{
+   EC_KEY *ecdh;
+
+   if (SSLeay() < 0x1000005fL) {
+      return;
+   }
+
+   ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
+   SSL_CTX_set_options(ctx, SSL_OP_SINGLE_ECDH_USE);
+   SSL_CTX_set_tmp_ecdh(ctx, ecdh);
+
+   EC_KEY_free(ecdh);
+}
+#endif
+
+#ifndef OPENSSL_NO_DH
+
+static unsigned char dh3072_p[] = {
+   0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC9,0x0F,0xDA,0xA2,
+   0x21,0x68,0xC2,0x34,0xC4,0xC6,0x62,0x8B,0x80,0xDC,0x1C,0xD1,
+   0x29,0x02,0x4E,0x08,0x8A,0x67,0xCC,0x74,0x02,0x0B,0xBE,0xA6,
+   0x3B,0x13,0x9B,0x22,0x51,0x4A,0x08,0x79,0x8E,0x34,0x04,0xDD,
+   0xEF,0x95,0x19,0xB3,0xCD,0x3A,0x43,0x1B,0x30,0x2B,0x0A,0x6D,
+   0xF2,0x5F,0x14,0x37,0x4F,0xE1,0x35,0x6D,0x6D,0x51,0xC2,0x45,
+   0xE4,0x85,0xB5,0x76,0x62,0x5E,0x7E,0xC6,0xF4,0x4C,0x42,0xE9,
+   0xA6,0x37,0xED,0x6B,0x0B,0xFF,0x5C,0xB6,0xF4,0x06,0xB7,0xED,
+   0xEE,0x38,0x6B,0xFB,0x5A,0x89,0x9F,0xA5,0xAE,0x9F,0x24,0x11,
+   0x7C,0x4B,0x1F,0xE6,0x49,0x28,0x66,0x51,0xEC,0xE4,0x5B,0x3D,
+   0xC2,0x00,0x7C,0xB8,0xA1,0x63,0xBF,0x05,0x98,0xDA,0x48,0x36,
+   0x1C,0x55,0xD3,0x9A,0x69,0x16,0x3F,0xA8,0xFD,0x24,0xCF,0x5F,
+   0x83,0x65,0x5D,0x23,0xDC,0xA3,0xAD,0x96,0x1C,0x62,0xF3,0x56,
+   0x20,0x85,0x52,0xBB,0x9E,0xD5,0x29,0x07,0x70,0x96,0x96,0x6D,
+   0x67,0x0C,0x35,0x4E,0x4A,0xBC,0x98,0x04,0xF1,0x74,0x6C,0x08,
+   0xCA,0x18,0x21,0x7C,0x32,0x90,0x5E,0x46,0x2E,0x36,0xCE,0x3B,
+   0xE3,0x9E,0x77,0x2C,0x18,0x0E,0x86,0x03,0x9B,0x27,0x83,0xA2,
+   0xEC,0x07,0xA2,0x8F,0xB5,0xC5,0x5D,0xF0,0x6F,0x4C,0x52,0xC9,
+   0xDE,0x2B,0xCB,0xF6,0x95,0x58,0x17,0x18,0x39,0x95,0x49,0x7C,
+   0xEA,0x95,0x6A,0xE5,0x15,0xD2,0x26,0x18,0x98,0xFA,0x05,0x10,
+   0x15,0x72,0x8E,0x5A,0x8A,0xAA,0xC4,0x2D,0xAD,0x33,0x17,0x0D,
+   0x04,0x50,0x7A,0x33,0xA8,0x55,0x21,0xAB,0xDF,0x1C,0xBA,0x64,
+   0xEC,0xFB,0x85,0x04,0x58,0xDB,0xEF,0x0A,0x8A,0xEA,0x71,0x57,
+   0x5D,0x06,0x0C,0x7D,0xB3,0x97,0x0F,0x85,0xA6,0xE1,0xE4,0xC7,
+   0xAB,0xF5,0xAE,0x8C,0xDB,0x09,0x33,0xD7,0x1E,0x8C,0x94,0xE0,
+   0x4A,0x25,0x61,0x9D,0xCE,0xE3,0xD2,0x26,0x1A,0xD2,0xEE,0x6B,
+   0xF1,0x2F,0xFA,0x06,0xD9,0x8A,0x08,0x64,0xD8,0x76,0x02,0x73,
+   0x3E,0xC8,0x6A,0x64,0x52,0x1F,0x2B,0x18,0x17,0x7B,0x20,0x0C,
+   0xBB,0xE1,0x17,0x57,0x7A,0x61,0x5D,0x6C,0x77,0x09,0x88,0xC0,
+   0xBA,0xD9,0x46,0xE2,0x08,0xE2,0x4F,0xA0,0x74,0xE5,0xAB,0x31,
+   0x43,0xDB,0x5B,0xFC,0xE0,0xFD,0x10,0x8E,0x4B,0x82,0xD1,0x20,
+   0xA9,0x3A,0xD2,0xCA,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF
+
+};
+
+static unsigned char dh3072_g[] = { 0x02 };
+
+static void setup_dh(SSL_CTX *ctx)
+{
+   DH *dh;
+
+   dh = DH_new();
+   if (dh == NULL) {
+      return;
+   }
+
+   dh->p = BN_bin2bn(dh3072_p, sizeof(dh3072_p), NULL);
+   dh->g = BN_bin2bn(dh3072_g, sizeof(dh3072_g), NULL);
+   if (dh->p == NULL || dh->g == NULL) {
+      DH_free(dh);
+      return;
+   }
+
+   SSL_CTX_set_options(ctx, SSL_OP_SINGLE_DH_USE);
+   SSL_CTX_set_tmp_dh(ctx, dh);
+
+   DH_free(dh);
+}
+#endif
+
 
 /**
  * @brief Create a new TLS domain structure
@@ -543,6 +628,12 @@ static int set_cipher_list(tls_domain_t* d)
 					tls_domain_str(d), cipher_list);
 			return -1;
 		}
+#ifndef OPENSSL_NO_ECDH
+                setup_ecdh(d->ctx[i]);
+#endif
+#ifndef OPENSSL_NO_DH
+                setup_dh(d->ctx[i]);
+#endif
 	}
 	return 0;
 }
diff --git a/modules/tls/tls_mod.c b/modules/tls/tls_mod.c
index b206bf6..97175e3 100644
--- a/modules/tls/tls_mod.c
+++ b/modules/tls/tls_mod.c
@@ -57,8 +57,6 @@
 	#error "conflict: CORE_TLS must _not_ be defined"
 #endif
 
-
-
 /*
  * FIXME:
  * - How do we ask for secret key password ? Mod_init is called after
@@ -344,6 +342,12 @@ static int mod_init(void)
 	if (tls_check_sockets(*tls_domains_cfg) < 0)
 		goto error;
 
+#ifndef OPENSSL_NO_ECDH
+	LM_INFO("With ECDH-Support!\n");
+#endif
+#ifndef OPENSSL_NO_DH
+	LM_INFO("With Diffie Hellman\n");
+#endif
 	return 0;
 error:
 	destroy_tls_h();
@@ -396,7 +400,12 @@ static int is_peer_verified(struct sip_msg* msg, char* foo, char* foo2)
 
 	c = tcpconn_get(msg->rcv.proto_reserved1, 0, 0, 0,
 					cfg_get(tls, tls_cfg, con_lifetime));
-	if (c && c->type != PROTO_TLS) {
+	if (!c) {
+		ERR("connection no longer exits\n");
+		return -1;
+	}
+
+	if(c->type != PROTO_TLS) {
 		ERR("Connection found but is not TLS\n");
 		tcpconn_put(c);
 		return -1;
diff --git a/modules/tm/h_table.c b/modules/tm/h_table.c
index 26ca3e3..3313fa0 100644
--- a/modules/tm/h_table.c
+++ b/modules/tm/h_table.c
@@ -210,6 +210,15 @@ void free_cell( struct cell* dead_cell )
 		if (unlikely(dead_cell->uac[i].path.s)) {
 			shm_free_unsafe(dead_cell->uac[i].path.s);
 		}
+		if (unlikely(dead_cell->uac[i].instance.s)) {
+			shm_free_unsafe(dead_cell->uac[i].instance.s);
+		}
+		if (unlikely(dead_cell->uac[i].ruid.s)) {
+			shm_free_unsafe(dead_cell->uac[i].ruid.s);
+		}
+		if (unlikely(dead_cell->uac[i].location_ua.s)) {
+			shm_free_unsafe(dead_cell->uac[i].location_ua.s);
+		}
 	}
 
 #ifdef WITH_AS_SUPPORT
@@ -249,20 +258,18 @@ void free_cell( struct cell* dead_cell )
 
 
 
-static inline void init_synonym_id( struct cell *t )
+static inline void init_synonym_id( struct sip_msg *p_msg, char *hash )
 {
-	struct sip_msg *p_msg;
 	int size;
 	char *c;
 	unsigned int myrand;
 
-	p_msg=t->uas.request;
 	if (p_msg) {
 		/* char value of a proxied transaction is
 		   calculated out of header-fields forming
 		   transaction key
 		*/
-		char_msg_val( p_msg, t->md5 );
+		char_msg_val( p_msg, hash );
 	} else {
 		/* char value for a UAC transaction is created
 		   randomly -- UAC is an originating stateful element
@@ -271,7 +278,7 @@ static inline void init_synonym_id( struct cell *t )
 		*/
 		/* HACK : not long enough */
 		myrand=rand();
-		c=t->md5;
+		c = hash;
 		size=MD5_LEN;
 		memset(c, '0', size );
 		int2reverse_hex( &c, &size, myrand );
@@ -378,7 +385,7 @@ struct cell*  build_cell( struct sip_msg* p_msg )
 	new_cell->relayed_reply_branch   = -1;
 	/* new_cell->T_canceled = T_UNDEFINED; */
 
-	init_synonym_id(new_cell);
+	init_synonym_id(p_msg, new_cell->md5);
 	init_cell_lock(  new_cell );
 	init_async_lock( new_cell );
 	t_stats_created();
diff --git a/modules/tm/h_table.h b/modules/tm/h_table.h
index 5790935..977f3fe 100644
--- a/modules/tm/h_table.h
+++ b/modules/tm/h_table.h
@@ -155,6 +155,7 @@ enum kill_reason { REQ_FWDED=1, REQ_RPLD=2, REQ_RLSD=4, REQ_EXIST=8,
 #define F_RB_NH_STRICT	0x200 /* next hop is a strict router */
 /* must detect when neither loose nor strict flag is set -> two flags.
  * alternatively, 1x flag for strict/loose and 1x for loose|strict set/not */
+#define F_RB_RELAYREPLY	0x400 /* branch under relay reply condition */
 
 
 /* if canceled or intended to be canceled, return true */
@@ -320,6 +321,7 @@ typedef struct async_state {
 #define T_ASYNC_CONTINUE (1<<12) /* Is this transaction in a continuation after being suspended */
 
 #define T_DISABLE_INTERNAL_REPLY (1<<13) /* don't send internal negative reply */
+#define T_ADMIN_REPLY (1<<14) /* t reply sent by admin (e.g., from cfg script) */
 
 /* unsigned short should be enough for a retr. timer: max. 65535 ms =>
  * max retr. = 65 s which should be enough and saves us 2*2 bytes */
diff --git a/modules/tm/t_cancel.c b/modules/tm/t_cancel.c
index 1b39648..c670041 100644
--- a/modules/tm/t_cancel.c
+++ b/modules/tm/t_cancel.c
@@ -245,7 +245,12 @@ int cancel_branch( struct cell *t, int branch,
 			/* remove BUSY_BUFFER -- mark cancel buffer as not used */
 			pcbuf=&crb->buffer; /* workaround for type punning warnings */
 			atomic_set_long(pcbuf, 0);
-			if (flags & F_CANCEL_B_FAKE_REPLY){
+			/* try to relay auto-generated 487 canceling response only when
+			 * another one is not under relaying on the branch and there is
+			 * no forced response per transaction from script */
+			if((flags & F_CANCEL_B_FAKE_REPLY)
+					&& !(irb->flags&F_RB_RELAYREPLY)
+					&& !(t->flags&T_ADMIN_REPLY)) {
 				LOCK_REPLIES(t);
 				if (relay_reply(t, FAKED_REPLY, branch, 487, &tmp_cd, 1) == 
 										RPS_ERROR){
diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
index 7fb66b8..8e435cb 100644
--- a/modules/tm/t_reply.c
+++ b/modules/tm/t_reply.c
@@ -2336,6 +2336,11 @@ int reply_received( struct sip_msg  *p_msg )
 	/* processing of on_reply block */
 	if (onreply_route) {
 		set_route_type(TM_ONREPLY_ROUTE);
+
+		/* lock onreply_route, for safe avp usage */
+		LOCK_REPLIES( t );
+		replies_locked=1;
+
 		/* transfer transaction flag to message context */
 		if (t->uas.request) p_msg->flags=t->uas.request->flags;
 		/* set the as avp_list the one from transaction */
@@ -2353,9 +2358,6 @@ int reply_received( struct sip_msg  *p_msg )
 		/* Pre- and post-script callbacks have already
 		 * been executed by the core. (Miklos)
 		 */
-		/* lock onreply_route, for safe avp usage */
-		LOCK_REPLIES( t );
-		replies_locked=1;
 		run_top_route(onreply_rt.rlist[onreply_route], p_msg, &ctx);
 		/* transfer current message context back to t */
 		if (t->uas.request) t->uas.request->flags=p_msg->flags;
@@ -2478,6 +2480,7 @@ int reply_received( struct sip_msg  *p_msg )
 	}
 	if ( is_local(t) ) {
 		reply_status=local_reply( t, p_msg, branch, msg_status, &cancel_data );
+		replies_locked=0;
 		if (reply_status == RPS_COMPLETED) {
 			     /* no more UAC FR/RETR (if I received a 2xx, there may
 			      * be still pending branches ...
@@ -2495,6 +2498,7 @@ int reply_received( struct sip_msg  *p_msg )
 	} else {
 		reply_status=relay_reply( t, p_msg, branch, msg_status,
 									&cancel_data, 1 );
+		replies_locked=0;
 		if (reply_status == RPS_COMPLETED) {
 			     /* no more UAC FR/RETR (if I received a 2xx, there may
 				be still pending branches ...
@@ -2532,7 +2536,8 @@ int reply_received( struct sip_msg  *p_msg )
 skip_send_reply:
 
 	if (likely(replies_locked)){
-		UNLOCK_REPLIES(t); /* unlock replies  - this would be unlocked by send function*/
+		/* unlock replies if still locked coming via goto skip_send_reply */
+		UNLOCK_REPLIES(t);
 		replies_locked=0;
 	}
 
diff --git a/modules/tm/t_serial.c b/modules/tm/t_serial.c
index 62200ad..8c9e131 100644
--- a/modules/tm/t_serial.c
+++ b/modules/tm/t_serial.c
@@ -155,7 +155,11 @@ void add_contacts_avp(str *uri, str *dst_uri, str *path, str *sock_str,
 
 	val.type = SR_XTYPE_XAVP;
 	val.v.xavp = record;
-	xavp_add_value(&contacts_avp, &val, NULL);
+	if(xavp_add_value(&contacts_avp, &val, NULL)==NULL) {
+		/* failed to add xavps to root list */
+		LM_ERR("failed to add xavps to root list\n");
+		xavp_destroy_list(&record);
+	}
 }
 
 /* 
@@ -193,10 +197,12 @@ int t_load_contacts(struct sip_msg* msg, char* key, char* value)
 		LM_ERR("no memory for contact info\n");
 		return -1;
 	}
+	memset(contacts, 0, sizeof(struct contact));
 
 	if (ruri_is_new) {
 		ruri = GET_RURI(msg);
 		if (!ruri) {
+			free_contact_list(contacts);
 			LM_ERR("no Request-URI found\n");
 			return -1;
 		}
@@ -303,6 +309,7 @@ int t_load_contacts(struct sip_msg* msg, char* key, char* value)
 			len = MAX_SOCKET_STR - 1;
 			if (socket2str(sock_buf, &len, curr->sock) < 0) {
 				LM_ERR("failed to convert socket to str\n");
+				free_contact_list(contacts);
 				return -1;
 			}
 			sock_buf[len] = 0;
@@ -383,7 +390,11 @@ void add_contact_flows_avp(str *uri, str *dst_uri, str *path, str *sock_str,
 
 	val.type = SR_XTYPE_XAVP;
 	val.v.xavp = record;
-	xavp_add_value(&contact_flows_avp, &val, NULL);
+	if(xavp_add_value(&contact_flows_avp, &val, NULL)==NULL) {
+		/* failed to add xavps to root list */
+		LM_ERR("failed to add xavps to root list\n");
+		xavp_destroy_list(&record);
+	}
 }
 
 /*
@@ -449,13 +460,13 @@ int t_next_contacts(struct sip_msg* msg, char* key, char* value)
 		if (parse_phostport(sock_str.s, &host.s, &host.len, &port, &proto)
 				!= 0) {
 			LM_ERR("parsing of socket info <%s> failed\n", sock_str.s);
-			xavp_destroy_list(&xavp_list);
+			xavp_rm(xavp_list, NULL);
 			return -1;
 		}
 		sock = grep_sock_info(&host, (unsigned short)port,
 				(unsigned short)proto);
 		if (sock == 0) {
-			xavp_destroy_list(&xavp_list);
+			xavp_rm(xavp_list, NULL);
 			return -1;
 		}
 	} else {
@@ -574,14 +585,14 @@ int t_next_contacts(struct sip_msg* msg, char* key, char* value)
 					!= 0) {
 				LM_ERR("parsing of socket info <%s> failed\n", sock_str.s);
 				free_instance_list(il);
-				xavp_destroy_list(&xavp_list);
+				xavp_rm(xavp_list, NULL);
 				return -1;
 			}
 			sock = grep_sock_info(&host, (unsigned short)port,
 					(unsigned short)proto);
 			if (sock == 0) {
 				free_instance_list(il);
-				xavp_destroy_list(&xavp_list);
+				xavp_rm(xavp_list, NULL);
 				return -1;
 			}
 		} else {
@@ -659,7 +670,7 @@ int t_next_contacts(struct sip_msg* msg, char* key, char* value)
 					&ruid, &location_ua) != 1) {
 			LM_ERR("appending branch failed\n");
 			free_instance_list(il);
-			xavp_destroy_list(&xavp_list);
+			xavp_rm(xavp_list, NULL);
 			return -1;
 		}
 
@@ -795,7 +806,7 @@ int t_next_contact_flow(struct sip_msg* msg, char* key, char* value)
 		if (append_branch(msg, &uri, &dst_uri, &path, 0, flags, sock, &instance, 0,
 					&ruid, &location_ua) != 1) {
 			LM_ERR("appending branch failed\n");
-			xavp_destroy_list(&xavp_list);
+			xavp_rm(xavp_list, NULL);
 			return -1;
 		}
 
diff --git a/modules/tm/timer.c b/modules/tm/timer.c
index aae9532..5e340a7 100644
--- a/modules/tm/timer.c
+++ b/modules/tm/timer.c
@@ -345,6 +345,7 @@ static void fake_reply(struct cell *t, int branch, int code )
 	do_cancel_branch = is_invite(t) && prepare_cancel_branch(t, branch, 0);
 	/* mark branch as canceled */
 	t->uac[branch].request.flags|=F_RB_CANCELED;
+	t->uac[branch].request.flags|=F_RB_RELAYREPLY;
 	if ( is_local(t) ) {
 		reply_status=local_reply( t, FAKED_REPLY, branch, 
 					  code, &cancel_data );
diff --git a/modules/tm/tm.c b/modules/tm/tm.c
index 3bdc7fb..25534fa 100644
--- a/modules/tm/tm.c
+++ b/modules/tm/tm.c
@@ -984,6 +984,8 @@ static int t_check_status(struct sip_msg* msg, char *p1, char *foo)
 		
 		if (regcomp(re, s, REG_EXTENDED|REG_ICASE|REG_NEWLINE)) {
 			ERR("Bad regular expression '%s'\n", s);
+			pkg_free(re);
+			re = NULL;
 			goto error;
 		}
 		break;
@@ -1319,6 +1321,7 @@ inline static int w_t_reply(struct sip_msg* msg, char* p1, char* p2)
 	 * the safe version would lead to a deadlock
 	 */
 	 
+	t->flags |= T_ADMIN_REPLY;
 	if (is_route_type(FAILURE_ROUTE)) {
 		DBG("DEBUG: t_reply_unsafe called from w_t_reply\n");
 		ret = t_reply_unsafe(t, msg, code, r);
diff --git a/modules/tmrec/period.h b/modules/tmrec/period.h
index 5c64be5..bede828 100644
--- a/modules/tmrec/period.h
+++ b/modules/tmrec/period.h
@@ -1,5 +1,5 @@
 #ifndef _PERIOD_H_
-#define _PERIOH_H_
+#define _PERIOD_H_
 
 int in_period(time_t t, const char *p);
 
diff --git a/modules/tmx/t_var.c b/modules/tmx/t_var.c
index a52927a..6b27ff5 100644
--- a/modules/tmx/t_var.c
+++ b/modules/tmx/t_var.c
@@ -384,7 +384,8 @@ int pv_get_tm_branch_idx(struct sip_msg *msg, pv_param_t *param,
 			idx = tcx->branch_index;
 	} else switch(route_type) {
 		case BRANCH_ROUTE:
-			/* branches have their index set */
+		case BRANCH_FAILURE_ROUTE:
+			/* branch and branch_failure routes have their index set */
 			tcx = _tmx_tmb.tm_ctx_get();
 			if(tcx != NULL)
 				idx = tcx->branch_index;
@@ -396,7 +397,7 @@ int pv_get_tm_branch_idx(struct sip_msg *msg, pv_param_t *param,
 		case FAILURE_ROUTE:
 			/* first get the transaction */
 			t = _tmx_tmb.t_gett();
-			if ( t == NULL && t == T_UNDEFINED ) {
+			if ( t == NULL || t == T_UNDEFINED ) {
 				return -1;
 			}
 			/* add the currently added branches to the number of
@@ -471,6 +472,7 @@ int pv_get_tm_reply_code(struct sip_msg *msg, pv_param_t *param,
 	} else {
 		switch (get_route_type()) {
 			case REQUEST_ROUTE:
+			case BRANCH_ROUTE:
 				/* use the status of the last sent reply */
 				code = t->uas.status;
 				break;
diff --git a/modules/tmx/tmx_mod.c b/modules/tmx/tmx_mod.c
index 89f5e65..d0e2ee2 100644
--- a/modules/tmx/tmx_mod.c
+++ b/modules/tmx/tmx_mod.c
@@ -91,10 +91,8 @@ unsigned long tmx_stats_trans_5xx(void);
 unsigned long tmx_stats_trans_6xx(void);
 unsigned long tmx_stats_trans_inuse(void);
 unsigned long tmx_stats_trans_active(void);
-#if 0
 unsigned long tmx_stats_rcv_rpls(void);
 unsigned long tmx_stats_rld_rpls(void);
-#endif
 unsigned long tmx_stats_loc_rpls(void);
 
 static stat_export_t mod_stats[] = {
@@ -107,10 +105,8 @@ static stat_export_t mod_stats[] = {
 	{"6xx_transactions" ,    STAT_IS_FUNC, (stat_var**)tmx_stats_trans_6xx   },
 	{"inuse_transactions" ,  STAT_IS_FUNC, (stat_var**)tmx_stats_trans_inuse },
 	{"active_transactions" , STAT_IS_FUNC, (stat_var**)tmx_stats_trans_active},
-#if 0
 	{"received_replies" ,    STAT_IS_FUNC, (stat_var**)tmx_stats_rcv_rpls    },
 	{"relayed_replies" ,     STAT_IS_FUNC, (stat_var**)tmx_stats_rld_rpls    },
-#endif
 	{"local_replies" ,       STAT_IS_FUNC, (stat_var**)tmx_stats_loc_rpls    },
 	{0,0,0}
 };
@@ -612,7 +608,7 @@ void tmx_stats_update(void)
 {
 	ticks_t t;
 	t = get_ticks();
-	if(t!=_tmx_stats_tm) {
+	if(t>_tmx_stats_tm+1) {
 		_tmx_tmb.get_stats(&_tmx_stats_all);
 		_tmx_stats_tm = t;
 	}
@@ -672,19 +668,26 @@ unsigned long tmx_stats_trans_active(void)
 	return (_tmx_stats_all.transactions - _tmx_stats_all.waiting);
 }
 
-#if 0
 unsigned long tmx_stats_rcv_rpls(void)
 {
 	tmx_stats_update();
-	return 0;
+	return _tmx_stats_all.completed_6xx
+		+ _tmx_stats_all.completed_5xx
+		+ _tmx_stats_all.completed_4xx
+		+ _tmx_stats_all.completed_3xx
+		+ _tmx_stats_all.completed_2xx;
 }
 
 unsigned long tmx_stats_rld_rpls(void)
 {
 	tmx_stats_update();
-	return 0;
+	return _tmx_stats_all.completed_6xx
+		+ _tmx_stats_all.completed_5xx
+		+ _tmx_stats_all.completed_4xx
+		+ _tmx_stats_all.completed_3xx
+		+ _tmx_stats_all.completed_2xx
+		- _tmx_stats_all.replied_locally;
 }
-#endif
 
 unsigned long tmx_stats_loc_rpls(void)
 {
diff --git a/modules/topoh/th_msg.c b/modules/topoh/th_msg.c
index 4d25750..d572f00 100644
--- a/modules/topoh/th_msg.c
+++ b/modules/topoh/th_msg.c
@@ -136,7 +136,7 @@ int th_get_uri_type(str *uri, int *mode, str *value)
 			return -1;
 		return 2; /* decode */
 	} else {
-		if(check_self(&puri.host, (puri.port_no)?puri.port_no:SIP_PORT, 0)==1)
+		if(check_self(&puri.host, (puri.port_no)?puri.port_no:0, 0)==1)
 		{
 			/* myself -- matched on all protos */
 			ret = th_get_param_value(&puri.params, &r2, value);
diff --git a/modules/uac/replace.c b/modules/uac/replace.c
index 7f1f92c..f8285c6 100644
--- a/modules/uac/replace.c
+++ b/modules/uac/replace.c
@@ -470,7 +470,6 @@ int replace_uri( struct sip_msg *msg, str *display, str *uri,
 		p += rr_param->len;
 		*(p++) = '=';
 		memcpy( p, replace.s, replace.len);
-		p += replace.len;
 
 		if (uac_rrb.add_rr_param( msg, &param)!=0)
 		{
@@ -588,7 +587,8 @@ int restore_uri( struct sip_msg *msg, str *rr_param, str* restore_avp, int check
 
 	/* get new uri */
 	if ( new_uri.len<old_uri.len ) {
-		LM_ERR("new URI shorter than old URI\n");
+		LM_ERR("new URI [%.*s] shorter than old URI [%.*s]\n",
+				new_uri.len, new_uri.s, old_uri.len, old_uri.s);
 		goto failed;
 	}
 	for( i=0 ; i<old_uri.len ; i++ ) {
diff --git a/modules/uac/uac.c b/modules/uac/uac.c
index 5142e03..7f5ddf3 100644
--- a/modules/uac/uac.c
+++ b/modules/uac/uac.c
@@ -432,8 +432,8 @@ int w_replace_from(struct sip_msg* msg, char* p1, char* p2)
 {
 	str uri_s;
 	str dsp_s;
-	str *uri;
-	str *dsp;
+	str *uri = NULL;
+	str *dsp = NULL;
 
 	if (p2==NULL) {
 		 p2 = p1;
@@ -499,8 +499,8 @@ static int w_replace_to(struct sip_msg* msg, char* p1, char* p2)
 {
 	str uri_s;
 	str dsp_s;
-	str *uri;
-	str *dsp;
+	str *uri = NULL;
+	str *dsp = NULL;
 
 	if (p2==NULL) {
 		p2 = p1;
@@ -527,6 +527,8 @@ static int w_replace_to(struct sip_msg* msg, char* p1, char* p2)
 		return -1;
 	}
 
+	LM_DBG("dsp=%p (len=%d) , uri=%p (len=%d)\n",dsp,dsp?dsp->len:0,uri,uri?uri->len:0);
+
 	return (replace_uri(msg, dsp, uri, msg->to, &rr_to_param, &restore_to_avp, 0)==0)?1:-1;
 
 }
diff --git a/modules/uac/uac_reg.c b/modules/uac/uac_reg.c
index 537ba82..8ab204f 100644
--- a/modules/uac/uac_reg.c
+++ b/modules/uac/uac_reg.c
@@ -236,6 +236,12 @@ int reg_ht_add_byuuid(reg_uac_t *reg)
 	unsigned int slot;
 	reg_item_t *ri = NULL;
 
+	if(_reg_htable==NULL)
+	{
+		LM_ERR("reg hash table not initialized\n");
+		return -1;
+	}
+
 	ri = (reg_item_t*)shm_malloc(sizeof(reg_item_t));
 	if(ri==NULL)
 	{
@@ -259,6 +265,12 @@ int reg_ht_add_byuser(reg_uac_t *reg)
 	unsigned int slot;
 	reg_item_t *ri = NULL;
 
+	if(_reg_htable==NULL)
+	{
+		LM_ERR("reg hash table not initialized\n");
+		return -1;
+	}
+
 	ri = (reg_item_t*)shm_malloc(sizeof(reg_item_t));
 	if(ri==NULL)
 	{
@@ -346,6 +358,12 @@ reg_uac_t *reg_ht_get_byuuid(str *uuid)
 	unsigned int slot;
 	reg_item_t *it = NULL;
 
+	if(_reg_htable==NULL)
+	{
+		LM_ERR("reg hash table not initialized\n");
+		return NULL;
+	}
+
 	hash = reg_compute_hash(uuid);
 	slot = reg_get_entry(hash, _reg_htable->htsize);
 	it = _reg_htable->entries[slot].byuuid;
@@ -370,6 +388,12 @@ reg_uac_t *reg_ht_get_byuser(str *user, str *domain)
 	unsigned int slot;
 	reg_item_t *it = NULL;
 
+	if(_reg_htable==NULL)
+	{
+		LM_ERR("reg hash table not initialized\n");
+		return NULL;
+	}
+
 	hash = reg_compute_hash(user);
 	slot = reg_get_entry(hash, _reg_htable->htsize);
 	it = _reg_htable->entries[slot].byuser;
@@ -740,6 +764,9 @@ void uac_reg_timer(unsigned int ticks)
 	reg_item_t *it = NULL;
 	time_t tn;
 
+	if(_reg_htable==NULL)
+		return;
+
 	tn = time(NULL);
 	for(i=0; i<_reg_htable->htsize; i++)
 	{
diff --git a/modules/usrloc/ucontact.c b/modules/usrloc/ucontact.c
index b18ce98..e295891 100644
--- a/modules/usrloc/ucontact.c
+++ b/modules/usrloc/ucontact.c
@@ -270,12 +270,14 @@ int mem_update_ucontact(ucontact_t* _c, ucontact_info_t* _ci)
 
 	if(_ci->instance.s!=NULL && _ci->instance.len>0)
 	{
-		/* when we have instance set, update contact address and call-id */
+		/* when we have instance set, update contact address */
 		if(_ci->c!=NULL && _ci->c->s!=NULL && _ci->c->len>0)
 			update_str( &_c->c, _ci->c);
-		if(_ci->callid!=NULL && _ci->callid->s!=NULL && _ci->callid->len>0)
-			update_str( &_c->callid, _ci->callid);
 	}
+
+	/* refresh call-id */
+	if(_ci->callid!=NULL && _ci->callid->s!=NULL && _ci->callid->len>0)
+		update_str( &_c->callid, _ci->callid);
 	update_str( &_c->user_agent, _ci->user_agent);
 
 	if (_ci->received.s && _ci->received.len) {
diff --git a/modules/usrloc/ul_mi.c b/modules/usrloc/ul_mi.c
index 3e12bf1..695fd38 100644
--- a/modules/usrloc/ul_mi.c
+++ b/modules/usrloc/ul_mi.c
@@ -48,9 +48,9 @@
 #include "usrloc.h"
 
 /*! CSEQ nr used */
-#define MI_UL_CSEQ 1
+static int MI_UL_CSEQ = 0;
 /*! call-id used for ul_add and ul_rm_contact */
-static str mi_ul_cid = str_init("dfjrewr12386fd6-343 at kamailio.mi");
+static str mi_ul_cid = {0,0}; /* str_init("dfjrewr12386fd6-343 at kamailio.mi");*/
 /*! user agent used for ul_add */
 static str mi_ul_ua  = str_init("SIP Router MI Server");
 /*! path used for ul_add and ul_rm_contact */
@@ -58,8 +58,27 @@ static str mi_ul_path = str_init("dummypath");
 
 extern sruid_t _ul_sruid;
 
+static char mi_ul_cid_buf[32];
+
 /************************ helper functions ****************************/
 
+static void set_mi_ul_cid(void)
+{
+	int i;
+    char charset[] = "0123456789"
+                     "abcdefghijklmnopqrstuvwxyz"
+                     "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+	if(mi_ul_cid.s!=NULL) return;
+
+	for(i=0; i<19; i++) {
+        mi_ul_cid_buf[i] = charset[rand()%(sizeof(charset) - 1)];
+    }
+    memcpy(mi_ul_cid_buf+i, "@kamailio.mi", sizeof("@kamailio.mi"));
+    mi_ul_cid.s = mi_ul_cid_buf;
+	mi_ul_cid.len = strlen(mi_ul_cid.s);
+}
+
 /*!
  * \brief Search a domain in the global domain list
  * \param table domain (table) name
@@ -360,6 +379,7 @@ struct mi_root* mi_usrloc_rm_contact(struct mi_root *cmd, void *param)
 	}
 
 	contact = &node->next->next->value;
+	set_mi_ul_cid();
 	ret = get_ucontact( rec, contact, &mi_ul_cid, &mi_ul_path, MI_UL_CSEQ+1, &con);
 	if (ret < 0) {
 		unlock_udomain( dom, aor);
@@ -566,6 +586,7 @@ struct mi_root* mi_usrloc_add(struct mi_root *cmd, void *param)
 
 	lock_udomain( dom, aor);
 
+	set_mi_ul_cid();
 	n = get_urecord( dom, aor, &r);
 	if ( n==1) {
 		if (insert_urecord( dom, aor, &r) < 0)
@@ -580,7 +601,7 @@ struct mi_root* mi_usrloc_add(struct mi_root *cmd, void *param)
 
 	ci.callid = &mi_ul_cid;
 	ci.user_agent = &mi_ul_ua;
-	ci.cseq = MI_UL_CSEQ;
+	ci.cseq = ++MI_UL_CSEQ;
 	/* 0 expires means permanent contact */
 	if (ci.expires!=0)
 		ci.expires += act_time;
diff --git a/modules/usrloc/ul_rpc.c b/modules/usrloc/ul_rpc.c
index 077b035..50e5343 100644
--- a/modules/usrloc/ul_rpc.c
+++ b/modules/usrloc/ul_rpc.c
@@ -544,7 +544,7 @@ static void ul_rpc_add(rpc_t* rpc, void* ctx)
 
 	ret = rpc->scan(ctx, "SSSdfSddd", &table, &aor, &contact, &ci.expires,
 		&dtemp, &path, &ci.flags, &ci.cflags, &ci.methods);
-	if(path.len==1 && (strncmp(temp.s, "0", 1)==0))	{
+	if(path.len==1 && (strncmp(path.s, "0", 1)==0))	{
 		LM_DBG("path == 0 -> unset\n");
 	}
 	else {
diff --git a/modules/websocket/ws_conn.c b/modules/websocket/ws_conn.c
index 9f2b672..62a1b61 100644
--- a/modules/websocket/ws_conn.c
+++ b/modules/websocket/ws_conn.c
@@ -47,6 +47,9 @@ gen_lock_t *wsconn_lock = NULL;
 #define WSCONN_LOCK	lock_get(wsconn_lock)
 #define WSCONN_UNLOCK	lock_release(wsconn_lock)
 
+#define wsconn_ref(c)   atomic_inc(&((c)->refcnt))
+#define wsconn_unref(c) atomic_dec_and_test(&((c)->refcnt))
+
 gen_lock_t *wsstat_lock = NULL;
 
 ws_connection_used_list_t *wsconn_used_list = NULL;
@@ -197,6 +200,8 @@ int wsconn_add(struct receive_info rcv, unsigned int sub_protocol)
 	int id_hash = tcp_id_hash(id);
 	ws_connection_t *wsc;
 
+	LM_DBG("wsconn_add id [%d]\n", id);
+
 	/* Allocate and fill in new WebSocket connection */
 	wsc = shm_malloc(sizeof(ws_connection_t));
 	if (wsc == NULL)
@@ -210,6 +215,10 @@ int wsconn_add(struct receive_info rcv, unsigned int sub_protocol)
 	wsc->state = WS_S_OPEN;
 	wsc->rcv = rcv;
 	wsc->sub_protocol = sub_protocol;
+	wsc->run_event = 0;
+	atomic_set(&wsc->refcnt, 0);
+
+	LM_DBG("wsconn_add new wsc => [%p], ref => [%d]\n", wsc, atomic_get(&wsc->refcnt));
 
 	WSCONN_LOCK;
 	/* Add to WebSocket connection table */
@@ -225,8 +234,12 @@ int wsconn_add(struct receive_info rcv, unsigned int sub_protocol)
 		wsconn_used_list->tail->used_next = wsc;
 		wsconn_used_list->tail = wsc;
 	}
+	wsconn_ref(wsc);
+
 	WSCONN_UNLOCK;
 
+	LM_DBG("wsconn_add added to conn_table wsc => [%p], ref => [%d]\n", wsc, atomic_get(&wsc->refcnt));
+
 	/* Update connection statistics */
 	lock_get(wsstat_lock);
 
@@ -290,32 +303,29 @@ static void wsconn_run_route(ws_connection_t *wsc)
 	set_route_type(backup_rt);
 }
 
-int wsconn_rm(ws_connection_t *wsc, ws_conn_eventroute_t run_event_route)
+static void wsconn_dtor(ws_connection_t *wsc)
 {
 	if (!wsc)
-	{
-		LM_ERR("wsconn_rm: null pointer\n");
-		return -1;
-	}
+		return;
 
-	if (run_event_route == WSCONN_EVENTROUTE_YES)
+	LM_DBG("wsconn_dtor for [%p] refcnt [%d]\n", wsc, atomic_get(&wsc->refcnt));
+
+	if (wsc->run_event)
 		wsconn_run_route(wsc);
 
-	WSCONN_LOCK;
-	/* Remove from the WebSocket used list */
-	if (wsconn_used_list->head == wsc)
-		wsconn_used_list->head = wsc->used_next;
-	if (wsconn_used_list->tail == wsc)
-		wsconn_used_list->tail = wsc->used_prev;
-	if (wsc->used_prev)
-		wsc->used_prev->used_next = wsc->used_next;
-	if (wsc->used_next)
-		wsc->used_next->used_prev = wsc->used_prev;
+	shm_free(wsc);
 
-	_wsconn_rm(wsc);
-	WSCONN_UNLOCK;
+	LM_DBG("wsconn_dtor for [%p] destroyed\n", wsc);
+}
 
-	return 0;
+int wsconn_rm(ws_connection_t *wsc, ws_conn_eventroute_t run_event_route)
+{
+	LM_DBG("wsconn_rm for [%p] refcnt [%d]\n", wsc, atomic_get(&wsc->refcnt));
+
+	if (run_event_route == WSCONN_EVENTROUTE_YES)
+		wsc->run_event = 1;
+
+	return wsconn_put(wsc);
 }
 
 int wsconn_update(ws_connection_t *wsc)
@@ -366,17 +376,70 @@ void wsconn_close_now(ws_connection_t *wsc)
 	con->timeout = get_ticks_raw();
 }
 
+/* must be called with unlocked WSCONN_LOCK */
+int wsconn_put(ws_connection_t *wsc)
+{
+	int destroy = 0;
+
+	LM_DBG("wsconn_put start for [%p] refcnt [%d]\n", wsc, atomic_get(&wsc->refcnt));
+
+	if (!wsc)
+		return -1;
+
+	WSCONN_LOCK;
+	/* refcnt == 0*/
+	if (wsconn_unref(wsc))
+	{
+		/* Remove from the WebSocket used list */
+		if (wsconn_used_list->head == wsc)
+			wsconn_used_list->head = wsc->used_next;
+		if (wsconn_used_list->tail == wsc)
+			wsconn_used_list->tail = wsc->used_prev;
+		if (wsc->used_prev)
+			wsc->used_prev->used_next = wsc->used_next;
+		if (wsc->used_next)
+			wsc->used_next->used_prev = wsc->used_prev;
+
+		/* remove from wsconn_id_hash */
+		wsconn_listrm(wsconn_id_hash[wsc->id_hash], wsc, id_next, id_prev);
+
+		/* stat */
+		update_stat(ws_current_connections, -1);
+		if (wsc->sub_protocol == SUB_PROTOCOL_SIP)
+			update_stat(ws_sip_current_connections, -1);
+		else if (wsc->sub_protocol == SUB_PROTOCOL_MSRP)
+			update_stat(ws_msrp_current_connections, -1);
+
+		destroy = 1;
+	}
+	WSCONN_UNLOCK;
+
+	LM_DBG("wsconn_put end for [%p] refcnt [%d]\n", wsc, atomic_get(&wsc->refcnt));
+
+	/* wsc is removed from all lists and can be destroyed safely */
+	if (destroy)
+		wsconn_dtor(wsc);
+
+	return 0;
+}
+
 ws_connection_t *wsconn_get(int id)
 {
 	int id_hash = tcp_id_hash(id);
 	ws_connection_t *wsc;
 
+	LM_DBG("wsconn_get for id [%d]\n", id);
+
 	WSCONN_LOCK;
 	for (wsc = wsconn_id_hash[id_hash]; wsc; wsc = wsc->id_next)
 	{
 		if (wsc->id == id)
 		{
+			wsconn_ref(wsc);
+			LM_DBG("wsconn_get returns wsc [%p] refcnt [%d]\n", wsc, atomic_get(&wsc->refcnt));
+
 			WSCONN_UNLOCK;
+
 			return wsc;
 		}
 	}
@@ -385,6 +448,85 @@ ws_connection_t *wsconn_get(int id)
 	return NULL;
 }
 
+ws_connection_t **wsconn_get_list(void)
+{
+	ws_connection_t **list = NULL;
+	ws_connection_t *wsc   = NULL;
+	size_t list_size = 0;
+	size_t list_len  = 0;
+	size_t i = 0;
+
+	LM_DBG("wsconn_get_list\n");
+
+	WSCONN_LOCK;
+
+	/* get the number of used connections */
+	wsc = wsconn_used_list->head;
+	while (wsc)
+	{
+		LM_DBG("counter wsc [%p] prev => [%p] next => [%p]\n", wsc, wsc->used_prev, wsc->used_next);
+		list_len++;
+		wsc = wsc->used_next;
+	}
+
+	if (!list_len)
+		goto end;
+
+	/* allocate a NULL terminated list of wsconn pointers */
+	list_size = (list_len + 1) * sizeof(ws_connection_t *);
+	list = pkg_malloc(list_size);
+	if (!list)
+		goto end;
+
+	memset(list, 0, list_size);
+
+	/* copy */
+	wsc = wsconn_used_list->head;
+	for(i = 0; i < list_len; i++)
+	{
+		if (!wsc) {
+			LM_ERR("Wrong list length\n");
+		}
+
+		list[i] = wsc;
+		wsconn_ref(wsc);
+		LM_DBG("wsc [%p] id [%d] ref++\n", wsc, wsc->id);
+
+		wsc = wsc->used_next;
+	}
+	list[list_len] = NULL; /* explicit NULL termination */
+
+end:
+	WSCONN_UNLOCK;
+
+	LM_DBG("wsconn_get_list returns list [%p] with [%d] members\n", list, (int)list_len);
+
+	return list;
+}
+
+int wsconn_put_list(ws_connection_t **list_head)
+{
+	ws_connection_t **list = NULL;
+	ws_connection_t *wsc   = NULL;
+
+	LM_DBG("wsconn_put_list [%p]\n", list_head);
+
+	if (!list_head)
+		return -1;
+
+	list =  list_head;
+	wsc  = *list_head;
+	while (wsc)
+	{
+		wsconn_put(wsc);
+		wsc = *(++list);
+	}
+
+	pkg_free(list_head);
+
+	return 0;
+}
+
 static int add_node(struct mi_root *tree, ws_connection_t *wsc)
 {
 	int interval;
diff --git a/modules/websocket/ws_conn.h b/modules/websocket/ws_conn.h
index 0c7d639..27ba5ee 100644
--- a/modules/websocket/ws_conn.h
+++ b/modules/websocket/ws_conn.h
@@ -29,6 +29,8 @@
 #ifndef _WS_CONN_H
 #define _WS_CONN_H
 
+#include "../../atomic_ops.h"
+
 #include "../../lib/kcore/kstats_wrapper.h"
 #include "../../lib/kmi/tree.h"
 
@@ -57,6 +59,9 @@ typedef struct ws_connection
 	struct receive_info rcv;
 
 	unsigned int sub_protocol;
+
+	atomic_t refcnt;
+	int      run_event;
 } ws_connection_t;
 
 typedef struct
@@ -89,6 +94,9 @@ int wsconn_rm(ws_connection_t *wsc, ws_conn_eventroute_t run_event_route);
 int wsconn_update(ws_connection_t *wsc);
 void wsconn_close_now(ws_connection_t *wsc);
 ws_connection_t *wsconn_get(int id);
+int wsconn_put(ws_connection_t *wsc);
+ws_connection_t **wsconn_get_list(void);
+int wsconn_put_list(ws_connection_t **list);
 struct mi_root *ws_mi_dump(struct mi_root *cmd, void *param);
 
 #endif /* _WS_CONN_H */
diff --git a/modules/websocket/ws_frame.c b/modules/websocket/ws_frame.c
index ba0713b..7dc2669 100644
--- a/modules/websocket/ws_frame.c
+++ b/modules/websocket/ws_frame.c
@@ -240,7 +240,6 @@ static int encode_and_send_ws_frame(ws_frame_t *frame, conn_close_t conn_close)
 		pkg_free(send_buf);
 		if (wsconn_rm(frame->wsc, WSCONN_EVENTROUTE_YES) < 0)
 			LM_ERR("removing WebSocket connection\n");
-		frame->wsc = NULL;
 		return -1;
 	}
 	init_dst_from_rcv(&dst, &con->rcv);
@@ -252,10 +251,8 @@ static int encode_and_send_ws_frame(ws_frame_t *frame, conn_close_t conn_close)
 			LM_ERR("removing WebSocket connection\n");
 			tcpconn_put(con);
 			pkg_free(send_buf);
-			frame->wsc = NULL;
 			return -1;
 		}
-		frame->wsc = NULL;
 	}
 
 	if (dst.proto == PROTO_WS)
@@ -308,7 +305,6 @@ static int encode_and_send_ws_frame(ws_frame_t *frame, conn_close_t conn_close)
 			update_stat(ws_msrp_failed_connections, 1);
 		if (wsconn_rm(frame->wsc, WSCONN_EVENTROUTE_YES) < 0)
 			LM_ERR("removing WebSocket connection\n");
-		frame->wsc = NULL;
 		tcpconn_put(con);
 		return -1;
 	}
@@ -394,20 +390,19 @@ static int close_connection(ws_connection_t **p_wsc, ws_close_type_t type,
 			else if (sub_proto == SUB_PROTOCOL_MSRP)
 				update_stat(ws_msrp_remote_closed_connections,
 						1);
-			*p_wsc = NULL;
 		}
 	}
 	else /* if (frame->wsc->state == WS_S_CLOSING) */
 	{
 		wsconn_close_now(wsc);
-		*p_wsc = NULL;
 	}
 
 	return 0;
 }
 
 static int decode_and_validate_ws_frame(ws_frame_t *frame,
-					tcp_event_info_t *tcpinfo)
+                                        tcp_event_info_t *tcpinfo,
+                                        short *err_code, str *err_text)
 {
 	unsigned int i, len = tcpinfo->len;
 	int mask_start, j;
@@ -415,21 +410,14 @@ static int decode_and_validate_ws_frame(ws_frame_t *frame,
 
 	LM_DBG("decoding WebSocket frame\n");
 
-	if ((frame->wsc = wsconn_get(tcpinfo->con->id)) == NULL)
-	{
-		LM_ERR("WebSocket connection not found\n");
-		return -1;
-	}
-
 	wsconn_update(frame->wsc);
 
 	/* Decode and validate first 9 bits */
 	if (len < 2)
 	{
 		LM_WARN("message is too short\n");
-		if (close_connection(&frame->wsc, LOCAL_CLOSE, 1002,
-					str_status_protocol_error) < 0)
-			LM_ERR("closing connection\n");
+		*err_code = 1002;
+		*err_text = str_status_protocol_error;
 		return -1;
 	}
 	frame->fin = (buf[0] & 0xff) & BYTE0_MASK_FIN;
@@ -443,18 +431,16 @@ static int decode_and_validate_ws_frame(ws_frame_t *frame,
 	{
 		LM_WARN("WebSocket fragmentation not supported in the sip "
 			"sub-protocol\n");
-		if (close_connection(&frame->wsc, LOCAL_CLOSE, 1002,
-					str_status_protocol_error) < 0)
-			LM_ERR("closing connection\n");
+		*err_code = 1002;
+		*err_text = str_status_protocol_error;
 		return -1;
 	}
 
 	if (frame->rsv1 || frame->rsv2 || frame->rsv3)
 	{
 		LM_WARN("WebSocket reserved fields with non-zero values\n");
-		if (close_connection(&frame->wsc, LOCAL_CLOSE, 1002,
-					str_status_protocol_error) < 0)
-			LM_ERR("closing connection\n");
+		*err_code = 1002;
+		*err_text = str_status_protocol_error;
 		return -1;
 	}
 
@@ -476,9 +462,8 @@ static int decode_and_validate_ws_frame(ws_frame_t *frame,
 	default:
 		LM_WARN("unsupported opcode: 0x%x\n",
 			(unsigned char) frame->opcode);
-		if (close_connection(&frame->wsc, LOCAL_CLOSE, 1008,
-					str_status_unsupported_opcode) < 0)
-			LM_ERR("closing connection\n");
+		*err_code = 1008;
+		*err_text = str_status_unsupported_opcode;
 		return -1;
 	}
 
@@ -486,9 +471,8 @@ static int decode_and_validate_ws_frame(ws_frame_t *frame,
 	{
 		LM_WARN("this is a server - all received messages must be "
 			"masked\n");
-		if (close_connection(&frame->wsc, LOCAL_CLOSE, 1002,
-					str_status_protocol_error) < 0)
-			LM_ERR("closing connection\n");
+		*err_code = 1002;
+		*err_text = str_status_protocol_error;
 		return -1;
 	}
 
@@ -499,9 +483,8 @@ static int decode_and_validate_ws_frame(ws_frame_t *frame,
 		if (len < 4)
 		{
 			LM_WARN("message is too short\n");
-			if (close_connection(&frame->wsc, LOCAL_CLOSE, 1002,
-						str_status_protocol_error) < 0)
-				LM_ERR("closing connection\n");
+			*err_code = 1002;
+			*err_text = str_status_protocol_error;
 			return -1;
 		}
 		mask_start = 4;
@@ -514,9 +497,8 @@ static int decode_and_validate_ws_frame(ws_frame_t *frame,
 		if (len < 10)
 		{
 			LM_WARN("message is too short\n");
-			if (close_connection(&frame->wsc, LOCAL_CLOSE, 1002,
-						str_status_protocol_error) < 0)
-				LM_ERR("closing connection\n");
+			*err_code = 1002;
+			*err_text = str_status_protocol_error;
 			return -1;
 		}
 		mask_start = 10;
@@ -525,9 +507,8 @@ static int decode_and_validate_ws_frame(ws_frame_t *frame,
 			|| (buf[4] & 0xff) != 0 || (buf[5] & 0xff) != 0)
 		{
 			LM_WARN("message is too long\n");
-			if (close_connection(&frame->wsc, LOCAL_CLOSE, 1009,
-						str_status_message_too_big) < 0)
-				LM_ERR("closing connection\n");
+			*err_code = 1009;
+			*err_text = str_status_message_too_big;
 			return -1;
 		}
 
@@ -553,9 +534,8 @@ static int decode_and_validate_ws_frame(ws_frame_t *frame,
 	{
 		LM_WARN("message not complete frame size %u but received %u\n",
 			frame->payload_len + mask_start + 4, len);
-		if (close_connection(&frame->wsc, LOCAL_CLOSE, 1002,
-					str_status_protocol_error) < 0)
-			LM_ERR("closing connection\n");
+		*err_code = 1002;
+		*err_text = str_status_protocol_error;
 		return -1;
 	}
 	frame->payload_data = &buf[mask_start + 4];
@@ -632,6 +612,11 @@ int ws_frame_receive(void *data)
 	ws_frame_t frame;
 	tcp_event_info_t *tcpinfo = (tcp_event_info_t *) data;
 
+	int opcode      = -1;
+	int ret         = 0;
+	short err_code  = 0;
+	str   err_text  = {NULL, 0};
+
 	update_stat(ws_received_frames, 1);
 
 	if (tcpinfo == NULL || tcpinfo->buf == NULL || tcpinfo->len <= 0)
@@ -640,7 +625,26 @@ int ws_frame_receive(void *data)
 		return -1;
 	}
 
-	switch(decode_and_validate_ws_frame(&frame, tcpinfo))
+	/* wsc refcnt++ */
+	frame.wsc = wsconn_get(tcpinfo->con->id);
+	if (frame.wsc == NULL)
+	{
+		LM_ERR("WebSocket connection not found\n");
+		return -1;
+	}
+
+	opcode = decode_and_validate_ws_frame(&frame, tcpinfo, &err_code, &err_text);
+	if (opcode < 0)
+	{
+		if (close_connection(&frame.wsc, LOCAL_CLOSE, err_code, err_text) < 0)
+			LM_ERR("closing connection\n");
+
+		wsconn_put(frame.wsc);
+
+		return -1;
+	}
+
+	switch(opcode)
 	{
 	case OPCODE_TEXT_FRAME:
 	case OPCODE_BINARY_FRAME:
@@ -649,6 +653,9 @@ int ws_frame_receive(void *data)
 			LM_DBG("Rx SIP message:\n%.*s\n", frame.payload_len,
 				frame.payload_data);
 			update_stat(ws_sip_received_frames, 1);
+
+			wsconn_put(frame.wsc);
+
 			return receive_msg(frame.payload_data,
 						frame.payload_len,
 						tcpinfo->rcv);
@@ -667,30 +674,46 @@ int ws_frame_receive(void *data)
 				tev.len = frame.payload_len;
 				tev.rcv = tcpinfo->rcv;
 				tev.con = tcpinfo->con;
+
+				wsconn_put(frame.wsc);
+
 				return sr_event_exec(SREV_TCP_MSRP_FRAME,
 							(void *) &tev);
 			}
 			else
 			{
-				LM_ERR("no callback registerd for MSRP\n");
+				LM_ERR("no callback registered for MSRP\n");
+
+				wsconn_put(frame.wsc);
+
 				return -1;
 			}
 		}
 
 	case OPCODE_CLOSE:
-		return handle_close(&frame);
+		ret = handle_close(&frame);
+		if (frame.wsc) wsconn_put(frame.wsc);
+		return ret;
 
 	case OPCODE_PING:
-		return handle_ping(&frame);
+		ret = handle_ping(&frame);
+		if (frame.wsc) wsconn_put(frame.wsc);
+		return ret;
 
 	case OPCODE_PONG:
-		return handle_pong(&frame);
+		ret = handle_pong(&frame);
+		if (frame.wsc) wsconn_put(frame.wsc);
+		return ret;
 
 	default:
 		LM_WARN("received bad frame\n");
+		wsconn_put(frame.wsc);
 		return -1;
 	}
 
+	/* how can we get here ? */
+	wsconn_put(frame.wsc);
+
 	return 0;
 }
 
@@ -715,9 +738,14 @@ int ws_frame_transmit(void *data)
 	if (encode_and_send_ws_frame(&frame, CONN_CLOSE_DONT) < 0)
 	{	
 		LM_ERR("sending message\n");
+
+		wsconn_put(frame.wsc);
+
 		return -1;
 	}
 
+	wsconn_put(frame.wsc);
+
 	return 0;
 }
 
@@ -783,8 +811,11 @@ struct mi_root *ws_mi_close(struct mi_root *cmd, void *param)
 					str_status_bad_param.len);
 	}
 
-	if (close_connection(&wsc, LOCAL_CLOSE, 1000,
-				str_status_normal_closure) < 0)
+	int ret = close_connection(&wsc, LOCAL_CLOSE, 1000, str_status_normal_closure);
+
+	wsconn_put(wsc);
+
+	if (ret < 0)
 	{
 		LM_WARN("closing connection\n");
 		return init_mi_tree(500, str_status_error_closing.s,
@@ -834,7 +865,11 @@ static struct mi_root *mi_ping_pong(struct mi_root *cmd, void *param,
 					str_status_bad_param.len);
 	}
 
-	if (ping_pong(wsc, opcode) < 0)
+	int ret = ping_pong(wsc, opcode);
+
+	wsconn_put(wsc);
+
+	if (ret < 0)
 	{
 		LM_WARN("sending %s\n", OPCODE_PING ? "Ping" : "Pong");
 		return init_mi_tree(500, str_status_error_sending.s,
@@ -858,36 +893,55 @@ void ws_keepalive(unsigned int ticks, void *param)
 {
 	int check_time = (int) time(NULL)
 		- cfg_get(websocket, ws_cfg, keepalive_timeout);
-	ws_connection_t *wsc = wsconn_used_list->head;
 
+	ws_connection_t **list      = NULL,
+	                **list_head = NULL;
+	ws_connection_t *wsc   = NULL;
+
+	/* get an array of pointer to all ws connection */
+	list_head = wsconn_get_list();
+	if (!list_head)
+		return;
+
+	list =  list_head;
+	wsc  = *list_head;
 	while (wsc && wsc->last_used < check_time)
 	{
-		if (wsc->state == WS_S_CLOSING
-			|| wsc->awaiting_pong)
+		if (wsc->state == WS_S_CLOSING || wsc->awaiting_pong)
 		{
 			LM_WARN("forcibly closing connection\n");
 			wsconn_close_now(wsc);
 		}
 		else
-			ping_pong(wsconn_used_list->head,
-			  ws_keepalive_mechanism == KEEPALIVE_MECHANISM_PING
-					? OPCODE_PING : OPCODE_PONG);
-		wsc = wsconn_used_list->head;
+		{
+			int opcode = (ws_keepalive_mechanism == KEEPALIVE_MECHANISM_PING)
+			             ? OPCODE_PING
+			             : OPCODE_PONG;
+			ping_pong(wsc, opcode);
+		}
+
+		wsc = *(++list);
 	}
-	
+
+	wsconn_put_list(list_head);
 }
 
 int ws_close(sip_msg_t *msg)
 {
 	ws_connection_t *wsc;
+	int ret;
 
 	if ((wsc = wsconn_get(msg->rcv.proto_reserved1)) == NULL) {
 		LM_ERR("failed to retrieve WebSocket connection\n");
 		return -1;
 	}
 
-	return (close_connection(&wsc, LOCAL_CLOSE, 1000,
+	ret = (close_connection(&wsc, LOCAL_CLOSE, 1000,
 				 str_status_normal_closure) == 0) ? 1: 0;
+
+	wsconn_put(wsc);
+
+	return ret;
 }
 
 int ws_close2(sip_msg_t *msg, char *_status, char *_reason)
@@ -895,6 +949,7 @@ int ws_close2(sip_msg_t *msg, char *_status, char *_reason)
 	int status;
 	str reason;
 	ws_connection_t *wsc;
+	int ret;
 
 	if (get_int_fparam(&status, msg, (fparam_t *) _status) < 0) {
 		LM_ERR("failed to get status code\n");
@@ -911,7 +966,11 @@ int ws_close2(sip_msg_t *msg, char *_status, char *_reason)
 		return -1;
 	}
 
-	return (close_connection(&wsc, LOCAL_CLOSE, status, reason) == 0) ? 1: 0;
+	ret = (close_connection(&wsc, LOCAL_CLOSE, status, reason) == 0) ? 1: 0;
+
+	wsconn_put(wsc);
+
+	return ret;
 }
 
 int ws_close3(sip_msg_t *msg, char *_status, char *_reason, char *_con)
@@ -920,6 +979,7 @@ int ws_close3(sip_msg_t *msg, char *_status, char *_reason, char *_con)
 	str reason;
 	int con;
 	ws_connection_t *wsc;
+	int ret;
 
 	if (get_int_fparam(&status, msg, (fparam_t *) _status) < 0) {
 		LM_ERR("failed to get status code\n");
@@ -941,5 +1001,9 @@ int ws_close3(sip_msg_t *msg, char *_status, char *_reason, char *_con)
 		return -1;
 	}
 
-	return (close_connection(&wsc, LOCAL_CLOSE, status, reason) == 0) ? 1: 0;
+	ret = (close_connection(&wsc, LOCAL_CLOSE, status, reason) == 0) ? 1: 0;
+
+	wsconn_put(wsc);
+
+	return ret;
 }
diff --git a/modules/websocket/ws_handshake.c b/modules/websocket/ws_handshake.c
index 05332e4..e89fda1 100644
--- a/modules/websocket/ws_handshake.c
+++ b/modules/websocket/ws_handshake.c
@@ -427,8 +427,10 @@ int ws_handle_handshake(struct sip_msg *msg)
 				&headers) < 0)
 	{
 		if ((wsc = wsconn_get(msg->rcv.proto_reserved1)) != NULL)
+		{
 			wsconn_rm(wsc, WSCONN_EVENTROUTE_NO);
-
+			wsconn_put(wsc);
+		}
 		goto end;
 	}
 	else
diff --git a/modules/xhttp/xhttp_mod.c b/modules/xhttp/xhttp_mod.c
index 9848892..eea8bda 100644
--- a/modules/xhttp/xhttp_mod.c
+++ b/modules/xhttp/xhttp_mod.c
@@ -385,7 +385,7 @@ static int xhttp_send_reply(sip_msg_t *msg, int code, str *reason,
 		tbuf.len=sizeof("Content-Type: ") - 1 + ctype->len + CRLF_LEN;
 		tbuf.s=pkg_malloc(sizeof(char)*(tbuf.len));
 
-		if (tbuf.len==0)
+		if (tbuf.s==0)
 		{
 			LM_ERR("out of pkg memory\n");
 			return -1;
diff --git a/modules/xhttp_pi/xhttp_pi_fnc.c b/modules/xhttp_pi/xhttp_pi_fnc.c
index 761a277..5602429 100644
--- a/modules/xhttp_pi/xhttp_pi_fnc.c
+++ b/modules/xhttp_pi/xhttp_pi_fnc.c
@@ -252,31 +252,31 @@ do{	\
 		case '<':	\
 			(temp_holder).len = (temp_counter) - (temp_holder).len;	\
 			XHTTP_PI_COPY_2(p, (temp_holder), XHTTP_PI_ESC_LT);	\
-			(temp_holder).s += (temp_counter) + 1;	\
+			(temp_holder).s = (str).s + (temp_counter) + 1;	\
 			(temp_holder).len = (temp_counter) + 1;	\
 			break;	\
 		case '>':	\
 			(temp_holder).len = (temp_counter) - (temp_holder).len;	\
 			XHTTP_PI_COPY_2(p, (temp_holder), XHTTP_PI_ESC_GT);	\
-			(temp_holder).s += (temp_counter) + 1;	\
+			(temp_holder).s = (str).s + (temp_counter) + 1;	\
 			(temp_holder).len = (temp_counter) + 1;	\
 			break;	\
 		case '&':	\
 			(temp_holder).len = (temp_counter) - (temp_holder).len;	\
 			XHTTP_PI_COPY_2(p, (temp_holder), XHTTP_PI_ESC_AMP);	\
-			(temp_holder).s += (temp_counter) + 1;	\
+			(temp_holder).s = (str).s + (temp_counter) + 1;	\
 			(temp_holder).len = (temp_counter) + 1;	\
 			break;	\
 		case '"':	\
 			(temp_holder).len = (temp_counter) - (temp_holder).len;	\
 			XHTTP_PI_COPY_2(p, (temp_holder), XHTTP_PI_ESC_QUOT);	\
-			(temp_holder).s += (temp_counter) + 1;	\
+			(temp_holder).s = (str).s + (temp_counter) + 1;	\
 			(temp_holder).len = (temp_counter) + 1;	\
 			break;	\
 		case '\'':	\
 			(temp_holder).len = (temp_counter) - (temp_holder).len;	\
 			XHTTP_PI_COPY_2(p, (temp_holder), XHTTP_PI_ESC_SQUOT);	\
-			(temp_holder).s += (temp_counter) + 1;	\
+			(temp_holder).s = (str).s + (temp_counter) + 1;	\
 			(temp_holder).len = (temp_counter) + 1;	\
 			break;	\
 		}	\
@@ -385,7 +385,7 @@ static const str XHTTP_PI_Response_Foot = str_init(\
 "\n</center>\n<div align=\"center\" class=\"foot\" style=\"margin:20px auto\">"\
 	"<span style='margin-left:5px;'></span>"\
 	"<a href=\"http://kamailio.org\">Kamailio web site</a><br/>"\
-	"Copyright © 2012-2013 <a href=\"http://www.voipembedded.com/\">VoIP Embedded Inc.</a>"\
+	"Copyright © 2012-2014 <a href=\"http://www.voipembedded.com/\">VoIP Embedded Inc.</a>"\
 								". All rights reserved."\
 "</div></body></html>");
 
@@ -1357,7 +1357,7 @@ int ph_getCmds(ph_db_table_t *ph_db_tables, int ph_db_tables_size,
 								NULL,
 								&cmds->o_keys,
 								NULL,
-								&cmds->q_vals,
+								NULL,
 								&cmds->o_keys_size,
 								cmd_cols)!=0)
 							return -1;
diff --git a/modules/xlog/xlog.c b/modules/xlog/xlog.c
index 8a9b8c2..968e99d 100644
--- a/modules/xlog/xlog.c
+++ b/modules/xlog/xlog.c
@@ -448,6 +448,7 @@ static int xlog3_fixup_helper(void** param, int param_no)
 	*facility = str2facility(s.s);
 	if (*facility == -1) {
 		LM_ERR("invalid syslog facility %s\n", s.s);
+		pkg_free(facility);
 		return E_UNSPEC;
 	}
 
diff --git a/modules/xmlrpc/xmlrpc.c b/modules/xmlrpc/xmlrpc.c
index 4fa9b15..5522a8f 100644
--- a/modules/xmlrpc/xmlrpc.c
+++ b/modules/xmlrpc/xmlrpc.c
@@ -993,7 +993,7 @@ static int print_value(struct xmlrpc_reply* res,
 	case 'd':
 		prefix = int_prefix;
 		suffix = int_suffix;
-		body.s = int2str(va_arg(*ap, int), &body.len);
+		body.s = sint2str(va_arg(*ap, int), &body.len);
 		break;
 
 	case 'f':
diff --git a/msg_translator.c b/msg_translator.c
index 13b0785..23a9157 100644
--- a/msg_translator.c
+++ b/msg_translator.c
@@ -362,8 +362,10 @@ char* received_builder(struct sip_msg *msg, unsigned int *received_len)
 		return 0;
 	}
 	memcpy(buf, RECEIVED, RECEIVED_LEN);
-	if ( (tmp=ip_addr2a(source_ip))==0)
+	if ( (tmp=ip_addr2a(source_ip))==0) {
+		pkg_free(buf);
 		return 0; /* error*/
+	}
 	tmp_len=strlen(tmp);
 	len=RECEIVED_LEN+tmp_len;
 
@@ -2495,12 +2497,14 @@ char* via_builder( unsigned int *len,
                         con = tcpconn_get(send_info->id, 0, 0, 0, 0);
                 else {
                         LM_CRIT("BUG: via_builder called with null_id & to\n");
+						pkg_free(line_buf);
                         return 0;
                 }
 
                 if (con == NULL) {
                         LM_WARN("TCP/TLS connection (id: %d) for WebSocket could not be found\n",
-				send_info->id);
+								send_info->id);
+						pkg_free(line_buf);
                         return 0;
                 }
 
@@ -2511,6 +2515,7 @@ char* via_builder( unsigned int *len,
 		} else {
 			tcpconn_put(con);
 			LOG(L_CRIT, "BUG: via_builder: unknown proto %d\n", con->rcv.proto);
+			pkg_free(line_buf);
 			return 0;
 		}
 		tcpconn_put(con);
@@ -2518,6 +2523,7 @@ char* via_builder( unsigned int *len,
 		memcpy(line_buf+MY_VIA_LEN-4, "WSS ", 4);
 	}else{
 		LOG(L_CRIT, "BUG: via_builder: unknown proto %d\n", send_info->proto);
+		pkg_free(line_buf);
 		return 0;
 	}
 	/* add [] only if ipv6 and outbound socket address is used;
@@ -2620,7 +2626,7 @@ char* create_via_hf( unsigned int *len,
 #endif /* USE_TCP || USE_SCTP */
 
 	/* test and add rport parameter to local via - rfc3581 */
-	if(msg->msg_flags&FL_ADD_LOCAL_RPORT) {
+	if(msg && msg->msg_flags&FL_ADD_LOCAL_RPORT) {
 		/* params so far + ';rport' + '\0' */
 		via = (char*)pkg_malloc(extra_params.len+RPORT_LEN);
 		if(via==0) {
diff --git a/parser/contact/parse_contact.c b/parser/contact/parse_contact.c
index 5f5d500..e89b81c 100644
--- a/parser/contact/parse_contact.c
+++ b/parser/contact/parse_contact.c
@@ -134,7 +134,7 @@ int contact_iterator(contact_t** c, struct sip_msg* msg, contact_t* prev)
 	contact_body_t* cb;
 
 	if (!msg) {
-		LOG(L_ERR, "contact_iterator: Invalid parameter value\n");
+		LOG(L_ERR, "Invalid parameter value\n");
 		return -1;
 	}
 
@@ -146,7 +146,7 @@ int contact_iterator(contact_t** c, struct sip_msg* msg, contact_t* prev)
 		hdr = msg->contact;
 		if (!hdr) {
 			if (parse_headers(msg, HDR_CONTACT_F, 0) == -1) {
-				LOG(L_ERR, "contact_iterator: Error while parsing headers\n");
+				LOG(L_ERR, "Error while parsing headers\n");
 				return -1;
 			}
 
@@ -155,7 +155,7 @@ int contact_iterator(contact_t** c, struct sip_msg* msg, contact_t* prev)
 
 		if (hdr) {
 			if (parse_contact(hdr) < 0) {
-				LOG(L_ERR, "contact_iterator: Error while parsing Contact\n");
+				LOG(L_ERR, "Error while parsing Contact\n");
 				return -1;
 			}
 		} else {
@@ -175,6 +175,11 @@ int contact_iterator(contact_t** c, struct sip_msg* msg, contact_t* prev)
 			return 0;
 		}
 
+		if(hdr==NULL) {
+			LOG(L_ERR, "contact iterator not initialized\n");
+			return -1;
+		}
+
 		     /* Try to find and parse another Contact
 		      * header field
 		      */
@@ -193,7 +198,7 @@ int contact_iterator(contact_t** c, struct sip_msg* msg, contact_t* prev)
 			      * part of the message header
 			      */
 			if (parse_headers(msg, HDR_CONTACT_F, 1) == -1) {
-				LOG(L_ERR, "contact_iterator: Error while parsing message header\n");
+				LOG(L_ERR, "Error while parsing message header\n");
 				return -1;
 			}
 			
@@ -212,7 +217,7 @@ int contact_iterator(contact_t** c, struct sip_msg* msg, contact_t* prev)
 		}
 		
 		if (parse_contact(hdr) < 0) {
-			LOG(L_ERR, "contact_iterator: Error while parsing Contact HF body\n");
+			LOG(L_ERR, "Error while parsing Contact HF body\n");
 			return -1;
 		}
 		
diff --git a/parser/sdp/sdp.c b/parser/sdp/sdp.c
index fde60d3..1e53940 100644
--- a/parser/sdp/sdp.c
+++ b/parser/sdp/sdp.c
@@ -871,12 +871,13 @@ void print_sdp_stream(sdp_stream_cell_t *stream, int log_level)
 
 void print_sdp_session(sdp_session_cell_t *session, int log_level)
 {
-	sdp_stream_cell_t *stream = session->streams;
+	sdp_stream_cell_t *stream;
 
 	if (session==NULL) {
 		LM_ERR("NULL session\n");
 		return;
 	}
+	stream = session->streams;
 
 	LOG(log_level, "..session[%d]:%p=>%p '%.*s' '%.*s' '%.*s' '%.*s:%.*s' (%d)=>%p\n",
 		session->session_num, session, session->next,
diff --git a/parser/sdp/sdp_helpr_funcs.c b/parser/sdp/sdp_helpr_funcs.c
index a9eb315..bc96e99 100644
--- a/parser/sdp/sdp_helpr_funcs.c
+++ b/parser/sdp/sdp_helpr_funcs.c
@@ -204,6 +204,10 @@ other:
 
 
 
+/**
+ * rfc4566:
+ * a=rtpmap:<payload type> <encoding name>/<clock rate> [/<encoding parameters>]
+ */
 int extract_rtpmap(str *body,
 	str *rtpmap_payload, str *rtpmap_encoding, str *rtpmap_clockrate, str *rtpmap_parmas)
 {
@@ -241,30 +245,28 @@ int extract_rtpmap(str *body,
 
 	rtpmap_encoding->s = cp;
 	cp1 = (char*)ser_memmem(cp, "/", len, 1);
-	len -= cp1 - cp;
-	if (len <= 0 || cp == cp1) {
-		LM_ERR("invalid encoding in `a=rtpmap'\n");
+	if(cp1==NULL) {
+		LM_ERR("invalid encoding in `a=rtpmap' at [%.*s]\n", len, cp);
 		return -1;
 	}
+	len -= cp1 - cp;
 	rtpmap_encoding->len = cp1 - cp;
 
-	cp = cp1;
+	cp = cp1+1;  /* skip '/' */
+	len--;
+	rtpmap_clockrate->s = cp;
 	cp1 = (char*)ser_memmem(cp, "/", len, 1);
-	len -= cp1 - cp;
-	if (len <= 0) {
-		LM_ERR("invalid encoding in `a=rtpmap:'\n");
-		return -1;
-	}
-
-	rtpmap_clockrate->s = cp + 1; /* skip '/' */
-	rtpmap_clockrate->len = len -1; /* skip '/' */
-	if ( cp == cp1) {
+	if(cp1==NULL) {
+		/* no encoding parameters */
+		rtpmap_clockrate->len = len;
 		rtpmap_parmas->s = NULL;
 		rtpmap_parmas->len = 0;
-	} else {
-		rtpmap_parmas->s = cp1 + 1;
-		rtpmap_parmas->len = cp1 - cp;
+		return 0;
 	}
+	rtpmap_clockrate->len = cp1 - cp;
+	len -= cp1 - cp;
+	rtpmap_parmas->s = cp1 + 1;  /* skip '/' */
+	rtpmap_parmas->len = len - 1;
 	return 0;
 }
 
diff --git a/pkg/kamailio/centos/6/README b/pkg/kamailio/centos/6/README
new file mode 100644
index 0000000..8d61c17
--- /dev/null
+++ b/pkg/kamailio/centos/6/README
@@ -0,0 +1,27 @@
+The following modules are not included in CentOS 6 builds because they have
+dependencies that cannot be met by the base or EPEL CentOS YUM repos or are
+obsolete.
+
+Obsolete modules
+----------------
+* iptrtpproxy		use the rtpproxy-ng module with mediaproxy-ng instead
+* jabber		use the xmpp and pua_xmpp modules instead
+
+Modules with unmet dependencies
+-------------------------------
+Note: If you need any of these modules you will need to find (and possibly
+      build) and install the dependencies and then do a manual build of
+      Kamailio.
+
+Ordered by module name:
+* app_mono	requires mono-devel-??? or higher (EPEL contains
+		mono-devel 2.4.3.1)
+* db_cassandra	requires thrift 0.6.1 or 0.7.0
+* db_oracle	requires instantclient-sdk-10.2.0.3
+* osp		requires the OSP Toolkit
+
+Ordered by unmet dependency:
+* instantclient-sdk-10.2.0.3	db_oracle
+* mono-devel-??? or higher	app_mono
+* OSP Toolkit			osp
+* thrift 0.6.1 or 0.7.0		db_cassandra
diff --git a/pkg/kamailio/centos/6/kamailio.init b/pkg/kamailio/centos/6/kamailio.init
new file mode 100644
index 0000000..3ee9677
--- /dev/null
+++ b/pkg/kamailio/centos/6/kamailio.init
@@ -0,0 +1,134 @@
+#!/bin/bash
+#
+# Startup script for Kamailio
+#
+# chkconfig: 345 85 15
+# description: Kamailio (OpenSER) - the Open Source SIP Server
+#
+# processname: kamailio
+# pidfile: /var/run/kamailio.pid
+# config: /etc/kamailio/kamailio.cfg
+#
+### BEGIN INIT INFO
+# Provides: kamailio
+# Required-Start: $local_fs $network
+# Short-Description: Kamailio (OpenSER) - the Open Source SIP Server
+# Description: Kamailio (former OpenSER) is an Open Source SIP Server released
+# 	under GPL, able to handle thousands of call setups per second.
+### END INIT INFO
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+KAM=/usr/sbin/kamailio
+KAMCFG=/etc/kamailio/kamailio.cfg
+PROG=kamailio
+PID_FILE=/var/run/kamailio.pid
+LOCK_FILE=/var/lock/subsys/kamailio
+RETVAL=0
+DEFAULTS=/etc/sysconfig/kamailio
+RUN_KAMAILIO=no
+
+
+# Do not start kamailio if fork=no is set in the config file
+# otherwise the boot process will just stop
+check_fork ()
+{
+    if grep -q "^[[:space:]]*fork[[:space:]]*=[[:space:]]*no.*" $KAMCFG; then
+        echo "Not starting $DESC: fork=no specified in config file; run /etc/init.d/kamailio debug instead"
+        exit 1
+    fi
+}
+
+check_kamailio_config ()
+{
+        # Check if kamailio configuration is valid before starting the server
+        out=$($KAM -c 2>&1 > /dev/null)
+        retcode=$?
+        if [ "$retcode" != '0' ]; then
+            echo "Not starting $DESC: invalid configuration file!"
+            echo -e "\n$out\n"
+            exit 1
+        fi
+}
+
+
+start() {
+	check_kamailio_config
+        if [ "$1" != "debug" ]; then
+            check_fork
+        fi
+	echo -n $"Starting $PROG: "
+	daemon $KAM $OPTIONS >/dev/null 2>/dev/null
+	RETVAL=$?
+	[ $RETVAL = 0 ] && touch $LOCK_FILE && success
+	echo
+	return $RETVAL
+}
+
+stop() {
+	echo -n $"Stopping $PROG: "
+	killproc $KAM
+	RETVAL=$?
+	echo
+	[ $RETVAL = 0 ] && rm -f $LOCK_FILE $PID_FILE
+}
+
+# Load startup options if available
+if [ -f $DEFAULTS ]; then
+   . $DEFAULTS || true
+fi
+
+if [ "$RUN_KAMAILIO" != "yes" ]; then
+    echo "Kamailio not yet configured. Edit /etc/default/kamailio first."
+    exit 0
+fi
+
+
+SHM_MEMORY=$((`echo $SHM_MEMORY | sed -e 's/[^0-9]//g'`))
+PKG_MEMORY=$((`echo $PKG_MEMORY | sed -e 's/[^0-9]//g'`))
+[ -z "$USER" ]  && USER=kamailio
+[ -z "$GROUP" ] && GROUP=kamailio
+[ $SHM_MEMORY -le 0 ] && SHM_MEMORY=32
+[ $PKG_MEMORY -le 0 ] && PKG_MEMORY=4
+
+if test "$DUMP_CORE" = "yes" ; then
+    # set proper ulimit
+    ulimit -c unlimited
+
+    # directory for the core dump files
+    COREDIR=/tmp
+    echo "$COREDIR/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
+fi
+
+OPTIONS="-P $PID_FILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP $EXTRA_OPTIONS"
+
+
+# See how we were called.
+case "$1" in
+	start|debug)
+		start
+		;;
+	stop)
+		stop
+		;;
+	status)
+		status $KAM
+		RETVAL=$?
+		;;
+	restart)
+		stop
+		start
+		;;
+	condrestart)
+		if [ -f $PID_FILE ] ; then
+			stop
+			start
+		fi
+		;;
+	*)
+		echo $"Usage: $PROG {start|stop|restart|condrestart|status|debug|help}"
+		exit 1
+esac
+
+exit $RETVAL
diff --git a/pkg/kamailio/centos/6/kamailio.spec b/pkg/kamailio/centos/6/kamailio.spec
new file mode 100644
index 0000000..edcd087
--- /dev/null
+++ b/pkg/kamailio/centos/6/kamailio.spec
@@ -0,0 +1,1179 @@
+%define name	kamailio
+%define ver	4.1.5
+%define rel	0%{dist}
+
+
+
+Summary:	Kamailio (former OpenSER) - the Open Source SIP Server
+Name:		%name
+Version:	%ver
+Release:	%rel
+Packager:	Peter Dunkley <peter at dunkley.me.uk>
+License:	GPL
+Group:		System Environment/Daemons
+Source:		http://kamailio.org/pub/kamailio/%{ver}/src/%{name}-%{ver}_src.tar.gz
+URL:		http://kamailio.org/
+Vendor:		kamailio.org
+BuildRoot:	%{_tmppath}/%{name}-%{ver}-buildroot
+Conflicts:	kamailio-auth-ephemeral < %ver, kamailio-bdb < %ver
+Conflicts:	kamailio-carrierroute < %ver, kamailio-cpl < %ver
+Conflicts:	kamailio-dialplan < %ver, kamailio-dnssec < %ver
+Conflicts:	kamailio-geoip < %ver, kamailio-gzcompress < %ver
+Conflicts:	kamailio-ims < %ver, kamailio-java < %ver, kamailio-json < %ver
+Conflicts:	kamailio-lcr < %ver, kamailio-ldap < %ver, kamailio-lua < %ver
+Conflicts:	kamailio-memcached < %ver, kamailio-mysql < %ver
+Conflicts:	kamailio-outbound < %ver, kamailio-perl < %ver
+Conflicts:	kamailio-postgresql < %ver, kamailio-presence < %ver
+Conflicts:	kamailio-purple < %ver, kamailio-python < %ver
+Conflicts:	kamailio-radius < % ver, kamailio-redis < %ver
+Conflicts:	kamailio-regex < %ver, kamailio-sctp < %ver
+Conflicts:	kamailio-snmpstats < %ver, kamailio-sqlite < %ver
+Conflicts:	kamailio-tls < %ver, kamailio-unixodbc < %ver
+Conflicts:	kamailio-utils < %ver, kamailio-websocket < %ver
+Conflicts:	kamailio-xhttp-pi < %ver, kamailio-xmlops < %ver
+Conflicts:	kamailio-xmlrpc < %ver, kamailio-xmpp < %ver
+BuildRequires:	bison, flex, gcc, make, redhat-rpm-config
+
+%description
+Kamailio (former OpenSER) is an Open Source SIP Server released under GPL, able
+to handle thousands of call setups per second. Among features: asynchronous TCP,
+UDP and SCTP, secure communication via TLS for VoIP (voice, video); IPv4 and
+IPv6; SIMPLE instant messaging and presence with embedded XCAP server and MSRP
+relay; ENUM; DID and least cost routing; load balancing; routing fail-over;
+accounting, authentication and authorization; support for many backend systems
+such as MySQL, Postgres, Oracle, Radius, LDAP, Redis, Cassandra; XMLRPC control
+interface, SNMP monitoring. It can be used to build large VoIP servicing
+platforms or to scale up SIP-to-PSTN gateways, PBX systems or media servers
+like Asterisk™, FreeSWITCH™ or SEMS.
+
+
+%package	auth-ephemeral
+Summary:	Functions for authentication using ephemeral credentials.
+Group:		System Environment/Daemons
+Requires:	openssl, kamailio = %ver
+BuildRequires:	openssl-devel
+
+%description auth-ephemeral
+Functions for authentication using ephemeral credentials.
+
+
+%package	bdb
+Summary:	Berkeley database connectivity for Kamailio.
+Group:		System Environment/Daemons
+Requires:	db4, kamailio = %ver
+BuildRequires:	db4-devel
+
+%description	bdb
+Berkeley database connectivity for Kamailio.
+
+
+%package	carrierroute
+Summary:	The carrierroute module for Kamailio.
+Group:		System Environment/Daemons
+Requires:	epel-release, libconfuse, kamailio = %ver
+BuildRequires:	epel-release, libconfuse-devel
+
+%description	carrierroute
+The carrierroute module for Kamailio.
+
+
+%package	cpl
+Summary:	CPL (Call Processing Language) interpreter for Kamailio.
+Group:		System Environment/Daemons
+Requires:	libxml2, kamailio = %ver
+BuildRequires:	libxml2-devel
+
+%description	cpl
+CPL (Call Processing Language) interpreter for Kamailio.
+
+
+%package	dialplan
+Summary:	String translations based on rules for Kamailio.
+Group:		System Environment/Daemons
+Requires:	pcre, kamailio = %ver
+BuildRequires:	pcre-devel
+
+%description	dialplan
+String translations based on rules for Kamailio.
+
+
+%package	dnssec
+Summary:	DNSSEC support for Kamailio.
+Group:		System Environment/Daemons
+Requires:	epel-release, dnssec-tools-libs, kamailio = %ver
+BuildRequires:	epel-release, dnssec-tools-libs-devel
+
+%description	dnssec
+DNSSEC support for Kamailio.
+
+
+%package	geoip
+Summary:	MaxMind GeoIP support for Kamailio.
+Group:		System Environment/Daemons
+Requires:	epel-release, GeoIP, kamailio = %ver
+BuildRequires:	epel-release, GeoIP-devel
+
+%description	geoip
+MaxMind GeoIP support for Kamailio.
+
+
+%package	gzcompress
+Summary:	Compressed body (SIP and HTTP) handling for kamailio.
+Group:		System Environment/Daemons
+Requires:	zlib, kamailio = %ver
+BuildRequires:	zlib-devel
+
+%description	gzcompress
+Compressed body (SIP and HTTP) handling for kamailio.
+
+
+%package	ims
+Summary:	IMS modules and extensions module for Kamailio.
+Group:		System Environment/Daemons
+Requires:	libxml2, kamailio = %ver
+BuildRequires:	libxml2-devel
+
+%description	ims
+IMS modules and extensions module for Kamailio.
+
+
+%package	java
+Summary:	Java extensions for Kamailio.
+Group:		System Environment/Daemons
+Requires:	libgcj, java-1.6.0-openjdk, kamailio = %ver
+BuildRequires:	libgcj-devel, java-1.6.0-openjdk-devel, ant
+
+%description	java
+Java extensions for Kamailio.
+
+
+%package	json
+Summary:	json string handling and RPC modules for Kamailio.
+Group:		System Environment/Daemons
+Requires:	epel-release, json-c, libevent, kamailio = %ver
+BuildRequires:	epel-release, json-c-devel, libevent-devel
+
+%description	json
+json string handling and RPC modules for Kamailio.
+
+
+%package	lcr
+Summary:	Least cost routing for Kamailio.
+Group:		System Environment/Daemons
+Requires:	pcre, kamailio = %ver
+BuildRequires:	pcre-devel
+
+%description	lcr
+Least cost routing for Kamailio.
+
+
+%package	ldap
+Summary:	LDAP search interface for Kamailio.
+Group:		System Environment/Daemons
+Requires:	openldap, kamailio = %ver
+BuildRequires:	openldap-devel
+
+%description	ldap
+LDAP search interface for Kamailio.
+
+
+%package	lua
+Summary:	Lua extensions for Kamailio.
+Group:		System Environment/Daemons
+Requires:	kamailio = %ver
+BuildRequires:	lua-devel
+
+%description	lua
+Lua extensions for Kamailio.
+
+
+%package	memcached
+Summary:	memcached configuration file support for Kamailio.
+Group:		System Environment/Daemons
+Requires:	libmemcached, kamailio = %ver
+BuildRequires:	libmemcached-devel
+
+%description	memcached
+memcached configuration file support for Kamailio.
+
+
+%package	mysql
+Summary:	MySQL database connectivity for Kamailio.
+Group:		System Environment/Daemons
+Requires:	mysql-libs, kamailio = %ver
+BuildRequires:	mysql-devel zlib-devel
+
+%description	mysql
+MySQL database connectivity for Kamailio.
+
+
+%package	outbound
+Summary:	Outbound (RFC 5626) support for Kamailio.
+Group:		System Environment/Daemons
+Requires:	openssl, kamailio = %ver
+BuildRequires:	openssl-devel
+
+%description	outbound
+RFC 5626, "Managing Client-Initiated Connections in the Session Initiation
+Protocol (SIP)" support for Kamailio.
+
+
+%package	perl
+Summary:	Perl extensions and database driver for Kamailio.
+Group:		System Environment/Daemons 
+Requires:	mod_perl, kamailio = %ver
+BuildRequires:	mod_perl-devel
+
+%description	perl
+Perl extensions and database driver for Kamailio.
+
+
+%package	postgresql
+Summary:	PostgreSQL database connectivity for Kamailio.
+Group:		System Environment/Daemons
+Requires:	postgresql-libs, kamailio = %ver
+BuildRequires:	postgresql-devel
+
+%description	postgresql
+PostgreSQL database connectivity for Kamailio.
+
+
+%package	presence
+Summary:	SIP Presence (and RLS, XCAP, etc) support for Kamailio.
+Group:		System Environment/Daemons
+Requires:	libxml2, libcurl, kamailio = %ver, kamailio-xmpp = %ver
+BuildRequires:	libxml2-devel, libcurl-devel
+
+%description	presence
+SIP Presence (and RLS, XCAP, etc) support for Kamailio.
+
+
+%package	purple
+Summary:	Multi-protocol IM and presence gateway module.
+Group:		System Environment/Daemons
+Requires:	glib2, libpurple, libxml2, kamailio = %ver
+Requires:	kamailio-presence = %ver
+BuildRequires:	glib2-devel, libpurple-devel, libxml2-devel
+
+%description	purple
+Multi-protocol IM and presence gateway module.
+
+
+%package	python
+Summary:	Python extensions for Kamailio.
+Group:		System Environment/Daemons
+Requires:	python, kamailio = %ver
+BuildRequires:	python-devel
+
+%description	python
+Python extensions for Kamailio.
+
+
+%package	radius
+Summary:	RADIUS modules for Kamailio.
+Group:		System Environment/Daemons
+Requires:	epel-release, radiusclient-ng, kamailio = %ver
+BuildRequires:	epel-release, radiusclient-ng-devel
+
+%description	radius
+RADIUS modules for Kamailio.
+
+
+%package	redis
+Summary:	Redis configuration file support for Kamailio.
+Group:		System Environment/Daemons
+Requires:	epel-release, hiredis, kamailio = %ver
+BuildRequires:	epel-release, hiredis-devel
+
+%description	redis
+Redis configuration file support for Kamailio.
+
+
+%package	regex
+Summary:	PCRE mtaching operations for Kamailio.
+Group:		System Environment/Daemons
+Requires:	pcre, kamailio = %ver
+BuildRequires:	pcre-devel
+
+%description	regex
+PCRE mtaching operations for Kamailio.
+
+
+%package	sctp
+Summary:	SCTP transport for Kamailio.
+Group:		System Environment/Daemons
+Requires:	lksctp-tools, kamailio = %ver
+BuildRequires:	lksctp-tools-devel
+
+%description	sctp
+SCTP transport for Kamailio.
+
+
+%package	snmpstats
+Summary:	SNMP management interface (scalar statistics) for Kamailio.
+Group:		System Environment/Daemons
+Requires:	net-snmp-libs, kamailio = %ver
+BuildRequires:	net-snmp-devel
+
+%description	snmpstats
+SNMP management interface (scalar statistics) for Kamailio.
+
+
+%package	sqlite
+Summary:	SQLite database connectivity for Kamailio.
+Group:		System Environment/Daemons
+Requires:	sqlite, kamailio = %ver
+BuildRequires:	sqlite-devel
+
+%description	sqlite
+SQLite database connectivity for Kamailio.
+
+
+%package	tls
+Summary:	TLS transport for Kamailio.
+Group:		System Environment/Daemons
+Requires:	openssl, kamailio = %ver
+BuildRequires:	openssl-devel
+
+%description	tls
+TLS transport for Kamailio.
+
+
+%package	unixodbc
+Summary:	unixODBC database connectivity for Kamailio.
+Group:		System Environment/Daemons
+Requires:	unixODBC, kamailio = %ver
+BuildRequires:	unixODBC-devel
+
+%description	unixodbc
+unixODBC database connectivity for Kamailio.
+
+
+%package	utils
+Summary:	Non-SIP utitility functions for Kamailio.
+Group:		System Environment/Daemons
+Requires:	libcurl, libxml2, kamailio = %ver
+BuildRequires:	libcurl-devel, libxml2-devel
+
+%description	utils
+Non-SIP utitility functions for Kamailio.
+
+
+%package	websocket
+Summary:	WebSocket transport for Kamailio.
+Group:		System Environment/Daemons
+Requires:	libunistring, openssl, kamailio = %ver
+BuildRequires:	libunistring-devel, openssl-devel
+
+%description	websocket
+WebSocket transport for Kamailio.
+
+
+%package	xhttp-pi
+Summary:	Web-provisioning interface for Kamailio.
+Group:		System Environment/Daemons
+Requires:	libxml2, kamailio = %ver
+BuildRequires:	libxml2-devel
+
+%description	xhttp-pi
+Web-provisioning interface for Kamailio.
+
+
+%package	xmlops
+Summary:	XML operation functions for Kamailio.
+Group:		System Environment/Daemons
+Requires:	libxml2, kamailio = %ver
+BuildRequires:	libxml2-devel
+
+%description	xmlops
+XML operation functions for Kamailio.
+
+
+%package	xmlrpc
+Summary:	XMLRPC transport and encoding for Kamailio RPCs and MI commands.
+Group:		System Environment/Daemons
+Requires:	libxml2, xmlrpc-c, kamailio = %ver
+BuildRequires:	libxml2-devel, xmlrpc-c-devel
+
+%description	xmlrpc
+XMLRPC transport and encoding for Kamailio RPCs and MI commands.
+
+
+%package	xmpp
+Summary:	SIP/XMPP IM gateway for Kamailio.
+Group:		System Environment/Daemons
+Requires:	expat, kamailio = %ver
+BuildRequires:	expat-devel
+
+%description	xmpp
+SIP/XMPP IM gateway for Kamailio.
+
+
+
+%prep
+%setup -n %{name}-%{ver}
+
+
+
+%build
+make cfg prefix=/usr cfg_prefix=$RPM_BUILD_ROOT basedir=$RPM_BUILD_ROOT \
+	cfg_target=/%{_sysconfdir}/kamailio/ modules_dirs="modules"
+make
+make every-module skip_modules="app_mono db_cassandra db_oracle iptrtpproxy \
+	jabber osp" \
+	group_include="kstandard kautheph kberkeley kcarrierroute kcpl \
+	kdnssec kgeoip kims kjava kjson kldap klua kmemcached kmi_xmlrpc \
+	kmysql koutbound kperl kpostgres kpresence kpurple kpython kradius \
+	kredis ksctp ksnmpstats ksqlite ktls kunixodbc kutils kwebsocket \
+	kxml kxmpp" 
+cd modules/app_java/kamailio_java_folder/java
+ant
+cd ../../../..
+make utils
+
+
+
+%install
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
+
+make install
+make install-modules-all skip_modules="app_mono db_cassandra db_oracle \
+	iptrtpproxy jabber osp" \
+	group_include="kstandard kautheph kberkeley kcarrierroute kcpl \
+	kdnssec kgeoip kims kjava kjson kldap klua kmemcached kmi_xmlrpc \
+	kmysql koutbound kperl kpostgres kpresence kpurple kpython kradius \
+	kredis ksctp ksnmpstats ksqlite ktls kunixodbc kutils kwebsocket \
+	kxml kxmpp" 
+
+mkdir -p $RPM_BUILD_ROOT/%{_libdir}/kamailio/java
+install -m644 modules/app_java/kamailio_java_folder/java/Kamailio.class \
+	$RPM_BUILD_ROOT/%{_libdir}/kamailio/java
+install -m644 modules/app_java/kamailio_java_folder/java/kamailio.jar \
+	$RPM_BUILD_ROOT/%{_libdir}/kamailio/java
+
+mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d
+install -m755 pkg/kamailio/centos/%{?centos}/kamailio.init \
+		$RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/kamailio
+
+mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig
+install -m644 pkg/kamailio/centos/%{?centos}/kamailio.sysconfig \
+		$RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/kamailio
+
+
+
+%pre
+/usr/sbin/groupadd -r kamailio 2> /dev/null || :
+/usr/sbin/useradd -r -g kamailio -s /bin/false -c "Kamailio daemon" -d \
+		%{_libdir}/kamailio kamailio 2> /dev/null || :
+
+
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+
+
+%post
+/sbin/chkconfig --add kamailio
+
+
+
+%preun
+if [ $1 = 0 ]; then
+	/sbin/service kamailio stop > /dev/null 2>&1
+	/sbin/chkconfig --del kamailio
+fi
+
+
+
+%files
+%defattr(-,root,root)
+%dir %{_docdir}/kamailio
+%doc %{_docdir}/kamailio/AUTHORS
+%doc %{_docdir}/kamailio/NEWS
+%doc %{_docdir}/kamailio/INSTALL
+%doc %{_docdir}/kamailio/README
+%doc %{_docdir}/kamailio/README-MODULES
+
+%dir %{_docdir}/kamailio/modules
+%doc %{_docdir}/kamailio/modules/README.acc
+%doc %{_docdir}/kamailio/modules/README.alias_db
+%doc %{_docdir}/kamailio/modules/README.async
+%doc %{_docdir}/kamailio/modules/README.auth
+%doc %{_docdir}/kamailio/modules/README.auth_db
+%doc %{_docdir}/kamailio/modules/README.auth_diameter
+%doc %{_docdir}/kamailio/modules/README.avp
+%doc %{_docdir}/kamailio/modules/README.avpops
+%doc %{_docdir}/kamailio/modules/README.benchmark
+%doc %{_docdir}/kamailio/modules/README.blst
+%doc %{_docdir}/kamailio/modules/README.call_control
+%doc %{_docdir}/kamailio/modules/README.cfg_db
+%doc %{_docdir}/kamailio/modules/README.cfg_rpc
+%doc %{_docdir}/kamailio/modules/README.cfgutils
+%doc %{_docdir}/kamailio/modules/README.cnxcc
+%doc %{_docdir}/kamailio/modules/README.corex
+%doc %{_docdir}/kamailio/modules/README.counters
+%doc %{_docdir}/kamailio/modules/README.ctl
+%doc %{_docdir}/kamailio/modules/README.db_cluster
+%doc %{_docdir}/kamailio/modules/README.db_flatstore
+%doc %{_docdir}/kamailio/modules/README.db_text
+%doc %{_docdir}/kamailio/modules/README.db2_ops
+%doc %{_docdir}/kamailio/modules/README.debugger
+%doc %{_docdir}/kamailio/modules/README.dialog
+%doc %{_docdir}/kamailio/modules/README.dialog_ng
+%doc %{_docdir}/kamailio/modules/README.dispatcher
+%doc %{_docdir}/kamailio/modules/README.diversion
+%doc %{_docdir}/kamailio/modules/README.dmq
+%doc %{_docdir}/kamailio/modules/README.domain
+%doc %{_docdir}/kamailio/modules/README.domainpolicy
+%doc %{_docdir}/kamailio/modules/README.drouting
+%doc %{_docdir}/kamailio/modules/README.enum
+%doc %{_docdir}/kamailio/modules/README.exec
+%doc %{_docdir}/kamailio/modules/README.group
+%doc %{_docdir}/kamailio/modules/README.htable
+%doc %{_docdir}/kamailio/modules/README.imc
+%doc %{_docdir}/kamailio/modules/README.ipops
+%doc %{_docdir}/kamailio/modules/README.kex
+%doc %{_docdir}/kamailio/modules/README.malloc_test
+%doc %{_docdir}/kamailio/modules/README.mangler
+%doc %{_docdir}/kamailio/modules/README.matrix
+%doc %{_docdir}/kamailio/modules/README.maxfwd
+%doc %{_docdir}/kamailio/modules/README.mediaproxy
+%doc %{_docdir}/kamailio/modules/README.mi_datagram
+%doc %{_docdir}/kamailio/modules/README.mi_fifo
+%doc %{_docdir}/kamailio/modules/README.mi_rpc
+%doc %{_docdir}/kamailio/modules/README.mohqueue
+%doc %{_docdir}/kamailio/modules/README.mqueue
+%doc %{_docdir}/kamailio/modules/README.msilo
+%doc %{_docdir}/kamailio/modules/README.msrp
+%doc %{_docdir}/kamailio/modules/README.mtree
+%doc %{_docdir}/kamailio/modules/README.nat_traversal
+%doc %{_docdir}/kamailio/modules/README.nathelper
+%doc %{_docdir}/kamailio/modules/README.p_usrloc
+%doc %{_docdir}/kamailio/modules/README.path
+%doc %{_docdir}/kamailio/modules/README.pdb
+%doc %{_docdir}/kamailio/modules/README.pdt
+%doc %{_docdir}/kamailio/modules/README.permissions
+%doc %{_docdir}/kamailio/modules/README.pike
+%doc %{_docdir}/kamailio/modules/README.pipelimit
+%doc %{_docdir}/kamailio/modules/README.prefix_route
+%doc %{_docdir}/kamailio/modules/README.print
+%doc %{_docdir}/kamailio/modules/README.print_lib
+%doc %{_docdir}/kamailio/modules/README.pv
+%doc %{_docdir}/kamailio/modules/README.qos
+%doc %{_docdir}/kamailio/modules/README.ratelimit
+%doc %{_docdir}/kamailio/modules/README.registrar
+%doc %{_docdir}/kamailio/modules/README.rr
+%doc %{_docdir}/kamailio/modules/README.rtimer
+%doc %{_docdir}/kamailio/modules/README.rtpproxy
+%doc %{_docdir}/kamailio/modules/README.rtpproxy-ng
+%doc %{_docdir}/kamailio/modules/README.sanity
+%doc %{_docdir}/kamailio/modules/README.sca
+%doc %{_docdir}/kamailio/modules/README.sdpops
+%doc %{_docdir}/kamailio/modules/README.seas
+%doc %{_docdir}/kamailio/modules/README.sipcapture
+%doc %{_docdir}/kamailio/modules/README.sipt
+%doc %{_docdir}/kamailio/modules/README.siptrace
+%doc %{_docdir}/kamailio/modules/README.siputils
+%doc %{_docdir}/kamailio/modules/README.sl
+%doc %{_docdir}/kamailio/modules/README.sms
+%doc %{_docdir}/kamailio/modules/README.speeddial
+%doc %{_docdir}/kamailio/modules/README.sqlops
+%doc %{_docdir}/kamailio/modules/README.sst
+%doc %{_docdir}/kamailio/modules/README.statistics
+%doc %{_docdir}/kamailio/modules/README.stun
+%doc %{_docdir}/kamailio/modules/README.textops
+%doc %{_docdir}/kamailio/modules/README.textopsx
+%doc %{_docdir}/kamailio/modules/README.timer
+%doc %{_docdir}/kamailio/modules/README.tm
+%doc %{_docdir}/kamailio/modules/README.tmrec
+%doc %{_docdir}/kamailio/modules/README.tmx
+%doc %{_docdir}/kamailio/modules/README.topoh
+%doc %{_docdir}/kamailio/modules/README.uac
+%doc %{_docdir}/kamailio/modules/README.uac_redirect
+%doc %{_docdir}/kamailio/modules/README.uid_auth_db
+%doc %{_docdir}/kamailio/modules/README.uid_avp_db
+%doc %{_docdir}/kamailio/modules/README.uid_domain
+%doc %{_docdir}/kamailio/modules/README.uid_gflags
+%doc %{_docdir}/kamailio/modules/README.uid_uri_db
+%doc %{_docdir}/kamailio/modules/README.uri_db
+%doc %{_docdir}/kamailio/modules/README.userblacklist
+%doc %{_docdir}/kamailio/modules/README.usrloc
+%doc %{_docdir}/kamailio/modules/README.xhttp
+%doc %{_docdir}/kamailio/modules/README.xhttp_rpc
+%doc %{_docdir}/kamailio/modules/README.xlog
+%doc %{_docdir}/kamailio/modules/README.xprint
+
+%dir %attr(-,kamailio,kamailio) %{_sysconfdir}/kamailio
+%config(noreplace) %{_sysconfdir}/kamailio/*
+%config %{_sysconfdir}/rc.d/init.d/*
+%config %{_sysconfdir}/sysconfig/*
+
+%dir %{_libdir}/kamailio
+%{_libdir}/kamailio/libbinrpc.so
+%{_libdir}/kamailio/libbinrpc.so.0
+%{_libdir}/kamailio/libbinrpc.so.0.1
+%{_libdir}/kamailio/libkcore.so
+%{_libdir}/kamailio/libkcore.so.1
+%{_libdir}/kamailio/libkcore.so.1.0
+%{_libdir}/kamailio/libkmi.so
+%{_libdir}/kamailio/libkmi.so.1
+%{_libdir}/kamailio/libkmi.so.1.0
+%{_libdir}/kamailio/libprint.so
+%{_libdir}/kamailio/libprint.so.1
+%{_libdir}/kamailio/libprint.so.1.2
+%{_libdir}/kamailio/libsrdb1.so
+%{_libdir}/kamailio/libsrdb1.so.1
+%{_libdir}/kamailio/libsrdb1.so.1.0
+%{_libdir}/kamailio/libsrdb2.so
+%{_libdir}/kamailio/libsrdb2.so.1
+%{_libdir}/kamailio/libsrdb2.so.1.0
+%{_libdir}/kamailio/libsrutils.so
+%{_libdir}/kamailio/libsrutils.so.1
+%{_libdir}/kamailio/libsrutils.so.1.0
+%{_libdir}/kamailio/libtrie.so
+%{_libdir}/kamailio/libtrie.so.1
+%{_libdir}/kamailio/libtrie.so.1.0
+
+%dir %{_libdir}/kamailio/modules
+%{_libdir}/kamailio/modules/acc.so
+%{_libdir}/kamailio/modules/alias_db.so
+%{_libdir}/kamailio/modules/async.so
+%{_libdir}/kamailio/modules/auth.so
+%{_libdir}/kamailio/modules/auth_db.so
+%{_libdir}/kamailio/modules/auth_diameter.so
+%{_libdir}/kamailio/modules/avp.so
+%{_libdir}/kamailio/modules/avpops.so
+%{_libdir}/kamailio/modules/benchmark.so
+%{_libdir}/kamailio/modules/blst.so
+%{_libdir}/kamailio/modules/call_control.so
+%{_libdir}/kamailio/modules/cfg_db.so
+%{_libdir}/kamailio/modules/cfg_rpc.so
+%{_libdir}/kamailio/modules/cfgutils.so
+%{_libdir}/kamailio/modules/cnxcc.so
+%{_libdir}/kamailio/modules/corex.so
+%{_libdir}/kamailio/modules/counters.so
+%{_libdir}/kamailio/modules/ctl.so
+%{_libdir}/kamailio/modules/db_cluster.so
+%{_libdir}/kamailio/modules/db_flatstore.so
+%{_libdir}/kamailio/modules/db_text.so
+%{_libdir}/kamailio/modules/db2_ops.so
+%{_libdir}/kamailio/modules/debugger.so
+%{_libdir}/kamailio/modules/dialog.so
+%{_libdir}/kamailio/modules/dialog_ng.so
+%{_libdir}/kamailio/modules/dispatcher.so
+%{_libdir}/kamailio/modules/diversion.so
+%{_libdir}/kamailio/modules/dmq.so
+%{_libdir}/kamailio/modules/domain.so
+%{_libdir}/kamailio/modules/domainpolicy.so
+%{_libdir}/kamailio/modules/drouting.so
+%{_libdir}/kamailio/modules/enum.so
+%{_libdir}/kamailio/modules/exec.so
+%{_libdir}/kamailio/modules/group.so
+%{_libdir}/kamailio/modules/htable.so
+%{_libdir}/kamailio/modules/imc.so
+%{_libdir}/kamailio/modules/ipops.so
+%{_libdir}/kamailio/modules/kex.so
+%{_libdir}/kamailio/modules/malloc_test.so
+%{_libdir}/kamailio/modules/mangler.so
+%{_libdir}/kamailio/modules/matrix.so
+%{_libdir}/kamailio/modules/maxfwd.so
+%{_libdir}/kamailio/modules/mediaproxy.so
+%{_libdir}/kamailio/modules/mi_datagram.so
+%{_libdir}/kamailio/modules/mi_fifo.so
+%{_libdir}/kamailio/modules/mi_rpc.so
+%{_libdir}/kamailio/modules/mohqueue.so
+%{_libdir}/kamailio/modules/mqueue.so
+%{_libdir}/kamailio/modules/msilo.so
+%{_libdir}/kamailio/modules/msrp.so
+%{_libdir}/kamailio/modules/mtree.so
+%{_libdir}/kamailio/modules/nat_traversal.so
+%{_libdir}/kamailio/modules/nathelper.so
+%{_libdir}/kamailio/modules/p_usrloc.so
+%{_libdir}/kamailio/modules/path.so
+%{_libdir}/kamailio/modules/pdb.so
+%{_libdir}/kamailio/modules/pdt.so
+%{_libdir}/kamailio/modules/permissions.so
+%{_libdir}/kamailio/modules/pike.so
+%{_libdir}/kamailio/modules/pipelimit.so
+%{_libdir}/kamailio/modules/prefix_route.so
+%{_libdir}/kamailio/modules/print.so
+%{_libdir}/kamailio/modules/print_lib.so
+%{_libdir}/kamailio/modules/pv.so
+%{_libdir}/kamailio/modules/qos.so
+%{_libdir}/kamailio/modules/ratelimit.so
+%{_libdir}/kamailio/modules/registrar.so
+%{_libdir}/kamailio/modules/rr.so
+%{_libdir}/kamailio/modules/rtimer.so
+%{_libdir}/kamailio/modules/rtpproxy.so
+%{_libdir}/kamailio/modules/rtpproxy-ng.so
+%{_libdir}/kamailio/modules/sanity.so
+%{_libdir}/kamailio/modules/sca.so
+%{_libdir}/kamailio/modules/sdpops.so
+%{_libdir}/kamailio/modules/seas.so
+%{_libdir}/kamailio/modules/sipcapture.so
+%{_libdir}/kamailio/modules/sipt.so
+%{_libdir}/kamailio/modules/siptrace.so
+%{_libdir}/kamailio/modules/siputils.so
+%{_libdir}/kamailio/modules/sl.so
+%{_libdir}/kamailio/modules/sms.so
+%{_libdir}/kamailio/modules/speeddial.so
+%{_libdir}/kamailio/modules/sqlops.so
+%{_libdir}/kamailio/modules/sst.so
+%{_libdir}/kamailio/modules/statistics.so
+%{_libdir}/kamailio/modules/stun.so
+%{_libdir}/kamailio/modules/textops.so
+%{_libdir}/kamailio/modules/textopsx.so
+%{_libdir}/kamailio/modules/timer.so
+%{_libdir}/kamailio/modules/tm.so
+%{_libdir}/kamailio/modules/tmrec.so
+%{_libdir}/kamailio/modules/tmx.so
+%{_libdir}/kamailio/modules/topoh.so
+%{_libdir}/kamailio/modules/uac.so
+%{_libdir}/kamailio/modules/uac_redirect.so
+%{_libdir}/kamailio/modules/uid_auth_db.so
+%{_libdir}/kamailio/modules/uid_avp_db.so
+%{_libdir}/kamailio/modules/uid_domain.so
+%{_libdir}/kamailio/modules/uid_gflags.so
+%{_libdir}/kamailio/modules/uid_uri_db.so
+%{_libdir}/kamailio/modules/uri_db.so
+%{_libdir}/kamailio/modules/userblacklist.so
+%{_libdir}/kamailio/modules/usrloc.so
+%{_libdir}/kamailio/modules/xhttp.so
+%{_libdir}/kamailio/modules/xhttp_rpc.so
+%{_libdir}/kamailio/modules/xlog.so
+%{_libdir}/kamailio/modules/xprint.so
+
+%{_sbindir}/kamailio
+%{_sbindir}/kamctl
+%{_sbindir}/kamdbctl
+%{_sbindir}/kamcmd
+
+%dir %{_libdir}/kamailio/kamctl
+%{_libdir}/kamailio/kamctl/kamctl.base
+%{_libdir}/kamailio/kamctl/kamctl.ctlbase
+%{_libdir}/kamailio/kamctl/kamctl.dbtext
+%{_libdir}/kamailio/kamctl/kamctl.fifo
+%{_libdir}/kamailio/kamctl/kamctl.ser
+%{_libdir}/kamailio/kamctl/kamctl.ser_mi
+%{_libdir}/kamailio/kamctl/kamctl.sqlbase
+%{_libdir}/kamailio/kamctl/kamctl.unixsock
+%{_libdir}/kamailio/kamctl/kamdbctl.base
+%{_libdir}/kamailio/kamctl/kamdbctl.dbtext
+
+%dir %{_libdir}/kamailio/kamctl/dbtextdb
+%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.py
+%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.pyc
+%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.pyo
+
+%{_mandir}/man5/*
+%{_mandir}/man8/*
+
+%dir %{_datadir}/kamailio
+%dir %{_datadir}/kamailio/dbtext
+%dir %{_datadir}/kamailio/dbtext/kamailio
+%{_datadir}/kamailio/dbtext/kamailio/*
+
+
+%files		auth-ephemeral
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.auth_ephemeral
+%{_libdir}/kamailio/modules/auth_ephemeral.so
+
+
+%files		bdb
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.db_berkeley
+%{_sbindir}/kambdb_recover
+%{_libdir}/kamailio/modules/db_berkeley.so
+%{_libdir}/kamailio/kamctl/kamctl.db_berkeley
+%{_libdir}/kamailio/kamctl/kamdbctl.db_berkeley
+%dir %{_datadir}/kamailio/db_berkeley
+%{_datadir}/kamailio/db_berkeley/*
+
+
+%files		carrierroute
+%defattr(-,root,root)
+%{_docdir}/kamailio/modules/README.carrierroute
+%{_libdir}/kamailio/modules/carrierroute.so
+
+
+%files		cpl
+%defattr(-,root,root)
+%{_docdir}/kamailio/modules/README.cpl-c
+%{_libdir}/kamailio/modules/cpl-c.so
+
+
+%files		dialplan
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.dialplan
+%{_libdir}/kamailio/modules/dialplan.so
+
+
+%files		dnssec
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.dnssec
+%{_libdir}/kamailio/modules/dnssec.so
+
+
+%files		geoip
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.geoip
+%{_libdir}/kamailio/modules/geoip.so
+
+
+%files		gzcompress
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.gzcompress
+%{_libdir}/kamailio/modules/gzcompress.so
+
+
+%files		ims
+%defattr(-,root,root)
+%{_libdir}/kamailio/libkamailio_ims.so
+%{_libdir}/kamailio/libkamailio_ims.so.0
+%{_libdir}/kamailio/libkamailio_ims.so.0.1
+
+%doc %{_docdir}/kamailio/modules/README.cdp
+%doc %{_docdir}/kamailio/modules/README.cdp_avp
+%doc %{_docdir}/kamailio/modules/README.ims_auth
+%doc %{_docdir}/kamailio/modules/README.ims_charging
+%doc %{_docdir}/kamailio/modules/README.ims_icscf
+%doc %{_docdir}/kamailio/modules/README.ims_isc
+%doc %{_docdir}/kamailio/modules/README.ims_qos
+#%doc %{_docdir}/kamailio/modules/README.ims_registrar_pcscf
+#%doc %{_docdir}/kamailio/modules/README.ims_registrar_scscf
+%doc %{_docdir}/kamailio/modules/README.ims_usrloc_pcscf
+#%doc %{_docdir}/kamailio/modules/README.ims_usrloc_scscf
+%{_libdir}/kamailio/modules/cdp.so
+%{_libdir}/kamailio/modules/cdp_avp.so
+%{_libdir}/kamailio/modules/ims_auth.so
+%{_libdir}/kamailio/modules/ims_charging.so
+%{_libdir}/kamailio/modules/ims_icscf.so
+%{_libdir}/kamailio/modules/ims_isc.so
+%{_libdir}/kamailio/modules/ims_qos.so
+%{_libdir}/kamailio/modules/ims_registrar_pcscf.so
+%{_libdir}/kamailio/modules/ims_registrar_scscf.so
+%{_libdir}/kamailio/modules/ims_usrloc_pcscf.so
+%{_libdir}/kamailio/modules/ims_usrloc_scscf.so
+
+
+%files		java
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.app_java
+%{_libdir}/kamailio/modules/app_java.so
+%dir %{_libdir}/kamailio/java
+%{_libdir}/kamailio/java/Kamailio.class
+%{_libdir}/kamailio/java/kamailio.jar
+
+
+%files		json
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.json
+%doc %{_docdir}/kamailio/modules/README.jsonrpc-c
+%{_libdir}/kamailio/modules/json.so
+%{_libdir}/kamailio/modules/jsonrpc-c.so
+
+
+%files		lcr
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.lcr
+%{_libdir}/kamailio/modules/lcr.so
+
+
+%files		ldap
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.db2_ldap
+%doc %{_docdir}/kamailio/modules/README.h350
+%doc %{_docdir}/kamailio/modules/README.ldap
+%{_libdir}/kamailio/modules/db2_ldap.so
+%{_libdir}/kamailio/modules/h350.so
+%{_libdir}/kamailio/modules/ldap.so
+
+
+%files		lua
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.app_lua
+%{_libdir}/kamailio/modules/app_lua.so
+
+
+%files		memcached
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.memcached
+%{_libdir}/kamailio/modules/memcached.so
+
+
+%files		mysql
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.db_mysql
+%{_libdir}/kamailio/modules/db_mysql.so
+%{_libdir}/kamailio/kamctl/kamctl.mysql
+%{_libdir}/kamailio/kamctl/kamdbctl.mysql
+%dir %{_datadir}/kamailio/mysql
+%{_datadir}/kamailio/mysql/*
+
+
+%files		outbound
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.outbound
+%{_libdir}/kamailio/modules/outbound.so
+
+
+%files		perl
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.app_perl
+%doc %{_docdir}/kamailio/modules/README.db_perlvdb
+%{_libdir}/kamailio/modules/app_perl.so
+%{_libdir}/kamailio/modules/db_perlvdb.so
+%dir %{_libdir}/kamailio/perl
+%{_libdir}/kamailio/perl/Kamailio.pm
+%dir %{_libdir}/kamailio/perl/Kamailio
+%{_libdir}/kamailio/perl/Kamailio/Constants.pm
+%{_libdir}/kamailio/perl/Kamailio/Message.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB.pm
+%dir %{_libdir}/kamailio/perl/Kamailio/LDAPUtils
+%{_libdir}/kamailio/perl/Kamailio/LDAPUtils/LDAPConf.pm
+%{_libdir}/kamailio/perl/Kamailio/LDAPUtils/LDAPConnection.pm
+%dir %{_libdir}/kamailio/perl/Kamailio/Utils
+%{_libdir}/kamailio/perl/Kamailio/Utils/Debug.pm
+%{_libdir}/kamailio/perl/Kamailio/Utils/PhoneNumbers.pm
+%dir %{_libdir}/kamailio/perl/Kamailio/VDB
+%{_libdir}/kamailio/perl/Kamailio/VDB/Column.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/Pair.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/ReqCond.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/Result.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/VTab.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/Value.pm
+%dir %{_libdir}/kamailio/perl/Kamailio/VDB/Adapter
+%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/AccountingSIPtrace.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/Alias.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/Auth.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/Describe.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/Speeddial.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/TableVersions.pm
+
+
+%files		postgresql
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.db_postgres
+%{_libdir}/kamailio/modules/db_postgres.so
+%{_libdir}/kamailio/kamctl/kamctl.pgsql
+%{_libdir}/kamailio/kamctl/kamdbctl.pgsql
+%dir %{_datadir}/kamailio/postgres
+%{_datadir}/kamailio/postgres/*
+
+
+%files		presence
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.presence
+%doc %{_docdir}/kamailio/modules/README.presence_conference
+%doc %{_docdir}/kamailio/modules/README.presence_dialoginfo
+%doc %{_docdir}/kamailio/modules/README.presence_mwi
+%doc %{_docdir}/kamailio/modules/README.presence_profile
+%doc %{_docdir}/kamailio/modules/README.presence_reginfo
+%doc %{_docdir}/kamailio/modules/README.presence_xml
+%doc %{_docdir}/kamailio/modules/README.pua
+%doc %{_docdir}/kamailio/modules/README.pua_bla
+%doc %{_docdir}/kamailio/modules/README.pua_dialoginfo
+%doc %{_docdir}/kamailio/modules/README.pua_mi
+%doc %{_docdir}/kamailio/modules/README.pua_reginfo
+%doc %{_docdir}/kamailio/modules/README.pua_usrloc
+%doc %{_docdir}/kamailio/modules/README.pua_xmpp
+%doc %{_docdir}/kamailio/modules/README.rls
+%doc %{_docdir}/kamailio/modules/README.xcap_client
+%doc %{_docdir}/kamailio/modules/README.xcap_server
+%{_libdir}/kamailio/modules/presence.so
+%{_libdir}/kamailio/modules/presence_conference.so
+%{_libdir}/kamailio/modules/presence_dialoginfo.so
+%{_libdir}/kamailio/modules/presence_mwi.so
+%{_libdir}/kamailio/modules/presence_profile.so
+%{_libdir}/kamailio/modules/presence_reginfo.so
+%{_libdir}/kamailio/modules/presence_xml.so
+%{_libdir}/kamailio/modules/pua.so
+%{_libdir}/kamailio/modules/pua_bla.so
+%{_libdir}/kamailio/modules/pua_dialoginfo.so
+%{_libdir}/kamailio/modules/pua_mi.so
+%{_libdir}/kamailio/modules/pua_reginfo.so
+%{_libdir}/kamailio/modules/pua_usrloc.so
+%{_libdir}/kamailio/modules/pua_xmpp.so
+%{_libdir}/kamailio/modules/rls.so
+%{_libdir}/kamailio/modules/xcap_client.so
+%{_libdir}/kamailio/modules/xcap_server.so
+
+
+%files		purple
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.purple
+%{_libdir}/kamailio/modules/purple.so
+
+
+%files		python
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.app_python
+%{_libdir}/kamailio/modules/app_python.so
+
+
+%files		radius
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.acc_radius
+%doc %{_docdir}/kamailio/modules/README.auth_radius
+%doc %{_docdir}/kamailio/modules/README.misc_radius
+%doc %{_docdir}/kamailio/modules/README.peering
+%{_libdir}/kamailio/modules/acc_radius.so
+%{_libdir}/kamailio/modules/auth_radius.so
+%{_libdir}/kamailio/modules/misc_radius.so
+%{_libdir}/kamailio/modules/peering.so
+
+
+%files		redis
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.ndb_redis
+%{_libdir}/kamailio/modules/ndb_redis.so
+
+
+%files		regex
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.regex
+%{_libdir}/kamailio/modules/regex.so
+
+
+%files		sctp
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.sctp
+%{_libdir}/kamailio/modules/sctp.so
+
+
+%files		snmpstats
+%defattr(-,root,root)
+%{_docdir}/kamailio/modules/README.snmpstats
+%{_libdir}/kamailio/modules/snmpstats.so
+
+
+%files		sqlite
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.db_sqlite
+%{_libdir}/kamailio/modules/db_sqlite.so
+%{_libdir}/kamailio/kamctl/kamctl.sqlite
+%{_libdir}/kamailio/kamctl/kamdbctl.sqlite
+%dir %{_datadir}/kamailio/db_sqlite
+%{_datadir}/kamailio/db_sqlite/*
+
+
+%files		tls
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.auth_identity
+%doc %{_docdir}/kamailio/modules/README.tls
+%{_libdir}/kamailio/modules/auth_identity.so
+%{_libdir}/kamailio/modules/tls.so
+
+
+%files		unixodbc
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.db_unixodbc
+%{_libdir}/kamailio/modules/db_unixodbc.so
+
+
+%files		utils
+%defattr(-,root,root)
+%{_docdir}/kamailio/modules/README.utils
+%{_libdir}/kamailio/modules/utils.so
+
+
+%files		websocket
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.websocket
+%{_libdir}/kamailio/modules/websocket.so
+
+
+%files		xhttp-pi
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.xhttp_pi
+%{_libdir}/kamailio/modules/xhttp_pi.so
+%dir %{_datadir}/kamailio/xhttp_pi
+%{_datadir}/kamailio/xhttp_pi/*
+
+
+%files		xmlops
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.xmlops
+%{_libdir}/kamailio/modules/xmlops.so
+
+
+%files		xmlrpc
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.xmlrpc
+%{_libdir}/kamailio/modules/xmlrpc.so
+%doc %{_docdir}/kamailio/modules/README.mi_xmlrpc
+%{_libdir}/kamailio/modules/mi_xmlrpc.so
+
+
+%files		xmpp
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.xmpp
+%{_libdir}/kamailio/modules/xmpp.so
+
+
+
+%changelog
+* Mon Oct 7 2013 Peter Dunkley <peter.dunkley at crocodilertc.net>
+  - Consolidating changelog for 4.1.0 into a single entry...
+  - Added new modules to main package:
+    - cnxcc
+    - gzcompress
+    - mohqueue
+    - rtpproxy-ng
+    - sipt
+    - stun (STUN functionality moved from compile time in core to own module)
+  - Added new modules to other packages:
+    - ims_charging module to ims package
+  - Added new packages for new modules:
+    - app_java
+    - auth_ephemeral
+    - sctp (SCTP functionality moved from compile time in core to own module)
+  - Moved existing modules to different packages:
+    - auth_identity to tls package (previously not built for CentOS)
+    - cdp and cdp_avp to ims package
+    - dialog_ng to main package
+    - memcached to own package (previously not built for CentOS)
+    - mi_xmlrpc to own package (previously not built for CentOS)
+    - tls to own package
+  - Added packages for (new and existing) modules that require EPEL:
+    - carrierroute in own package
+    - dnssec in own package
+    - geoip in own package
+    - json and jsonrpc-c in new json package
+    - redis in own package
+    - acc_radius, auth_radius, misc_radius, and peering in new radius package
+  - Removed Fedora stuff as I am only maintaining this for CentOS now
+  - Refactored .spec
+  - Updated make commands to match updated module groups
+  - Updated version to 4.1.0
+* Mon Mar 11 2013 Peter Dunkley <peter.dunkley at crocodilertc.net>
+  - Consolidating changelog for 4.0.0 into a single entry...
+  - Added new modules to main package:
+    - corex
+    - sca
+  - Added new packages for new modules:
+    - cdp (cdp, cdp_avp)
+    - ims (dialog_ng, ims_auth, ims_icscf, ims_isc, ims_qos,
+      ims_registrar_pcscf, ims_registrar_scscf, ims_usrloc_pcscf,
+      ims_usrloc_scscf)
+    - outbound
+    - websocket
+    - xhttp_pi
+  - Moved existing modules to different packages:
+    - Various SER modules added to main package (avp, db2_ops, mangler, timer,
+      uid_auth_db, uid_avp_db, uid_domain, uid_gflags, uid_uri_db, print,
+      print_lib, xprint)
+    - db2_ldap SER module added to ldap package
+    - tls to main package (as OpenSSL was needed in core for STUN)
+  - Moved modules from modules_k/ to modules/
+  - Renamed perl modules
+  - Added installation of auth.7.gz for Fedora now that manpages are built for
+    Fedora
+  - SCTP and STUN now included in this build
+  - Refactored .spec
+  - Updated ver to 4.0.0
+* Mon Jun 18 2012 Peter Dunkley <peter.dunkley at crocodilertc.net>
+  - Consolidating changelog for 3.3.0 into a single entry...
+  - See revision control for details this far back
diff --git a/pkg/kamailio/centos/6/kamailio.sysconfig b/pkg/kamailio/centos/6/kamailio.sysconfig
new file mode 100644
index 0000000..1a7316f
--- /dev/null
+++ b/pkg/kamailio/centos/6/kamailio.sysconfig
@@ -0,0 +1,30 @@
+#
+# Kamailio startup options
+#
+
+# Set to yes to enable kamailio, once configured properly.
+RUN_KAMAILIO=yes
+
+# User to run as
+USER=kamailio
+
+# Group to run as
+GROUP=kamailio
+
+# Amount of shared memory to allocate for the running Kamailio server (in Mb)
+SHM_MEMORY=64
+
+# Amount of per-process (package) memory to allocate for Kamailio (in Mb)
+PKG_MEMORY=4
+
+# Enable the server to leave a core file when it crashes.
+# Set this to 'yes' to enable kamailio to leave a core file when it crashes
+# or 'no' to disable this feature. This option is case sensitive and only
+# accepts 'yes' and 'no' and only in lowercase letters.
+# On some systems (e.g. Ubuntu 6.10, Debian 4.0) it is necessary to specify
+# a directory for the core files to get a dump. Look into the kamailio
+# init file for an example configuration.
+DUMP_CORE=no
+
+# Add extra command line parameters in the EXTRA_OPTIONS variable
+# EXTRA_OPTIONS="-a no"
diff --git a/pkg/kamailio/deb/debian/backports/jessie b/pkg/kamailio/deb/debian/backports/jessie
new file mode 100755
index 0000000..80cd6a6
--- /dev/null
+++ b/pkg/kamailio/deb/debian/backports/jessie
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# Hook for automatic backports at buildserver.net
+#
+# Target dist: Debian Jessie
+DIST=jessie
+
+rm -rf ${DIST}
+cp -r debian ${DIST}
+
+# No mi_xmlrpc module
+sed -i -e '/libxmlrpc-c3-dev/d' -e '/^Package: kamailio-xmlrpc-modules/,/^$/d' \
+	${DIST}/control
+sed -i -e 's/ mi_xmlrpc[ ,$]*/ /' ${DIST}/rules
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ mi_xmlrpc/' ${DIST}/rules
+
+# clean backports scripts
+rm -rf ${DIST}/backports
+exit 0
diff --git a/pkg/kamailio/deb/debian/backports/precise b/pkg/kamailio/deb/debian/backports/precise
new file mode 100755
index 0000000..6cf914a
--- /dev/null
+++ b/pkg/kamailio/deb/debian/backports/precise
@@ -0,0 +1,32 @@
+#!/bin/bash
+#
+# Hook for automatic backports at buildserver.net
+#
+# Target dist: Debian Squeeze
+DIST=precise
+
+rm -rf ${DIST}
+cp -r debian ${DIST}
+
+# No mi_xmlrpc module
+sed -i -e '/libxmlrpc-c3-dev/d' -e '/^Package: kamailio-xmlrpc-modules/,/^$/d' \
+	${DIST}/control
+sed -i -e 's/ mi_xmlrpc[ ,$]*/ /' ${DIST}/rules
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ mi_xmlrpc/' ${DIST}/rules
+
+# No dnssec module:
+sed -i -e '/libval-dev/d' -e '/^Package: kamailio-dnssec-modules/,/^$/d' \
+	${DIST}/control
+sed -i -e 's/ dnssec[ ,$]*/ /' ${DIST}/rules
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ dnssec/' ${DIST}/rules
+
+# use old radius-client-ng
+sed -i 's/libfreeradius-client-dev/libradiusclient-ng-dev/' ${DIST}/control
+sed -i -e '/FREERADIUS/d' ${DIST}/rules
+
+# use old json
+sed -i 's/libjson-c-dev/libjson0-dev/' ${DIST}/control
+
+# clean backports scripts
+rm -rf ${DIST}/backports
+exit 0
diff --git a/pkg/kamailio/deb/debian/backports/squeeze b/pkg/kamailio/deb/debian/backports/squeeze
new file mode 100755
index 0000000..a7f8ba2
--- /dev/null
+++ b/pkg/kamailio/deb/debian/backports/squeeze
@@ -0,0 +1,78 @@
+#!/bin/bash
+#
+# Hook for automatic backports at buildserver.net
+#
+# Target dist: Debian Squeeze
+DIST=squeeze
+
+rm -rf ${DIST}
+cp -r debian ${DIST}
+
+# remove Multi-arch
+sed -i -e 's#^DEB_HOST_MULTIARCH.*$##' -e 's#^LIBDIR ?= lib/$(DEB_HOST_MULTIARCH)#LIBDIR ?= lib#' ${DIST}/rules
+if [ -e ${DIST}/patches/series ]; then
+  sed -i -e 's#multiarch_support.patch#no_lib64_on_64_bits.patch#' ${DIST}/patches/series
+fi
+sed -i -e '/^Multi-Arch: .*/d' ${DIST}/control
+
+# Downgrade to debhelper 8 compat
+sed -i -e  's#debhelper[^,$]*[\ ,$]\+\(.*\)$#debhelper (>= 8), \1#' ${DIST}/control
+echo 8 > ${DIST}/compat
+
+# Hardening flags
+sed -i -e '/dpkg-dev/d' ${DIST}/control
+sed -i -e '/^include.*buildflags.mk/d' -e '/.*dpkg-buildflags --export=configure.*/d' ${DIST}/rules
+if [ -e ${DIST}/patches/series ]; then
+  sed -i -e '/hardening_flags.patch/d' ${DIST}/patches/series
+fi
+
+# No java module:
+sed -i -e '/gcj-jdk/d' -e '/^Package: kamailio-java-modules/,/^$/d' \
+	${DIST}/control
+sed -i -e 's/ java[ ,$]*/ /' ${DIST}/rules
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ java/' ${DIST}/rules
+sed -i -e '/^export JAVA_HOME=.*/d' ${DIST}/rules
+
+# No dnssec module:
+sed -i -e '/libval-dev/d' -e '/^Package: kamailio-dnssec-modules/,/^$/d' \
+	${DIST}/control
+sed -i -e 's/ dnssec[ ,$]*/ /' ${DIST}/rules
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ dnssec/' ${DIST}/rules
+
+# No sctp module:
+sed -i -e '/libsctp-dev/d' -e '/^Package: kamailio-sctp-modules/,/^$/d' \
+	${DIST}/control
+sed -i -e 's/ sctp[ ,$]*/ /' ${DIST}/rules
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ sctp/' ${DIST}/rules
+
+# No purple module:
+sed -i -e '/libpurple-dev/d' -e '/^Package: kamailio-purple-modules/,/^$/d' \
+	${DIST}/control
+sed -i -e 's/ purple[ ,$]*/ /' ${DIST}/rules
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ purple/' ${DIST}/rules
+
+# No libhiredis:
+sed -i -e '/libhiredis-dev/d' -e '/^Package: kamailio-redis-modules/,/^$/d' \
+	${DIST}/control
+sed -i -e 's/ redis[ ,$]*/ /' ${DIST}/rules
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ redis/' ${DIST}/rules
+
+# No mono module
+sed -i -e '/libmono-2.0-dev/d' -e '/^Package: kamailio-mono-modules/,/^$/d' \
+	${DIST}/control
+sed -i -e 's/ mono[ ,$]*/ /' ${DIST}/rules
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ mono/' ${DIST}/rules
+
+# db-util version
+sed -i -e 's/db-util/db4.8-util/' ${DIST}/control
+
+# use old radius-client-ng
+sed -i 's/libfreeradius-client-dev/libradiusclient-ng-dev/' ${DIST}/control
+sed -i -e '/FREERADIUS/d' ${DIST}/rules
+
+# use old json
+sed -i 's/libjson-c-dev/libjson0-dev/' ${DIST}/control
+
+# clean backports scripts
+rm -rf ${DIST}/backports
+exit 0
diff --git a/pkg/kamailio/deb/debian/backports/trusty b/pkg/kamailio/deb/debian/backports/trusty
new file mode 100755
index 0000000..14749aa
--- /dev/null
+++ b/pkg/kamailio/deb/debian/backports/trusty
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# Hook for automatic backports at buildserver.net
+#
+# Target dist: Ubuntu trusty
+DIST=trusty
+
+rm -rf ${DIST}
+cp -r debian ${DIST}
+
+# No mi_xmlrpc module
+sed -i -e '/libxmlrpc-c3-dev/d' -e '/^Package: kamailio-xmlrpc-modules/,/^$/d' \
+	${DIST}/control
+sed -i -e 's/ mi_xmlrpc[ ,$]*/ /' ${DIST}/rules
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ mi_xmlrpc/' ${DIST}/rules
+
+# clean backports scripts
+rm -rf ${DIST}/backports
+exit 0
diff --git a/pkg/kamailio/deb/debian/backports/wheezy b/pkg/kamailio/deb/debian/backports/wheezy
new file mode 100755
index 0000000..ccd1b9d
--- /dev/null
+++ b/pkg/kamailio/deb/debian/backports/wheezy
@@ -0,0 +1,38 @@
+#!/bin/bash
+#
+# Hook for automatic backports at buildserver.net
+#
+# Target dist: Debian Wheezy
+DIST=wheezy
+
+rm -rf ${DIST}
+cp -r debian ${DIST}
+
+# No purple module:
+sed -i -e '/libpurple-dev/d' -e '/^Package: kamailio-purple-modules/,/^$/d' \
+	${DIST}/control
+sed -i -e 's/ purple[ ,$]*/ /' ${DIST}/rules
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ purple/' ${DIST}/rules
+
+# No mi_xmlrpc module
+sed -i -e '/libxmlrpc-c3-dev/d' -e '/^Package: kamailio-xmlrpc-modules/,/^$/d' \
+	${DIST}/control
+sed -i -e 's/ mi_xmlrpc[ ,$]*/ /' ${DIST}/rules
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ mi_xmlrpc/' ${DIST}/rules
+
+# No dnssec module:
+sed -i -e '/libval-dev/d' -e '/^Package: kamailio-dnssec-modules/,/^$/d' \
+	${DIST}/control
+sed -i -e 's/ dnssec[ ,$]*/ /' ${DIST}/rules
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ dnssec/' ${DIST}/rules
+
+# use old radius-client-ng
+sed -i 's/libfreeradius-client-dev/libradiusclient-ng-dev/' ${DIST}/control
+sed -i -e '/FREERADIUS/d' ${DIST}/rules
+
+# use old json
+sed -i 's/libjson-c-dev/libjson0-dev/' ${DIST}/control
+
+# clean backports scripts
+rm -rf ${DIST}/backports
+exit 0
diff --git a/pkg/kamailio/deb/debian/changelog b/pkg/kamailio/deb/debian/changelog
new file mode 100644
index 0000000..d13762c
--- /dev/null
+++ b/pkg/kamailio/deb/debian/changelog
@@ -0,0 +1,118 @@
+kamailio (4.1.5) unstable; urgency=low
+
+  * update to 4.1.5 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Wed, 06 Aug 2014 16:50:20 +0100
+
+kamailio (4.1.4) unstable; urgency=low
+
+  * update to 4.1.4 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 12 Jun 2014 15:55:55 +0100
+
+kamailio (4.1.3) unstable; urgency=low
+
+  * update to 4.1.3 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 24 Apr 2014 10:45:20 +0100
+
+kamailio (4.1.2) unstable; urgency=low
+
+  * update to 4.1.2 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 06 Mar 2014 15:25:35 +0100
+
+kamailio (4.1.1) unstable; urgency=low
+
+  * update to 4.1.1 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 09 Jan 2014 15:45:35 +0100
+
+kamailio (4.1.0) unstable; urgency=low
+
+  * update to 4.1.0
+
+ -- Victor Seva <linuxmaniac at torreviejawireless.org>  Wed, 04 Dec 2013 11:42:27 +0100
+
+kamailio (4.0.0) unstable; urgency=low
+
+  * update to 4.0.0 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Mon, 11 Mar 2013 10:40:30 +0100
+
+kamailio (3.4.0~dev0) unstable; urgency=low
+
+  * update version to 3.4.0~dev0
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Wed, 15 Jun 2012 03:15:00 +0100
+
+kamailio (3.2.0) unstable; urgency=low
+
+  * update to 3.2.0 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Fri, 29 Apr 2011 12:25:30 +0100
+
+kamailio (3.1.1) unstable; urgency=low
+
+  * update to 3.1.1 from upstream
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Fri, 3 Dec 2010 16:30:00 +0100
+
+kamailio (3.1.0) unstable; urgency=low
+
+  * update to 3.1.0 from upstream
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Wed, 6 Oct 2010 17:24:00 +0100
+
+kamailio (3.0.2.99) unstable; urgency=low
+
+  * update to 3.0.2.99 for development version builds
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Fri, 28 May 2010 22:26:00 +0100
+
+kamailio (3.0.2) unstable; urgency=low
+
+  * update to 3.0.2 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 27 May 2010 10:27:36 +0100
+
+kamailio (3.0.1) unstable; urgency=low
+
+  * update to 3.0.1 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Mon, 08 Mar 2010 20:30:48 +0100
+
+kamailio (3.0.0) unstable; urgency=low
+
+  * update to 3.0.0 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Mon, 11 Jan 2010 18:30:42 +0100
+
+kamailio (3.0.0-rc3) unstable; urgency=low
+
+  * update to 3.0.0-rc3 from upstream
+  * updated debian/rules to work with the SIP Router style module packaging
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Fri, 10 Dec 2009 12:10:02 +0100
+
+kamailio (3.0.0-rc2) unstable; urgency=low
+
+  * update to 3.0.0-rc2 from upstream
+  * updated debian/rules to work with the new style module packaging
+
+ -- Jonas Bergler <jonas.bergler at staff.snap.net.nz>  Wed, 18 Nov 2009 12:30:02 +1300
+
+kamailio (1.5.0-svn1) unstable; urgency=low
+
+  * increment debian packaging for trunk
+
+ -- Henning Westerholt <henning.westerholt at 1und1.de>  Mon, 02 Mar 2009 17:40:02 +0100
+
+kamailio (1.4.0-svn1) unstable; urgency=low
+
+  [ Klaus Darilion ]
+  * first release of Kamailio (after renaming from Openser)
+
+ -- Julien BLACHE <jblache at debian.org>  Wed, 12 Dec 2007 17:25:31 +0100
+
+
diff --git a/pkg/kamailio/deb/debian/compat b/pkg/kamailio/deb/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/pkg/kamailio/deb/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/pkg/kamailio/deb/debian/control b/pkg/kamailio/deb/debian/control
new file mode 100644
index 0000000..9dffb14
--- /dev/null
+++ b/pkg/kamailio/deb/debian/control
@@ -0,0 +1,570 @@
+Source: kamailio
+Section: net
+Priority: optional
+Maintainer: Debian VoIP Team <pkg-voip-maintainers at lists.alioth.debian.org>
+Uploaders: Victor Seva <linuxmaniac at torreviejawireless.org>,
+           Tzafrir Cohen <tzafrir at debian.org>
+Build-Depends: bison,
+               debhelper (>= 9),
+               docbook-xml,
+               dpkg-dev (>= 1.16.1.1),
+               flex,
+               gcj-jdk,
+               libconfuse-dev,
+               libcurl4-openssl-dev,
+               libdb-dev (>= 4.6.19),
+               libevent-dev,
+               libexpat1-dev,
+               libfreeradius-client-dev,
+               libgeoip-dev (>= 1.4.5),
+               libhiredis-dev (>= 0.10.0),
+               libjson-c-dev,
+               libldap2-dev,
+               liblua5.1-0-dev,
+               libmemcached-dev,
+               libmono-2.0-dev,
+               libmysqlclient-dev,
+               libncurses5-dev,
+               libpcre3-dev,
+               libperl-dev,
+               libpq-dev,
+               libpurple-dev,
+               libreadline-dev,
+               libsasl2-dev,
+               libsctp-dev,
+               libsnmp-dev,
+               libsqlite3-dev,
+               libunistring-dev,
+               libval-dev,
+               libxml2-dev,
+               libxmlrpc-c3-dev,
+               openssl,
+               python,
+               python-dev,
+               unixodbc-dev,
+               xsltproc,
+               zlib1g-dev
+Standards-Version: 3.9.5
+Homepage: http://www.kamailio.org/
+Vcs-git: git://anonscm.debian.org/pkg-voip/kamailio.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-voip/kamailio.git
+
+Package: kamailio
+Architecture: linux-any
+Multi-Arch: foreign
+Pre-Depends: ${misc:Pre-Depends}
+Depends: adduser, python, ${misc:Depends}, ${shlibs:Depends}
+Suggests: kamailio-berkeley-modules,
+          kamailio-carrierroute-modules,
+          kamailio-cpl-modules,
+          kamailio-dbg,
+          kamailio-ldap-modules,
+          kamailio-lua-modules,
+          kamailio-mysql-modules,
+          kamailio-perl-modules,
+          kamailio-postgres-modules,
+          kamailio-presence-modules,
+          kamailio-python-modules,
+          kamailio-radius-modules,
+          kamailio-snmpstats-modules,
+          kamailio-tls-modules,
+          kamailio-unixodbc-modules,
+          kamailio-xml-modules,
+          kamailio-xmpp-modules
+Description: very fast and configurable SIP proxy
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ C Shell-like scripting language provides full control over the server's
+ behaviour. Its modular architecture allows only required functionality to be
+ loaded.
+ .
+ Among others, the following modules are available: digest authentication, CPL
+ scripts, instant messaging, MySQL support, presence agent, RADIUS
+ authentication, record routing, SMS gateway, Jabber/XMPP gateway, transaction
+ module, registrar and user location, XML-RPC interface.
+ .
+ This package contains the main Kamailio binary along with the principal modules
+ and support binaries.
+
+Package: kamailio-dbg
+Priority: extra
+Section: debug
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}
+Description: very fast and configurable SIP proxy [debug symbols]
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains the debugging symbols for the Kamailio binaries and
+ modules. You only need to install it if you need to debug Kamailio.
+
+Package: kamailio-geoip-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the geoip module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the geoip module, an extension allowing to
+ use GeoIP API within configuration file.
+
+Package: kamailio-sqlite-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Recommends: sqlite3
+Description: SQLite database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the SQLite database driver for Kamailio.
+
+Package: kamailio-json-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Json parser and jsonrpc modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides json parser for Kamailio's configuration file
+ and the JSON-RPC client over netstrings.
+
+Package: kamailio-memcached-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Replaces: kamailio-memcached-module
+Description: Provides the memcached module, an interface to the memcached server
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the memcached module, an interface to the memcached
+ server, a high-performance, distributed memory object caching system.
+
+Package: kamailio-lua-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the app_lua module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_lua module, an extension allowing to
+ execute embedded Lua applications within configuration file.
+
+Package: kamailio-mono-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the app_mono module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_mono module, an extension allowing to
+ execute embedded Mono applications within configuration file.
+
+Package: kamailio-python-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         python-dev,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: contains the app_python module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_python module, an extension allowing to
+ execute embedded Python applications within configuration file.
+
+Package: kamailio-redis-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Redis database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the Redis NOSQL database driver for Kamailio.
+
+Package: kamailio-mysql-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         mysql-client,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: MySQL database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the MySQL database driver for Kamailio.
+
+Package: kamailio-postgres-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         postgresql-client,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: PostgreSQL database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the PostgreSQL database driver for Kamailio.
+
+Package: kamailio-cpl-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: CPL module (CPL interpreter engine) for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides a CPL (Call Processing Language) interpreter for
+ Kamailio, turning Kamailio into a CPL server (storage and interpreter).
+
+Package: kamailio-radius-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: RADIUS modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides a set of RADIUS modules for Kamailio, for
+ authentication, peering, group membership and messages URIs checking against a
+ RADIUS server.
+
+Package: kamailio-unixodbc-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: unixODBC database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the unixODBC database driver for Kamailio.
+
+Package: kamailio-presence-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: SIMPLE presence modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides several Kamailio modules for implementing presence
+ server and presence user agent for RICH presence, registrar-based presence,
+ external triggered presence and XCAP support.
+
+Package: kamailio-perl-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Perl extensions and database driver for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides an interface for Kamailio to write Perl extensions and
+ the perlvdb database driver for Kamailio.
+
+Package: kamailio-snmpstats-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         snmpd,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: SNMP AgentX subagent module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the snmpstats module for Kamailio. This module acts
+ as an AgentX subagent which connects to a master agent.
+
+Package: kamailio-purple-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Provides the purple module, a multi-protocol IM gateway
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the purple module, a multi-protocol instant
+ messaging gateway module.
+
+Package: kamailio-xmpp-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: XMPP gateway module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the SIP to XMPP IM translator module for Kamailio.
+
+Package: kamailio-xml-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Replaces: kamailio-xml-module, kamailio-xmlrpc-module
+Provides: kamailio-xmlrpc-modules
+Description: XML based extensions for Kamailio's Management Interface
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides:
+ - the XMLRPC transport implementations for Kamailio's
+ Management and Control Interface.
+ - xmlops module for XPath operations in configuration file
+
+Package: kamailio-carrierroute-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: carrierroute module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the carrierroute module for Kamailio, an integrated
+ solution for routing, balancing and blacklisting.
+
+Package: kamailio-berkeley-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: db5.1-util,
+         kamailio (= ${binary:Version}),
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: Berkeley database module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the Berkeley database module for Kamailio, a
+ high-performance embedded DB kernel. All database tables are stored
+ in files, no additional server is necessary.
+
+Package: kamailio-berkeley-bin
+Architecture: linux-any
+Multi-Arch: foreign
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: Berkeley database module for Kamailio - helper program
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides helper modules for the Berkeley database module for
+ Kamailio, a high-performance embedded DB kernel. You should normally
+ install kamailio-berkeley-modules and not this package directly.
+
+Package: kamailio-ldap-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: LDAP modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the ldap and h350 modules for Kamailio, enabling LDAP
+ queries from the Kamailio config and storage of SIP account data in an LDAP
+ directory.
+
+Package: kamailio-ims-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: IMS module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains various Diameter interfaces and modules for Kamailio
+ to run as an IMS core.
+
+Package: kamailio-utils-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Provides a set utility functions for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ Provides a set of utility functions for Kamailio, which are not related
+ to the server configuration.
+
+Package: kamailio-sctp-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: sctp module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the sctp module for Kamailio.
+
+Package: kamailio-java-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: gcj-jre,
+         kamailio (= ${binary:Version}),
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: contains the app_java module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_java module, an extension allowing to
+ execute embedded Java applications within configuration file.
+
+Package: kamailio-tls-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the TLS kamailio transport module
+ This has been split out of the main kamailio package, so that kamailio will
+ not depend on openssl. This module will enable you to use the TLS transport.
+
+Package: kamailio-outbound-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Outbound module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains the module implementing SIP outbound extension.
+
+Package: kamailio-websocket-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Websocket module for kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains the module implementing WebSocket transport layer.
+
+Package: kamailio-dnssec-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the dnssec module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the dnssec module for Kamailio.
+
+Package: kamailio-autheph-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: authentication using ephemeral credentials module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the ephemeral module for Kamailio.
+
+Package: kamailio-extra-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: extra modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides: gzcompress
+
+Package: kamailio-nth
+Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: binutils,
+         bison,
+         bvi,
+         flex,
+         gcc,
+         gdb,
+         iftop,
+         lsof,
+         mc,
+         most,
+         ngrep,
+         psmisc,
+         screen,
+         sipsak,
+         tcpdump,
+         vim,
+         ${misc:Depends}
+Description: Kamailio - package for "nice to have" installation
+ This is a metapackage for easy installation various useful tools that may be
+ handy on server with Kamailio installed.
diff --git a/pkg/kamailio/deb/debian/copyright b/pkg/kamailio/deb/debian/copyright
new file mode 100644
index 0000000..ff31338
--- /dev/null
+++ b/pkg/kamailio/deb/debian/copyright
@@ -0,0 +1,335 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Kamailio
+Upstream-Contact: sr-dev at lists.sip-router.org
+Source: http://www.kamailio.org/pub/kamailio/
+
+Files: *
+Copyright:
+ 2001-2003 FhG Fokus
+ 2006-2010 iptelorg GmbH
+ Various others (see AUTHORS file)
+License: GPL-2.0+
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+
+Files: debian/*
+Copyright: 2012, 2013, 2014 Victor Seva <linuxmaniac at torreviejawireless.org>
+           2009, 2010, 2011, Daniel-Constantin Mierla <miconda at gmail.com>
+           2010, Jon Bonilla <manwe at aholab.ehu.es>
+           2009, Jonas Bergler <jonas.bergler at staff.snap.net.nz>
+           2009, Henning Westerholt <henning.westerholt at 1und1.de>
+           2007, Julien BLACHE <jblache at debian.org>
+License: GPL-2+
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+
+
+Files: atomic/* atomic_ops.* basex.* bit_*.c char_msg_val.h compiler_opt.h
+ core_stats.h counters.* endianness.* futexlock.h hashes.h io_wait.*
+ kstats_types.h lib/kcore/kstats_wrapper.* lock_ops.c lock_ops_init.h
+ lvalue.* mem/ll_malloc.* mem/memdbg.h mem/sf_malloc.* mi/*.h mod_fix.*
+ modules/tm/rpc_uac.* modules/counters/counters.c modules/tls/sbufq.h
+ modules/tls/tls_bio.* modules/tls/tls_cfg.* modules/tls/tls_cfg.h
+ modules/tls/tls_ct_wrq.* modules/tls/tls_ct_q.h modules/tls/tls_domain.*
+ modules/tls/tls_server.h modules/tls/tls_locking.* modules/tls/tls_rpc.*
+ modules/tls/tls_server.c modules/malloc_test/malloc_test.c modules/blst/blst.c
+ parser/case_p_* parser/case_reas.h pvapi.h pv_core.* rand/fastrand.* raw_*
+ rpc_lookup.* rvalue.* sctp_* ser_time.h shm_init.* sip_msg_clone.* sock_ut.*
+ sr_compat.* str_hash.h switch.* tcp_ev.h tcp_int_send.h tcp_options.*
+ tcp_read.h tcp_stats.* timer_proc.* tls_hooks.* tls_hooks_init.h ver.*
+Copyright: 2006-2010 iptelorg GmbH
+License: ISC
+
+Files: modules/tls/tls_select.* modules/tls/tls_dump_vf.*
+Copyright: 2005-2010 iptelorg GmbH
+License: GPL-2 + OpenSSL exception
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+ * Exception: permission to copy, modify, propagate, and distribute a work
+ * formed by combining OpenSSL toolkit software and the code in this file,
+ * such as linking with software components and libraries released under
+ * OpenSSL project license.
+
+Files: modules/websocket/* modules/outbound/* modules/auth_ephemeral/*
+Copyright: 2012-2013 Crocodile RCS Ltd
+License: GPL-2 + OpenSSL exception
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+ * Exception: permission to copy, modify, propagate, and distribute a work
+ * formed by combining OpenSSL toolkit software and the code in this file,
+ * such as linking with software components and libraries released under
+ * OpenSSL project license.
+
+Files: daemonize.* fastlock.h lock_ops.h mem/mem.* mem/f_malloc.h
+ mem/meminfo.h mem/memtest.c mem/shm_mem.c mem/q_malloc.h mem/q_malloc.c
+ mem/shm_mem.h mem/f_malloc.c modules/tls/tls_rpc.c modules/tls/tls_server.c
+ modules/tls/tls_domain.c modules/tls/tls_domain.h modules/tls/tls_server.h
+ modules/tls/tls_rpc.h pt.c pt.h sched_yield.h ut.c ut.h
+Copyright: 2001-2003 FhG Fokus
+License: ISC
+
+Files: events.* modules/topoh/*
+Copyright: 2009 SIP-Router.org
+License: ISC
+
+Files: modules/mi_rpc/mi_rpc_mod.c modules/pv/pv_xavp.*
+ modules/usrloc/ul_rpc.* ppcfg.* xavp.*
+Copyright: 2009-2010 Daniel-Constantin Mierla (asipto.com)
+License: ISC
+
+Files: obsolete/jabber_k/tree234.*
+Copyright: 1999, 2000, 2001, Simon Tatham
+License: Expat
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or
+ sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+ .
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT.  IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+
+Files: modules/xmpp/xsnprintf.c obsolete/jabber_s/xsnprintf.c obsolete/jabber_k/xsnprintf.c
+Copyright: 1995-1998, The Apache Group
+License: Apache-1.0
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ .
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+ .
+ 3. All advertising materials mentioning features or use of this
+    software must display the following acknowledgment:
+    "This product includes software developed by the Apache Group
+    for use in the Apache HTTP server project (http://www.apache.org/)."
+ .
+ 4. The names "Apache Server" and "Apache Group" must not be used to
+    endorse or promote products derived from this software without
+    prior written permission.
+ .
+ 5. Redistributions of any form whatsoever must retain the following
+    acknowledgment:
+    "This product includes software developed by the Apache Group
+    for use in the Apache HTTP server project (http://www.apache.org/)."
+ .
+ THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
+ EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Files: modules/mi_xmlrpc/abyss*
+Copyright: 2000, Moez Mahfoudh <mmoez at bigfoot.com>
+License: BSD-3-clause
+
+Files: list.h
+Copyright: 1991, 1993 The Regents of the University of California
+License: BSD-3-clause
+
+Files: modules/tm/t_serial.*
+Copyright: 2008 Juha Heinanen
+License: BSD-2-clause
+
+Files: parser/sdp/sdp.* parser/sdp/sdp_helpr_funcs.* parser/sdp/sdp_cloner.h
+Copyright:
+ 2008-2009 SOMA Networks, INC.
+ 2010 VoIP Embedded, Inc
+License: BSD-2-clause
+
+Files: modules/tls/fixed_c_zlib.h
+Copyright:1998-2005 The OpenSSL Project
+Comment: file copied from OpenSSL 0.9.8, refers to OpenSSL License. Note that
+ this code will not build by default in the Debian packaging.
+License: OpenSSL
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ .
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+ .
+ 3. All advertising materials mentioning features or use of this
+    software must display the following acknowledgment:
+    "This product includes software developed by the OpenSSL Project
+    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ .
+ 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+    endorse or promote products derived from this software without
+    prior written permission. For written permission, please contact
+    openssl-core at openssl.org.
+ .
+ 5. Products derived from this software may not be called "OpenSSL"
+    nor may "OpenSSL" appear in their names without prior written
+    permission of the OpenSSL Project.
+ .
+ 6. Redistributions of any form whatsoever must retain the following
+    acknowledgment:
+    "This product includes software developed by the OpenSSL Project
+    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ .
+ THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Files: md5.* md5utils.c
+Copyright: 1991-2, RSA Data Security, Inc
+Comment: Note that md5.c and md5.h have been replaced in the patches
+ plum_md5*.patch .
+ .
+ As for md5utils.c, according to a mail from Upstream (Daniel-Constantin
+ Mierla): while the initial commit log for it states that it is derived
+ from mddriver.c of RFC 1321, it seems that it was, in fact, written from
+ scratch by Jiri Kuthan (a core developer of SER at that time, working for
+ FhG Fokus Institute). As you can see it's rather trivial and uses a data
+ type of SER ("str").  I didn't reimplement it as it's too trivial and
+ looks like there's no other way to implement it.
+License: RSA-MD5
+ License to copy and use this software is granted provided that it
+ is identified as the "RSA Data Security, Inc. MD5 Message-Digest
+ Algorithm" in all material mentioning or referencing this software
+ or this function.
+ .
+ License is also granted to make and use derivative works provided
+ that such works are identified as "derived from the RSA Data
+ Security, Inc. MD5 Message-Digest Algorithm" in all material
+ mentioning or referencing the derived work.
+ .
+ RSA Data Security, Inc. makes no representations concerning either
+ the merchantability of this software or the suitability of this
+ software for any particular purpose. It is provided "as is"
+ without express or implied warranty of any kind.
+ .
+ These notices must be retained in any copies of any part of this
+ documentation and/or software.
+
+Files: mem/dl_*
+Copyright: n/a
+License: public-domain
+ This is a version (aka dlmalloc) of malloc/free/realloc written by
+ Doug Lea and released to the public domain, as explained at
+ http://creativecommons.org/licenses/publicdomain.  Send questions,
+ comments, complaints, performance data, etc to dl at cs.oswego.edu
+
+Files: rand/isaac/*
+Copyright: n/a
+License: public-domain
+ By Bob Jenkins.  My random number generator, ISAAC.  Public Domain.
+
+License: ISC
+ Permission to use, copy, modify, and distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Files: lib/srutils/srjson.*
+Copyright: 2009 Dave Gamble
+License: MIT
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ ,
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+
+License: BSD-3-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 4. Neither the name of the University nor the names of its contributors
+    may be used to endorse or promote products derived from this software
+    without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+License: BSD-2-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ .
+  1. Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/pkg/kamailio/deb/debian/kamailio-autheph-modules.lintian-overrides b/pkg/kamailio/deb/debian/kamailio-autheph-modules.lintian-overrides
new file mode 100644
index 0000000..dcb3d18
--- /dev/null
+++ b/pkg/kamailio/deb/debian/kamailio-autheph-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-autheph-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/debian/kamailio-berkeley-bin.dirs b/pkg/kamailio/deb/debian/kamailio-berkeley-bin.dirs
new file mode 100644
index 0000000..236670a
--- /dev/null
+++ b/pkg/kamailio/deb/debian/kamailio-berkeley-bin.dirs
@@ -0,0 +1 @@
+usr/sbin
diff --git a/pkg/kamailio/deb/debian/kamailio-dnssec-modules.lintian-overrides b/pkg/kamailio/deb/debian/kamailio-dnssec-modules.lintian-overrides
new file mode 100644
index 0000000..10165fe
--- /dev/null
+++ b/pkg/kamailio/deb/debian/kamailio-dnssec-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-dnssec-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/debian/kamailio-outbound-modules.lintian-overrides b/pkg/kamailio/deb/debian/kamailio-outbound-modules.lintian-overrides
new file mode 100644
index 0000000..3050cfe
--- /dev/null
+++ b/pkg/kamailio/deb/debian/kamailio-outbound-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-outbound-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/debian/kamailio-tls-modules.lintian-overrides b/pkg/kamailio/deb/debian/kamailio-tls-modules.lintian-overrides
new file mode 100644
index 0000000..bbe0d37
--- /dev/null
+++ b/pkg/kamailio/deb/debian/kamailio-tls-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/debian/kamailio-websocket-modules.lintian-overrides b/pkg/kamailio/deb/debian/kamailio-websocket-modules.lintian-overrides
new file mode 100644
index 0000000..8f384fb
--- /dev/null
+++ b/pkg/kamailio/deb/debian/kamailio-websocket-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-websocket-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/debian/kamailio.README.Debian b/pkg/kamailio/deb/debian/kamailio.README.Debian
new file mode 100644
index 0000000..d25769a
--- /dev/null
+++ b/pkg/kamailio/deb/debian/kamailio.README.Debian
@@ -0,0 +1,39 @@
+Kamailio for Debian
+-------------------
+
+* init script check for fork=no
+-------------------------------
+
+The Kamailio init script will not start Kamailio on boot if fork=no is
+specified in the config file. The check in the initscript will match
+any occurrence of fork=no in the file, even inside C-style comments.
+
+You can disable this check in the init script if you wish; just comment
+out the calls to the check_fork function in the script. Your changes to
+the init script will be preserved upon upgrade, as the file is tagged
+as a conffile.
+
+
+* Kamailio setup
+----------------
+
+To setup Kamailio, you need to:
+ - configure Kamailio properly to suit your needs
+ - edit /etc/default/kamailio, adjust the MEMORY parameter and set
+   RUN_KAMAILIO to "yes"
+
+If you are building an HA cluster using heartbeat or similar, you'll want
+to disable the init script by running:
+
+  update-rc.d kamailio remove
+
+so that Kamailio will not be launched at system startup. You still need
+to set RUN_KAMAILIO to "yes" if you want to use the /etc/init.d/kamailio init
+script.
+
+Set the DUMP_CORE parameter in /etc/default/kamailio to "yes" if you want to
+get a core dump in case Kamailio crashes. The debug symbols for Kamailio are
+provided by the kamailio-dbg package.
+
+
+ -- Victor Seva <linuxmaniac at torreviejawireless.org>  Wed, 11 Dec 2013 16:07:11 +0100
diff --git a/pkg/kamailio/deb/debian/kamailio.default b/pkg/kamailio/deb/debian/kamailio.default
new file mode 100644
index 0000000..0cfc8c8
--- /dev/null
+++ b/pkg/kamailio/deb/debian/kamailio.default
@@ -0,0 +1,28 @@
+#
+# Kamailio startup options
+#
+
+# Set to yes to enable kamailio, once configured properly.
+#RUN_KAMAILIO=yes
+
+# User to run as
+#USER=kamailio
+
+# Group to run as
+#GROUP=kamailio
+
+# Amount of shared and private memory to allocate
+# for the running Kamailio server (in Mb)
+#SHM_MEMORY=64
+#PKG_MEMORY=4
+
+# Config file
+#CFGFILE=/etc/kamailio/kamailio.cfg
+
+# Enable the server to leave a core file when it crashes.
+# Set this to 'yes' to enable Kamailio to leave a core file when it crashes
+# or 'no' to disable this feature. This option is case sensitive and only
+# accepts 'yes' and 'no' and only in lowercase letters.
+# On some systems it is necessary to specify a directory for the core files
+# to get a dump. Look into the kamailio init file for an example configuration.
+#DUMP_CORE=yes
diff --git a/pkg/kamailio/deb/debian/kamailio.examples b/pkg/kamailio/deb/debian/kamailio.examples
new file mode 100644
index 0000000..c48447a
--- /dev/null
+++ b/pkg/kamailio/deb/debian/kamailio.examples
@@ -0,0 +1,2 @@
+examples/*
+
diff --git a/pkg/kamailio/deb/debian/kamailio.init b/pkg/kamailio/deb/debian/kamailio.init
new file mode 100644
index 0000000..d4801d2
--- /dev/null
+++ b/pkg/kamailio/deb/debian/kamailio.init
@@ -0,0 +1,162 @@
+#! /bin/sh
+#
+### BEGIN INIT INFO
+# Provides:          kamailio
+# Required-Start:    $syslog $network $local_fs $remote_fs $time
+# Should-Start:      $named slapd mysql postgresql snmpd radiusd
+# Should-Stop:       $named slapd mysql postgresql snmpd radiusd
+# Required-Stop:     $syslog $network $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start the Kamailio SIP proxy server
+# Description:       Start the Kamailio SIP proxy server
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/kamailio
+NAME=kamailio
+DESC="Kamailio SIP server"
+HOMEDIR=/var/run/kamailio
+PIDFILE=$HOMEDIR/$NAME.pid
+DEFAULTS=/etc/default/kamailio
+CFGFILE=/etc/kamailio/kamailio.cfg
+RUN_KAMAILIO=no
+USER=kamailio
+GROUP=kamailio
+# Amount of shared and private memory to allocate
+# for the running Kamailio server (in Mb)
+SHM_MEMORY=64
+PKG_MEMORY=4
+DUMP_CORE=no
+
+# Do not start kamailio if fork=no is set in the config file
+# otherwise the boot process will just stop
+check_fork ()
+{
+    if grep -q "^[[:space:]]*fork[[:space:]]*=[[:space:]]*no.*" $CFGFILE; then
+	log_failure_msg "Not starting $DESC: fork=no specified in config file; run /etc/init.d/kamailio debug instead"
+	exit 0
+    fi
+}
+
+check_kamailio_config ()
+{
+	# Check if kamailio configuration is valid before starting the server
+	set +e
+	out=$($DAEMON -f $CFGFILE -M $PKG_MEMORY -c 2>&1 > /dev/null)
+	retcode=$?
+	set -e
+	if [ "$retcode" != '0' ]; then
+	    log_failure_msg "Not starting $DESC: invalid configuration file!"
+	    log_failure_msg
+	    log_failure_msg "$out"
+	    log_failure_msg
+	    exit 1
+	fi
+}
+
+create_radius_seqfile ()
+{
+    # Create a radius sequence file to be used by the radius client if
+    # radius accounting is enabled. This is needed to avoid any issue
+    # with the file not being writable if kamailio first starts as user
+    # root because DUMP_CORE is enabled and creates this file as user
+    # root and then later it switches back to user kamailio and cannot
+    # write to the file. If the file exists before kamailio starts, it
+    # won't change it's ownership and will be writable for both root
+    # and kamailio, no matter what options are chosen at install time
+    RADIUS_SEQ_FILE=/var/run/kamailio/kamailio_radius.seq
+    if [ -d /var/run/kamailio ]; then
+	chown ${USER}:${GROUP} /var/run/kamailio
+
+	if [ ! -f $RADIUS_SEQ_FILE ]; then
+	    touch $RADIUS_SEQ_FILE
+	fi
+
+	chown ${USER}:${GROUP} $RADIUS_SEQ_FILE
+	chmod 660 $RADIUS_SEQ_FILE
+    fi
+}
+
+test -f $DAEMON || exit 0
+
+# Load startup options if available
+if [ -f $DEFAULTS ]; then
+   . $DEFAULTS || true
+fi
+
+if [ "$RUN_KAMAILIO" != "yes" ]; then
+    log_failure_msg "Kamailio not yet configured. Edit /etc/default/kamailio first."
+    exit 0
+fi
+
+set -e
+
+SHM_MEMORY=$((`echo $SHM_MEMORY | sed -e 's/[^0-9]//g'`))
+PKG_MEMORY=$((`echo $PKG_MEMORY | sed -e 's/[^0-9]//g'`))
+[ -z "$USER" ]  && USER=kamailio
+[ -z "$GROUP" ] && GROUP=kamailio
+[ $SHM_MEMORY -le 0 ] && SHM_MEMORY=64
+[ $PKG_MEMORY -le 0 ] && PKG_MEMORY=4
+
+if test "$DUMP_CORE" = "yes" ; then
+    # set proper ulimit
+    ulimit -c unlimited
+
+    # directory for the core dump files
+    # COREDIR=/home/corefiles
+    # [ -d $COREDIR ] || mkdir $COREDIR
+    # chmod 777 $COREDIR
+    # echo "$COREDIR/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
+fi
+
+# /var/run can be a tmpfs
+if [ ! -d $HOMEDIR ]; then
+    mkdir -p $HOMEDIR
+fi
+
+OPTIONS="-f $CFGFILE -P $PIDFILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP"
+
+case "$1" in
+  start|debug)
+	check_kamailio_config
+	create_radius_seqfile
+
+	if [ "$1" != "debug" ]; then
+	    check_fork
+	fi
+
+	log_daemon_msg "Starting $DESC: $NAME"
+	start-stop-daemon --start --quiet --pidfile $PIDFILE \
+		--exec $DAEMON -- $OPTIONS || log_failure_msg " already running"
+	log_end_msg 0
+	;;
+  stop)
+	log_daemon_msg "Stopping $DESC: $NAME"
+	start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
+		--exec $DAEMON
+	log_end_msg 0
+	;;
+  restart|force-reload)
+	check_kamailio_config
+	create_radius_seqfile
+
+	$0 stop
+	sleep 1
+	$0 start
+	;;
+  status)
+	log_daemon_msg "Status of $DESC: "
+
+	status_of_proc -p"$PIDFILE" $NAME $NAME
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload|status|debug}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/pkg/kamailio/deb/debian/kamailio.lintian-overrides b/pkg/kamailio/deb/debian/kamailio.lintian-overrides
new file mode 100644
index 0000000..18152ed
--- /dev/null
+++ b/pkg/kamailio/deb/debian/kamailio.lintian-overrides
@@ -0,0 +1,2 @@
+kamailio binary: example-interpreter-not-absolute usr/share/doc/kamailio/examples/outbound/edge.cfg #!KAMAILIO
+kamailio binary: example-interpreter-not-absolute usr/share/doc/kamailio/examples/outbound/registrar.cfg #!KAMAILIO
diff --git a/pkg/kamailio/deb/debian/kamailio.postinst b/pkg/kamailio/deb/debian/kamailio.postinst
new file mode 100644
index 0000000..4ee38ec
--- /dev/null
+++ b/pkg/kamailio/deb/debian/kamailio.postinst
@@ -0,0 +1,24 @@
+#! /bin/sh
+
+set -e
+
+case "$1" in
+    configure)
+        adduser --quiet --system --group --disabled-password \
+                --shell /bin/false --gecos "Kamailio SIP Server" \
+                --home /var/run/kamailio kamailio || true
+
+        ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+        ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+        ;;
+esac
+
+#DEBHELPER#
+
diff --git a/pkg/kamailio/deb/debian/rules b/pkg/kamailio/deb/debian/rules
new file mode 100755
index 0000000..0e80348
--- /dev/null
+++ b/pkg/kamailio/deb/debian/rules
@@ -0,0 +1,220 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+DEBVERSION:=$(shell head -n 1 debian/changelog \
+                    | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
+UPVERSION:=$(shell dpkg-parsechangelog | sed -ne 's/^Version: \(\([0-9]\+\):\)\?\(.*\)-.*/\3/p')
+
+FILENAME := kamailio_$(UPVERSION).orig.tar.gz
+URL := http://www.kamailio.org/pub/kamailio/$(UPVERSION)/src/kamailio-$(UPVERSION)_src.tar.gz
+
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/buildflags.mk
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+export JAVA_HOME=/usr/lib/jvm/java-gcj
+
+# choose freeradius
+export FREERADIUS=1
+
+# modules not in the "main" kamailio package
+EXCLUDED_MODULES=
+
+# extra modules to skip, because they are not compilable now
+# - regardless if they go to the main kamailio package or to some module package,
+# they will be excluded from compile and install of all
+EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy
+
+# module groups that are packaged in seperate packages
+# (with the name kamailio-$(group_name)-modules)
+# Note: the order is important (should be in dependency order, the one
+# on which other depend first)
+PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \
+			   ldap xml perl utils lua memcached \
+			   snmpstats carrierroute xmpp cpl redis python geoip\
+			   sqlite json mono ims sctp java \
+			   purple tls outbound websocket autheph dnssec
+
+# module groups to be packaged onto kamailio-extra-modules
+EXTRA_GROUPS=gzcompress
+
+# name of libdir in the path for libraries (e.g., lib for 32b, lib64 for 64b)
+LIBDIR ?= lib/$(DEB_HOST_MULTIARCH)
+
+# directories with possible duplicate libraries (that should be deleted
+# from current module* packages)
+DUP_LIBS_DIRS=$(CURDIR)/debian/kamailio/usr/$(LIBDIR)/kamailio \
+			$(CURDIR)/debian/kamailio-db-modules/usr/$(LIBDIR)/kamailio
+
+# "function" to get package short name out of a dir/module_name
+# it also transforms db_foo into foo
+mod_name=$(subst db_,,$(lastword $(subst /, ,$(1))))
+
+define PACKAGE_GRP_BUILD_template
+	# package all the modules in PACKAGE_GROUPS in separate packages
+	$(foreach grp,$(PACKAGE_GROUPS EXTRA_GROUPS),\
+		$(MAKE) every-module group_include="k$(grp)"
+	)
+endef
+
+
+define PACKAGE_GRP_INSTALL_template
+	$(foreach grp,$(PACKAGE_GROUPS),\
+		$(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \
+		basedir=$(CURDIR)/debian/kamailio-$(grp)-modules \
+		cfg_prefix=$(CURDIR)/debian/kamailio-$(grp)-modules \
+		doc-dir=share/doc/kamailio-$(grp)-modules
+		# eliminate duplicate libs
+		-for d in $(DUP_LIBS_DIRS); do \
+			test "$$d" != "$(CURDIR)/debian/kamailio-$(grp)-modules/usr/$(LIBDIR)/kamailio" &&\
+			for r in `find $$d -name 'lib*'|xargs`; do \
+				echo "removing $(grp) lib `basename $$r` present also in $$d";\
+				rm -f $(CURDIR)/debian/kamailio-$(grp)-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \
+			done ; \
+		done
+		find $(CURDIR)/debian/kamailio-$(grp)-modules -depth -empty -type d -exec rmdir {} \;
+	)
+endef
+
+define PACKAGE_EXTRA_INSTALL_template
+	$(foreach grp,$(EXTRA_GROUPS),\
+		$(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \
+		basedir=$(CURDIR)/debian/kamailio-extra-modules \
+		cfg_prefix=$(CURDIR)/debian/kamailio-extra-modules \
+		doc-dir=share/doc/kamailio-extra-modules
+	)
+	# eliminate duplicate libs
+	-for d in $(DUP_LIBS_DIRS); do \
+		test "$$d" != "$(CURDIR)/debian/kamailio-extra-modules/usr/$(LIBDIR)/kamailio" &&\
+		for r in `find $$d -name 'lib*'|xargs`; do \
+			echo "removing extra lib `basename $$r` present also in $$d";\
+			rm -f $(CURDIR)/debian/kamailio-extra-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \
+		done ; \
+	done
+	find $(CURDIR)/debian/kamailio-extra-modules -depth -empty -type d -exec rmdir {} \;
+endef
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	INSTALL_PROGRAM += -s
+endif
+
+# CFLAGS + CPPFLAGS -> CC_EXTRA_OPTS
+# LDFLAGS -> LD_EXTRA_OPTS
+CUSTOM_BUILDFLAGS:=$(shell dpkg-buildflags --export=configure| \
+sed -e 's/" CPPFLAGS="/ /' -e 's/CFLAGS/CC_EXTRA_OPTS/g' -e 's/LDFLAGS/LD_EXTRA_OPTS/g')
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	# Add here commands to configure the package.
+	$(MAKE) FLAVOUR=kamailio cfg prefix=/usr cfg_prefix=$(CURDIR)/debian/kamailio \
+			cfg_target=/etc/kamailio/ \
+			basedir=$(CURDIR)/debian/kamailio \
+			skip_modules="$(EXCLUDED_MODULES) $(EXTRA_EXCLUDED_MODULES)" \
+			$(CUSTOM_BUILDFLAGS) \
+			group_include="kstandard"
+
+	touch configure-stamp
+
+
+build: build-stamp
+build-arch: build-stamp
+build-indep: build-stamp
+build-stamp: configure-stamp
+	dh_testdir
+	# Add here commands to compile the package.
+	$(MAKE) all
+	# make groups
+	$(call PACKAGE_GRP_BUILD_template)
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	# Add here commands to clean up after the build process.
+	$(MAKE) maintainer-clean
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_prep
+	dh_installdirs
+	# Add here commands to install the package into debian/kamailio
+	$(MAKE) install LIBDIR=$(LIBDIR) group_include="kstandard"
+	# make group packages
+	$(call PACKAGE_GRP_INSTALL_template)
+	$(call PACKAGE_EXTRA_INSTALL_template)
+	mv $(CURDIR)/debian/kamailio-berkeley-modules/usr/sbin/kambdb_recover \
+		$(CURDIR)/debian/kamailio-berkeley-bin/usr/sbin/kambdb_recover
+	# install /etc/default/kamailio file
+	mkdir -p $(CURDIR)/debian/kamailio/etc/default
+	cp -f debian/kamailio.default $(CURDIR)/debian/kamailio/etc/default/kamailio
+
+
+# This single target is used to build all the packages, all at once, or
+# one at a time. So keep in mind: any options passed to commands here will
+# affect _all_ packages. Anything you want to only affect one package
+# should be put in another target, such as the install target.
+binary-common:
+	dh_testdir
+	dh_testroot
+	dh_installdebconf
+	dh_installdocs
+	dh_installexamples
+	dh_installmenu
+	dh_installinit -pkamailio -- defaults 23
+	dh_installcron
+	dh_installman
+	dh_installinfo
+	dh_lintian
+	dh_installchangelogs ChangeLog
+	dh_link
+	dh_strip --dbg-package=kamailio-dbg
+	dh_compress
+	dh_fixperms
+	dh_makeshlibs
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+# Build architecture-independent packages using the common target
+binary-indep: build install
+# (Uncomment this next line if you have such packages.)
+#        $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
+# We have nothing to do by default.
+
+
+# Build architecture-dependent packages using the common target
+binary-arch: build install
+	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
+
+# Any other binary targets build just one binary package at a time.
+binary-%: build install
+	$(MAKE) -f debian/rules binary-common DH_OPTIONS=-p$*
+
+print-version:
+	@@echo "Debian version:          $(DEBVERSION)"
+	@@echo "Upstream version:        $(UPVERSION)"
+
+get-orig-source:
+	@@dh_testdir
+	@@[ -d ../tarballs/. ]||mkdir -p ../tarballs
+	@@echo Downloading $(FILENAME) from $(URL) ...
+	@@wget -nv -T10 -t3 -O ../tarballs/$(FILENAME) $(URL)
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
+
diff --git a/pkg/kamailio/deb/debian/source.lintian-overrides b/pkg/kamailio/deb/debian/source.lintian-overrides
new file mode 100644
index 0000000..620d9ff
--- /dev/null
+++ b/pkg/kamailio/deb/debian/source.lintian-overrides
@@ -0,0 +1 @@
+kamailio source: debian-watch-file-in-native-package
diff --git a/pkg/kamailio/deb/debian/source/format b/pkg/kamailio/deb/debian/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/pkg/kamailio/deb/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/pkg/kamailio/deb/debian/watch b/pkg/kamailio/deb/debian/watch
new file mode 100644
index 0000000..c50f31f
--- /dev/null
+++ b/pkg/kamailio/deb/debian/watch
@@ -0,0 +1,3 @@
+version=3
+opts=dversionmangle=s/\~svn([\d]+)//; \
+http://www.kamailio.org/pub/kamailio/([\d.]+)/src/kamailio-([\d.]+)_src\.tar\.gz
diff --git a/pkg/kamailio/deb/jessie/changelog b/pkg/kamailio/deb/jessie/changelog
new file mode 100644
index 0000000..d13762c
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/changelog
@@ -0,0 +1,118 @@
+kamailio (4.1.5) unstable; urgency=low
+
+  * update to 4.1.5 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Wed, 06 Aug 2014 16:50:20 +0100
+
+kamailio (4.1.4) unstable; urgency=low
+
+  * update to 4.1.4 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 12 Jun 2014 15:55:55 +0100
+
+kamailio (4.1.3) unstable; urgency=low
+
+  * update to 4.1.3 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 24 Apr 2014 10:45:20 +0100
+
+kamailio (4.1.2) unstable; urgency=low
+
+  * update to 4.1.2 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 06 Mar 2014 15:25:35 +0100
+
+kamailio (4.1.1) unstable; urgency=low
+
+  * update to 4.1.1 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 09 Jan 2014 15:45:35 +0100
+
+kamailio (4.1.0) unstable; urgency=low
+
+  * update to 4.1.0
+
+ -- Victor Seva <linuxmaniac at torreviejawireless.org>  Wed, 04 Dec 2013 11:42:27 +0100
+
+kamailio (4.0.0) unstable; urgency=low
+
+  * update to 4.0.0 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Mon, 11 Mar 2013 10:40:30 +0100
+
+kamailio (3.4.0~dev0) unstable; urgency=low
+
+  * update version to 3.4.0~dev0
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Wed, 15 Jun 2012 03:15:00 +0100
+
+kamailio (3.2.0) unstable; urgency=low
+
+  * update to 3.2.0 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Fri, 29 Apr 2011 12:25:30 +0100
+
+kamailio (3.1.1) unstable; urgency=low
+
+  * update to 3.1.1 from upstream
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Fri, 3 Dec 2010 16:30:00 +0100
+
+kamailio (3.1.0) unstable; urgency=low
+
+  * update to 3.1.0 from upstream
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Wed, 6 Oct 2010 17:24:00 +0100
+
+kamailio (3.0.2.99) unstable; urgency=low
+
+  * update to 3.0.2.99 for development version builds
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Fri, 28 May 2010 22:26:00 +0100
+
+kamailio (3.0.2) unstable; urgency=low
+
+  * update to 3.0.2 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 27 May 2010 10:27:36 +0100
+
+kamailio (3.0.1) unstable; urgency=low
+
+  * update to 3.0.1 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Mon, 08 Mar 2010 20:30:48 +0100
+
+kamailio (3.0.0) unstable; urgency=low
+
+  * update to 3.0.0 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Mon, 11 Jan 2010 18:30:42 +0100
+
+kamailio (3.0.0-rc3) unstable; urgency=low
+
+  * update to 3.0.0-rc3 from upstream
+  * updated debian/rules to work with the SIP Router style module packaging
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Fri, 10 Dec 2009 12:10:02 +0100
+
+kamailio (3.0.0-rc2) unstable; urgency=low
+
+  * update to 3.0.0-rc2 from upstream
+  * updated debian/rules to work with the new style module packaging
+
+ -- Jonas Bergler <jonas.bergler at staff.snap.net.nz>  Wed, 18 Nov 2009 12:30:02 +1300
+
+kamailio (1.5.0-svn1) unstable; urgency=low
+
+  * increment debian packaging for trunk
+
+ -- Henning Westerholt <henning.westerholt at 1und1.de>  Mon, 02 Mar 2009 17:40:02 +0100
+
+kamailio (1.4.0-svn1) unstable; urgency=low
+
+  [ Klaus Darilion ]
+  * first release of Kamailio (after renaming from Openser)
+
+ -- Julien BLACHE <jblache at debian.org>  Wed, 12 Dec 2007 17:25:31 +0100
+
+
diff --git a/pkg/kamailio/deb/jessie/compat b/pkg/kamailio/deb/jessie/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/compat
@@ -0,0 +1 @@
+9
diff --git a/pkg/kamailio/deb/jessie/control b/pkg/kamailio/deb/jessie/control
new file mode 100644
index 0000000..fa67335
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/control
@@ -0,0 +1,569 @@
+Source: kamailio
+Section: net
+Priority: optional
+Maintainer: Debian VoIP Team <pkg-voip-maintainers at lists.alioth.debian.org>
+Uploaders: Victor Seva <linuxmaniac at torreviejawireless.org>,
+           Tzafrir Cohen <tzafrir at debian.org>
+Build-Depends: bison,
+               debhelper (>= 9),
+               docbook-xml,
+               dpkg-dev (>= 1.16.1.1),
+               flex,
+               gcj-jdk,
+               libconfuse-dev,
+               libcurl4-openssl-dev,
+               libdb-dev (>= 4.6.19),
+               libevent-dev,
+               libexpat1-dev,
+               libfreeradius-client-dev,
+               libgeoip-dev (>= 1.4.5),
+               libhiredis-dev (>= 0.10.0),
+               libjson-c-dev,
+               libldap2-dev,
+               liblua5.1-0-dev,
+               libmemcached-dev,
+               libmono-2.0-dev,
+               libmysqlclient-dev,
+               libncurses5-dev,
+               libpcre3-dev,
+               libperl-dev,
+               libpq-dev,
+               libpurple-dev,
+               libreadline-dev,
+               libsasl2-dev,
+               libsctp-dev,
+               libsnmp-dev,
+               libsqlite3-dev,
+               libunistring-dev,
+               libval-dev,
+               libxml2-dev,
+               openssl,
+               python,
+               python-dev,
+               unixodbc-dev,
+               xsltproc,
+               zlib1g-dev
+Standards-Version: 3.9.5
+Homepage: http://www.kamailio.org/
+Vcs-git: git://anonscm.debian.org/pkg-voip/kamailio.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-voip/kamailio.git
+
+Package: kamailio
+Architecture: linux-any
+Multi-Arch: foreign
+Pre-Depends: ${misc:Pre-Depends}
+Depends: adduser, python, ${misc:Depends}, ${shlibs:Depends}
+Suggests: kamailio-berkeley-modules,
+          kamailio-carrierroute-modules,
+          kamailio-cpl-modules,
+          kamailio-dbg,
+          kamailio-ldap-modules,
+          kamailio-lua-modules,
+          kamailio-mysql-modules,
+          kamailio-perl-modules,
+          kamailio-postgres-modules,
+          kamailio-presence-modules,
+          kamailio-python-modules,
+          kamailio-radius-modules,
+          kamailio-snmpstats-modules,
+          kamailio-tls-modules,
+          kamailio-unixodbc-modules,
+          kamailio-xml-modules,
+          kamailio-xmpp-modules
+Description: very fast and configurable SIP proxy
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ C Shell-like scripting language provides full control over the server's
+ behaviour. Its modular architecture allows only required functionality to be
+ loaded.
+ .
+ Among others, the following modules are available: digest authentication, CPL
+ scripts, instant messaging, MySQL support, presence agent, RADIUS
+ authentication, record routing, SMS gateway, Jabber/XMPP gateway, transaction
+ module, registrar and user location, XML-RPC interface.
+ .
+ This package contains the main Kamailio binary along with the principal modules
+ and support binaries.
+
+Package: kamailio-dbg
+Priority: extra
+Section: debug
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}
+Description: very fast and configurable SIP proxy [debug symbols]
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains the debugging symbols for the Kamailio binaries and
+ modules. You only need to install it if you need to debug Kamailio.
+
+Package: kamailio-geoip-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the geoip module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the geoip module, an extension allowing to
+ use GeoIP API within configuration file.
+
+Package: kamailio-sqlite-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Recommends: sqlite3
+Description: SQLite database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the SQLite database driver for Kamailio.
+
+Package: kamailio-json-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Json parser and jsonrpc modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides json parser for Kamailio's configuration file
+ and the JSON-RPC client over netstrings.
+
+Package: kamailio-memcached-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Replaces: kamailio-memcached-module
+Description: Provides the memcached module, an interface to the memcached server
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the memcached module, an interface to the memcached
+ server, a high-performance, distributed memory object caching system.
+
+Package: kamailio-lua-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the app_lua module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_lua module, an extension allowing to
+ execute embedded Lua applications within configuration file.
+
+Package: kamailio-mono-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the app_mono module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_mono module, an extension allowing to
+ execute embedded Mono applications within configuration file.
+
+Package: kamailio-python-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         python-dev,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: contains the app_python module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_python module, an extension allowing to
+ execute embedded Python applications within configuration file.
+
+Package: kamailio-redis-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Redis database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the Redis NOSQL database driver for Kamailio.
+
+Package: kamailio-mysql-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         mysql-client,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: MySQL database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the MySQL database driver for Kamailio.
+
+Package: kamailio-postgres-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         postgresql-client,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: PostgreSQL database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the PostgreSQL database driver for Kamailio.
+
+Package: kamailio-cpl-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: CPL module (CPL interpreter engine) for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides a CPL (Call Processing Language) interpreter for
+ Kamailio, turning Kamailio into a CPL server (storage and interpreter).
+
+Package: kamailio-radius-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: RADIUS modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides a set of RADIUS modules for Kamailio, for
+ authentication, peering, group membership and messages URIs checking against a
+ RADIUS server.
+
+Package: kamailio-unixodbc-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: unixODBC database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the unixODBC database driver for Kamailio.
+
+Package: kamailio-presence-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: SIMPLE presence modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides several Kamailio modules for implementing presence
+ server and presence user agent for RICH presence, registrar-based presence,
+ external triggered presence and XCAP support.
+
+Package: kamailio-perl-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Perl extensions and database driver for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides an interface for Kamailio to write Perl extensions and
+ the perlvdb database driver for Kamailio.
+
+Package: kamailio-snmpstats-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         snmpd,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: SNMP AgentX subagent module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the snmpstats module for Kamailio. This module acts
+ as an AgentX subagent which connects to a master agent.
+
+Package: kamailio-purple-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Provides the purple module, a multi-protocol IM gateway
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the purple module, a multi-protocol instant
+ messaging gateway module.
+
+Package: kamailio-xmpp-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: XMPP gateway module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the SIP to XMPP IM translator module for Kamailio.
+
+Package: kamailio-xml-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Replaces: kamailio-xml-module, kamailio-xmlrpc-module
+Provides: kamailio-xmlrpc-modules
+Description: XML based extensions for Kamailio's Management Interface
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides:
+ - the XMLRPC transport implementations for Kamailio's
+ Management and Control Interface.
+ - xmlops module for XPath operations in configuration file
+
+Package: kamailio-carrierroute-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: carrierroute module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the carrierroute module for Kamailio, an integrated
+ solution for routing, balancing and blacklisting.
+
+Package: kamailio-berkeley-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: db5.1-util,
+         kamailio (= ${binary:Version}),
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: Berkeley database module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the Berkeley database module for Kamailio, a
+ high-performance embedded DB kernel. All database tables are stored
+ in files, no additional server is necessary.
+
+Package: kamailio-berkeley-bin
+Architecture: linux-any
+Multi-Arch: foreign
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: Berkeley database module for Kamailio - helper program
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides helper modules for the Berkeley database module for
+ Kamailio, a high-performance embedded DB kernel. You should normally
+ install kamailio-berkeley-modules and not this package directly.
+
+Package: kamailio-ldap-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: LDAP modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the ldap and h350 modules for Kamailio, enabling LDAP
+ queries from the Kamailio config and storage of SIP account data in an LDAP
+ directory.
+
+Package: kamailio-ims-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: IMS module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains various Diameter interfaces and modules for Kamailio
+ to run as an IMS core.
+
+Package: kamailio-utils-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Provides a set utility functions for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ Provides a set of utility functions for Kamailio, which are not related
+ to the server configuration.
+
+Package: kamailio-sctp-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: sctp module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the sctp module for Kamailio.
+
+Package: kamailio-java-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: gcj-jre,
+         kamailio (= ${binary:Version}),
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: contains the app_java module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_java module, an extension allowing to
+ execute embedded Java applications within configuration file.
+
+Package: kamailio-tls-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the TLS kamailio transport module
+ This has been split out of the main kamailio package, so that kamailio will
+ not depend on openssl. This module will enable you to use the TLS transport.
+
+Package: kamailio-outbound-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Outbound module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains the module implementing SIP outbound extension.
+
+Package: kamailio-websocket-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Websocket module for kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains the module implementing WebSocket transport layer.
+
+Package: kamailio-dnssec-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the dnssec module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the dnssec module for Kamailio.
+
+Package: kamailio-autheph-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: authentication using ephemeral credentials module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the ephemeral module for Kamailio.
+
+Package: kamailio-extra-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: extra modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides: gzcompress
+
+Package: kamailio-nth
+Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: binutils,
+         bison,
+         bvi,
+         flex,
+         gcc,
+         gdb,
+         iftop,
+         lsof,
+         mc,
+         most,
+         ngrep,
+         psmisc,
+         screen,
+         sipsak,
+         tcpdump,
+         vim,
+         ${misc:Depends}
+Description: Kamailio - package for "nice to have" installation
+ This is a metapackage for easy installation various useful tools that may be
+ handy on server with Kamailio installed.
diff --git a/pkg/kamailio/deb/jessie/copyright b/pkg/kamailio/deb/jessie/copyright
new file mode 100644
index 0000000..ff31338
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/copyright
@@ -0,0 +1,335 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Kamailio
+Upstream-Contact: sr-dev at lists.sip-router.org
+Source: http://www.kamailio.org/pub/kamailio/
+
+Files: *
+Copyright:
+ 2001-2003 FhG Fokus
+ 2006-2010 iptelorg GmbH
+ Various others (see AUTHORS file)
+License: GPL-2.0+
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+
+Files: debian/*
+Copyright: 2012, 2013, 2014 Victor Seva <linuxmaniac at torreviejawireless.org>
+           2009, 2010, 2011, Daniel-Constantin Mierla <miconda at gmail.com>
+           2010, Jon Bonilla <manwe at aholab.ehu.es>
+           2009, Jonas Bergler <jonas.bergler at staff.snap.net.nz>
+           2009, Henning Westerholt <henning.westerholt at 1und1.de>
+           2007, Julien BLACHE <jblache at debian.org>
+License: GPL-2+
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+
+
+Files: atomic/* atomic_ops.* basex.* bit_*.c char_msg_val.h compiler_opt.h
+ core_stats.h counters.* endianness.* futexlock.h hashes.h io_wait.*
+ kstats_types.h lib/kcore/kstats_wrapper.* lock_ops.c lock_ops_init.h
+ lvalue.* mem/ll_malloc.* mem/memdbg.h mem/sf_malloc.* mi/*.h mod_fix.*
+ modules/tm/rpc_uac.* modules/counters/counters.c modules/tls/sbufq.h
+ modules/tls/tls_bio.* modules/tls/tls_cfg.* modules/tls/tls_cfg.h
+ modules/tls/tls_ct_wrq.* modules/tls/tls_ct_q.h modules/tls/tls_domain.*
+ modules/tls/tls_server.h modules/tls/tls_locking.* modules/tls/tls_rpc.*
+ modules/tls/tls_server.c modules/malloc_test/malloc_test.c modules/blst/blst.c
+ parser/case_p_* parser/case_reas.h pvapi.h pv_core.* rand/fastrand.* raw_*
+ rpc_lookup.* rvalue.* sctp_* ser_time.h shm_init.* sip_msg_clone.* sock_ut.*
+ sr_compat.* str_hash.h switch.* tcp_ev.h tcp_int_send.h tcp_options.*
+ tcp_read.h tcp_stats.* timer_proc.* tls_hooks.* tls_hooks_init.h ver.*
+Copyright: 2006-2010 iptelorg GmbH
+License: ISC
+
+Files: modules/tls/tls_select.* modules/tls/tls_dump_vf.*
+Copyright: 2005-2010 iptelorg GmbH
+License: GPL-2 + OpenSSL exception
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+ * Exception: permission to copy, modify, propagate, and distribute a work
+ * formed by combining OpenSSL toolkit software and the code in this file,
+ * such as linking with software components and libraries released under
+ * OpenSSL project license.
+
+Files: modules/websocket/* modules/outbound/* modules/auth_ephemeral/*
+Copyright: 2012-2013 Crocodile RCS Ltd
+License: GPL-2 + OpenSSL exception
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+ * Exception: permission to copy, modify, propagate, and distribute a work
+ * formed by combining OpenSSL toolkit software and the code in this file,
+ * such as linking with software components and libraries released under
+ * OpenSSL project license.
+
+Files: daemonize.* fastlock.h lock_ops.h mem/mem.* mem/f_malloc.h
+ mem/meminfo.h mem/memtest.c mem/shm_mem.c mem/q_malloc.h mem/q_malloc.c
+ mem/shm_mem.h mem/f_malloc.c modules/tls/tls_rpc.c modules/tls/tls_server.c
+ modules/tls/tls_domain.c modules/tls/tls_domain.h modules/tls/tls_server.h
+ modules/tls/tls_rpc.h pt.c pt.h sched_yield.h ut.c ut.h
+Copyright: 2001-2003 FhG Fokus
+License: ISC
+
+Files: events.* modules/topoh/*
+Copyright: 2009 SIP-Router.org
+License: ISC
+
+Files: modules/mi_rpc/mi_rpc_mod.c modules/pv/pv_xavp.*
+ modules/usrloc/ul_rpc.* ppcfg.* xavp.*
+Copyright: 2009-2010 Daniel-Constantin Mierla (asipto.com)
+License: ISC
+
+Files: obsolete/jabber_k/tree234.*
+Copyright: 1999, 2000, 2001, Simon Tatham
+License: Expat
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or
+ sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+ .
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT.  IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+
+Files: modules/xmpp/xsnprintf.c obsolete/jabber_s/xsnprintf.c obsolete/jabber_k/xsnprintf.c
+Copyright: 1995-1998, The Apache Group
+License: Apache-1.0
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ .
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+ .
+ 3. All advertising materials mentioning features or use of this
+    software must display the following acknowledgment:
+    "This product includes software developed by the Apache Group
+    for use in the Apache HTTP server project (http://www.apache.org/)."
+ .
+ 4. The names "Apache Server" and "Apache Group" must not be used to
+    endorse or promote products derived from this software without
+    prior written permission.
+ .
+ 5. Redistributions of any form whatsoever must retain the following
+    acknowledgment:
+    "This product includes software developed by the Apache Group
+    for use in the Apache HTTP server project (http://www.apache.org/)."
+ .
+ THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
+ EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Files: modules/mi_xmlrpc/abyss*
+Copyright: 2000, Moez Mahfoudh <mmoez at bigfoot.com>
+License: BSD-3-clause
+
+Files: list.h
+Copyright: 1991, 1993 The Regents of the University of California
+License: BSD-3-clause
+
+Files: modules/tm/t_serial.*
+Copyright: 2008 Juha Heinanen
+License: BSD-2-clause
+
+Files: parser/sdp/sdp.* parser/sdp/sdp_helpr_funcs.* parser/sdp/sdp_cloner.h
+Copyright:
+ 2008-2009 SOMA Networks, INC.
+ 2010 VoIP Embedded, Inc
+License: BSD-2-clause
+
+Files: modules/tls/fixed_c_zlib.h
+Copyright:1998-2005 The OpenSSL Project
+Comment: file copied from OpenSSL 0.9.8, refers to OpenSSL License. Note that
+ this code will not build by default in the Debian packaging.
+License: OpenSSL
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ .
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+ .
+ 3. All advertising materials mentioning features or use of this
+    software must display the following acknowledgment:
+    "This product includes software developed by the OpenSSL Project
+    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ .
+ 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+    endorse or promote products derived from this software without
+    prior written permission. For written permission, please contact
+    openssl-core at openssl.org.
+ .
+ 5. Products derived from this software may not be called "OpenSSL"
+    nor may "OpenSSL" appear in their names without prior written
+    permission of the OpenSSL Project.
+ .
+ 6. Redistributions of any form whatsoever must retain the following
+    acknowledgment:
+    "This product includes software developed by the OpenSSL Project
+    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ .
+ THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Files: md5.* md5utils.c
+Copyright: 1991-2, RSA Data Security, Inc
+Comment: Note that md5.c and md5.h have been replaced in the patches
+ plum_md5*.patch .
+ .
+ As for md5utils.c, according to a mail from Upstream (Daniel-Constantin
+ Mierla): while the initial commit log for it states that it is derived
+ from mddriver.c of RFC 1321, it seems that it was, in fact, written from
+ scratch by Jiri Kuthan (a core developer of SER at that time, working for
+ FhG Fokus Institute). As you can see it's rather trivial and uses a data
+ type of SER ("str").  I didn't reimplement it as it's too trivial and
+ looks like there's no other way to implement it.
+License: RSA-MD5
+ License to copy and use this software is granted provided that it
+ is identified as the "RSA Data Security, Inc. MD5 Message-Digest
+ Algorithm" in all material mentioning or referencing this software
+ or this function.
+ .
+ License is also granted to make and use derivative works provided
+ that such works are identified as "derived from the RSA Data
+ Security, Inc. MD5 Message-Digest Algorithm" in all material
+ mentioning or referencing the derived work.
+ .
+ RSA Data Security, Inc. makes no representations concerning either
+ the merchantability of this software or the suitability of this
+ software for any particular purpose. It is provided "as is"
+ without express or implied warranty of any kind.
+ .
+ These notices must be retained in any copies of any part of this
+ documentation and/or software.
+
+Files: mem/dl_*
+Copyright: n/a
+License: public-domain
+ This is a version (aka dlmalloc) of malloc/free/realloc written by
+ Doug Lea and released to the public domain, as explained at
+ http://creativecommons.org/licenses/publicdomain.  Send questions,
+ comments, complaints, performance data, etc to dl at cs.oswego.edu
+
+Files: rand/isaac/*
+Copyright: n/a
+License: public-domain
+ By Bob Jenkins.  My random number generator, ISAAC.  Public Domain.
+
+License: ISC
+ Permission to use, copy, modify, and distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Files: lib/srutils/srjson.*
+Copyright: 2009 Dave Gamble
+License: MIT
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ ,
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+
+License: BSD-3-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 4. Neither the name of the University nor the names of its contributors
+    may be used to endorse or promote products derived from this software
+    without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+License: BSD-2-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ .
+  1. Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/pkg/kamailio/deb/jessie/kamailio-autheph-modules.lintian-overrides b/pkg/kamailio/deb/jessie/kamailio-autheph-modules.lintian-overrides
new file mode 100644
index 0000000..dcb3d18
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/kamailio-autheph-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-autheph-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/jessie/kamailio-berkeley-bin.dirs b/pkg/kamailio/deb/jessie/kamailio-berkeley-bin.dirs
new file mode 100644
index 0000000..236670a
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/kamailio-berkeley-bin.dirs
@@ -0,0 +1 @@
+usr/sbin
diff --git a/pkg/kamailio/deb/jessie/kamailio-dnssec-modules.lintian-overrides b/pkg/kamailio/deb/jessie/kamailio-dnssec-modules.lintian-overrides
new file mode 100644
index 0000000..10165fe
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/kamailio-dnssec-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-dnssec-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/jessie/kamailio-outbound-modules.lintian-overrides b/pkg/kamailio/deb/jessie/kamailio-outbound-modules.lintian-overrides
new file mode 100644
index 0000000..3050cfe
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/kamailio-outbound-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-outbound-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/jessie/kamailio-tls-modules.lintian-overrides b/pkg/kamailio/deb/jessie/kamailio-tls-modules.lintian-overrides
new file mode 100644
index 0000000..bbe0d37
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/kamailio-tls-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/jessie/kamailio-websocket-modules.lintian-overrides b/pkg/kamailio/deb/jessie/kamailio-websocket-modules.lintian-overrides
new file mode 100644
index 0000000..8f384fb
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/kamailio-websocket-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-websocket-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/jessie/kamailio.README.Debian b/pkg/kamailio/deb/jessie/kamailio.README.Debian
new file mode 100644
index 0000000..d25769a
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/kamailio.README.Debian
@@ -0,0 +1,39 @@
+Kamailio for Debian
+-------------------
+
+* init script check for fork=no
+-------------------------------
+
+The Kamailio init script will not start Kamailio on boot if fork=no is
+specified in the config file. The check in the initscript will match
+any occurrence of fork=no in the file, even inside C-style comments.
+
+You can disable this check in the init script if you wish; just comment
+out the calls to the check_fork function in the script. Your changes to
+the init script will be preserved upon upgrade, as the file is tagged
+as a conffile.
+
+
+* Kamailio setup
+----------------
+
+To setup Kamailio, you need to:
+ - configure Kamailio properly to suit your needs
+ - edit /etc/default/kamailio, adjust the MEMORY parameter and set
+   RUN_KAMAILIO to "yes"
+
+If you are building an HA cluster using heartbeat or similar, you'll want
+to disable the init script by running:
+
+  update-rc.d kamailio remove
+
+so that Kamailio will not be launched at system startup. You still need
+to set RUN_KAMAILIO to "yes" if you want to use the /etc/init.d/kamailio init
+script.
+
+Set the DUMP_CORE parameter in /etc/default/kamailio to "yes" if you want to
+get a core dump in case Kamailio crashes. The debug symbols for Kamailio are
+provided by the kamailio-dbg package.
+
+
+ -- Victor Seva <linuxmaniac at torreviejawireless.org>  Wed, 11 Dec 2013 16:07:11 +0100
diff --git a/pkg/kamailio/deb/jessie/kamailio.default b/pkg/kamailio/deb/jessie/kamailio.default
new file mode 100644
index 0000000..0cfc8c8
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/kamailio.default
@@ -0,0 +1,28 @@
+#
+# Kamailio startup options
+#
+
+# Set to yes to enable kamailio, once configured properly.
+#RUN_KAMAILIO=yes
+
+# User to run as
+#USER=kamailio
+
+# Group to run as
+#GROUP=kamailio
+
+# Amount of shared and private memory to allocate
+# for the running Kamailio server (in Mb)
+#SHM_MEMORY=64
+#PKG_MEMORY=4
+
+# Config file
+#CFGFILE=/etc/kamailio/kamailio.cfg
+
+# Enable the server to leave a core file when it crashes.
+# Set this to 'yes' to enable Kamailio to leave a core file when it crashes
+# or 'no' to disable this feature. This option is case sensitive and only
+# accepts 'yes' and 'no' and only in lowercase letters.
+# On some systems it is necessary to specify a directory for the core files
+# to get a dump. Look into the kamailio init file for an example configuration.
+#DUMP_CORE=yes
diff --git a/pkg/kamailio/deb/jessie/kamailio.examples b/pkg/kamailio/deb/jessie/kamailio.examples
new file mode 100644
index 0000000..c48447a
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/kamailio.examples
@@ -0,0 +1,2 @@
+examples/*
+
diff --git a/pkg/kamailio/deb/jessie/kamailio.init b/pkg/kamailio/deb/jessie/kamailio.init
new file mode 100644
index 0000000..d4801d2
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/kamailio.init
@@ -0,0 +1,162 @@
+#! /bin/sh
+#
+### BEGIN INIT INFO
+# Provides:          kamailio
+# Required-Start:    $syslog $network $local_fs $remote_fs $time
+# Should-Start:      $named slapd mysql postgresql snmpd radiusd
+# Should-Stop:       $named slapd mysql postgresql snmpd radiusd
+# Required-Stop:     $syslog $network $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start the Kamailio SIP proxy server
+# Description:       Start the Kamailio SIP proxy server
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/kamailio
+NAME=kamailio
+DESC="Kamailio SIP server"
+HOMEDIR=/var/run/kamailio
+PIDFILE=$HOMEDIR/$NAME.pid
+DEFAULTS=/etc/default/kamailio
+CFGFILE=/etc/kamailio/kamailio.cfg
+RUN_KAMAILIO=no
+USER=kamailio
+GROUP=kamailio
+# Amount of shared and private memory to allocate
+# for the running Kamailio server (in Mb)
+SHM_MEMORY=64
+PKG_MEMORY=4
+DUMP_CORE=no
+
+# Do not start kamailio if fork=no is set in the config file
+# otherwise the boot process will just stop
+check_fork ()
+{
+    if grep -q "^[[:space:]]*fork[[:space:]]*=[[:space:]]*no.*" $CFGFILE; then
+	log_failure_msg "Not starting $DESC: fork=no specified in config file; run /etc/init.d/kamailio debug instead"
+	exit 0
+    fi
+}
+
+check_kamailio_config ()
+{
+	# Check if kamailio configuration is valid before starting the server
+	set +e
+	out=$($DAEMON -f $CFGFILE -M $PKG_MEMORY -c 2>&1 > /dev/null)
+	retcode=$?
+	set -e
+	if [ "$retcode" != '0' ]; then
+	    log_failure_msg "Not starting $DESC: invalid configuration file!"
+	    log_failure_msg
+	    log_failure_msg "$out"
+	    log_failure_msg
+	    exit 1
+	fi
+}
+
+create_radius_seqfile ()
+{
+    # Create a radius sequence file to be used by the radius client if
+    # radius accounting is enabled. This is needed to avoid any issue
+    # with the file not being writable if kamailio first starts as user
+    # root because DUMP_CORE is enabled and creates this file as user
+    # root and then later it switches back to user kamailio and cannot
+    # write to the file. If the file exists before kamailio starts, it
+    # won't change it's ownership and will be writable for both root
+    # and kamailio, no matter what options are chosen at install time
+    RADIUS_SEQ_FILE=/var/run/kamailio/kamailio_radius.seq
+    if [ -d /var/run/kamailio ]; then
+	chown ${USER}:${GROUP} /var/run/kamailio
+
+	if [ ! -f $RADIUS_SEQ_FILE ]; then
+	    touch $RADIUS_SEQ_FILE
+	fi
+
+	chown ${USER}:${GROUP} $RADIUS_SEQ_FILE
+	chmod 660 $RADIUS_SEQ_FILE
+    fi
+}
+
+test -f $DAEMON || exit 0
+
+# Load startup options if available
+if [ -f $DEFAULTS ]; then
+   . $DEFAULTS || true
+fi
+
+if [ "$RUN_KAMAILIO" != "yes" ]; then
+    log_failure_msg "Kamailio not yet configured. Edit /etc/default/kamailio first."
+    exit 0
+fi
+
+set -e
+
+SHM_MEMORY=$((`echo $SHM_MEMORY | sed -e 's/[^0-9]//g'`))
+PKG_MEMORY=$((`echo $PKG_MEMORY | sed -e 's/[^0-9]//g'`))
+[ -z "$USER" ]  && USER=kamailio
+[ -z "$GROUP" ] && GROUP=kamailio
+[ $SHM_MEMORY -le 0 ] && SHM_MEMORY=64
+[ $PKG_MEMORY -le 0 ] && PKG_MEMORY=4
+
+if test "$DUMP_CORE" = "yes" ; then
+    # set proper ulimit
+    ulimit -c unlimited
+
+    # directory for the core dump files
+    # COREDIR=/home/corefiles
+    # [ -d $COREDIR ] || mkdir $COREDIR
+    # chmod 777 $COREDIR
+    # echo "$COREDIR/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
+fi
+
+# /var/run can be a tmpfs
+if [ ! -d $HOMEDIR ]; then
+    mkdir -p $HOMEDIR
+fi
+
+OPTIONS="-f $CFGFILE -P $PIDFILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP"
+
+case "$1" in
+  start|debug)
+	check_kamailio_config
+	create_radius_seqfile
+
+	if [ "$1" != "debug" ]; then
+	    check_fork
+	fi
+
+	log_daemon_msg "Starting $DESC: $NAME"
+	start-stop-daemon --start --quiet --pidfile $PIDFILE \
+		--exec $DAEMON -- $OPTIONS || log_failure_msg " already running"
+	log_end_msg 0
+	;;
+  stop)
+	log_daemon_msg "Stopping $DESC: $NAME"
+	start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
+		--exec $DAEMON
+	log_end_msg 0
+	;;
+  restart|force-reload)
+	check_kamailio_config
+	create_radius_seqfile
+
+	$0 stop
+	sleep 1
+	$0 start
+	;;
+  status)
+	log_daemon_msg "Status of $DESC: "
+
+	status_of_proc -p"$PIDFILE" $NAME $NAME
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload|status|debug}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/pkg/kamailio/deb/jessie/kamailio.lintian-overrides b/pkg/kamailio/deb/jessie/kamailio.lintian-overrides
new file mode 100644
index 0000000..18152ed
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/kamailio.lintian-overrides
@@ -0,0 +1,2 @@
+kamailio binary: example-interpreter-not-absolute usr/share/doc/kamailio/examples/outbound/edge.cfg #!KAMAILIO
+kamailio binary: example-interpreter-not-absolute usr/share/doc/kamailio/examples/outbound/registrar.cfg #!KAMAILIO
diff --git a/pkg/kamailio/deb/jessie/kamailio.postinst b/pkg/kamailio/deb/jessie/kamailio.postinst
new file mode 100644
index 0000000..4ee38ec
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/kamailio.postinst
@@ -0,0 +1,24 @@
+#! /bin/sh
+
+set -e
+
+case "$1" in
+    configure)
+        adduser --quiet --system --group --disabled-password \
+                --shell /bin/false --gecos "Kamailio SIP Server" \
+                --home /var/run/kamailio kamailio || true
+
+        ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+        ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+        ;;
+esac
+
+#DEBHELPER#
+
diff --git a/pkg/kamailio/deb/jessie/rules b/pkg/kamailio/deb/jessie/rules
new file mode 100755
index 0000000..f9058d3
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/rules
@@ -0,0 +1,220 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+DEBVERSION:=$(shell head -n 1 debian/changelog \
+                    | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
+UPVERSION:=$(shell dpkg-parsechangelog | sed -ne 's/^Version: \(\([0-9]\+\):\)\?\(.*\)-.*/\3/p')
+
+FILENAME := kamailio_$(UPVERSION).orig.tar.gz
+URL := http://www.kamailio.org/pub/kamailio/$(UPVERSION)/src/kamailio-$(UPVERSION)_src.tar.gz
+
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/buildflags.mk
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+export JAVA_HOME=/usr/lib/jvm/java-gcj
+
+# choose freeradius
+export FREERADIUS=1
+
+# modules not in the "main" kamailio package
+EXCLUDED_MODULES=
+
+# extra modules to skip, because they are not compilable now
+# - regardless if they go to the main kamailio package or to some module package,
+# they will be excluded from compile and install of all
+EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc
+
+# module groups that are packaged in seperate packages
+# (with the name kamailio-$(group_name)-modules)
+# Note: the order is important (should be in dependency order, the one
+# on which other depend first)
+PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \
+			   ldap xml perl utils lua memcached \
+			   snmpstats carrierroute xmpp cpl redis python geoip\
+			   sqlite json mono ims sctp java \
+			   purple tls outbound websocket autheph dnssec
+
+# module groups to be packaged onto kamailio-extra-modules
+EXTRA_GROUPS=gzcompress
+
+# name of libdir in the path for libraries (e.g., lib for 32b, lib64 for 64b)
+LIBDIR ?= lib/$(DEB_HOST_MULTIARCH)
+
+# directories with possible duplicate libraries (that should be deleted
+# from current module* packages)
+DUP_LIBS_DIRS=$(CURDIR)/debian/kamailio/usr/$(LIBDIR)/kamailio \
+			$(CURDIR)/debian/kamailio-db-modules/usr/$(LIBDIR)/kamailio
+
+# "function" to get package short name out of a dir/module_name
+# it also transforms db_foo into foo
+mod_name=$(subst db_,,$(lastword $(subst /, ,$(1))))
+
+define PACKAGE_GRP_BUILD_template
+	# package all the modules in PACKAGE_GROUPS in separate packages
+	$(foreach grp,$(PACKAGE_GROUPS EXTRA_GROUPS),\
+		$(MAKE) every-module group_include="k$(grp)"
+	)
+endef
+
+
+define PACKAGE_GRP_INSTALL_template
+	$(foreach grp,$(PACKAGE_GROUPS),\
+		$(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \
+		basedir=$(CURDIR)/debian/kamailio-$(grp)-modules \
+		cfg_prefix=$(CURDIR)/debian/kamailio-$(grp)-modules \
+		doc-dir=share/doc/kamailio-$(grp)-modules
+		# eliminate duplicate libs
+		-for d in $(DUP_LIBS_DIRS); do \
+			test "$$d" != "$(CURDIR)/debian/kamailio-$(grp)-modules/usr/$(LIBDIR)/kamailio" &&\
+			for r in `find $$d -name 'lib*'|xargs`; do \
+				echo "removing $(grp) lib `basename $$r` present also in $$d";\
+				rm -f $(CURDIR)/debian/kamailio-$(grp)-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \
+			done ; \
+		done
+		find $(CURDIR)/debian/kamailio-$(grp)-modules -depth -empty -type d -exec rmdir {} \;
+	)
+endef
+
+define PACKAGE_EXTRA_INSTALL_template
+	$(foreach grp,$(EXTRA_GROUPS),\
+		$(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \
+		basedir=$(CURDIR)/debian/kamailio-extra-modules \
+		cfg_prefix=$(CURDIR)/debian/kamailio-extra-modules \
+		doc-dir=share/doc/kamailio-extra-modules
+	)
+	# eliminate duplicate libs
+	-for d in $(DUP_LIBS_DIRS); do \
+		test "$$d" != "$(CURDIR)/debian/kamailio-extra-modules/usr/$(LIBDIR)/kamailio" &&\
+		for r in `find $$d -name 'lib*'|xargs`; do \
+			echo "removing extra lib `basename $$r` present also in $$d";\
+			rm -f $(CURDIR)/debian/kamailio-extra-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \
+		done ; \
+	done
+	find $(CURDIR)/debian/kamailio-extra-modules -depth -empty -type d -exec rmdir {} \;
+endef
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	INSTALL_PROGRAM += -s
+endif
+
+# CFLAGS + CPPFLAGS -> CC_EXTRA_OPTS
+# LDFLAGS -> LD_EXTRA_OPTS
+CUSTOM_BUILDFLAGS:=$(shell dpkg-buildflags --export=configure| \
+sed -e 's/" CPPFLAGS="/ /' -e 's/CFLAGS/CC_EXTRA_OPTS/g' -e 's/LDFLAGS/LD_EXTRA_OPTS/g')
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	# Add here commands to configure the package.
+	$(MAKE) FLAVOUR=kamailio cfg prefix=/usr cfg_prefix=$(CURDIR)/debian/kamailio \
+			cfg_target=/etc/kamailio/ \
+			basedir=$(CURDIR)/debian/kamailio \
+			skip_modules="$(EXCLUDED_MODULES) $(EXTRA_EXCLUDED_MODULES)" \
+			$(CUSTOM_BUILDFLAGS) \
+			group_include="kstandard"
+
+	touch configure-stamp
+
+
+build: build-stamp
+build-arch: build-stamp
+build-indep: build-stamp
+build-stamp: configure-stamp
+	dh_testdir
+	# Add here commands to compile the package.
+	$(MAKE) all
+	# make groups
+	$(call PACKAGE_GRP_BUILD_template)
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	# Add here commands to clean up after the build process.
+	$(MAKE) maintainer-clean
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_prep
+	dh_installdirs
+	# Add here commands to install the package into debian/kamailio
+	$(MAKE) install LIBDIR=$(LIBDIR) group_include="kstandard"
+	# make group packages
+	$(call PACKAGE_GRP_INSTALL_template)
+	$(call PACKAGE_EXTRA_INSTALL_template)
+	mv $(CURDIR)/debian/kamailio-berkeley-modules/usr/sbin/kambdb_recover \
+		$(CURDIR)/debian/kamailio-berkeley-bin/usr/sbin/kambdb_recover
+	# install /etc/default/kamailio file
+	mkdir -p $(CURDIR)/debian/kamailio/etc/default
+	cp -f debian/kamailio.default $(CURDIR)/debian/kamailio/etc/default/kamailio
+
+
+# This single target is used to build all the packages, all at once, or
+# one at a time. So keep in mind: any options passed to commands here will
+# affect _all_ packages. Anything you want to only affect one package
+# should be put in another target, such as the install target.
+binary-common:
+	dh_testdir
+	dh_testroot
+	dh_installdebconf
+	dh_installdocs
+	dh_installexamples
+	dh_installmenu
+	dh_installinit -pkamailio -- defaults 23
+	dh_installcron
+	dh_installman
+	dh_installinfo
+	dh_lintian
+	dh_installchangelogs ChangeLog
+	dh_link
+	dh_strip --dbg-package=kamailio-dbg
+	dh_compress
+	dh_fixperms
+	dh_makeshlibs
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+# Build architecture-independent packages using the common target
+binary-indep: build install
+# (Uncomment this next line if you have such packages.)
+#        $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
+# We have nothing to do by default.
+
+
+# Build architecture-dependent packages using the common target
+binary-arch: build install
+	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
+
+# Any other binary targets build just one binary package at a time.
+binary-%: build install
+	$(MAKE) -f debian/rules binary-common DH_OPTIONS=-p$*
+
+print-version:
+	@@echo "Debian version:          $(DEBVERSION)"
+	@@echo "Upstream version:        $(UPVERSION)"
+
+get-orig-source:
+	@@dh_testdir
+	@@[ -d ../tarballs/. ]||mkdir -p ../tarballs
+	@@echo Downloading $(FILENAME) from $(URL) ...
+	@@wget -nv -T10 -t3 -O ../tarballs/$(FILENAME) $(URL)
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
+
diff --git a/pkg/kamailio/deb/jessie/source.lintian-overrides b/pkg/kamailio/deb/jessie/source.lintian-overrides
new file mode 100644
index 0000000..620d9ff
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/source.lintian-overrides
@@ -0,0 +1 @@
+kamailio source: debian-watch-file-in-native-package
diff --git a/pkg/kamailio/deb/jessie/source/format b/pkg/kamailio/deb/jessie/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/pkg/kamailio/deb/jessie/watch b/pkg/kamailio/deb/jessie/watch
new file mode 100644
index 0000000..c50f31f
--- /dev/null
+++ b/pkg/kamailio/deb/jessie/watch
@@ -0,0 +1,3 @@
+version=3
+opts=dversionmangle=s/\~svn([\d]+)//; \
+http://www.kamailio.org/pub/kamailio/([\d.]+)/src/kamailio-([\d.]+)_src\.tar\.gz
diff --git a/pkg/kamailio/deb/precise/changelog b/pkg/kamailio/deb/precise/changelog
new file mode 100644
index 0000000..d13762c
--- /dev/null
+++ b/pkg/kamailio/deb/precise/changelog
@@ -0,0 +1,118 @@
+kamailio (4.1.5) unstable; urgency=low
+
+  * update to 4.1.5 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Wed, 06 Aug 2014 16:50:20 +0100
+
+kamailio (4.1.4) unstable; urgency=low
+
+  * update to 4.1.4 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 12 Jun 2014 15:55:55 +0100
+
+kamailio (4.1.3) unstable; urgency=low
+
+  * update to 4.1.3 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 24 Apr 2014 10:45:20 +0100
+
+kamailio (4.1.2) unstable; urgency=low
+
+  * update to 4.1.2 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 06 Mar 2014 15:25:35 +0100
+
+kamailio (4.1.1) unstable; urgency=low
+
+  * update to 4.1.1 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 09 Jan 2014 15:45:35 +0100
+
+kamailio (4.1.0) unstable; urgency=low
+
+  * update to 4.1.0
+
+ -- Victor Seva <linuxmaniac at torreviejawireless.org>  Wed, 04 Dec 2013 11:42:27 +0100
+
+kamailio (4.0.0) unstable; urgency=low
+
+  * update to 4.0.0 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Mon, 11 Mar 2013 10:40:30 +0100
+
+kamailio (3.4.0~dev0) unstable; urgency=low
+
+  * update version to 3.4.0~dev0
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Wed, 15 Jun 2012 03:15:00 +0100
+
+kamailio (3.2.0) unstable; urgency=low
+
+  * update to 3.2.0 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Fri, 29 Apr 2011 12:25:30 +0100
+
+kamailio (3.1.1) unstable; urgency=low
+
+  * update to 3.1.1 from upstream
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Fri, 3 Dec 2010 16:30:00 +0100
+
+kamailio (3.1.0) unstable; urgency=low
+
+  * update to 3.1.0 from upstream
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Wed, 6 Oct 2010 17:24:00 +0100
+
+kamailio (3.0.2.99) unstable; urgency=low
+
+  * update to 3.0.2.99 for development version builds
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Fri, 28 May 2010 22:26:00 +0100
+
+kamailio (3.0.2) unstable; urgency=low
+
+  * update to 3.0.2 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 27 May 2010 10:27:36 +0100
+
+kamailio (3.0.1) unstable; urgency=low
+
+  * update to 3.0.1 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Mon, 08 Mar 2010 20:30:48 +0100
+
+kamailio (3.0.0) unstable; urgency=low
+
+  * update to 3.0.0 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Mon, 11 Jan 2010 18:30:42 +0100
+
+kamailio (3.0.0-rc3) unstable; urgency=low
+
+  * update to 3.0.0-rc3 from upstream
+  * updated debian/rules to work with the SIP Router style module packaging
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Fri, 10 Dec 2009 12:10:02 +0100
+
+kamailio (3.0.0-rc2) unstable; urgency=low
+
+  * update to 3.0.0-rc2 from upstream
+  * updated debian/rules to work with the new style module packaging
+
+ -- Jonas Bergler <jonas.bergler at staff.snap.net.nz>  Wed, 18 Nov 2009 12:30:02 +1300
+
+kamailio (1.5.0-svn1) unstable; urgency=low
+
+  * increment debian packaging for trunk
+
+ -- Henning Westerholt <henning.westerholt at 1und1.de>  Mon, 02 Mar 2009 17:40:02 +0100
+
+kamailio (1.4.0-svn1) unstable; urgency=low
+
+  [ Klaus Darilion ]
+  * first release of Kamailio (after renaming from Openser)
+
+ -- Julien BLACHE <jblache at debian.org>  Wed, 12 Dec 2007 17:25:31 +0100
+
+
diff --git a/pkg/kamailio/deb/precise/compat b/pkg/kamailio/deb/precise/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/pkg/kamailio/deb/precise/compat
@@ -0,0 +1 @@
+9
diff --git a/pkg/kamailio/deb/precise/control b/pkg/kamailio/deb/precise/control
new file mode 100644
index 0000000..10ebf76
--- /dev/null
+++ b/pkg/kamailio/deb/precise/control
@@ -0,0 +1,556 @@
+Source: kamailio
+Section: net
+Priority: optional
+Maintainer: Debian VoIP Team <pkg-voip-maintainers at lists.alioth.debian.org>
+Uploaders: Victor Seva <linuxmaniac at torreviejawireless.org>,
+           Tzafrir Cohen <tzafrir at debian.org>
+Build-Depends: bison,
+               debhelper (>= 9),
+               docbook-xml,
+               dpkg-dev (>= 1.16.1.1),
+               flex,
+               gcj-jdk,
+               libconfuse-dev,
+               libcurl4-openssl-dev,
+               libdb-dev (>= 4.6.19),
+               libevent-dev,
+               libexpat1-dev,
+               libradiusclient-ng-dev,
+               libgeoip-dev (>= 1.4.5),
+               libhiredis-dev (>= 0.10.0),
+               libjson0-dev,
+               libldap2-dev,
+               liblua5.1-0-dev,
+               libmemcached-dev,
+               libmono-2.0-dev,
+               libmysqlclient-dev,
+               libncurses5-dev,
+               libpcre3-dev,
+               libperl-dev,
+               libpq-dev,
+               libpurple-dev,
+               libreadline-dev,
+               libsasl2-dev,
+               libsctp-dev,
+               libsnmp-dev,
+               libsqlite3-dev,
+               libunistring-dev,
+               libxml2-dev,
+               openssl,
+               python,
+               python-dev,
+               unixodbc-dev,
+               xsltproc,
+               zlib1g-dev
+Standards-Version: 3.9.5
+Homepage: http://www.kamailio.org/
+Vcs-git: git://anonscm.debian.org/pkg-voip/kamailio.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-voip/kamailio.git
+
+Package: kamailio
+Architecture: linux-any
+Multi-Arch: foreign
+Pre-Depends: ${misc:Pre-Depends}
+Depends: adduser, python, ${misc:Depends}, ${shlibs:Depends}
+Suggests: kamailio-berkeley-modules,
+          kamailio-carrierroute-modules,
+          kamailio-cpl-modules,
+          kamailio-dbg,
+          kamailio-ldap-modules,
+          kamailio-lua-modules,
+          kamailio-mysql-modules,
+          kamailio-perl-modules,
+          kamailio-postgres-modules,
+          kamailio-presence-modules,
+          kamailio-python-modules,
+          kamailio-radius-modules,
+          kamailio-snmpstats-modules,
+          kamailio-tls-modules,
+          kamailio-unixodbc-modules,
+          kamailio-xml-modules,
+          kamailio-xmpp-modules
+Description: very fast and configurable SIP proxy
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ C Shell-like scripting language provides full control over the server's
+ behaviour. Its modular architecture allows only required functionality to be
+ loaded.
+ .
+ Among others, the following modules are available: digest authentication, CPL
+ scripts, instant messaging, MySQL support, presence agent, RADIUS
+ authentication, record routing, SMS gateway, Jabber/XMPP gateway, transaction
+ module, registrar and user location, XML-RPC interface.
+ .
+ This package contains the main Kamailio binary along with the principal modules
+ and support binaries.
+
+Package: kamailio-dbg
+Priority: extra
+Section: debug
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}
+Description: very fast and configurable SIP proxy [debug symbols]
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains the debugging symbols for the Kamailio binaries and
+ modules. You only need to install it if you need to debug Kamailio.
+
+Package: kamailio-geoip-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the geoip module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the geoip module, an extension allowing to
+ use GeoIP API within configuration file.
+
+Package: kamailio-sqlite-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Recommends: sqlite3
+Description: SQLite database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the SQLite database driver for Kamailio.
+
+Package: kamailio-json-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Json parser and jsonrpc modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides json parser for Kamailio's configuration file
+ and the JSON-RPC client over netstrings.
+
+Package: kamailio-memcached-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Replaces: kamailio-memcached-module
+Description: Provides the memcached module, an interface to the memcached server
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the memcached module, an interface to the memcached
+ server, a high-performance, distributed memory object caching system.
+
+Package: kamailio-lua-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the app_lua module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_lua module, an extension allowing to
+ execute embedded Lua applications within configuration file.
+
+Package: kamailio-mono-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the app_mono module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_mono module, an extension allowing to
+ execute embedded Mono applications within configuration file.
+
+Package: kamailio-python-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         python-dev,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: contains the app_python module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_python module, an extension allowing to
+ execute embedded Python applications within configuration file.
+
+Package: kamailio-redis-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Redis database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the Redis NOSQL database driver for Kamailio.
+
+Package: kamailio-mysql-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         mysql-client,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: MySQL database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the MySQL database driver for Kamailio.
+
+Package: kamailio-postgres-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         postgresql-client,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: PostgreSQL database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the PostgreSQL database driver for Kamailio.
+
+Package: kamailio-cpl-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: CPL module (CPL interpreter engine) for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides a CPL (Call Processing Language) interpreter for
+ Kamailio, turning Kamailio into a CPL server (storage and interpreter).
+
+Package: kamailio-radius-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: RADIUS modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides a set of RADIUS modules for Kamailio, for
+ authentication, peering, group membership and messages URIs checking against a
+ RADIUS server.
+
+Package: kamailio-unixodbc-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: unixODBC database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the unixODBC database driver for Kamailio.
+
+Package: kamailio-presence-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: SIMPLE presence modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides several Kamailio modules for implementing presence
+ server and presence user agent for RICH presence, registrar-based presence,
+ external triggered presence and XCAP support.
+
+Package: kamailio-perl-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Perl extensions and database driver for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides an interface for Kamailio to write Perl extensions and
+ the perlvdb database driver for Kamailio.
+
+Package: kamailio-snmpstats-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         snmpd,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: SNMP AgentX subagent module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the snmpstats module for Kamailio. This module acts
+ as an AgentX subagent which connects to a master agent.
+
+Package: kamailio-purple-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Provides the purple module, a multi-protocol IM gateway
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the purple module, a multi-protocol instant
+ messaging gateway module.
+
+Package: kamailio-xmpp-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: XMPP gateway module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the SIP to XMPP IM translator module for Kamailio.
+
+Package: kamailio-xml-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Replaces: kamailio-xml-module, kamailio-xmlrpc-module
+Provides: kamailio-xmlrpc-modules
+Description: XML based extensions for Kamailio's Management Interface
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides:
+ - the XMLRPC transport implementations for Kamailio's
+ Management and Control Interface.
+ - xmlops module for XPath operations in configuration file
+
+Package: kamailio-carrierroute-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: carrierroute module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the carrierroute module for Kamailio, an integrated
+ solution for routing, balancing and blacklisting.
+
+Package: kamailio-berkeley-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: db5.1-util,
+         kamailio (= ${binary:Version}),
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: Berkeley database module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the Berkeley database module for Kamailio, a
+ high-performance embedded DB kernel. All database tables are stored
+ in files, no additional server is necessary.
+
+Package: kamailio-berkeley-bin
+Architecture: linux-any
+Multi-Arch: foreign
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: Berkeley database module for Kamailio - helper program
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides helper modules for the Berkeley database module for
+ Kamailio, a high-performance embedded DB kernel. You should normally
+ install kamailio-berkeley-modules and not this package directly.
+
+Package: kamailio-ldap-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: LDAP modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the ldap and h350 modules for Kamailio, enabling LDAP
+ queries from the Kamailio config and storage of SIP account data in an LDAP
+ directory.
+
+Package: kamailio-ims-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: IMS module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains various Diameter interfaces and modules for Kamailio
+ to run as an IMS core.
+
+Package: kamailio-utils-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Provides a set utility functions for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ Provides a set of utility functions for Kamailio, which are not related
+ to the server configuration.
+
+Package: kamailio-sctp-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: sctp module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the sctp module for Kamailio.
+
+Package: kamailio-java-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: gcj-jre,
+         kamailio (= ${binary:Version}),
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: contains the app_java module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_java module, an extension allowing to
+ execute embedded Java applications within configuration file.
+
+Package: kamailio-tls-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the TLS kamailio transport module
+ This has been split out of the main kamailio package, so that kamailio will
+ not depend on openssl. This module will enable you to use the TLS transport.
+
+Package: kamailio-outbound-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Outbound module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains the module implementing SIP outbound extension.
+
+Package: kamailio-websocket-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Websocket module for kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains the module implementing WebSocket transport layer.
+
+Package: kamailio-autheph-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: authentication using ephemeral credentials module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the ephemeral module for Kamailio.
+
+Package: kamailio-extra-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: extra modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides: gzcompress
+
+Package: kamailio-nth
+Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: binutils,
+         bison,
+         bvi,
+         flex,
+         gcc,
+         gdb,
+         iftop,
+         lsof,
+         mc,
+         most,
+         ngrep,
+         psmisc,
+         screen,
+         sipsak,
+         tcpdump,
+         vim,
+         ${misc:Depends}
+Description: Kamailio - package for "nice to have" installation
+ This is a metapackage for easy installation various useful tools that may be
+ handy on server with Kamailio installed.
diff --git a/pkg/kamailio/deb/precise/copyright b/pkg/kamailio/deb/precise/copyright
new file mode 100644
index 0000000..ff31338
--- /dev/null
+++ b/pkg/kamailio/deb/precise/copyright
@@ -0,0 +1,335 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Kamailio
+Upstream-Contact: sr-dev at lists.sip-router.org
+Source: http://www.kamailio.org/pub/kamailio/
+
+Files: *
+Copyright:
+ 2001-2003 FhG Fokus
+ 2006-2010 iptelorg GmbH
+ Various others (see AUTHORS file)
+License: GPL-2.0+
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+
+Files: debian/*
+Copyright: 2012, 2013, 2014 Victor Seva <linuxmaniac at torreviejawireless.org>
+           2009, 2010, 2011, Daniel-Constantin Mierla <miconda at gmail.com>
+           2010, Jon Bonilla <manwe at aholab.ehu.es>
+           2009, Jonas Bergler <jonas.bergler at staff.snap.net.nz>
+           2009, Henning Westerholt <henning.westerholt at 1und1.de>
+           2007, Julien BLACHE <jblache at debian.org>
+License: GPL-2+
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+
+
+Files: atomic/* atomic_ops.* basex.* bit_*.c char_msg_val.h compiler_opt.h
+ core_stats.h counters.* endianness.* futexlock.h hashes.h io_wait.*
+ kstats_types.h lib/kcore/kstats_wrapper.* lock_ops.c lock_ops_init.h
+ lvalue.* mem/ll_malloc.* mem/memdbg.h mem/sf_malloc.* mi/*.h mod_fix.*
+ modules/tm/rpc_uac.* modules/counters/counters.c modules/tls/sbufq.h
+ modules/tls/tls_bio.* modules/tls/tls_cfg.* modules/tls/tls_cfg.h
+ modules/tls/tls_ct_wrq.* modules/tls/tls_ct_q.h modules/tls/tls_domain.*
+ modules/tls/tls_server.h modules/tls/tls_locking.* modules/tls/tls_rpc.*
+ modules/tls/tls_server.c modules/malloc_test/malloc_test.c modules/blst/blst.c
+ parser/case_p_* parser/case_reas.h pvapi.h pv_core.* rand/fastrand.* raw_*
+ rpc_lookup.* rvalue.* sctp_* ser_time.h shm_init.* sip_msg_clone.* sock_ut.*
+ sr_compat.* str_hash.h switch.* tcp_ev.h tcp_int_send.h tcp_options.*
+ tcp_read.h tcp_stats.* timer_proc.* tls_hooks.* tls_hooks_init.h ver.*
+Copyright: 2006-2010 iptelorg GmbH
+License: ISC
+
+Files: modules/tls/tls_select.* modules/tls/tls_dump_vf.*
+Copyright: 2005-2010 iptelorg GmbH
+License: GPL-2 + OpenSSL exception
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+ * Exception: permission to copy, modify, propagate, and distribute a work
+ * formed by combining OpenSSL toolkit software and the code in this file,
+ * such as linking with software components and libraries released under
+ * OpenSSL project license.
+
+Files: modules/websocket/* modules/outbound/* modules/auth_ephemeral/*
+Copyright: 2012-2013 Crocodile RCS Ltd
+License: GPL-2 + OpenSSL exception
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+ * Exception: permission to copy, modify, propagate, and distribute a work
+ * formed by combining OpenSSL toolkit software and the code in this file,
+ * such as linking with software components and libraries released under
+ * OpenSSL project license.
+
+Files: daemonize.* fastlock.h lock_ops.h mem/mem.* mem/f_malloc.h
+ mem/meminfo.h mem/memtest.c mem/shm_mem.c mem/q_malloc.h mem/q_malloc.c
+ mem/shm_mem.h mem/f_malloc.c modules/tls/tls_rpc.c modules/tls/tls_server.c
+ modules/tls/tls_domain.c modules/tls/tls_domain.h modules/tls/tls_server.h
+ modules/tls/tls_rpc.h pt.c pt.h sched_yield.h ut.c ut.h
+Copyright: 2001-2003 FhG Fokus
+License: ISC
+
+Files: events.* modules/topoh/*
+Copyright: 2009 SIP-Router.org
+License: ISC
+
+Files: modules/mi_rpc/mi_rpc_mod.c modules/pv/pv_xavp.*
+ modules/usrloc/ul_rpc.* ppcfg.* xavp.*
+Copyright: 2009-2010 Daniel-Constantin Mierla (asipto.com)
+License: ISC
+
+Files: obsolete/jabber_k/tree234.*
+Copyright: 1999, 2000, 2001, Simon Tatham
+License: Expat
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or
+ sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+ .
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT.  IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+
+Files: modules/xmpp/xsnprintf.c obsolete/jabber_s/xsnprintf.c obsolete/jabber_k/xsnprintf.c
+Copyright: 1995-1998, The Apache Group
+License: Apache-1.0
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ .
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+ .
+ 3. All advertising materials mentioning features or use of this
+    software must display the following acknowledgment:
+    "This product includes software developed by the Apache Group
+    for use in the Apache HTTP server project (http://www.apache.org/)."
+ .
+ 4. The names "Apache Server" and "Apache Group" must not be used to
+    endorse or promote products derived from this software without
+    prior written permission.
+ .
+ 5. Redistributions of any form whatsoever must retain the following
+    acknowledgment:
+    "This product includes software developed by the Apache Group
+    for use in the Apache HTTP server project (http://www.apache.org/)."
+ .
+ THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
+ EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Files: modules/mi_xmlrpc/abyss*
+Copyright: 2000, Moez Mahfoudh <mmoez at bigfoot.com>
+License: BSD-3-clause
+
+Files: list.h
+Copyright: 1991, 1993 The Regents of the University of California
+License: BSD-3-clause
+
+Files: modules/tm/t_serial.*
+Copyright: 2008 Juha Heinanen
+License: BSD-2-clause
+
+Files: parser/sdp/sdp.* parser/sdp/sdp_helpr_funcs.* parser/sdp/sdp_cloner.h
+Copyright:
+ 2008-2009 SOMA Networks, INC.
+ 2010 VoIP Embedded, Inc
+License: BSD-2-clause
+
+Files: modules/tls/fixed_c_zlib.h
+Copyright:1998-2005 The OpenSSL Project
+Comment: file copied from OpenSSL 0.9.8, refers to OpenSSL License. Note that
+ this code will not build by default in the Debian packaging.
+License: OpenSSL
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ .
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+ .
+ 3. All advertising materials mentioning features or use of this
+    software must display the following acknowledgment:
+    "This product includes software developed by the OpenSSL Project
+    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ .
+ 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+    endorse or promote products derived from this software without
+    prior written permission. For written permission, please contact
+    openssl-core at openssl.org.
+ .
+ 5. Products derived from this software may not be called "OpenSSL"
+    nor may "OpenSSL" appear in their names without prior written
+    permission of the OpenSSL Project.
+ .
+ 6. Redistributions of any form whatsoever must retain the following
+    acknowledgment:
+    "This product includes software developed by the OpenSSL Project
+    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ .
+ THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Files: md5.* md5utils.c
+Copyright: 1991-2, RSA Data Security, Inc
+Comment: Note that md5.c and md5.h have been replaced in the patches
+ plum_md5*.patch .
+ .
+ As for md5utils.c, according to a mail from Upstream (Daniel-Constantin
+ Mierla): while the initial commit log for it states that it is derived
+ from mddriver.c of RFC 1321, it seems that it was, in fact, written from
+ scratch by Jiri Kuthan (a core developer of SER at that time, working for
+ FhG Fokus Institute). As you can see it's rather trivial and uses a data
+ type of SER ("str").  I didn't reimplement it as it's too trivial and
+ looks like there's no other way to implement it.
+License: RSA-MD5
+ License to copy and use this software is granted provided that it
+ is identified as the "RSA Data Security, Inc. MD5 Message-Digest
+ Algorithm" in all material mentioning or referencing this software
+ or this function.
+ .
+ License is also granted to make and use derivative works provided
+ that such works are identified as "derived from the RSA Data
+ Security, Inc. MD5 Message-Digest Algorithm" in all material
+ mentioning or referencing the derived work.
+ .
+ RSA Data Security, Inc. makes no representations concerning either
+ the merchantability of this software or the suitability of this
+ software for any particular purpose. It is provided "as is"
+ without express or implied warranty of any kind.
+ .
+ These notices must be retained in any copies of any part of this
+ documentation and/or software.
+
+Files: mem/dl_*
+Copyright: n/a
+License: public-domain
+ This is a version (aka dlmalloc) of malloc/free/realloc written by
+ Doug Lea and released to the public domain, as explained at
+ http://creativecommons.org/licenses/publicdomain.  Send questions,
+ comments, complaints, performance data, etc to dl at cs.oswego.edu
+
+Files: rand/isaac/*
+Copyright: n/a
+License: public-domain
+ By Bob Jenkins.  My random number generator, ISAAC.  Public Domain.
+
+License: ISC
+ Permission to use, copy, modify, and distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Files: lib/srutils/srjson.*
+Copyright: 2009 Dave Gamble
+License: MIT
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ ,
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+
+License: BSD-3-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 4. Neither the name of the University nor the names of its contributors
+    may be used to endorse or promote products derived from this software
+    without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+License: BSD-2-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ .
+  1. Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/pkg/kamailio/deb/precise/kamailio-autheph-modules.lintian-overrides b/pkg/kamailio/deb/precise/kamailio-autheph-modules.lintian-overrides
new file mode 100644
index 0000000..dcb3d18
--- /dev/null
+++ b/pkg/kamailio/deb/precise/kamailio-autheph-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-autheph-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/precise/kamailio-berkeley-bin.dirs b/pkg/kamailio/deb/precise/kamailio-berkeley-bin.dirs
new file mode 100644
index 0000000..236670a
--- /dev/null
+++ b/pkg/kamailio/deb/precise/kamailio-berkeley-bin.dirs
@@ -0,0 +1 @@
+usr/sbin
diff --git a/pkg/kamailio/deb/precise/kamailio-dnssec-modules.lintian-overrides b/pkg/kamailio/deb/precise/kamailio-dnssec-modules.lintian-overrides
new file mode 100644
index 0000000..10165fe
--- /dev/null
+++ b/pkg/kamailio/deb/precise/kamailio-dnssec-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-dnssec-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/precise/kamailio-outbound-modules.lintian-overrides b/pkg/kamailio/deb/precise/kamailio-outbound-modules.lintian-overrides
new file mode 100644
index 0000000..3050cfe
--- /dev/null
+++ b/pkg/kamailio/deb/precise/kamailio-outbound-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-outbound-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/precise/kamailio-tls-modules.lintian-overrides b/pkg/kamailio/deb/precise/kamailio-tls-modules.lintian-overrides
new file mode 100644
index 0000000..bbe0d37
--- /dev/null
+++ b/pkg/kamailio/deb/precise/kamailio-tls-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/precise/kamailio-websocket-modules.lintian-overrides b/pkg/kamailio/deb/precise/kamailio-websocket-modules.lintian-overrides
new file mode 100644
index 0000000..8f384fb
--- /dev/null
+++ b/pkg/kamailio/deb/precise/kamailio-websocket-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-websocket-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/precise/kamailio.README.Debian b/pkg/kamailio/deb/precise/kamailio.README.Debian
new file mode 100644
index 0000000..d25769a
--- /dev/null
+++ b/pkg/kamailio/deb/precise/kamailio.README.Debian
@@ -0,0 +1,39 @@
+Kamailio for Debian
+-------------------
+
+* init script check for fork=no
+-------------------------------
+
+The Kamailio init script will not start Kamailio on boot if fork=no is
+specified in the config file. The check in the initscript will match
+any occurrence of fork=no in the file, even inside C-style comments.
+
+You can disable this check in the init script if you wish; just comment
+out the calls to the check_fork function in the script. Your changes to
+the init script will be preserved upon upgrade, as the file is tagged
+as a conffile.
+
+
+* Kamailio setup
+----------------
+
+To setup Kamailio, you need to:
+ - configure Kamailio properly to suit your needs
+ - edit /etc/default/kamailio, adjust the MEMORY parameter and set
+   RUN_KAMAILIO to "yes"
+
+If you are building an HA cluster using heartbeat or similar, you'll want
+to disable the init script by running:
+
+  update-rc.d kamailio remove
+
+so that Kamailio will not be launched at system startup. You still need
+to set RUN_KAMAILIO to "yes" if you want to use the /etc/init.d/kamailio init
+script.
+
+Set the DUMP_CORE parameter in /etc/default/kamailio to "yes" if you want to
+get a core dump in case Kamailio crashes. The debug symbols for Kamailio are
+provided by the kamailio-dbg package.
+
+
+ -- Victor Seva <linuxmaniac at torreviejawireless.org>  Wed, 11 Dec 2013 16:07:11 +0100
diff --git a/pkg/kamailio/deb/precise/kamailio.default b/pkg/kamailio/deb/precise/kamailio.default
new file mode 100644
index 0000000..0cfc8c8
--- /dev/null
+++ b/pkg/kamailio/deb/precise/kamailio.default
@@ -0,0 +1,28 @@
+#
+# Kamailio startup options
+#
+
+# Set to yes to enable kamailio, once configured properly.
+#RUN_KAMAILIO=yes
+
+# User to run as
+#USER=kamailio
+
+# Group to run as
+#GROUP=kamailio
+
+# Amount of shared and private memory to allocate
+# for the running Kamailio server (in Mb)
+#SHM_MEMORY=64
+#PKG_MEMORY=4
+
+# Config file
+#CFGFILE=/etc/kamailio/kamailio.cfg
+
+# Enable the server to leave a core file when it crashes.
+# Set this to 'yes' to enable Kamailio to leave a core file when it crashes
+# or 'no' to disable this feature. This option is case sensitive and only
+# accepts 'yes' and 'no' and only in lowercase letters.
+# On some systems it is necessary to specify a directory for the core files
+# to get a dump. Look into the kamailio init file for an example configuration.
+#DUMP_CORE=yes
diff --git a/pkg/kamailio/deb/precise/kamailio.examples b/pkg/kamailio/deb/precise/kamailio.examples
new file mode 100644
index 0000000..c48447a
--- /dev/null
+++ b/pkg/kamailio/deb/precise/kamailio.examples
@@ -0,0 +1,2 @@
+examples/*
+
diff --git a/pkg/kamailio/deb/precise/kamailio.init b/pkg/kamailio/deb/precise/kamailio.init
new file mode 100644
index 0000000..d4801d2
--- /dev/null
+++ b/pkg/kamailio/deb/precise/kamailio.init
@@ -0,0 +1,162 @@
+#! /bin/sh
+#
+### BEGIN INIT INFO
+# Provides:          kamailio
+# Required-Start:    $syslog $network $local_fs $remote_fs $time
+# Should-Start:      $named slapd mysql postgresql snmpd radiusd
+# Should-Stop:       $named slapd mysql postgresql snmpd radiusd
+# Required-Stop:     $syslog $network $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start the Kamailio SIP proxy server
+# Description:       Start the Kamailio SIP proxy server
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/kamailio
+NAME=kamailio
+DESC="Kamailio SIP server"
+HOMEDIR=/var/run/kamailio
+PIDFILE=$HOMEDIR/$NAME.pid
+DEFAULTS=/etc/default/kamailio
+CFGFILE=/etc/kamailio/kamailio.cfg
+RUN_KAMAILIO=no
+USER=kamailio
+GROUP=kamailio
+# Amount of shared and private memory to allocate
+# for the running Kamailio server (in Mb)
+SHM_MEMORY=64
+PKG_MEMORY=4
+DUMP_CORE=no
+
+# Do not start kamailio if fork=no is set in the config file
+# otherwise the boot process will just stop
+check_fork ()
+{
+    if grep -q "^[[:space:]]*fork[[:space:]]*=[[:space:]]*no.*" $CFGFILE; then
+	log_failure_msg "Not starting $DESC: fork=no specified in config file; run /etc/init.d/kamailio debug instead"
+	exit 0
+    fi
+}
+
+check_kamailio_config ()
+{
+	# Check if kamailio configuration is valid before starting the server
+	set +e
+	out=$($DAEMON -f $CFGFILE -M $PKG_MEMORY -c 2>&1 > /dev/null)
+	retcode=$?
+	set -e
+	if [ "$retcode" != '0' ]; then
+	    log_failure_msg "Not starting $DESC: invalid configuration file!"
+	    log_failure_msg
+	    log_failure_msg "$out"
+	    log_failure_msg
+	    exit 1
+	fi
+}
+
+create_radius_seqfile ()
+{
+    # Create a radius sequence file to be used by the radius client if
+    # radius accounting is enabled. This is needed to avoid any issue
+    # with the file not being writable if kamailio first starts as user
+    # root because DUMP_CORE is enabled and creates this file as user
+    # root and then later it switches back to user kamailio and cannot
+    # write to the file. If the file exists before kamailio starts, it
+    # won't change it's ownership and will be writable for both root
+    # and kamailio, no matter what options are chosen at install time
+    RADIUS_SEQ_FILE=/var/run/kamailio/kamailio_radius.seq
+    if [ -d /var/run/kamailio ]; then
+	chown ${USER}:${GROUP} /var/run/kamailio
+
+	if [ ! -f $RADIUS_SEQ_FILE ]; then
+	    touch $RADIUS_SEQ_FILE
+	fi
+
+	chown ${USER}:${GROUP} $RADIUS_SEQ_FILE
+	chmod 660 $RADIUS_SEQ_FILE
+    fi
+}
+
+test -f $DAEMON || exit 0
+
+# Load startup options if available
+if [ -f $DEFAULTS ]; then
+   . $DEFAULTS || true
+fi
+
+if [ "$RUN_KAMAILIO" != "yes" ]; then
+    log_failure_msg "Kamailio not yet configured. Edit /etc/default/kamailio first."
+    exit 0
+fi
+
+set -e
+
+SHM_MEMORY=$((`echo $SHM_MEMORY | sed -e 's/[^0-9]//g'`))
+PKG_MEMORY=$((`echo $PKG_MEMORY | sed -e 's/[^0-9]//g'`))
+[ -z "$USER" ]  && USER=kamailio
+[ -z "$GROUP" ] && GROUP=kamailio
+[ $SHM_MEMORY -le 0 ] && SHM_MEMORY=64
+[ $PKG_MEMORY -le 0 ] && PKG_MEMORY=4
+
+if test "$DUMP_CORE" = "yes" ; then
+    # set proper ulimit
+    ulimit -c unlimited
+
+    # directory for the core dump files
+    # COREDIR=/home/corefiles
+    # [ -d $COREDIR ] || mkdir $COREDIR
+    # chmod 777 $COREDIR
+    # echo "$COREDIR/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
+fi
+
+# /var/run can be a tmpfs
+if [ ! -d $HOMEDIR ]; then
+    mkdir -p $HOMEDIR
+fi
+
+OPTIONS="-f $CFGFILE -P $PIDFILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP"
+
+case "$1" in
+  start|debug)
+	check_kamailio_config
+	create_radius_seqfile
+
+	if [ "$1" != "debug" ]; then
+	    check_fork
+	fi
+
+	log_daemon_msg "Starting $DESC: $NAME"
+	start-stop-daemon --start --quiet --pidfile $PIDFILE \
+		--exec $DAEMON -- $OPTIONS || log_failure_msg " already running"
+	log_end_msg 0
+	;;
+  stop)
+	log_daemon_msg "Stopping $DESC: $NAME"
+	start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
+		--exec $DAEMON
+	log_end_msg 0
+	;;
+  restart|force-reload)
+	check_kamailio_config
+	create_radius_seqfile
+
+	$0 stop
+	sleep 1
+	$0 start
+	;;
+  status)
+	log_daemon_msg "Status of $DESC: "
+
+	status_of_proc -p"$PIDFILE" $NAME $NAME
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload|status|debug}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/pkg/kamailio/deb/precise/kamailio.lintian-overrides b/pkg/kamailio/deb/precise/kamailio.lintian-overrides
new file mode 100644
index 0000000..18152ed
--- /dev/null
+++ b/pkg/kamailio/deb/precise/kamailio.lintian-overrides
@@ -0,0 +1,2 @@
+kamailio binary: example-interpreter-not-absolute usr/share/doc/kamailio/examples/outbound/edge.cfg #!KAMAILIO
+kamailio binary: example-interpreter-not-absolute usr/share/doc/kamailio/examples/outbound/registrar.cfg #!KAMAILIO
diff --git a/pkg/kamailio/deb/precise/kamailio.postinst b/pkg/kamailio/deb/precise/kamailio.postinst
new file mode 100644
index 0000000..4ee38ec
--- /dev/null
+++ b/pkg/kamailio/deb/precise/kamailio.postinst
@@ -0,0 +1,24 @@
+#! /bin/sh
+
+set -e
+
+case "$1" in
+    configure)
+        adduser --quiet --system --group --disabled-password \
+                --shell /bin/false --gecos "Kamailio SIP Server" \
+                --home /var/run/kamailio kamailio || true
+
+        ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+        ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+        ;;
+esac
+
+#DEBHELPER#
+
diff --git a/pkg/kamailio/deb/precise/rules b/pkg/kamailio/deb/precise/rules
new file mode 100755
index 0000000..7b9dcdf
--- /dev/null
+++ b/pkg/kamailio/deb/precise/rules
@@ -0,0 +1,219 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+DEBVERSION:=$(shell head -n 1 debian/changelog \
+                    | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
+UPVERSION:=$(shell dpkg-parsechangelog | sed -ne 's/^Version: \(\([0-9]\+\):\)\?\(.*\)-.*/\3/p')
+
+FILENAME := kamailio_$(UPVERSION).orig.tar.gz
+URL := http://www.kamailio.org/pub/kamailio/$(UPVERSION)/src/kamailio-$(UPVERSION)_src.tar.gz
+
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/buildflags.mk
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+export JAVA_HOME=/usr/lib/jvm/java-gcj
+
+# choose freeradius
+
+# modules not in the "main" kamailio package
+EXCLUDED_MODULES=
+
+# extra modules to skip, because they are not compilable now
+# - regardless if they go to the main kamailio package or to some module package,
+# they will be excluded from compile and install of all
+EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc dnssec
+
+# module groups that are packaged in seperate packages
+# (with the name kamailio-$(group_name)-modules)
+# Note: the order is important (should be in dependency order, the one
+# on which other depend first)
+PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \
+			   ldap xml perl utils lua memcached \
+			   snmpstats carrierroute xmpp cpl redis python geoip\
+			   sqlite json mono ims sctp java \
+			   purple tls outbound websocket autheph 
+
+# module groups to be packaged onto kamailio-extra-modules
+EXTRA_GROUPS=gzcompress
+
+# name of libdir in the path for libraries (e.g., lib for 32b, lib64 for 64b)
+LIBDIR ?= lib/$(DEB_HOST_MULTIARCH)
+
+# directories with possible duplicate libraries (that should be deleted
+# from current module* packages)
+DUP_LIBS_DIRS=$(CURDIR)/debian/kamailio/usr/$(LIBDIR)/kamailio \
+			$(CURDIR)/debian/kamailio-db-modules/usr/$(LIBDIR)/kamailio
+
+# "function" to get package short name out of a dir/module_name
+# it also transforms db_foo into foo
+mod_name=$(subst db_,,$(lastword $(subst /, ,$(1))))
+
+define PACKAGE_GRP_BUILD_template
+	# package all the modules in PACKAGE_GROUPS in separate packages
+	$(foreach grp,$(PACKAGE_GROUPS EXTRA_GROUPS),\
+		$(MAKE) every-module group_include="k$(grp)"
+	)
+endef
+
+
+define PACKAGE_GRP_INSTALL_template
+	$(foreach grp,$(PACKAGE_GROUPS),\
+		$(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \
+		basedir=$(CURDIR)/debian/kamailio-$(grp)-modules \
+		cfg_prefix=$(CURDIR)/debian/kamailio-$(grp)-modules \
+		doc-dir=share/doc/kamailio-$(grp)-modules
+		# eliminate duplicate libs
+		-for d in $(DUP_LIBS_DIRS); do \
+			test "$$d" != "$(CURDIR)/debian/kamailio-$(grp)-modules/usr/$(LIBDIR)/kamailio" &&\
+			for r in `find $$d -name 'lib*'|xargs`; do \
+				echo "removing $(grp) lib `basename $$r` present also in $$d";\
+				rm -f $(CURDIR)/debian/kamailio-$(grp)-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \
+			done ; \
+		done
+		find $(CURDIR)/debian/kamailio-$(grp)-modules -depth -empty -type d -exec rmdir {} \;
+	)
+endef
+
+define PACKAGE_EXTRA_INSTALL_template
+	$(foreach grp,$(EXTRA_GROUPS),\
+		$(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \
+		basedir=$(CURDIR)/debian/kamailio-extra-modules \
+		cfg_prefix=$(CURDIR)/debian/kamailio-extra-modules \
+		doc-dir=share/doc/kamailio-extra-modules
+	)
+	# eliminate duplicate libs
+	-for d in $(DUP_LIBS_DIRS); do \
+		test "$$d" != "$(CURDIR)/debian/kamailio-extra-modules/usr/$(LIBDIR)/kamailio" &&\
+		for r in `find $$d -name 'lib*'|xargs`; do \
+			echo "removing extra lib `basename $$r` present also in $$d";\
+			rm -f $(CURDIR)/debian/kamailio-extra-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \
+		done ; \
+	done
+	find $(CURDIR)/debian/kamailio-extra-modules -depth -empty -type d -exec rmdir {} \;
+endef
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	INSTALL_PROGRAM += -s
+endif
+
+# CFLAGS + CPPFLAGS -> CC_EXTRA_OPTS
+# LDFLAGS -> LD_EXTRA_OPTS
+CUSTOM_BUILDFLAGS:=$(shell dpkg-buildflags --export=configure| \
+sed -e 's/" CPPFLAGS="/ /' -e 's/CFLAGS/CC_EXTRA_OPTS/g' -e 's/LDFLAGS/LD_EXTRA_OPTS/g')
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	# Add here commands to configure the package.
+	$(MAKE) FLAVOUR=kamailio cfg prefix=/usr cfg_prefix=$(CURDIR)/debian/kamailio \
+			cfg_target=/etc/kamailio/ \
+			basedir=$(CURDIR)/debian/kamailio \
+			skip_modules="$(EXCLUDED_MODULES) $(EXTRA_EXCLUDED_MODULES)" \
+			$(CUSTOM_BUILDFLAGS) \
+			group_include="kstandard"
+
+	touch configure-stamp
+
+
+build: build-stamp
+build-arch: build-stamp
+build-indep: build-stamp
+build-stamp: configure-stamp
+	dh_testdir
+	# Add here commands to compile the package.
+	$(MAKE) all
+	# make groups
+	$(call PACKAGE_GRP_BUILD_template)
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	# Add here commands to clean up after the build process.
+	$(MAKE) maintainer-clean
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_prep
+	dh_installdirs
+	# Add here commands to install the package into debian/kamailio
+	$(MAKE) install LIBDIR=$(LIBDIR) group_include="kstandard"
+	# make group packages
+	$(call PACKAGE_GRP_INSTALL_template)
+	$(call PACKAGE_EXTRA_INSTALL_template)
+	mv $(CURDIR)/debian/kamailio-berkeley-modules/usr/sbin/kambdb_recover \
+		$(CURDIR)/debian/kamailio-berkeley-bin/usr/sbin/kambdb_recover
+	# install /etc/default/kamailio file
+	mkdir -p $(CURDIR)/debian/kamailio/etc/default
+	cp -f debian/kamailio.default $(CURDIR)/debian/kamailio/etc/default/kamailio
+
+
+# This single target is used to build all the packages, all at once, or
+# one at a time. So keep in mind: any options passed to commands here will
+# affect _all_ packages. Anything you want to only affect one package
+# should be put in another target, such as the install target.
+binary-common:
+	dh_testdir
+	dh_testroot
+	dh_installdebconf
+	dh_installdocs
+	dh_installexamples
+	dh_installmenu
+	dh_installinit -pkamailio -- defaults 23
+	dh_installcron
+	dh_installman
+	dh_installinfo
+	dh_lintian
+	dh_installchangelogs ChangeLog
+	dh_link
+	dh_strip --dbg-package=kamailio-dbg
+	dh_compress
+	dh_fixperms
+	dh_makeshlibs
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+# Build architecture-independent packages using the common target
+binary-indep: build install
+# (Uncomment this next line if you have such packages.)
+#        $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
+# We have nothing to do by default.
+
+
+# Build architecture-dependent packages using the common target
+binary-arch: build install
+	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
+
+# Any other binary targets build just one binary package at a time.
+binary-%: build install
+	$(MAKE) -f debian/rules binary-common DH_OPTIONS=-p$*
+
+print-version:
+	@@echo "Debian version:          $(DEBVERSION)"
+	@@echo "Upstream version:        $(UPVERSION)"
+
+get-orig-source:
+	@@dh_testdir
+	@@[ -d ../tarballs/. ]||mkdir -p ../tarballs
+	@@echo Downloading $(FILENAME) from $(URL) ...
+	@@wget -nv -T10 -t3 -O ../tarballs/$(FILENAME) $(URL)
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
+
diff --git a/pkg/kamailio/deb/precise/source.lintian-overrides b/pkg/kamailio/deb/precise/source.lintian-overrides
new file mode 100644
index 0000000..620d9ff
--- /dev/null
+++ b/pkg/kamailio/deb/precise/source.lintian-overrides
@@ -0,0 +1 @@
+kamailio source: debian-watch-file-in-native-package
diff --git a/pkg/kamailio/deb/precise/source/format b/pkg/kamailio/deb/precise/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/pkg/kamailio/deb/precise/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/pkg/kamailio/deb/precise/watch b/pkg/kamailio/deb/precise/watch
new file mode 100644
index 0000000..c50f31f
--- /dev/null
+++ b/pkg/kamailio/deb/precise/watch
@@ -0,0 +1,3 @@
+version=3
+opts=dversionmangle=s/\~svn([\d]+)//; \
+http://www.kamailio.org/pub/kamailio/([\d.]+)/src/kamailio-([\d.]+)_src\.tar\.gz
diff --git a/pkg/kamailio/deb/squeeze/changelog b/pkg/kamailio/deb/squeeze/changelog
new file mode 100644
index 0000000..d13762c
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/changelog
@@ -0,0 +1,118 @@
+kamailio (4.1.5) unstable; urgency=low
+
+  * update to 4.1.5 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Wed, 06 Aug 2014 16:50:20 +0100
+
+kamailio (4.1.4) unstable; urgency=low
+
+  * update to 4.1.4 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 12 Jun 2014 15:55:55 +0100
+
+kamailio (4.1.3) unstable; urgency=low
+
+  * update to 4.1.3 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 24 Apr 2014 10:45:20 +0100
+
+kamailio (4.1.2) unstable; urgency=low
+
+  * update to 4.1.2 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 06 Mar 2014 15:25:35 +0100
+
+kamailio (4.1.1) unstable; urgency=low
+
+  * update to 4.1.1 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 09 Jan 2014 15:45:35 +0100
+
+kamailio (4.1.0) unstable; urgency=low
+
+  * update to 4.1.0
+
+ -- Victor Seva <linuxmaniac at torreviejawireless.org>  Wed, 04 Dec 2013 11:42:27 +0100
+
+kamailio (4.0.0) unstable; urgency=low
+
+  * update to 4.0.0 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Mon, 11 Mar 2013 10:40:30 +0100
+
+kamailio (3.4.0~dev0) unstable; urgency=low
+
+  * update version to 3.4.0~dev0
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Wed, 15 Jun 2012 03:15:00 +0100
+
+kamailio (3.2.0) unstable; urgency=low
+
+  * update to 3.2.0 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Fri, 29 Apr 2011 12:25:30 +0100
+
+kamailio (3.1.1) unstable; urgency=low
+
+  * update to 3.1.1 from upstream
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Fri, 3 Dec 2010 16:30:00 +0100
+
+kamailio (3.1.0) unstable; urgency=low
+
+  * update to 3.1.0 from upstream
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Wed, 6 Oct 2010 17:24:00 +0100
+
+kamailio (3.0.2.99) unstable; urgency=low
+
+  * update to 3.0.2.99 for development version builds
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Fri, 28 May 2010 22:26:00 +0100
+
+kamailio (3.0.2) unstable; urgency=low
+
+  * update to 3.0.2 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 27 May 2010 10:27:36 +0100
+
+kamailio (3.0.1) unstable; urgency=low
+
+  * update to 3.0.1 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Mon, 08 Mar 2010 20:30:48 +0100
+
+kamailio (3.0.0) unstable; urgency=low
+
+  * update to 3.0.0 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Mon, 11 Jan 2010 18:30:42 +0100
+
+kamailio (3.0.0-rc3) unstable; urgency=low
+
+  * update to 3.0.0-rc3 from upstream
+  * updated debian/rules to work with the SIP Router style module packaging
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Fri, 10 Dec 2009 12:10:02 +0100
+
+kamailio (3.0.0-rc2) unstable; urgency=low
+
+  * update to 3.0.0-rc2 from upstream
+  * updated debian/rules to work with the new style module packaging
+
+ -- Jonas Bergler <jonas.bergler at staff.snap.net.nz>  Wed, 18 Nov 2009 12:30:02 +1300
+
+kamailio (1.5.0-svn1) unstable; urgency=low
+
+  * increment debian packaging for trunk
+
+ -- Henning Westerholt <henning.westerholt at 1und1.de>  Mon, 02 Mar 2009 17:40:02 +0100
+
+kamailio (1.4.0-svn1) unstable; urgency=low
+
+  [ Klaus Darilion ]
+  * first release of Kamailio (after renaming from Openser)
+
+ -- Julien BLACHE <jblache at debian.org>  Wed, 12 Dec 2007 17:25:31 +0100
+
+
diff --git a/pkg/kamailio/deb/squeeze/compat b/pkg/kamailio/deb/squeeze/compat
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/compat
@@ -0,0 +1 @@
+8
diff --git a/pkg/kamailio/deb/squeeze/control b/pkg/kamailio/deb/squeeze/control
new file mode 100644
index 0000000..80130d1
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/control
@@ -0,0 +1,456 @@
+Source: kamailio
+Section: net
+Priority: optional
+Maintainer: Debian VoIP Team <pkg-voip-maintainers at lists.alioth.debian.org>
+Uploaders: Victor Seva <linuxmaniac at torreviejawireless.org>,
+           Tzafrir Cohen <tzafrir at debian.org>
+Build-Depends: bison,
+               debhelper (>= 8), 
+               docbook-xml,
+               flex,
+               libconfuse-dev,
+               libcurl4-openssl-dev,
+               libdb-dev (>= 4.6.19),
+               libevent-dev,
+               libexpat1-dev,
+               libradiusclient-ng-dev,
+               libgeoip-dev (>= 1.4.5),
+               libjson0-dev,
+               libldap2-dev,
+               liblua5.1-0-dev,
+               libmemcached-dev,
+               libmysqlclient-dev,
+               libncurses5-dev,
+               libpcre3-dev,
+               libperl-dev,
+               libpq-dev,
+               libreadline-dev,
+               libsasl2-dev,
+               libsnmp-dev,
+               libsqlite3-dev,
+               libunistring-dev,
+               libxml2-dev,
+               libxmlrpc-c3-dev,
+               openssl,
+               python,
+               python-dev,
+               unixodbc-dev,
+               xsltproc,
+               zlib1g-dev
+Standards-Version: 3.9.5
+Homepage: http://www.kamailio.org/
+Vcs-git: git://anonscm.debian.org/pkg-voip/kamailio.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-voip/kamailio.git
+
+Package: kamailio
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: adduser, python, ${misc:Depends}, ${shlibs:Depends}
+Suggests: kamailio-berkeley-modules,
+          kamailio-carrierroute-modules,
+          kamailio-cpl-modules,
+          kamailio-dbg,
+          kamailio-ldap-modules,
+          kamailio-lua-modules,
+          kamailio-mysql-modules,
+          kamailio-perl-modules,
+          kamailio-postgres-modules,
+          kamailio-presence-modules,
+          kamailio-python-modules,
+          kamailio-radius-modules,
+          kamailio-snmpstats-modules,
+          kamailio-tls-modules,
+          kamailio-unixodbc-modules,
+          kamailio-xml-modules,
+          kamailio-xmpp-modules
+Description: very fast and configurable SIP proxy
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ C Shell-like scripting language provides full control over the server's
+ behaviour. Its modular architecture allows only required functionality to be
+ loaded.
+ .
+ Among others, the following modules are available: digest authentication, CPL
+ scripts, instant messaging, MySQL support, presence agent, RADIUS
+ authentication, record routing, SMS gateway, Jabber/XMPP gateway, transaction
+ module, registrar and user location, XML-RPC interface.
+ .
+ This package contains the main Kamailio binary along with the principal modules
+ and support binaries.
+
+Package: kamailio-dbg
+Priority: extra
+Section: debug
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}
+Description: very fast and configurable SIP proxy [debug symbols]
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains the debugging symbols for the Kamailio binaries and
+ modules. You only need to install it if you need to debug Kamailio.
+
+Package: kamailio-geoip-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the geoip module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the geoip module, an extension allowing to
+ use GeoIP API within configuration file.
+
+Package: kamailio-sqlite-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Recommends: sqlite3
+Description: SQLite database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the SQLite database driver for Kamailio.
+
+Package: kamailio-json-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Json parser and jsonrpc modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides json parser for Kamailio's configuration file
+ and the JSON-RPC client over netstrings.
+
+Package: kamailio-memcached-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Replaces: kamailio-memcached-module
+Description: Provides the memcached module, an interface to the memcached server
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the memcached module, an interface to the memcached
+ server, a high-performance, distributed memory object caching system.
+
+Package: kamailio-lua-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the app_lua module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_lua module, an extension allowing to
+ execute embedded Lua applications within configuration file.
+
+Package: kamailio-python-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         python-dev,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: contains the app_python module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_python module, an extension allowing to
+ execute embedded Python applications within configuration file.
+
+Package: kamailio-mysql-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         mysql-client,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: MySQL database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the MySQL database driver for Kamailio.
+
+Package: kamailio-postgres-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         postgresql-client,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: PostgreSQL database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the PostgreSQL database driver for Kamailio.
+
+Package: kamailio-cpl-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: CPL module (CPL interpreter engine) for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides a CPL (Call Processing Language) interpreter for
+ Kamailio, turning Kamailio into a CPL server (storage and interpreter).
+
+Package: kamailio-radius-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: RADIUS modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides a set of RADIUS modules for Kamailio, for
+ authentication, peering, group membership and messages URIs checking against a
+ RADIUS server.
+
+Package: kamailio-unixodbc-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: unixODBC database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the unixODBC database driver for Kamailio.
+
+Package: kamailio-presence-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: SIMPLE presence modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides several Kamailio modules for implementing presence
+ server and presence user agent for RICH presence, registrar-based presence,
+ external triggered presence and XCAP support.
+
+Package: kamailio-perl-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Perl extensions and database driver for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides an interface for Kamailio to write Perl extensions and
+ the perlvdb database driver for Kamailio.
+
+Package: kamailio-snmpstats-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         snmpd,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: SNMP AgentX subagent module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the snmpstats module for Kamailio. This module acts
+ as an AgentX subagent which connects to a master agent.
+
+Package: kamailio-xmpp-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: XMPP gateway module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the SIP to XMPP IM translator module for Kamailio.
+
+Package: kamailio-xml-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Replaces: kamailio-xml-module, kamailio-xmlrpc-module
+Provides: kamailio-xmlrpc-modules
+Description: XML based extensions for Kamailio's Management Interface
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides:
+ - the XMLRPC transport implementations for Kamailio's
+ Management and Control Interface.
+ - xmlops module for XPath operations in configuration file
+
+Package: kamailio-carrierroute-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: carrierroute module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the carrierroute module for Kamailio, an integrated
+ solution for routing, balancing and blacklisting.
+
+Package: kamailio-berkeley-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: db5.1-util,
+         kamailio (= ${binary:Version}),
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: Berkeley database module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the Berkeley database module for Kamailio, a
+ high-performance embedded DB kernel. All database tables are stored
+ in files, no additional server is necessary.
+
+Package: kamailio-berkeley-bin
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: Berkeley database module for Kamailio - helper program
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides helper modules for the Berkeley database module for
+ Kamailio, a high-performance embedded DB kernel. You should normally
+ install kamailio-berkeley-modules and not this package directly.
+
+Package: kamailio-ldap-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: LDAP modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the ldap and h350 modules for Kamailio, enabling LDAP
+ queries from the Kamailio config and storage of SIP account data in an LDAP
+ directory.
+
+Package: kamailio-ims-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: IMS module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains various Diameter interfaces and modules for Kamailio
+ to run as an IMS core.
+
+Package: kamailio-utils-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Provides a set utility functions for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ Provides a set of utility functions for Kamailio, which are not related
+ to the server configuration.
+
+Package: kamailio-tls-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the TLS kamailio transport module
+ This has been split out of the main kamailio package, so that kamailio will
+ not depend on openssl. This module will enable you to use the TLS transport.
+
+Package: kamailio-outbound-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Outbound module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains the module implementing SIP outbound extension.
+
+Package: kamailio-websocket-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Websocket module for kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains the module implementing WebSocket transport layer.
+
+Package: kamailio-autheph-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: authentication using ephemeral credentials module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the ephemeral module for Kamailio.
+
+Package: kamailio-extra-modules
+Architecture: linux-any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: extra modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides: gzcompress
+
+Package: kamailio-nth
+Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: binutils,
+         bison,
+         bvi,
+         flex,
+         gcc,
+         gdb,
+         iftop,
+         lsof,
+         mc,
+         most,
+         ngrep,
+         psmisc,
+         screen,
+         sipsak,
+         tcpdump,
+         vim,
+         ${misc:Depends}
+Description: Kamailio - package for "nice to have" installation
+ This is a metapackage for easy installation various useful tools that may be
+ handy on server with Kamailio installed.
diff --git a/pkg/kamailio/deb/squeeze/copyright b/pkg/kamailio/deb/squeeze/copyright
new file mode 100644
index 0000000..ff31338
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/copyright
@@ -0,0 +1,335 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Kamailio
+Upstream-Contact: sr-dev at lists.sip-router.org
+Source: http://www.kamailio.org/pub/kamailio/
+
+Files: *
+Copyright:
+ 2001-2003 FhG Fokus
+ 2006-2010 iptelorg GmbH
+ Various others (see AUTHORS file)
+License: GPL-2.0+
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+
+Files: debian/*
+Copyright: 2012, 2013, 2014 Victor Seva <linuxmaniac at torreviejawireless.org>
+           2009, 2010, 2011, Daniel-Constantin Mierla <miconda at gmail.com>
+           2010, Jon Bonilla <manwe at aholab.ehu.es>
+           2009, Jonas Bergler <jonas.bergler at staff.snap.net.nz>
+           2009, Henning Westerholt <henning.westerholt at 1und1.de>
+           2007, Julien BLACHE <jblache at debian.org>
+License: GPL-2+
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+
+
+Files: atomic/* atomic_ops.* basex.* bit_*.c char_msg_val.h compiler_opt.h
+ core_stats.h counters.* endianness.* futexlock.h hashes.h io_wait.*
+ kstats_types.h lib/kcore/kstats_wrapper.* lock_ops.c lock_ops_init.h
+ lvalue.* mem/ll_malloc.* mem/memdbg.h mem/sf_malloc.* mi/*.h mod_fix.*
+ modules/tm/rpc_uac.* modules/counters/counters.c modules/tls/sbufq.h
+ modules/tls/tls_bio.* modules/tls/tls_cfg.* modules/tls/tls_cfg.h
+ modules/tls/tls_ct_wrq.* modules/tls/tls_ct_q.h modules/tls/tls_domain.*
+ modules/tls/tls_server.h modules/tls/tls_locking.* modules/tls/tls_rpc.*
+ modules/tls/tls_server.c modules/malloc_test/malloc_test.c modules/blst/blst.c
+ parser/case_p_* parser/case_reas.h pvapi.h pv_core.* rand/fastrand.* raw_*
+ rpc_lookup.* rvalue.* sctp_* ser_time.h shm_init.* sip_msg_clone.* sock_ut.*
+ sr_compat.* str_hash.h switch.* tcp_ev.h tcp_int_send.h tcp_options.*
+ tcp_read.h tcp_stats.* timer_proc.* tls_hooks.* tls_hooks_init.h ver.*
+Copyright: 2006-2010 iptelorg GmbH
+License: ISC
+
+Files: modules/tls/tls_select.* modules/tls/tls_dump_vf.*
+Copyright: 2005-2010 iptelorg GmbH
+License: GPL-2 + OpenSSL exception
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+ * Exception: permission to copy, modify, propagate, and distribute a work
+ * formed by combining OpenSSL toolkit software and the code in this file,
+ * such as linking with software components and libraries released under
+ * OpenSSL project license.
+
+Files: modules/websocket/* modules/outbound/* modules/auth_ephemeral/*
+Copyright: 2012-2013 Crocodile RCS Ltd
+License: GPL-2 + OpenSSL exception
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+ * Exception: permission to copy, modify, propagate, and distribute a work
+ * formed by combining OpenSSL toolkit software and the code in this file,
+ * such as linking with software components and libraries released under
+ * OpenSSL project license.
+
+Files: daemonize.* fastlock.h lock_ops.h mem/mem.* mem/f_malloc.h
+ mem/meminfo.h mem/memtest.c mem/shm_mem.c mem/q_malloc.h mem/q_malloc.c
+ mem/shm_mem.h mem/f_malloc.c modules/tls/tls_rpc.c modules/tls/tls_server.c
+ modules/tls/tls_domain.c modules/tls/tls_domain.h modules/tls/tls_server.h
+ modules/tls/tls_rpc.h pt.c pt.h sched_yield.h ut.c ut.h
+Copyright: 2001-2003 FhG Fokus
+License: ISC
+
+Files: events.* modules/topoh/*
+Copyright: 2009 SIP-Router.org
+License: ISC
+
+Files: modules/mi_rpc/mi_rpc_mod.c modules/pv/pv_xavp.*
+ modules/usrloc/ul_rpc.* ppcfg.* xavp.*
+Copyright: 2009-2010 Daniel-Constantin Mierla (asipto.com)
+License: ISC
+
+Files: obsolete/jabber_k/tree234.*
+Copyright: 1999, 2000, 2001, Simon Tatham
+License: Expat
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or
+ sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+ .
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT.  IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+
+Files: modules/xmpp/xsnprintf.c obsolete/jabber_s/xsnprintf.c obsolete/jabber_k/xsnprintf.c
+Copyright: 1995-1998, The Apache Group
+License: Apache-1.0
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ .
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+ .
+ 3. All advertising materials mentioning features or use of this
+    software must display the following acknowledgment:
+    "This product includes software developed by the Apache Group
+    for use in the Apache HTTP server project (http://www.apache.org/)."
+ .
+ 4. The names "Apache Server" and "Apache Group" must not be used to
+    endorse or promote products derived from this software without
+    prior written permission.
+ .
+ 5. Redistributions of any form whatsoever must retain the following
+    acknowledgment:
+    "This product includes software developed by the Apache Group
+    for use in the Apache HTTP server project (http://www.apache.org/)."
+ .
+ THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
+ EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Files: modules/mi_xmlrpc/abyss*
+Copyright: 2000, Moez Mahfoudh <mmoez at bigfoot.com>
+License: BSD-3-clause
+
+Files: list.h
+Copyright: 1991, 1993 The Regents of the University of California
+License: BSD-3-clause
+
+Files: modules/tm/t_serial.*
+Copyright: 2008 Juha Heinanen
+License: BSD-2-clause
+
+Files: parser/sdp/sdp.* parser/sdp/sdp_helpr_funcs.* parser/sdp/sdp_cloner.h
+Copyright:
+ 2008-2009 SOMA Networks, INC.
+ 2010 VoIP Embedded, Inc
+License: BSD-2-clause
+
+Files: modules/tls/fixed_c_zlib.h
+Copyright:1998-2005 The OpenSSL Project
+Comment: file copied from OpenSSL 0.9.8, refers to OpenSSL License. Note that
+ this code will not build by default in the Debian packaging.
+License: OpenSSL
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ .
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+ .
+ 3. All advertising materials mentioning features or use of this
+    software must display the following acknowledgment:
+    "This product includes software developed by the OpenSSL Project
+    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ .
+ 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+    endorse or promote products derived from this software without
+    prior written permission. For written permission, please contact
+    openssl-core at openssl.org.
+ .
+ 5. Products derived from this software may not be called "OpenSSL"
+    nor may "OpenSSL" appear in their names without prior written
+    permission of the OpenSSL Project.
+ .
+ 6. Redistributions of any form whatsoever must retain the following
+    acknowledgment:
+    "This product includes software developed by the OpenSSL Project
+    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ .
+ THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Files: md5.* md5utils.c
+Copyright: 1991-2, RSA Data Security, Inc
+Comment: Note that md5.c and md5.h have been replaced in the patches
+ plum_md5*.patch .
+ .
+ As for md5utils.c, according to a mail from Upstream (Daniel-Constantin
+ Mierla): while the initial commit log for it states that it is derived
+ from mddriver.c of RFC 1321, it seems that it was, in fact, written from
+ scratch by Jiri Kuthan (a core developer of SER at that time, working for
+ FhG Fokus Institute). As you can see it's rather trivial and uses a data
+ type of SER ("str").  I didn't reimplement it as it's too trivial and
+ looks like there's no other way to implement it.
+License: RSA-MD5
+ License to copy and use this software is granted provided that it
+ is identified as the "RSA Data Security, Inc. MD5 Message-Digest
+ Algorithm" in all material mentioning or referencing this software
+ or this function.
+ .
+ License is also granted to make and use derivative works provided
+ that such works are identified as "derived from the RSA Data
+ Security, Inc. MD5 Message-Digest Algorithm" in all material
+ mentioning or referencing the derived work.
+ .
+ RSA Data Security, Inc. makes no representations concerning either
+ the merchantability of this software or the suitability of this
+ software for any particular purpose. It is provided "as is"
+ without express or implied warranty of any kind.
+ .
+ These notices must be retained in any copies of any part of this
+ documentation and/or software.
+
+Files: mem/dl_*
+Copyright: n/a
+License: public-domain
+ This is a version (aka dlmalloc) of malloc/free/realloc written by
+ Doug Lea and released to the public domain, as explained at
+ http://creativecommons.org/licenses/publicdomain.  Send questions,
+ comments, complaints, performance data, etc to dl at cs.oswego.edu
+
+Files: rand/isaac/*
+Copyright: n/a
+License: public-domain
+ By Bob Jenkins.  My random number generator, ISAAC.  Public Domain.
+
+License: ISC
+ Permission to use, copy, modify, and distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Files: lib/srutils/srjson.*
+Copyright: 2009 Dave Gamble
+License: MIT
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ ,
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+
+License: BSD-3-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 4. Neither the name of the University nor the names of its contributors
+    may be used to endorse or promote products derived from this software
+    without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+License: BSD-2-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ .
+  1. Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/pkg/kamailio/deb/squeeze/kamailio-autheph-modules.lintian-overrides b/pkg/kamailio/deb/squeeze/kamailio-autheph-modules.lintian-overrides
new file mode 100644
index 0000000..dcb3d18
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/kamailio-autheph-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-autheph-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/squeeze/kamailio-berkeley-bin.dirs b/pkg/kamailio/deb/squeeze/kamailio-berkeley-bin.dirs
new file mode 100644
index 0000000..236670a
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/kamailio-berkeley-bin.dirs
@@ -0,0 +1 @@
+usr/sbin
diff --git a/pkg/kamailio/deb/squeeze/kamailio-dnssec-modules.lintian-overrides b/pkg/kamailio/deb/squeeze/kamailio-dnssec-modules.lintian-overrides
new file mode 100644
index 0000000..10165fe
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/kamailio-dnssec-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-dnssec-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/squeeze/kamailio-outbound-modules.lintian-overrides b/pkg/kamailio/deb/squeeze/kamailio-outbound-modules.lintian-overrides
new file mode 100644
index 0000000..3050cfe
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/kamailio-outbound-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-outbound-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/squeeze/kamailio-tls-modules.lintian-overrides b/pkg/kamailio/deb/squeeze/kamailio-tls-modules.lintian-overrides
new file mode 100644
index 0000000..bbe0d37
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/kamailio-tls-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/squeeze/kamailio-websocket-modules.lintian-overrides b/pkg/kamailio/deb/squeeze/kamailio-websocket-modules.lintian-overrides
new file mode 100644
index 0000000..8f384fb
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/kamailio-websocket-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-websocket-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/squeeze/kamailio.README.Debian b/pkg/kamailio/deb/squeeze/kamailio.README.Debian
new file mode 100644
index 0000000..d25769a
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/kamailio.README.Debian
@@ -0,0 +1,39 @@
+Kamailio for Debian
+-------------------
+
+* init script check for fork=no
+-------------------------------
+
+The Kamailio init script will not start Kamailio on boot if fork=no is
+specified in the config file. The check in the initscript will match
+any occurrence of fork=no in the file, even inside C-style comments.
+
+You can disable this check in the init script if you wish; just comment
+out the calls to the check_fork function in the script. Your changes to
+the init script will be preserved upon upgrade, as the file is tagged
+as a conffile.
+
+
+* Kamailio setup
+----------------
+
+To setup Kamailio, you need to:
+ - configure Kamailio properly to suit your needs
+ - edit /etc/default/kamailio, adjust the MEMORY parameter and set
+   RUN_KAMAILIO to "yes"
+
+If you are building an HA cluster using heartbeat or similar, you'll want
+to disable the init script by running:
+
+  update-rc.d kamailio remove
+
+so that Kamailio will not be launched at system startup. You still need
+to set RUN_KAMAILIO to "yes" if you want to use the /etc/init.d/kamailio init
+script.
+
+Set the DUMP_CORE parameter in /etc/default/kamailio to "yes" if you want to
+get a core dump in case Kamailio crashes. The debug symbols for Kamailio are
+provided by the kamailio-dbg package.
+
+
+ -- Victor Seva <linuxmaniac at torreviejawireless.org>  Wed, 11 Dec 2013 16:07:11 +0100
diff --git a/pkg/kamailio/deb/squeeze/kamailio.default b/pkg/kamailio/deb/squeeze/kamailio.default
new file mode 100644
index 0000000..0cfc8c8
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/kamailio.default
@@ -0,0 +1,28 @@
+#
+# Kamailio startup options
+#
+
+# Set to yes to enable kamailio, once configured properly.
+#RUN_KAMAILIO=yes
+
+# User to run as
+#USER=kamailio
+
+# Group to run as
+#GROUP=kamailio
+
+# Amount of shared and private memory to allocate
+# for the running Kamailio server (in Mb)
+#SHM_MEMORY=64
+#PKG_MEMORY=4
+
+# Config file
+#CFGFILE=/etc/kamailio/kamailio.cfg
+
+# Enable the server to leave a core file when it crashes.
+# Set this to 'yes' to enable Kamailio to leave a core file when it crashes
+# or 'no' to disable this feature. This option is case sensitive and only
+# accepts 'yes' and 'no' and only in lowercase letters.
+# On some systems it is necessary to specify a directory for the core files
+# to get a dump. Look into the kamailio init file for an example configuration.
+#DUMP_CORE=yes
diff --git a/pkg/kamailio/deb/squeeze/kamailio.examples b/pkg/kamailio/deb/squeeze/kamailio.examples
new file mode 100644
index 0000000..c48447a
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/kamailio.examples
@@ -0,0 +1,2 @@
+examples/*
+
diff --git a/pkg/kamailio/deb/squeeze/kamailio.init b/pkg/kamailio/deb/squeeze/kamailio.init
new file mode 100644
index 0000000..d4801d2
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/kamailio.init
@@ -0,0 +1,162 @@
+#! /bin/sh
+#
+### BEGIN INIT INFO
+# Provides:          kamailio
+# Required-Start:    $syslog $network $local_fs $remote_fs $time
+# Should-Start:      $named slapd mysql postgresql snmpd radiusd
+# Should-Stop:       $named slapd mysql postgresql snmpd radiusd
+# Required-Stop:     $syslog $network $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start the Kamailio SIP proxy server
+# Description:       Start the Kamailio SIP proxy server
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/kamailio
+NAME=kamailio
+DESC="Kamailio SIP server"
+HOMEDIR=/var/run/kamailio
+PIDFILE=$HOMEDIR/$NAME.pid
+DEFAULTS=/etc/default/kamailio
+CFGFILE=/etc/kamailio/kamailio.cfg
+RUN_KAMAILIO=no
+USER=kamailio
+GROUP=kamailio
+# Amount of shared and private memory to allocate
+# for the running Kamailio server (in Mb)
+SHM_MEMORY=64
+PKG_MEMORY=4
+DUMP_CORE=no
+
+# Do not start kamailio if fork=no is set in the config file
+# otherwise the boot process will just stop
+check_fork ()
+{
+    if grep -q "^[[:space:]]*fork[[:space:]]*=[[:space:]]*no.*" $CFGFILE; then
+	log_failure_msg "Not starting $DESC: fork=no specified in config file; run /etc/init.d/kamailio debug instead"
+	exit 0
+    fi
+}
+
+check_kamailio_config ()
+{
+	# Check if kamailio configuration is valid before starting the server
+	set +e
+	out=$($DAEMON -f $CFGFILE -M $PKG_MEMORY -c 2>&1 > /dev/null)
+	retcode=$?
+	set -e
+	if [ "$retcode" != '0' ]; then
+	    log_failure_msg "Not starting $DESC: invalid configuration file!"
+	    log_failure_msg
+	    log_failure_msg "$out"
+	    log_failure_msg
+	    exit 1
+	fi
+}
+
+create_radius_seqfile ()
+{
+    # Create a radius sequence file to be used by the radius client if
+    # radius accounting is enabled. This is needed to avoid any issue
+    # with the file not being writable if kamailio first starts as user
+    # root because DUMP_CORE is enabled and creates this file as user
+    # root and then later it switches back to user kamailio and cannot
+    # write to the file. If the file exists before kamailio starts, it
+    # won't change it's ownership and will be writable for both root
+    # and kamailio, no matter what options are chosen at install time
+    RADIUS_SEQ_FILE=/var/run/kamailio/kamailio_radius.seq
+    if [ -d /var/run/kamailio ]; then
+	chown ${USER}:${GROUP} /var/run/kamailio
+
+	if [ ! -f $RADIUS_SEQ_FILE ]; then
+	    touch $RADIUS_SEQ_FILE
+	fi
+
+	chown ${USER}:${GROUP} $RADIUS_SEQ_FILE
+	chmod 660 $RADIUS_SEQ_FILE
+    fi
+}
+
+test -f $DAEMON || exit 0
+
+# Load startup options if available
+if [ -f $DEFAULTS ]; then
+   . $DEFAULTS || true
+fi
+
+if [ "$RUN_KAMAILIO" != "yes" ]; then
+    log_failure_msg "Kamailio not yet configured. Edit /etc/default/kamailio first."
+    exit 0
+fi
+
+set -e
+
+SHM_MEMORY=$((`echo $SHM_MEMORY | sed -e 's/[^0-9]//g'`))
+PKG_MEMORY=$((`echo $PKG_MEMORY | sed -e 's/[^0-9]//g'`))
+[ -z "$USER" ]  && USER=kamailio
+[ -z "$GROUP" ] && GROUP=kamailio
+[ $SHM_MEMORY -le 0 ] && SHM_MEMORY=64
+[ $PKG_MEMORY -le 0 ] && PKG_MEMORY=4
+
+if test "$DUMP_CORE" = "yes" ; then
+    # set proper ulimit
+    ulimit -c unlimited
+
+    # directory for the core dump files
+    # COREDIR=/home/corefiles
+    # [ -d $COREDIR ] || mkdir $COREDIR
+    # chmod 777 $COREDIR
+    # echo "$COREDIR/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
+fi
+
+# /var/run can be a tmpfs
+if [ ! -d $HOMEDIR ]; then
+    mkdir -p $HOMEDIR
+fi
+
+OPTIONS="-f $CFGFILE -P $PIDFILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP"
+
+case "$1" in
+  start|debug)
+	check_kamailio_config
+	create_radius_seqfile
+
+	if [ "$1" != "debug" ]; then
+	    check_fork
+	fi
+
+	log_daemon_msg "Starting $DESC: $NAME"
+	start-stop-daemon --start --quiet --pidfile $PIDFILE \
+		--exec $DAEMON -- $OPTIONS || log_failure_msg " already running"
+	log_end_msg 0
+	;;
+  stop)
+	log_daemon_msg "Stopping $DESC: $NAME"
+	start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
+		--exec $DAEMON
+	log_end_msg 0
+	;;
+  restart|force-reload)
+	check_kamailio_config
+	create_radius_seqfile
+
+	$0 stop
+	sleep 1
+	$0 start
+	;;
+  status)
+	log_daemon_msg "Status of $DESC: "
+
+	status_of_proc -p"$PIDFILE" $NAME $NAME
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload|status|debug}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/pkg/kamailio/deb/squeeze/kamailio.lintian-overrides b/pkg/kamailio/deb/squeeze/kamailio.lintian-overrides
new file mode 100644
index 0000000..18152ed
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/kamailio.lintian-overrides
@@ -0,0 +1,2 @@
+kamailio binary: example-interpreter-not-absolute usr/share/doc/kamailio/examples/outbound/edge.cfg #!KAMAILIO
+kamailio binary: example-interpreter-not-absolute usr/share/doc/kamailio/examples/outbound/registrar.cfg #!KAMAILIO
diff --git a/pkg/kamailio/deb/squeeze/kamailio.postinst b/pkg/kamailio/deb/squeeze/kamailio.postinst
new file mode 100644
index 0000000..4ee38ec
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/kamailio.postinst
@@ -0,0 +1,24 @@
+#! /bin/sh
+
+set -e
+
+case "$1" in
+    configure)
+        adduser --quiet --system --group --disabled-password \
+                --shell /bin/false --gecos "Kamailio SIP Server" \
+                --home /var/run/kamailio kamailio || true
+
+        ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+        ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+        ;;
+esac
+
+#DEBHELPER#
+
diff --git a/pkg/kamailio/deb/squeeze/rules b/pkg/kamailio/deb/squeeze/rules
new file mode 100755
index 0000000..ab63b32
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/rules
@@ -0,0 +1,216 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+DEBVERSION:=$(shell head -n 1 debian/changelog \
+                    | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
+UPVERSION:=$(shell dpkg-parsechangelog | sed -ne 's/^Version: \(\([0-9]\+\):\)\?\(.*\)-.*/\3/p')
+
+FILENAME := kamailio_$(UPVERSION).orig.tar.gz
+URL := http://www.kamailio.org/pub/kamailio/$(UPVERSION)/src/kamailio-$(UPVERSION)_src.tar.gz
+
+
+
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+DPKG_EXPORT_BUILDFLAGS = 1
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+# choose freeradius
+
+# modules not in the "main" kamailio package
+EXCLUDED_MODULES=
+
+# extra modules to skip, because they are not compilable now
+# - regardless if they go to the main kamailio package or to some module package,
+# they will be excluded from compile and install of all
+EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy java dnssec sctp purple redis mono
+
+# module groups that are packaged in seperate packages
+# (with the name kamailio-$(group_name)-modules)
+# Note: the order is important (should be in dependency order, the one
+# on which other depend first)
+PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \
+			   ldap xml perl utils lua memcached \
+			   snmpstats carrierroute xmpp cpl python geoip\
+			   sqlite json ims \
+			   tls outbound websocket autheph 
+
+# module groups to be packaged onto kamailio-extra-modules
+EXTRA_GROUPS=gzcompress
+
+# name of libdir in the path for libraries (e.g., lib for 32b, lib64 for 64b)
+LIBDIR ?= lib
+
+# directories with possible duplicate libraries (that should be deleted
+# from current module* packages)
+DUP_LIBS_DIRS=$(CURDIR)/debian/kamailio/usr/$(LIBDIR)/kamailio \
+			$(CURDIR)/debian/kamailio-db-modules/usr/$(LIBDIR)/kamailio
+
+# "function" to get package short name out of a dir/module_name
+# it also transforms db_foo into foo
+mod_name=$(subst db_,,$(lastword $(subst /, ,$(1))))
+
+define PACKAGE_GRP_BUILD_template
+	# package all the modules in PACKAGE_GROUPS in separate packages
+	$(foreach grp,$(PACKAGE_GROUPS EXTRA_GROUPS),\
+		$(MAKE) every-module group_include="k$(grp)"
+	)
+endef
+
+
+define PACKAGE_GRP_INSTALL_template
+	$(foreach grp,$(PACKAGE_GROUPS),\
+		$(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \
+		basedir=$(CURDIR)/debian/kamailio-$(grp)-modules \
+		cfg_prefix=$(CURDIR)/debian/kamailio-$(grp)-modules \
+		doc-dir=share/doc/kamailio-$(grp)-modules
+		# eliminate duplicate libs
+		-for d in $(DUP_LIBS_DIRS); do \
+			test "$$d" != "$(CURDIR)/debian/kamailio-$(grp)-modules/usr/$(LIBDIR)/kamailio" &&\
+			for r in `find $$d -name 'lib*'|xargs`; do \
+				echo "removing $(grp) lib `basename $$r` present also in $$d";\
+				rm -f $(CURDIR)/debian/kamailio-$(grp)-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \
+			done ; \
+		done
+		find $(CURDIR)/debian/kamailio-$(grp)-modules -depth -empty -type d -exec rmdir {} \;
+	)
+endef
+
+define PACKAGE_EXTRA_INSTALL_template
+	$(foreach grp,$(EXTRA_GROUPS),\
+		$(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \
+		basedir=$(CURDIR)/debian/kamailio-extra-modules \
+		cfg_prefix=$(CURDIR)/debian/kamailio-extra-modules \
+		doc-dir=share/doc/kamailio-extra-modules
+	)
+	# eliminate duplicate libs
+	-for d in $(DUP_LIBS_DIRS); do \
+		test "$$d" != "$(CURDIR)/debian/kamailio-extra-modules/usr/$(LIBDIR)/kamailio" &&\
+		for r in `find $$d -name 'lib*'|xargs`; do \
+			echo "removing extra lib `basename $$r` present also in $$d";\
+			rm -f $(CURDIR)/debian/kamailio-extra-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \
+		done ; \
+	done
+	find $(CURDIR)/debian/kamailio-extra-modules -depth -empty -type d -exec rmdir {} \;
+endef
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	INSTALL_PROGRAM += -s
+endif
+
+# CFLAGS + CPPFLAGS -> CC_EXTRA_OPTS
+# LDFLAGS -> LD_EXTRA_OPTS
+sed -e 's/" CPPFLAGS="/ /' -e 's/CFLAGS/CC_EXTRA_OPTS/g' -e 's/LDFLAGS/LD_EXTRA_OPTS/g')
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	# Add here commands to configure the package.
+	$(MAKE) FLAVOUR=kamailio cfg prefix=/usr cfg_prefix=$(CURDIR)/debian/kamailio \
+			cfg_target=/etc/kamailio/ \
+			basedir=$(CURDIR)/debian/kamailio \
+			skip_modules="$(EXCLUDED_MODULES) $(EXTRA_EXCLUDED_MODULES)" \
+			$(CUSTOM_BUILDFLAGS) \
+			group_include="kstandard"
+
+	touch configure-stamp
+
+
+build: build-stamp
+build-arch: build-stamp
+build-indep: build-stamp
+build-stamp: configure-stamp
+	dh_testdir
+	# Add here commands to compile the package.
+	$(MAKE) all
+	# make groups
+	$(call PACKAGE_GRP_BUILD_template)
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	# Add here commands to clean up after the build process.
+	$(MAKE) maintainer-clean
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_prep
+	dh_installdirs
+	# Add here commands to install the package into debian/kamailio
+	$(MAKE) install LIBDIR=$(LIBDIR) group_include="kstandard"
+	# make group packages
+	$(call PACKAGE_GRP_INSTALL_template)
+	$(call PACKAGE_EXTRA_INSTALL_template)
+	mv $(CURDIR)/debian/kamailio-berkeley-modules/usr/sbin/kambdb_recover \
+		$(CURDIR)/debian/kamailio-berkeley-bin/usr/sbin/kambdb_recover
+	# install /etc/default/kamailio file
+	mkdir -p $(CURDIR)/debian/kamailio/etc/default
+	cp -f debian/kamailio.default $(CURDIR)/debian/kamailio/etc/default/kamailio
+
+
+# This single target is used to build all the packages, all at once, or
+# one at a time. So keep in mind: any options passed to commands here will
+# affect _all_ packages. Anything you want to only affect one package
+# should be put in another target, such as the install target.
+binary-common:
+	dh_testdir
+	dh_testroot
+	dh_installdebconf
+	dh_installdocs
+	dh_installexamples
+	dh_installmenu
+	dh_installinit -pkamailio -- defaults 23
+	dh_installcron
+	dh_installman
+	dh_installinfo
+	dh_lintian
+	dh_installchangelogs ChangeLog
+	dh_link
+	dh_strip --dbg-package=kamailio-dbg
+	dh_compress
+	dh_fixperms
+	dh_makeshlibs
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+# Build architecture-independent packages using the common target
+binary-indep: build install
+# (Uncomment this next line if you have such packages.)
+#        $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
+# We have nothing to do by default.
+
+
+# Build architecture-dependent packages using the common target
+binary-arch: build install
+	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
+
+# Any other binary targets build just one binary package at a time.
+binary-%: build install
+	$(MAKE) -f debian/rules binary-common DH_OPTIONS=-p$*
+
+print-version:
+	@@echo "Debian version:          $(DEBVERSION)"
+	@@echo "Upstream version:        $(UPVERSION)"
+
+get-orig-source:
+	@@dh_testdir
+	@@[ -d ../tarballs/. ]||mkdir -p ../tarballs
+	@@echo Downloading $(FILENAME) from $(URL) ...
+	@@wget -nv -T10 -t3 -O ../tarballs/$(FILENAME) $(URL)
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
+
diff --git a/pkg/kamailio/deb/squeeze/source.lintian-overrides b/pkg/kamailio/deb/squeeze/source.lintian-overrides
new file mode 100644
index 0000000..620d9ff
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/source.lintian-overrides
@@ -0,0 +1 @@
+kamailio source: debian-watch-file-in-native-package
diff --git a/pkg/kamailio/deb/squeeze/source/format b/pkg/kamailio/deb/squeeze/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/pkg/kamailio/deb/squeeze/watch b/pkg/kamailio/deb/squeeze/watch
new file mode 100644
index 0000000..c50f31f
--- /dev/null
+++ b/pkg/kamailio/deb/squeeze/watch
@@ -0,0 +1,3 @@
+version=3
+opts=dversionmangle=s/\~svn([\d]+)//; \
+http://www.kamailio.org/pub/kamailio/([\d.]+)/src/kamailio-([\d.]+)_src\.tar\.gz
diff --git a/pkg/kamailio/deb/trusty/changelog b/pkg/kamailio/deb/trusty/changelog
new file mode 100644
index 0000000..d13762c
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/changelog
@@ -0,0 +1,118 @@
+kamailio (4.1.5) unstable; urgency=low
+
+  * update to 4.1.5 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Wed, 06 Aug 2014 16:50:20 +0100
+
+kamailio (4.1.4) unstable; urgency=low
+
+  * update to 4.1.4 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 12 Jun 2014 15:55:55 +0100
+
+kamailio (4.1.3) unstable; urgency=low
+
+  * update to 4.1.3 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 24 Apr 2014 10:45:20 +0100
+
+kamailio (4.1.2) unstable; urgency=low
+
+  * update to 4.1.2 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 06 Mar 2014 15:25:35 +0100
+
+kamailio (4.1.1) unstable; urgency=low
+
+  * update to 4.1.1 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 09 Jan 2014 15:45:35 +0100
+
+kamailio (4.1.0) unstable; urgency=low
+
+  * update to 4.1.0
+
+ -- Victor Seva <linuxmaniac at torreviejawireless.org>  Wed, 04 Dec 2013 11:42:27 +0100
+
+kamailio (4.0.0) unstable; urgency=low
+
+  * update to 4.0.0 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Mon, 11 Mar 2013 10:40:30 +0100
+
+kamailio (3.4.0~dev0) unstable; urgency=low
+
+  * update version to 3.4.0~dev0
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Wed, 15 Jun 2012 03:15:00 +0100
+
+kamailio (3.2.0) unstable; urgency=low
+
+  * update to 3.2.0 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Fri, 29 Apr 2011 12:25:30 +0100
+
+kamailio (3.1.1) unstable; urgency=low
+
+  * update to 3.1.1 from upstream
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Fri, 3 Dec 2010 16:30:00 +0100
+
+kamailio (3.1.0) unstable; urgency=low
+
+  * update to 3.1.0 from upstream
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Wed, 6 Oct 2010 17:24:00 +0100
+
+kamailio (3.0.2.99) unstable; urgency=low
+
+  * update to 3.0.2.99 for development version builds
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Fri, 28 May 2010 22:26:00 +0100
+
+kamailio (3.0.2) unstable; urgency=low
+
+  * update to 3.0.2 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 27 May 2010 10:27:36 +0100
+
+kamailio (3.0.1) unstable; urgency=low
+
+  * update to 3.0.1 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Mon, 08 Mar 2010 20:30:48 +0100
+
+kamailio (3.0.0) unstable; urgency=low
+
+  * update to 3.0.0 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Mon, 11 Jan 2010 18:30:42 +0100
+
+kamailio (3.0.0-rc3) unstable; urgency=low
+
+  * update to 3.0.0-rc3 from upstream
+  * updated debian/rules to work with the SIP Router style module packaging
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Fri, 10 Dec 2009 12:10:02 +0100
+
+kamailio (3.0.0-rc2) unstable; urgency=low
+
+  * update to 3.0.0-rc2 from upstream
+  * updated debian/rules to work with the new style module packaging
+
+ -- Jonas Bergler <jonas.bergler at staff.snap.net.nz>  Wed, 18 Nov 2009 12:30:02 +1300
+
+kamailio (1.5.0-svn1) unstable; urgency=low
+
+  * increment debian packaging for trunk
+
+ -- Henning Westerholt <henning.westerholt at 1und1.de>  Mon, 02 Mar 2009 17:40:02 +0100
+
+kamailio (1.4.0-svn1) unstable; urgency=low
+
+  [ Klaus Darilion ]
+  * first release of Kamailio (after renaming from Openser)
+
+ -- Julien BLACHE <jblache at debian.org>  Wed, 12 Dec 2007 17:25:31 +0100
+
+
diff --git a/pkg/kamailio/deb/trusty/compat b/pkg/kamailio/deb/trusty/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/compat
@@ -0,0 +1 @@
+9
diff --git a/pkg/kamailio/deb/trusty/control b/pkg/kamailio/deb/trusty/control
new file mode 100644
index 0000000..fa67335
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/control
@@ -0,0 +1,569 @@
+Source: kamailio
+Section: net
+Priority: optional
+Maintainer: Debian VoIP Team <pkg-voip-maintainers at lists.alioth.debian.org>
+Uploaders: Victor Seva <linuxmaniac at torreviejawireless.org>,
+           Tzafrir Cohen <tzafrir at debian.org>
+Build-Depends: bison,
+               debhelper (>= 9),
+               docbook-xml,
+               dpkg-dev (>= 1.16.1.1),
+               flex,
+               gcj-jdk,
+               libconfuse-dev,
+               libcurl4-openssl-dev,
+               libdb-dev (>= 4.6.19),
+               libevent-dev,
+               libexpat1-dev,
+               libfreeradius-client-dev,
+               libgeoip-dev (>= 1.4.5),
+               libhiredis-dev (>= 0.10.0),
+               libjson-c-dev,
+               libldap2-dev,
+               liblua5.1-0-dev,
+               libmemcached-dev,
+               libmono-2.0-dev,
+               libmysqlclient-dev,
+               libncurses5-dev,
+               libpcre3-dev,
+               libperl-dev,
+               libpq-dev,
+               libpurple-dev,
+               libreadline-dev,
+               libsasl2-dev,
+               libsctp-dev,
+               libsnmp-dev,
+               libsqlite3-dev,
+               libunistring-dev,
+               libval-dev,
+               libxml2-dev,
+               openssl,
+               python,
+               python-dev,
+               unixodbc-dev,
+               xsltproc,
+               zlib1g-dev
+Standards-Version: 3.9.5
+Homepage: http://www.kamailio.org/
+Vcs-git: git://anonscm.debian.org/pkg-voip/kamailio.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-voip/kamailio.git
+
+Package: kamailio
+Architecture: linux-any
+Multi-Arch: foreign
+Pre-Depends: ${misc:Pre-Depends}
+Depends: adduser, python, ${misc:Depends}, ${shlibs:Depends}
+Suggests: kamailio-berkeley-modules,
+          kamailio-carrierroute-modules,
+          kamailio-cpl-modules,
+          kamailio-dbg,
+          kamailio-ldap-modules,
+          kamailio-lua-modules,
+          kamailio-mysql-modules,
+          kamailio-perl-modules,
+          kamailio-postgres-modules,
+          kamailio-presence-modules,
+          kamailio-python-modules,
+          kamailio-radius-modules,
+          kamailio-snmpstats-modules,
+          kamailio-tls-modules,
+          kamailio-unixodbc-modules,
+          kamailio-xml-modules,
+          kamailio-xmpp-modules
+Description: very fast and configurable SIP proxy
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ C Shell-like scripting language provides full control over the server's
+ behaviour. Its modular architecture allows only required functionality to be
+ loaded.
+ .
+ Among others, the following modules are available: digest authentication, CPL
+ scripts, instant messaging, MySQL support, presence agent, RADIUS
+ authentication, record routing, SMS gateway, Jabber/XMPP gateway, transaction
+ module, registrar and user location, XML-RPC interface.
+ .
+ This package contains the main Kamailio binary along with the principal modules
+ and support binaries.
+
+Package: kamailio-dbg
+Priority: extra
+Section: debug
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}
+Description: very fast and configurable SIP proxy [debug symbols]
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains the debugging symbols for the Kamailio binaries and
+ modules. You only need to install it if you need to debug Kamailio.
+
+Package: kamailio-geoip-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the geoip module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the geoip module, an extension allowing to
+ use GeoIP API within configuration file.
+
+Package: kamailio-sqlite-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Recommends: sqlite3
+Description: SQLite database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the SQLite database driver for Kamailio.
+
+Package: kamailio-json-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Json parser and jsonrpc modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides json parser for Kamailio's configuration file
+ and the JSON-RPC client over netstrings.
+
+Package: kamailio-memcached-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Replaces: kamailio-memcached-module
+Description: Provides the memcached module, an interface to the memcached server
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the memcached module, an interface to the memcached
+ server, a high-performance, distributed memory object caching system.
+
+Package: kamailio-lua-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the app_lua module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_lua module, an extension allowing to
+ execute embedded Lua applications within configuration file.
+
+Package: kamailio-mono-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the app_mono module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_mono module, an extension allowing to
+ execute embedded Mono applications within configuration file.
+
+Package: kamailio-python-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         python-dev,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: contains the app_python module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_python module, an extension allowing to
+ execute embedded Python applications within configuration file.
+
+Package: kamailio-redis-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Redis database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the Redis NOSQL database driver for Kamailio.
+
+Package: kamailio-mysql-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         mysql-client,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: MySQL database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the MySQL database driver for Kamailio.
+
+Package: kamailio-postgres-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         postgresql-client,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: PostgreSQL database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the PostgreSQL database driver for Kamailio.
+
+Package: kamailio-cpl-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: CPL module (CPL interpreter engine) for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides a CPL (Call Processing Language) interpreter for
+ Kamailio, turning Kamailio into a CPL server (storage and interpreter).
+
+Package: kamailio-radius-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: RADIUS modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides a set of RADIUS modules for Kamailio, for
+ authentication, peering, group membership and messages URIs checking against a
+ RADIUS server.
+
+Package: kamailio-unixodbc-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: unixODBC database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the unixODBC database driver for Kamailio.
+
+Package: kamailio-presence-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: SIMPLE presence modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides several Kamailio modules for implementing presence
+ server and presence user agent for RICH presence, registrar-based presence,
+ external triggered presence and XCAP support.
+
+Package: kamailio-perl-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Perl extensions and database driver for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides an interface for Kamailio to write Perl extensions and
+ the perlvdb database driver for Kamailio.
+
+Package: kamailio-snmpstats-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         snmpd,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: SNMP AgentX subagent module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the snmpstats module for Kamailio. This module acts
+ as an AgentX subagent which connects to a master agent.
+
+Package: kamailio-purple-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Provides the purple module, a multi-protocol IM gateway
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the purple module, a multi-protocol instant
+ messaging gateway module.
+
+Package: kamailio-xmpp-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: XMPP gateway module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the SIP to XMPP IM translator module for Kamailio.
+
+Package: kamailio-xml-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Replaces: kamailio-xml-module, kamailio-xmlrpc-module
+Provides: kamailio-xmlrpc-modules
+Description: XML based extensions for Kamailio's Management Interface
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides:
+ - the XMLRPC transport implementations for Kamailio's
+ Management and Control Interface.
+ - xmlops module for XPath operations in configuration file
+
+Package: kamailio-carrierroute-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: carrierroute module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the carrierroute module for Kamailio, an integrated
+ solution for routing, balancing and blacklisting.
+
+Package: kamailio-berkeley-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: db5.1-util,
+         kamailio (= ${binary:Version}),
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: Berkeley database module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the Berkeley database module for Kamailio, a
+ high-performance embedded DB kernel. All database tables are stored
+ in files, no additional server is necessary.
+
+Package: kamailio-berkeley-bin
+Architecture: linux-any
+Multi-Arch: foreign
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: Berkeley database module for Kamailio - helper program
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides helper modules for the Berkeley database module for
+ Kamailio, a high-performance embedded DB kernel. You should normally
+ install kamailio-berkeley-modules and not this package directly.
+
+Package: kamailio-ldap-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: LDAP modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the ldap and h350 modules for Kamailio, enabling LDAP
+ queries from the Kamailio config and storage of SIP account data in an LDAP
+ directory.
+
+Package: kamailio-ims-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: IMS module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains various Diameter interfaces and modules for Kamailio
+ to run as an IMS core.
+
+Package: kamailio-utils-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Provides a set utility functions for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ Provides a set of utility functions for Kamailio, which are not related
+ to the server configuration.
+
+Package: kamailio-sctp-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: sctp module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the sctp module for Kamailio.
+
+Package: kamailio-java-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: gcj-jre,
+         kamailio (= ${binary:Version}),
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: contains the app_java module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_java module, an extension allowing to
+ execute embedded Java applications within configuration file.
+
+Package: kamailio-tls-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the TLS kamailio transport module
+ This has been split out of the main kamailio package, so that kamailio will
+ not depend on openssl. This module will enable you to use the TLS transport.
+
+Package: kamailio-outbound-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Outbound module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains the module implementing SIP outbound extension.
+
+Package: kamailio-websocket-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Websocket module for kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains the module implementing WebSocket transport layer.
+
+Package: kamailio-dnssec-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the dnssec module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the dnssec module for Kamailio.
+
+Package: kamailio-autheph-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: authentication using ephemeral credentials module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the ephemeral module for Kamailio.
+
+Package: kamailio-extra-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: extra modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides: gzcompress
+
+Package: kamailio-nth
+Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: binutils,
+         bison,
+         bvi,
+         flex,
+         gcc,
+         gdb,
+         iftop,
+         lsof,
+         mc,
+         most,
+         ngrep,
+         psmisc,
+         screen,
+         sipsak,
+         tcpdump,
+         vim,
+         ${misc:Depends}
+Description: Kamailio - package for "nice to have" installation
+ This is a metapackage for easy installation various useful tools that may be
+ handy on server with Kamailio installed.
diff --git a/pkg/kamailio/deb/trusty/copyright b/pkg/kamailio/deb/trusty/copyright
new file mode 100644
index 0000000..ff31338
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/copyright
@@ -0,0 +1,335 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Kamailio
+Upstream-Contact: sr-dev at lists.sip-router.org
+Source: http://www.kamailio.org/pub/kamailio/
+
+Files: *
+Copyright:
+ 2001-2003 FhG Fokus
+ 2006-2010 iptelorg GmbH
+ Various others (see AUTHORS file)
+License: GPL-2.0+
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+
+Files: debian/*
+Copyright: 2012, 2013, 2014 Victor Seva <linuxmaniac at torreviejawireless.org>
+           2009, 2010, 2011, Daniel-Constantin Mierla <miconda at gmail.com>
+           2010, Jon Bonilla <manwe at aholab.ehu.es>
+           2009, Jonas Bergler <jonas.bergler at staff.snap.net.nz>
+           2009, Henning Westerholt <henning.westerholt at 1und1.de>
+           2007, Julien BLACHE <jblache at debian.org>
+License: GPL-2+
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+
+
+Files: atomic/* atomic_ops.* basex.* bit_*.c char_msg_val.h compiler_opt.h
+ core_stats.h counters.* endianness.* futexlock.h hashes.h io_wait.*
+ kstats_types.h lib/kcore/kstats_wrapper.* lock_ops.c lock_ops_init.h
+ lvalue.* mem/ll_malloc.* mem/memdbg.h mem/sf_malloc.* mi/*.h mod_fix.*
+ modules/tm/rpc_uac.* modules/counters/counters.c modules/tls/sbufq.h
+ modules/tls/tls_bio.* modules/tls/tls_cfg.* modules/tls/tls_cfg.h
+ modules/tls/tls_ct_wrq.* modules/tls/tls_ct_q.h modules/tls/tls_domain.*
+ modules/tls/tls_server.h modules/tls/tls_locking.* modules/tls/tls_rpc.*
+ modules/tls/tls_server.c modules/malloc_test/malloc_test.c modules/blst/blst.c
+ parser/case_p_* parser/case_reas.h pvapi.h pv_core.* rand/fastrand.* raw_*
+ rpc_lookup.* rvalue.* sctp_* ser_time.h shm_init.* sip_msg_clone.* sock_ut.*
+ sr_compat.* str_hash.h switch.* tcp_ev.h tcp_int_send.h tcp_options.*
+ tcp_read.h tcp_stats.* timer_proc.* tls_hooks.* tls_hooks_init.h ver.*
+Copyright: 2006-2010 iptelorg GmbH
+License: ISC
+
+Files: modules/tls/tls_select.* modules/tls/tls_dump_vf.*
+Copyright: 2005-2010 iptelorg GmbH
+License: GPL-2 + OpenSSL exception
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+ * Exception: permission to copy, modify, propagate, and distribute a work
+ * formed by combining OpenSSL toolkit software and the code in this file,
+ * such as linking with software components and libraries released under
+ * OpenSSL project license.
+
+Files: modules/websocket/* modules/outbound/* modules/auth_ephemeral/*
+Copyright: 2012-2013 Crocodile RCS Ltd
+License: GPL-2 + OpenSSL exception
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+ * Exception: permission to copy, modify, propagate, and distribute a work
+ * formed by combining OpenSSL toolkit software and the code in this file,
+ * such as linking with software components and libraries released under
+ * OpenSSL project license.
+
+Files: daemonize.* fastlock.h lock_ops.h mem/mem.* mem/f_malloc.h
+ mem/meminfo.h mem/memtest.c mem/shm_mem.c mem/q_malloc.h mem/q_malloc.c
+ mem/shm_mem.h mem/f_malloc.c modules/tls/tls_rpc.c modules/tls/tls_server.c
+ modules/tls/tls_domain.c modules/tls/tls_domain.h modules/tls/tls_server.h
+ modules/tls/tls_rpc.h pt.c pt.h sched_yield.h ut.c ut.h
+Copyright: 2001-2003 FhG Fokus
+License: ISC
+
+Files: events.* modules/topoh/*
+Copyright: 2009 SIP-Router.org
+License: ISC
+
+Files: modules/mi_rpc/mi_rpc_mod.c modules/pv/pv_xavp.*
+ modules/usrloc/ul_rpc.* ppcfg.* xavp.*
+Copyright: 2009-2010 Daniel-Constantin Mierla (asipto.com)
+License: ISC
+
+Files: obsolete/jabber_k/tree234.*
+Copyright: 1999, 2000, 2001, Simon Tatham
+License: Expat
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or
+ sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+ .
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT.  IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+
+Files: modules/xmpp/xsnprintf.c obsolete/jabber_s/xsnprintf.c obsolete/jabber_k/xsnprintf.c
+Copyright: 1995-1998, The Apache Group
+License: Apache-1.0
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ .
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+ .
+ 3. All advertising materials mentioning features or use of this
+    software must display the following acknowledgment:
+    "This product includes software developed by the Apache Group
+    for use in the Apache HTTP server project (http://www.apache.org/)."
+ .
+ 4. The names "Apache Server" and "Apache Group" must not be used to
+    endorse or promote products derived from this software without
+    prior written permission.
+ .
+ 5. Redistributions of any form whatsoever must retain the following
+    acknowledgment:
+    "This product includes software developed by the Apache Group
+    for use in the Apache HTTP server project (http://www.apache.org/)."
+ .
+ THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
+ EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Files: modules/mi_xmlrpc/abyss*
+Copyright: 2000, Moez Mahfoudh <mmoez at bigfoot.com>
+License: BSD-3-clause
+
+Files: list.h
+Copyright: 1991, 1993 The Regents of the University of California
+License: BSD-3-clause
+
+Files: modules/tm/t_serial.*
+Copyright: 2008 Juha Heinanen
+License: BSD-2-clause
+
+Files: parser/sdp/sdp.* parser/sdp/sdp_helpr_funcs.* parser/sdp/sdp_cloner.h
+Copyright:
+ 2008-2009 SOMA Networks, INC.
+ 2010 VoIP Embedded, Inc
+License: BSD-2-clause
+
+Files: modules/tls/fixed_c_zlib.h
+Copyright:1998-2005 The OpenSSL Project
+Comment: file copied from OpenSSL 0.9.8, refers to OpenSSL License. Note that
+ this code will not build by default in the Debian packaging.
+License: OpenSSL
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ .
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+ .
+ 3. All advertising materials mentioning features or use of this
+    software must display the following acknowledgment:
+    "This product includes software developed by the OpenSSL Project
+    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ .
+ 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+    endorse or promote products derived from this software without
+    prior written permission. For written permission, please contact
+    openssl-core at openssl.org.
+ .
+ 5. Products derived from this software may not be called "OpenSSL"
+    nor may "OpenSSL" appear in their names without prior written
+    permission of the OpenSSL Project.
+ .
+ 6. Redistributions of any form whatsoever must retain the following
+    acknowledgment:
+    "This product includes software developed by the OpenSSL Project
+    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ .
+ THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Files: md5.* md5utils.c
+Copyright: 1991-2, RSA Data Security, Inc
+Comment: Note that md5.c and md5.h have been replaced in the patches
+ plum_md5*.patch .
+ .
+ As for md5utils.c, according to a mail from Upstream (Daniel-Constantin
+ Mierla): while the initial commit log for it states that it is derived
+ from mddriver.c of RFC 1321, it seems that it was, in fact, written from
+ scratch by Jiri Kuthan (a core developer of SER at that time, working for
+ FhG Fokus Institute). As you can see it's rather trivial and uses a data
+ type of SER ("str").  I didn't reimplement it as it's too trivial and
+ looks like there's no other way to implement it.
+License: RSA-MD5
+ License to copy and use this software is granted provided that it
+ is identified as the "RSA Data Security, Inc. MD5 Message-Digest
+ Algorithm" in all material mentioning or referencing this software
+ or this function.
+ .
+ License is also granted to make and use derivative works provided
+ that such works are identified as "derived from the RSA Data
+ Security, Inc. MD5 Message-Digest Algorithm" in all material
+ mentioning or referencing the derived work.
+ .
+ RSA Data Security, Inc. makes no representations concerning either
+ the merchantability of this software or the suitability of this
+ software for any particular purpose. It is provided "as is"
+ without express or implied warranty of any kind.
+ .
+ These notices must be retained in any copies of any part of this
+ documentation and/or software.
+
+Files: mem/dl_*
+Copyright: n/a
+License: public-domain
+ This is a version (aka dlmalloc) of malloc/free/realloc written by
+ Doug Lea and released to the public domain, as explained at
+ http://creativecommons.org/licenses/publicdomain.  Send questions,
+ comments, complaints, performance data, etc to dl at cs.oswego.edu
+
+Files: rand/isaac/*
+Copyright: n/a
+License: public-domain
+ By Bob Jenkins.  My random number generator, ISAAC.  Public Domain.
+
+License: ISC
+ Permission to use, copy, modify, and distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Files: lib/srutils/srjson.*
+Copyright: 2009 Dave Gamble
+License: MIT
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ ,
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+
+License: BSD-3-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 4. Neither the name of the University nor the names of its contributors
+    may be used to endorse or promote products derived from this software
+    without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+License: BSD-2-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ .
+  1. Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/pkg/kamailio/deb/trusty/kamailio-autheph-modules.lintian-overrides b/pkg/kamailio/deb/trusty/kamailio-autheph-modules.lintian-overrides
new file mode 100644
index 0000000..dcb3d18
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/kamailio-autheph-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-autheph-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/trusty/kamailio-berkeley-bin.dirs b/pkg/kamailio/deb/trusty/kamailio-berkeley-bin.dirs
new file mode 100644
index 0000000..236670a
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/kamailio-berkeley-bin.dirs
@@ -0,0 +1 @@
+usr/sbin
diff --git a/pkg/kamailio/deb/trusty/kamailio-dnssec-modules.lintian-overrides b/pkg/kamailio/deb/trusty/kamailio-dnssec-modules.lintian-overrides
new file mode 100644
index 0000000..10165fe
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/kamailio-dnssec-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-dnssec-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/trusty/kamailio-outbound-modules.lintian-overrides b/pkg/kamailio/deb/trusty/kamailio-outbound-modules.lintian-overrides
new file mode 100644
index 0000000..3050cfe
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/kamailio-outbound-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-outbound-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/trusty/kamailio-tls-modules.lintian-overrides b/pkg/kamailio/deb/trusty/kamailio-tls-modules.lintian-overrides
new file mode 100644
index 0000000..bbe0d37
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/kamailio-tls-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/trusty/kamailio-websocket-modules.lintian-overrides b/pkg/kamailio/deb/trusty/kamailio-websocket-modules.lintian-overrides
new file mode 100644
index 0000000..8f384fb
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/kamailio-websocket-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-websocket-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/trusty/kamailio.README.Debian b/pkg/kamailio/deb/trusty/kamailio.README.Debian
new file mode 100644
index 0000000..d25769a
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/kamailio.README.Debian
@@ -0,0 +1,39 @@
+Kamailio for Debian
+-------------------
+
+* init script check for fork=no
+-------------------------------
+
+The Kamailio init script will not start Kamailio on boot if fork=no is
+specified in the config file. The check in the initscript will match
+any occurrence of fork=no in the file, even inside C-style comments.
+
+You can disable this check in the init script if you wish; just comment
+out the calls to the check_fork function in the script. Your changes to
+the init script will be preserved upon upgrade, as the file is tagged
+as a conffile.
+
+
+* Kamailio setup
+----------------
+
+To setup Kamailio, you need to:
+ - configure Kamailio properly to suit your needs
+ - edit /etc/default/kamailio, adjust the MEMORY parameter and set
+   RUN_KAMAILIO to "yes"
+
+If you are building an HA cluster using heartbeat or similar, you'll want
+to disable the init script by running:
+
+  update-rc.d kamailio remove
+
+so that Kamailio will not be launched at system startup. You still need
+to set RUN_KAMAILIO to "yes" if you want to use the /etc/init.d/kamailio init
+script.
+
+Set the DUMP_CORE parameter in /etc/default/kamailio to "yes" if you want to
+get a core dump in case Kamailio crashes. The debug symbols for Kamailio are
+provided by the kamailio-dbg package.
+
+
+ -- Victor Seva <linuxmaniac at torreviejawireless.org>  Wed, 11 Dec 2013 16:07:11 +0100
diff --git a/pkg/kamailio/deb/trusty/kamailio.default b/pkg/kamailio/deb/trusty/kamailio.default
new file mode 100644
index 0000000..0cfc8c8
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/kamailio.default
@@ -0,0 +1,28 @@
+#
+# Kamailio startup options
+#
+
+# Set to yes to enable kamailio, once configured properly.
+#RUN_KAMAILIO=yes
+
+# User to run as
+#USER=kamailio
+
+# Group to run as
+#GROUP=kamailio
+
+# Amount of shared and private memory to allocate
+# for the running Kamailio server (in Mb)
+#SHM_MEMORY=64
+#PKG_MEMORY=4
+
+# Config file
+#CFGFILE=/etc/kamailio/kamailio.cfg
+
+# Enable the server to leave a core file when it crashes.
+# Set this to 'yes' to enable Kamailio to leave a core file when it crashes
+# or 'no' to disable this feature. This option is case sensitive and only
+# accepts 'yes' and 'no' and only in lowercase letters.
+# On some systems it is necessary to specify a directory for the core files
+# to get a dump. Look into the kamailio init file for an example configuration.
+#DUMP_CORE=yes
diff --git a/pkg/kamailio/deb/trusty/kamailio.examples b/pkg/kamailio/deb/trusty/kamailio.examples
new file mode 100644
index 0000000..c48447a
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/kamailio.examples
@@ -0,0 +1,2 @@
+examples/*
+
diff --git a/pkg/kamailio/deb/trusty/kamailio.init b/pkg/kamailio/deb/trusty/kamailio.init
new file mode 100644
index 0000000..d4801d2
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/kamailio.init
@@ -0,0 +1,162 @@
+#! /bin/sh
+#
+### BEGIN INIT INFO
+# Provides:          kamailio
+# Required-Start:    $syslog $network $local_fs $remote_fs $time
+# Should-Start:      $named slapd mysql postgresql snmpd radiusd
+# Should-Stop:       $named slapd mysql postgresql snmpd radiusd
+# Required-Stop:     $syslog $network $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start the Kamailio SIP proxy server
+# Description:       Start the Kamailio SIP proxy server
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/kamailio
+NAME=kamailio
+DESC="Kamailio SIP server"
+HOMEDIR=/var/run/kamailio
+PIDFILE=$HOMEDIR/$NAME.pid
+DEFAULTS=/etc/default/kamailio
+CFGFILE=/etc/kamailio/kamailio.cfg
+RUN_KAMAILIO=no
+USER=kamailio
+GROUP=kamailio
+# Amount of shared and private memory to allocate
+# for the running Kamailio server (in Mb)
+SHM_MEMORY=64
+PKG_MEMORY=4
+DUMP_CORE=no
+
+# Do not start kamailio if fork=no is set in the config file
+# otherwise the boot process will just stop
+check_fork ()
+{
+    if grep -q "^[[:space:]]*fork[[:space:]]*=[[:space:]]*no.*" $CFGFILE; then
+	log_failure_msg "Not starting $DESC: fork=no specified in config file; run /etc/init.d/kamailio debug instead"
+	exit 0
+    fi
+}
+
+check_kamailio_config ()
+{
+	# Check if kamailio configuration is valid before starting the server
+	set +e
+	out=$($DAEMON -f $CFGFILE -M $PKG_MEMORY -c 2>&1 > /dev/null)
+	retcode=$?
+	set -e
+	if [ "$retcode" != '0' ]; then
+	    log_failure_msg "Not starting $DESC: invalid configuration file!"
+	    log_failure_msg
+	    log_failure_msg "$out"
+	    log_failure_msg
+	    exit 1
+	fi
+}
+
+create_radius_seqfile ()
+{
+    # Create a radius sequence file to be used by the radius client if
+    # radius accounting is enabled. This is needed to avoid any issue
+    # with the file not being writable if kamailio first starts as user
+    # root because DUMP_CORE is enabled and creates this file as user
+    # root and then later it switches back to user kamailio and cannot
+    # write to the file. If the file exists before kamailio starts, it
+    # won't change it's ownership and will be writable for both root
+    # and kamailio, no matter what options are chosen at install time
+    RADIUS_SEQ_FILE=/var/run/kamailio/kamailio_radius.seq
+    if [ -d /var/run/kamailio ]; then
+	chown ${USER}:${GROUP} /var/run/kamailio
+
+	if [ ! -f $RADIUS_SEQ_FILE ]; then
+	    touch $RADIUS_SEQ_FILE
+	fi
+
+	chown ${USER}:${GROUP} $RADIUS_SEQ_FILE
+	chmod 660 $RADIUS_SEQ_FILE
+    fi
+}
+
+test -f $DAEMON || exit 0
+
+# Load startup options if available
+if [ -f $DEFAULTS ]; then
+   . $DEFAULTS || true
+fi
+
+if [ "$RUN_KAMAILIO" != "yes" ]; then
+    log_failure_msg "Kamailio not yet configured. Edit /etc/default/kamailio first."
+    exit 0
+fi
+
+set -e
+
+SHM_MEMORY=$((`echo $SHM_MEMORY | sed -e 's/[^0-9]//g'`))
+PKG_MEMORY=$((`echo $PKG_MEMORY | sed -e 's/[^0-9]//g'`))
+[ -z "$USER" ]  && USER=kamailio
+[ -z "$GROUP" ] && GROUP=kamailio
+[ $SHM_MEMORY -le 0 ] && SHM_MEMORY=64
+[ $PKG_MEMORY -le 0 ] && PKG_MEMORY=4
+
+if test "$DUMP_CORE" = "yes" ; then
+    # set proper ulimit
+    ulimit -c unlimited
+
+    # directory for the core dump files
+    # COREDIR=/home/corefiles
+    # [ -d $COREDIR ] || mkdir $COREDIR
+    # chmod 777 $COREDIR
+    # echo "$COREDIR/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
+fi
+
+# /var/run can be a tmpfs
+if [ ! -d $HOMEDIR ]; then
+    mkdir -p $HOMEDIR
+fi
+
+OPTIONS="-f $CFGFILE -P $PIDFILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP"
+
+case "$1" in
+  start|debug)
+	check_kamailio_config
+	create_radius_seqfile
+
+	if [ "$1" != "debug" ]; then
+	    check_fork
+	fi
+
+	log_daemon_msg "Starting $DESC: $NAME"
+	start-stop-daemon --start --quiet --pidfile $PIDFILE \
+		--exec $DAEMON -- $OPTIONS || log_failure_msg " already running"
+	log_end_msg 0
+	;;
+  stop)
+	log_daemon_msg "Stopping $DESC: $NAME"
+	start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
+		--exec $DAEMON
+	log_end_msg 0
+	;;
+  restart|force-reload)
+	check_kamailio_config
+	create_radius_seqfile
+
+	$0 stop
+	sleep 1
+	$0 start
+	;;
+  status)
+	log_daemon_msg "Status of $DESC: "
+
+	status_of_proc -p"$PIDFILE" $NAME $NAME
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload|status|debug}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/pkg/kamailio/deb/trusty/kamailio.lintian-overrides b/pkg/kamailio/deb/trusty/kamailio.lintian-overrides
new file mode 100644
index 0000000..18152ed
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/kamailio.lintian-overrides
@@ -0,0 +1,2 @@
+kamailio binary: example-interpreter-not-absolute usr/share/doc/kamailio/examples/outbound/edge.cfg #!KAMAILIO
+kamailio binary: example-interpreter-not-absolute usr/share/doc/kamailio/examples/outbound/registrar.cfg #!KAMAILIO
diff --git a/pkg/kamailio/deb/trusty/kamailio.postinst b/pkg/kamailio/deb/trusty/kamailio.postinst
new file mode 100644
index 0000000..4ee38ec
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/kamailio.postinst
@@ -0,0 +1,24 @@
+#! /bin/sh
+
+set -e
+
+case "$1" in
+    configure)
+        adduser --quiet --system --group --disabled-password \
+                --shell /bin/false --gecos "Kamailio SIP Server" \
+                --home /var/run/kamailio kamailio || true
+
+        ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+        ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+        ;;
+esac
+
+#DEBHELPER#
+
diff --git a/pkg/kamailio/deb/trusty/rules b/pkg/kamailio/deb/trusty/rules
new file mode 100755
index 0000000..f9058d3
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/rules
@@ -0,0 +1,220 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+DEBVERSION:=$(shell head -n 1 debian/changelog \
+                    | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
+UPVERSION:=$(shell dpkg-parsechangelog | sed -ne 's/^Version: \(\([0-9]\+\):\)\?\(.*\)-.*/\3/p')
+
+FILENAME := kamailio_$(UPVERSION).orig.tar.gz
+URL := http://www.kamailio.org/pub/kamailio/$(UPVERSION)/src/kamailio-$(UPVERSION)_src.tar.gz
+
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/buildflags.mk
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+export JAVA_HOME=/usr/lib/jvm/java-gcj
+
+# choose freeradius
+export FREERADIUS=1
+
+# modules not in the "main" kamailio package
+EXCLUDED_MODULES=
+
+# extra modules to skip, because they are not compilable now
+# - regardless if they go to the main kamailio package or to some module package,
+# they will be excluded from compile and install of all
+EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc
+
+# module groups that are packaged in seperate packages
+# (with the name kamailio-$(group_name)-modules)
+# Note: the order is important (should be in dependency order, the one
+# on which other depend first)
+PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \
+			   ldap xml perl utils lua memcached \
+			   snmpstats carrierroute xmpp cpl redis python geoip\
+			   sqlite json mono ims sctp java \
+			   purple tls outbound websocket autheph dnssec
+
+# module groups to be packaged onto kamailio-extra-modules
+EXTRA_GROUPS=gzcompress
+
+# name of libdir in the path for libraries (e.g., lib for 32b, lib64 for 64b)
+LIBDIR ?= lib/$(DEB_HOST_MULTIARCH)
+
+# directories with possible duplicate libraries (that should be deleted
+# from current module* packages)
+DUP_LIBS_DIRS=$(CURDIR)/debian/kamailio/usr/$(LIBDIR)/kamailio \
+			$(CURDIR)/debian/kamailio-db-modules/usr/$(LIBDIR)/kamailio
+
+# "function" to get package short name out of a dir/module_name
+# it also transforms db_foo into foo
+mod_name=$(subst db_,,$(lastword $(subst /, ,$(1))))
+
+define PACKAGE_GRP_BUILD_template
+	# package all the modules in PACKAGE_GROUPS in separate packages
+	$(foreach grp,$(PACKAGE_GROUPS EXTRA_GROUPS),\
+		$(MAKE) every-module group_include="k$(grp)"
+	)
+endef
+
+
+define PACKAGE_GRP_INSTALL_template
+	$(foreach grp,$(PACKAGE_GROUPS),\
+		$(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \
+		basedir=$(CURDIR)/debian/kamailio-$(grp)-modules \
+		cfg_prefix=$(CURDIR)/debian/kamailio-$(grp)-modules \
+		doc-dir=share/doc/kamailio-$(grp)-modules
+		# eliminate duplicate libs
+		-for d in $(DUP_LIBS_DIRS); do \
+			test "$$d" != "$(CURDIR)/debian/kamailio-$(grp)-modules/usr/$(LIBDIR)/kamailio" &&\
+			for r in `find $$d -name 'lib*'|xargs`; do \
+				echo "removing $(grp) lib `basename $$r` present also in $$d";\
+				rm -f $(CURDIR)/debian/kamailio-$(grp)-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \
+			done ; \
+		done
+		find $(CURDIR)/debian/kamailio-$(grp)-modules -depth -empty -type d -exec rmdir {} \;
+	)
+endef
+
+define PACKAGE_EXTRA_INSTALL_template
+	$(foreach grp,$(EXTRA_GROUPS),\
+		$(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \
+		basedir=$(CURDIR)/debian/kamailio-extra-modules \
+		cfg_prefix=$(CURDIR)/debian/kamailio-extra-modules \
+		doc-dir=share/doc/kamailio-extra-modules
+	)
+	# eliminate duplicate libs
+	-for d in $(DUP_LIBS_DIRS); do \
+		test "$$d" != "$(CURDIR)/debian/kamailio-extra-modules/usr/$(LIBDIR)/kamailio" &&\
+		for r in `find $$d -name 'lib*'|xargs`; do \
+			echo "removing extra lib `basename $$r` present also in $$d";\
+			rm -f $(CURDIR)/debian/kamailio-extra-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \
+		done ; \
+	done
+	find $(CURDIR)/debian/kamailio-extra-modules -depth -empty -type d -exec rmdir {} \;
+endef
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	INSTALL_PROGRAM += -s
+endif
+
+# CFLAGS + CPPFLAGS -> CC_EXTRA_OPTS
+# LDFLAGS -> LD_EXTRA_OPTS
+CUSTOM_BUILDFLAGS:=$(shell dpkg-buildflags --export=configure| \
+sed -e 's/" CPPFLAGS="/ /' -e 's/CFLAGS/CC_EXTRA_OPTS/g' -e 's/LDFLAGS/LD_EXTRA_OPTS/g')
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	# Add here commands to configure the package.
+	$(MAKE) FLAVOUR=kamailio cfg prefix=/usr cfg_prefix=$(CURDIR)/debian/kamailio \
+			cfg_target=/etc/kamailio/ \
+			basedir=$(CURDIR)/debian/kamailio \
+			skip_modules="$(EXCLUDED_MODULES) $(EXTRA_EXCLUDED_MODULES)" \
+			$(CUSTOM_BUILDFLAGS) \
+			group_include="kstandard"
+
+	touch configure-stamp
+
+
+build: build-stamp
+build-arch: build-stamp
+build-indep: build-stamp
+build-stamp: configure-stamp
+	dh_testdir
+	# Add here commands to compile the package.
+	$(MAKE) all
+	# make groups
+	$(call PACKAGE_GRP_BUILD_template)
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	# Add here commands to clean up after the build process.
+	$(MAKE) maintainer-clean
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_prep
+	dh_installdirs
+	# Add here commands to install the package into debian/kamailio
+	$(MAKE) install LIBDIR=$(LIBDIR) group_include="kstandard"
+	# make group packages
+	$(call PACKAGE_GRP_INSTALL_template)
+	$(call PACKAGE_EXTRA_INSTALL_template)
+	mv $(CURDIR)/debian/kamailio-berkeley-modules/usr/sbin/kambdb_recover \
+		$(CURDIR)/debian/kamailio-berkeley-bin/usr/sbin/kambdb_recover
+	# install /etc/default/kamailio file
+	mkdir -p $(CURDIR)/debian/kamailio/etc/default
+	cp -f debian/kamailio.default $(CURDIR)/debian/kamailio/etc/default/kamailio
+
+
+# This single target is used to build all the packages, all at once, or
+# one at a time. So keep in mind: any options passed to commands here will
+# affect _all_ packages. Anything you want to only affect one package
+# should be put in another target, such as the install target.
+binary-common:
+	dh_testdir
+	dh_testroot
+	dh_installdebconf
+	dh_installdocs
+	dh_installexamples
+	dh_installmenu
+	dh_installinit -pkamailio -- defaults 23
+	dh_installcron
+	dh_installman
+	dh_installinfo
+	dh_lintian
+	dh_installchangelogs ChangeLog
+	dh_link
+	dh_strip --dbg-package=kamailio-dbg
+	dh_compress
+	dh_fixperms
+	dh_makeshlibs
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+# Build architecture-independent packages using the common target
+binary-indep: build install
+# (Uncomment this next line if you have such packages.)
+#        $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
+# We have nothing to do by default.
+
+
+# Build architecture-dependent packages using the common target
+binary-arch: build install
+	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
+
+# Any other binary targets build just one binary package at a time.
+binary-%: build install
+	$(MAKE) -f debian/rules binary-common DH_OPTIONS=-p$*
+
+print-version:
+	@@echo "Debian version:          $(DEBVERSION)"
+	@@echo "Upstream version:        $(UPVERSION)"
+
+get-orig-source:
+	@@dh_testdir
+	@@[ -d ../tarballs/. ]||mkdir -p ../tarballs
+	@@echo Downloading $(FILENAME) from $(URL) ...
+	@@wget -nv -T10 -t3 -O ../tarballs/$(FILENAME) $(URL)
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
+
diff --git a/pkg/kamailio/deb/trusty/source.lintian-overrides b/pkg/kamailio/deb/trusty/source.lintian-overrides
new file mode 100644
index 0000000..620d9ff
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/source.lintian-overrides
@@ -0,0 +1 @@
+kamailio source: debian-watch-file-in-native-package
diff --git a/pkg/kamailio/deb/trusty/source/format b/pkg/kamailio/deb/trusty/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/pkg/kamailio/deb/trusty/watch b/pkg/kamailio/deb/trusty/watch
new file mode 100644
index 0000000..c50f31f
--- /dev/null
+++ b/pkg/kamailio/deb/trusty/watch
@@ -0,0 +1,3 @@
+version=3
+opts=dversionmangle=s/\~svn([\d]+)//; \
+http://www.kamailio.org/pub/kamailio/([\d.]+)/src/kamailio-([\d.]+)_src\.tar\.gz
diff --git a/pkg/kamailio/deb/wheezy/changelog b/pkg/kamailio/deb/wheezy/changelog
new file mode 100644
index 0000000..d13762c
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/changelog
@@ -0,0 +1,118 @@
+kamailio (4.1.5) unstable; urgency=low
+
+  * update to 4.1.5 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Wed, 06 Aug 2014 16:50:20 +0100
+
+kamailio (4.1.4) unstable; urgency=low
+
+  * update to 4.1.4 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 12 Jun 2014 15:55:55 +0100
+
+kamailio (4.1.3) unstable; urgency=low
+
+  * update to 4.1.3 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 24 Apr 2014 10:45:20 +0100
+
+kamailio (4.1.2) unstable; urgency=low
+
+  * update to 4.1.2 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 06 Mar 2014 15:25:35 +0100
+
+kamailio (4.1.1) unstable; urgency=low
+
+  * update to 4.1.1 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 09 Jan 2014 15:45:35 +0100
+
+kamailio (4.1.0) unstable; urgency=low
+
+  * update to 4.1.0
+
+ -- Victor Seva <linuxmaniac at torreviejawireless.org>  Wed, 04 Dec 2013 11:42:27 +0100
+
+kamailio (4.0.0) unstable; urgency=low
+
+  * update to 4.0.0 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Mon, 11 Mar 2013 10:40:30 +0100
+
+kamailio (3.4.0~dev0) unstable; urgency=low
+
+  * update version to 3.4.0~dev0
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Wed, 15 Jun 2012 03:15:00 +0100
+
+kamailio (3.2.0) unstable; urgency=low
+
+  * update to 3.2.0 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Fri, 29 Apr 2011 12:25:30 +0100
+
+kamailio (3.1.1) unstable; urgency=low
+
+  * update to 3.1.1 from upstream
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Fri, 3 Dec 2010 16:30:00 +0100
+
+kamailio (3.1.0) unstable; urgency=low
+
+  * update to 3.1.0 from upstream
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Wed, 6 Oct 2010 17:24:00 +0100
+
+kamailio (3.0.2.99) unstable; urgency=low
+
+  * update to 3.0.2.99 for development version builds
+
+ -- Jon Bonilla <manwe at aholab.ehu.es>  Fri, 28 May 2010 22:26:00 +0100
+
+kamailio (3.0.2) unstable; urgency=low
+
+  * update to 3.0.2 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Thu, 27 May 2010 10:27:36 +0100
+
+kamailio (3.0.1) unstable; urgency=low
+
+  * update to 3.0.1 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Mon, 08 Mar 2010 20:30:48 +0100
+
+kamailio (3.0.0) unstable; urgency=low
+
+  * update to 3.0.0 from upstream
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Mon, 11 Jan 2010 18:30:42 +0100
+
+kamailio (3.0.0-rc3) unstable; urgency=low
+
+  * update to 3.0.0-rc3 from upstream
+  * updated debian/rules to work with the SIP Router style module packaging
+
+ -- Daniel-Constantin Mierla <miconda at gmail.com>  Fri, 10 Dec 2009 12:10:02 +0100
+
+kamailio (3.0.0-rc2) unstable; urgency=low
+
+  * update to 3.0.0-rc2 from upstream
+  * updated debian/rules to work with the new style module packaging
+
+ -- Jonas Bergler <jonas.bergler at staff.snap.net.nz>  Wed, 18 Nov 2009 12:30:02 +1300
+
+kamailio (1.5.0-svn1) unstable; urgency=low
+
+  * increment debian packaging for trunk
+
+ -- Henning Westerholt <henning.westerholt at 1und1.de>  Mon, 02 Mar 2009 17:40:02 +0100
+
+kamailio (1.4.0-svn1) unstable; urgency=low
+
+  [ Klaus Darilion ]
+  * first release of Kamailio (after renaming from Openser)
+
+ -- Julien BLACHE <jblache at debian.org>  Wed, 12 Dec 2007 17:25:31 +0100
+
+
diff --git a/pkg/kamailio/deb/wheezy/compat b/pkg/kamailio/deb/wheezy/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/compat
@@ -0,0 +1 @@
+9
diff --git a/pkg/kamailio/deb/wheezy/control b/pkg/kamailio/deb/wheezy/control
new file mode 100644
index 0000000..fe2ee80
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/control
@@ -0,0 +1,542 @@
+Source: kamailio
+Section: net
+Priority: optional
+Maintainer: Debian VoIP Team <pkg-voip-maintainers at lists.alioth.debian.org>
+Uploaders: Victor Seva <linuxmaniac at torreviejawireless.org>,
+           Tzafrir Cohen <tzafrir at debian.org>
+Build-Depends: bison,
+               debhelper (>= 9),
+               docbook-xml,
+               dpkg-dev (>= 1.16.1.1),
+               flex,
+               gcj-jdk,
+               libconfuse-dev,
+               libcurl4-openssl-dev,
+               libdb-dev (>= 4.6.19),
+               libevent-dev,
+               libexpat1-dev,
+               libradiusclient-ng-dev,
+               libgeoip-dev (>= 1.4.5),
+               libhiredis-dev (>= 0.10.0),
+               libjson0-dev,
+               libldap2-dev,
+               liblua5.1-0-dev,
+               libmemcached-dev,
+               libmono-2.0-dev,
+               libmysqlclient-dev,
+               libncurses5-dev,
+               libpcre3-dev,
+               libperl-dev,
+               libpq-dev,
+               libreadline-dev,
+               libsasl2-dev,
+               libsctp-dev,
+               libsnmp-dev,
+               libsqlite3-dev,
+               libunistring-dev,
+               libxml2-dev,
+               openssl,
+               python,
+               python-dev,
+               unixodbc-dev,
+               xsltproc,
+               zlib1g-dev
+Standards-Version: 3.9.5
+Homepage: http://www.kamailio.org/
+Vcs-git: git://anonscm.debian.org/pkg-voip/kamailio.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-voip/kamailio.git
+
+Package: kamailio
+Architecture: linux-any
+Multi-Arch: foreign
+Pre-Depends: ${misc:Pre-Depends}
+Depends: adduser, python, ${misc:Depends}, ${shlibs:Depends}
+Suggests: kamailio-berkeley-modules,
+          kamailio-carrierroute-modules,
+          kamailio-cpl-modules,
+          kamailio-dbg,
+          kamailio-ldap-modules,
+          kamailio-lua-modules,
+          kamailio-mysql-modules,
+          kamailio-perl-modules,
+          kamailio-postgres-modules,
+          kamailio-presence-modules,
+          kamailio-python-modules,
+          kamailio-radius-modules,
+          kamailio-snmpstats-modules,
+          kamailio-tls-modules,
+          kamailio-unixodbc-modules,
+          kamailio-xml-modules,
+          kamailio-xmpp-modules
+Description: very fast and configurable SIP proxy
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ C Shell-like scripting language provides full control over the server's
+ behaviour. Its modular architecture allows only required functionality to be
+ loaded.
+ .
+ Among others, the following modules are available: digest authentication, CPL
+ scripts, instant messaging, MySQL support, presence agent, RADIUS
+ authentication, record routing, SMS gateway, Jabber/XMPP gateway, transaction
+ module, registrar and user location, XML-RPC interface.
+ .
+ This package contains the main Kamailio binary along with the principal modules
+ and support binaries.
+
+Package: kamailio-dbg
+Priority: extra
+Section: debug
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}
+Description: very fast and configurable SIP proxy [debug symbols]
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains the debugging symbols for the Kamailio binaries and
+ modules. You only need to install it if you need to debug Kamailio.
+
+Package: kamailio-geoip-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the geoip module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the geoip module, an extension allowing to
+ use GeoIP API within configuration file.
+
+Package: kamailio-sqlite-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Recommends: sqlite3
+Description: SQLite database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the SQLite database driver for Kamailio.
+
+Package: kamailio-json-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Json parser and jsonrpc modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides json parser for Kamailio's configuration file
+ and the JSON-RPC client over netstrings.
+
+Package: kamailio-memcached-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Replaces: kamailio-memcached-module
+Description: Provides the memcached module, an interface to the memcached server
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the memcached module, an interface to the memcached
+ server, a high-performance, distributed memory object caching system.
+
+Package: kamailio-lua-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the app_lua module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_lua module, an extension allowing to
+ execute embedded Lua applications within configuration file.
+
+Package: kamailio-mono-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the app_mono module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_mono module, an extension allowing to
+ execute embedded Mono applications within configuration file.
+
+Package: kamailio-python-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         python-dev,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: contains the app_python module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_python module, an extension allowing to
+ execute embedded Python applications within configuration file.
+
+Package: kamailio-redis-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Redis database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the Redis NOSQL database driver for Kamailio.
+
+Package: kamailio-mysql-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         mysql-client,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: MySQL database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the MySQL database driver for Kamailio.
+
+Package: kamailio-postgres-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         postgresql-client,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: PostgreSQL database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the PostgreSQL database driver for Kamailio.
+
+Package: kamailio-cpl-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: CPL module (CPL interpreter engine) for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides a CPL (Call Processing Language) interpreter for
+ Kamailio, turning Kamailio into a CPL server (storage and interpreter).
+
+Package: kamailio-radius-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: RADIUS modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides a set of RADIUS modules for Kamailio, for
+ authentication, peering, group membership and messages URIs checking against a
+ RADIUS server.
+
+Package: kamailio-unixodbc-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: unixODBC database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the unixODBC database driver for Kamailio.
+
+Package: kamailio-presence-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: SIMPLE presence modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides several Kamailio modules for implementing presence
+ server and presence user agent for RICH presence, registrar-based presence,
+ external triggered presence and XCAP support.
+
+Package: kamailio-perl-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Perl extensions and database driver for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides an interface for Kamailio to write Perl extensions and
+ the perlvdb database driver for Kamailio.
+
+Package: kamailio-snmpstats-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}),
+         snmpd,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: SNMP AgentX subagent module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the snmpstats module for Kamailio. This module acts
+ as an AgentX subagent which connects to a master agent.
+
+Package: kamailio-xmpp-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: XMPP gateway module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the SIP to XMPP IM translator module for Kamailio.
+
+Package: kamailio-xml-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Replaces: kamailio-xml-module, kamailio-xmlrpc-module
+Provides: kamailio-xmlrpc-modules
+Description: XML based extensions for Kamailio's Management Interface
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides:
+ - the XMLRPC transport implementations for Kamailio's
+ Management and Control Interface.
+ - xmlops module for XPath operations in configuration file
+
+Package: kamailio-carrierroute-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: carrierroute module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the carrierroute module for Kamailio, an integrated
+ solution for routing, balancing and blacklisting.
+
+Package: kamailio-berkeley-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: db5.1-util,
+         kamailio (= ${binary:Version}),
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: Berkeley database module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the Berkeley database module for Kamailio, a
+ high-performance embedded DB kernel. All database tables are stored
+ in files, no additional server is necessary.
+
+Package: kamailio-berkeley-bin
+Architecture: linux-any
+Multi-Arch: foreign
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: Berkeley database module for Kamailio - helper program
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides helper modules for the Berkeley database module for
+ Kamailio, a high-performance embedded DB kernel. You should normally
+ install kamailio-berkeley-modules and not this package directly.
+
+Package: kamailio-ldap-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: LDAP modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the ldap and h350 modules for Kamailio, enabling LDAP
+ queries from the Kamailio config and storage of SIP account data in an LDAP
+ directory.
+
+Package: kamailio-ims-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: IMS module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains various Diameter interfaces and modules for Kamailio
+ to run as an IMS core.
+
+Package: kamailio-utils-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Provides a set utility functions for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ Provides a set of utility functions for Kamailio, which are not related
+ to the server configuration.
+
+Package: kamailio-sctp-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: sctp module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the sctp module for Kamailio.
+
+Package: kamailio-java-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: gcj-jre,
+         kamailio (= ${binary:Version}),
+         ${misc:Depends},
+         ${shlibs:Depends}
+Description: contains the app_java module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_java module, an extension allowing to
+ execute embedded Java applications within configuration file.
+
+Package: kamailio-tls-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: contains the TLS kamailio transport module
+ This has been split out of the main kamailio package, so that kamailio will
+ not depend on openssl. This module will enable you to use the TLS transport.
+
+Package: kamailio-outbound-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Outbound module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains the module implementing SIP outbound extension.
+
+Package: kamailio-websocket-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: Websocket module for kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package contains the module implementing WebSocket transport layer.
+
+Package: kamailio-autheph-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: authentication using ephemeral credentials module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the ephemeral module for Kamailio.
+
+Package: kamailio-extra-modules
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: kamailio (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Description: extra modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides: gzcompress
+
+Package: kamailio-nth
+Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: binutils,
+         bison,
+         bvi,
+         flex,
+         gcc,
+         gdb,
+         iftop,
+         lsof,
+         mc,
+         most,
+         ngrep,
+         psmisc,
+         screen,
+         sipsak,
+         tcpdump,
+         vim,
+         ${misc:Depends}
+Description: Kamailio - package for "nice to have" installation
+ This is a metapackage for easy installation various useful tools that may be
+ handy on server with Kamailio installed.
diff --git a/pkg/kamailio/deb/wheezy/copyright b/pkg/kamailio/deb/wheezy/copyright
new file mode 100644
index 0000000..ff31338
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/copyright
@@ -0,0 +1,335 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Kamailio
+Upstream-Contact: sr-dev at lists.sip-router.org
+Source: http://www.kamailio.org/pub/kamailio/
+
+Files: *
+Copyright:
+ 2001-2003 FhG Fokus
+ 2006-2010 iptelorg GmbH
+ Various others (see AUTHORS file)
+License: GPL-2.0+
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+
+Files: debian/*
+Copyright: 2012, 2013, 2014 Victor Seva <linuxmaniac at torreviejawireless.org>
+           2009, 2010, 2011, Daniel-Constantin Mierla <miconda at gmail.com>
+           2010, Jon Bonilla <manwe at aholab.ehu.es>
+           2009, Jonas Bergler <jonas.bergler at staff.snap.net.nz>
+           2009, Henning Westerholt <henning.westerholt at 1und1.de>
+           2007, Julien BLACHE <jblache at debian.org>
+License: GPL-2+
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+
+
+Files: atomic/* atomic_ops.* basex.* bit_*.c char_msg_val.h compiler_opt.h
+ core_stats.h counters.* endianness.* futexlock.h hashes.h io_wait.*
+ kstats_types.h lib/kcore/kstats_wrapper.* lock_ops.c lock_ops_init.h
+ lvalue.* mem/ll_malloc.* mem/memdbg.h mem/sf_malloc.* mi/*.h mod_fix.*
+ modules/tm/rpc_uac.* modules/counters/counters.c modules/tls/sbufq.h
+ modules/tls/tls_bio.* modules/tls/tls_cfg.* modules/tls/tls_cfg.h
+ modules/tls/tls_ct_wrq.* modules/tls/tls_ct_q.h modules/tls/tls_domain.*
+ modules/tls/tls_server.h modules/tls/tls_locking.* modules/tls/tls_rpc.*
+ modules/tls/tls_server.c modules/malloc_test/malloc_test.c modules/blst/blst.c
+ parser/case_p_* parser/case_reas.h pvapi.h pv_core.* rand/fastrand.* raw_*
+ rpc_lookup.* rvalue.* sctp_* ser_time.h shm_init.* sip_msg_clone.* sock_ut.*
+ sr_compat.* str_hash.h switch.* tcp_ev.h tcp_int_send.h tcp_options.*
+ tcp_read.h tcp_stats.* timer_proc.* tls_hooks.* tls_hooks_init.h ver.*
+Copyright: 2006-2010 iptelorg GmbH
+License: ISC
+
+Files: modules/tls/tls_select.* modules/tls/tls_dump_vf.*
+Copyright: 2005-2010 iptelorg GmbH
+License: GPL-2 + OpenSSL exception
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+ * Exception: permission to copy, modify, propagate, and distribute a work
+ * formed by combining OpenSSL toolkit software and the code in this file,
+ * such as linking with software components and libraries released under
+ * OpenSSL project license.
+
+Files: modules/websocket/* modules/outbound/* modules/auth_ephemeral/*
+Copyright: 2012-2013 Crocodile RCS Ltd
+License: GPL-2 + OpenSSL exception
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'.
+ * Exception: permission to copy, modify, propagate, and distribute a work
+ * formed by combining OpenSSL toolkit software and the code in this file,
+ * such as linking with software components and libraries released under
+ * OpenSSL project license.
+
+Files: daemonize.* fastlock.h lock_ops.h mem/mem.* mem/f_malloc.h
+ mem/meminfo.h mem/memtest.c mem/shm_mem.c mem/q_malloc.h mem/q_malloc.c
+ mem/shm_mem.h mem/f_malloc.c modules/tls/tls_rpc.c modules/tls/tls_server.c
+ modules/tls/tls_domain.c modules/tls/tls_domain.h modules/tls/tls_server.h
+ modules/tls/tls_rpc.h pt.c pt.h sched_yield.h ut.c ut.h
+Copyright: 2001-2003 FhG Fokus
+License: ISC
+
+Files: events.* modules/topoh/*
+Copyright: 2009 SIP-Router.org
+License: ISC
+
+Files: modules/mi_rpc/mi_rpc_mod.c modules/pv/pv_xavp.*
+ modules/usrloc/ul_rpc.* ppcfg.* xavp.*
+Copyright: 2009-2010 Daniel-Constantin Mierla (asipto.com)
+License: ISC
+
+Files: obsolete/jabber_k/tree234.*
+Copyright: 1999, 2000, 2001, Simon Tatham
+License: Expat
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or
+ sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+ .
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT.  IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+
+Files: modules/xmpp/xsnprintf.c obsolete/jabber_s/xsnprintf.c obsolete/jabber_k/xsnprintf.c
+Copyright: 1995-1998, The Apache Group
+License: Apache-1.0
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ .
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+ .
+ 3. All advertising materials mentioning features or use of this
+    software must display the following acknowledgment:
+    "This product includes software developed by the Apache Group
+    for use in the Apache HTTP server project (http://www.apache.org/)."
+ .
+ 4. The names "Apache Server" and "Apache Group" must not be used to
+    endorse or promote products derived from this software without
+    prior written permission.
+ .
+ 5. Redistributions of any form whatsoever must retain the following
+    acknowledgment:
+    "This product includes software developed by the Apache Group
+    for use in the Apache HTTP server project (http://www.apache.org/)."
+ .
+ THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
+ EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Files: modules/mi_xmlrpc/abyss*
+Copyright: 2000, Moez Mahfoudh <mmoez at bigfoot.com>
+License: BSD-3-clause
+
+Files: list.h
+Copyright: 1991, 1993 The Regents of the University of California
+License: BSD-3-clause
+
+Files: modules/tm/t_serial.*
+Copyright: 2008 Juha Heinanen
+License: BSD-2-clause
+
+Files: parser/sdp/sdp.* parser/sdp/sdp_helpr_funcs.* parser/sdp/sdp_cloner.h
+Copyright:
+ 2008-2009 SOMA Networks, INC.
+ 2010 VoIP Embedded, Inc
+License: BSD-2-clause
+
+Files: modules/tls/fixed_c_zlib.h
+Copyright:1998-2005 The OpenSSL Project
+Comment: file copied from OpenSSL 0.9.8, refers to OpenSSL License. Note that
+ this code will not build by default in the Debian packaging.
+License: OpenSSL
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ .
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+ .
+ 3. All advertising materials mentioning features or use of this
+    software must display the following acknowledgment:
+    "This product includes software developed by the OpenSSL Project
+    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ .
+ 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+    endorse or promote products derived from this software without
+    prior written permission. For written permission, please contact
+    openssl-core at openssl.org.
+ .
+ 5. Products derived from this software may not be called "OpenSSL"
+    nor may "OpenSSL" appear in their names without prior written
+    permission of the OpenSSL Project.
+ .
+ 6. Redistributions of any form whatsoever must retain the following
+    acknowledgment:
+    "This product includes software developed by the OpenSSL Project
+    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ .
+ THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Files: md5.* md5utils.c
+Copyright: 1991-2, RSA Data Security, Inc
+Comment: Note that md5.c and md5.h have been replaced in the patches
+ plum_md5*.patch .
+ .
+ As for md5utils.c, according to a mail from Upstream (Daniel-Constantin
+ Mierla): while the initial commit log for it states that it is derived
+ from mddriver.c of RFC 1321, it seems that it was, in fact, written from
+ scratch by Jiri Kuthan (a core developer of SER at that time, working for
+ FhG Fokus Institute). As you can see it's rather trivial and uses a data
+ type of SER ("str").  I didn't reimplement it as it's too trivial and
+ looks like there's no other way to implement it.
+License: RSA-MD5
+ License to copy and use this software is granted provided that it
+ is identified as the "RSA Data Security, Inc. MD5 Message-Digest
+ Algorithm" in all material mentioning or referencing this software
+ or this function.
+ .
+ License is also granted to make and use derivative works provided
+ that such works are identified as "derived from the RSA Data
+ Security, Inc. MD5 Message-Digest Algorithm" in all material
+ mentioning or referencing the derived work.
+ .
+ RSA Data Security, Inc. makes no representations concerning either
+ the merchantability of this software or the suitability of this
+ software for any particular purpose. It is provided "as is"
+ without express or implied warranty of any kind.
+ .
+ These notices must be retained in any copies of any part of this
+ documentation and/or software.
+
+Files: mem/dl_*
+Copyright: n/a
+License: public-domain
+ This is a version (aka dlmalloc) of malloc/free/realloc written by
+ Doug Lea and released to the public domain, as explained at
+ http://creativecommons.org/licenses/publicdomain.  Send questions,
+ comments, complaints, performance data, etc to dl at cs.oswego.edu
+
+Files: rand/isaac/*
+Copyright: n/a
+License: public-domain
+ By Bob Jenkins.  My random number generator, ISAAC.  Public Domain.
+
+License: ISC
+ Permission to use, copy, modify, and distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Files: lib/srutils/srjson.*
+Copyright: 2009 Dave Gamble
+License: MIT
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ ,
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+
+License: BSD-3-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 4. Neither the name of the University nor the names of its contributors
+    may be used to endorse or promote products derived from this software
+    without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+License: BSD-2-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ .
+  1. Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/pkg/kamailio/deb/wheezy/kamailio-autheph-modules.lintian-overrides b/pkg/kamailio/deb/wheezy/kamailio-autheph-modules.lintian-overrides
new file mode 100644
index 0000000..dcb3d18
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/kamailio-autheph-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-autheph-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/wheezy/kamailio-berkeley-bin.dirs b/pkg/kamailio/deb/wheezy/kamailio-berkeley-bin.dirs
new file mode 100644
index 0000000..236670a
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/kamailio-berkeley-bin.dirs
@@ -0,0 +1 @@
+usr/sbin
diff --git a/pkg/kamailio/deb/wheezy/kamailio-dnssec-modules.lintian-overrides b/pkg/kamailio/deb/wheezy/kamailio-dnssec-modules.lintian-overrides
new file mode 100644
index 0000000..10165fe
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/kamailio-dnssec-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-dnssec-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/wheezy/kamailio-outbound-modules.lintian-overrides b/pkg/kamailio/deb/wheezy/kamailio-outbound-modules.lintian-overrides
new file mode 100644
index 0000000..3050cfe
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/kamailio-outbound-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-outbound-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/wheezy/kamailio-tls-modules.lintian-overrides b/pkg/kamailio/deb/wheezy/kamailio-tls-modules.lintian-overrides
new file mode 100644
index 0000000..bbe0d37
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/kamailio-tls-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/wheezy/kamailio-websocket-modules.lintian-overrides b/pkg/kamailio/deb/wheezy/kamailio-websocket-modules.lintian-overrides
new file mode 100644
index 0000000..8f384fb
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/kamailio-websocket-modules.lintian-overrides
@@ -0,0 +1 @@
+kamailio-websocket-modules binary: possible-gpl-code-linked-with-openssl
diff --git a/pkg/kamailio/deb/wheezy/kamailio.README.Debian b/pkg/kamailio/deb/wheezy/kamailio.README.Debian
new file mode 100644
index 0000000..d25769a
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/kamailio.README.Debian
@@ -0,0 +1,39 @@
+Kamailio for Debian
+-------------------
+
+* init script check for fork=no
+-------------------------------
+
+The Kamailio init script will not start Kamailio on boot if fork=no is
+specified in the config file. The check in the initscript will match
+any occurrence of fork=no in the file, even inside C-style comments.
+
+You can disable this check in the init script if you wish; just comment
+out the calls to the check_fork function in the script. Your changes to
+the init script will be preserved upon upgrade, as the file is tagged
+as a conffile.
+
+
+* Kamailio setup
+----------------
+
+To setup Kamailio, you need to:
+ - configure Kamailio properly to suit your needs
+ - edit /etc/default/kamailio, adjust the MEMORY parameter and set
+   RUN_KAMAILIO to "yes"
+
+If you are building an HA cluster using heartbeat or similar, you'll want
+to disable the init script by running:
+
+  update-rc.d kamailio remove
+
+so that Kamailio will not be launched at system startup. You still need
+to set RUN_KAMAILIO to "yes" if you want to use the /etc/init.d/kamailio init
+script.
+
+Set the DUMP_CORE parameter in /etc/default/kamailio to "yes" if you want to
+get a core dump in case Kamailio crashes. The debug symbols for Kamailio are
+provided by the kamailio-dbg package.
+
+
+ -- Victor Seva <linuxmaniac at torreviejawireless.org>  Wed, 11 Dec 2013 16:07:11 +0100
diff --git a/pkg/kamailio/deb/wheezy/kamailio.default b/pkg/kamailio/deb/wheezy/kamailio.default
new file mode 100644
index 0000000..0cfc8c8
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/kamailio.default
@@ -0,0 +1,28 @@
+#
+# Kamailio startup options
+#
+
+# Set to yes to enable kamailio, once configured properly.
+#RUN_KAMAILIO=yes
+
+# User to run as
+#USER=kamailio
+
+# Group to run as
+#GROUP=kamailio
+
+# Amount of shared and private memory to allocate
+# for the running Kamailio server (in Mb)
+#SHM_MEMORY=64
+#PKG_MEMORY=4
+
+# Config file
+#CFGFILE=/etc/kamailio/kamailio.cfg
+
+# Enable the server to leave a core file when it crashes.
+# Set this to 'yes' to enable Kamailio to leave a core file when it crashes
+# or 'no' to disable this feature. This option is case sensitive and only
+# accepts 'yes' and 'no' and only in lowercase letters.
+# On some systems it is necessary to specify a directory for the core files
+# to get a dump. Look into the kamailio init file for an example configuration.
+#DUMP_CORE=yes
diff --git a/pkg/kamailio/deb/wheezy/kamailio.examples b/pkg/kamailio/deb/wheezy/kamailio.examples
new file mode 100644
index 0000000..c48447a
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/kamailio.examples
@@ -0,0 +1,2 @@
+examples/*
+
diff --git a/pkg/kamailio/deb/wheezy/kamailio.init b/pkg/kamailio/deb/wheezy/kamailio.init
new file mode 100644
index 0000000..d4801d2
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/kamailio.init
@@ -0,0 +1,162 @@
+#! /bin/sh
+#
+### BEGIN INIT INFO
+# Provides:          kamailio
+# Required-Start:    $syslog $network $local_fs $remote_fs $time
+# Should-Start:      $named slapd mysql postgresql snmpd radiusd
+# Should-Stop:       $named slapd mysql postgresql snmpd radiusd
+# Required-Stop:     $syslog $network $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start the Kamailio SIP proxy server
+# Description:       Start the Kamailio SIP proxy server
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/kamailio
+NAME=kamailio
+DESC="Kamailio SIP server"
+HOMEDIR=/var/run/kamailio
+PIDFILE=$HOMEDIR/$NAME.pid
+DEFAULTS=/etc/default/kamailio
+CFGFILE=/etc/kamailio/kamailio.cfg
+RUN_KAMAILIO=no
+USER=kamailio
+GROUP=kamailio
+# Amount of shared and private memory to allocate
+# for the running Kamailio server (in Mb)
+SHM_MEMORY=64
+PKG_MEMORY=4
+DUMP_CORE=no
+
+# Do not start kamailio if fork=no is set in the config file
+# otherwise the boot process will just stop
+check_fork ()
+{
+    if grep -q "^[[:space:]]*fork[[:space:]]*=[[:space:]]*no.*" $CFGFILE; then
+	log_failure_msg "Not starting $DESC: fork=no specified in config file; run /etc/init.d/kamailio debug instead"
+	exit 0
+    fi
+}
+
+check_kamailio_config ()
+{
+	# Check if kamailio configuration is valid before starting the server
+	set +e
+	out=$($DAEMON -f $CFGFILE -M $PKG_MEMORY -c 2>&1 > /dev/null)
+	retcode=$?
+	set -e
+	if [ "$retcode" != '0' ]; then
+	    log_failure_msg "Not starting $DESC: invalid configuration file!"
+	    log_failure_msg
+	    log_failure_msg "$out"
+	    log_failure_msg
+	    exit 1
+	fi
+}
+
+create_radius_seqfile ()
+{
+    # Create a radius sequence file to be used by the radius client if
+    # radius accounting is enabled. This is needed to avoid any issue
+    # with the file not being writable if kamailio first starts as user
+    # root because DUMP_CORE is enabled and creates this file as user
+    # root and then later it switches back to user kamailio and cannot
+    # write to the file. If the file exists before kamailio starts, it
+    # won't change it's ownership and will be writable for both root
+    # and kamailio, no matter what options are chosen at install time
+    RADIUS_SEQ_FILE=/var/run/kamailio/kamailio_radius.seq
+    if [ -d /var/run/kamailio ]; then
+	chown ${USER}:${GROUP} /var/run/kamailio
+
+	if [ ! -f $RADIUS_SEQ_FILE ]; then
+	    touch $RADIUS_SEQ_FILE
+	fi
+
+	chown ${USER}:${GROUP} $RADIUS_SEQ_FILE
+	chmod 660 $RADIUS_SEQ_FILE
+    fi
+}
+
+test -f $DAEMON || exit 0
+
+# Load startup options if available
+if [ -f $DEFAULTS ]; then
+   . $DEFAULTS || true
+fi
+
+if [ "$RUN_KAMAILIO" != "yes" ]; then
+    log_failure_msg "Kamailio not yet configured. Edit /etc/default/kamailio first."
+    exit 0
+fi
+
+set -e
+
+SHM_MEMORY=$((`echo $SHM_MEMORY | sed -e 's/[^0-9]//g'`))
+PKG_MEMORY=$((`echo $PKG_MEMORY | sed -e 's/[^0-9]//g'`))
+[ -z "$USER" ]  && USER=kamailio
+[ -z "$GROUP" ] && GROUP=kamailio
+[ $SHM_MEMORY -le 0 ] && SHM_MEMORY=64
+[ $PKG_MEMORY -le 0 ] && PKG_MEMORY=4
+
+if test "$DUMP_CORE" = "yes" ; then
+    # set proper ulimit
+    ulimit -c unlimited
+
+    # directory for the core dump files
+    # COREDIR=/home/corefiles
+    # [ -d $COREDIR ] || mkdir $COREDIR
+    # chmod 777 $COREDIR
+    # echo "$COREDIR/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
+fi
+
+# /var/run can be a tmpfs
+if [ ! -d $HOMEDIR ]; then
+    mkdir -p $HOMEDIR
+fi
+
+OPTIONS="-f $CFGFILE -P $PIDFILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP"
+
+case "$1" in
+  start|debug)
+	check_kamailio_config
+	create_radius_seqfile
+
+	if [ "$1" != "debug" ]; then
+	    check_fork
+	fi
+
+	log_daemon_msg "Starting $DESC: $NAME"
+	start-stop-daemon --start --quiet --pidfile $PIDFILE \
+		--exec $DAEMON -- $OPTIONS || log_failure_msg " already running"
+	log_end_msg 0
+	;;
+  stop)
+	log_daemon_msg "Stopping $DESC: $NAME"
+	start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
+		--exec $DAEMON
+	log_end_msg 0
+	;;
+  restart|force-reload)
+	check_kamailio_config
+	create_radius_seqfile
+
+	$0 stop
+	sleep 1
+	$0 start
+	;;
+  status)
+	log_daemon_msg "Status of $DESC: "
+
+	status_of_proc -p"$PIDFILE" $NAME $NAME
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload|status|debug}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/pkg/kamailio/deb/wheezy/kamailio.lintian-overrides b/pkg/kamailio/deb/wheezy/kamailio.lintian-overrides
new file mode 100644
index 0000000..18152ed
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/kamailio.lintian-overrides
@@ -0,0 +1,2 @@
+kamailio binary: example-interpreter-not-absolute usr/share/doc/kamailio/examples/outbound/edge.cfg #!KAMAILIO
+kamailio binary: example-interpreter-not-absolute usr/share/doc/kamailio/examples/outbound/registrar.cfg #!KAMAILIO
diff --git a/pkg/kamailio/deb/wheezy/kamailio.postinst b/pkg/kamailio/deb/wheezy/kamailio.postinst
new file mode 100644
index 0000000..4ee38ec
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/kamailio.postinst
@@ -0,0 +1,24 @@
+#! /bin/sh
+
+set -e
+
+case "$1" in
+    configure)
+        adduser --quiet --system --group --disabled-password \
+                --shell /bin/false --gecos "Kamailio SIP Server" \
+                --home /var/run/kamailio kamailio || true
+
+        ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+        ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+        ;;
+esac
+
+#DEBHELPER#
+
diff --git a/pkg/kamailio/deb/wheezy/rules b/pkg/kamailio/deb/wheezy/rules
new file mode 100755
index 0000000..369192e
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/rules
@@ -0,0 +1,219 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+DEBVERSION:=$(shell head -n 1 debian/changelog \
+                    | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
+UPVERSION:=$(shell dpkg-parsechangelog | sed -ne 's/^Version: \(\([0-9]\+\):\)\?\(.*\)-.*/\3/p')
+
+FILENAME := kamailio_$(UPVERSION).orig.tar.gz
+URL := http://www.kamailio.org/pub/kamailio/$(UPVERSION)/src/kamailio-$(UPVERSION)_src.tar.gz
+
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/buildflags.mk
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+export JAVA_HOME=/usr/lib/jvm/java-gcj
+
+# choose freeradius
+
+# modules not in the "main" kamailio package
+EXCLUDED_MODULES=
+
+# extra modules to skip, because they are not compilable now
+# - regardless if they go to the main kamailio package or to some module package,
+# they will be excluded from compile and install of all
+EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy purple mi_xmlrpc dnssec
+
+# module groups that are packaged in seperate packages
+# (with the name kamailio-$(group_name)-modules)
+# Note: the order is important (should be in dependency order, the one
+# on which other depend first)
+PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \
+			   ldap xml perl utils lua memcached \
+			   snmpstats carrierroute xmpp cpl redis python geoip\
+			   sqlite json mono ims sctp java \
+			   tls outbound websocket autheph 
+
+# module groups to be packaged onto kamailio-extra-modules
+EXTRA_GROUPS=gzcompress
+
+# name of libdir in the path for libraries (e.g., lib for 32b, lib64 for 64b)
+LIBDIR ?= lib/$(DEB_HOST_MULTIARCH)
+
+# directories with possible duplicate libraries (that should be deleted
+# from current module* packages)
+DUP_LIBS_DIRS=$(CURDIR)/debian/kamailio/usr/$(LIBDIR)/kamailio \
+			$(CURDIR)/debian/kamailio-db-modules/usr/$(LIBDIR)/kamailio
+
+# "function" to get package short name out of a dir/module_name
+# it also transforms db_foo into foo
+mod_name=$(subst db_,,$(lastword $(subst /, ,$(1))))
+
+define PACKAGE_GRP_BUILD_template
+	# package all the modules in PACKAGE_GROUPS in separate packages
+	$(foreach grp,$(PACKAGE_GROUPS EXTRA_GROUPS),\
+		$(MAKE) every-module group_include="k$(grp)"
+	)
+endef
+
+
+define PACKAGE_GRP_INSTALL_template
+	$(foreach grp,$(PACKAGE_GROUPS),\
+		$(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \
+		basedir=$(CURDIR)/debian/kamailio-$(grp)-modules \
+		cfg_prefix=$(CURDIR)/debian/kamailio-$(grp)-modules \
+		doc-dir=share/doc/kamailio-$(grp)-modules
+		# eliminate duplicate libs
+		-for d in $(DUP_LIBS_DIRS); do \
+			test "$$d" != "$(CURDIR)/debian/kamailio-$(grp)-modules/usr/$(LIBDIR)/kamailio" &&\
+			for r in `find $$d -name 'lib*'|xargs`; do \
+				echo "removing $(grp) lib `basename $$r` present also in $$d";\
+				rm -f $(CURDIR)/debian/kamailio-$(grp)-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \
+			done ; \
+		done
+		find $(CURDIR)/debian/kamailio-$(grp)-modules -depth -empty -type d -exec rmdir {} \;
+	)
+endef
+
+define PACKAGE_EXTRA_INSTALL_template
+	$(foreach grp,$(EXTRA_GROUPS),\
+		$(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \
+		basedir=$(CURDIR)/debian/kamailio-extra-modules \
+		cfg_prefix=$(CURDIR)/debian/kamailio-extra-modules \
+		doc-dir=share/doc/kamailio-extra-modules
+	)
+	# eliminate duplicate libs
+	-for d in $(DUP_LIBS_DIRS); do \
+		test "$$d" != "$(CURDIR)/debian/kamailio-extra-modules/usr/$(LIBDIR)/kamailio" &&\
+		for r in `find $$d -name 'lib*'|xargs`; do \
+			echo "removing extra lib `basename $$r` present also in $$d";\
+			rm -f $(CURDIR)/debian/kamailio-extra-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \
+		done ; \
+	done
+	find $(CURDIR)/debian/kamailio-extra-modules -depth -empty -type d -exec rmdir {} \;
+endef
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	INSTALL_PROGRAM += -s
+endif
+
+# CFLAGS + CPPFLAGS -> CC_EXTRA_OPTS
+# LDFLAGS -> LD_EXTRA_OPTS
+CUSTOM_BUILDFLAGS:=$(shell dpkg-buildflags --export=configure| \
+sed -e 's/" CPPFLAGS="/ /' -e 's/CFLAGS/CC_EXTRA_OPTS/g' -e 's/LDFLAGS/LD_EXTRA_OPTS/g')
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	# Add here commands to configure the package.
+	$(MAKE) FLAVOUR=kamailio cfg prefix=/usr cfg_prefix=$(CURDIR)/debian/kamailio \
+			cfg_target=/etc/kamailio/ \
+			basedir=$(CURDIR)/debian/kamailio \
+			skip_modules="$(EXCLUDED_MODULES) $(EXTRA_EXCLUDED_MODULES)" \
+			$(CUSTOM_BUILDFLAGS) \
+			group_include="kstandard"
+
+	touch configure-stamp
+
+
+build: build-stamp
+build-arch: build-stamp
+build-indep: build-stamp
+build-stamp: configure-stamp
+	dh_testdir
+	# Add here commands to compile the package.
+	$(MAKE) all
+	# make groups
+	$(call PACKAGE_GRP_BUILD_template)
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	# Add here commands to clean up after the build process.
+	$(MAKE) maintainer-clean
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_prep
+	dh_installdirs
+	# Add here commands to install the package into debian/kamailio
+	$(MAKE) install LIBDIR=$(LIBDIR) group_include="kstandard"
+	# make group packages
+	$(call PACKAGE_GRP_INSTALL_template)
+	$(call PACKAGE_EXTRA_INSTALL_template)
+	mv $(CURDIR)/debian/kamailio-berkeley-modules/usr/sbin/kambdb_recover \
+		$(CURDIR)/debian/kamailio-berkeley-bin/usr/sbin/kambdb_recover
+	# install /etc/default/kamailio file
+	mkdir -p $(CURDIR)/debian/kamailio/etc/default
+	cp -f debian/kamailio.default $(CURDIR)/debian/kamailio/etc/default/kamailio
+
+
+# This single target is used to build all the packages, all at once, or
+# one at a time. So keep in mind: any options passed to commands here will
+# affect _all_ packages. Anything you want to only affect one package
+# should be put in another target, such as the install target.
+binary-common:
+	dh_testdir
+	dh_testroot
+	dh_installdebconf
+	dh_installdocs
+	dh_installexamples
+	dh_installmenu
+	dh_installinit -pkamailio -- defaults 23
+	dh_installcron
+	dh_installman
+	dh_installinfo
+	dh_lintian
+	dh_installchangelogs ChangeLog
+	dh_link
+	dh_strip --dbg-package=kamailio-dbg
+	dh_compress
+	dh_fixperms
+	dh_makeshlibs
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+# Build architecture-independent packages using the common target
+binary-indep: build install
+# (Uncomment this next line if you have such packages.)
+#        $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
+# We have nothing to do by default.
+
+
+# Build architecture-dependent packages using the common target
+binary-arch: build install
+	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
+
+# Any other binary targets build just one binary package at a time.
+binary-%: build install
+	$(MAKE) -f debian/rules binary-common DH_OPTIONS=-p$*
+
+print-version:
+	@@echo "Debian version:          $(DEBVERSION)"
+	@@echo "Upstream version:        $(UPVERSION)"
+
+get-orig-source:
+	@@dh_testdir
+	@@[ -d ../tarballs/. ]||mkdir -p ../tarballs
+	@@echo Downloading $(FILENAME) from $(URL) ...
+	@@wget -nv -T10 -t3 -O ../tarballs/$(FILENAME) $(URL)
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
+
diff --git a/pkg/kamailio/deb/wheezy/source.lintian-overrides b/pkg/kamailio/deb/wheezy/source.lintian-overrides
new file mode 100644
index 0000000..620d9ff
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/source.lintian-overrides
@@ -0,0 +1 @@
+kamailio source: debian-watch-file-in-native-package
diff --git a/pkg/kamailio/deb/wheezy/source/format b/pkg/kamailio/deb/wheezy/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/pkg/kamailio/deb/wheezy/watch b/pkg/kamailio/deb/wheezy/watch
new file mode 100644
index 0000000..c50f31f
--- /dev/null
+++ b/pkg/kamailio/deb/wheezy/watch
@@ -0,0 +1,3 @@
+version=3
+opts=dversionmangle=s/\~svn([\d]+)//; \
+http://www.kamailio.org/pub/kamailio/([\d.]+)/src/kamailio-([\d.]+)_src\.tar\.gz
diff --git a/pkg/kamailio/fedora/17/README b/pkg/kamailio/fedora/17/README
new file mode 100644
index 0000000..b3f5b2d
--- /dev/null
+++ b/pkg/kamailio/fedora/17/README
@@ -0,0 +1,67 @@
+Building Kamailio RPMs for Enterprise Linux and Fedora
+------------------------------------------------------
+
+This is a simple process:
+1) Create a clean appliance using BoxGrinder (always worth doing as it makes
+   sure your build appliance contains only standard versions of packages and
+   has all updates applied).
+2) Start the appliance and log in.
+3) Prepare the appliance for RPM builds
+4) Either:
+   a) Checkout the version of Kamailio you want to build from GIT (instructions
+      available on the Kamailio wiki at http://www.kamailio.org/wiki) and
+      create a release tar file, or
+   b) Download a release tar file from http://www.kamailio.org/pub/kamailio and
+      extract the correct kamailio.spec file from it
+5) Run "rpmbuild" to create the RPMs
+
+If you don't have BoxGrinder installed (http://boxgrinder.org/) you can do so in
+Fedora using the command:
+
+   # [sudo] yum install rubygem-boxgrinder-build
+
+Note: The host operating system you install BoxGrinder on does not have to be
+      same operating system flavour, architecture, or version as the appliance
+      you are creating.  It is entirely sensible to use an x86_64 Fedora host to
+      build an i386 CentOS appliance and i386 CentOS Kamailio RPMs.
+
+Example: Building Kamailio 3.4.x (master) x86_64 binary RPMs from GIT for
+         Fedora 17.
+
+This example assumes:
+- You have Internet connectivity
+- You have BoxGrinder, and libvirtd (and any management software required for
+  it) installed locally.
+- You have obtained the kamailio-build.appl file from pkg/kamailio/fedora/17
+  (either by download from http://git.sip-router.org/ or from a local
+  checkout of the code)
+- Your host operating system is x86_64.
+
+If you want to build a different version of Kamailio, a different set of RPMs
+(different rpmbuild options), or install and run the appliance on a remote
+(or different type of virtual) machine you should only need to make small
+changes to the commands in this example.
+
+1) Create a clean Fedora 17 x86_64 appliance using BoxGrinder:
+   # mkdir appliance
+   # cd appliance
+   # [sudo] boxgrinder-build \
+       [path to]/pkg/kamailio/fedora/17/kamailio-build.appl -d libvirt \
+       --delivery-config connection_uri:qemu:///system,\
+       image_delivery_uri:/var/lib/libvirt/images,overwrite:true,\
+       domain_type:kvm
+2) Start the appliance and log in:
+   - I prefer to use virt-manager for this.  The default username and password
+     for the appliance is "root" and "kamailio" respectively.
+3) Prepare the appliance for RPM builds:
+   # mkdir -p rpmbuild/SOURCES
+4) Checkout Kamailio 3.4.x (master) and create a release tar file:
+   # git clone --depth 1 git://git.sip-router.org/sip-router kamailio
+   # cd kamailio
+    Note: if not building master you want to do a "git checkout" after this
+   # git archive --output ../rpmbuild/SOURCES/kamailio-3.4.0_src.tar.gz \
+       --prefix=kamailio-3.4.0/ master
+5) Run "rpmbuild" to create the binary RPMs:
+   # rpmbuild -bb pkg/kamailio/fedora/17/kamailio.spec
+
+Once the build is complete the RPMs will be in ~/rpmbuild/RPMS/x86_64.
diff --git a/pkg/kamailio/fedora/17/kamailio-build.appl b/pkg/kamailio/fedora/17/kamailio-build.appl
new file mode 100644
index 0000000..e841b53
--- /dev/null
+++ b/pkg/kamailio/fedora/17/kamailio-build.appl
@@ -0,0 +1,49 @@
+name: "kamailio-build-fc17-#BASE_ARCH#"
+summary: "Fedora 17 image for building Kamailio #BASE_ARCH# RPMs"
+os:
+  name: fedora
+  version: 17
+  password: kamailio
+hardware:
+  memory: 1024
+  partitions:
+    "/":
+      size: 6
+packages:
+  - @core
+  - @base
+  - bison			# kamailio
+  - db4-devel			# kamailio-bdb
+  - docbook2X
+  - expat-devel			# kamailio-xmpp
+  - flex			# kamailio
+  - GeoIP-devel			# kamailio-GeoIP
+  - gcc
+  - git
+  - glib-devel			# kamailio-purple
+  - hiredis-devel		# kamailio-redis
+  - json-c-devel		# kamailio-json
+  - libconfuse-devel		# kamailio-carrierroute
+  - libcurl-devel		# kamailio-utils, kamailio-presence
+  - libevent-devel		# kamailio-json
+  - libpurple-devel		# kamailio-purple
+  - libunistring-devel		# kamailio-websocket
+  - libxml2-devel		# kamailio-cdp, kamailio-cpl, kamailio-ims, kamailio-presence, kamailio-purple, kamailio-utils, kamailio-xhttp-pi, kamailio-xmlops, kamailio-xmlrpc
+  - lksctp-tools-devel		# kamailio
+  - lua-devel			# kamailio-lua
+  - make			# kamailio
+  - mod_perl-devel		# kamailio-perl
+  - mono-devel			# kamailio-mono
+  - mysql-devel			# kamailio-mysql
+  - net-snmp-devel		# kamailio-snmpstats
+  - openldap-devel		# kamailio-ldap
+  - openssl-devel		# kamailio
+  - pcre-devel			# kamailio-regex, kamailio-dialplan, kamailio-lcr
+  - postgresql-devel		# kamailio-postgresql
+  - python-devel		# kamailio-python
+  - radiusclient-ng-devel	# kamailio-radius
+  - redhat-rpm-config		# kamailio-debuginfo
+  - rpm-build
+  - sqlite-devel		# kamailio-sqlite
+  - unixODBC-devel		# kamailio-unixODBC
+  - zlib-devel			# kamailio-mysql
diff --git a/pkg/kamailio/fedora/17/kamailio.appl b/pkg/kamailio/fedora/17/kamailio.appl
new file mode 100644
index 0000000..7e37812
--- /dev/null
+++ b/pkg/kamailio/fedora/17/kamailio.appl
@@ -0,0 +1,42 @@
+name: "kamailio-fc17-#BASE_ARCH#"
+summary: "Fedora 17 image for installing Kamailio #BASE_ARCH# RPMs"
+os:
+  name: fedora
+  version: 17
+  password: kamailio
+hardware:
+  memory: 1024
+  partitions:
+    "/":
+      size: 2
+packages:
+  - @core
+  - @base
+  - db4				# kamailio-bdb
+  - expat			# kamailio-xmpp
+  - GeoIP			# kamailio-GeoIP
+  - glib			# kamailio-purple
+  - hiredis			# kamailio-redis
+  - json-c			# kamailio-json
+  - libconfuse			# kamailio-carrierroute
+  - libcurl			# kamailio-utils, kamailio-presence
+  - libevent			# kamailio-json
+  - libpurple			# kamailio-purple
+  - libunistring		# kamailio-websocket
+  - libxml2			# kamailio-cdp, kamailio-cpl, kamailio-ims, kamailio-presence, kamailio-purple, kamailio-utils, kamailio-xhttp-pi, kamailio-xmlops, kamailio-xmlrpc
+  - lksctp-tools		# kamailio
+  - mod_perl			# kamailio-perl
+  - mono-core			# kamailio-mono
+  - mysql-libs			# kamailio-mysql
+  - net-snmp-libs		# kamailio-snmpstats
+  - openldap			# kamailio-ldap
+  - openssl			# kamailio
+  - pcre			# kamailio-regex, kamailio-dialplan, kamailio-lcr
+  - perl-Authen-SASL		# kamailio-perl
+  - perl-LDAP			# kamailio-perl
+  - postgresql-libs		# kamailio-postgresql
+  - python			# kamailio-python
+  - radiusclient-ng		# kamailio-radius
+  - sqlite			# kamailio-sqlite
+  - unixODBC			# kamailio-unixODBC
+  - zlib			# kamailio-mysql
diff --git a/pkg/kamailio/fedora/17/kamailio.service b/pkg/kamailio/fedora/17/kamailio.service
new file mode 100644
index 0000000..a8d59b0
--- /dev/null
+++ b/pkg/kamailio/fedora/17/kamailio.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Kamailio (OpenSER) - the Open Source SIP Server
+After=syslog.target network.target
+
+[Service]
+Type=forking
+EnvironmentFile=/etc/sysconfig/kamailio
+PIDFile=/var/run/kamailio.pid
+ExecStart=/usr/sbin/kamailio -P /var/run/kamailio.pid $OPTIONS
+ExecStopPost=/usr/bin/rm -f /var/run/kamailio.pid
+Restart=on-abort
+
+[Install]
+WantedBy=multi-user.target
diff --git a/pkg/kamailio/fedora/17/kamailio.spec b/pkg/kamailio/fedora/17/kamailio.spec
new file mode 100644
index 0000000..ca61285
--- /dev/null
+++ b/pkg/kamailio/fedora/17/kamailio.spec
@@ -0,0 +1,1328 @@
+%define name	kamailio
+%define ver	4.1.5
+%define rel	0%{dist}
+
+
+
+Summary:	Kamailio (former OpenSER) - the Open Source SIP Server
+Name:		%name
+Version:	%ver
+Release:	%rel
+Packager:	Peter Dunkley <peter at dunkley.me.uk>
+License:	GPL
+Group:		System Environment/Daemons
+Source:		http://kamailio.org/pub/kamailio/%{ver}/src/%{name}-%{ver}_src.tar.gz
+URL:		http://kamailio.org/
+Vendor:		kamailio.org
+BuildRoot:	%{_tmppath}/%{name}-%{ver}-buildroot
+Conflicts:	kamailio-auth-ephemeral < %ver, kamailio-auth-identity < %ver
+Conflicts:	kamailio-bdb < %ver, kamailio-cdp < %ver, kamailio-cdp < %ver
+Conflicts:	kamailio-dialplan < %ver, kamailio-ims < %ver
+Conflicts:	kamailio-lcr < %ver, kamailio-ldap < %ver, kamailio-lua < %ver
+Conflicts:	kamailio-mysql < %ver, kamailio-outbound < %ver
+Conflicts:	kamailio-perl < %ver, kamailio-postgresql < %ver
+Conflicts:	kamailio-presence < %ver, kamailio-purple < %ver
+Conflicts:	kamailio-python < %ver, kamailio-regex < %ver
+Conflicts:	kamailio-sctp < %ver, kamailio-snmpstats < %ver
+Conflicts:	kamailio-sqlite < %ver, kamailio-stun < %ver
+Conflicts:	kamailio-tls < %ver, kamailio-unixODBC < %ver
+Conflicts:	kamailio-utils < %ver, kamailio-websocket < %ver
+Conflicts:	kamailio-xhttp-pi < %ver, kamailio-xmlops < %ver
+Conflicts:	kamailio-xmlrpc < %ver, kamailio-xmpp < %ver
+%if 0%{?fedora}
+Conflicts:	kamailio-carrierroute < %ver, kamailio-GeoIP < %ver
+Conflicts:	kamailio-json < %ver, kamailio-mono < %ver
+Conflicts: 	kamailio-radius < %ver, kamailio-redis < %ver
+%endif
+BuildRequires:	bison, flex, gcc, make, redhat-rpm-config
+%if 0%{?fedora}
+BuildRequires:	docbook2X
+%endif
+
+%description
+Kamailio (former OpenSER) is an Open Source SIP Server released under GPL, able
+to handle thousands of call setups per second. Among features: asynchronous TCP,
+UDP and SCTP, secure communication via TLS for VoIP (voice, video); IPv4 and
+IPv6; SIMPLE instant messaging and presence with embedded XCAP server and MSRP
+relay; ENUM; DID and least cost routing; load balancing; routing fail-over;
+accounting, authentication and authorization; support for many backend systems
+such as MySQL, Postgres, Oracle, Radius, LDAP, Redis, Cassandra; XMLRPC control
+interface, SNMP monitoring. It can be used to build large VoIP servicing
+platforms or to scale up SIP-to-PSTN gateways, PBX systems or media servers
+like Asterisk™, FreeSWITCH™ or SEMS.
+
+
+%package	auth-ephemeral
+Summary:	Functions for authentication using ephemeral credentials.
+Group:		System Environment/Daemons
+Requires:	openssl, kamailio = %ver
+BuildRequires:	openssl-devel
+
+%description auth-ephemeral
+Functions for authentication using ephemeral credentials.
+
+
+%package	auth-identity
+Summary:	Functions for secure identification of originators of SIP messages for Kamailio.
+Group:		System Environment/Daemons
+Requires:	libcurl, openssl, kamailio = %ver
+BuildRequires:	libcurl-devel, openssl-devel
+
+%description auth-identity
+Functions for secure identification of originators of SIP messages for Kamailio.
+
+
+%package	bdb
+Summary:	Berkeley database connectivity for Kamailio.
+Group:		System Environment/Daemons
+Requires:	db4, kamailio = %ver
+BuildRequires:	db4-devel
+
+%description	bdb
+Berkeley database connectivity for Kamailio.
+
+
+%package	cdp
+Summary:	C Diameter Peer module and extensions module for Kamailio.
+Group:		System Environment/Daemons
+Requires:	libxml2, kamailio = %ver
+BuildRequires:	libxml2-devel
+
+%description	cdp
+C Diameter Peer module and extensions module for Kamailio.
+
+
+%package	cpl
+Summary:	CPL (Call Processing Language) interpreter for Kamailio.
+Group:		System Environment/Daemons
+Requires:	libxml2, kamailio = %ver
+BuildRequires:	libxml2-devel
+
+%description	cpl
+CPL (Call Processing Language) interpreter for Kamailio.
+
+
+%package	dialplan
+Summary:	String translations based on rules for Kamailio.
+Group:		System Environment/Daemons
+Requires:	pcre, kamailio = %ver
+BuildRequires:	pcre-devel
+
+%description	dialplan
+String translations based on rules for Kamailio.
+
+
+%package	ims
+Summary:	IMS modules and extensions module for Kamailio.
+Group:		System Environment/Daemons
+Requires:	libxml2, kamailio = %ver, kamailio-cdp = %ver
+BuildRequires:	libxml2-devel
+
+%description	ims
+IMS modules and extensions module for Kamailio.
+
+
+%package	lcr
+Summary:	Least cost routing for Kamailio.
+Group:		System Environment/Daemons
+Requires:	pcre, kamailio = %ver
+BuildRequires:	pcre-devel
+
+%description	lcr
+Least cost routing for Kamailio.
+
+
+%package	ldap
+Summary:	LDAP search interface for Kamailio.
+Group:		System Environment/Daemons
+Requires:	openldap, kamailio = %ver
+BuildRequires:	openldap-devel
+
+%description	ldap
+LDAP search interface for Kamailio.
+
+
+%package	lua
+Summary:	Lua extensions for Kamailio.
+Group:		System Environment/Daemons
+Requires:	kamailio = %ver
+BuildRequires:	lua-devel
+
+%description	lua
+Lua extensions for Kamailio.
+
+
+%package	mysql
+Summary:	MySQL database connectivity for Kamailio.
+Group:		System Environment/Daemons
+Requires:	mysql-libs, kamailio = %ver
+BuildRequires:	mysql-devel zlib-devel
+
+%description	mysql
+MySQL database connectivity for Kamailio.
+
+
+%package	outbound
+Summary:	Outbound (RFC 5626) support for Kamailio.
+Group:		System Environment/Daemons
+Requires:	openssl, kamailio = %ver
+BuildRequires:	openssl-devel
+
+%description	outbound
+RFC 5626, "Managing Client-Initiated Connections in the Session Initiation
+Protocol (SIP)" support for Kamailio.
+
+
+%package	perl
+Summary:	Perl extensions and database driver for Kamailio.
+Group:		System Environment/Daemons 
+Requires:	mod_perl, kamailio = %ver
+BuildRequires:	mod_perl-devel
+
+%description	perl
+Perl extensions and database driver for Kamailio.
+
+
+%package	postgresql
+Summary:	PostgreSQL database connectivity for Kamailio.
+Group:		System Environment/Daemons
+Requires:	postgresql-libs, kamailio = %ver
+BuildRequires:	postgresql-devel
+
+%description	postgresql
+PostgreSQL database connectivity for Kamailio.
+
+
+%package	presence
+Summary:	SIP Presence (and RLS, XCAP, etc) support for Kamailio.
+Group:		System Environment/Daemons
+Requires:	libxml2, libcurl, kamailio = %ver, kamailio-xmpp = %ver
+BuildRequires:	libxml2-devel, libcurl-devel
+
+%description	presence
+SIP Presence (and RLS, XCAP, etc) support for Kamailio.
+
+
+%package	purple
+Summary:	Multi-protocol IM and presence gateway module.
+Group:		System Environment/Daemons
+%if 0%{?fedora}
+Requires:	glib, libpurple, libxml2, kamailio = %ver
+Requires:	kamailio-presence = %ver
+BuildRequires:	glib-devel, libpurple-devel, libxml2-devel
+%else
+Requires:	glib2, libpurple, libxml2, kamailio = %ver
+Requires:	kamailio-presence = %ver
+BuildRequires:	glib2-devel, libpurple-devel, libxml2-devel
+%endif
+
+%description	purple
+Multi-protocol IM and presence gateway module.
+
+
+%package	python
+Summary:	Python extensions for Kamailio.
+Group:		System Environment/Daemons
+Requires:	python, kamailio = %ver
+BuildRequires:	python-devel
+
+%description	python
+Python extensions for Kamailio.
+
+
+%package	regex
+Summary:	PCRE mtaching operations for Kamailio.
+Group:		System Environment/Daemons
+Requires:	pcre, kamailio = %ver
+BuildRequires:	pcre-devel
+
+%description	regex
+PCRE mtaching operations for Kamailio.
+
+
+%package	sctp
+Summary:	SCTP transport for Kamailio.
+Group:		System Environment/Daemons
+Requires:	lksctp-tools, kamailio = %ver
+BuildRequires:	lksctp-tools-devel
+
+%description	sctp
+SCTP transport for Kamailio.
+
+
+%package	snmpstats
+Summary:	SNMP management interface (scalar statistics) for Kamailio.
+Group:		System Environment/Daemons
+%if 0%{?fedora}
+Requires:	net-snmp-agent-libs, kamailio = %ver
+%else
+Requires:	net-snmp-libs, kamailio = %ver
+%endif
+BuildRequires:	net-snmp-devel
+
+%description	snmpstats
+SNMP management interface (scalar statistics) for Kamailio.
+
+
+%package	sqlite
+Summary:	SQLite database connectivity for Kamailio.
+Group:		System Environment/Daemons
+Requires:	sqlite, kamailio = %ver
+BuildRequires:	sqlite-devel
+
+%description	sqlite
+SQLite database connectivity for Kamailio.
+
+
+%package	stun
+Summary:	Limited STUN (RFC 5389) support for Kamailio.
+Group:		System Environment/Daemons
+Requires:	openssl, kamailio = %ver
+BuildRequires:	openssl-devel
+
+%description	stun
+Limited RFC 5389, "Session Traversal Utilities for NAT (STUN)" support for
+Kamailio.
+
+
+%package	tls
+Summary:	TLS transport for Kamailio.
+Group:		System Environment/Daemons
+Requires:	openssl, kamailio = %ver
+BuildRequires:	openssl-devel
+
+%description	tls
+TLS transport for Kamailio.
+
+
+%package	unixODBC
+Summary:	unixODBC database connectivity for Kamailio.
+Group:		System Environment/Daemons
+Requires:	unixODBC, kamailio = %ver
+BuildRequires:	unixODBC-devel
+
+%description	unixODBC
+unixODBC database connectivity for Kamailio.
+
+
+%package	utils
+Summary:	Non-SIP utitility functions for Kamailio.
+Group:		System Environment/Daemons
+Requires:	libcurl, libxml2, kamailio = %ver
+BuildRequires:	libcurl-devel, libxml2-devel
+
+%description	utils
+Non-SIP utitility functions for Kamailio.
+
+
+%package	websocket
+Summary:	WebSocket transport for Kamailio.
+Group:		System Environment/Daemons
+Requires:	libunistring, openssl, kamailio = %ver
+BuildRequires:	libunistring-devel, openssl-devel
+
+%description	websocket
+WebSocket transport for Kamailio.
+
+
+%package	xhttp-pi
+Summary:	Web-provisioning interface for Kamailio.
+Group:		System Environment/Daemons
+Requires:	libxml2, kamailio = %ver
+BuildRequires:	libxml2-devel
+
+%description	xhttp-pi
+Web-provisioning interface for Kamailio.
+
+
+%package	xmlops
+Summary:	XML operation functions for Kamailio.
+Group:		System Environment/Daemons
+Requires:	libxml2, kamailio = %ver
+BuildRequires:	libxml2-devel
+
+%description	xmlops
+XML operation functions for Kamailio.
+
+
+%package	xmlrpc
+Summary:	XMLRPC trasnport and encoding for Kamailio RPCs.
+Group:		System Environment/Daemons
+Requires:	libxml2, kamailio = %ver
+BuildRequires:	libxml2-devel
+
+%description	xmlrpc
+XMLRPC trasnport and encoding for Kamailio RPCs.
+
+
+%package	xmpp
+Summary:	SIP/XMPP IM gateway for Kamailio.
+Group:		System Environment/Daemons
+Requires:	expat, kamailio = %ver
+BuildRequires:	expat-devel
+
+%description	xmpp
+SIP/XMPP IM gateway for Kamailio.
+
+
+%if 0%{?fedora}
+%package	carrierroute
+Summary:	Routing, balancing, and blacklisting for Kamailio.
+Group:		System Environment/Daemons
+Requires:	libconfuse, kamailio = %ver
+BuildRequires:	libconfuse-devel
+
+%description	carrierroute
+Routing, balancing, and blacklisting for Kamailio.
+
+
+%package	GeoIP
+Summary:	Max Mind GeoIP real-time query support for Kamailio.
+Group:		System Environment/Daemons
+Requires:	GeoIP, kamailio = %ver
+BuildRequires:	GeoIP-devel
+
+%description	GeoIP
+Max Mind GeoIP real-time query support for Kamailio.
+
+
+%package	json
+Summary:	json string operation and rpc support for Kamailio.
+Group:		System Environment/Daemons
+Requires:	json-c, libevent, kamailio = %ver
+BuildRequires:	json-c-devel, libevent-devel
+
+%description	json
+json string operation and rpc support for Kamailio.
+
+
+%package	mono
+Summary:	Mono extensions for Kamailio.
+Group:		System Environment/Daemons
+Requires:	mono-core, kamailio = %ver
+BuildRequires:	mono-devel
+
+%description	mono
+Mono extensions for Kamailio.
+
+
+%package	radius
+Summary:	Radius AAA API for Kamailio.
+Group:		System Environment/Daemons
+Requires:	radiusclient-ng, kamailio = %ver
+BuildRequires:	radiusclient-ng-devel
+
+%description	radius
+Radius AAA API for Kamailio.
+
+
+%package	redis
+Summary:	REDIS NoSQL database connector for Kamailio.
+Group:		System Environment/Daemons
+Requires:	hiredis, kamailio = %ver
+BuildRequires:	hiredis-devel
+
+%description	redis
+REDIS NoSQL database connector for Kamailio.
+%endif
+
+
+
+%prep
+%setup -n %{name}-%{ver}
+
+
+
+%build
+make cfg prefix=/usr cfg_prefix=$RPM_BUILD_ROOT basedir=$RPM_BUILD_ROOT \
+	cfg_target=/%{_sysconfdir}/kamailio/ modules_dirs="modules"
+make
+%if 0%{?fedora}
+make every-module skip_modules="app_java db_cassandra db_oracle dnssec \
+	iptrtpproxy memcached mi_xmlrpc osp" \
+	group_include="kstandard kmysql kpostgres kcpl kxml kradius kunixodbc \
+	kperl ksnmpstats kxmpp kcarrierroute kberkeley kldap kutils kpurple \
+	ktls kwebsocket kpresence klua kpython kgeoip ksqlite kjson kredis \
+	kmono kims koutbound ksctp kstun kautheph"
+%else
+make every-module skip_modules="app_java db_cassandra db_oracle dnssec \
+	iptrtpproxy memcached mi_xmlrpc osp" \
+	group_include="kstandard kmysql kpostgres kcpl kxml kunixodbc \
+	kperl ksnmpstats kxmpp kberkeley kldap kutils kpurple \
+	ktls kwebsocket kpresence klua kpython ksqlite \
+	kims koutbound ksctp kstun kautheph"
+%endif
+make utils
+
+
+
+%install
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
+
+make install
+%if 0%{?fedora}
+make install-modules-all skip_modules="db_cassandra iptrtpproxy db_oracle \
+	memcached mi_xmlrpc osp" \
+	group_include="kstandard kmysql kpostgres kcpl kxml kradius kunixodbc \
+	kperl ksnmpstats kxmpp kcarrierroute kberkeley kldap kutils kpurple \
+	ktls kwebsocket kpresence klua kpython kgeoip ksqlite kjson kredis \
+	kmono kims koutbound ksctp kstun kautheph"
+
+mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
+install -m644 pkg/kamailio/fedora/%{?fedora}/kamailio.service \
+		$RPM_BUILD_ROOT/%{_unitdir}/kamailio.service
+
+mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig
+install -m644 pkg/kamailio/fedora/%{?fedora}/kamailio.sysconfig \
+		$RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/kamailio
+%else
+make install-modules-all skip_modules="db_cassandra iptrtpproxy db_oracle \
+	memcached mi_xmlrpc osp" \
+	group_include="kstandard kmysql kpostgres kcpl kxml kunixodbc \
+	kperl ksnmpstats kxmpp kberkeley kldap kutils kpurple \
+	ktls kwebsocket kpresence klua kpython ksqlite \
+	kims koutbound ksctp kstun kautheph"
+
+mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d
+install -m755 pkg/kamailio/centos/%{?centos}/kamailio.init \
+		$RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/kamailio
+
+mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig
+install -m644 pkg/kamailio/centos/%{?centos}/kamailio.sysconfig \
+		$RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/kamailio
+%endif
+
+
+
+%pre
+/usr/sbin/groupadd -r kamailio 2> /dev/null || :
+/usr/sbin/useradd -r -g kamailio -s /bin/false -c "Kamailio daemon" -d \
+		%{_libdir}/kamailio kamailio 2> /dev/null || :
+
+
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+
+
+%post
+%if 0%{?fedora}
+/bin/systemctl --system daemon-reload
+%else
+/sbin/chkconfig --add kamailio
+%endif
+
+
+
+%preun
+if [ $1 = 0 ]; then
+%if 0%{?fedora}
+	/bin/systemctl stop kamailio.service
+	/bin/systemctl disable kamailio.service 2> /dev/null
+%else
+	/sbin/service kamailio stop > /dev/null 2>&1
+	/sbin/chkconfig --del kamailio
+%endif
+fi
+
+
+
+%postun
+%if 0%{?fedora}
+/bin/systemctl --system daemon-reload
+%endif
+
+
+
+%files
+%defattr(-,root,root)
+%dir %{_docdir}/kamailio
+%doc %{_docdir}/kamailio/AUTHORS
+%doc %{_docdir}/kamailio/NEWS
+%doc %{_docdir}/kamailio/INSTALL
+%doc %{_docdir}/kamailio/README
+%doc %{_docdir}/kamailio/README-MODULES
+
+%dir %{_docdir}/kamailio/modules
+%doc %{_docdir}/kamailio/modules/README.acc
+%doc %{_docdir}/kamailio/modules/README.alias_db
+%doc %{_docdir}/kamailio/modules/README.async
+%doc %{_docdir}/kamailio/modules/README.auth
+%doc %{_docdir}/kamailio/modules/README.auth_db
+%doc %{_docdir}/kamailio/modules/README.auth_diameter
+%doc %{_docdir}/kamailio/modules/README.avp
+%doc %{_docdir}/kamailio/modules/README.avpops
+%doc %{_docdir}/kamailio/modules/README.benchmark
+%doc %{_docdir}/kamailio/modules/README.blst
+%doc %{_docdir}/kamailio/modules/README.call_control
+%doc %{_docdir}/kamailio/modules/README.cfg_db
+%doc %{_docdir}/kamailio/modules/README.cfg_rpc
+%doc %{_docdir}/kamailio/modules/README.cfgutils
+%doc %{_docdir}/kamailio/modules/README.cnxcc
+%doc %{_docdir}/kamailio/modules/README.corex
+%doc %{_docdir}/kamailio/modules/README.counters
+%doc %{_docdir}/kamailio/modules/README.ctl
+%doc %{_docdir}/kamailio/modules/README.db_cluster
+%doc %{_docdir}/kamailio/modules/README.db_flatstore
+%doc %{_docdir}/kamailio/modules/README.db_text
+%doc %{_docdir}/kamailio/modules/README.db2_ops
+%doc %{_docdir}/kamailio/modules/README.debugger
+%doc %{_docdir}/kamailio/modules/README.dialog
+%doc %{_docdir}/kamailio/modules/README.dispatcher
+%doc %{_docdir}/kamailio/modules/README.diversion
+%doc %{_docdir}/kamailio/modules/README.dmq
+%doc %{_docdir}/kamailio/modules/README.domain
+%doc %{_docdir}/kamailio/modules/README.domainpolicy
+%doc %{_docdir}/kamailio/modules/README.drouting
+%doc %{_docdir}/kamailio/modules/README.enum
+%doc %{_docdir}/kamailio/modules/README.exec
+%doc %{_docdir}/kamailio/modules/README.group
+%doc %{_docdir}/kamailio/modules/README.htable
+%doc %{_docdir}/kamailio/modules/README.imc
+%doc %{_docdir}/kamailio/modules/README.ipops
+%doc %{_docdir}/kamailio/modules/README.kex
+%doc %{_docdir}/kamailio/modules/README.malloc_test
+%doc %{_docdir}/kamailio/modules/README.mangler
+%doc %{_docdir}/kamailio/modules/README.matrix
+%doc %{_docdir}/kamailio/modules/README.maxfwd
+%doc %{_docdir}/kamailio/modules/README.mediaproxy
+%doc %{_docdir}/kamailio/modules/README.mi_datagram
+%doc %{_docdir}/kamailio/modules/README.mi_fifo
+%doc %{_docdir}/kamailio/modules/README.mi_rpc
+%doc %{_docdir}/kamailio/modules/README.mqueue
+%doc %{_docdir}/kamailio/modules/README.msilo
+%doc %{_docdir}/kamailio/modules/README.msrp
+%doc %{_docdir}/kamailio/modules/README.mtree
+%doc %{_docdir}/kamailio/modules/README.nat_traversal
+%doc %{_docdir}/kamailio/modules/README.nathelper
+%doc %{_docdir}/kamailio/modules/README.p_usrloc
+%doc %{_docdir}/kamailio/modules/README.path
+%doc %{_docdir}/kamailio/modules/README.pdb
+%doc %{_docdir}/kamailio/modules/README.pdt
+%doc %{_docdir}/kamailio/modules/README.permissions
+%doc %{_docdir}/kamailio/modules/README.pike
+%doc %{_docdir}/kamailio/modules/README.pipelimit
+%doc %{_docdir}/kamailio/modules/README.prefix_route
+%doc %{_docdir}/kamailio/modules/README.print
+%doc %{_docdir}/kamailio/modules/README.print_lib
+%doc %{_docdir}/kamailio/modules/README.pv
+%doc %{_docdir}/kamailio/modules/README.qos
+%doc %{_docdir}/kamailio/modules/README.ratelimit
+%doc %{_docdir}/kamailio/modules/README.registrar
+%doc %{_docdir}/kamailio/modules/README.rr
+%doc %{_docdir}/kamailio/modules/README.rtimer
+%doc %{_docdir}/kamailio/modules/README.rtpproxy
+%doc %{_docdir}/kamailio/modules/README.rtpproxy-ng
+%doc %{_docdir}/kamailio/modules/README.sanity
+%doc %{_docdir}/kamailio/modules/README.sca
+%doc %{_docdir}/kamailio/modules/README.sdpops
+%doc %{_docdir}/kamailio/modules/README.seas
+%doc %{_docdir}/kamailio/modules/README.sipcapture
+%doc %{_docdir}/kamailio/modules/README.sipt
+%doc %{_docdir}/kamailio/modules/README.siptrace
+%doc %{_docdir}/kamailio/modules/README.siputils
+%doc %{_docdir}/kamailio/modules/README.sl
+%doc %{_docdir}/kamailio/modules/README.sms
+%doc %{_docdir}/kamailio/modules/README.speeddial
+%doc %{_docdir}/kamailio/modules/README.sqlops
+%doc %{_docdir}/kamailio/modules/README.sst
+%doc %{_docdir}/kamailio/modules/README.statistics
+%doc %{_docdir}/kamailio/modules/README.textops
+%doc %{_docdir}/kamailio/modules/README.textopsx
+%doc %{_docdir}/kamailio/modules/README.timer
+%doc %{_docdir}/kamailio/modules/README.tm
+%doc %{_docdir}/kamailio/modules/README.tmrec
+%doc %{_docdir}/kamailio/modules/README.tmx
+%doc %{_docdir}/kamailio/modules/README.topoh
+%doc %{_docdir}/kamailio/modules/README.uac
+%doc %{_docdir}/kamailio/modules/README.uac_redirect
+%doc %{_docdir}/kamailio/modules/README.uid_auth_db
+%doc %{_docdir}/kamailio/modules/README.uid_avp_db
+%doc %{_docdir}/kamailio/modules/README.uid_domain
+%doc %{_docdir}/kamailio/modules/README.uid_gflags
+%doc %{_docdir}/kamailio/modules/README.uid_uri_db
+%doc %{_docdir}/kamailio/modules/README.uri_db
+%doc %{_docdir}/kamailio/modules/README.userblacklist
+%doc %{_docdir}/kamailio/modules/README.usrloc
+%doc %{_docdir}/kamailio/modules/README.xhttp
+%doc %{_docdir}/kamailio/modules/README.xhttp_rpc
+%doc %{_docdir}/kamailio/modules/README.xlog
+%doc %{_docdir}/kamailio/modules/README.xprint
+
+%dir %attr(-,kamailio,kamailio) %{_sysconfdir}/kamailio
+%config(noreplace) %{_sysconfdir}/kamailio/*
+%if 0%{?fedora}
+%config %{_unitdir}/*
+%else
+%config %{_sysconfdir}/rc.d/init.d/*
+%endif
+%config %{_sysconfdir}/sysconfig/*
+
+%dir %{_libdir}/kamailio
+%{_libdir}/kamailio/libbinrpc.so
+%{_libdir}/kamailio/libbinrpc.so.0
+%{_libdir}/kamailio/libbinrpc.so.0.1
+%{_libdir}/kamailio/libkcore.so
+%{_libdir}/kamailio/libkcore.so.1
+%{_libdir}/kamailio/libkcore.so.1.0
+%{_libdir}/kamailio/libkmi.so
+%{_libdir}/kamailio/libkmi.so.1
+%{_libdir}/kamailio/libkmi.so.1.0
+%{_libdir}/kamailio/libprint.so
+%{_libdir}/kamailio/libprint.so.1
+%{_libdir}/kamailio/libprint.so.1.2
+%{_libdir}/kamailio/libsrdb1.so
+%{_libdir}/kamailio/libsrdb1.so.1
+%{_libdir}/kamailio/libsrdb1.so.1.0
+%{_libdir}/kamailio/libsrdb2.so
+%{_libdir}/kamailio/libsrdb2.so.1
+%{_libdir}/kamailio/libsrdb2.so.1.0
+%{_libdir}/kamailio/libsrutils.so
+%{_libdir}/kamailio/libsrutils.so.1
+%{_libdir}/kamailio/libsrutils.so.1.0
+%{_libdir}/kamailio/libtrie.so
+%{_libdir}/kamailio/libtrie.so.1
+%{_libdir}/kamailio/libtrie.so.1.0
+
+%dir %{_libdir}/kamailio/modules
+%{_libdir}/kamailio/modules/acc.so
+%{_libdir}/kamailio/modules/alias_db.so
+%{_libdir}/kamailio/modules/auth.so
+%{_libdir}/kamailio/modules/auth_db.so
+%{_libdir}/kamailio/modules/auth_diameter.so
+%{_libdir}/kamailio/modules/async.so
+%{_libdir}/kamailio/modules/avp.so
+%{_libdir}/kamailio/modules/avpops.so
+%{_libdir}/kamailio/modules/benchmark.so
+%{_libdir}/kamailio/modules/blst.so
+%{_libdir}/kamailio/modules/call_control.so
+%{_libdir}/kamailio/modules/cfg_db.so
+%{_libdir}/kamailio/modules/cfg_rpc.so
+%{_libdir}/kamailio/modules/cfgutils.so
+%{_libdir}/kamailio/modules/cnxcc.so
+%{_libdir}/kamailio/modules/corex.so
+%{_libdir}/kamailio/modules/counters.so
+%{_libdir}/kamailio/modules/ctl.so
+%{_libdir}/kamailio/modules/db_cluster.so
+%{_libdir}/kamailio/modules/db_text.so
+%{_libdir}/kamailio/modules/db_flatstore.so
+%{_libdir}/kamailio/modules/db2_ops.so
+%{_libdir}/kamailio/modules/debugger.so
+%{_libdir}/kamailio/modules/dialog.so
+%{_libdir}/kamailio/modules/dispatcher.so
+%{_libdir}/kamailio/modules/diversion.so
+%{_libdir}/kamailio/modules/dmq.so
+%{_libdir}/kamailio/modules/domain.so
+%{_libdir}/kamailio/modules/domainpolicy.so
+%{_libdir}/kamailio/modules/drouting.so
+%{_libdir}/kamailio/modules/enum.so
+%{_libdir}/kamailio/modules/exec.so
+%{_libdir}/kamailio/modules/group.so
+%{_libdir}/kamailio/modules/htable.so
+%{_libdir}/kamailio/modules/imc.so
+%{_libdir}/kamailio/modules/ipops.so
+%{_libdir}/kamailio/modules/kex.so
+%{_libdir}/kamailio/modules/malloc_test.so
+%{_libdir}/kamailio/modules/mangler.so
+%{_libdir}/kamailio/modules/matrix.so
+%{_libdir}/kamailio/modules/maxfwd.so
+%{_libdir}/kamailio/modules/mediaproxy.so
+%{_libdir}/kamailio/modules/mi_datagram.so
+%{_libdir}/kamailio/modules/mi_fifo.so
+%{_libdir}/kamailio/modules/mi_rpc.so
+%{_libdir}/kamailio/modules/mqueue.so
+%{_libdir}/kamailio/modules/msilo.so
+%{_libdir}/kamailio/modules/msrp.so
+%{_libdir}/kamailio/modules/mtree.so
+%{_libdir}/kamailio/modules/nat_traversal.so
+%{_libdir}/kamailio/modules/nathelper.so
+%{_libdir}/kamailio/modules/p_usrloc.so
+%{_libdir}/kamailio/modules/path.so
+%{_libdir}/kamailio/modules/pdb.so
+%{_libdir}/kamailio/modules/pdt.so
+%{_libdir}/kamailio/modules/permissions.so
+%{_libdir}/kamailio/modules/pike.so
+%{_libdir}/kamailio/modules/pipelimit.so
+%{_libdir}/kamailio/modules/prefix_route.so
+%{_libdir}/kamailio/modules/print.so
+%{_libdir}/kamailio/modules/print_lib.so
+%{_libdir}/kamailio/modules/pv.so
+%{_libdir}/kamailio/modules/qos.so
+%{_libdir}/kamailio/modules/ratelimit.so
+%{_libdir}/kamailio/modules/registrar.so
+%{_libdir}/kamailio/modules/rr.so
+%{_libdir}/kamailio/modules/rtimer.so
+%{_libdir}/kamailio/modules/rtpproxy.so
+%{_libdir}/kamailio/modules/rtpproxy-ng.so
+%{_libdir}/kamailio/modules/sanity.so
+%{_libdir}/kamailio/modules/sca.so
+%{_libdir}/kamailio/modules/seas.so
+%{_libdir}/kamailio/modules/sipcapture.so
+%{_libdir}/kamailio/modules/sipt.so
+%{_libdir}/kamailio/modules/siptrace.so
+%{_libdir}/kamailio/modules/siputils.so
+%{_libdir}/kamailio/modules/sl.so
+%{_libdir}/kamailio/modules/sdpops.so
+%{_libdir}/kamailio/modules/sms.so
+%{_libdir}/kamailio/modules/speeddial.so
+%{_libdir}/kamailio/modules/sqlops.so
+%{_libdir}/kamailio/modules/sst.so
+%{_libdir}/kamailio/modules/statistics.so
+%{_libdir}/kamailio/modules/textops.so
+%{_libdir}/kamailio/modules/textopsx.so
+%{_libdir}/kamailio/modules/timer.so
+%{_libdir}/kamailio/modules/tm.so
+%{_libdir}/kamailio/modules/tmrec.so
+%{_libdir}/kamailio/modules/tmx.so
+%{_libdir}/kamailio/modules/topoh.so
+%{_libdir}/kamailio/modules/uac.so
+%{_libdir}/kamailio/modules/uac_redirect.so
+%{_libdir}/kamailio/modules/uid_auth_db.so
+%{_libdir}/kamailio/modules/uid_avp_db.so
+%{_libdir}/kamailio/modules/uid_domain.so
+%{_libdir}/kamailio/modules/uid_gflags.so
+%{_libdir}/kamailio/modules/uid_uri_db.so
+%{_libdir}/kamailio/modules/uri_db.so
+%{_libdir}/kamailio/modules/userblacklist.so
+%{_libdir}/kamailio/modules/usrloc.so
+%{_libdir}/kamailio/modules/xhttp.so
+%{_libdir}/kamailio/modules/xhttp_rpc.so
+%{_libdir}/kamailio/modules/xlog.so
+%{_libdir}/kamailio/modules/xprint.so
+
+%{_sbindir}/kamailio
+%{_sbindir}/kamctl
+%{_sbindir}/kamdbctl
+%{_sbindir}/kamcmd
+
+%dir %{_libdir}/kamailio/kamctl
+%{_libdir}/kamailio/kamctl/kamctl.base
+%{_libdir}/kamailio/kamctl/kamctl.ctlbase
+%{_libdir}/kamailio/kamctl/kamctl.dbtext
+%{_libdir}/kamailio/kamctl/kamctl.fifo
+%{_libdir}/kamailio/kamctl/kamctl.ser
+%{_libdir}/kamailio/kamctl/kamctl.ser_mi
+%{_libdir}/kamailio/kamctl/kamctl.sqlbase
+%{_libdir}/kamailio/kamctl/kamctl.unixsock
+%{_libdir}/kamailio/kamctl/kamdbctl.base
+%{_libdir}/kamailio/kamctl/kamdbctl.dbtext
+
+%dir %{_libdir}/kamailio/kamctl/dbtextdb
+%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.py
+%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.pyc
+%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.pyo
+
+%{_mandir}/man5/*
+%if 0%{?fedora}
+%{_mandir}/man7/*
+%endif
+%{_mandir}/man8/*
+
+%dir %{_datadir}/kamailio
+%dir %{_datadir}/kamailio/dbtext
+%dir %{_datadir}/kamailio/dbtext/kamailio
+%{_datadir}/kamailio/dbtext/kamailio/*
+
+
+%files		auth-ephemeral
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.auth_ephemeral
+%{_libdir}/kamailio/modules/auth_ephemeral.so
+
+
+%files		auth-identity
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.auth_identity
+%{_libdir}/kamailio/modules/auth_identity.so
+
+
+%files		bdb
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.db_berkeley
+%{_sbindir}/kambdb_recover
+%{_libdir}/kamailio/modules/db_berkeley.so
+%{_libdir}/kamailio/kamctl/kamctl.db_berkeley
+%{_libdir}/kamailio/kamctl/kamdbctl.db_berkeley
+%dir %{_datadir}/kamailio/db_berkeley
+%{_datadir}/kamailio/db_berkeley/*
+
+
+%files		cdp
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.cdp
+%{_libdir}/kamailio/modules/cdp.so
+%doc %{_docdir}/kamailio/modules/README.cdp_avp
+%{_libdir}/kamailio/modules/cdp_avp.so
+
+
+%files		cpl
+%defattr(-,root,root)
+%{_docdir}/kamailio/modules/README.cpl-c
+%{_libdir}/kamailio/modules/cpl-c.so
+
+
+%files		dialplan
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.dialplan
+%{_libdir}/kamailio/modules/dialplan.so
+
+
+%files		ims
+%defattr(-,root,root)
+%{_libdir}/kamailio/libkamailio_ims.so
+%{_libdir}/kamailio/libkamailio_ims.so.0
+%{_libdir}/kamailio/libkamailio_ims.so.0.1
+%doc %{_docdir}/kamailio/modules/README.dialog_ng
+%{_libdir}/kamailio/modules/dialog_ng.so
+%doc %{_docdir}/kamailio/modules/README.ims_auth
+%{_libdir}/kamailio/modules/ims_auth.so
+%doc %{_docdir}/kamailio/modules/README.ims_icscf
+%{_libdir}/kamailio/modules/ims_icscf.so
+%doc %{_docdir}/kamailio/modules/README.ims_isc
+%{_libdir}/kamailio/modules/ims_isc.so
+%doc %{_docdir}/kamailio/modules/README.ims_qos
+%{_libdir}/kamailio/modules/ims_qos.so
+#%doc %{_docdir}/kamailio/modules/README.ims_registrar_pcscf
+%{_libdir}/kamailio/modules/ims_registrar_pcscf.so
+#%doc %{_docdir}/kamailio/modules/README.ims_registrar_scscf
+%{_libdir}/kamailio/modules/ims_registrar_scscf.so
+%doc %{_docdir}/kamailio/modules/README.ims_usrloc_pcscf
+%{_libdir}/kamailio/modules/ims_usrloc_pcscf.so
+#%doc %{_docdir}/kamailio/modules/README.ims_usrloc_scscf
+%{_libdir}/kamailio/modules/ims_usrloc_scscf.so
+
+
+%files		lcr
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.lcr
+%{_libdir}/kamailio/modules/lcr.so
+
+
+%files		ldap
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.db2_ldap
+%doc %{_docdir}/kamailio/modules/README.h350
+%doc %{_docdir}/kamailio/modules/README.ldap
+%{_libdir}/kamailio/modules/db2_ldap.so
+%{_libdir}/kamailio/modules/h350.so
+%{_libdir}/kamailio/modules/ldap.so
+
+
+%files		lua
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.app_lua
+%{_libdir}/kamailio/modules/app_lua.so
+
+
+%files		mysql
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.db_mysql
+%{_libdir}/kamailio/modules/db_mysql.so
+%{_libdir}/kamailio/kamctl/kamctl.mysql
+%{_libdir}/kamailio/kamctl/kamdbctl.mysql
+%dir %{_datadir}/kamailio/mysql
+%{_datadir}/kamailio/mysql/*
+
+
+%files		outbound
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.outbound
+%{_libdir}/kamailio/modules/outbound.so
+
+
+%files		perl
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.app_perl
+%doc %{_docdir}/kamailio/modules/README.db_perlvdb
+%{_libdir}/kamailio/modules/app_perl.so
+%{_libdir}/kamailio/modules/db_perlvdb.so
+%dir %{_libdir}/kamailio/perl
+%{_libdir}/kamailio/perl/Kamailio.pm
+%dir %{_libdir}/kamailio/perl/Kamailio
+%{_libdir}/kamailio/perl/Kamailio/Constants.pm
+%{_libdir}/kamailio/perl/Kamailio/Message.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB.pm
+%dir %{_libdir}/kamailio/perl/Kamailio/LDAPUtils
+%{_libdir}/kamailio/perl/Kamailio/LDAPUtils/LDAPConf.pm
+%{_libdir}/kamailio/perl/Kamailio/LDAPUtils/LDAPConnection.pm
+%dir %{_libdir}/kamailio/perl/Kamailio/Utils
+%{_libdir}/kamailio/perl/Kamailio/Utils/Debug.pm
+%{_libdir}/kamailio/perl/Kamailio/Utils/PhoneNumbers.pm
+%dir %{_libdir}/kamailio/perl/Kamailio/VDB
+%{_libdir}/kamailio/perl/Kamailio/VDB/Column.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/Pair.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/ReqCond.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/Result.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/VTab.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/Value.pm
+%dir %{_libdir}/kamailio/perl/Kamailio/VDB/Adapter
+%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/AccountingSIPtrace.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/Alias.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/Auth.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/Describe.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/Speeddial.pm
+%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/TableVersions.pm
+
+
+%files		postgresql
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.db_postgres
+%{_libdir}/kamailio/modules/db_postgres.so
+%{_libdir}/kamailio/kamctl/kamctl.pgsql
+%{_libdir}/kamailio/kamctl/kamdbctl.pgsql
+%dir %{_datadir}/kamailio/postgres
+%{_datadir}/kamailio/postgres/*
+
+
+%files		presence
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.presence
+%doc %{_docdir}/kamailio/modules/README.presence_conference
+%doc %{_docdir}/kamailio/modules/README.presence_dialoginfo
+%doc %{_docdir}/kamailio/modules/README.presence_mwi
+%doc %{_docdir}/kamailio/modules/README.presence_profile
+%doc %{_docdir}/kamailio/modules/README.presence_reginfo
+%doc %{_docdir}/kamailio/modules/README.presence_xml
+%doc %{_docdir}/kamailio/modules/README.pua
+%doc %{_docdir}/kamailio/modules/README.pua_bla
+%doc %{_docdir}/kamailio/modules/README.pua_dialoginfo
+%doc %{_docdir}/kamailio/modules/README.pua_mi
+%doc %{_docdir}/kamailio/modules/README.pua_reginfo
+%doc %{_docdir}/kamailio/modules/README.pua_usrloc
+%doc %{_docdir}/kamailio/modules/README.pua_xmpp
+%doc %{_docdir}/kamailio/modules/README.rls
+%doc %{_docdir}/kamailio/modules/README.xcap_client
+%doc %{_docdir}/kamailio/modules/README.xcap_server
+%{_libdir}/kamailio/modules/presence.so
+%{_libdir}/kamailio/modules/presence_conference.so
+%{_libdir}/kamailio/modules/presence_dialoginfo.so
+%{_libdir}/kamailio/modules/presence_mwi.so
+%{_libdir}/kamailio/modules/presence_profile.so
+%{_libdir}/kamailio/modules/presence_reginfo.so
+%{_libdir}/kamailio/modules/presence_xml.so
+%{_libdir}/kamailio/modules/pua.so
+%{_libdir}/kamailio/modules/pua_bla.so
+%{_libdir}/kamailio/modules/pua_dialoginfo.so
+%{_libdir}/kamailio/modules/pua_mi.so
+%{_libdir}/kamailio/modules/pua_reginfo.so
+%{_libdir}/kamailio/modules/pua_usrloc.so
+%{_libdir}/kamailio/modules/pua_xmpp.so
+%{_libdir}/kamailio/modules/rls.so
+%{_libdir}/kamailio/modules/xcap_client.so
+%{_libdir}/kamailio/modules/xcap_server.so
+
+
+%files		purple
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.purple
+%{_libdir}/kamailio/modules/purple.so
+
+
+%files		python
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.app_python
+%{_libdir}/kamailio/modules/app_python.so
+
+
+%files		regex
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.regex
+%{_libdir}/kamailio/modules/regex.so
+
+
+%files		sctp
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.sctp
+%{_libdir}/kamailio/modules/sctp.so
+
+
+%files		snmpstats
+%defattr(-,root,root)
+%{_docdir}/kamailio/modules/README.snmpstats
+%{_libdir}/kamailio/modules/snmpstats.so
+
+
+%files		sqlite
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.db_sqlite
+%{_libdir}/kamailio/modules/db_sqlite.so
+%{_libdir}/kamailio/kamctl/kamctl.sqlite
+%{_libdir}/kamailio/kamctl/kamdbctl.sqlite
+%dir %{_datadir}/kamailio/db_sqlite
+%{_datadir}/kamailio/db_sqlite/*
+
+
+%files		stun
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.stun
+%{_libdir}/kamailio/modules/stun.so
+
+
+%files		tls
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.tls
+%{_libdir}/kamailio/modules/tls.so
+
+
+%files		unixODBC
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.db_unixodbc
+%{_libdir}/kamailio/modules/db_unixodbc.so
+
+
+%files		utils
+%defattr(-,root,root)
+%{_docdir}/kamailio/modules/README.utils
+%{_libdir}/kamailio/modules/utils.so
+
+
+%files		websocket
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.websocket
+%{_libdir}/kamailio/modules/websocket.so
+
+
+%files		xhttp-pi
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.xhttp_pi
+%{_libdir}/kamailio/modules/xhttp_pi.so
+%dir %{_datadir}/kamailio/xhttp_pi
+%{_datadir}/kamailio/xhttp_pi/*
+
+
+%files		xmlops
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.xmlops
+%{_libdir}/kamailio/modules/xmlops.so
+
+
+%files		xmlrpc
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.xmlrpc
+%{_libdir}/kamailio/modules/xmlrpc.so
+
+
+%files		xmpp
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.xmpp
+%{_libdir}/kamailio/modules/xmpp.so
+
+
+%if 0%{?fedora}
+%files		carrierroute
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.carrierroute
+%{_libdir}/kamailio/modules/carrierroute.so
+
+
+%files		radius
+%defattr(-,root,root)
+%{_docdir}/kamailio/modules/README.acc_radius
+%{_docdir}/kamailio/modules/README.auth_radius
+%{_docdir}/kamailio/modules/README.misc_radius
+%{_docdir}/kamailio/modules/README.peering
+%{_libdir}/kamailio/modules/acc_radius.so
+%{_libdir}/kamailio/modules/auth_radius.so
+%{_libdir}/kamailio/modules/misc_radius.so
+%{_libdir}/kamailio/modules/peering.so
+
+
+%files		json
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.json
+%doc %{_docdir}/kamailio/modules/README.jsonrpc-c
+%{_libdir}/kamailio/modules/json.so
+%{_libdir}/kamailio/modules/jsonrpc-c.so
+
+
+%files		GeoIP
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.geoip
+%{_libdir}/kamailio/modules/geoip.so
+
+
+%files		mono
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.app_mono
+%{_libdir}/kamailio/modules/app_mono.so
+
+
+%files		redis
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.ndb_redis
+%{_libdir}/kamailio/modules/ndb_redis.so
+%endif
+
+
+
+%changelog
+* Thu Aug 22 2013 Peter Dunkley <peter at dunkley.me.uk>
+  - Added rtpproxy-ng module to build
+* Wed Aug 14 2013 Peter Dunkley <peter at dunkley.me.uk>
+  - Updated rel to dev7
+* Mon May 27 2013 Peter Dunkley <peter at dunkley.me.uk>
+  - Created package for auth_ephemeral module
+* Sun May 26 2013 Peter Dunkley <peter at dunkley.me.uk>
+  - Created package for sctp module
+  - Updated rel to dev6
+* Sat May 18 2013 Peter Dunkley <peter at dunkley.me.uk>
+  - Refactored .spec
+  - Put tls module back in its own .spec (OpenSSL no longer needed by core as
+    stun is in its own module)
+  - Updated rel to dev5
+* Wed Apr 24 2013 Peter Dunkley <peter at dunkley.me.uk>
+  - Updated rel to dev3
+* Wed Apr 10 2013 Peter Dunkley <peter at dunkley.me.uk>
+  - Added sipt module to .spec
+  - Updated rel to dev2
+* Fri Mar 29 2013 Peter Dunkley <peter at dunkley.me.uk>
+  - Added stun module to .spec
+  - Updated rel to dev1
+* Wed Mar 27 2013 Peter Dunkley <peter at dunkley.me.uk>
+  - Added cnxcc module to .spec
+* Thu Mar 7 2013 Peter Dunkley <peter at dunkley.me.uk>
+  - Added build requirement for docbook2X for Fedora builds
+* Wed Mar 6 2013 Peter Dunkley <peter at dunkley.me.uk>
+  - Restored perl related files
+* Tue Mar 5 2013 Peter Dunkley <peter at dunkley.me.uk>
+  - Updated rel to dev0 and ver to 4.1.0
+  - Re-ordered file to make it internally consistent
+  - Updated make commands to match updated module groups
+  - Added auth_identity back in
+  - Temporarily commented out perl related files as perl modules do not appear
+    to be working
+* Sun Jan 20 2013 Peter Dunkley <peter at dunkley.me.uk>
+  - Updated rel to pre1
+  - Moved modules from modules_k/ to modules/
+  - Renamed perl modules
+* Fri Jan 11 2013 Peter Dunkley <peter at dunkley.me.uk>
+  - Updated rel to pre0
+* Thu Jan 10 2013 Peter Dunkley <peter at dunkley.me.uk>
+  - More IMS updates
+* Tue Jan 8 2013 Peter Dunkley <peter at dunkley.me.uk>
+  - Changed dialog2 to dialog_ng
+  - Renamed all IMS modules (prepended ims_)
+* Sun Jan 6 2013 Peter Dunkley <peter at dunkley.me.uk>
+  - Updated ver to 4.0.0 and rel to dev8
+* Mon Dec 31 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Added dialog2 and IMS modules to the build
+* Fri Dec 21 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Added db2_ldap, db2_ops, and timer to the build
+  - Added uid_auth_db, uid_avp_db, uid_domain, uid_gflags, uid_uri_db, print,
+    and print_lib to the build
+* Thu Dec 13 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Added xhttp_pi framework examples to the installation
+  - Added xhttp_pi README to the installation
+* Wed Dec 12 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Added mangler module to the build
+  - Tidied up make commands used to build and install
+* Sun Dec 9 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Updated rel to dev7
+  - Added avp, sca, and xprint modules to the build
+  - Moved xlog from modules_k to modules
+* Fri Nov 9 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Updated rel to dev5
+* Tue Oct 30 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Added xhttp_pi module to RPM builds
+* Fri Oct 20 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Set ownership of /etc/kamailio to kamailio.kamailio
+  - Added installation of auth.7.gz for Fedora now that manpages are built for
+    Fedora
+  - Added "make utils" to the build section (when it's not there utils get
+    built during the install - which isn't right)
+  - SCTP and STUN now included in this build
+  - Removed kamailio-tls package - tls module now in main kamailio RPM as that
+    has openssl as a dependency for STUN
+* Sun Sep 17 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Added corex module to RPM builds
+  - Updated rel to dev4
+* Sun Aug 19 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Updated rel to dev3
+* Mon Aug 13 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Added Outbound module
+* Fri Jul 13 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Updated rel to dev2
+* Thu Jul 5 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Added kamailio-cdp RPM for cdp and cdp_avp modules
+* Tue Jul 3 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Updates to websocket module
+* Sat Jun 30 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Updated rel to dev1
+  - Removed %_sharedir and replaced with standard macro %_datadir
+* Sat Jun 23 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Added websocket module
+* Mon Jun 11 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Updated ver to 3.4.0 and rel to dev0
+* Mon Jun 4 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Added a number of %dir lines to make sure the RPMs are properly cleaned up
+    on uninstall
+* Sat Jun 2 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Added %postun section to reload systemd on Fedora after uninstall
+  - Added build requirement for redhat-rpm-config so debuginfo RPMs get built
+* Fri Jun 1 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Tweak to the pkg/kamailio/fedora directory structure
+  - Tested with Fedora 17
+* Thu May 31 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Updated rel to pre3
+  - Combined Fedora/CentOS .spec in preparation for Fedora 17
+* Sun May 20 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - First version created for Kamailio 3.3.0. Based on spec-file for Fedora
+    created by myself (in turn based on an older spec-file for CentOS created
+    by Ovidiu Sas).
+  - Tested with CentOS 6.2 x86_64.
+  - Builds all Kamailio 3.3.0 modules (modules/modules_k) except:
+    - modules/app_mono: Requires mono which is not in the CentOS 6 repo
+    - modules/auth_identity: Conflicts with TLS unless statically linked (which
+      requires changes to Makefile and is impractical for generic RPM building)
+    - modules/db_cassandra: Requires Cassandra and Thrift which are not in the
+      CentOS 6 repo
+    - modules/geoip: Requires GeoIP which is not in the CentOS 6 repo
+    - modules/iptrtpproxy: Needs local copy of iptables source to build
+      (impractical for generic RPM building)
+    - modules/json: Requires json-c whish is not in the CentOS 6 repo
+    - modules/jsonrpc-c: Requires json-c whish is not in the CentOS 6 repo
+    - modules/ndb_redis: Requires hiredis which is not in the CentOS 6 repo
+    - modules/peering: Requires radiusclient-ng which is not in the CentOS 6
+      repo
+    - modules_k/acc_radius: Requires radiusclient-ng which is not in the CentOS
+      6 repo
+    - modules_k/auth_radius: Required radiusclient-ng which is not in the
+      CentOS 6 repo
+    - modules_k/carrierroute: Requires libconfuse which is not in the CentOS 6
+      repo
+    - modules_k/db_oracle: Requires Oracle which is not in the CentOS 6 repo
+      (and is closed-source)
+    - modules_k/memcached: Module compilation appears to require an older
+      version of libmemcached-devel than the one in the CentOS 6 repo
+    - modules_k/mi_xmlrpc: Requires libxmlrpc-c3 which is not in the CentOS 6
+      repo
+    - modules_k/misc_radius: Requires radiusclient-ng which is not in the
+      CentOS 6 repo
+    - modules_k/osp: Requires OSP Toolkit which is not in the CentOS 6 repo
+* Fri May 18 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Added missing BuildRequires (gcc).
+  - Added .fc16 to rel.  This makes it easy to tell which distribution the RPMs
+    are built for.
+* Thu May 17 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Updated rel to pre2.
+* Mon May 7 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Changed to use systemd instead of SysV init.
+* Sun May 6 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - First version created for Kamailio 3.3.0. Based on spec-file for CentOS
+    created by Ovidiu Sas.
+  - Tested with Fedora 16 x86_64.
+  - Builds all Kamailio 3.3.0 modules (modules/modules_k) except:
+    - modules/auth_identity: Conflicts with TLS unless statically linked (which
+      requires changes to Makefile and is impractical for generic RPM building)
+    - modules/db_cassandra: Requires Thrift which is not in the F16 repo
+    - modules/iptrtpproxy: Needs local copy of iptables source to build
+      (impractical for generic RPM building)
+    - modules_k/db_oracle: Requires Oracle which is not in the F16 repo
+      (and is closed-source)
+    - modules_k/memcached: Module compilation appears to require an older
+      version of libmemcached-devel than the one in the F16 repo
+    - modules_k/mi_xmlrpc: The F16 repo contains an unsupported version of
+      libxmlrpc-c3, and there is an compilation error due to the module code
+      using an unknown type ('TString')
+    - modules_k/osp: Requires OSP Toolkit which is not in the F16 repo
diff --git a/pkg/kamailio/fedora/17/kamailio.sysconfig b/pkg/kamailio/fedora/17/kamailio.sysconfig
new file mode 100644
index 0000000..60916b5
--- /dev/null
+++ b/pkg/kamailio/fedora/17/kamailio.sysconfig
@@ -0,0 +1,12 @@
+#
+# Kamailio startup options
+#
+
+# Options to pass when starting Kamailio
+# Note: variable interpolation is not supported by systemd so $OPTIONS cannot
+#       be constructed from multiple variables.
+# -m - Kamailio shared (global) memory (default 32 MB)
+# -M - Kamailio package (per-process private) memory (default 4 MB)
+# -u - User to run Kamailio as
+# -g - Group to run Kamailio as
+OPTIONS="-m 32 -M 4 -u kamailio -g kamailio"
diff --git a/pkg/kamailio/fedora/18/README b/pkg/kamailio/fedora/18/README
new file mode 120000
index 0000000..7331e24
--- /dev/null
+++ b/pkg/kamailio/fedora/18/README
@@ -0,0 +1 @@
+../17/README
\ No newline at end of file
diff --git a/pkg/kamailio/fedora/18/kamailio-build.appl b/pkg/kamailio/fedora/18/kamailio-build.appl
new file mode 100644
index 0000000..27bcc51
--- /dev/null
+++ b/pkg/kamailio/fedora/18/kamailio-build.appl
@@ -0,0 +1,49 @@
+name: "kamailio-build-fc18-#BASE_ARCH#"
+summary: "Fedora 18 image for building Kamailio #BASE_ARCH# RPMs"
+os:
+  name: fedora
+  version: 18
+  password: kamailio
+hardware:
+  memory: 1024
+  partitions:
+    "/":
+      size: 6
+packages:
+  - @core
+  - @base
+  - bison			# kamailio
+  - db4-devel			# kamailio-bdb
+  - docbook2X
+  - expat-devel			# kamailio-xmpp
+  - flex			# kamailio
+  - GeoIP-devel			# kamailio-GeoIP
+  - gcc
+  - git
+  - glib-devel			# kamailio-purple
+  - hiredis-devel		# kamailio-redis
+  - json-c-devel		# kamailio-json
+  - libconfuse-devel		# kamailio-carrierroute
+  - libcurl-devel		# kamailio-utils, kamailio-presence
+  - libevent-devel		# kamailio-json
+  - libpurple-devel		# kamailio-purple
+  - libunistring-devel		# kamailio-websocket
+  - libxml2-devel		# kamailio-cdp, kamailio-cpl, kamailio-ims, kamailio-presence, kamailio-purple, kamailio-utils, kamailio-xhttp-pi, kamailio-xmlops, kamailio-xmlrpc
+  - lksctp-tools-devel		# kamailio
+  - lua-devel			# kamailio-lua
+  - make			# kamailio
+  - mod_perl-devel		# kamailio-perl
+  - mono-devel			# kamailio-mono
+  - mysql-devel			# kamailio-mysql
+  - net-snmp-devel		# kamailio-snmpstats
+  - openldap-devel		# kamailio-ldap
+  - openssl-devel		# kamailio
+  - pcre-devel			# kamailio-regex, kamailio-dialplan, kamailio-lcr
+  - postgresql-devel		# kamailio-postgresql
+  - python-devel		# kamailio-python
+  - radiusclient-ng-devel	# kamailio-radius
+  - redhat-rpm-config		# kamailio-debuginfo
+  - rpm-build
+  - sqlite-devel		# kamailio-sqlite
+  - unixODBC-devel		# kamailio-unixODBC
+  - zlib-devel			# kamailio-mysql
diff --git a/pkg/kamailio/fedora/18/kamailio.appl b/pkg/kamailio/fedora/18/kamailio.appl
new file mode 100644
index 0000000..dc5e757
--- /dev/null
+++ b/pkg/kamailio/fedora/18/kamailio.appl
@@ -0,0 +1,42 @@
+name: "kamailio-fc18-#BASE_ARCH#"
+summary: "Fedora 18 image for installing Kamailio #BASE_ARCH# RPMs"
+os:
+  name: fedora
+  version: 18
+  password: kamailio
+hardware:
+  memory: 1024
+  partitions:
+    "/":
+      size: 2
+packages:
+  - @core
+  - @base
+  - db4				# kamailio-bdb
+  - expat			# kamailio-xmpp
+  - GeoIP			# kamailio-GeoIP
+  - glib			# kamailio-purple
+  - hiredis			# kamailio-redis
+  - json-c			# kamailio-json
+  - libconfuse			# kamailio-carrierroute
+  - libcurl			# kamailio-utils, kamailio-presence
+  - libevent			# kamailio-json
+  - libpurple			# kamailio-purple
+  - libunistring		# kamailio-websocket
+  - libxml2			# kamailio-cdp, kamailio-cpl, kamailio-ims, kamailio-presence, kamailio-purple, kamailio-utils, kamailio-xhttp-pi, kamailio-xmlops, kamailio-xmlrpc
+  - lksctp-tools		# kamailio
+  - mod_perl			# kamailio-perl
+  - mono-core			# kamailio-mono
+  - mysql-libs			# kamailio-mysql
+  - net-snmp-libs		# kamailio-snmpstats
+  - openldap			# kamailio-ldap
+  - openssl			# kamailio
+  - pcre			# kamailio-regex, kamailio-dialplan, kamailio-lcr
+  - perl-Authen-SASL		# kamailio-perl
+  - perl-LDAP			# kamailio-perl
+  - postgresql-libs		# kamailio-postgresql
+  - python			# kamailio-python
+  - radiusclient-ng		# kamailio-radius
+  - sqlite			# kamailio-sqlite
+  - unixODBC			# kamailio-unixODBC
+  - zlib			# kamailio-mysql
diff --git a/pkg/kamailio/fedora/18/kamailio.service b/pkg/kamailio/fedora/18/kamailio.service
new file mode 120000
index 0000000..b57fd37
--- /dev/null
+++ b/pkg/kamailio/fedora/18/kamailio.service
@@ -0,0 +1 @@
+../17/kamailio.service
\ No newline at end of file
diff --git a/pkg/kamailio/fedora/18/kamailio.spec b/pkg/kamailio/fedora/18/kamailio.spec
new file mode 120000
index 0000000..4e06dfc
--- /dev/null
+++ b/pkg/kamailio/fedora/18/kamailio.spec
@@ -0,0 +1 @@
+../17/kamailio.spec
\ No newline at end of file
diff --git a/pkg/kamailio/fedora/18/kamailio.sysconfig b/pkg/kamailio/fedora/18/kamailio.sysconfig
new file mode 120000
index 0000000..53dfcf3
--- /dev/null
+++ b/pkg/kamailio/fedora/18/kamailio.sysconfig
@@ -0,0 +1 @@
+../17/kamailio.sysconfig
\ No newline at end of file
diff --git a/pkg/kamailio/freebsd/Makefile b/pkg/kamailio/freebsd/Makefile
new file mode 100644
index 0000000..dee6360
--- /dev/null
+++ b/pkg/kamailio/freebsd/Makefile
@@ -0,0 +1,201 @@
+# New ports collection makefile for:	kamailio
+# Date created:				20 October 2005
+# Whom:					jesusr
+#
+# $FreeBSD: ports/net/kamailio/Makefile,v 1.9 2007/08/20 09:12:42 miwi Exp $
+#
+
+PORTNAME=	kamailio
+PORTVERSION=	1.3.0
+CATEGORIES=	net
+MASTER_SITES=	http://kamailio.org/pub/kamailio/${PORTVERSION}/src/
+DISTNAME=	${PORTNAME}-${PORTVERSION}-tls_src
+
+MAINTAINER=	jesusr at FreeBSD.org
+COMMENT=	A very fast and configurable SIP proxy with TLS support
+
+LIB_DEPENDS=	radiusclient-ng.2:${PORTSDIR}/net/radiusclient
+
+WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}-tls
+
+USE_GMAKE=	yes
+MAKE_ENV=	CC="${CC}" \
+		CC_EXTRA_OPTS="${CFLAGS}" \
+		PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
+		PTHREAD_LIBS="${PTHREAD_LIBS}"
+
+PLIST_FILES=	sbin/kamailio sbin/kamctl sbin/kamdbctl sbin/kamunix \
+		lib/kamailio/kamctl/kamctl.base lib/kamailio/kamctl/kamctl.ctlbase \
+		lib/kamailio/kamctl/kamctl.dbtext lib/kamailio/kamctl/kamctl.fifo \
+		lib/kamailio/kamctl/kamctl.sqlbase lib/kamailio/kamctl/kamctl.unixsock \
+		lib/kamailio/kamctl/kamdbctl.base lib/kamailio/kamctl/kamdbctl.dbtext \
+		etc/kamailio/kamctlrc
+
+PLIST_DIRS=	lib/kamailio/modules lib/kamailio/kamctl lib/kamailio
+
+MODULES=	acc alias_db auth auth_db auth_diameter avpops benchmark \
+		cfgutils dbtext dialog dispatcher diversion domain \
+		domainpolicy enum exec flatstore gflags group imc lcr \
+		mangler maxfwd mediaproxy mi_datagram mi_fifo msilo nathelper \
+		options path pdt permissions pike registrar rr seas \
+		siptrace sl sms speeddial sst statistics textops tm uac \
+		uac_redirect uri uri_db usrloc xlog
+
+RC_FILES=	acc/radiusclient.conf \
+		acc/servers \
+		dictionary.radius \
+		kamailio.cfg
+RC_DIRS=	acc
+
+ONLY_FOR_ARCHS=	i386
+
+MAN5=		kamailio.cfg.5
+MAN8=		kamailio.8 \
+		kamctl.8 \
+		kamunix.8
+
+PORTDOCS=	*
+
+SUB_FILES=	pkg-install pkg-deinstall
+SUB_LIST=	RC_DIRS="${RC_DIRS}" RC_FILES="${RC_FILES}"
+
+OPTIONS=	MYSQL "MySQL support" on \
+		POSTGRESQL "PostgreSQL support" off \
+		UNIXODBC "UnixODBC support" off \
+		CPL "CPL-C support" off \
+		TLS "TLS support" off \
+		SNMPSTATS "SNMPStats support" off
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_MYSQL)
+USE_MYSQL=	yes
+MODULES+=	mysql
+PLIST_FILES+=	lib/kamailio/kamctl/kamdbctl.mysql lib/kamailio/kamctl/kamctl.mysql
+.else
+MAKE_ENV+=	MYSQL=mysql
+.endif
+
+.if defined(WITH_POSTGRESQL)
+USE_PGSQL=	yes
+MODULES+=	postgres
+PLIST_FILES+=	lib/kamailio/kamctl/kamdbctl.pgsql lib/kamailio/kamctl/kamctl.pgsql
+.else
+MAKE_ENV+=	POSTGRESQL=postgres
+.endif
+
+.if defined(WITH_UNIXODBC)
+LIB_DEPENDS+=	odbc.1:${PORTSDIR}/databases/unixODBC
+MODULES+=	unixodbc
+.else
+MAKE_ENV+=	UNIXODBC=unixodbc
+.endif
+
+.if defined(WITH_CPL)
+USE_GNOME=	libxml2
+MODULES+=	cpl-c
+PLIST_FILES+=	etc/kamailio/cpl-06.dtd
+.else
+MAKE_ENV+=	CPL=cpl-c
+.endif
+
+.if defined(WITH_TLS)
+MODULES+=	tlsops
+.include "${PORTSDIR}/Mk/bsd.openssl.mk"
+TLS_RC_FILES=	tls/rootCA/cacert.pem \
+		tls/rootCA/certs/01.pem \
+		tls/rootCA/index.txt \
+		tls/rootCA/private/cakey.pem \
+		tls/rootCA/serial \
+		tls/user/user-calist.pem \
+		tls/user/user-cert.pem \
+		tls/user/user-cert_req.pem \
+		tls/user/user-privkey.pem \
+		tls/README \
+		tls/ca.conf \
+		tls/request.conf \
+		tls/user.conf
+RC_FILES+=	${TLS_RC_FILES}
+TLS_RC_DIRS=	tls/user \
+		tls/rootCA/certs \
+		tls/rootCA/private \
+		tls/rootCA \
+		tls
+RC_DIRS+=	${TLS_RC_DIRS}
+.else
+MAKE_ENV+=	TLSOPS=tlsops
+MAKE_ARGS+=	TLS=""
+.endif
+
+.if defined(WITH_SNMPSTATS)
+RUN_DEPENDS+=	snmpcheck:${PORTSDIR}/net-mgmt/net-snmp
+MODULES+=	snmpstats
+.else
+MAKE_ENV+=	SNMPSTATS=snmpstats
+.endif
+
+PLIST_FILES+=	${MODULES:S|^|lib/kamailio/modules/|:S|$|.so|} \
+		${RC_FILES:S|^|etc/kamailio/|:S|$|.default|}
+
+post-patch:
+.if defined(NOPORTDOCS)
+	@${REINPLACE_CMD} -e 's|install-doc install-man|install-man|' \
+		${WRKSRC}/Makefile
+.endif
+	@${REINPLACE_CMD} -e 's|-g -O9 ||' -e 's|-O9 ||' ${WRKSRC}/Makefile.defs
+	@${REINPLACE_CMD} -e 's|/usr/local/etc/kamailio|${PREFIX}/etc/kamailio|' \
+		${WRKSRC}/scripts/kamdbctl.dbtext
+	@${REINPLACE_CMD} -e 's|/usr/local/share/kamailio|${PREFIX}/share/kamailio|' \
+		${WRKSRC}/scripts/kamdbctl.dbtext
+	@${REINPLACE_CMD} -e 's|/etc/kamailio|${PREFIX}/etc/kamailio|' \
+		${WRKSRC}/modules/mediaproxy/README \
+		${WRKSRC}/modules/cpl-c/README \
+		${WRKSRC}/INSTALL
+	@${REINPLACE_CMD} -e 's|/usr/local/sbin/kamailio|${PREFIX}/sbin/kamailio|' \
+		${WRKSRC}/INSTALL
+	@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|' \
+		${WRKSRC}/etc/kamailio.cfg \
+		${WRKSRC}/scripts/kamctl \
+		${WRKSRC}/scripts/kamctl.8 \
+		${WRKSRC}/scripts/kamctl.base \
+		${WRKSRC}/scripts/kamctl.db_berkeley \
+		${WRKSRC}/scripts/kamctl.dbtext \
+		${WRKSRC}/scripts/kamctlrc \
+		${WRKSRC}/scripts/kamdbctl \
+		${WRKSRC}/scripts/kamdbctl.base \
+		${WRKSRC}/scripts/kamdbctl.db_berkeley \
+		${WRKSRC}/scripts/kamdbctl.dbtext \
+		${WRKSRC}/scripts/kamdbctl.mysql \
+		${WRKSRC}/scripts/kamdbctl.pgsql \
+		${WRKSRC}/modules/acc/README \
+		${WRKSRC}/modules/avp_radius/README \
+		${WRKSRC}/modules/db_berkeley/README \
+		${WRKSRC}/modules/ldap/README \
+		${WRKSRC}/modules/osp/README \
+		${WRKSRC}/modules/perl/README \
+		${WRKSRC}/modules/seas/README \
+		${WRKSRC}/modules/snmpstats/README \
+		${WRKSRC}/modules/speeddial/README \
+		${WRKSRC}/modules/unixodbc/README
+	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' \
+		${WRKSRC}/modules/acc/etc/radiusclient.conf
+	@${REINPLACE_CMD} -e 's|/usr/local/etc/radiusclient|${PREFIX}/etc/kamailio/acc|' \
+		${WRKSRC}/modules/acc/acc_mod.c ${WRKSRC}/modules/acc/README
+
+post-install:
+	${INSTALL_DATA} ${WRKSRC}/etc/kamailio.cfg \
+		${PREFIX}/etc/kamailio/kamailio.cfg.default
+	${MKDIR} ${PREFIX}/etc/kamailio/acc
+	${INSTALL_DATA} ${WRKSRC}/modules/acc/etc/radiusclient.conf \
+		${PREFIX}/etc/kamailio/acc/radiusclient.conf.default
+	${INSTALL_DATA} ${WRKSRC}/modules/acc/etc/servers \
+		${PREFIX}/etc/kamailio/acc/servers.default
+.for d in ${TLS_RC_DIRS}
+	${MKDIR} ${PREFIX}/etc/kamailio/${d}
+.endfor
+.for f in ${TLS_RC_FILES}
+	${INSTALL_DATA} ${WRKSRC}/etc/${f} ${PREFIX}/etc/kamailio/${f}.default
+.endfor
+	@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+
+.include <bsd.port.post.mk>
diff --git a/pkg/kamailio/freebsd/distinfo b/pkg/kamailio/freebsd/distinfo
new file mode 100644
index 0000000..fd36f3f
--- /dev/null
+++ b/pkg/kamailio/freebsd/distinfo
@@ -0,0 +1,3 @@
+MD5 (kamailio-1.3.0-tls_src.tar.gz) = e380fa73095274162fac129e16d7c7d8
+SHA256 (kamailio-1.3.0-tls_src.tar.gz) = afd43b70e5887c5f91769bbc22506e8a6e0da90a91bf699da17f73988fc61fcf
+SIZE (kamailio-1.3.0-tls_src.tar.gz) = 3405325
diff --git a/pkg/kamailio/freebsd/files/patch-Makefile b/pkg/kamailio/freebsd/files/patch-Makefile
new file mode 100644
index 0000000..6b4f892
--- /dev/null
+++ b/pkg/kamailio/freebsd/files/patch-Makefile
@@ -0,0 +1,78 @@
+--- Makefile.orig	Thu Dec 13 18:49:12 2007
++++ Makefile	Thu Dec 13 21:49:54 2007
+@@ -48,11 +48,11 @@
+ skip_modules?=
+ 
+ # if not set on the cmd. line or the env, exclude this modules:
+-exclude_modules?= jabber cpl-c mysql postgres osp unixodbc \
+-	avp_radius auth_radius group_radius uri_radius xmpp \
++exclude_modules?= 	$(MYSQL) $(POSTGRESQL) $(CPL) $(SNMPSTATS) $(TLSOPS) $(UNIXODBC) \
++	jabber osp avp_radius auth_radius group_radius uri_radius xmpp \
+ 	presence presence_xml presence_mwi pua pua_bla pua_mi \
+ 	pua_usrloc pua_xmpp rls mi_xmlrpc perl snmpstats perlvdb \
+-	ldap carrierroute h350 xcap_client db_berkeley seas
++	ldap carrierroute h350 xcap_client db_berkeley
+ ifeq ($(TLS),)
+ 	exclude_modules+= tlsops
+ endif
+@@ -392,24 +392,11 @@
+ 		
+ # note: on solaris 8 sed: ? or \(...\)* (a.s.o) do not work
+ install-cfg: $(cfg-prefix)/$(cfg-dir)
+-		sed -e "s#/usr/.*lib/$(NAME)/modules/#$(modules-target)#g" \
+-			< etc/$(NAME).cfg > $(cfg-prefix)/$(cfg-dir)$(NAME).cfg.sample0
+-		sed -e "s#/usr/.*etc/$(NAME)/tls/#$(cfg-target)tls/#g" \
+-			< $(cfg-prefix)/$(cfg-dir)$(NAME).cfg.sample0 \
+-			> $(cfg-prefix)/$(cfg-dir)$(NAME).cfg.sample
+-		rm -fr $(cfg-prefix)/$(cfg-dir)$(NAME).cfg.sample0
+-		chmod 644 $(cfg-prefix)/$(cfg-dir)$(NAME).cfg.sample
+-		if [ -z "${skip_cfg_install}" -a \
+-				! -f $(cfg-prefix)/$(cfg-dir)$(NAME).cfg ]; then \
+-			mv -f $(cfg-prefix)/$(cfg-dir)$(NAME).cfg.sample \
+-				$(cfg-prefix)/$(cfg-dir)$(NAME).cfg; \
+-		fi
+ 		# radius dictionary
+-		$(INSTALL_TOUCH) $(cfg-prefix)/$(cfg-dir)/dictionary.radius.sample
+-		$(INSTALL_CFG) etc/dictionary.radius \
+-			$(cfg-prefix)/$(cfg-dir)/dictionary.radius.sample
++		$(INSTALL_TOUCH) $(cfg-prefix)/$(cfg-dir)/dictionary.radius.default
++		$(INSTALL_CFG) etc/dictionary.radius $(cfg-prefix)/$(cfg-dir)/dictionary.radius.default
+ 		if [ ! -f $(cfg-prefix)/$(cfg-dir)/dictionary.radius ]; then \
+-			mv -f $(cfg-prefix)/$(cfg-dir)/dictionary.radius.sample \
++			cp -f $(cfg-prefix)/$(cfg-dir)/dictionary.radius.default \
+ 				$(cfg-prefix)/$(cfg-dir)/dictionary.radius; \
+ 		fi
+ 		# kamctl config
+@@ -445,7 +432,7 @@
+ 		sed -e "s#/usr/local/lib/kamailio/#$(lib-target)#g" | \
+ 		sed -e "s#/usr/local/etc/kamailio/#$(cfg-target)#g"  >/tmp/kamctl
+ 		$(INSTALL_TOUCH) $(bin-prefix)/$(bin-dir)/kamctl
+-		$(INSTALL_BIN) /tmp/kamctl $(bin-prefix)/$(bin-dir)
++		$(BSD_INSTALL_SCRIPT) /tmp/kamctl $(bin-prefix)/$(bin-dir)
+ 		rm -fr /tmp/kamctl
+ 		sed -e "s#/usr/local/sbin#$(bin-target)#g" \
+ 			< scripts/kamctl.base > /tmp/kamctl.base
+@@ -492,10 +479,10 @@
+ 		sed -e "s#/usr/local/lib/kamailio/#$(lib-target)#g" | \
+ 		sed -e "s#/usr/local/etc/kamailio/#$(cfg-target)#g"  >/tmp/kamdbctl
+ 		$(INSTALL_TOUCH) $(bin-prefix)/$(bin-dir)/kamdbctl
+-		$(INSTALL_BIN) /tmp/kamdbctl $(bin-prefix)/$(bin-dir)
++		$(BSD_INSTALL_SCRIPT) /tmp/kamdbctl $(bin-prefix)/$(bin-dir)
+ 		rm -fr /tmp/kamdbctl
+ 		$(INSTALL_TOUCH)   $(bin-prefix)/$(bin-dir)/$(NAME)unix
+-		$(INSTALL_BIN) utils/$(NAME)unix/$(NAME)unix $(bin-prefix)/$(bin-dir)
++		$(BSD_INSTALL_SCRIPT) utils/$(NAME)unix/$(NAME)unix $(bin-prefix)/$(bin-dir)
+ 		# install dbtext stuff
+ 		mkdir -p $(modules-prefix)/$(lib-dir)/kamctl ; \
+ 		sed -e "s#/usr/local/share/kamailio/#$(data-target)#g" \
+@@ -624,9 +611,7 @@
+ 			if [ -f modules/"$$r"/README ]; then \
+ 				$(INSTALL_TOUCH)  $(doc-prefix)/$(doc-dir)/README ; \
+ 				$(INSTALL_DOC)  modules/"$$r"/README  \
+-									$(doc-prefix)/$(doc-dir)/README ; \
+-				mv -f $(doc-prefix)/$(doc-dir)/README \
+-						$(doc-prefix)/$(doc-dir)/README."$$r" ; \
++					$(doc-prefix)/$(doc-dir)/README."$$r" ; \
+ 			fi ; \
+ 		fi ; \
+ 	done 
diff --git a/pkg/kamailio/freebsd/files/patch-Makefile-mysql b/pkg/kamailio/freebsd/files/patch-Makefile-mysql
new file mode 100644
index 0000000..3005ace
--- /dev/null
+++ b/pkg/kamailio/freebsd/files/patch-Makefile-mysql
@@ -0,0 +1,11 @@
+--- modules/mysql/Makefile.orig	Thu Dec 13 20:15:16 2007
++++ modules/mysql/Makefile	Thu Dec 13 20:15:20 2007
+@@ -8,7 +8,7 @@
+ 
+ # set CROSS_COMPILE to true if you want to skip
+ # the autodetection
+-# CROSS_COMPILE=true
++CROSS_COMPILE=true
+ 
+ ifeq ($(CROSS_COMPILE),)
+ MYSQLCFG=$(shell which mysql_config)
diff --git a/pkg/kamailio/freebsd/files/patch-Makefile.defs b/pkg/kamailio/freebsd/files/patch-Makefile.defs
new file mode 100644
index 0000000..87a111a
--- /dev/null
+++ b/pkg/kamailio/freebsd/files/patch-Makefile.defs
@@ -0,0 +1,42 @@
+--- Makefile.defs.orig	Thu Dec 13 18:56:53 2007
++++ Makefile.defs	Thu Dec 13 20:31:40 2007
+@@ -135,7 +135,7 @@
+ ifeq ($(ARCH_B),64b)
+ 	LIBDIR ?= lib64
+ else
+-	LIBDIR ?= lib
++	LIBDIR = lib
+ 	# assume 32b - it is not really used further
+ 	ARCH_B=32b
+ endif
+@@ -228,13 +228,13 @@
+ TAR ?= tar
+ endif
+ 
+-INSTALL_TOUCH = touch          # used to create the file first (good to 
++INSTALL_TOUCH = :          # used to create the file first (good to 
+                                #  make solaris install work)
+-INSTALL_CFG = $(INSTALL) -m 644
+-INSTALL_BIN = $(INSTALL) -m 755
+-INSTALL_MODULES = $(INSTALL) -m 755
+-INSTALL_DOC = $(INSTALL) -m 644
+-INSTALL_MAN = $(INSTALL) -m 644
++INSTALL_CFG = $(BSD_INSTALL_DATA) -m 644
++INSTALL_BIN = $(BSD_INSTALL_PROGRAM) -m 755
++INSTALL_MODULES = $(BSD_INSTALL_PROGRAM) -m 755
++INSTALL_DOC = $(BSD_INSTALL_DATA) -m 644
++INSTALL_MAN = $(BSD_INSTALL_MAN) -m 644
+ 
+ #set some vars from the environment (and not make builtins)
+ CC   := $(shell echo "$${CC}")
+@@ -1254,8 +1254,8 @@
+ 
+ #add libssl if needed
+ ifneq ($(TLS),)
+-DEFS+= -I$(LOCALBASE)/ssl/include -I$(LOCALBASE)/include
+-LIBS+= -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib -lssl  -lcrypto
++DEFS+= -I$(OPENSSLINC)
++LIBS+= -L$(OPENSSLLIB) -lssl  -lcrypto
+ endif
+ 
+ #add libsctp if needed
diff --git a/pkg/kamailio/freebsd/files/pkg-deinstall.in b/pkg/kamailio/freebsd/files/pkg-deinstall.in
new file mode 100644
index 0000000..8cf7bab
--- /dev/null
+++ b/pkg/kamailio/freebsd/files/pkg-deinstall.in
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+rc_dir=$PKG_PREFIX/etc/kamailio/
+
+if [ "$2" = DEINSTALL ]; then
+	for f in %%RC_FILES%%; do
+		if /usr/bin/cmp -s $rc_dir/$f.default $rc_dir/$f; then
+			/bin/rm -f $rc_dir/$f
+		fi
+	done
+elif [ "$2" = POST-DEINSTALL ]; then
+	rc_dirs=`for d in %%RC_DIRS%%; do echo $d; done | /usr/bin/sort -r`
+
+	for d in $rc_dirs ""; do
+		/bin/rmdir $rc_dir/$d 2>/dev/null || /usr/bin/true
+	done
+
+	if [ -e $rc_dir ]; then
+		echo "==============================================================================="
+		echo "If you are permanently removing this port, you should manually remove the"
+		echo "$rc_dir directory."
+		echo "==============================================================================="
+	fi
+fi
diff --git a/pkg/kamailio/freebsd/files/pkg-install.in b/pkg/kamailio/freebsd/files/pkg-install.in
new file mode 100644
index 0000000..97680f6
--- /dev/null
+++ b/pkg/kamailio/freebsd/files/pkg-install.in
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+[ "$2" != POST-INSTALL ] && exit
+
+rc_dir=$PKG_PREFIX/etc/kamailio/
+
+for f in %%RC_FILES%%; do
+	if ! [ -e $rc_dir/$f ]; then
+		/usr/bin/install -o root -g wheel -m 644 \
+			$rc_dir/$f.default $rc_dir/$f
+	fi
+done
diff --git a/pkg/kamailio/freebsd/pkg-descr b/pkg/kamailio/freebsd/pkg-descr
new file mode 100644
index 0000000..9aad819
--- /dev/null
+++ b/pkg/kamailio/freebsd/pkg-descr
@@ -0,0 +1,13 @@
+Kamailio is a very fast and flexible SIP (RFC3261)
+proxy server. Written entirely in C, kamailio can handle thousands calls
+per second even on low-budget hardware. A C Shell like scripting language
+provides full control over the server's behaviour. It's modular
+architecture allows only required functionality to be loaded.
+Currently the following modules are available: digest authentication,
+CPL scripts, instant messaging, MySQL and UNIXODBC support, a presence agent,
+radius authentication, record routing, an SMS gateway, a jabber gateway, a 
+transaction and dialog module, OSP module, statistics support, 
+registrar and user location, SIMPLE Presence, Perl programming interface,
+SNMP and Java SIP Servlet.
+
+WWW: http://www.kamailio.org/
diff --git a/pkg/kamailio/gentoo b/pkg/kamailio/gentoo
new file mode 120000
index 0000000..6cd8d42
--- /dev/null
+++ b/pkg/kamailio/gentoo
@@ -0,0 +1 @@
+../ser/gentoo/
\ No newline at end of file
diff --git a/pkg/kamailio/netbsd/COMMENT b/pkg/kamailio/netbsd/COMMENT
new file mode 100644
index 0000000..1d877c1
--- /dev/null
+++ b/pkg/kamailio/netbsd/COMMENT
@@ -0,0 +1 @@
+Kamailio, very fast and configurable SIP proxy
diff --git a/pkg/kamailio/netbsd/DESCR b/pkg/kamailio/netbsd/DESCR
new file mode 100644
index 0000000..5c77338
--- /dev/null
+++ b/pkg/kamailio/netbsd/DESCR
@@ -0,0 +1,18 @@
+Kamailio is a very fast and flexible SIP (RFC3261)
+proxy server. Written entirely in C, ser can handle thousands calls
+per second even on low-budget hardware. C Shell like scripting language
+provides full control over the server's behaviour. It's modular
+architecture allows only required functionality to be loaded.
+Currently the following modules are available: Digest Authentication,
+CPL scripts, Instant Messaging, MySQL support, UNIXODBC support,
+OSP support, Radius Authentication, Record Routing, SMS Gateway,
+Jabber Gateway, Transaction Module, Dialog Module, Registrar and
+User Location, Perl programming interface, SIMPLE Presence and SNMP.
+
+
+WWW: http://www.kamailio.org/
+
+- Bogdan-Andrei Iancu
+bogdan at voice-system.ro
+- Daniel-Constantin Mierla
+miconda at gmail.com
diff --git a/pkg/kamailio/netbsd/Makefile b/pkg/kamailio/netbsd/Makefile
new file mode 100644
index 0000000..a5c62b0
--- /dev/null
+++ b/pkg/kamailio/netbsd/Makefile
@@ -0,0 +1,42 @@
+# New ports collection makefile for:    kamailio
+#
+# $NetBSD$
+#
+# $Id$
+#
+
+COMMENT= "Kamailio"
+
+PORTNAME= kamailio
+PORTVERSION= 1.2.0-notls
+CATEGORIES= net
+MASTER_SITES= http://kamailio.org/pub/kamailio/1.2.0/src/
+
+MAINTAINER= miconda at gmail.com
+
+MAN8=kamailio.8
+MAN5=kamailio.cfg.5
+# MANCOMPRESSED must not be specified (if defined is assumed to be yes)
+
+
+USE_GMAKE= yes
+USE_TOOLS+= gmake
+# we override the DISTFILE NAME
+DISTNAME= ${PORTNAME}-${PORTVERSION}
+DISTFILES= ${DISTNAME}_src.tar.gz
+WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
+
+# build by default mysql and jabber
+MAKE_ENV= include_modules="mysql jabber"
+
+# depends on expat and mysqlclient because of the above modules
+DEPENDS= expat-[0-9]*:../../textproc/expat \
+         mysql-client>=3.23.35:../../databases/mysql-client
+
+#.include "/usr/pkgsrc/mk/bsd.prefs.mk"
+
+pre-fetch:
+
+.include "../../mk/bsd.pkg.mk"
+
+
diff --git a/pkg/kamailio/netbsd/PLIST b/pkg/kamailio/netbsd/PLIST
new file mode 100644
index 0000000..8a25398
--- /dev/null
+++ b/pkg/kamailio/netbsd/PLIST
@@ -0,0 +1,120 @@
+etc/kamailio/kamailio.cfg
+etc/kamailio/kamctlrc
+sbin/kamailio
+sbin/kamctl
+sbin/kamailio_mysql.sh
+lib/kamailio/modules/acc.so
+lib/kamailio/modules/alias_db.so
+lib/kamailio/modules/auth.so
+lib/kamailio/modules/auth_db.so
+lib/kamailio/modules/auth_diameter.so
+lib/kamailio/modules/avpops.so
+lib/kamailio/modules/dbtext.so
+lib/kamailio/modules/dialog.so
+lib/kamailio/modules/dispatcher.so
+lib/kamailio/modules/diversion.so
+lib/kamailio/modules/domain.so
+lib/kamailio/modules/domainpolicy.so
+lib/kamailio/modules/enum.so
+lib/kamailio/modules/exec.so
+lib/kamailio/modules/flatstore.so
+lib/kamailio/modules/gflags.so
+lib/kamailio/modules/group.so
+lib/kamailio/modules/jabber.so
+lib/kamailio/modules/lcr.so
+lib/kamailio/modules/mangler.so
+lib/kamailio/modules/maxfwd.so
+lib/kamailio/modules/mediaproxy.so
+lib/kamailio/modules/mi_fifo.so
+lib/kamailio/modules/msilo.so
+lib/kamailio/modules/mysql.so
+lib/kamailio/modules/nathelper.so
+lib/kamailio/modules/options.so
+lib/kamailio/modules/pa.so
+lib/kamailio/modules/path.so
+lib/kamailio/modules/pdt.so
+lib/kamailio/modules/permissions.so
+lib/kamailio/modules/pike.so
+lib/kamailio/modules/registrar.so
+lib/kamailio/modules/rr.so
+lib/kamailio/modules/seas.so
+lib/kamailio/modules/siptrace.so
+lib/kamailio/modules/sl.so
+lib/kamailio/modules/sms.so
+lib/kamailio/modules/speeddial.so
+lib/kamailio/modules/sst.so
+lib/kamailio/modules/statistics.so
+lib/kamailio/modules/textops.so
+lib/kamailio/modules/tm.so
+lib/kamailio/modules/uac.so
+lib/kamailio/modules/uac_redirect.so
+lib/kamailio/modules/uri.so
+lib/kamailio/modules/uri_db.so
+lib/kamailio/modules/usrloc.so
+lib/kamailio/modules/xlog.so
+lib/kamailio/modules/xmpp.so
+lib/kamctl/kamctl.base
+lib/kamctl/kamctl.sqlbase
+lib/kamctl/kamctl.ctlbase
+lib/kamctl/kamctl.fifo
+lib/kamctl/kamctl.unixsock
+lib/kamctl/kamctl.mysql
+share/doc/kamailio/README
+share/doc/kamailio/INSTALL
+share/doc/kamailio/README-MODULES
+share/doc/kamailio/AUTHORS
+share/doc/kamailio/NEWS
+share/doc/kamailio/README.acc
+share/doc/kamailio/README.alias_db
+share/doc/kamailio/README.auth
+share/doc/kamailio/README.auth_db
+share/doc/kamailio/README.auth_diameter
+share/doc/kamailio/README.avpops
+share/doc/kamailio/README.dbtext
+share/doc/kamailio/README.dialog
+share/doc/kamailio/README.dispatcher
+share/doc/kamailio/README.diversion
+share/doc/kamailio/README.domain
+share/doc/kamailio/README.domainpolicy
+share/doc/kamailio/README.enum
+share/doc/kamailio/README.exec
+share/doc/kamailio/README.flatstore
+share/doc/kamailio/README.gflags
+share/doc/kamailio/README.group
+share/doc/kamailio/README.jabber
+share/doc/kamailio/README.lcr
+share/doc/kamailio/README.mangler
+share/doc/kamailio/README.maxfwd
+share/doc/kamailio/README.mediaproxy
+share/doc/kamailio/README.mi_fifo
+share/doc/kamailio/README.msilo
+share/doc/kamailio/README.mysql
+share/doc/kamailio/README.nathelper
+share/doc/kamailio/README.options
+share/doc/kamailio/README.pa
+share/doc/kamailio/README.path
+share/doc/kamailio/README.pdt
+share/doc/kamailio/README.permissions
+share/doc/kamailio/README.pike
+share/doc/kamailio/README.registrar
+share/doc/kamailio/README.rr
+share/doc/kamailio/README.seas
+share/doc/kamailio/README.siptrace
+share/doc/kamailio/README.sl
+share/doc/kamailio/README.sms
+share/doc/kamailio/README.speeddial
+share/doc/kamailio/README.sst
+share/doc/kamailio/README.statistics
+share/doc/kamailio/README.textops
+share/doc/kamailio/README.tm
+share/doc/kamailio/README.uac
+share/doc/kamailio/README.uac_redirect
+share/doc/kamailio/README.uri
+share/doc/kamailio/README.uri_db
+share/doc/kamailio/README.usrloc
+share/doc/kamailio/README.xlog
+share/doc/kamailio/README.xmpp
+ at dirrm share/doc/kamailio
+ at dirrm etc/kamailio
+ at dirrm lib/kamailio/modules
+ at dirrm lib/kamailio
diff --git a/pkg/kamailio/netbsd/distinfo b/pkg/kamailio/netbsd/distinfo
new file mode 100644
index 0000000..187f898
--- /dev/null
+++ b/pkg/kamailio/netbsd/distinfo
@@ -0,0 +1 @@
+MD5 (kamailio-1.2.0-notls_src.tar.gz) = 9ca396cb5d95623206b109bdfb4c6374
diff --git a/pkg/kamailio/openbsd/Makefile b/pkg/kamailio/openbsd/Makefile
new file mode 100644
index 0000000..cf481de
--- /dev/null
+++ b/pkg/kamailio/openbsd/Makefile
@@ -0,0 +1,154 @@
+# $OpenBSD$
+
+COMMENT-main =		mature and flexible open source SIP server
+COMMENT-postgresql =	kamailio postgresql module
+COMMENT-mysql =		kamailio mysql module
+COMMENT-radius =	kamailio RADIUS modules
+COMMENT-berkeleydb =	kamailio berkeley DB module
+COMMENT-ldap =		kamailio LDAP modules
+COMMENT-xmlrpc =	kamailio XML-RPC module
+COMMENT-xcap_client =	kamailio XCAP client module
+COMMENT-carrierroute =	kamailio carrierroute module
+COMMENT-snmpstats =	kamailio snmpstats module
+COMMENT-perl =		kamailio perl modules
+
+VERSION =		1.5.0
+DISTNAME =		kamailio-${VERSION}
+PKGNAME-main =		kamailio-${VERSION}
+PKGNAME-mysql =		kamailio-mysql-${VERSION}
+PKGNAME-postgresql =	kamailio-postgresql-${VERSION}
+PKGNAME-radius =	kamailio-radius-${VERSION}
+PKGNAME-berkeleydb =	kamailio-berkeleydb-${VERSION}
+PKGNAME-ldap =		kamailio-ldap-${VERSION}
+PKGNAME-xmlrpc =	kamailio-xmlrpc-${VERSION}
+PKGNAME-xcap_client =	kamailio-xcap_client-${VERSION}
+PKGNAME-carrierroute =	kamailio-carrierroute-${VERSION}
+PKGNAME-snmpstats =	kamailio-snmpstats-${VERSION}
+PKGNAME-perl =		kamailio-perl-${VERSION}
+
+CATEGORIES =		telephony
+MAINTAINER =		port-pkg-maint at clark-communications.com
+
+HOMEPAGE =		http://www.kamailio.org/
+
+# GPL
+PERMIT_PACKAGE_CDROM =	Yes
+PERMIT_PACKAGE_FTP =	Yes
+PERMIT_DISTFILES_CDROM =Yes
+PERMIT_DISTFILES_FTP =	Yes
+
+MASTER_SITES =		http://www.kamailio.org/pub/kamailio/${VERSION}/src/
+DISTFILES =		${DISTNAME}-tls_src.tar.gz
+WRKDIST =		${WRKDIR}/${DISTNAME}-tls
+
+BUILD_DEPENDS =		::devel/gmake
+
+WANTLIB-main =		c expat crypto ssl
+LIB_DEPENDS-main =	xml2::textproc/libxml,-main,no_python
+# kamctl and kamdbctl use bash
+RUN_DEPENDS-main =	::shells/bash
+
+WANTLIB-berkeleydb =	c
+LIB_DEPENDS-berkeleydb =db::databases/db/v4,-main
+RUN_DEPENDS-berkeleydb =::telephony/kamailio
+
+LIB_DEPENDS-postgresql =pq:postgresql-client-*:databases/postgresql,-main
+RUN_DEPENDS-postgresql =::telephony/kamailio
+
+WANTLIB-mysql =		crypto m ssl z
+LIB_DEPENDS-mysql =	mysqlclient:mysql-client-*:databases/mysql,-main
+RUN_DEPENDS-mysql =	::telephony/kamailio
+
+LIB_DEPENDS-radius =	radiusclient-ng:radiusclient-ng-*:net/radiusclient-ng
+RUN_DEPENDS-radius =	::telephony/kamailio
+
+LIB_DEPENDS-ldap =	ldap:openldap-client-*:databases/openldap,-main
+RUN_DEPENDS-ldap =	::telephony/kamailio
+
+LIB_DEPENDS-xmlrpc =	xmlrpc::net/xmlrpc-c \
+			xmlrpc_server::net/xmlrpc-c \
+			xmlrpc_util::net/xmlrpc-c \
+			xmlrpc_xmlparse::net/xmlrpc-c \
+			xmlrpc_xmltok::net/xmlrpc-c
+RUN_DEPENDS-xmlrpc =	::telephony/kamailio
+
+LIB_DEPENDS-xcap_client =	curl::net/curl \
+				xml2::textproc/libxml,-main
+RUN_DEPENDS-xcap_client =	::telephony/kamailio
+
+LIB_DEPENDS-carrierroute =	confuse::devel/libconfuse
+RUN_DEPENDS-carrierroute =	::telephony/kamailio
+
+WANTLIB-snmpstats =	c m perl util
+LIB_DEPENDS-snmpstats =	netsnmp:net-snmp-*:net/net-snmp \
+			netsnmpagent:net-snmp-*:net/net-snmp \
+			netsnmphelpers:net-snmp-*:net/net-snmp
+RUN_DEPENDS-snmpstats =	::telephony/kamailio
+
+RUN_DEPENDS-perl =	::telephony/kamailio \
+			::databases/p5-ldap
+WANTLIB-perl =		c m perl util
+
+PSEUDO_FLAVORS =	no_berkeleydb no_postgresql no_mysql no_radius no_ldap no_xmlrpc no_xcap_client no_carrierroute no_snmpstats no_perl
+
+KAMAILIO_MODULES =	cpl-c jabber presence presence_mwi presence_xml pua pua_bla pua_mi pua_usrloc pua_xmpp rls seas xmpp
+FLAVOR ?=
+MULTI_PACKAGES =	-main
+
+.if !${FLAVOR:L:Mno_berkeleydb}
+MULTI_PACKAGES +=	-berkeleydb
+KAMAILIO_MODULES +=	db_berkeley
+.endif
+.if !${FLAVOR:L:Mno_postgresql}
+MULTI_PACKAGES +=	-postgresql
+KAMAILIO_MODULES +=	db_postgres
+.endif
+.if !${FLAVOR:L:Mno_mysql}
+MULTI_PACKAGES +=	-mysql
+KAMAILIO_MODULES +=	db_mysql
+.endif
+.if !${FLAVOR:L:Mno_radius}
+MULTI_PACKAGES +=	-radius
+KAMAILIO_MODULES +=	avp_radius auth_radius group_radius uri_radius peering
+.endif
+.if !${FLAVOR:L:Mno_ldap}
+MULTI_PACKAGES +=	-ldap
+KAMAILIO_MODULES +=	ldap h350
+.endif
+.if !${FLAVOR:L:Mno_xmlrpc}
+MULTI_PACKAGES +=	-xmlrpc
+KAMAILIO_MODULES +=	mi_xmlrpc
+.endif
+.if !${FLAVOR:L:Mno_xcap_client}
+MULTI_PACKAGES +=	-xcap_client
+KAMAILIO_MODULES +=	xcap_client
+.endif
+.if !${FLAVOR:L:Mno_snmpstats}
+MULTI_PACKAGES +=	-snmpstats
+KAMAILIO_MODULES +=	snmpstats
+.endif
+.if !${FLAVOR:L:Mno_carrierroute}
+MULTI_PACKAGES +=	-carrierroute
+KAMAILIO_MODULES +=	carrierroute
+.endif
+.if !${FLAVOR:L:Mno_perl}
+MULTI_PACKAGES +=	-perl
+KAMAILIO_MODULES +=	perl perlvdb
+.endif
+
+MAKE_FLAGS =		TLS=1 LIBDIR="lib" cfg-prefix="${WRKINST}" cfg-target="/etc/kamailio/" include_modules="${KAMAILIO_MODULES}"
+FAKE_FLAGS =		PREFIX=${PREFIX}
+USE_GMAKE =		Yes
+CONFIGURE_STYLE =	none
+DESTDIRNAME=BASEDIR
+NO_REGRESS =		Yes
+
+post-patch:
+.for f in kamctl kamdbctl
+	@cp ${WRKDIST}/scripts/${f} ${WRKDIST}/scripts/${f}.bak
+	@sed -e '1s,^#!/bin/bash,#!/usr/local/bin/bash,' ${WRKDIST}/scripts/${f}.bak > ${WRKDIST}/scripts/${f}
+.endfor
+
+post-install:
+	mv ${WRKINST}${SYSCONFDIR}/kamailio ${WRKINST}${LOCALBASE}/share/examples
+.include <bsd.port.mk>
diff --git a/pkg/kamailio/openbsd/distinfo b/pkg/kamailio/openbsd/distinfo
new file mode 100644
index 0000000..74b177e
--- /dev/null
+++ b/pkg/kamailio/openbsd/distinfo
@@ -0,0 +1,5 @@
+MD5 (kamailio-1.5.0-tls_src.tar.gz) = 
+RMD160 (kamailio-1.5.0-tls_src.tar.gz) = 
+SHA1 (kamailio-1.5.0-tls_src.tar.gz) = 
+SHA256 (kamailio-1.5.0-tls_src.tar.gz) = 
+SIZE (kamailio-1.5.0-tls_src.tar.gz) = 
diff --git a/pkg/kamailio/openbsd/patches/patch-etc_kamailio_cfg b/pkg/kamailio/openbsd/patches/patch-etc_kamailio_cfg
new file mode 100644
index 0000000..e029aa4
--- /dev/null
+++ b/pkg/kamailio/openbsd/patches/patch-etc_kamailio_cfg
@@ -0,0 +1,13 @@
+$OpenBSD$
+--- etc/kamailio.cfg.orig	Thu Oct 23 19:32:11 2008
++++ etc/kamailio.cfg	Thu Oct 23 19:33:14 2008
+@@ -18,6 +18,9 @@ log_facility=LOG_LOCAL0
+ fork=yes
+ children=4
+ 
++user="_kamailio"
++group="_kamailio"
++
+ /* uncomment the following lines to enable debugging */
+ #debug=6
+ #fork=no
diff --git a/pkg/kamailio/openbsd/patches/patch-modules_perl_Makefile b/pkg/kamailio/openbsd/patches/patch-modules_perl_Makefile
new file mode 100644
index 0000000..a8cb64f
--- /dev/null
+++ b/pkg/kamailio/openbsd/patches/patch-modules_perl_Makefile
@@ -0,0 +1,15 @@
+$OpenBSD$
+--- modules/perl/Makefile.orig	Thu Oct 23 12:04:58 2008
++++ modules/perl/Makefile	Mon Nov  3 21:33:22 2008
+@@ -5,6 +5,11 @@
+ # 
+ # WARNING: do not run this directly, it should be run by the master Makefile
+ 
++# Force inclusion due to bug in gmake 3.81 on OpenBSD which causes the 
++# "export" command to fail when the variable name contains hyphens. (!)
++ifeq ($(OS),openbsd)
++	makefile_defs=0
++endif
+ include ../../Makefile.defs
+ auto_gen=
+ NAME=perl.so
diff --git a/pkg/kamailio/openbsd/patches/patch-scripts_kamctlrc b/pkg/kamailio/openbsd/patches/patch-scripts_kamctlrc
new file mode 100644
index 0000000..c61e9c1
--- /dev/null
+++ b/pkg/kamailio/openbsd/patches/patch-scripts_kamctlrc
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- scripts/kamctlrc.orig	Thu Oct 23 12:04:49 2008
++++ scripts/kamctlrc	Mon Nov  3 20:15:24 2008
+@@ -135,7 +135,7 @@
+ 
+ ## OPENSER START Options
+ ## PID file path - default is: /var/run/kamailio.pid
+-# PID_FILE=/var/run/kamailio.pid
++PID_FILE=/var/kamailio/kamailio.pid
+ 
+ ## Extra start options - default is: not set
+ # example: start Kamailio with 64MB share memory: STARTOPTIONS="-m 64"
diff --git a/pkg/kamailio/openbsd/pkg/COMMENT b/pkg/kamailio/openbsd/pkg/COMMENT
new file mode 100644
index 0000000..1d877c1
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/COMMENT
@@ -0,0 +1 @@
+Kamailio, very fast and configurable SIP proxy
diff --git a/pkg/kamailio/openbsd/pkg/DESCR b/pkg/kamailio/openbsd/pkg/DESCR
new file mode 100644
index 0000000..28b5a4e
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/DESCR
@@ -0,0 +1,18 @@
+Kamailio is a very fast and flexible SIP (RFC3261)
+proxy server. Written entirely in C, ser can handle thousands calls
+per second even on low-budget hardware. C Shell like scripting language
+provides full control over the server's behaviour. It's modular
+architecture allows only required functionality to be loaded.
+Currently the following modules are available: Digest Authentication,
+CPL scripts, Instant Messaging, MySQL support, UNIXODBC support,
+OSP support, Radius Authentication, Record Routing, SMS Gateway,
+Jabber Gateway, Transaction Module, Dialog Module, Registrar and
+User Location, SIMPLE Presence, Perl programming interface, SNMP.
+
+
+WWW: http://www.kamailio.org/
+
+- Bogdan-Andrei Iancu
+bogdan at voice-system.ro
+- Daniel-Constantin Mierla
+miconda at gmail.com
diff --git a/pkg/kamailio/openbsd/pkg/DESCR-berkeleydb b/pkg/kamailio/openbsd/pkg/DESCR-berkeleydb
new file mode 100644
index 0000000..7a88cab
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/DESCR-berkeleydb
@@ -0,0 +1 @@
+kamailio berkeley DB module
diff --git a/pkg/kamailio/openbsd/pkg/DESCR-carrierroute b/pkg/kamailio/openbsd/pkg/DESCR-carrierroute
new file mode 100644
index 0000000..e23d971
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/DESCR-carrierroute
@@ -0,0 +1 @@
+kamailio carrierroute module
diff --git a/pkg/kamailio/openbsd/pkg/DESCR-ldap b/pkg/kamailio/openbsd/pkg/DESCR-ldap
new file mode 100644
index 0000000..6746432
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/DESCR-ldap
@@ -0,0 +1 @@
+kamailio LDAP modules
diff --git a/pkg/kamailio/openbsd/pkg/DESCR-main b/pkg/kamailio/openbsd/pkg/DESCR-main
new file mode 100644
index 0000000..9e82766
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/DESCR-main
@@ -0,0 +1,7 @@
+KAMAILIO (OpenSER) is a mature and flexible open source SIP server (RFC3261).
+It can be used on systems with limitted resources as well as on carrier grade
+servers, scaling to up to thousands call setups per second. It is written in
+pure C for Unix/Linux-like systems with architecture specific optimizations to
+offer high performances. It is customizable, being able to feature as fast load
+balancer; SIP server flavours: registrar, location server, proxy server,
+redirect server; gateway to SMS/XMPP; or advanced VoIP application server.
diff --git a/pkg/kamailio/openbsd/pkg/DESCR-mysql b/pkg/kamailio/openbsd/pkg/DESCR-mysql
new file mode 100644
index 0000000..129e0d0
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/DESCR-mysql
@@ -0,0 +1 @@
+kamailio mysql module
diff --git a/pkg/kamailio/openbsd/pkg/DESCR-perl b/pkg/kamailio/openbsd/pkg/DESCR-perl
new file mode 100644
index 0000000..0da43d5
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/DESCR-perl
@@ -0,0 +1 @@
+kamailio perl modules
diff --git a/pkg/kamailio/openbsd/pkg/DESCR-postgresql b/pkg/kamailio/openbsd/pkg/DESCR-postgresql
new file mode 100644
index 0000000..463e6fe
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/DESCR-postgresql
@@ -0,0 +1 @@
+kamailio postgresql module
diff --git a/pkg/kamailio/openbsd/pkg/DESCR-radius b/pkg/kamailio/openbsd/pkg/DESCR-radius
new file mode 100644
index 0000000..82c4c61
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/DESCR-radius
@@ -0,0 +1 @@
+kamailio RADIUS modules
diff --git a/pkg/kamailio/openbsd/pkg/DESCR-snmpstats b/pkg/kamailio/openbsd/pkg/DESCR-snmpstats
new file mode 100644
index 0000000..ef05fe3
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/DESCR-snmpstats
@@ -0,0 +1 @@
+kamailio snmpstats module
diff --git a/pkg/kamailio/openbsd/pkg/DESCR-xcap_client b/pkg/kamailio/openbsd/pkg/DESCR-xcap_client
new file mode 100644
index 0000000..3244704
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/DESCR-xcap_client
@@ -0,0 +1 @@
+kamailio XCAP client module
diff --git a/pkg/kamailio/openbsd/pkg/DESCR-xmlrpc b/pkg/kamailio/openbsd/pkg/DESCR-xmlrpc
new file mode 100644
index 0000000..5a4caed
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/DESCR-xmlrpc
@@ -0,0 +1 @@
+kamailio XML-RPC module
diff --git a/pkg/kamailio/openbsd/pkg/PFRAG.shared-berkeleydb b/pkg/kamailio/openbsd/pkg/PFRAG.shared-berkeleydb
new file mode 100644
index 0000000..1edf730
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PFRAG.shared-berkeleydb
@@ -0,0 +1,2 @@
+ at comment $OpenBSD$
+lib/kamailio/modules/db_berkeley.so
diff --git a/pkg/kamailio/openbsd/pkg/PFRAG.shared-carrierroute b/pkg/kamailio/openbsd/pkg/PFRAG.shared-carrierroute
new file mode 100644
index 0000000..fcfb37c
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PFRAG.shared-carrierroute
@@ -0,0 +1,2 @@
+ at comment $OpenBSD$
+lib/kamailio/modules/carrierroute.so
diff --git a/pkg/kamailio/openbsd/pkg/PFRAG.shared-ldap b/pkg/kamailio/openbsd/pkg/PFRAG.shared-ldap
new file mode 100644
index 0000000..f5c0968
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PFRAG.shared-ldap
@@ -0,0 +1,3 @@
+ at comment $OpenBSD$
+lib/kamailio/modules/h350.so
+lib/kamailio/modules/ldap.so
diff --git a/pkg/kamailio/openbsd/pkg/PFRAG.shared-main b/pkg/kamailio/openbsd/pkg/PFRAG.shared-main
new file mode 100644
index 0000000..99345bf
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PFRAG.shared-main
@@ -0,0 +1,68 @@
+ at comment $OpenBSD$
+lib/kamailio/modules/acc.so
+lib/kamailio/modules/alias_db.so
+lib/kamailio/modules/auth.so
+lib/kamailio/modules/auth_db.so
+lib/kamailio/modules/auth_diameter.so
+lib/kamailio/modules/avpops.so
+lib/kamailio/modules/benchmark.so
+lib/kamailio/modules/cfgutils.so
+lib/kamailio/modules/cpl-c.so
+lib/kamailio/modules/db_flatstore.so
+lib/kamailio/modules/db_text.so
+lib/kamailio/modules/dialog.so
+lib/kamailio/modules/dialplan.so
+lib/kamailio/modules/dispatcher.so
+lib/kamailio/modules/diversion.so
+lib/kamailio/modules/domain.so
+lib/kamailio/modules/domainpolicy.so
+lib/kamailio/modules/enum.so
+lib/kamailio/modules/exec.so
+lib/kamailio/modules/gflags.so
+lib/kamailio/modules/group.so
+lib/kamailio/modules/imc.so
+lib/kamailio/modules/jabber.so
+lib/kamailio/modules/lcr.so
+lib/kamailio/modules/mangler.so
+lib/kamailio/modules/maxfwd.so
+lib/kamailio/modules/mediaproxy.so
+lib/kamailio/modules/mi_datagram.so
+lib/kamailio/modules/mi_fifo.so
+lib/kamailio/modules/msilo.so
+lib/kamailio/modules/nat_traversal.so
+lib/kamailio/modules/nathelper.so
+lib/kamailio/modules/options.so
+lib/kamailio/modules/path.so
+lib/kamailio/modules/pdt.so
+lib/kamailio/modules/permissions.so
+lib/kamailio/modules/pike.so
+lib/kamailio/modules/presence.so
+lib/kamailio/modules/presence_mwi.so
+lib/kamailio/modules/presence_xml.so
+lib/kamailio/modules/pua.so
+lib/kamailio/modules/pua_bla.so
+lib/kamailio/modules/pua_mi.so
+lib/kamailio/modules/pua_usrloc.so
+lib/kamailio/modules/pua_xmpp.so
+lib/kamailio/modules/ratelimit.so
+lib/kamailio/modules/registrar.so
+lib/kamailio/modules/rls.so
+lib/kamailio/modules/rr.so
+lib/kamailio/modules/seas.so
+lib/kamailio/modules/siptrace.so
+lib/kamailio/modules/sl.so
+lib/kamailio/modules/sms.so
+lib/kamailio/modules/speeddial.so
+lib/kamailio/modules/sst.so
+lib/kamailio/modules/statistics.so
+lib/kamailio/modules/textops.so
+lib/kamailio/modules/tlsops.so
+lib/kamailio/modules/tm.so
+lib/kamailio/modules/uac.so
+lib/kamailio/modules/uac_redirect.so
+lib/kamailio/modules/uri.so
+lib/kamailio/modules/uri_db.so
+lib/kamailio/modules/userblacklist.so
+lib/kamailio/modules/usrloc.so
+lib/kamailio/modules/xlog.so
+lib/kamailio/modules/xmpp.so
diff --git a/pkg/kamailio/openbsd/pkg/PFRAG.shared-mysql b/pkg/kamailio/openbsd/pkg/PFRAG.shared-mysql
new file mode 100644
index 0000000..6d8b175
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PFRAG.shared-mysql
@@ -0,0 +1,2 @@
+ at comment $OpenBSD$
+lib/kamailio/modules/db_mysql.so
diff --git a/pkg/kamailio/openbsd/pkg/PFRAG.shared-perl b/pkg/kamailio/openbsd/pkg/PFRAG.shared-perl
new file mode 100644
index 0000000..8c57e4f
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PFRAG.shared-perl
@@ -0,0 +1,3 @@
+ at comment $OpenBSD$
+lib/kamailio/modules/perl.so
+lib/kamailio/modules/perlvdb.so
diff --git a/pkg/kamailio/openbsd/pkg/PFRAG.shared-postgresql b/pkg/kamailio/openbsd/pkg/PFRAG.shared-postgresql
new file mode 100644
index 0000000..bd8c414
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PFRAG.shared-postgresql
@@ -0,0 +1,2 @@
+ at comment $OpenBSD$
+lib/kamailio/modules/db_postgres.so
diff --git a/pkg/kamailio/openbsd/pkg/PFRAG.shared-radius b/pkg/kamailio/openbsd/pkg/PFRAG.shared-radius
new file mode 100644
index 0000000..8a6b266
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PFRAG.shared-radius
@@ -0,0 +1,6 @@
+ at comment $OpenBSD$
+lib/kamailio/modules/auth_radius.so
+lib/kamailio/modules/avp_radius.so
+lib/kamailio/modules/group_radius.so
+lib/kamailio/modules/peering.so
+lib/kamailio/modules/uri_radius.so
diff --git a/pkg/kamailio/openbsd/pkg/PFRAG.shared-snmpstats b/pkg/kamailio/openbsd/pkg/PFRAG.shared-snmpstats
new file mode 100644
index 0000000..418ff26
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PFRAG.shared-snmpstats
@@ -0,0 +1,2 @@
+ at comment $OpenBSD$
+lib/kamailio/modules/snmpstats.so
diff --git a/pkg/kamailio/openbsd/pkg/PFRAG.shared-xcap_client b/pkg/kamailio/openbsd/pkg/PFRAG.shared-xcap_client
new file mode 100644
index 0000000..f6ff6ab
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PFRAG.shared-xcap_client
@@ -0,0 +1,2 @@
+ at comment $OpenBSD$
+lib/kamailio/modules/xcap_client.so
diff --git a/pkg/kamailio/openbsd/pkg/PFRAG.shared-xmlrpc b/pkg/kamailio/openbsd/pkg/PFRAG.shared-xmlrpc
new file mode 100644
index 0000000..d73582b
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PFRAG.shared-xmlrpc
@@ -0,0 +1,2 @@
+ at comment $OpenBSD$
+lib/kamailio/modules/mi_xmlrpc.so
diff --git a/pkg/kamailio/openbsd/pkg/PLIST b/pkg/kamailio/openbsd/pkg/PLIST
new file mode 100644
index 0000000..f08ff47
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PLIST
@@ -0,0 +1,120 @@
+etc/kamailio/kamailio.cfg
+etc/kamailio/kamctl
+sbin/kamailio
+sbin/kamctl
+sbin/kamailio_mysql.sh
+lib/kamailio/modules/acc.so
+lib/kamailio/modules/alias_db.so
+lib/kamailio/modules/auth.so
+lib/kamailio/modules/auth_db.so
+lib/kamailio/modules/auth_diameter.so
+lib/kamailio/modules/avpops.so
+lib/kamailio/modules/dbtext.so
+lib/kamailio/modules/dialog.so
+lib/kamailio/modules/dispatcher.so
+lib/kamailio/modules/diversion.so
+lib/kamailio/modules/domain.so
+lib/kamailio/modules/domainpolicy.so
+lib/kamailio/modules/enum.so
+lib/kamailio/modules/exec.so
+lib/kamailio/modules/flatstore.so
+lib/kamailio/modules/gflags.so
+lib/kamailio/modules/group.so
+lib/kamailio/modules/jabber.so
+lib/kamailio/modules/lcr.so
+lib/kamailio/modules/mangler.so
+lib/kamailio/modules/maxfwd.so
+lib/kamailio/modules/mediaproxy.so
+lib/kamailio/modules/mi_fifo.so
+lib/kamailio/modules/msilo.so
+lib/kamailio/modules/mysql.so
+lib/kamailio/modules/nathelper.so
+lib/kamailio/modules/options.so
+lib/kamailio/modules/pa.so
+lib/kamailio/modules/path.so
+lib/kamailio/modules/pdt.so
+lib/kamailio/modules/permissions.so
+lib/kamailio/modules/pike.so
+lib/kamailio/modules/registrar.so
+lib/kamailio/modules/rr.so
+lib/kamailio/modules/seas.so
+lib/kamailio/modules/siptrace.so
+lib/kamailio/modules/sl.so
+lib/kamailio/modules/sms.so
+lib/kamailio/modules/speeddial.so
+lib/kamailio/modules/sst.so
+lib/kamailio/modules/statistics.so
+lib/kamailio/modules/textops.so
+lib/kamailio/modules/tm.so
+lib/kamailio/modules/uac.so
+lib/kamailio/modules/uac_redirect.so
+lib/kamailio/modules/uri.so
+lib/kamailio/modules/uri_db.so
+lib/kamailio/modules/usrloc.so
+lib/kamailio/modules/xlog.so
+lib/kamailio/modules/xmpp.so
+lib/kamctl/kamctl.base
+lib/kamctl/kamctl.sqlbase
+lib/kamctl/kamctl.ctlbase
+lib/kamctl/kamctl.fifo
+lib/kamctl/kamctl.unixsock
+lib/kamctl/kamctl.mysql
+share/doc/kamailio/README
+share/doc/kamailio/INSTALL
+share/doc/kamailio/README-MODULES
+share/doc/kamailio/AUTHORS
+share/doc/kamailio/NEWS
+share/doc/kamailio/README.acc
+share/doc/kamailio/README.alias_db
+share/doc/kamailio/README.auth
+share/doc/kamailio/README.auth_db
+share/doc/kamailio/README.auth_diameter
+share/doc/kamailio/README.avpops
+share/doc/kamailio/README.dbtext
+share/doc/kamailio/README.dialog
+share/doc/kamailio/README.dispatcher
+share/doc/kamailio/README.diversion
+share/doc/kamailio/README.domain
+share/doc/kamailio/README.domainpolicy
+share/doc/kamailio/README.enum
+share/doc/kamailio/README.exec
+share/doc/kamailio/README.flatstore
+share/doc/kamailio/README.gflags
+share/doc/kamailio/README.group
+share/doc/kamailio/README.jabber
+share/doc/kamailio/README.lcr
+share/doc/kamailio/README.mangler
+share/doc/kamailio/README.maxfwd
+share/doc/kamailio/README.mediaproxy
+share/doc/kamailio/README.mi_fifo
+share/doc/kamailio/README.msilo
+share/doc/kamailio/README.mysql
+share/doc/kamailio/README.nathelper
+share/doc/kamailio/README.options
+share/doc/kamailio/README.pa
+share/doc/kamailio/README.path
+share/doc/kamailio/README.pdt
+share/doc/kamailio/README.permissions
+share/doc/kamailio/README.pike
+share/doc/kamailio/README.registrar
+share/doc/kamailio/README.rr
+share/doc/kamailio/README.seas
+share/doc/kamailio/README.siptrace
+share/doc/kamailio/README.sl
+share/doc/kamailio/README.sms
+share/doc/kamailio/README.speeddial
+share/doc/kamailio/README.statistics
+share/doc/kamailio/README.sst
+share/doc/kamailio/README.textops
+share/doc/kamailio/README.tm
+share/doc/kamailio/README.uac
+share/doc/kamailio/README.uac_redirect
+share/doc/kamailio/README.uri
+share/doc/kamailio/README.uri_db
+share/doc/kamailio/README.usrloc
+share/doc/kamailio/README.xlog
+share/doc/kamailio/README.xmpp
+ at dirrm share/doc/kamailio
+ at dirrm etc/kamailio
+ at dirrm lib/kamailio/modules
+ at dirrm lib/kamailio
diff --git a/pkg/kamailio/openbsd/pkg/PLIST-berkeleydb b/pkg/kamailio/openbsd/pkg/PLIST-berkeleydb
new file mode 100644
index 0000000..e74c459
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PLIST-berkeleydb
@@ -0,0 +1,47 @@
+ at comment $OpenBSD$
+%%SHARED%%
+lib/kamailio/kamctl/kamctl.db_berkeley
+lib/kamailio/kamctl/kamdbctl.db_berkeley
+ at bin sbin/kambdb_recover
+share/doc/kamailio/README.db_berkeley
+share/kamailio/db_berkeley/
+share/kamailio/db_berkeley/kamailio/
+share/kamailio/db_berkeley/kamailio/acc
+share/kamailio/db_berkeley/kamailio/active_watchers
+share/kamailio/db_berkeley/kamailio/address
+share/kamailio/db_berkeley/kamailio/aliases
+share/kamailio/db_berkeley/kamailio/carrierfailureroute
+share/kamailio/db_berkeley/kamailio/carrierroute
+share/kamailio/db_berkeley/kamailio/cpl
+share/kamailio/db_berkeley/kamailio/dbaliases
+share/kamailio/db_berkeley/kamailio/dialog
+share/kamailio/db_berkeley/kamailio/dialplan
+share/kamailio/db_berkeley/kamailio/dispatcher
+share/kamailio/db_berkeley/kamailio/domain
+share/kamailio/db_berkeley/kamailio/domainpolicy
+share/kamailio/db_berkeley/kamailio/globalblacklist
+share/kamailio/db_berkeley/kamailio/grp
+share/kamailio/db_berkeley/kamailio/gw
+share/kamailio/db_berkeley/kamailio/imc_members
+share/kamailio/db_berkeley/kamailio/imc_rooms
+share/kamailio/db_berkeley/kamailio/lcr
+share/kamailio/db_berkeley/kamailio/location
+share/kamailio/db_berkeley/kamailio/missed_calls
+share/kamailio/db_berkeley/kamailio/pdt
+share/kamailio/db_berkeley/kamailio/presentity
+share/kamailio/db_berkeley/kamailio/pua
+share/kamailio/db_berkeley/kamailio/re_grp
+share/kamailio/db_berkeley/kamailio/rls_presentity
+share/kamailio/db_berkeley/kamailio/rls_watchers
+share/kamailio/db_berkeley/kamailio/route_tree
+share/kamailio/db_berkeley/kamailio/silo
+share/kamailio/db_berkeley/kamailio/sip_trace
+share/kamailio/db_berkeley/kamailio/speed_dial
+share/kamailio/db_berkeley/kamailio/subscriber
+share/kamailio/db_berkeley/kamailio/trusted
+share/kamailio/db_berkeley/kamailio/uri
+share/kamailio/db_berkeley/kamailio/userblacklist
+share/kamailio/db_berkeley/kamailio/usr_preferences
+share/kamailio/db_berkeley/kamailio/version
+share/kamailio/db_berkeley/kamailio/watchers
+share/kamailio/db_berkeley/kamailio/xcap
diff --git a/pkg/kamailio/openbsd/pkg/PLIST-carrierroute b/pkg/kamailio/openbsd/pkg/PLIST-carrierroute
new file mode 100644
index 0000000..17958b1
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PLIST-carrierroute
@@ -0,0 +1,3 @@
+ at comment $OpenBSD$
+%%SHARED%%
+share/doc/kamailio/README.carrierroute
diff --git a/pkg/kamailio/openbsd/pkg/PLIST-ldap b/pkg/kamailio/openbsd/pkg/PLIST-ldap
new file mode 100644
index 0000000..e3bfcfa
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PLIST-ldap
@@ -0,0 +1,4 @@
+ at comment $OpenBSD$
+%%SHARED%%
+share/doc/kamailio/README.h350
+share/doc/kamailio/README.ldap
diff --git a/pkg/kamailio/openbsd/pkg/PLIST-main b/pkg/kamailio/openbsd/pkg/PLIST-main
new file mode 100644
index 0000000..82894b8
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PLIST-main
@@ -0,0 +1,186 @@
+ at comment $OpenBSD$
+ at newgroup _kamailio:610
+ at newuser _kamailio:610:610:daemon:Kamailio:/nonexistent:/sbin/nologin
+%%SHARED%%
+lib/kamailio/
+lib/kamailio/kamctl/
+lib/kamailio/kamctl/dbtextdb/
+lib/kamailio/kamctl/dbtextdb/dbtextdb.py
+lib/kamailio/kamctl/kamctl.base
+lib/kamailio/kamctl/kamctl.ctlbase
+lib/kamailio/kamctl/kamctl.dbtext
+lib/kamailio/kamctl/kamctl.fifo
+lib/kamailio/kamctl/kamctl.sqlbase
+lib/kamailio/kamctl/kamctl.unixsock
+lib/kamailio/kamctl/kamdbctl.base
+lib/kamailio/kamctl/kamdbctl.dbtext
+lib/kamailio/modules/
+ at man man/man5/kamailio.cfg.5
+ at man man/man8/kamailio.8
+ at man man/man8/kamctl.8
+ at man man/man8/kamunix.8
+ at bin sbin/kamailio
+sbin/kamctl
+sbin/kamdbctl
+ at bin sbin/kamunix
+share/doc/kamailio/
+share/doc/kamailio/AUTHORS
+share/doc/kamailio/INSTALL
+share/doc/kamailio/NEWS
+share/doc/kamailio/README
+share/doc/kamailio/README-MODULES
+share/doc/kamailio/README.acc
+share/doc/kamailio/README.alias_db
+share/doc/kamailio/README.auth
+share/doc/kamailio/README.auth_db
+share/doc/kamailio/README.auth_diameter
+share/doc/kamailio/README.avpops
+share/doc/kamailio/README.benchmark
+share/doc/kamailio/README.cfgutils
+share/doc/kamailio/README.cpl-c
+share/doc/kamailio/README.db_flatstore
+share/doc/kamailio/README.db_text
+share/doc/kamailio/README.dialog
+share/doc/kamailio/README.dialplan
+share/doc/kamailio/README.dispatcher
+share/doc/kamailio/README.diversion
+share/doc/kamailio/README.domain
+share/doc/kamailio/README.domainpolicy
+share/doc/kamailio/README.enum
+share/doc/kamailio/README.exec
+share/doc/kamailio/README.gflags
+share/doc/kamailio/README.group
+share/doc/kamailio/README.imc
+share/doc/kamailio/README.jabber
+share/doc/kamailio/README.lcr
+share/doc/kamailio/README.mangler
+share/doc/kamailio/README.maxfwd
+share/doc/kamailio/README.mediaproxy
+share/doc/kamailio/README.mi_datagram
+share/doc/kamailio/README.mi_fifo
+share/doc/kamailio/README.msilo
+share/doc/kamailio/README.nat_traversal
+share/doc/kamailio/README.nathelper
+share/doc/kamailio/README.options
+share/doc/kamailio/README.path
+share/doc/kamailio/README.pdt
+share/doc/kamailio/README.permissions
+share/doc/kamailio/README.pike
+share/doc/kamailio/README.presence
+share/doc/kamailio/README.presence_mwi
+share/doc/kamailio/README.presence_xml
+share/doc/kamailio/README.pua
+share/doc/kamailio/README.pua_bla
+share/doc/kamailio/README.pua_mi
+share/doc/kamailio/README.pua_usrloc
+share/doc/kamailio/README.pua_xmpp
+share/doc/kamailio/README.ratelimit
+share/doc/kamailio/README.registrar
+share/doc/kamailio/README.rls
+share/doc/kamailio/README.rr
+share/doc/kamailio/README.seas
+share/doc/kamailio/README.siptrace
+share/doc/kamailio/README.sl
+share/doc/kamailio/README.sms
+share/doc/kamailio/README.speeddial
+share/doc/kamailio/README.sst
+share/doc/kamailio/README.statistics
+share/doc/kamailio/README.textops
+share/doc/kamailio/README.tlsops
+share/doc/kamailio/README.tm
+share/doc/kamailio/README.uac
+share/doc/kamailio/README.uac_redirect
+share/doc/kamailio/README.uri
+share/doc/kamailio/README.uri_db
+share/doc/kamailio/README.userblacklist
+share/doc/kamailio/README.usrloc
+share/doc/kamailio/README.xlog
+share/doc/kamailio/README.xmpp
+share/examples/kamailio/
+ at sample ${SYSCONFDIR}/kamailio/
+share/examples/kamailio/kamailio.cfg
+ at sample ${SYSCONFDIR}/kamailio/kamailio.cfg
+share/examples/kamailio/kamctlrc
+ at sample ${SYSCONFDIR}/kamailio/kamctlrc
+share/examples/kamailio/tls/
+ at sample ${SYSCONFDIR}/kamailio/tls/
+share/examples/kamailio/tls/README
+ at sample ${SYSCONFDIR}/kamailio/tls/README
+share/examples/kamailio/tls/ca.conf
+ at sample ${SYSCONFDIR}/kamailio/tls/ca.conf
+share/examples/kamailio/tls/request.conf
+ at sample ${SYSCONFDIR}/kamailio/tls/request.conf
+share/examples/kamailio/tls/rootCA/
+ at sample ${SYSCONFDIR}/kamailio/tls/rootCA/
+share/examples/kamailio/tls/rootCA/cacert.pem
+ at sample ${SYSCONFDIR}/kamailio/tls/rootCA/cacert.pem
+share/examples/kamailio/tls/rootCA/certs/
+ at sample ${SYSCONFDIR}/kamailio/tls/rootCA/certs/
+share/examples/kamailio/tls/rootCA/certs/01.pem
+ at sample ${SYSCONFDIR}/kamailio/tls/rootCA/certs/01.pem
+share/examples/kamailio/tls/rootCA/index.txt
+ at sample ${SYSCONFDIR}/kamailio/tls/rootCA/index.txt
+share/examples/kamailio/tls/rootCA/private/
+ at sample ${SYSCONFDIR}/kamailio/tls/rootCA/private/
+share/examples/kamailio/tls/rootCA/private/cakey.pem
+ at sample ${SYSCONFDIR}/kamailio/tls/rootCA/private/cakey.pem
+share/examples/kamailio/tls/rootCA/serial
+ at sample ${SYSCONFDIR}/kamailio/tls/rootCA/serial
+share/examples/kamailio/tls/user/
+ at sample ${SYSCONFDIR}/kamailio/tls/user/
+share/examples/kamailio/tls/user.conf
+ at sample ${SYSCONFDIR}/kamailio/tls/user.conf
+share/examples/kamailio/tls/user/user-calist.pem
+ at sample ${SYSCONFDIR}/kamailio/tls/user/user-calist.pem
+share/examples/kamailio/tls/user/user-cert.pem
+ at sample ${SYSCONFDIR}/kamailio/tls/user/user-cert.pem
+share/examples/kamailio/tls/user/user-cert_req.pem
+ at sample ${SYSCONFDIR}/kamailio/tls/user/user-cert_req.pem
+share/examples/kamailio/tls/user/user-privkey.pem
+ at sample ${SYSCONFDIR}/kamailio/tls/user/user-privkey.pem
+share/kamailio/
+share/kamailio/dbtext/
+share/kamailio/dbtext/kamailio/
+share/kamailio/dbtext/kamailio/acc
+share/kamailio/dbtext/kamailio/active_watchers
+share/kamailio/dbtext/kamailio/address
+share/kamailio/dbtext/kamailio/aliases
+share/kamailio/dbtext/kamailio/carrierfailureroute
+share/kamailio/dbtext/kamailio/carrierroute
+share/kamailio/dbtext/kamailio/cpl
+share/kamailio/dbtext/kamailio/dbaliases
+share/kamailio/dbtext/kamailio/dialog
+share/kamailio/dbtext/kamailio/dialplan
+share/kamailio/dbtext/kamailio/dispatcher
+share/kamailio/dbtext/kamailio/domain
+share/kamailio/dbtext/kamailio/domainpolicy
+share/kamailio/dbtext/kamailio/globalblacklist
+share/kamailio/dbtext/kamailio/grp
+share/kamailio/dbtext/kamailio/gw
+share/kamailio/dbtext/kamailio/imc_members
+share/kamailio/dbtext/kamailio/imc_rooms
+share/kamailio/dbtext/kamailio/lcr
+share/kamailio/dbtext/kamailio/location
+share/kamailio/dbtext/kamailio/missed_calls
+share/kamailio/dbtext/kamailio/pdt
+share/kamailio/dbtext/kamailio/presentity
+share/kamailio/dbtext/kamailio/pua
+share/kamailio/dbtext/kamailio/re_grp
+share/kamailio/dbtext/kamailio/rls_presentity
+share/kamailio/dbtext/kamailio/rls_watchers
+share/kamailio/dbtext/kamailio/route_tree
+share/kamailio/dbtext/kamailio/silo
+share/kamailio/dbtext/kamailio/sip_trace
+share/kamailio/dbtext/kamailio/speed_dial
+share/kamailio/dbtext/kamailio/subscriber
+share/kamailio/dbtext/kamailio/trusted
+share/kamailio/dbtext/kamailio/uri
+share/kamailio/dbtext/kamailio/userblacklist
+share/kamailio/dbtext/kamailio/usr_preferences
+share/kamailio/dbtext/kamailio/version
+share/kamailio/dbtext/kamailio/watchers
+share/kamailio/dbtext/kamailio/xcap
+ at mode 700
+ at owner _kamailio
+ at sample /var/kamailio/
+ at extraunexec rm -rf /var/kamailio/
diff --git a/pkg/kamailio/openbsd/pkg/PLIST-mysql b/pkg/kamailio/openbsd/pkg/PLIST-mysql
new file mode 100644
index 0000000..bea158e
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PLIST-mysql
@@ -0,0 +1,32 @@
+ at comment $OpenBSD$
+%%SHARED%%
+lib/kamailio/kamctl/kamctl.mysql
+lib/kamailio/kamctl/kamdbctl.mysql
+share/doc/kamailio/README.db_mysql
+share/kamailio/mysql/
+share/kamailio/mysql/acc-create.sql
+share/kamailio/mysql/alias_db-create.sql
+share/kamailio/mysql/auth_db-create.sql
+share/kamailio/mysql/avpops-create.sql
+share/kamailio/mysql/carrierroute-create.sql
+share/kamailio/mysql/cpl-create.sql
+share/kamailio/mysql/dialog-create.sql
+share/kamailio/mysql/dialplan-create.sql
+share/kamailio/mysql/dispatcher-create.sql
+share/kamailio/mysql/domain-create.sql
+share/kamailio/mysql/domainpolicy-create.sql
+share/kamailio/mysql/group-create.sql
+share/kamailio/mysql/imc-create.sql
+share/kamailio/mysql/lcr-create.sql
+share/kamailio/mysql/msilo-create.sql
+share/kamailio/mysql/pdt-create.sql
+share/kamailio/mysql/permissions-create.sql
+share/kamailio/mysql/presence-create.sql
+share/kamailio/mysql/registrar-create.sql
+share/kamailio/mysql/rls-create.sql
+share/kamailio/mysql/siptrace-create.sql
+share/kamailio/mysql/speeddial-create.sql
+share/kamailio/mysql/standard-create.sql
+share/kamailio/mysql/uri_db-create.sql
+share/kamailio/mysql/userblacklist-create.sql
+share/kamailio/mysql/usrloc-create.sql
diff --git a/pkg/kamailio/openbsd/pkg/PLIST-perl b/pkg/kamailio/openbsd/pkg/PLIST-perl
new file mode 100644
index 0000000..82386cc
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PLIST-perl
@@ -0,0 +1,30 @@
+ at comment $OpenBSD$
+%%SHARED%%
+lib/kamailio/perl/
+lib/kamailio/perl/OpenSER/
+lib/kamailio/perl/OpenSER.pm
+lib/kamailio/perl/OpenSER/Constants.pm
+lib/kamailio/perl/OpenSER/LDAPUtils/
+lib/kamailio/perl/OpenSER/LDAPUtils/LDAPConf.pm
+lib/kamailio/perl/OpenSER/LDAPUtils/LDAPConnection.pm
+lib/kamailio/perl/OpenSER/Message.pm
+lib/kamailio/perl/OpenSER/Utils/
+lib/kamailio/perl/OpenSER/Utils/Debug.pm
+lib/kamailio/perl/OpenSER/Utils/PhoneNumbers.pm
+lib/kamailio/perl/OpenSER/VDB/
+lib/kamailio/perl/OpenSER/VDB.pm
+lib/kamailio/perl/OpenSER/VDB/Adapter/
+lib/kamailio/perl/OpenSER/VDB/Adapter/AccountingSIPtrace.pm
+lib/kamailio/perl/OpenSER/VDB/Adapter/Alias.pm
+lib/kamailio/perl/OpenSER/VDB/Adapter/Auth.pm
+lib/kamailio/perl/OpenSER/VDB/Adapter/Describe.pm
+lib/kamailio/perl/OpenSER/VDB/Adapter/Speeddial.pm
+lib/kamailio/perl/OpenSER/VDB/Adapter/TableVersions.pm
+lib/kamailio/perl/OpenSER/VDB/Column.pm
+lib/kamailio/perl/OpenSER/VDB/Pair.pm
+lib/kamailio/perl/OpenSER/VDB/ReqCond.pm
+lib/kamailio/perl/OpenSER/VDB/Result.pm
+lib/kamailio/perl/OpenSER/VDB/VTab.pm
+lib/kamailio/perl/OpenSER/VDB/Value.pm
+share/doc/kamailio/README.perl
+share/doc/kamailio/README.perlvdb
diff --git a/pkg/kamailio/openbsd/pkg/PLIST-postgresql b/pkg/kamailio/openbsd/pkg/PLIST-postgresql
new file mode 100644
index 0000000..b1b432e
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PLIST-postgresql
@@ -0,0 +1,32 @@
+ at comment $OpenBSD$
+%%SHARED%%
+lib/kamailio/kamctl/kamctl.pgsql
+lib/kamailio/kamctl/kamdbctl.pgsql
+share/doc/kamailio/README.db_postgres
+share/kamailio/postgres/
+share/kamailio/postgres/acc-create.sql
+share/kamailio/postgres/alias_db-create.sql
+share/kamailio/postgres/auth_db-create.sql
+share/kamailio/postgres/avpops-create.sql
+share/kamailio/postgres/carrierroute-create.sql
+share/kamailio/postgres/cpl-create.sql
+share/kamailio/postgres/dialog-create.sql
+share/kamailio/postgres/dialplan-create.sql
+share/kamailio/postgres/dispatcher-create.sql
+share/kamailio/postgres/domain-create.sql
+share/kamailio/postgres/domainpolicy-create.sql
+share/kamailio/postgres/group-create.sql
+share/kamailio/postgres/imc-create.sql
+share/kamailio/postgres/lcr-create.sql
+share/kamailio/postgres/msilo-create.sql
+share/kamailio/postgres/pdt-create.sql
+share/kamailio/postgres/permissions-create.sql
+share/kamailio/postgres/presence-create.sql
+share/kamailio/postgres/registrar-create.sql
+share/kamailio/postgres/rls-create.sql
+share/kamailio/postgres/siptrace-create.sql
+share/kamailio/postgres/speeddial-create.sql
+share/kamailio/postgres/standard-create.sql
+share/kamailio/postgres/uri_db-create.sql
+share/kamailio/postgres/userblacklist-create.sql
+share/kamailio/postgres/usrloc-create.sql
diff --git a/pkg/kamailio/openbsd/pkg/PLIST-radius b/pkg/kamailio/openbsd/pkg/PLIST-radius
new file mode 100644
index 0000000..237e91d
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PLIST-radius
@@ -0,0 +1,8 @@
+ at comment $OpenBSD$
+%%SHARED%%
+share/doc/kamailio/README.auth_radius
+share/doc/kamailio/README.avp_radius
+share/doc/kamailio/README.group_radius
+share/doc/kamailio/README.peering
+share/doc/kamailio/README.uri_radius
+share/examples/kamailio/dictionary.radius
diff --git a/pkg/kamailio/openbsd/pkg/PLIST-snmpstats b/pkg/kamailio/openbsd/pkg/PLIST-snmpstats
new file mode 100644
index 0000000..b2f0779
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PLIST-snmpstats
@@ -0,0 +1,10 @@
+ at comment $OpenBSD$
+%%SHARED%%
+share/doc/kamailio/README.snmpstats
+share/snmp/
+share/snmp/mibs/
+share/snmp/mibs/OPENSER-MIB
+share/snmp/mibs/OPENSER-REG-MIB
+share/snmp/mibs/OPENSER-SIP-COMMON-MIB
+share/snmp/mibs/OPENSER-SIP-SERVER-MIB
+share/snmp/mibs/OPENSER-TC
diff --git a/pkg/kamailio/openbsd/pkg/PLIST-xcap_client b/pkg/kamailio/openbsd/pkg/PLIST-xcap_client
new file mode 100644
index 0000000..e20a9fb
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PLIST-xcap_client
@@ -0,0 +1,3 @@
+ at comment $OpenBSD$
+%%SHARED%%
+share/doc/kamailio/README.xcap_client
diff --git a/pkg/kamailio/openbsd/pkg/PLIST-xmlrpc b/pkg/kamailio/openbsd/pkg/PLIST-xmlrpc
new file mode 100644
index 0000000..94853a1
--- /dev/null
+++ b/pkg/kamailio/openbsd/pkg/PLIST-xmlrpc
@@ -0,0 +1,3 @@
+ at comment $OpenBSD$
+%%SHARED%%
+share/doc/kamailio/README.mi_xmlrpc
diff --git a/pkg/kamailio/rpm/kamailio.default b/pkg/kamailio/rpm/kamailio.default
new file mode 100644
index 0000000..90e6ca7
--- /dev/null
+++ b/pkg/kamailio/rpm/kamailio.default
@@ -0,0 +1,30 @@
+#
+# Kamailio startup options
+#
+
+# Set to yes to enable kamailio, once configured properly.
+RUN_KAMAILIO=yes
+
+# User to run as
+USER=kamailio
+
+# Group to run as
+GROUP=kamailio
+
+# Amount of shared memory to allocate for the running Kamailio server (in Mb)
+SHM_MEMORY=64
+
+# Amount of private memory to allocate for the running Kamailio server (in Mb)
+PKG_MEMORY=4
+
+# Enable the server to leave a core file when it crashes.
+# Set this to 'yes' to enable kamailio to leave a core file when it crashes
+# or 'no' to disable this feature. This option is case sensitive and only
+# accepts 'yes' and 'no' and only in lowercase letters.
+# On some systems (e.g. Ubuntu 6.10, Debian 4.0) it is necessary to specify
+# a directory for the core files to get a dump. Look into the kamailio
+# init file for an example configuration.
+DUMP_CORE=no
+
+# Add extra command line parameters in the EXTRA_OPTIONS variable
+# EXTRA_OPTIONS="-a no"
diff --git a/pkg/kamailio/rpm/kamailio.init b/pkg/kamailio/rpm/kamailio.init
new file mode 100644
index 0000000..cf76929
--- /dev/null
+++ b/pkg/kamailio/rpm/kamailio.init
@@ -0,0 +1,128 @@
+#!/bin/bash
+#
+# Startup script for Kamailio
+#
+# chkconfig: 345 85 15
+# description: Kamailio is a fast SIP Server.
+#
+# processname: kamailio
+# pidfile: /var/run/kamailio.pid
+# config: /etc/kamailio/kamailio.cfg
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+KAM=/usr/sbin/kamailio
+KAMCFG=/etc/kamailio/kamailio.cfg
+PROG=kamailio
+PID_FILE=/var/run/kamailio.pid
+LOCK_FILE=/var/lock/subsys/kamailio
+RETVAL=0
+DEFAULTS=/etc/default/kamailio
+RUN_KAMAILIO=no
+
+
+# Do not start kamailio if fork=no is set in the config file
+# otherwise the boot process will just stop
+check_fork ()
+{
+    if grep -q "^[[:space:]]*fork[[:space:]]*=[[:space:]]*no.*" $KAMCFG; then
+        echo "Not starting $DESC: fork=no specified in config file; run /etc/init.d/kamailio debug instead"
+        exit 1
+    fi
+}
+
+check_kamailio_config ()
+{
+        # Check if kamailio configuration is valid before starting the server
+        out=$($KAM -M $PKG_MEMORY -c 2>&1 > /dev/null)
+        retcode=$?
+        if [ "$retcode" != '0' ]; then
+            echo "Not starting $DESC: invalid configuration file!"
+            echo -e "\n$out\n"
+            exit 1
+        fi
+}
+
+
+start() {
+	check_kamailio_config
+        if [ "$1" != "debug" ]; then
+            check_fork
+        fi
+	echo -n $"Starting $PROG: "
+	daemon $KAM $OPTIONS >/dev/null 2>/dev/null
+	RETVAL=$?
+	echo
+	[ $RETVAL = 0 ] && touch $LOCK_FILE && success
+	return $RETVAL
+}
+
+stop() {
+	echo -n $"Stopping $PROG: "
+	killproc $KAM
+	RETVAL=$?
+	echo
+	[ $RETVAL = 0 ] && rm -f $LOCK_FILE $PID_FILE
+}
+
+# Load startup options if available
+if [ -f $DEFAULTS ]; then
+   . $DEFAULTS || true
+fi
+
+if [ "$RUN_KAMAILIO" != "yes" ]; then
+    echo "Kamailio not yet configured. Edit /etc/default/kamailio first."
+    exit 0
+fi
+
+
+SHM_MEMORY=$((`echo $SHM_MEMORY | sed -e 's/[^0-9]//g'`))
+PKG_MEMORY=$((`echo $PKG_MEMORY | sed -e 's/[^0-9]//g'`))
+[ -z "$USER" ]  && USER=kamailio
+[ -z "$GROUP" ] && GROUP=kamailio
+[ $SHM_MEMORY -le 0 ] && SHM_MEMORY=32
+[ $PKG_MEMORY -le 0 ] && PKG_MEMORY=4
+
+if test "$DUMP_CORE" = "yes" ; then
+    # set proper ulimit
+    ulimit -c unlimited
+
+    # directory for the core dump files
+    # COREDIR=/home/corefiles
+    # [ -d $COREDIR ] || mkdir $COREDIR
+    # chmod 777 $COREDIR
+    # echo "$COREDIR/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
+fi
+
+OPTIONS="-P $PID_FILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP $EXTRA_OPTIONS"
+
+
+# See how we were called.
+case "$1" in
+	start|debug)
+		start
+		;;
+	stop)
+		stop
+		;;
+	status)
+		status $KAM
+		RETVAL=$?
+		;;
+	restart)
+		stop
+		start
+		;;
+	condrestart)
+		if [ -f $PID_FILE ] ; then
+			stop
+			start
+		fi
+		;;
+	*)
+		echo $"Usage: $PROG {start|stop|restart|condrestart|status|debug|help}"
+		exit 1
+esac
+
+exit $RETVAL
diff --git a/pkg/kamailio/rpm/kamailio.init.SuSE b/pkg/kamailio/rpm/kamailio.init.SuSE
new file mode 100644
index 0000000..ac0f655
--- /dev/null
+++ b/pkg/kamailio/rpm/kamailio.init.SuSE
@@ -0,0 +1,133 @@
+#! /bin/sh
+# Copyright (c) 2002 FhG FOKUS, Germany.
+# All rights reserved.
+#
+# /etc/init.d/kamailio
+#
+### BEGIN INIT INFO
+# Provides:          sip
+# Required-Start:    $network
+# X-UnitedLinux-Should-Start: $network
+# Required-Stop:     $network
+# X-UnitedLinux-Should-Stop: $network
+# Default-Start:     3 5
+# Default-Stop:      0 1 2 6
+# Short-Description: Kamailio
+# Description:       Start Kamailio and provide the routing of SIP requests.
+### END INIT INFO
+
+
+# Check for missing binaries (stale symlinks should not happen)
+OSER_BIN=/usr/sbin/kamailio
+test -x $OSER_BIN || exit 5
+
+# Check for existence of needed config file and read it
+OSER_CONFIG=/etc/kamailio/kamailio.cfg
+test -r $OSER_CONFIG || exit 6
+
+# Shell functions sourced from /etc/rc.status:
+#      rc_check         check and set local and overall rc status
+#      rc_status        check and set local and overall rc status
+#      rc_status -v     ditto but be verbose in local rc status
+#      rc_status -v -r  ditto and clear the local rc status
+#      rc_status -s     display "skipped" and exit with status 3
+#      rc_status -u     display "unused" and exit with status 3
+#      rc_failed        set local and overall rc status to failed
+#      rc_failed <num>  set local and overall rc status to <num>
+#      rc_reset         clear local rc status (overall remains)
+#      rc_exit          exit appropriate to overall rc status
+#      rc_active	checks whether a service is activated by symlinks
+#      rc_splash arg    sets the boot splash screen to arg (if active)
+. /etc/rc.status
+
+# Reset status of this service
+rc_reset
+
+# Return values acc. to LSB for all commands but status:
+# 0	  - success
+# 1       - generic or unspecified error
+# 2       - invalid or excess argument(s)
+# 3       - unimplemented feature (e.g. "reload")
+# 4       - user had insufficient privileges
+# 5       - program is not installed
+# 6       - program is not configured
+# 7       - program is not running
+# 8--199  - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
+# 
+# Note that starting an already running service, stopping
+# or restarting a not-running service as well as the restart
+# with force-reload (in case signaling is not supported) are
+# considered a success.
+
+case "$1" in
+	start)
+		echo -n "Starting Kamailio "
+		## Start daemon with startproc(8). If this fails
+		## the return value is set appropriately by startproc.
+		startproc $OSER_BIN -f $OSER_CONFIG
+
+		# Remember status and be verbose
+		rc_status -v
+		;;
+	stop)
+		echo -n "Shutting down Kamailio "
+		## Stop daemon with killproc(8) and if this fails
+		## killproc sets the return value according to LSB.
+
+		killproc -TERM $OSER_BIN
+
+		# Remember status and be verbose
+		rc_status -v
+		;;
+	restart)
+		## Stop the service and regardless of whether it was
+		## running or not, start it again.
+		$0 stop
+		$0 start
+
+		# Remember status and be quiet
+		rc_status
+		;;
+	force-reload)
+		## Signal the daemon to reload its config. Most daemons
+		## do this on signal 1 (SIGHUP).
+		## If it does not support it, restart.
+
+		echo -n "Reload service Kamailio "
+		## Otherwise:
+		$0 stop  &&  $0 start
+		rc_status
+		;;
+	reload)
+		## Like force-reload, but if daemon does not support
+		## signaling, do nothing (!)
+
+		## Otherwise if it does not support reload:
+		rc_failed 3
+		rc_status -v
+		;;
+	status)
+		echo -n "Checking for service Kamailio "
+		## Check status with checkproc(8), if process is running
+		## checkproc will return with exit status 0.
+
+		# Return value is slightly different for the status command:
+		# 0 - service up and running
+		# 1 - service dead, but /var/run/  pid  file exists
+		# 2 - service dead, but /var/lock/ lock file exists
+		# 3 - service not running (unused)
+		# 4 - service status unknown :-(
+		# 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
+
+		# NOTE: checkproc returns LSB compliant status values.
+		checkproc $OSER_BIN
+		# NOTE: rc_status knows that we called this init script with
+		# "status" option and adapts its messages accordingly.
+		rc_status -v
+		;;
+	*)
+		echo "Usage: $0 {start|stop|status|restart|force-reload|reload}"
+		exit 1
+		;;
+esac
+rc_exit
diff --git a/pkg/kamailio/rpm/kamailio.spec-4.1 b/pkg/kamailio/rpm/kamailio.spec-4.1
new file mode 100644
index 0000000..b365bcf
--- /dev/null
+++ b/pkg/kamailio/rpm/kamailio.spec-4.1
@@ -0,0 +1,403 @@
+%define name    kamailio
+%define ver     4.1.5
+%define rel     0
+
+%define EXCLUDED_MODULES	mysql jabber cpl-c avp_radius auth_radius group_radius uri_radius pa postgres osp tlsops unixodbc
+%define MYSQL_MODULES		mysql
+%define UNIXODBC_MODULES	unixodbc
+%define POSTGRES_MODULES	postgres
+%define JABBER_MODULES		jabber
+%define CPL_MODULES			cpl-c
+%define PA_MODULES			pa
+%define RADIUS_MODULES		avp_radius auth_radius group_radius uri_radius
+%define RADIUS_MOD_PATH		modules/avp_radius modules/auth_radius modules/group_radius modules/uri_radius
+
+Summary:      Kamailio, very fast and flexible SIP Proxy
+Name:         %name
+Version:      %ver
+Release:      %rel
+Packager:     Daniel-Constantin Mierla <miconda at gmail.com>
+Copyright:    GPL
+Group:        System Environment/Daemons
+Source:       http://kamailio.org/pub/kamailio/stable/%{name}-%{ver}_src.tar.gz
+Source2:      kamailio.init
+URL:          http://kamailio.org/
+Vendor:       kamailio.org
+BuildRoot:    /var/tmp/%{name}-%{ver}-root
+Conflicts:    kamailio-mysql < %ver, kamailio-jabber < %ver, kamailio-radius < %ver, kamailio-cpl < %ver, kamailio-unixodbc < %ver, kamailio-pa < %ver, kamailio-postgres < %ver
+BuildPrereq:  make flex bison
+
+
+%description
+Kamailio is a very fast and flexible SIP (RFC3261)
+proxy server. Written entirely in C, kamailio can handle thousands calls
+per second even on low-budget hardware. A C Shell like scripting language
+provides full control over the server's behaviour. It's modular
+architecture allows only required functionality to be loaded.
+Currently the following modules are available: digest authentication,
+CPL scripts, instant messaging, MySQL and UNIXODBC support, a presence agent,
+radius authentication, record routing, an SMS gateway, a jabber gateway, a 
+transaction and dialog module, OSP module, statistics support, 
+registrar and user location, SNMP, SIMPLE Presence and Perl programming
+interface.
+
+%package  mysql
+Summary:  MySQL connectivity for the Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  mysql-devel zlib-devel
+
+%description mysql
+The kamailio-mysql package contains MySQL database connectivity that you
+need to use digest authentication module or persistent user location
+entries.
+
+%package  postgres
+Summary:  MPOSTGRES connectivity for the Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  postgresql-devel
+
+%description postgres
+The kamailio-postgres package contains Postgres database connectivity that you
+need to use digest authentication module or persistent user location
+entries.
+
+%package  unixodbc
+Summary:  UNIXODBC connectivity for Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  unixodbc-dev
+
+%description unixodbc
+The kamailio-unixodbc package contains UNIXODBC database connectivity support
+that is required by other modules with database dependencies.
+
+%package  jabber
+Summary:  sip jabber message translation support for the Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  expat-devel
+
+%description jabber
+The kamailio-jabber package contains a sip to jabber message translator.
+
+%%package  cpl
+Summary:  CPL interpreter engine for the Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  libxml2-dev
+
+%description cpl
+The kamailio-cpl package contains a SIP CPL interpreter engine.
+
+%package  pa
+Summary:  sip presence agent support for the Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  libxml2-dev
+
+%description pa
+The kamailio-pa package contains a sip Presence Agent.
+
+%package  radius
+Summary:  kamailio radius authentication, group and uri check modules.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  radiusclient-devel
+
+%description radius
+The kamailio-radius package contains modules for radius authentication, group
+ membership and uri checking.
+
+%prep
+%setup
+
+%build
+make all skip_modules="%EXCLUDED_MODULES"         cfg-target=/%{_sysconfdir}/kamailio/
+make modules modules="modules/%MYSQL_MODULES"     cfg-target=/%{_sysconfdir}/kamailio/
+make modules modules="modules/%POSTGRES_MODULES"  cfg-target=/%{_sysconfdir}/kamailio/
+make modules modules="modules/%UNIXODBC_MODULES"  cfg-target=/%{_sysconfdir}/kamailio/
+make modules modules="modules/%JABBER_MODULES"    cfg-target=/%{_sysconfdir}/kamailio/
+make modules modules="modules/%CPL_MODULES"       cfg-target=/%{_sysconfdir}/kamailio/
+make modules modules="modules/%PA_MODULES"        cfg-target=/%{_sysconfdir}/kamailio/
+make modules modules="%RADIUS_MOD_PATH"           cfg-target=/%{_sysconfdir}/kamailio/
+
+
+%install
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
+
+make install skip_modules="%EXCLUDED_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ 
+make install-modules modules="modules/%MYSQL_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ 
+make install-doc modules="modules/%MYSQL_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ 
+make install-modules modules="modules/%POSTGRES_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ 
+make install-doc modules="modules/%POSTGRES_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ 
+make install-modules modules="modules/%UNIXODBC_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ 
+make install-doc modules="modules/%UNIXODBC_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ 
+make install-modules modules="modules/%JABBER_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ 
+make install-doc modules="modules/%JABBER_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ 
+make install-modules modules="modules/%CPL_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ 
+make install-doc modules="modules/%CPL_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ 
+make install-modules modules="modules/%PA_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ 
+make install-doc modules="modules/%PA_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ 
+make install-modules modules="%RADIUS_MOD_PATH" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ 
+make install-doc modules="%RADIUS_MOD_PATH" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ 
+
+mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d
+install -m755 $RPM_SOURCE_DIR/kamailio.init \
+              $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/kamailio
+
+
+
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+%post
+/sbin/chkconfig --add kamailio
+
+%preun
+if [ $1 = 0 ]; then
+    /sbin/service kamailio stop > /dev/null 2>&1
+    /sbin/chkconfig --del kamailio
+fi
+
+
+%files
+%defattr(-,root,root)
+%dir %{_docdir}/kamailio
+%doc %{_docdir}/kamailio/AUTHORS
+%doc %{_docdir}/kamailio/NEWS
+%doc %{_docdir}/kamailio/INSTALL
+%doc %{_docdir}/kamailio/README
+%doc %{_docdir}/kamailio/README-MODULES
+%doc %{_docdir}/kamailio/README.acc
+%doc %{_docdir}/kamailio/README.alias_db
+%doc %{_docdir}/kamailio/README.auth
+%doc %{_docdir}/kamailio/README.auth_db
+%doc %{_docdir}/kamailio/README.auth_diameter
+%doc %{_docdir}/kamailio/README.avpops
+%doc %{_docdir}/kamailio/README.dbtext
+%doc %{_docdir}/kamailio/README.dialog
+%doc %{_docdir}/kamailio/README.dispatcher
+%doc %{_docdir}/kamailio/README.diversion
+%doc %{_docdir}/kamailio/README.domain
+%doc %{_docdir}/kamailio/README.enum
+%doc %{_docdir}/kamailio/README.exec
+%doc %{_docdir}/kamailio/README.flatstore
+%doc %{_docdir}/kamailio/README.gflags
+%doc %{_docdir}/kamailio/README.group
+%doc %{_docdir}/kamailio/README.lcr
+%doc %{_docdir}/kamailio/README.mangler
+%doc %{_docdir}/kamailio/README.maxfwd
+%doc %{_docdir}/kamailio/README.mediaproxy
+%doc %{_docdir}/kamailio/README.msilo
+%doc %{_docdir}/kamailio/README.nathelper
+%doc %{_docdir}/kamailio/README.options
+%doc %{_docdir}/kamailio/README.path
+%doc %{_docdir}/kamailio/README.pdt
+%doc %{_docdir}/kamailio/README.permissions
+%doc %{_docdir}/kamailio/README.pike
+%doc %{_docdir}/kamailio/README.registrar
+%doc %{_docdir}/kamailio/README.rr
+%doc %{_docdir}/kamailio/README.siptrace
+%doc %{_docdir}/kamailio/README.sl
+%doc %{_docdir}/kamailio/README.sms
+%doc %{_docdir}/kamailio/README.speeddial
+%doc %{_docdir}/kamailio/README.statistics
+%doc %{_docdir}/kamailio/README.textops
+%doc %{_docdir}/kamailio/README.tm
+%doc %{_docdir}/kamailio/README.uac
+%doc %{_docdir}/kamailio/README.uac_redirect
+%doc %{_docdir}/kamailio/README.uri
+%doc %{_docdir}/kamailio/README.uri_db
+%doc %{_docdir}/kamailio/README.usrloc
+%doc %{_docdir}/kamailio/README.xlog
+
+%dir %{_sysconfdir}/kamailio
+%config(noreplace) %{_sysconfdir}/kamailio/*
+%config %{_sysconfdir}/rc.d/init.d/*
+
+%dir %{_libdir}/kamailio
+%dir %{_libdir}/kamailio/modules
+%{_libdir}/kamailio/modules/acc.so
+%{_libdir}/kamailio/modules/alias_db.so
+%{_libdir}/kamailio/modules/auth.so
+%{_libdir}/kamailio/modules/auth_db.so
+%{_libdir}/kamailio/modules/auth_diameter.so
+%{_libdir}/kamailio/modules/avpops.so
+%{_libdir}/kamailio/modules/dbtext.so
+%{_libdir}/kamailio/modules/dispatcher.so
+%{_libdir}/kamailio/modules/diversion.so
+%{_libdir}/kamailio/modules/domain.so
+%{_libdir}/kamailio/modules/enum.so
+%{_libdir}/kamailio/modules/exec.so
+%{_libdir}/kamailio/modules/flatstore.so
+%{_libdir}/kamailio/modules/gflags.so
+%{_libdir}/kamailio/modules/group.so
+%{_libdir}/kamailio/modules/lcr.so
+%{_libdir}/kamailio/modules/mangler.so
+%{_libdir}/kamailio/modules/maxfwd.so
+%{_libdir}/kamailio/modules/mediaproxy.so
+%{_libdir}/kamailio/modules/msilo.so
+%{_libdir}/kamailio/modules/nathelper.so
+%{_libdir}/kamailio/modules/options.so
+%{_libdir}/kamailio/modules/path.so
+%{_libdir}/kamailio/modules/pdt.so
+%{_libdir}/kamailio/modules/permissions.so
+%{_libdir}/kamailio/modules/pike.so
+%{_libdir}/kamailio/modules/registrar.so
+%{_libdir}/kamailio/modules/rr.so
+%{_libdir}/kamailio/modules/siptrace.so
+%{_libdir}/kamailio/modules/sl.so
+%{_libdir}/kamailio/modules/sms.so
+%{_libdir}/kamailio/modules/speeddial.so
+%{_libdir}/kamailio/modules/statistics.so
+%{_libdir}/kamailio/modules/textops.so
+%{_libdir}/kamailio/modules/tm.so
+%{_libdir}/kamailio/modules/uac.so
+%{_libdir}/kamailio/modules/uac_redirect.so
+%{_libdir}/kamailio/modules/uri.so
+%{_libdir}/kamailio/modules/uri_db.so
+%{_libdir}/kamailio/modules/usrloc.so
+%{_libdir}/kamailio/modules/xlog.so
+
+%{_sbindir}/kamailio
+%{_sbindir}/kamctl
+%{_libdir}/kamctl/kamctl.base
+%{_libdir}/kamctl/kamctl.sqlbase
+%{_libdir}/kamctl/kamctl.ctlbase
+%{_libdir}/kamctl/kamctl.fifo
+%{_libdir}/kamctl/kamctl.unixsock
+
+%{_mandir}/man5/*
+%{_mandir}/man8/*
+
+
+%files mysql
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/README.mysql
+
+%{_libdir}/kamailio/modules/mysql.so
+%{_sbindir}/kamailio_mysql.sh
+%{_libdir}/kamctl/kamctl.mysql
+
+%files postgres
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/README.postgres
+
+%{_libdir}/kamailio/modules/postgres.so
+%{_sbindir}/kamailio_postgres.sh
+%{_libdir}/kamctl/kamctl.pgsql
+
+%files unixodbc
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/README.unixodbc
+
+%{_libdir}/kamailio/modules/unixodbc.so
+
+%files jabber
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/README.jabber
+
+%{_libdir}/kamailio/modules/jabber.so
+
+%files cpl
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/README.cpl-c
+
+%{_libdir}/kamailio/modules/cpl-c.so
+
+%files pa
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/README.pa
+
+%{_libdir}/kamailio/modules/pa.so
+
+%files radius
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/README.avp_radius
+%doc %{_docdir}/kamailio/README.auth_radius
+%doc %{_docdir}/kamailio/README.group_radius
+%doc %{_docdir}/kamailio/README.uri_radius
+
+%{_libdir}/kamailio/modules/avp_radius.so
+%{_libdir}/kamailio/modules/auth_radius.so
+%{_libdir}/kamailio/modules/group_radius.so
+%{_libdir}/kamailio/modules/uri_radius.so
+
+
+%changelog
+
+* Fri Jun 30 2006 Bogdan-Andrei Iancu <bogdan at voice-system.ro>
+- version set to 1.1.0
+- added packages for pa, postgres and unixodbc
+- added dialog, lcr, options, path, siptrace, statistics modules
+
+* Thu Oct 27 2005 Daniel-Constantin Mierla <miconda at gmail.com>
+- version set to 1.0.0
+- added readme for flatstore
+- added uac and uac_redirect modules
+
+* Wed Jun 08 2005 Daniel-Constantin Mierla <miconda at gmail.com>
+- First version of the spec file.
diff --git a/pkg/kamailio/rpm/kamailio.spec.CenOS b/pkg/kamailio/rpm/kamailio.spec.CenOS
new file mode 100644
index 0000000..81fe2f9
--- /dev/null
+++ b/pkg/kamailio/rpm/kamailio.spec.CenOS
@@ -0,0 +1,742 @@
+%define name    kamailio
+%define ver     4.1.5
+%define rel     0
+%define _sharedir %{_prefix}/share
+
+%define MYSQL_MODULES           mysql
+%define POSTGRES_MODULES        postgres
+%define UNIXODBC_MODULES        unixodbc
+%define LDAP_MODULES            ldap
+%define XMLRPC_MODULES          xml
+%define PERL_MODULES            perl
+%define PYTHON_MODULES          python
+%define LUA_MODULES             lua
+%define UTILS_MODULES           utils
+%define PURPLE_MODULES          purple
+%define MEMCACHED_MODULES       memcached
+%define TLS_MODULES             tls
+%define XMPP_MODULES            xmpp
+%define CPL_MODULES             cpl
+%define SNMPSTATS_MODULES       snmpstats
+%define CARRIERROUTE_MODULES    carrierroute
+%define PRESENCE_MODULES        presence
+%define RADIUS_MODULES          radius
+%define GEOIP_MODULES           geoip
+
+Summary:      Kamailio, very fast and flexible SIP Server
+Name:         %name
+Version:      %ver
+Release:      %rel
+Packager:     Ovidiu Sas <osas at voipembedded.com>
+License:      GPL
+Group:        System Environment/Daemons
+Source0:      http://kamailio.org/pub/kamailio/%{ver}/%{name}-%{ver}_src.tar.gz
+Source1:      kamailio.init
+Source2:      kamailio.default
+URL:          http://kamailio.org/
+Vendor:       kamailio.org
+BuildRoot:    %{_tmppath}/%{name}-%{ver}-buildroot
+Conflicts:    kamailio-mysql < %ver, kamailio-postgres < %ver, kamailio-unixodbc < %ver, kamailio-ldap < %ver, kamailio-xmlrpc < %ver, kamailio-perl < %ver, kamailio-python < %ver, kamailio-lua < %ver, kamailio-utils < %ver, kamailio-purple < %ver, kamailio-memcached  < %ver, kamailio-tls  < %ver, kamailio-xmpp  < %ver, kamailio-cpl  < %ver, kamailio-snmpstats  < %ver, kamailio-carrierroute  < %ver, kamailio-presence  < %ver, kamailio-radius  < %ver, kamailio-geoip  < %ver
+BuildPrereq:  make flex bison pcre-devel
+
+%description
+Kamailio is a very fast and flexible SIP (RFC3261)
+proxy server. Written entirely in C, kamailio can handle thousands calls
+per second even on low-budget hardware. A C Shell like scripting language
+provides full control over the server's behaviour. It's modular
+architecture allows only required functionality to be loaded.
+Currently the following modules are available: digest authentication,
+CPL scripts, instant messaging, MySQL and UNIXODBC support, a presence agent,
+radius authentication, record routing, an SMS gateway, a
+transaction and dialog module, OSP module, statistics support,
+registrar and user location, SNMP, SIMPLE Presence and Perl programming
+interface.
+
+%package  mysql
+Summary:  MySQL connectivity for the Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  mysql-devel zlib-devel
+
+%description mysql
+The kamailio-mysql package contains MySQL database connectivity that you
+need to use digest authentication module or persistent user location
+entries.
+
+
+%package  postgres
+Summary:  MPOSTGRES connectivity for the Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  postgresql-devel
+
+%description postgres
+The kamailio-postgres package contains Postgres database connectivity that you
+need to use digest authentication module or persistent user location
+entries.
+
+
+%package  unixodbc
+Summary:  UNIXODBC connectivity for Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  unixODBC-devel
+
+%description unixodbc
+The kamailio-unixodbc package contains UNIXODBC database connectivity support
+that is required by other modules with database dependencies.
+
+
+%package  utils
+Summary:  Utils for Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+
+%description utils
+The kamailio-utils package provides a set utility functions for Kamailio
+
+
+%package  cpl
+Summary:  CPL module (CPL interpreter engine) for Kamailio
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  libxml2-devel
+
+%description cpl
+The kamailio-cpl package provides a CPL interpreter engine for Kamailio
+
+
+%package  radius
+Summary:  Kamailio radius support for AAA API.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  radiusclient-ng-devel
+
+%description radius
+The kamailio-radius package contains modules for radius authentication, group
+membership and uri checking.
+
+
+%package  snmpstats
+Summary:  SNMP AgentX subagent module for Kamailio
+Group:    System Environment/Daemons
+Requires: kamailio = %ver, net-snmp-utils
+BuildPrereq:  lm_sensors-devel net-snmp-devel
+
+%description snmpstats
+The kamailio-snmpstats package snmpstats module for Kamailio.  This module acts
+as an AgentX subagent which connects to a master agent.
+
+
+%package  presence
+Summary:  sip presence user agent support for Kamailio
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  libxml2-devel, curl-devel
+
+%description presence
+The kamailio-presence package contains a sip Presence Agent.
+
+
+%package  xmpp
+Summary:  SIP2XMPP message translation support for Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  expat-devel
+
+%description xmpp
+The kamailio-xmpp package contains a SIP to XMPP message translator.
+
+
+%package  tls
+Summary:  TLS transport protocol for Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  openssl-devel
+
+%description tls
+The kamailio-tls package contains the SIP TLSt transport mechanism for Kamailio.
+
+
+%package  carrierroute
+Summary:  Routing module for Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  libconfuse-devel
+
+%description carrierroute
+The kamailio-carrierroute package contains a fast routing engine.
+
+
+%package  purple
+Summary:  Provides the purple module, a multi-protocol IM gateway.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq: libpurple-devel
+
+%description purple
+The kamailio-purple package provides the purple module, a multi-protocol instant
+messaging gateway module.
+
+
+%package  ldap
+Summary:  LDAP modules for Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq: openldap-devel
+
+%description ldap
+The kamailio-ldap package provides the ldap and h350 modules for Kamailio,
+enabling LDAP queries from the Kamailio config and storage of SIP account
+data in an LDAP directory.
+
+
+#%package  memcached
+#Summary:  Distributed hash table for Kamailio.
+#Group:    System Environment/Daemons
+#Requires: kamailio = %ver
+#BuildPrereq:  libmemcached-devel
+#
+#%description memcached
+#The kamailio-memcached package provides access to a distributed hash table memcached.
+
+
+#%package  xmlrpc
+#Summary:  XMLRPC support for Kamailio's Management Interface.
+#Group:    System Environment/Daemons
+#Requires: kamailio = %ver
+#BuildPrereq:  libxml2-devel xmlrpc-c-devel
+#
+#%description xmlrpc
+#The kamailio-xmlrpc package provides the XMLRPC transport implementations for Kamailio's
+#Management and Control Interface.
+
+
+%package  perl
+Summary:  Perl extensions and database driver for Kamailio.
+Group:    System Environment/Daemons 
+Requires: kamailio = %ver
+BuildPrereq: mod_perl-devel
+
+%description perl
+The kamailio-perl package provides an interface for Kamailio to write Perl extensions and
+the perlvdb database driver for Kamailio.
+
+
+%package  lua
+Summary:  Lua extensions for Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq: lua-devel
+
+%description lua
+The kamailio-lua package provides an interface for Kamailio to write Python extensions
+
+
+%package  python
+Summary:  Python extensions for Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq: python-devel
+
+%description python
+The kamailio-python package provides an interface for Kamailio to write Python extensions
+
+
+%package  geoip
+Summary:  GeoIP extensions for Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq: geoip-devel
+
+%description geoip
+The kamailio-geoip package provides a GeoIP interface for Kamailio
+
+
+
+
+%prep
+%setup -n %{name}-%{ver}
+
+%build
+make FLAVOUR=kamailio cfg prefix=/usr cfg_prefix=$RPM_BUILD_ROOT basedir=$RPM_BUILD_ROOT cfg_target=/%{_sysconfdir}/kamailio/ modules_dirs="modules modules_k"
+make
+make every-module skip_modules="iptrtpproxy" group_include="kstandard"
+make every-module group_include="k%MYSQL_MODULES"
+make every-module group_include="k%POSTGRES_MODULES"
+make every-module group_include="k%UNIXODBC_MODULES"
+make every-module group_include="k%UTILS_MODULES"
+make every-module group_include="k%CPL_MODULES"
+make every-module group_include="k%RADIUS_MODULES"
+make every-module group_include="k%SNMPSTATS_MODULES"
+make every-module group_include="k%PRESENCE_MODULES"
+make every-module group_include="k%XMPP_MODULES"
+make every-module group_include="k%TLS_MODULES"
+make every-module group_include="k%CARRIERROUTE_MODULES"
+make every-module group_include="k%PURPLE_MODULES"
+make every-module group_include="k%LDAP_MODULES"
+#make every-module group_include="k%MEMCACHED_MODULES"
+#make every-module group_include="k%XMLRPC_MODULES"
+make every-module group_include="k%PERL_MODULES"
+make every-module group_include="k%LUA_MODULES"
+make every-module group_include="k%PYTHON_MODULES"
+make every-module group_include="k%GEOIP_MODULES"
+
+%install
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
+
+make install
+make install-modules-all skip_modules="iptrtpproxy" group_include="kstandard"
+make install-modules-all group_include="k%MYSQL_MODULES"
+make install-modules-all group_include="k%POSTGRES_MODULES"
+make install-modules-all group_include="k%UNIXODBC_MODULES"
+make install-modules-all group_include="k%UTILS_MODULES"
+make install-modules-all group_include="k%CPL_MODULES"
+make install-modules-all group_include="k%SNMPSTATS_MODULES"
+make install-modules-all group_include="k%RADIUS_MODULES"
+make install-modules-all group_include="k%PRESENCE_MODULES"
+make install-modules-all group_include="k%XMPP_MODULES"
+make install-modules-all group_include="k%TLS_MODULES"
+make install-modules-all group_include="k%CARRIERROUTE_MODULES"
+make install-modules-all group_include="k%PURPLE_MODULES"
+make install-modules-all group_include="k%LDAP_MODULES"
+#make install-modules-all group_include="k%MEMCACHED_MODULES"
+#make install-modules-all group_include="k%XMLRPC_MODULES"
+make install-modules-all group_include="k%PERL_MODULES"
+make install-modules-all group_include="k%LUA_MODULES"
+make install-modules-all group_include="k%PYTHON_MODULES"
+make install-modules-all group_include="k%GEOIP_MODULES"
+
+
+mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d
+install -m755 $RPM_SOURCE_DIR/kamailio.init \
+              $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/kamailio
+
+mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/default
+install -m755 $RPM_SOURCE_DIR/kamailio.default \
+              $RPM_BUILD_ROOT/%{_sysconfdir}/default/kamailio
+
+
+%pre
+/usr/sbin/groupadd -r kamailio 2> /dev/null || :
+/usr/sbin/useradd -r -g kamailio -s /bin/false -c "Kamailio daemon" -d \
+                  %{_libdir}/kamailio kamailio 2> /dev/null || :
+
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+                
+%post           
+/sbin/chkconfig --add kamailio
+
+%preun          
+if [ $1 = 0 ]; then
+    /sbin/service kamailio stop > /dev/null 2>&1
+    /sbin/chkconfig --del kamailio
+fi
+                
+
+%files
+%defattr(-,root,root)
+%dir %{_docdir}/kamailio
+%doc %{_docdir}/kamailio/AUTHORS
+%doc %{_docdir}/kamailio/NEWS
+%doc %{_docdir}/kamailio/INSTALL
+%doc %{_docdir}/kamailio/README
+%doc %{_docdir}/kamailio/README-MODULES
+%doc %{_docdir}/kamailio/modules/README.auth
+%doc %{_docdir}/kamailio/modules/README.avpops
+%doc %{_docdir}/kamailio/modules/README.blst
+%doc %{_docdir}/kamailio/modules/README.cfg_db
+%doc %{_docdir}/kamailio/modules/README.cfg_rpc
+%doc %{_docdir}/kamailio/modules/README.counters
+%doc %{_docdir}/kamailio/modules/README.ctl
+%doc %{_docdir}/kamailio/modules/README.db_flatstore
+%doc %{_docdir}/kamailio/modules/README.debugger
+%doc %{_docdir}/kamailio/modules/README.dialplan
+%doc %{_docdir}/kamailio/modules/README.enum
+%doc %{_docdir}/kamailio/modules/README.lcr
+%doc %{_docdir}/kamailio/modules/README.malloc_test
+%doc %{_docdir}/kamailio/modules/README.matrix
+%doc %{_docdir}/kamailio/modules/README.mediaproxy
+%doc %{_docdir}/kamailio/modules/README.mi_rpc
+%doc %{_docdir}/kamailio/modules/README.mqueue
+%doc %{_docdir}/kamailio/modules/README.mtree
+%doc %{_docdir}/kamailio/modules/README.pdb
+%doc %{_docdir}/kamailio/modules/README.pipelimit
+%doc %{_docdir}/kamailio/modules/README.prefix_route
+#%doc %{_docdir}/kamailio/modules/README.privacy
+%doc %{_docdir}/kamailio/modules/README.ratelimit
+%doc %{_docdir}/kamailio/modules/README.sanity
+%doc %{_docdir}/kamailio/modules/README.sl
+%doc %{_docdir}/kamailio/modules/README.sms
+%doc %{_docdir}/kamailio/modules/README.textopsx
+%doc %{_docdir}/kamailio/modules/README.tm
+%doc %{_docdir}/kamailio/modules/README.topoh
+%doc %{_docdir}/kamailio/modules/README.xhttp
+%doc %{_docdir}/kamailio/modules_k/README.acc
+%doc %{_docdir}/kamailio/modules_k/README.alias_db
+%doc %{_docdir}/kamailio/modules_k/README.auth_db
+%doc %{_docdir}/kamailio/modules_k/README.auth_diameter
+%doc %{_docdir}/kamailio/modules_k/README.benchmark
+%doc %{_docdir}/kamailio/modules_k/README.call_control
+%doc %{_docdir}/kamailio/modules_k/README.cfgutils
+%doc %{_docdir}/kamailio/modules_k/README.db_text
+%doc %{_docdir}/kamailio/modules_k/README.dialog
+%doc %{_docdir}/kamailio/modules_k/README.dispatcher
+%doc %{_docdir}/kamailio/modules_k/README.diversion
+%doc %{_docdir}/kamailio/modules_k/README.domain
+%doc %{_docdir}/kamailio/modules_k/README.domainpolicy
+%doc %{_docdir}/kamailio/modules_k/README.drouting
+%doc %{_docdir}/kamailio/modules_k/README.exec
+%doc %{_docdir}/kamailio/modules_k/README.group
+%doc %{_docdir}/kamailio/modules_k/README.htable
+%doc %{_docdir}/kamailio/modules_k/README.imc
+%doc %{_docdir}/kamailio/modules_k/README.kex
+%doc %{_docdir}/kamailio/modules_k/README.maxfwd
+%doc %{_docdir}/kamailio/modules_k/README.mi_datagram
+%doc %{_docdir}/kamailio/modules_k/README.mi_fifo
+%doc %{_docdir}/kamailio/modules_k/README.msilo
+%doc %{_docdir}/kamailio/modules_k/README.nat_traversal
+%doc %{_docdir}/kamailio/modules_k/README.nathelper
+%doc %{_docdir}/kamailio/modules_k/README.path
+%doc %{_docdir}/kamailio/modules_k/README.pdt
+%doc %{_docdir}/kamailio/modules_k/README.permissions
+%doc %{_docdir}/kamailio/modules_k/README.pike
+%doc %{_docdir}/kamailio/modules_k/README.pua_mi
+%doc %{_docdir}/kamailio/modules_k/README.pv
+%doc %{_docdir}/kamailio/modules_k/README.qos
+%doc %{_docdir}/kamailio/modules_k/README.regex
+%doc %{_docdir}/kamailio/modules_k/README.registrar
+%doc %{_docdir}/kamailio/modules_k/README.rr
+%doc %{_docdir}/kamailio/modules_k/README.rtimer
+%doc %{_docdir}/kamailio/modules_k/README.rtpproxy
+%doc %{_docdir}/kamailio/modules_k/README.seas
+%doc %{_docdir}/kamailio/modules_k/README.siptrace
+%doc %{_docdir}/kamailio/modules_k/README.siputils
+%doc %{_docdir}/kamailio/modules_k/README.speeddial
+%doc %{_docdir}/kamailio/modules_k/README.sqlops
+%doc %{_docdir}/kamailio/modules_k/README.sst
+%doc %{_docdir}/kamailio/modules_k/README.statistics
+%doc %{_docdir}/kamailio/modules_k/README.textops
+%doc %{_docdir}/kamailio/modules_k/README.tmx
+%doc %{_docdir}/kamailio/modules_k/README.uac
+%doc %{_docdir}/kamailio/modules_k/README.uac_redirect
+%doc %{_docdir}/kamailio/modules_k/README.uri_db
+%doc %{_docdir}/kamailio/modules_k/README.userblacklist
+%doc %{_docdir}/kamailio/modules_k/README.usrloc
+%doc %{_docdir}/kamailio/modules_k/README.xlog
+
+
+%dir %{_sysconfdir}/kamailio
+%config(noreplace) %{_sysconfdir}/kamailio/*
+%config %{_sysconfdir}/rc.d/init.d/*
+%config %{_sysconfdir}/default/*
+
+%dir %{_libdir}/kamailio
+%{_libdir}/kamailio/libkcore.so
+%{_libdir}/kamailio/libkcore.so.1
+%{_libdir}/kamailio/libkcore.so.1.0
+%{_libdir}/kamailio/libkmi.so
+%{_libdir}/kamailio/libkmi.so.1
+%{_libdir}/kamailio/libkmi.so.1.0
+%{_libdir}/kamailio/libsrdb1.so
+%{_libdir}/kamailio/libsrdb1.so.1
+%{_libdir}/kamailio/libsrdb1.so.1.0
+%{_libdir}/kamailio/libsrdb2.so
+%{_libdir}/kamailio/libsrdb2.so.1
+%{_libdir}/kamailio/libsrdb2.so.1.0
+%{_libdir}/kamailio/libtrie.so
+%{_libdir}/kamailio/libtrie.so.1
+%{_libdir}/kamailio/libtrie.so.1.0
+%dir %{_libdir}/kamailio/modules
+%{_libdir}/kamailio/modules/auth.so
+%{_libdir}/kamailio/modules/avpops.so
+%{_libdir}/kamailio/modules/blst.so
+%{_libdir}/kamailio/modules/cfg_db.so
+%{_libdir}/kamailio/modules/cfg_rpc.so
+%{_libdir}/kamailio/modules/counters.so
+%{_libdir}/kamailio/modules/ctl.so
+%{_libdir}/kamailio/modules/db_flatstore.so
+%{_libdir}/kamailio/modules/debugger.so
+%{_libdir}/kamailio/modules/dialplan.so
+%{_libdir}/kamailio/modules/enum.so
+%{_libdir}/kamailio/modules/lcr.so
+%{_libdir}/kamailio/modules/malloc_test.so
+%{_libdir}/kamailio/modules/matrix.so
+%{_libdir}/kamailio/modules/mediaproxy.so
+%{_libdir}/kamailio/modules/mi_rpc.so
+%{_libdir}/kamailio/modules/mqueue.so
+%{_libdir}/kamailio/modules/mtree.so
+%{_libdir}/kamailio/modules/pdb.so
+%{_libdir}/kamailio/modules/pipelimit.so
+%{_libdir}/kamailio/modules/prefix_route.so
+%{_libdir}/kamailio/modules/privacy.so
+%{_libdir}/kamailio/modules/ratelimit.so
+%{_libdir}/kamailio/modules/sanity.so
+%{_libdir}/kamailio/modules/sl.so
+%{_libdir}/kamailio/modules/sms.so
+%{_libdir}/kamailio/modules/tm.so
+%{_libdir}/kamailio/modules/textopsx.so
+%{_libdir}/kamailio/modules/topoh.so
+%{_libdir}/kamailio/modules/xhttp.so
+%dir %{_libdir}/kamailio/modules_k
+%{_libdir}/kamailio/modules_k/acc.so
+%{_libdir}/kamailio/modules_k/alias_db.so
+%{_libdir}/kamailio/modules_k/auth_db.so
+%{_libdir}/kamailio/modules_k/auth_diameter.so
+%{_libdir}/kamailio/modules_k/benchmark.so
+%{_libdir}/kamailio/modules_k/call_control.so
+%{_libdir}/kamailio/modules_k/cfgutils.so
+%{_libdir}/kamailio/modules_k/db_text.so
+%{_libdir}/kamailio/modules_k/dialog.so
+%{_libdir}/kamailio/modules_k/dispatcher.so
+%{_libdir}/kamailio/modules_k/diversion.so
+%{_libdir}/kamailio/modules_k/domain.so
+%{_libdir}/kamailio/modules_k/domainpolicy.so
+%{_libdir}/kamailio/modules_k/drouting.so
+%{_libdir}/kamailio/modules_k/exec.so
+%{_libdir}/kamailio/modules_k/group.so
+%{_libdir}/kamailio/modules_k/htable.so
+%{_libdir}/kamailio/modules_k/imc.so
+%{_libdir}/kamailio/modules_k/kex.so
+%{_libdir}/kamailio/modules_k/maxfwd.so
+%{_libdir}/kamailio/modules_k/mi_datagram.so
+%{_libdir}/kamailio/modules_k/mi_fifo.so
+%{_libdir}/kamailio/modules_k/msilo.so
+%{_libdir}/kamailio/modules_k/nat_traversal.so
+%{_libdir}/kamailio/modules_k/nathelper.so
+%{_libdir}/kamailio/modules_k/path.so
+%{_libdir}/kamailio/modules_k/pdt.so
+%{_libdir}/kamailio/modules_k/permissions.so
+%{_libdir}/kamailio/modules_k/pike.so
+%{_libdir}/kamailio/modules_k/pua_mi.so
+%{_libdir}/kamailio/modules_k/pv.so
+%{_libdir}/kamailio/modules_k/qos.so
+%{_libdir}/kamailio/modules_k/regex.so
+%{_libdir}/kamailio/modules_k/registrar.so
+%{_libdir}/kamailio/modules_k/rr.so
+%{_libdir}/kamailio/modules_k/rtimer.so
+%{_libdir}/kamailio/modules_k/rtpproxy.so
+%{_libdir}/kamailio/modules_k/seas.so
+%{_libdir}/kamailio/modules_k/siptrace.so
+%{_libdir}/kamailio/modules_k/siputils.so
+%{_libdir}/kamailio/modules_k/speeddial.so
+%{_libdir}/kamailio/modules_k/sqlops.so
+%{_libdir}/kamailio/modules_k/sst.so
+%{_libdir}/kamailio/modules_k/statistics.so
+%{_libdir}/kamailio/modules_k/textops.so
+%{_libdir}/kamailio/modules_k/tmx.so
+%{_libdir}/kamailio/modules_k/uac.so
+%{_libdir}/kamailio/modules_k/uac_redirect.so
+%{_libdir}/kamailio/modules_k/uri_db.so
+%{_libdir}/kamailio/modules_k/userblacklist.so
+%{_libdir}/kamailio/modules_k/usrloc.so
+%{_libdir}/kamailio/modules_k/xlog.so
+
+
+%{_sbindir}/kamailio
+%{_sbindir}/kamctl
+%{_sbindir}/kamdbctl
+%{_sbindir}/kamcmd
+%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.py
+%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.pyc
+%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.pyo
+%{_libdir}/kamailio/kamctl/kamctl.base
+%{_libdir}/kamailio/kamctl/kamctl.ctlbase
+%{_libdir}/kamailio/kamctl/kamctl.dbtext
+%{_libdir}/kamailio/kamctl/kamctl.fifo
+%{_libdir}/kamailio/kamctl/kamctl.ser
+%{_libdir}/kamailio/kamctl/kamctl.ser_mi
+%{_libdir}/kamailio/kamctl/kamctl.sqlbase
+%{_libdir}/kamailio/kamctl/kamctl.unixsock
+%{_libdir}/kamailio/kamctl/kamdbctl.base
+%{_libdir}/kamailio/kamctl/kamdbctl.dbtext
+
+%{_mandir}/man5/*
+%{_mandir}/man8/*
+
+%{_sharedir}/kamailio/dbtext/kamailio/*
+
+
+%files mysql
+%defattr(-,root,root)
+%{_libdir}/kamailio/modules/db_mysql.so
+%{_libdir}/kamailio/kamctl/kamctl.mysql
+%{_libdir}/kamailio/kamctl/kamdbctl.mysql
+%{_sharedir}/kamailio/mysql/*
+
+
+%files postgres
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.db_postgres
+%{_libdir}/kamailio/modules/db_postgres.so
+%{_libdir}/kamailio/kamctl/kamctl.pgsql
+%{_libdir}/kamailio/kamctl/kamdbctl.pgsql
+%{_sharedir}/kamailio/postgres/*
+
+
+%files unixodbc
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules_k/README.db_unixodbc
+%{_libdir}/kamailio/modules_k/db_unixodbc.so
+
+
+%files utils
+%defattr(-,root,root)
+%{_docdir}/kamailio/modules/README.utils
+%{_libdir}/kamailio/modules/utils.so
+
+
+%files cpl
+%defattr(-,root,root)
+%{_docdir}/kamailio/modules_k/README.cpl-c
+%{_libdir}/kamailio/modules_k/cpl-c.so
+
+
+%files radius
+%defattr(-,root,root)
+%{_docdir}/kamailio/modules_k/README.acc_radius
+%{_docdir}/kamailio/modules_k/README.auth_radius
+%{_docdir}/kamailio/modules_k/README.misc_radius
+%{_docdir}/kamailio/modules/README.peering
+%{_libdir}/kamailio/modules_k/acc_radius.so
+%{_libdir}/kamailio/modules_k/auth_radius.so
+%{_libdir}/kamailio/modules_k/misc_radius.so
+%{_libdir}/kamailio/modules/peering.so
+
+
+%files snmpstats
+%defattr(-,root,root)
+%{_docdir}/kamailio/modules_k/README.snmpstats
+%{_libdir}/kamailio/modules_k/snmpstats.so
+
+
+%files presence
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules_k/README.presence
+%doc %{_docdir}/kamailio/modules_k/README.presence_conference
+%doc %{_docdir}/kamailio/modules_k/README.presence_dialoginfo
+%doc %{_docdir}/kamailio/modules_k/README.presence_mwi
+%doc %{_docdir}/kamailio/modules_k/README.presence_xml
+%doc %{_docdir}/kamailio/modules_k/README.pua
+%doc %{_docdir}/kamailio/modules_k/README.pua_bla
+%doc %{_docdir}/kamailio/modules_k/README.pua_dialoginfo
+%doc %{_docdir}/kamailio/modules_k/README.pua_mi
+%doc %{_docdir}/kamailio/modules_k/README.pua_usrloc
+%doc %{_docdir}/kamailio/modules_k/README.pua_xmpp
+%doc %{_docdir}/kamailio/modules_k/README.rls
+%doc %{_docdir}/kamailio/modules_k/README.xcap_client
+%doc %{_docdir}/kamailio/modules_k/README.xcap_server
+%{_libdir}/kamailio/modules_k/presence.so
+%{_libdir}/kamailio/modules_k/presence_conference.so
+%{_libdir}/kamailio/modules_k/presence_dialoginfo.so
+%{_libdir}/kamailio/modules_k/presence_mwi.so
+%{_libdir}/kamailio/modules_k/presence_xml.so
+%{_libdir}/kamailio/modules_k/pua.so
+%{_libdir}/kamailio/modules_k/pua_bla.so
+%{_libdir}/kamailio/modules_k/pua_dialoginfo.so
+%{_libdir}/kamailio/modules_k/pua_mi.so
+%{_libdir}/kamailio/modules_k/pua_usrloc.so
+%{_libdir}/kamailio/modules_k/pua_xmpp.so
+%{_libdir}/kamailio/modules_k/rls.so
+%{_libdir}/kamailio/modules_k/xcap_client.so
+%{_libdir}/kamailio/modules_k/xcap_server.so
+
+
+%files xmpp
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules_k/README.xmpp
+%{_libdir}/kamailio/modules_k/xmpp.so
+
+
+%files tls
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.tls
+%{_libdir}/kamailio/modules/tls.so
+
+
+%files carrierroute
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.carrierroute
+%{_libdir}/kamailio/modules/carrierroute.so
+
+
+%files purple
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules_k/README.purple
+%{_libdir}/kamailio/modules_k/purple.so
+
+
+%files ldap
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules_k/README.h350
+%doc %{_docdir}/kamailio/modules_k/README.ldap
+%{_libdir}/kamailio/modules_k/h350.so
+%{_libdir}/kamailio/modules_k/ldap.so
+
+
+#%files memcached
+#%defattr(-,root,root)
+#%doc %{_docdir}/kamailio/modules_k/README.memcached
+#%{_libdir}/kamailio/modules_k/memcached.so
+
+
+#%files xmlrpc
+#%defattr(-,root,root)
+#%doc %{_docdir}/kamailio/modules_k/README.memcached
+#%{_libdir}/kamailio/modules_k/memcached.so
+
+
+%files perl
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules_k/README.perl
+%doc %{_docdir}/kamailio/modules_k/README.perlvdb
+%{_libdir}/kamailio/modules_k/perl.so
+%{_libdir}/kamailio/modules_k/perlvdb.so
+%{_libdir}/kamailio/perl/OpenSER.pm
+%{_libdir}/kamailio/perl/OpenSER/Constants.pm
+%{_libdir}/kamailio/perl/OpenSER/LDAPUtils/LDAPConf.pm
+%{_libdir}/kamailio/perl/OpenSER/LDAPUtils/LDAPConnection.pm
+%{_libdir}/kamailio/perl/OpenSER/Message.pm
+%{_libdir}/kamailio/perl/OpenSER/Utils/Debug.pm
+%{_libdir}/kamailio/perl/OpenSER/Utils/PhoneNumbers.pm
+%{_libdir}/kamailio/perl/OpenSER/VDB.pm
+%{_libdir}/kamailio/perl/OpenSER/VDB/Adapter/AccountingSIPtrace.pm
+%{_libdir}/kamailio/perl/OpenSER/VDB/Adapter/Alias.pm
+%{_libdir}/kamailio/perl/OpenSER/VDB/Adapter/Auth.pm
+%{_libdir}/kamailio/perl/OpenSER/VDB/Adapter/Describe.pm
+%{_libdir}/kamailio/perl/OpenSER/VDB/Adapter/Speeddial.pm
+%{_libdir}/kamailio/perl/OpenSER/VDB/Adapter/TableVersions.pm
+%{_libdir}/kamailio/perl/OpenSER/VDB/Column.pm
+%{_libdir}/kamailio/perl/OpenSER/VDB/Pair.pm
+%{_libdir}/kamailio/perl/OpenSER/VDB/ReqCond.pm
+%{_libdir}/kamailio/perl/OpenSER/VDB/Result.pm
+%{_libdir}/kamailio/perl/OpenSER/VDB/VTab.pm
+%{_libdir}/kamailio/perl/OpenSER/VDB/Value.pm
+
+%files lua
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.app_lua
+%{_libdir}/kamailio/modules/app_lua.so
+
+
+%files python
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.app_python
+%{_libdir}/kamailio/modules/app_python.so
+
+
+%files geoip
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.geoip
+%{_libdir}/kamailio/modules/geoip.so
+
+
+
+%changelog
+* Mon Oct 4 2010 Ovidiu Sas <osas at voipembedded.com>
+ - Update for kamailio 3.1
+
+* Tue Mar 23 2010 Ovidiu Sas <osas at voipembedded.com>
+ - First version of the spec file for kamailio 3.0
diff --git a/pkg/kamailio/rpm/kamailio.spec.SuSE b/pkg/kamailio/rpm/kamailio.spec.SuSE
new file mode 100644
index 0000000..47e22a6
--- /dev/null
+++ b/pkg/kamailio/rpm/kamailio.spec.SuSE
@@ -0,0 +1,383 @@
+%define name    kamailio
+%define ver     4.1.5
+%define rel     0
+
+%define EXCLUDED_MODULES	mysql jabber cpl-c auth_radius misc_radius peering postgress pa unixodbc osp tlsops
+%define MYSQL_MODULES		mysql
+%define POSTGRES_MODULES	postgres
+%define UNIXODBC_MODULES	unixodbc
+%define JABBER_MODULES		jabber
+%define CPL_MODULES			cpl-c
+%define PA_MODULES			pa
+%define RADIUS_MODULES		auth_radius misc_radius peering
+%define RADIUS_MOD_PATH		modules/auth_radius modules/misc_radius modules/peering
+
+Summary:      Kamailio, very fast and flexible SIP Proxy
+Name:         %name
+Version:      %ver
+Release:      %rel
+
+Packager:     Daniel-Constantin Mierla <miconda at gmail.com>
+Copyright:    GPL
+Group:        Networking/Daemons
+Source:       http://kamailio.org/pub/kamailio/stable/%{name}-%{ver}_src.tar.gz
+Source2:      kamailio.init.SuSE
+URL:          http://www.kamailio.org/
+Vendor:       kamailio.org
+BuildRoot:    /var/tmp/%{name}-%{ver}-root
+Conflicts:    kamailio < %ver, kamailio-mysql < %ver, kamailio-jabber < %ver, kamailio-radius < %ver, kamailio-postgres < %ver, kamailio-unixodbc < %ver, kamailio-pa < %ver
+BuildPrereq:  make flex bison 
+
+
+%description
+Kamailio is a very fast and flexible SIP (RFC3261)
+proxy server. Written entirely in C, ser can handle thousands calls
+per second even on low-budget hardware. A C Shell like scripting language
+provides full control over the server's behaviour. It's modular
+architecture allows only required functionality to be loaded.
+Currently the following modules are available: digest authentication,
+CPL scripts, instant messaging, MySQL and UNIXODBC support, a presence agent,
+radius authentication, record routing, an SMS gateway, a jabber gateway, a 
+transaction and dialog module, OSP module, statistics support, 
+registrar and user location.
+
+%package  mysql
+Summary:  MySQL connectivity for the Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq: mysql-devel zlib-devel
+
+%description mysql
+The kamailio-mysql package contains MySQL database connectivity that you
+need to use digest authentication module or persistent user location
+entries.
+
+%package  postgres
+Summary:  MPOSTGRES connectivity for the Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  postgresql-devel
+
+%description postgres
+The kamailio-postgres package contains Postgres database connectivity that you
+need to use digest authentication module or persistent user location
+entries.
+
+%package  unixodbc
+Summary:  UNIXODBC connectivity for Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  unixodbc-dev
+
+%description unixodbc
+The kamailio-unixodbc package contains UNIXODBC database connectivity support
+that is required by other modules with database dependencies.
+
+
+%package  jabber
+Summary:  sip jabber message translation support for the Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq: expat
+
+%description jabber
+The kamailio-jabber package contains a sip to jabber message translator.
+
+%package  cpl
+Summary:  CPL interpreter engine for the Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq: libxml2-dev
+
+%description cpl
+The kamailio-cpl package contains a CPL interpreter engine.
+
+%package  pa
+Summary:  sip presence agent support for the Kamailio.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  libxml2-dev
+
+%description pa
+The kamailio-pa package contains a sip Presence Agent.
+
+%package  radius
+Summary:  kamailio radius authentication, group and uri check modules.
+Group:    System Environment/Daemons
+Requires: kamailio = %ver
+BuildPrereq:  radiusclient
+
+%description radius
+The kamailio-radius package contains modules for radius authentication, group
+ membership and uri checking.
+
+%prep
+%setup
+
+%build
+make all skip_modules="%EXCLUDED_MODULES"         cfg-target=/%{_sysconfdir}/kamailio/
+make modules modules="modules/%MYSQL_MODULES"     cfg-target=/%{_sysconfdir}/kamailio/
+make modules modules="modules/%POSTGRES_MODULES"  cfg-target=/%{_sysconfdir}/kamailio/
+make modules modules="modules/%UNIXODBC_MODULES"  cfg-target=/%{_sysconfdir}/kamailio/
+make modules modules="modules/%JABBER_MODULES"    cfg-target=/%{_sysconfdir}/kamailio/
+make modules modules="modules/%CPL_MODULES"       cfg-target=/%{_sysconfdir}/kamailio/
+make modules modules="modules/%PA_MODULES"        cfg-target=/%{_sysconfdir}/kamailio/
+make modules modules="%RADIUS_MOD_PATH"           cfg-target=/%{_sysconfdir}/kamailio/
+
+%install
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
+
+make install skip_modules="%EXCLUDED_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ \
+		doc-prefix=$RPM_BUILD_ROOT \
+		doc-dir=/%{_docdir}/kamailio/
+make install-modules modules="modules/%MYSQL_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ \
+		doc-prefix=$RPM_BUILD_ROOT \
+		doc-dir=/%{_docdir}/kamailio/
+make install-modules modules="modules/%POSTGRES_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ \
+		doc-prefix=$RPM_BUILD_ROOT \
+		doc-dir=/%{_docdir}/kamailio/
+make install-modules modules="modules/%UNIXODBC_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ \
+		doc-prefix=$RPM_BUILD_ROOT \
+		doc-dir=/%{_docdir}/kamailio/
+make install-modules modules="modules/%JABBER_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ \
+		doc-prefix=$RPM_BUILD_ROOT \
+		doc-dir=/%{_docdir}/kamailio/
+make install-modules modules="modules/%CPL_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ \
+		doc-prefix=$RPM_BUILD_ROOT \
+		doc-dir=/%{_docdir}/kamailio/
+make install-modules modules="modules/%PA_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ \
+		doc-prefix=$RPM_BUILD_ROOT \
+		doc-dir=/%{_docdir}/kamailio/
+make install-modules modules="%RADIUS_MOD_PATH" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/kamailio/ \
+		doc-prefix=$RPM_BUILD_ROOT \
+		doc-dir=/%{_docdir}/kamailio/
+make install-doc modules="modules/%JABBER_MODULES %RADIUS_MOD_PATH %MYSQL_MODULES %POSTGRES_MODULES %UNIXODBC_MODULES %CPL_MODULES %PA_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		doc-prefix=$RPM_BUILD_ROOT \
+		doc-dir=/%{_docdir}/kamailio/
+
+
+mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/init.d
+install -m755 $RPM_SOURCE_DIR/kamailio.init.SuSE \
+              $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/kamailio
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+%post
+sbin/insserv etc/init.d/kamailio
+
+%preun
+if [ $1 = 0 ]; then
+    etc/init.d/kamailio stop > /dev/null 2>&1
+fi
+
+%postun
+sbin/insserv etc/init.d/
+
+%files
+%defattr(-,root,root)
+%dir %{_docdir}/kamailio
+%doc %{_docdir}/kamailio/AUTHORS
+%doc %{_docdir}/kamailio/NEWS
+%doc %{_docdir}/kamailio/INSTALL
+%doc %{_docdir}/kamailio/README
+%doc %{_docdir}/kamailio/README-MODULES
+%doc %{_docdir}/kamailio/README.acc
+%doc %{_docdir}/kamailio/README.alias_db
+%doc %{_docdir}/kamailio/README.auth
+%doc %{_docdir}/kamailio/README.auth_db
+%doc %{_docdir}/kamailio/README.auth_diameter
+%doc %{_docdir}/kamailio/README.avpops
+%doc %{_docdir}/kamailio/README.dbtext
+%doc %{_docdir}/kamailio/README.dialog
+%doc %{_docdir}/kamailio/README.dispatcher
+%doc %{_docdir}/kamailio/README.diversion
+%doc %{_docdir}/kamailio/README.domain
+%doc %{_docdir}/kamailio/README.enum
+%doc %{_docdir}/kamailio/README.exec
+%doc %{_docdir}/kamailio/README.flatstore
+%doc %{_docdir}/kamailio/README.gflags
+%doc %{_docdir}/kamailio/README.group
+%doc %{_docdir}/kamailio/README.lcr
+%doc %{_docdir}/kamailio/README.mangler
+%doc %{_docdir}/kamailio/README.maxfwd
+%doc %{_docdir}/kamailio/README.mediaproxy
+%doc %{_docdir}/kamailio/README.msilo
+%doc %{_docdir}/kamailio/README.nathelper
+%doc %{_docdir}/kamailio/README.options
+%doc %{_docdir}/kamailio/README.path
+%doc %{_docdir}/kamailio/README.pdt
+%doc %{_docdir}/kamailio/README.permissions
+%doc %{_docdir}/kamailio/README.pike
+%doc %{_docdir}/kamailio/README.registrar
+%doc %{_docdir}/kamailio/README.rr
+%doc %{_docdir}/kamailio/README.siptrace
+%doc %{_docdir}/kamailio/README.sl
+%doc %{_docdir}/kamailio/README.sms
+%doc %{_docdir}/kamailio/README.speeddial
+%doc %{_docdir}/kamailio/README.statistics
+%doc %{_docdir}/kamailio/README.textops
+%doc %{_docdir}/kamailio/README.tm
+%doc %{_docdir}/kamailio/README.uac
+%doc %{_docdir}/kamailio/README.uac_redirect
+%doc %{_docdir}/kamailio/README.uri
+%doc %{_docdir}/kamailio/README.uri_db
+%doc %{_docdir}/kamailio/README.usrloc
+%doc %{_docdir}/kamailio/README.xlog
+
+%dir %{_sysconfdir}/kamailio
+%config(noreplace) %{_sysconfdir}/kamailio/*
+%config %{_sysconfdir}/init.d/*
+
+%dir %{_libdir}/kamailio
+%dir %{_libdir}/kamailio/modules
+%{_libdir}/kamailio/modules/acc.so
+%{_libdir}/kamailio/modules/alias_db.so
+%{_libdir}/kamailio/modules/auth.so
+%{_libdir}/kamailio/modules/auth_db.so
+%{_libdir}/kamailio/modules/auth_diameter.so
+%{_libdir}/kamailio/modules/avpops.so
+%{_libdir}/kamailio/modules/dbtext.so
+%{_libdir}/kamailio/modules/dispatcher.so
+%{_libdir}/kamailio/modules/diversion.so
+%{_libdir}/kamailio/modules/domain.so
+%{_libdir}/kamailio/modules/enum.so
+%{_libdir}/kamailio/modules/exec.so
+%{_libdir}/kamailio/modules/flatstore.so
+%{_libdir}/kamailio/modules/gflags.so
+%{_libdir}/kamailio/modules/group.so
+%{_libdir}/kamailio/modules/lcr.so
+%{_libdir}/kamailio/modules/mangler.so
+%{_libdir}/kamailio/modules/maxfwd.so
+%{_libdir}/kamailio/modules/mediaproxy.so
+%{_libdir}/kamailio/modules/msilo.so
+%{_libdir}/kamailio/modules/nathelper.so
+%{_libdir}/kamailio/modules/options.so
+%{_libdir}/kamailio/modules/path.so
+%{_libdir}/kamailio/modules/pdt.so
+%{_libdir}/kamailio/modules/permissions.so
+%{_libdir}/kamailio/modules/pike.so
+%{_libdir}/kamailio/modules/registrar.so
+%{_libdir}/kamailio/modules/rr.so
+%{_libdir}/kamailio/modules/siptrace.so
+%{_libdir}/kamailio/modules/sl.so
+%{_libdir}/kamailio/modules/sms.so
+%{_libdir}/kamailio/modules/speeddial.so
+%{_libdir}/kamailio/modules/statistics.so
+%{_libdir}/kamailio/modules/textops.so
+%{_libdir}/kamailio/modules/tm.so
+%{_libdir}/kamailio/modules/uac.so
+%{_libdir}/kamailio/modules/uac_redirect.so
+%{_libdir}/kamailio/modules/uri.so
+%{_libdir}/kamailio/modules/uri_db.so
+%{_libdir}/kamailio/modules/usrloc.so
+%{_libdir}/kamailio/modules/xlog.so
+
+%{_sbindir}/kamailio
+%{_sbindir}/kamctl
+%{_libdir}/kamctl/kamctl.base
+%{_libdir}/kamctl/kamctl.sqlbase
+%{_libdir}/kamctl/kamctl.ctlbase
+%{_libdir}/kamctl/kamctl.fifo
+%{_libdir}/kamctl/kamctl.unixsock
+
+%{_mandir}/man5/*
+%{_mandir}/man8/*
+
+
+%files mysql
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/README.mysql
+
+%{_libdir}/kamailio/modules/mysql.so
+%{_sbindir}/kamailio_mysql.sh
+%{_libdir}/kamctl/kamctl.mysql
+
+%files postgres
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/README.postgres
+
+%{_libdir}/kamailio/modules/postgres.so
+%{_sbindir}/kamailio_postgres.sh
+%{_libdir}/kamctl/kamctl.pgsql
+
+%files unixodbc
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/README.unixodbc
+
+%{_libdir}/kamailio/modules/unixodbc.so
+
+%files jabber
+%defattr(-,root,root)
+%{_libdir}/kamailio/modules/jabber.so
+%doc %{_docdir}/kamailio/README.jabber
+
+%files cpl
+%defattr(-,root,root)
+%{_libdir}/kamailio/modules/cpl-c.so
+%doc %{_docdir}/kamailio/README.cpl-c
+
+%files pa
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/README.pa
+
+%{_libdir}/kamailio/modules/pa.so
+
+%files radius
+%defattr(-,root,root)
+%{_libdir}/kamailio/modules/auth_radius.so
+%{_libdir}/kamailio/modules/misc_radius.so
+%{_libdir}/kamailio/modules/peering.so
+%doc %{_docdir}/kamailio/README.auth_radius
+%doc %{_docdir}/kamailio/README.misc_radius
+%doc %{_docdir}/kamailio/README.peering
+
+
+%changelog
+
+* Fri Jun 30 2006 Bogdan-Andrei Iancu <bogdan at voice-system.ro>
+- version set to 1.1.0
+- added packages for pa, postgres and unixodbc
+- added dialog, lcr, options, path, siptrace, statistics modules
+
+* Thu Oct 27 2005 Daniel-Constantin Mierla <miconda at gmail.com>
+- version set to 1.0.0
+- added readme for flatstore
+- added uac and uac_redirect modules
+
+* Wed Jun 08 2005 Daniel-Constantin Mierla <miconda at gmail.com>
+- First version of the spec file.
diff --git a/pkg/kamailio/solaris/kamailio-manifest.xml b/pkg/kamailio/solaris/kamailio-manifest.xml
new file mode 100644
index 0000000..2ac2089
--- /dev/null
+++ b/pkg/kamailio/solaris/kamailio-manifest.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+
+<!-- This is a manifest file to start, stop or restart the server automatically at
+     the Solaris 10 bootup. Setup and usage:
+     cp kamailio-manifest.xml to /var/svc/manifest/network/kamailio.xml
+     chmod 444 kamailio.xml
+     svccg -v import kamailio.xml
+     and finally enable the server to be a SMF service:
+     svcadm enable kamailio -->
+
+<service_bundle type='manifest' name='kamailio'>	
+	<service name='network/kamailio' type='service' version='1'>
+		<create_default_instance enabled='false' />
+		<single_instance/>
+
+		<dependency name='multi-user' grouping='require_all' restart_on='none' type='service'>
+			<service_fmri value='svc:/milestone/multi-user' />
+		</dependency>
+
+		<dependency name='multi-user-server' grouping='require_all' restart_on='none' type='service'>
+			<service_fmri value='svc:/milestone/multi-user-server' />
+		</dependency>
+
+		<dependency name='cswmysql5' grouping='require_all' restart_on='none' type='service'>
+			<!-- adapt if you use another mysql version -->
+			<service_fmri value='svc:/network/cswmysql5:default' />
+		</dependency>
+
+		<exec_method type='method' name='start' exec='/sbin/kamctl start' timeout_seconds='30' />
+
+		<exec_method type='method' name='stop' exec='/sbin/kamctl stop' timeout_seconds='60' /> 
+
+		<exec_method type='method' name='restart' exec='/sbin/kamctl restart' timeout_seconds='-1' />
+
+		<stability value='Unstable' />
+		<template>
+			<common_name>
+				<loctext xml:lang='C'> Kamailio </loctext> 
+			</common_name>
+		</template>
+	</service>
+</service_bundle>
diff --git a/pkg/kamailio/solaris/pkginfo b/pkg/kamailio/solaris/pkginfo
new file mode 100644
index 0000000..116657e
--- /dev/null
+++ b/pkg/kamailio/solaris/pkginfo
@@ -0,0 +1,9 @@
+PKG=Kamailio
+ARCH=sparc
+VERSION=1.2.0
+CATEGORY=application
+EMAIL=miconda at gmail.com
+NAME=Kamailio is a very fast and flexible SIP (RFC3261) proxy server
+SUNW_ISA=sparcv9
+BASEDIR=/usr/local
+CLASSES=none
diff --git a/pkg/kamailio/solaris/prototype b/pkg/kamailio/solaris/prototype
new file mode 100644
index 0000000..7b7da8d
--- /dev/null
+++ b/pkg/kamailio/solaris/prototype
@@ -0,0 +1,132 @@
+# $Id$
+i pkginfo=pkginfo
+d none etc 0755 bin bin
+d none etc/kamailio 0755 bin bin
+e none etc/kamailio/kamailio.cfg 0644 bin bin
+e none etc/kamailio/kamctlrc 0644 bin bin
+d none sbin 0755 bin bin
+f none sbin/kamailio 0755 bin bin
+f none sbin/kamctl 0755 bin bin
+f none sbin/kamailio_mysql.sh 0755 bin bin
+d none lib 0755 bin bin
+d none lib/kamailio 2755 bin bin
+d none lib/kamailio/modules 2755 bin bin
+f none lib/kamailio/modules/acc.so 0755 bin bin
+f none lib/kamailio/modules/alias_db.so 0755 bin bin
+f none lib/kamailio/modules/auth.so 0755 bin bin
+f none lib/kamailio/modules/auth_db.so 0755 bin bin
+f none lib/kamailio/modules/auth_diameter.so 0755 bin bin
+f none lib/kamailio/modules/avpops.so 0755 bin bin
+f none lib/kamailio/modules/dbtext.so 0755 bin bin
+f none lib/kamailio/modules/dialog.so 0755 bin bin
+f none lib/kamailio/modules/dispatcher.so 0755 bin bin
+f none lib/kamailio/modules/diversion.so 0755 bin bin
+f none lib/kamailio/modules/domain.so 0755 bin bin
+f none lib/kamailio/modules/domainpolicy.so 0755 bin bin
+f none lib/kamailio/modules/enum.so 0755 bin bin
+f none lib/kamailio/modules/exec.so 0755 bin bin
+f none lib/kamailio/modules/flatstore.so 0755 bin bin
+f none lib/kamailio/modules/gflags.so 0755 bin bin
+f none lib/kamailio/modules/group.so 0755 bin bin
+f none lib/kamailio/modules/lcr.so 0755 bin bin
+f none lib/kamailio/modules/jabber.so 0755 bin bin
+f none lib/kamailio/modules/mangler.so 0755 bin bin
+f none lib/kamailio/modules/maxfwd.so 0755 bin bin
+f none lib/kamailio/modules/mediaproxy.so 0755 bin bin
+f none lib/kamailio/modules/mi_fifo.so 0755 bin bin
+f none lib/kamailio/modules/msilo.so 0755 bin bin
+f none lib/kamailio/modules/mysql.so 0755 bin bin
+f none lib/kamailio/modules/nathelper.so 0755 bin bin
+f none lib/kamailio/modules/options.so 0755 bin bin
+f none lib/kamailio/modules/path.so 0755 bin bin
+f none lib/kamailio/modules/pdt.so 0755 bin bin
+f none lib/kamailio/modules/permissions.so 0755 bin bin
+f none lib/kamailio/modules/pike.so 0755 bin bin
+f none lib/kamailio/modules/registrar.so 0755 bin bin
+f none lib/kamailio/modules/rr.so 0755 bin bin
+f none lib/kamailio/modules/seas.so 0755 bin bin
+f none lib/kamailio/modules/siptrace.so 0755 bin bin
+f none lib/kamailio/modules/sl.so 0755 bin bin
+f none lib/kamailio/modules/sms.so 0755 bin bin
+f none lib/kamailio/modules/speeddial.so 0755 bin bin
+f none lib/kamailio/modules/sst.so 0755 bin bin
+f none lib/kamailio/modules/statistics.so 0755 bin bin
+f none lib/kamailio/modules/textops.so 0755 bin bin
+f none lib/kamailio/modules/tm.so 0755 bin bin
+f none lib/kamailio/modules/uac.so 0755 bin bin
+f none lib/kamailio/modules/uac_redirect.so 0755 bin bin
+f none lib/kamailio/modules/uri.so 0755 bin bin
+f none lib/kamailio/modules/uri_db.so 0755 bin bin
+f none lib/kamailio/modules/usrloc.so 0755 bin bin
+f none lib/kamailio/modules/xlog.so 0755 bin bin
+f none lib/kamailio/modules/xmpp.so 0755 bin bin
+d none lib/kamctl 0644 bin bin
+f none lib/kamctl/kamctl.base 0644 bin bin
+f none lib/kamctl/kamctl.ctlbase 0644 bin bin
+f none lib/kamctl/kamctl.sqlbase 0644 bin bin
+f none lib/kamctl/kamctl.fifo 0644 bin bin
+f none lib/kamctl/kamctl.unixsock 0644 bin bin
+f none lib/kamctl/kamctl.mysql 0644 bin bin
+d none doc 0755 bin bin
+d none doc/kamailio 0755 bin bin
+f none doc/kamailio/README 0644 bin bin
+f none doc/kamailio/INSTALL 0644 bin bin
+f none doc/kamailio/README-MODULES 0644 bin bin
+f none doc/kamailio/AUTHORS 0644 bin bin
+f none doc/kamailio/NEWS    0644 bin bin
+f none doc/kamailio/README.acc 0644 bin bin
+f none doc/kamailio/README.alias_db 0644 bin bin
+f none doc/kamailio/README.auth 0644 bin bin
+f none doc/kamailio/README.auth_db 0644 bin bin
+f none doc/kamailio/README.auth_diameter 0644 bin bin
+f none doc/kamailio/README.avpops 0644 bin bin
+f none doc/kamailio/README.dbtext  0644 bin bin
+f none doc/kamailio/README.dialog  0644 bin bin
+f none doc/kamailio/README.dispatcher  0644 bin bin
+f none doc/kamailio/README.diversion  0644 bin bin
+f none doc/kamailio/README.domain  0644 bin bin
+f none doc/kamailio/README.domainpolicy  0644 bin bin
+f none doc/kamailio/README.enum    0644 bin bin
+f none doc/kamailio/README.exec 0644 bin bin
+f none doc/kamailio/README.flatstore 0644 bin bin
+f none doc/kamailio/README.gflags 0644 bin bin
+f none doc/kamailio/README.group 0644 bin bin
+f none doc/kamailio/README.jabber 0644 bin bin
+f none doc/kamailio/README.lcr 0644 bin bin
+f none doc/kamailio/README.mangler 0644 bin bin
+f none doc/kamailio/README.maxfwd 0644 bin bin
+f none doc/kamailio/README.mediaproxy 0644 bin bin
+f none doc/kamailio/README.mi_fifo 0644 bin bin
+f none doc/kamailio/README.msilo 0644 bin bin
+f none doc/kamailio/README.mysql 0644 bin bin
+f none doc/kamailio/README.nathelper 0644 bin bin
+f none doc/kamailio/README.options 0644 bin bin
+f none doc/kamailio/README.path 0644 bin bin
+f none doc/kamailio/README.pdt 0644 bin bin
+f none doc/kamailio/README.permissions 0644 bin bin
+f none doc/kamailio/README.pike 0644 bin bin
+f none doc/kamailio/README.registrar 0644 bin bin
+f none doc/kamailio/README.rr 0644 bin bin
+f none doc/kamailio/README.siptrace 0644 bin bin
+f none doc/kamailio/README.seas 0644 bin bin
+f none doc/kamailio/README.sl 0644 bin bin
+f none doc/kamailio/README.sms 0644 bin bin
+f none doc/kamailio/README.speeddial 0644 bin bin
+f none doc/kamailio/README.statistics 0644 bin bin
+f none doc/kamailio/README.sst 0644 bin bin
+f none doc/kamailio/README.textops 0644 bin bin
+f none doc/kamailio/README.tm 0644 bin bin
+f none doc/kamailio/README.uac 0644 bin bin
+f none doc/kamailio/README.uac_redirect 0644 bin bin
+f none doc/kamailio/README.uri 0644 bin bin
+f none doc/kamailio/README.uri_db 0644 bin bin
+f none doc/kamailio/README.usrloc 0644 bin bin
+f none doc/kamailio/README.xlog 0644 bin bin
+f none doc/kamailio/README.xmpp 0644 bin bin
+d none man 0755 bin bin
+d none man/man8 0755 bin bin
+f none man/man8/kamailio.8 0644 bin bin
+f none man/man8/kamctl.8 0644 bin bin
+f none man/man8/kamunix.8 0644 bin bin
+d none man/man5 0755 bin bin
+f none man/man5/kamailio.cfg.5 0644 bin bin
diff --git a/pkg/ser/deb/debian/changelog b/pkg/ser/deb/debian/changelog
new file mode 100644
index 0000000..a5bdbf4
--- /dev/null
+++ b/pkg/ser/deb/debian/changelog
@@ -0,0 +1,156 @@
+ser (2.99.0-dev1.1) unstable; urgency=low
+
+  * Updated the build dependencies with the doc building tools:
+    docbook2x, xsltproc and lynx.
+
+ -- Andrei Pelinescu - Onciul <andrei at ape.fokus.gmd.de>  Mon, 30 Aug 2010 23:15:18 +0200
+
+ser (2.99.0-dev01) unstable; urgency=low
+
+  * Added the ser-db-modules package, containing database using modules and
+    basic DB drivers (db_text and db_flatstore).
+  * The ser-mysql-modules and ser-postgres-modules contain now only the DB
+    drivers and depend on ser-db-modules.
+  * Various minor packaging problems fixed.
+
+ -- Andrei Pelinescu-Onciul <andrei at iptel.org>  Wed, 09 Jul 2009 15:37:00 +0200
+
+ser (2.99.0-dev01) unstable; urgency=low
+
+  * Update Debian specification for sip-router.
+
+ -- Andrei Pelinescu-Onciul <andrei at iptel.org>  Wed, 08 Jul 2009 14:13:11 +0200
+
+ser (2.1.0-0dev15) unstable; urgency=low
+
+  * Added installation of *.sql files for ser_mysql.sh script.
+  * Added ser-ai1 meta-package.
+
+ -- Pavel Kasparek <pavel at iptel.org>  Mon, 10 Dec 2007 12:53:46 +0100
+
+ser (2.1.0-0dev12) unstable; urgency=low
+
+  * Updated Debian specification for cvs HEAD version.
+
+ -- Pavel Kasparek <pavel at iptel.org>  Wed, 31 Oct 2007 13:35:40 +0100
+
+ser (2.0.0-0rc5.7) unstable; urgency=low
+
+  * Updated Debian specification for upcoming SER 2.0.0 version.
+
+ -- Pavel Kasparek <pavel at iptel.org>  Tue, 11 Sep 2007 12:08:05 +0200
+
+ser (0.9.4-0.2) unstable; urgency=low
+
+  * minor debian rules clean target fix 
+
+ -- Andrei Pelinescu-Onciul <andrei at iptel.org>  Wed, 02 Nov 2005 17:46:55 +0200
+
+ser (0.9.4-0.1) unstable; urgency=low
+
+  * new upstream minor release 
+
+ -- Andrei Pelinescu-Onciul <andrei at iptel.org>  Fri, 02 Sep 2005 14:49:37 +0200
+
+ser (0.9.3-0.2) unstable; urgency=low
+
+  * missing init.d/ser fixed 
+
+ -- Andrei Pelinescu-Onciul <andrei at iptel.org>  Tue, 28 Jun 2005 23:56:05 +0200
+
+ser (0.9.3-0.1) unstable; urgency=low
+
+  * new upstream release 
+  * added ser-cpl-module, ser-pa-module, ser-postgres-module,
+    ser-acc-db-module and ser-acc-radius-module
+  * ser-radius-modules depend now on libradiusclient-ng2 
+    (not in official Debian archives)
+
+ -- Andrei Pelinescu-Onciul <andrei at iptel.org>  Thu, 23 Jun 2005 16:43:35 +0200
+
+ser (0.8.14) unstable; urgency=low
+
+  * new upstream release 
+
+ -- Andrei Pelinescu-Onciul <pelinescu-onciul at fokus.fraunhofer.de>  Fri, 23 Jul 2004 16:00:04 +0200
+
+ser (0.8.12) unstable; urgency=low
+
+  * new upstream release (improved tcp support, set_advertised_address a.s.o)
+
+ -- Andrei Pelinescu-Onciul <pelinescu-onciul at fokus.fraunhofer.de>  Fri, 14 Nov 2003 16:41:05 +0200
+
+ser (0.8.11) unstable; urgency=low
+
+  * new upstream release
+
+ -- Andrei Pelinescu-Onciul <pelinescu-onciul at fokus.fraunhofer.de>  Wed, 27 Aug 2003 14:53:24 +0200
+
+ser (0.8.11-pre34) unstable; urgency=low
+
+  * minor bugfixes
+
+  * debian packaging changes (debhelper 4.0, init & postinst cleanups, added
+    examples, a.s.o)
+
+ -- Andrei Pelinescu-Onciul <pelinescu-onciul at fokus.fraunhofer.de>  Fri, 27 Jun 2003 15:14:52 +0200
+
+ser (0.8.11-pre30) unstable; urgency=low
+
+  * minor bugfixes
+
+  * debian packaging changes (added conflicts)
+
+ -- Andrei Pelinescu-Onciul <pelinescu-onciul at fokus.fraunhofer.de>  Fri, 06 Jun 2003 14:03:29 +0200
+
+ser (0.8.11-pre29) unstable; urgency=low
+
+  * RFC3261 support (TCP, loose routing)
+
+  * lots of new modules:  rich access control lists (permissions), database in
+    textfile support (dbtext), presence agent (pa), enum support (enum),
+    voicemail interface (vm), NAT traversal utility for Cisco/ATA NAT
+    (nathelper)
+
+  * arhitectural  improvements
+
+ -- Andrei Pelinescu-Onciul <pelinescu-onciul at fokus.fraunhofer.de>  Fri, 30 May 2003 18:11:52 +0200
+
+ser (0.8.10) unstable; urgency=low
+
+ * fixes lots of  bugs in 0.8.9 (log not working, ipv6 address conversion)
+
+ * introduces port support in uri matching with myself
+
+ * faster hash function (statefull performance increase ~10%)
+
+ * modules updates (sms, jabber)
+
+ * the jabber module is in a separate package now (it depends on libexpat)
+
+ -- Andrei Pelinescu-Onciul <pelinescu-onciul at fokus.gmd.de>  Tue, 4 Nov 2002 17:23:37 +0200
+
+ser (0.8.9) unstable; urgency=low
+
+  * fixes a few bugs in 0.8.8 (primary some modules which where linked to some bad libs)
+
+ -- Andrei Pelinescu-Onciul <pelinescu-onciul at fokus.gmd.de>  Wed, 7 Oct 2002 16:49:05 +0200
+
+ser (0.8.8) unstable; urgency=low
+
+  * first release (really this time)
+
+ -- Andrei Pelinescu-Onciul <pelinescu-onciul at fokus.gmd.de>  Wed, 25 Sep 2002 23:27:11 +0200
+
+ser (0.8.7.16) unstable; urgency=low
+
+  * First Public Release.
+
+ -- Andrei Pelinescu-Onciul <pelinescu-onciul at fokus.gmd.de>  Tue, 24 Sep 2002 21:33:39 +0200
+
+ser (0.8.7.6-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Andrei Pelinescu-Onciul <pelinescu-onciul at fokus.gmd.de>  Tue, 16 Jul 2002 15:41:31 +0200
+
diff --git a/pkg/ser/deb/debian/compat b/pkg/ser/deb/debian/compat
new file mode 100644
index 0000000..b8626c4
--- /dev/null
+++ b/pkg/ser/deb/debian/compat
@@ -0,0 +1 @@
+4
diff --git a/pkg/ser/deb/debian/control b/pkg/ser/deb/debian/control
new file mode 100644
index 0000000..1931d1b
--- /dev/null
+++ b/pkg/ser/deb/debian/control
@@ -0,0 +1,117 @@
+Source: ser
+Section: net
+Priority: optional
+Maintainer: Andrei Pelinescu-Onciul <andrei at iptel.org>
+Build-Depends: debhelper (>= 4), libmysqlclient-dev | libmysqlclient15-dev | libmysqlclient14-dev | libmysqlclient12-dev, libexpat1-dev, libradius-ng-dev | libradiusclient-ng-dev, libxml2-dev, libpq-dev | postgresql-dev, libcurl3-dev, libssl-dev, libreadline5-dev, libpcre3-dev, bison, flex, docbook2x,
+ xsltproc, lynx
+Standards-Version: 3.5.2
+
+Package: ser
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
+Suggests: ser-mysql-modules, ser-jabber-module, ser-cpl-module, ser-presence-modules, ser-radius-modules
+Conflicts: ser-mysql-module (<< ${Source-Version}), ser-jabber-module (<< ${Source-Version}), ser-radius-modules (<< ${Source-Version}), ser-cpl-module (<< ${Source-Version}), ser-presence-modules (<< ${Source-Version}), ser-postgres-module (<< ${Source-Version}), ser-acc-db-module (<< ${Source-Version}), ser-acc-radius-module (<< ${Source-Version})
+Description: Sip Express Router, very fast and configurable SIP proxy
+ ser or SIP Express Router is a very fast and flexible SIP (RFC3621)
+ proxy server. Written entirely in C, ser can handle thousands calls
+ per second even on low-budget hardware. C Shell like scripting language
+ provides full control over the server's behaviour. It's modular
+ architecture allows only required functionality to be loaded.
+ Currently the following modules are available: Digest Authentication,
+ CPL scripts, Instant Messaging, MySQL support, Presence Agent, Radius
+ Authentication, Record Routing, SMS Gateway, Jabber Gateway, Transaction 
+ Module, Registrar and User Location.
+
+Package: ser-db-modules
+Architecture: any
+Depends: ${shlibs:Depends}, ser (= ${Source-Version})
+Suggests: ser-mysql-module, ser-postgres-module
+Conflicts: ser-mysql-modules
+Description: contains generic DB support and modules using a DB
+ These modules will enable usage of various DB related functionality.
+ Note that only basic DB drivers are included in this package (db_text and
+ db_flatstore). You probably want to install a more advanced db driver, like
+ the ones provided in ser-mysql-modules or ser-postgres-module packages.
+
+Package: ser-mysql-module
+Architecture: any
+Depends: ${shlibs:Depends}, ser (= ${Source-Version}), ser-db-modules (= ${Source-Version})
+Description: contains the MySQL database driver module
+ This package will enable using a MySQL database with ser.
+
+#Package: ser-jabber-module
+#Architecture: any
+#Depends: ${shlibs:Depends}, ser (= ${Source-Version})
+#Description: contains the Jabber module (SIP-Jabber message translation)
+# This has been split out of the main ser package, so that ser will not
+# depend upon libexpat. This module will enable you to use ser to translate
+# SIP messages into Jabber messages.
+
+#Package: ser-cpl-module
+#Architecture: any
+#Depends: ${shlibs:Depends}, ser (= ${Source-Version})
+#Description: contains the cpl-c module (CPL support)
+# This has been split out of the main ser package, so that ser will not
+# depend upon libxml2.
+
+#Package: ser-presence-modules
+#Architecture: any
+#Depends: ${shlibs:Depends}, ser (= ${Source-Version})
+#Description: contains the SIMPLE based presence support (Presence server)
+# This module contains modules and libraries needed to implement SIMPLE
+# based presence support in SER
+
+Package: ser-radius-modules
+Architecture: any
+Depends: ${shlibs:Depends}, ser (= ${Source-Version})
+Description: contains the ser RADIUS modules 
+ This has been split out of the main ser package, so that ser will not
+ depend upon libradius1. This modules will enable you to authenticate, 
+ do group membership checking or check the messages uris using RADIUS.
+
+Package: ser-postgres-module
+Architecture: any
+Depends: ${shlibs:Depends}, ser (= ${Source-Version}), ser-db-modules (= ${Source-Version})
+Description: contains the PostgreSQL database driver module
+ This package will enable using a PostgreSQL database with ser.
+
+Package: ser-tls-module
+Architecture: any
+Depends: ${shlibs:Depends}, ser (= ${Source-Version})
+Description: contains the TLS ser transport module
+ This has been split out of the main ser package, so that ser will not
+ depend on openssl. This module will enable you to use the TLS transport.
+
+Package: ser-xmlrpc-module
+Architecture: any
+Depends: ${shlibs:Depends}, ser (= ${Source-Version})
+Description: contains the XML-RPC based interface to SER
+ This module provides XML-RPC administrative interface to SER. The
+ interface can be used to change various configuration options of
+ SER at runtime. Other applications, such as serctl command line
+ tools and SERWeb use XML-RPC interface to communicate with SER
+
+Package: ser-oob
+Architecture: any
+Depends: ser, ser-mysql-modules, ser-xmlrpc-module, serctl
+Suggests: rttpproxy, logrotate, ngrep, ntp
+Description: Sip Express Router - package for "out of the box" installation
+ This package conatins advanced configuration file for ser - SIP Express Router
+ and depends on ser and all needed ser modules. It can be used for easy installation 
+ of ser "out of the box".
+
+Package: ser-nth
+Architecture: any
+Depends: screen, gdb, binutils, gcc, bison, flex, ngrep, tcpdump, iftop, lsof, psmisc, vim, bvi, most, serctl, mc, sipsak
+Description: Sip Express Router - package for "nice to have" installation
+ This is a meta-package for easy installation various useful tools that may be
+ handy on server with SER installed.
+
+Package: ser-ai1
+Architecture: any
+Depends: ser-oob, mysql-server, rtpproxy, mystun, sipsak, tcpdump, ngrep, iftop, serweb, sems
+Suggests: ser-nth
+Description: Sip Express Router - package for "all in one" installation
+ This is a meta-package for easy installation of complete server running ser - SIP Express
+ Router, rtpproxy -  RTP relay, mystun - STUN server and mysql server.
+
diff --git a/pkg/ser/deb/debian/copyright b/pkg/ser/deb/debian/copyright
new file mode 100644
index 0000000..76fff62
--- /dev/null
+++ b/pkg/ser/deb/debian/copyright
@@ -0,0 +1,19 @@
+This package was debianized by Andrei Pelinescu-Onciul
+<pelinescu-onciul at fokus.fraunhofer.de> on Tue, 16 Jul 2002 15:41:31 +0200.
+
+It was downloaded from http://iptel.org/ser.
+
+Upstream Authors: Andrei Pelinescu-Onciul
+<pelinescu-onciul at fokus.fraunhofer.de>, Bogdan Iancu
+<iancu at fokus.fraunhofer.de>, Daniel-Constantin Mierla, Jan Janak
+<jan at iptel.org>, Jiri Kuthan <jiri at iptel.org>, Juha Heinanen, Maxim
+Sobolev, Miklos Tirpak, Nils Ohlmeier, Ramona-Elena Modroiu, Raphael Coeffic,
+Ricardo Baratto, Stelios Sidiroglou-Douskos  (see AUTHORS file for details)
+
+This software is copyright (c) 2002-2003 by FhG Fokus
+
+You are free to distribute this software under the terms of
+the GNU General Public License.
+
+On Debian systems, the complete text of the GNU General Public
+License can be found in the file `/usr/share/common-licenses/GPL.
diff --git a/pkg/ser/deb/debian/cron.d.ex b/pkg/ser/deb/debian/cron.d.ex
new file mode 100644
index 0000000..b7d2235
--- /dev/null
+++ b/pkg/ser/deb/debian/cron.d.ex
@@ -0,0 +1,4 @@
+#
+# Regular cron jobs for the ser-0.8.7 package
+#
+0 4	* * *	root	ser-0.8.7_maintenance
diff --git a/pkg/ser/deb/debian/ex.package.doc-base b/pkg/ser/deb/debian/ex.package.doc-base
new file mode 100644
index 0000000..4600109
--- /dev/null
+++ b/pkg/ser/deb/debian/ex.package.doc-base
@@ -0,0 +1,22 @@
+Document: ser-0.8.7
+Title: Debian ser-0.8.7 Manual
+Author: <insert document author here>
+Abstract: This manual describes what ser-0.8.7 is
+ and how it can be used to
+ manage online manuals on Debian systems.
+Section: unknown
+
+Format: debiandoc-sgml
+Files: /usr/share/doc/ser-0.8.7/ser-0.8.7.sgml.gz
+
+Format: postscript
+Files: /usr/share/doc/ser-0.8.7/ser-0.8.7.ps.gz
+
+Format: text
+Files: /usr/share/doc/ser-0.8.7/ser-0.8.7.text.gz
+
+Format: HTML
+Index: /usr/share/doc/ser-0.8.7/html/index.html
+Files: /usr/share/doc/ser-0.8.7/html/*.html
+
+  
diff --git a/pkg/ser/deb/debian/manpage.1.ex b/pkg/ser/deb/debian/manpage.1.ex
new file mode 100644
index 0000000..cf44cd4
--- /dev/null
+++ b/pkg/ser/deb/debian/manpage.1.ex
@@ -0,0 +1,60 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH SER-0.8.7 SECTION "July 16, 2002"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+ser-0.8.7 \- program to do something
+.SH SYNOPSIS
+.B ser-0.8.7
+.RI [ options ] " files" ...
+.br
+.B bar
+.RI [ options ] " files" ...
+.SH DESCRIPTION
+This manual page documents briefly the
+.B ser-0.8.7
+and
+.B bar
+commands.
+This manual page was written for the Debian distribution
+because the original program does not have a manual page.
+Instead, it has documentation in the GNU Info format; see below.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
+.\" respectively.
+\fBser-0.8.7\fP is a program that...
+.SH OPTIONS
+These programs follow the usual GNU command line syntax, with long
+options starting with two dashes (`-').
+A summary of options is included below.
+For a complete description, see the Info files.
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.TP
+.B \-v, \-\-version
+Show version of program.
+.SH SEE ALSO
+.BR bar (1),
+.BR baz (1).
+.br
+The programs are documented fully by
+.IR "The Rise and Fall of a Fooish Bar" ,
+available via the Info system.
+.SH AUTHOR
+This manual page was written by Andrei Pelinescu-Onciul <pelinescu-onciul at fokus.gmd.de>,
+for the Debian GNU/Linux system (but may be used by others).
diff --git a/pkg/ser/deb/debian/manpage.sgml.ex b/pkg/ser/deb/debian/manpage.sgml.ex
new file mode 100644
index 0000000..b7e7923
--- /dev/null
+++ b/pkg/ser/deb/debian/manpage.sgml.ex
@@ -0,0 +1,152 @@
+<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
+
+<!-- Process this file with docbook-to-man to generate an nroff manual
+     page: `docbook-to-man manpage.sgml > manpage.1'.  You may view
+     the manual page with: `docbook-to-man manpage.sgml | nroff -man |
+     less'.  A typical entry in a Makefile or Makefile.am is:
+
+manpage.1: manpage.sgml
+	docbook-to-man $< > $@
+
+    
+	The docbook-to-man binary is found in the docbook-to-man package.
+	Please remember that if you create the nroff version in one of the
+	debian/rules file targets (such as build), you will need to include
+	docbook-to-man in your Build-Depends control field.
+
+  -->
+
+  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
+  <!ENTITY dhfirstname "<firstname>FIRSTNAME</firstname>">
+  <!ENTITY dhsurname   "<surname>SURNAME</surname>">
+  <!-- Please adjust the date whenever revising the manpage. -->
+  <!ENTITY dhdate      "<date>July 16, 2002</date>">
+  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
+       allowed: see man(7), man(1). -->
+  <!ENTITY dhsection   "<manvolnum>SECTION</manvolnum>">
+  <!ENTITY dhemail     "<email>pelinescu-onciul at fokus.gmd.de</email>">
+  <!ENTITY dhusername  "Andrei Pelinescu-Onciul">
+  <!ENTITY dhucpackage "<refentrytitle>SER-0.8.7</refentrytitle>">
+  <!ENTITY dhpackage   "ser-0.8.7">
+
+  <!ENTITY debian      "<productname>Debian</productname>">
+  <!ENTITY gnu         "<acronym>GNU</acronym>">
+]>
+
+<refentry>
+  <refentryinfo>
+    <address>
+      &dhemail;
+    </address>
+    <author>
+      &dhfirstname;
+      &dhsurname;
+    </author>
+    <copyright>
+      <year>2002</year>
+      <holder>&dhusername;</holder>
+    </copyright>
+    &dhdate;
+  </refentryinfo>
+  <refmeta>
+    &dhucpackage;
+
+    &dhsection;
+  </refmeta>
+  <refnamediv>
+    <refname>&dhpackage;</refname>
+
+    <refpurpose>program to do something</refpurpose>
+  </refnamediv>
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>&dhpackage;</command>
+
+      <arg><option>-e <replaceable>this</replaceable></option></arg>
+
+      <arg><option>--example <replaceable>that</replaceable></option></arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+  <refsect1>
+    <title>DESCRIPTION</title>
+
+    <para>This manual page documents briefly the
+      <command>&dhpackage;</command> and <command>bar</command>
+      commands.</para>
+
+    <para>This manual page was written for the &debian; distribution
+      because the original program does not have a manual page.
+      Instead, it has documentation in the &gnu;
+      <application>Info</application> format; see below.</para>
+
+    <para><command>&dhpackage;</command> is a program that...</para>
+
+  </refsect1>
+  <refsect1>
+    <title>OPTIONS</title>
+
+    <para>These programs follow the usual GNU command line syntax,
+      with long options starting with two dashes (`-').  A summary of
+      options is included below.  For a complete description, see the
+      <application>Info</application> files.</para>
+
+    <variablelist>
+      <varlistentry>
+        <term><option>-h</option>
+          <option>--help</option>
+        </term>
+        <listitem>
+          <para>Show summary of options.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-v</option>
+          <option>--version</option>
+        </term>
+        <listitem>
+          <para>Show version of program.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsect1>
+  <refsect1>
+    <title>SEE ALSO</title>
+
+    <para>bar (1), baz (1).</para>
+
+    <para>The programs are documented fully by <citetitle>The Rise and
+      Fall of a Fooish Bar</citetitle> available via the
+      <application>Info</application> system.</para>
+  </refsect1>
+  <refsect1>
+    <title>AUTHOR</title>
+
+    <para>This manual page was written by &dhusername; &dhemail; for
+      the &debian; system (but may be used by others).  Permission is
+      granted to copy, distribute and/or modify this document under
+      the terms of the <acronym>GNU</acronym> Free Documentation
+      License, Version 1.1 or any later version published by the Free
+      Software Foundation; with no Invariant Sections, no Front-Cover
+      Texts and no Back-Cover Texts.</para>
+
+  </refsect1>
+</refentry>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:2
+sgml-indent-data:t
+sgml-parent-document:nil
+sgml-default-dtd-file:nil
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+-->
+
+
diff --git a/pkg/ser/deb/debian/postinst b/pkg/ser/deb/debian/postinst
new file mode 100644
index 0000000..de0f5d1
--- /dev/null
+++ b/pkg/ser/deb/debian/postinst
@@ -0,0 +1,182 @@
+#!/bin/sh
+
+set -e
+
+# don't do anything when called with other argument than configure 
+case "$1" in
+  configure)
+  ;;  
+  abort-upgrade|abort-remove|abort-deconfigure)
+    exit 0
+  ;;
+  *)
+    echo "postinst called with unknown argument \$1'" >&2
+    exit 1
+  ;;
+esac
+
+. /usr/share/debconf/confmodule
+
+# add ser user
+adduser --quiet --system --group --disabled-password --shell /bin/false \
+--gecos "SIP Express Router" --home /var/run/ser ser || true
+
+if [ -d /usr/doc -a ! -e /usr/doc/ser -a -d /usr/share/doc/ser ]; then
+  ln -sf ../share/doc/ser /usr/doc/ser
+fi
+
+
+# ser defaults file, which will be modified by this script
+DEFAULTFILE=/etc/default/ser
+
+if ! test -e $DEFAULTFILE; then
+  echo "Warning: ser postinst script can't find config file $DEFAULTFILE. Configuration aborted."
+  exit 0
+fi
+
+# ----------------------------------------------------------------------
+
+fn_config_replace ()
+{
+	if test $# -ne 2; then
+	  echo "Error - bad number of input parameters"
+	  echo "usage:"
+	  echo "fn_config_replace config_file CFG_OPTION_something" 
+	  exit 1
+	fi
+
+	FILENAME="$1"
+	ITEM="$2"
+
+	echo "Changing config option $ITEM."
+	OLDFILE="$FILENAME.config_replace_bck"
+	cp -f $FILENAME $OLDFILE
+
+	REPLACEMENT="$FILENAME.repl"
+	TEMPFILE="$FILENAME.temp"
+	TAIL="$FILENAME.tail"
+
+	rm -f $REPLACEMENT
+	touch $REPLACEMENT # needed if the input is empty
+	while read -r LINE
+	do
+	  echo "$LINE" >> $REPLACEMENT
+	done
+
+	STARTPOS=`nl -b a $FILENAME | grep -w "DEBCONF-$ITEM-START" | sed -e "s/^ *\([0-9]*\).*/\1/g"`
+	if [ "$STARTPOS" == "" ]; then
+		echo "WARNING: section $ITEM not found"
+		return
+	fi
+		
+	ENDPOS=`nl -b a $FILENAME | sed -e "1,${STARTPOS}d" | grep "DEBCONF-$ITEM-END" | head -n 1 | sed -e "s/^ *\([0-9]*\).*/\1/g"`
+	if [ "$STARTPOS" == "" ]; then
+		echo "WARNING: end of section $ITEM not found"
+		return
+	fi
+	ENDPOS=$(($ENDPOS-1))
+	STARTPOS=$(($STARTPOS+1))
+
+	cat $FILENAME | sed -e "1,${ENDPOS}d" > $TAIL
+	cat $FILENAME | sed -e "${STARTPOS},\$d" > $TEMPFILE
+	cat $REPLACEMENT >> $TEMPFILE
+	cat $TAIL >> $TEMPFILE
+	rm -f $TAIL
+	mv -f $TEMPFILE $FILENAME
+}
+
+# pads $1 with as many empty rows as needed until $2 lines are complete
+padLines() {
+	output="$1"
+	needed="$2"
+	num=`echo "$output" | wc -l`
+	echo "$output"
+	moreneeded=$(($needed-$num))
+	while (true); do
+	if [ $moreneeded -gt 0 ]
+	then
+		echo ""
+		moreneeded=$(($moreneeded-1))
+	else
+		break
+	fi
+	done
+}
+
+#----------------------------------------------------------------------------
+
+
+db_get ser/config
+if [ "$RET" = "false" ] ; then
+  # do not change config file
+  echo "Package ser postinstall script: NOT modifying config file $DEFAULTFILE."
+else
+
+BACKUP="$DEFAULTFILE.config_bck"
+
+echo "Package ser postinstall script: MODIFYING config file $DEFAULTFILE."
+echo "Creating backup copy as $BACKUP"
+cp -f $DEFAULTFILE $BACKUP
+
+db_get ser/USER
+if test "$RET" != "!" ; then
+  fn_config_replace $DEFAULTFILE USER <<+++
+SER_USER="$RET"
++++
+fi
+
+db_get ser/GROUP
+if test "$RET" != "!" ; then
+  fn_config_replace $DEFAULTFILE GROUP <<+++
+SER_GROUP="$RET"
++++
+fi
+
+db_get ser/WORKDIR
+if test "$RET" != "!" ; then
+  fn_config_replace $DEFAULTFILE WORKDIR <<+++
+SER_WORKDIR="$RET"
++++
+fi
+
+db_get ser/KERNEL_CORE_PID
+if test "$RET" != "!" ; then
+  fn_config_replace $DEFAULTFILE KERNEL_CORE_PID <<+++
+SER_KERNEL_CORE_PID="$RET"
++++
+fi
+
+db_get ser/MEMORY
+if test "$RET" != "!" ; then
+  fn_config_replace $DEFAULTFILE MEMORY <<+++
+SER_MEMORY="$RET"
++++
+fi
+
+fi # if changing config
+
+echo ""
+echo "***"
+echo "Configuration of ser has finished."
+echo ""
+echo "To restart it when configuration has changed use '/etc/init.d/ser restart'"
+echo ""
+echo "To change it's configuration use 'dpkg-reconfigure ser'"
+echo "***"
+echo ""
+
+echo "Setting ser to start automatically"
+/usr/sbin/update-rc.d ser defaults || true
+
+
+if [ -x "/etc/init.d/ser" ]; then
+  if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+    invoke-rc.d ser restart || exit 0
+  else
+    /etc/init.d/ser restart || exit 0
+  fi
+fi
+                                                                
+
+exit 0
+
diff --git a/pkg/ser/deb/debian/postrm b/pkg/ser/deb/debian/postrm
new file mode 100644
index 0000000..eb08756
--- /dev/null
+++ b/pkg/ser/deb/debian/postrm
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#DEBHELPER#
+
+if [ "$1" = "purge" ] ; then
+  # remove user/group on purge
+  deluser --quiet --remove-home ser &>/dev/null || true
+  # remove /etc/ser if empty
+  rmdir /etc/ser || true
+fi
+
+exit 0
+
diff --git a/pkg/ser/deb/debian/preinst.ex b/pkg/ser/deb/debian/preinst.ex
new file mode 100644
index 0000000..d5c9921
--- /dev/null
+++ b/pkg/ser/deb/debian/preinst.ex
@@ -0,0 +1,44 @@
+#! /bin/sh
+# preinst script for ser-0.8.7
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <new-preinst> `install'
+#        * <new-preinst> `install' <old-version>
+#        * <new-preinst> `upgrade' <old-version>
+#        * <old-preinst> `abort-upgrade' <new-version>
+#
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    install|upgrade)
+#        if [ "$1" = "upgrade" ]
+#        then
+#            start-stop-daemon --stop --quiet --oknodo  \
+#                --pidfile /var/run/ser-0.8.7.pid  \
+#                --exec /usr/sbin/ser-0.8.7 2>/dev/null || true
+#        fi
+    ;;
+
+    abort-upgrade)
+    ;;
+
+    *)
+        echo "preinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
diff --git a/pkg/ser/deb/debian/prerm b/pkg/ser/deb/debian/prerm
new file mode 100644
index 0000000..2626f71
--- /dev/null
+++ b/pkg/ser/deb/debian/prerm
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+if test "$1" = "upgrade"; then
+  exit 0
+fi
+
+#DEBHELPER#
+
+
+exit 0
+
+
diff --git a/pkg/ser/deb/debian/prerm.ex b/pkg/ser/deb/debian/prerm.ex
new file mode 100644
index 0000000..77a79f5
--- /dev/null
+++ b/pkg/ser/deb/debian/prerm.ex
@@ -0,0 +1,39 @@
+#! /bin/sh
+# prerm script for ser-0.8.7
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <prerm> `remove'
+#        * <old-prerm> `upgrade' <new-version>
+#        * <new-prerm> `failed-upgrade' <old-version>
+#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+#        * <deconfigured's-prerm> `deconfigure' `in-favour'
+#          <package-being-installed> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    remove|upgrade|deconfigure)
+#       install-info --quiet --remove /usr/info/ser-0.8.7.info.gz
+        ;;
+    failed-upgrade)
+        ;;
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
diff --git a/pkg/ser/deb/debian/rules b/pkg/ser/deb/debian/rules
new file mode 100755
index 0000000..7b1f18d
--- /dev/null
+++ b/pkg/ser/deb/debian/rules
@@ -0,0 +1,243 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+#
+# $Id$
+#
+# History:
+# --------
+#  2003-05-30  updated for the 0.8.11 release, changed modules list and
+#              some ser make options (andrei)
+#  2003-06-27  changed to DH_COMPAT 4 (debian/compat) + other filenames
+#              & small fixes (andrei)
+#  2003-08-29  replaced modules-install with modules-install-all, to 
+#               install also the modules doc (andrei)
+#  2004-07-23  added ext and commented out the radius modules
+#              (the current radius modules depend on radiusclient-ng which
+#               is not yet part of debian)  (andrei)
+#  2005-06-23  added cpl-c, pa & re-enabled radius (with libradiusclient-ng)
+#                (andrei)
+#  2007-09-11  updated for ser 2.0.0 and Debian Etch
+#              presence modules commented out (can't be compiled due to some bug in Makefile)
+#              added /etc/defaults/ser file installation
+#              added ser-oob package
+#                (pavel)
+#  2007-10-31  updated for cvs head (pavel)
+#  2009-07-08  updated for sip-router (andrei)
+
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatibility version to use.
+# export DH_COMPAT=4
+#  -- already set in compat
+#  force no striping (always include debug symbols for now)
+export DEB_BUILD_OPTIONS:="$(DEB_BUILD_OPTIONS) nostrip"
+
+# modules not in the "main" ser package
+EXCLUDED_MODULES=jabber xmlrpc cpl-c
+
+# extra modules to skip, because they are not compilable now
+# - regardless if they go to the main ser package or to some module package,
+# they will be excluded from compile and install of all
+EXTRA_EXCLUDED_MODULES=seas bdb dbtext oracle pa rls iptrtpproxy
+#EXTRA_EXCLUDED_MODULES=
+
+# possible module directories that can appear in MODULES_SP
+# (only used for deducing a module name)
+MDIRS=modules modules_s modules_k
+
+# modules packaged in separate packages (complete with full modules_* path)
+# with the package name: ser-$(module_name)-module
+MODULES_SP=modules/db_mysql modules/db_postgres modules/tls modules/xmlrpc
+
+# module groups that are packaged in seperate packages
+# (with the name ser-$(group_name)-modules)
+# Note: the order is important (should be in dependency order, the one
+# on which other depend first)
+PACKAGE_GROUPS=db radius
+
+# directories with possible duplicate libraries (that should be deleted
+# from current module* packages)
+DUP_LIBS_DIRS=$(CURDIR)/debian/ser/usr/lib/ser \
+			$(CURDIR)/debian/ser-db-modules/usr/lib/ser
+
+# modules names out of modules sp
+MODULES_SP_NAMES=$(filter-out $(MDIRS),$(subst /, ,$(MODULES_SP)))
+
+# "function" to get package short name out of a dir/module_name
+# it also transforms db_foo into foo
+mod_name=$(subst db_,,$(lastword $(subst /, ,$(1))))
+
+define PACKAGE_GRP_BUILD_template
+	# package all the modules in PACKAGE_GROUPS in separate packages
+	$(foreach grp,$(PACKAGE_GROUPS),\
+		$(MAKE) every-module group_include="$(grp)"
+	)
+endef
+
+
+define PACKAGE_MODULE_BUILD_template
+	# package all the modules MODULES_SP in separate packages
+	$(foreach mod,$(MODULES_SP),\
+		$(MAKE) modules modules="$(mod)"
+	)
+endef
+
+
+define PACKAGE_GRP_INSTALL_template
+	$(foreach grp,$(PACKAGE_GROUPS),\
+		$(MAKE) install-modules-all group_include="$(grp)" \
+			basedir=$(CURDIR)/debian/ser-$(grp)-modules \
+			cfg_prefix=$(CURDIR)/debian/ser-$(grp)-modules \
+			doc-dir=share/doc/ser-$(grp)-modules
+		# eliminate duplicate libs
+		-for d in $(DUP_LIBS_DIRS); do \
+			test "$$d" != "$(CURDIR)/debian/ser-$(grp)-modules/usr/lib/ser" &&\
+			for r in $$d/lib*; do \
+				echo "removing $(grp) lib `basename $$r` present also in $$d";\
+				rm -f $(CURDIR)/debian/ser-$(grp)-modules/usr/lib/ser/`basename "$$r"` ; \
+			done ; \
+		done
+	)
+endef
+
+
+define PACKAGE_MODULE_INSTALL_template
+	$(foreach mod,$(MODULES_SP),
+		$(MAKE) install-modules-all modules="$(mod)" \
+				modules_s="" modules_k="" \
+				basedir=$(CURDIR)/debian/ser-$(call mod_name,$(mod))-module \
+				doc-dir=share/doc/ser-$(call mod_name,$(mod))-module
+		# eliminate duplicate libs
+		-for d in $(DUP_LIBS_DIRS); do \
+			test "$$d" != "$(CURDIR)/debian/ser-$(call mod_name,$(mod))-module/usr/lib/ser" &&\
+			for r in $$d/lib*; do \
+				echo "removing $(call mod_name, $(mod)) lib `basename $$r` present also in $$d";\
+				rm -f $(CURDIR)/debian/ser-$(call mod_name,$(mod))-module/usr/lib/ser/`basename "$$r"` ; \
+			done ; \
+		done
+	)
+endef
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	INSTALL_PROGRAM += -s
+endif
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	# Add here commands to configure the package.
+	$(MAKE) cfg prefix=/usr cfg_prefix=$(CURDIR)/debian/ser \
+			cfg_target=/etc/ser/ \
+			basedir=$(CURDIR)/debian/ser \
+			skip_modules="$(EXCLUDED_MODULES) $(EXTRA_EXCLUDED_MODULES)" \
+			group_include="standard"
+
+	touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp 
+	dh_testdir
+	# Add here commands to compile the package.
+	$(MAKE) all
+	# make groups
+	$(call PACKAGE_GRP_BUILD_template)
+	# make single-module packages
+	$(call PACKAGE_MODULE_BUILD_template)
+	#/usr/bin/docbook-to-man debian/ser.sgml > ser.1
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	# Add here commands to clean up after the build process.
+	-$(MAKE) maintainer-clean
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+	# Add here commands to install the package into debian/ser
+	$(MAKE) install group_include="standard"
+	# fix etc/ser dir location -- not needed -- andrei
+	# mv -f $(CURDIR)/debian/ser/usr/etc $(CURDIR)/debian/ser
+	# make group packages
+	$(call PACKAGE_GRP_INSTALL_template)
+	# make single module packages
+	$(call PACKAGE_MODULE_INSTALL_template)
+	# install /etc/default/ser file
+	mkdir -p $(CURDIR)/debian/ser/etc/default
+	cp -f debian/ser.default $(CURDIR)/debian/ser/etc/default/ser
+	# install the *.sql files for ser_mysql.sh script
+	cp -f scripts/mysql/*.sql $(CURDIR)/debian/ser-mysql-module/usr/lib/ser/
+	# and fix path to the *.sql files in ser_mysql.sh script
+	sed -i 's#DEFAULT_SCRIPT_DIR=.*#DEFAULT_SCRIPT_DIR="/usr/lib/ser/"#' \
+		$(CURDIR)/debian/ser-mysql-module/usr/sbin/ser_mysql.sh
+	# install advanced ser config file for ser-oob package
+	mkdir -p $(CURDIR)/debian/ser-oob/etc/ser
+	cp -f etc/sip-router-oob.cfg $(CURDIR)/debian/ser-oob/etc/ser/ser-oob.cfg
+	#dh_movefiles
+
+
+
+# This single target is used to build all the packages, all at once, or
+# one at a time. So keep in mind: any options passed to commands here will
+# affect _all_ packages. Anything you want to only affect one package
+# should be put in another target, such as the install target.
+binary-common: 
+	dh_testdir
+	dh_testroot
+	dh_installdebconf	
+	dh_installdocs
+	dh_installexamples
+	dh_installmenu
+#	dh_installlogrotate
+#	dh_installemacsen
+#	dh_installpam
+#	dh_installmime
+	dh_installinit  -- defaults 23
+	dh_installcron
+	dh_installman
+	dh_installinfo
+#	dh_undocumented
+	dh_installchangelogs 
+	dh_link
+	dh_strip
+	dh_compress 
+	dh_fixperms
+	dh_makeshlibs
+	dh_installdeb
+#	dh_perl
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+# Build architecture-independent packages using the common target
+binary-indep: build install
+# (Uncomment this next line if you have such packages.)
+#        $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
+# We have nothing to do by default.
+
+
+# Build architecture-dependent packages using the common target
+binary-arch: build install
+	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
+
+# Any other binary targets build just one binary package at a time.
+binary-%: build install
+	$(MAKE) -f debian/rules binary-common DH_OPTIONS=-p$*
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
+
diff --git a/pkg/ser/deb/debian/ser-oob.config b/pkg/ser/deb/debian/ser-oob.config
new file mode 100644
index 0000000..fdd3732
--- /dev/null
+++ b/pkg/ser/deb/debian/ser-oob.config
@@ -0,0 +1,81 @@
+#!/bin/sh -e
+
+. /usr/share/debconf/confmodule
+
+# set cfg file name in default/ser file
+db_input medium ser-oob/CFG_FILE || true
+db_go
+
+# configure the ser-oob.cfg file ?
+db_input medium ser-oob/config || true
+db_go
+
+db_get ser-oob/config
+
+if [ "$RET" = "false" ]; then
+  exit 0
+fi
+
+db_input medium ser-oob/SERVERID || true
+db_go
+
+db_input medium ser-oob/LISTEN || true
+db_go
+
+# ask for administrative address and for replication sending addr only if listen addr was set
+db_get ser-oob/LISTEN
+if [ "$RET" != "" ]; then
+  db_input medium ser-oob/ADMINADDR || true
+  db_go
+  db_input medium ser-oob/SENDADDR || true
+  db_go
+else
+  # set admin addr to empty
+  db_set ser-oob/ADMINADDR
+fi
+
+db_input medium ser-oob/DBURL || true
+db_go
+
+db_input medium ser-oob/DBURLACC || true
+db_go
+
+db_input medium ser-oob/AUTHSECRET || true
+db_go
+
+db_input medium ser-oob/RTTPPROXY || true
+db_go
+
+db_input medium ser-oob/RTP_ENABLE || true
+db_go
+
+db_input medium ser-oob/NATPING_INTERVAL || true
+db_go
+
+db_input medium ser-oob/DBMODE || true
+db_go
+
+db_input medium ser-oob/CREATE_DB || true
+db_go
+
+db_get ser-oob/CREATE_DB
+if [ "$RET" = "true" ]; then
+  db_input medium ser-oob/MYSQLPASS || true
+  db_go
+fi
+
+db_input medium ser-oob/SERCTL_DOMAIN || true
+db_go
+
+db_get ser-oob/SERCTL_DOMAIN
+if [ "$RET" != "" ]; then
+  db_input medium ser-oob/SERCTL_USER || true
+  db_go
+
+  db_get ser-oob/SERCTL_USER
+  if [ "$RET" != "" ]; then
+    db_input medium ser-oob/SERCTL_PASS || true
+    db_go
+  fi
+fi
+
diff --git a/pkg/ser/deb/debian/ser-oob.postinst b/pkg/ser/deb/debian/ser-oob.postinst
new file mode 100644
index 0000000..d86a107
--- /dev/null
+++ b/pkg/ser/deb/debian/ser-oob.postinst
@@ -0,0 +1,286 @@
+#!/bin/sh
+
+set -e
+
+# don't do anything when called with other argument than configure 
+case "$1" in
+  configure)
+  ;;  
+  abort-upgrade|abort-remove|abort-deconfigure)
+    exit 0
+  ;;
+  *)
+    echo "postinst called with unknown argument \$1'" >&2
+    exit 1
+  ;;
+esac
+
+. /usr/share/debconf/confmodule
+
+
+# ser config file that will be altered by this script, based on debconf values
+CONFIGFILE=/etc/ser/ser-oob.cfg 
+# ser defaults file, where config filename is set
+DEFAULTFILE=/etc/default/ser
+
+
+if ! test -e $CONFIGFILE; then
+  echo "Warning: ser-oob postinst script can't find config file $CONFIGFILE. Configuration aborted."
+  exit 0
+fi
+
+if ! test -e $DEFAULTFILE; then
+  echo "Warning: ser-oob postinst script can't find config file $DEFAULTFILE. Configuration aborted."
+  exit 0
+fi
+
+
+fn_config_replace ()
+{
+	if test $# -ne 2; then
+	  echo "Error - bad number of input parameters"
+	  echo "usage:"
+	  echo "fn_config_replace config_file CFG_OPTION_something" 
+	  exit 1
+	fi
+
+	FILENAME="$1"
+	ITEM="$2"
+
+	echo "Changing config option $ITEM."
+	OLDFILE="$FILENAME.config_replace_bck"
+	cp -f $FILENAME $OLDFILE
+
+	REPLACEMENT="$FILENAME.repl"
+	TEMPFILE="$FILENAME.temp"
+	TAIL="$FILENAME.tail"
+
+	rm -f $REPLACEMENT
+	touch $REPLACEMENT # needed if the input is empty
+	while read -r LINE
+	do
+	  echo "$LINE" >> $REPLACEMENT
+	done
+
+	STARTPOS=`nl -b a $FILENAME | grep -w "DEBCONF-$ITEM-START" | sed -e "s/^ *\([0-9]*\).*/\1/g"`
+	if [ "$STARTPOS" == "" ]; then
+		echo "WARNING: section $ITEM not found"
+		return
+	fi
+		
+	ENDPOS=`nl -b a $FILENAME | sed -e "1,${STARTPOS}d" | grep "DEBCONF-$ITEM-END" | head -n 1 | sed -e "s/^ *\([0-9]*\).*/\1/g"`
+	if [ "$STARTPOS" == "" ]; then
+		echo "WARNING: end of section $ITEM not found"
+		return
+	fi
+	ENDPOS=$(($ENDPOS-1))
+	STARTPOS=$(($STARTPOS+1))
+
+	cat $FILENAME | sed -e "1,${ENDPOS}d" > $TAIL
+	cat $FILENAME | sed -e "${STARTPOS},\$d" > $TEMPFILE
+	cat $REPLACEMENT >> $TEMPFILE
+	cat $TAIL >> $TEMPFILE
+	rm -f $TAIL
+	mv -f $TEMPFILE $FILENAME
+}
+
+# pads $1 with as many empty rows as needed until $2 lines are complete
+padLines() {
+	output="$1"
+	needed="$2"
+	num=`echo "$output" | wc -l`
+	echo "$output"
+	moreneeded=$(($needed-$num))
+	while (true); do
+	if [ $moreneeded -gt 0 ]
+	then
+		echo ""
+		moreneeded=$(($moreneeded-1))
+	else
+		break
+	fi
+	done
+}
+
+#----------------------------------------------------------------------------
+
+db_get ser-oob/CFG_FILE
+if test "$RET" != "!" ; then
+  echo "Package ser-oob postinstall script: MODIFYING config file $DEFAULTFILE."
+  fn_config_replace $DEFAULTFILE CFG_FILE <<+++
+SER_CFG_FILE="$RET"
++++
+fi
+
+db_get ser-oob/config
+if [ "$RET" = "false" ] ; then
+  # do not change config file
+  echo "Package ser-oob postinstall script: NOT modifying config file $CONFIGFILE."
+else
+
+BACKUP="$CONFIGFILE.config_bck"
+
+echo "Package ser-oob postinstall script: MODIFYING config file $CONFIGFILE."
+echo "Creating backup copy as $BACKUP"
+cp -f $CONFIGFILE $BACKUP
+
+db_get ser-oob/SERVERID
+if test "$RET" != "!" ; then
+  fn_config_replace $CONFIGFILE SERVERID <<+++
+server_id=$RET
++++
+fi
+
+db_get ser-oob/LISTEN
+if test "$RET" != "!" ; then
+  if test "$RET" != "" ; then
+    echo "$RET"|sed 's/,/\n/g'|awk '{print "listen=\"" $1 "\""}' | \
+    fn_config_replace $CONFIGFILE LISTEN
+    # enable the replication block
+    echo "#" | fn_config_replace $CONFIGFILE REPLICATION1
+    echo "#" | fn_config_replace $CONFIGFILE REPLICATION2
+    # enable replication listen addr
+    echo "listen=224.0.1.75" | fn_config_replace $CONFIGFILE LISTEN_REPL
+  else
+    echo "#listen=127.0.0.1" | fn_config_replace $CONFIGFILE LISTEN
+    # comment out the replication block
+    echo "/*" | fn_config_replace $CONFIGFILE REPLICATION1
+    echo "*/" | fn_config_replace $CONFIGFILE REPLICATION2
+    # disable replication listen addr
+    echo "#listen=224.0.1.75" | fn_config_replace $CONFIGFILE LISTEN_REPL
+  fi
+fi
+
+db_get ser-oob/ADMINADDR
+if test "$RET" != "!" ; then
+  if test "$RET" != "" ; then
+    echo "listen=udp:$RET" | fn_config_replace $CONFIGFILE LISTEN_ADMIN
+  else
+    echo "#listen=udp:127.0.0.1" | fn_config_replace $CONFIGFILE LISTEN_ADMIN
+  fi
+fi
+
+db_get ser-oob/SENDADDR
+if test "$RET" != "!" ; then
+  fn_config_replace $CONFIGFILE REPL_SEND_ADDR <<+++
+		force_send_socket(udp:$RET);
++++
+fi
+
+db_get ser-oob/DBURL
+DBURL="$RET"
+if test "$RET" != "!" ; then
+  fn_config_replace $CONFIGFILE DBURL <<+++
+modparam("speeddial|auth_db|usrloc|acc_db|domain|uri_db|gflags|avp_db|db_ops", "db_url", "$RET")
++++
+fi
+
+db_get ser-oob/DBURLACC
+if test "$RET" = "" ; then
+  RET="$DBURL"
+fi    
+if test "$RET" != "!" ; then
+  fn_config_replace $CONFIGFILE DBURLACC <<+++
+modparam("acc_db", "db_url", "$RET")
++++
+fi
+
+db_get ser-oob/AUTHSECRET
+if test "$RET" != "!" ; then
+  fn_config_replace $CONFIGFILE AUTHSECRET <<+++
+modparam("auth", "secret", "$RET")
++++
+fi
+
+db_get ser-oob/RTTPPROXY
+if test "$RET" != "!" ; then
+  fn_config_replace $CONFIGFILE RTTPPROXY <<+++
+modparam("nathelper", "rtpproxy_sock", "$RET")
++++
+fi
+
+db_get ser-oob/RTP_ENABLE
+if test "$RET" != "!" ; then
+  fn_config_replace $CONFIGFILE RTP_ENABLE <<+++
+rtp_proxy.enabled = "$RET" desc "indicates whether the RTP Proxy is enabled or not (0/1/detect)"
++++
+fi
+
+db_get ser-oob/NATPING_INTERVAL
+if test "$RET" != "!" ; then
+  fn_config_replace $CONFIGFILE NATPING_INTERVAL <<+++
+modparam("nathelper", "natping_interval", $RET)
++++
+fi
+
+db_get ser-oob/DBMODE
+if test "$RET" != "!" ; then
+  fn_config_replace $CONFIGFILE DBMODE <<+++
+modparam("usrloc", "db_mode", $RET)
++++
+fi
+
+db_get ser-oob/CREATE_DB
+if [ "$RET" = "true" ] ; then
+  db_set ser-oob/CREATE_DB false
+  db_get ser-oob/MYSQLPASS
+  PASS="$RET"
+  db_set ser-oob/MYSQLPASS ""
+  echo "Creating ser database"
+  /usr/sbin/ser_mysql.sh create -q$PASS
+fi
+
+# restart ser - after creating db, but before calling ser_ctl
+if [ -x "/etc/init.d/ser" ]; then
+  if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+    invoke-rc.d ser restart || echo "Warning: ser restart failed!"
+  else
+    /etc/init.d/ser restart || echo "Warning: ser restart failed!"
+  fi
+fi
+
+db_get ser-oob/SERCTL_DOMAIN
+if [ "$RET" != "" ] ; then
+  DOMAIN="$RET"
+  # clear it, to be sure we do not add it more than once
+  db_set ser-oob/SERCTL_DOMAIN
+  # add the domain using ser_ctl
+  echo "Waiting for ser to finish startup..."
+  # wait some time, to allow ser start after starting it
+  sleep 10
+  echo "Calling ser_ctl to add domain"
+  ser_ctl domain add $DOMAIN || echo "Warning: ser_ctl failed!"
+
+  db_get ser-oob/SERCTL_USER
+  if [ "$RET" != "" ] ; then
+    USER="$RET"
+    # clear it, to be sure we do not add it more than once
+    db_set ser-oob/SERCTL_USER
+    # get the user password
+    db_get ser-oob/SERCTL_PASS
+    PASS="$RET"
+    # clear it
+    db_set ser-oob/SERCTL_PASS
+    # add the user using ser_ctl
+    echo "Calling ser_ctl to add user"
+    ser_ctl user add $USER@$DOMAIN -p "$PASS" || echo "Waring: ser_ctl failed!"
+    echo "Calling ser_ctl to set user rights"
+    ser_ctl attrs set $USER@$DOMAIN sw_is_admin=1 sw_is_hostmaster=1 || echo "Waring: ser_ctl failed!"
+  fi
+fi
+
+
+fi # if changing config
+
+echo ""
+echo "***"
+echo "Configuration of ser-oob has finished."
+echo ""
+echo "To restart it when configuration has changed use '/etc/init.d/ser restart'"
+echo ""
+echo "To change it's configuration use 'dpkg-reconfigure ser-oob'"
+echo "***"
+echo ""
+
+exit 0
+
diff --git a/pkg/ser/deb/debian/ser-oob.postrm b/pkg/ser/deb/debian/ser-oob.postrm
new file mode 100644
index 0000000..808300f
--- /dev/null
+++ b/pkg/ser/deb/debian/ser-oob.postrm
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+#DEBHELPER#
+
+
+exit 0
diff --git a/pkg/ser/deb/debian/ser-oob.prerm b/pkg/ser/deb/debian/ser-oob.prerm
new file mode 100644
index 0000000..2626f71
--- /dev/null
+++ b/pkg/ser/deb/debian/ser-oob.prerm
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+if test "$1" = "upgrade"; then
+  exit 0
+fi
+
+#DEBHELPER#
+
+
+exit 0
+
+
diff --git a/pkg/ser/deb/debian/ser-oob.templates b/pkg/ser/deb/debian/ser-oob.templates
new file mode 100644
index 0000000..6dcf79a
--- /dev/null
+++ b/pkg/ser/deb/debian/ser-oob.templates
@@ -0,0 +1,191 @@
+Template: ser-oob/CFG_FILE
+Type: string
+Default: /etc/ser/ser-oob.cfg
+Description: SER config file name 
+ This option sets SER config file name in '/etc/default/ser' file, which is used by SER init
+ script to start SER.
+ .
+ It is recommended to use the default value '/etc/ser/ser-oob.cfg'.
+ .
+ If you do not want to modify this setting now you can modify it manually later,
+ or repeat this configuartion by running "dpkg-reconfigure ser-oob".
+ .
+ Note: this value you enter here will be automatically applied to '/etc/default/ser' file
+ each time the ser-oob package is upgraded (or installed without purging previous
+ installation).
+ .
+ Enter "!" to not modify this option.
+
+Template: ser-oob/config
+Type: boolean
+Default: false
+Description: Change config file now ?
+ You have now opportunity to modify basic configuration values in 'ser-oob.cfg'
+ config file for SER Sip Express Router, installed from 'ser-oob' package.
+ If you do not want to modify the config file now you can modify it manually later,
+ or repeat this configuartion by running "dpkg-reconfigure ser-oob".
+ .
+ Note: the values you enter here will be automatically applied to 'ser-oob.cfg' file
+ each time the ser-oob package is upgraded (or installed without purging previous
+ installation).
+
+Template: ser-oob/SERVERID
+Type: string
+Default: 1
+Description: Unique identifier of the SER server
+ This is the unique identifier of the SER server. You only have to change this option
+ if you are setting up a cluster of SER servers. In that case each SER server within
+ the cluster must have its own unique number. Leave this option untouched if you are
+ setting up a single SER server only. Use integer numbes only.
+ .
+ Enter "!" to not modify this option.
+
+Template: ser-oob/LISTEN
+Type: string
+Default: 127.0.0.1
+Description: List of IP addresses to listen on
+ List of all IP addresses SER will listen for SIP messages on. 
+ Multiple entries may be entered separated by commas.
+ Enter empty string to not set explicit listening address.
+ The order is important - SER will use the first address as the default address when it
+ doesn't know what socket to choose.
+ Please do not list private administrative address here (separate question for it will follow).
+ .
+ Note: if you do not specify any listen ip address then SER will listen on all interfaces,
+ and also replication using multicast will be disabled in the ser config.
+ .
+ Enter "!" to not modify this option.
+
+Template: ser-oob/ADMINADDR
+Type: string
+Default:
+Description: Administrative IP address
+ Set the IP address of administrative interface (usually a private one), on which
+ Ser will also listen.
+ .
+ You can enter empty string to not listen on any administrative address.
+ .
+ Enter "!" to not modify this option.
+
+Template: ser-oob/SENDADDR
+Type: string
+Default: 127.0.0.1
+Description: IP address used for sending replication
+ Set source IP address that Ser will use for sending REGISTERs replication
+ to multicast address.
+ .
+ Enter "!" to not modify this option.
+
+Template: ser-oob/DBURL
+Type: string
+Default: mysql://ser:heslo@127.0.0.1/ser
+Description: address of database
+ Set the address of your database server which includes all provisioning
+ data. Example is "mysql://ser:heslo@localhost/ser".
+ .
+ Enter "!" to not modify this option.
+
+Template: ser-oob/DBURLACC
+Type: string
+Default: mysql://ser:heslo@127.0.0.1/ser
+Description: address of database for accounting
+ Set the address of your database that will be used for acconting. Example is "mysql://ser:heslo@localhost/ser".
+ .
+ You can leave it blank to use the same db as for provisioning data.
+ .
+ Enter "!" to not modify this option.
+
+Template: ser-oob/AUTHSECRET
+Type: string
+Default: SomeSecretVerySecret
+Description: Synchronization secret for twin servers:
+ Local value used to generate secure nonces. Set it to a long random
+ string such as "alsdkhgla5sd7fkloKwr". Make sure that in hot/standby
+ setup the same secret is used on both machines.
+ .
+ Enter "!" to not modify this option.
+
+Template: ser-oob/RTTPPROXY
+Type: string
+Default: udp:127.0.0.1:22222
+Description: RTP proxy control socket
+ Set address of RTP proxy control socket. Example: "udp:localhost:22222".
+ Enter empty string to not set any RTP proxy address.
+ .
+ Enter "!" to not modify this option.
+
+Template: ser-oob/RTP_ENABLE
+Type: select
+Choices: 0, 1, detect, !
+Default: detect
+Description: Enable or disable the rtp proxy
+ Select whether to enable or disable using of RTP proxy. Possible values are:
+ "0" -- always disable, "1" -- always enable regardless of whether UAC or UAS is behind NAT,
+ "detect" -- detect whether the UAC or the UAS is behind NAT, and enable the rtp proxy
+ when necessary.
+ .
+ Use "!" to not modify this option.
+
+Template: ser-oob/NATPING_INTERVAL
+Type: select
+Choices: 0, 15, !
+Default: 15
+Description: NAT ping interval
+ Set NAT ping interval.
+ .
+ Use "!" to not modify this option.
+
+Template: ser-oob/DBMODE
+Type: select
+Choices: 0, 1, 2, !
+Default: 1
+Description: usrloc database mode
+ Set usrloc module db_mode option. Choices are: 0 -- memory cached,
+ 1 -- write thru, 2 -- delayed write.
+ .
+ 1 is generally safer than 2 ... 2 can help to survive peaks in load
+ however it creates delayed peaks that can impair request-processing
+ latency later (it would have to be re-redesigned more lock-free to
+ avoid it).
+ .
+ Enter "!" to not modify this option.
+
+Template: ser-oob/CREATE_DB
+Type: boolean
+Default: false
+Description: Create ser database
+ Do you want to create ser database 'ser' with default users 'ser' and 'serro' on Mysql
+ server running on localhost ? You should use this option when doing first-time installation only.
+ .
+ Note: you can run the script creation script manually by calling 'ser_mysql.sh'.
+
+Template: ser-oob/MYSQLPASS
+Type: string
+Default:
+Description: Mysql root password
+ Please enter your Mysql root password. It will be used to create the ser database. You can leave it empty
+ to use empty password.
+
+Template: ser-oob/SERCTL_DOMAIN
+Type: string
+Default:
+Description: Domain
+ Please enter your sip domain name. A record for it will be added using 'ser_ctl domain add' command. Note: this requires database to be already working.
+ .
+ Leave this entry empty to not add any domain.
+
+Template: ser-oob/SERCTL_USER
+Type: string
+Default:
+Description: Admin user
+ Please enter username for admin user. It will be created using 'ser_ctl user add' command and it's rights will be set using 'ser_ctl attrs <user> sw_is_admin=1 sw_is_hostmaster=1' command.
+ Note: this requires database to be already working.
+ .
+ Leave this entry empty to not add the user record.
+
+Template: ser-oob/SERCTL_PASS
+Type: string
+Default:
+Description: Admin user password
+ Please enter password for admin user.
+
diff --git a/pkg/ser/deb/debian/ser.config b/pkg/ser/deb/debian/ser.config
new file mode 100644
index 0000000..7d4ee16
--- /dev/null
+++ b/pkg/ser/deb/debian/ser.config
@@ -0,0 +1,29 @@
+#!/bin/sh -e
+
+. /usr/share/debconf/confmodule
+
+# configure ?
+db_input medium ser/config || true
+db_go
+
+db_get ser/config
+
+if [ "$RET" = "false" ]; then
+  exit 0
+fi
+
+db_input medium ser/USER || true
+db_go
+
+db_input medium ser/GROUP || true
+db_go
+
+db_input medium ser/WORKDIR || true
+db_go
+
+db_input medium ser/KERNEL_CORE_PID || true
+db_go
+
+db_input medium ser/MEMORY || true
+db_go
+
diff --git a/pkg/ser/deb/debian/ser.default b/pkg/ser/deb/debian/ser.default
new file mode 100644
index 0000000..448a88c
--- /dev/null
+++ b/pkg/ser/deb/debian/ser.default
@@ -0,0 +1,44 @@
+# configuration for ser - Sip Expres Router
+#
+# this file is sourced by ser init script /etc/init.d/ser
+
+# Note: the #DEBCONF-xxx-START and DEBCONF-xxx-END lines are used for
+# debconf configuration, please don't remove or alter them.
+
+# ser configuration file
+#DEBCONF-CFG_FILE-START
+SER_CFG_FILE="/etc/ser/ser.cfg"
+#DEBCONF-CFG_FILE-END
+
+# user to run ser as
+#DEBCONF-USER-START
+SER_USER="root"
+#DEBCONF-USER-END
+
+# group to run ser as
+#DEBCONF-GROUP-START
+SER_GROUP="root"
+#DEBCONF-GROUP-END
+
+# ser pidfile
+SER_PIDFILE="/var/run/ser/ser.pid"
+
+# working dir (cores will be placed there in case of ser crash)
+#DEBCONF-WORKDIR-START
+#SER_WORKDIR="/var/cores"
+#DEBCONF-WORKDIR-END
+
+# set if you want kernel flag to use pid for core files
+#DEBCONF-KERNEL_CORE_PID-START
+#SER_KERNEL_CORE_PID="yes"
+#DEBCONF-KERNEL_CORE_PID-END
+
+# size of shared memory used by ser, in megabytes
+#DEBCONF-MEMORY-START
+#SER_MEMORY="128"
+#DEBCONF-MEMORY-END
+
+
+
+
+
diff --git a/pkg/ser/deb/debian/ser.examples b/pkg/ser/deb/debian/ser.examples
new file mode 100644
index 0000000..efa9c4c
--- /dev/null
+++ b/pkg/ser/deb/debian/ser.examples
@@ -0,0 +1,15 @@
+examples/acc.cfg
+examples/ccdiversion.cfg
+examples/ctd.sh
+examples/exec.cfg
+examples/logging.cfg
+examples/msilo.cfg
+examples/onr.cfg
+examples/pstn.cfg
+examples/redirect.cfg
+examples/replicate.cfg
+examples/serial_183.cfg
+examples/uas.cfg
+examples/vm_proxy.cfg
+examples/voicemail.cfg
+examples/welcome.cfg
diff --git a/pkg/ser/deb/debian/ser.init b/pkg/ser/deb/debian/ser.init
new file mode 100644
index 0000000..b18aaef
--- /dev/null
+++ b/pkg/ser/deb/debian/ser.init
@@ -0,0 +1,125 @@
+#! /bin/sh
+#
+# skeleton	example file to build /etc/init.d/ scripts.
+#		This file should be used to construct scripts for /etc/init.d.
+#
+#		Written by Miquel van Smoorenburg <miquels at cistron.nl>.
+#		Modified for Debian GNU/Linux
+#		by Ian Murdock <imurdock at gnu.ai.mit.edu>.
+#
+# Version:	@(#)skeleton  1.8  03-Mar-1998  miquels at cistron.nl
+#
+#  adapted for ser by Andrei Pelinescu-Onciul <pelinescu-onciul at fokus.gmd.de>
+# $Id$
+
+# read configuration from /etc/default/ser file
+if test -f /etc/default/ser ; then
+  . /etc/default/ser
+fi
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/ser
+NAME=ser
+DESC=ser
+
+PARAMS=""
+
+if test "$SER_PIDFILE" ; then
+  PARAMS="$PARAMS -P $SER_PIDFILE"
+fi
+
+if test "$SER_USER" ; then
+  PARAMS="$PARAMS -u $SER_USER"
+fi
+
+if test "$SER_GROUP" ; then
+  PARAMS="$PARAMS -g $SER_GROUP"
+fi
+
+if test "$SER_CFG_FILE" ; then
+  PARAMS="$PARAMS -f $SER_CFG_FILE"
+  CFGPARAMS="-f $SER_CFG_FILE"
+fi
+
+if test "$SER_WORKDIR" ; then
+  PARAMS="$PARAMS -w $SER_WORKDIR"
+  # try to create the working dir
+  mkdir -p $SER_WORKDIR || echo "Warning: error creating ser working dir $SER_WORKDIR"
+fi
+
+if test "$SER_MEMORY" ; then
+  PARAMS="$PARAMS -m $SER_MEMORY"
+fi
+
+if test "$SER_KERNEL_CORE_PID" = "true" ; then
+  # enable using pid for cores
+  echo 1 > /proc/sys/kernel/core_uses_pid || echo "Warning: error when enabling /proc/sys/kernel/core_uses_pid"
+fi
+
+if ! test -f $DAEMON ; then
+  echo "Error: cannot find $DAEMON"
+  exit 0
+fi
+
+LD_LIBRARY_PATH=/usr/lib/ser
+export LD_LIBRARY_PATH
+
+set -e
+
+case "$1" in
+  start)
+	echo -n "Starting $DESC: $NAME"
+	start-stop-daemon --start --quiet --pidfile $SER_PIDFILE \
+		--exec $DAEMON -- $PARAMS
+	echo "."
+	;;
+  stop)
+	echo -n "Stopping $DESC: $NAME"
+	start-stop-daemon --oknodo --stop --quiet --pidfile $SER_PIDFILE \
+		--exec $DAEMON
+	echo "."
+	;;
+  #reload)
+	#
+	#	If the daemon can reload its config files on the fly
+	#	for example by sending it SIGHUP, do it here.
+	#
+	#	If the daemon responds to changes in its config file
+	#	directly anyway, make this a do-nothing entry.
+	#
+	# echo "Reloading $DESC configuration files."
+	# start-stop-daemon --stop --signal 1 --quiet --pidfile \
+	#	$SER_PIDFILE --exec $DAEMON
+  #;;
+  restart|force-reload)
+	#
+	#	If the "reload" option is implemented, move the "force-reload"
+	#	option to the "reload" entry above. If not, "force-reload" is
+	#	just the same as "restart".
+	#
+	# Check if ser configuration is valid before restarting the server
+        (($DAEMON $CFGPARAMS -c 2>&1) | grep "config file ok, exiting") > /dev/null
+	if [ $? -ne 0 ]; then
+            ($DAEMON $CFGPARAMS -c 2>&1)
+	    echo -e "\nThere are errors in the configuration file. Please fix them first"
+	    echo -e "\n$out\n"
+	    exit 0
+	fi
+	echo -n "Restarting $DESC: $NAME"
+	start-stop-daemon --oknodo --stop --quiet --pidfile \
+		$SER_PIDFILE --exec $DAEMON
+	sleep 1
+	start-stop-daemon --start --quiet --pidfile \
+		$SER_PIDFILE --exec $DAEMON  -- $PARAMS
+	echo "."
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
+	echo "Usage: $N {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
+
diff --git a/pkg/ser/deb/debian/ser.templates b/pkg/ser/deb/debian/ser.templates
new file mode 100644
index 0000000..9b91b96
--- /dev/null
+++ b/pkg/ser/deb/debian/ser.templates
@@ -0,0 +1,59 @@
+Template: ser/config
+Type: boolean
+Default: false
+Description: Change config file now ?
+ You have now opportunity to modify basic configuration values in '/etc/default/ser'
+ config file for SER Sip Express Router, installed from 'ser' package. Settings from this
+ file are used by SER init script when it is started - e.g. size of shared memory used,
+ user and group to run as, working directory.
+ .
+ If you do not want to modify the config file now you can modify it manually later,
+ or repeat this configuartion by running "dpkg-reconfigure ser".
+ .
+ Note: if you choose 'yes' here then the values you enter will be automatically applied
+ each time the ser package is upgraded (or installed without purging previous installation).
+
+Template: ser/USER
+Type: string
+Default: root
+Description: User to run SER as
+ Set the user which SER should run as. Default is 'root' user.
+ .
+ Note: if you want ser to be able to dump a core file in case of crash, you have to run it as root user.
+ .
+ Enter "!" to not modify this option.
+
+Template: ser/GROUP
+Type: string
+Default: root
+Description: Group to run SER as
+ Set the group which SER should run as. Default is 'root' group.
+ .
+ Enter "!" to not modify this option.
+
+Template: ser/WORKDIR
+Type: string
+Default: /
+Description: SER working directory
+ Set the working directory to which core files will be written in case of SER crash.
+ For debugging purposes it is recommended to use '/var/cores' directory. The directory will
+ be created automatically by SER init script if not existing.
+ .
+ Enter "!" to not modify this option.
+
+Template: ser/KERNEL_CORE_PID
+Type: boolean
+Default: false
+Description: Set kernel to use pid for core files
+ If enabled the '/proc/sys/kernel/core_uses_pid' will be set to '1' before starting SER,
+ to enable using of pid for core files creation. If disabled nothing will be set.
+ For debugging purposes it is recommended to enable this option.
+
+Template: ser/MEMORY
+Type: string
+Default: 32
+Description: Size of shared memory used, in MB
+ Set size of SER shared memory to allocate, in megabytes.
+ .
+ Enter "!" to not modify this option.
+
diff --git a/pkg/ser/deb/debian/shlibs.local b/pkg/ser/deb/debian/shlibs.local
new file mode 100644
index 0000000..e69de29
diff --git a/pkg/ser/deb/debian/watch b/pkg/ser/deb/debian/watch
new file mode 100644
index 0000000..f318abc
--- /dev/null
+++ b/pkg/ser/deb/debian/watch
@@ -0,0 +1,7 @@
+# Example watch control file for uscan
+# Rename this file to "watch" and then you can run the "uscan" command
+# to check for upstream updates and more.
+version=2
+
+# Site		Directory		Pattern			Version	Script
+ftp://ftp.berlios.de/pub/ser/latest/src/ser-(.*)_src\.tar\.gz	debian	uupdate
diff --git a/pkg/ser/freebsd/000.ser.sh b/pkg/ser/freebsd/000.ser.sh
new file mode 100644
index 0000000..814c074
--- /dev/null
+++ b/pkg/ser/freebsd/000.ser.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+# Start/stop/restart SIP EXpress Router (SER)
+#
+# Version: 1.0 - Paul Belanger <pabelanger at gmail.com>
+#
+# Directions:
+# copy ser script to /usr/local/etc/rc.d/
+# edit /etc/rc.conf and add the following:
+# ser_enable="YES"
+#
+#
+# 05.05.2005 - Initial Version
+
+. /etc/rc.subr
+
+name="ser"
+rcvar="`set_rcvar`"
+command="/usr/local/sbin/${name}"
+pidfile="/var/run/${name}.pid"
+
+load_rc_config $name
+ser_flags="$cron_flags -P $pidfile"
+run_rc_command "$1"
diff --git a/pkg/ser/freebsd/Makefile b/pkg/ser/freebsd/Makefile
new file mode 100644
index 0000000..f8cdc54
--- /dev/null
+++ b/pkg/ser/freebsd/Makefile
@@ -0,0 +1,55 @@
+# New ports collection makefile for:    ser
+# Date created:        6 November 2002
+# Whom:                andrei
+#
+# $FreeBSD$
+#
+# $Id$
+#
+
+
+PORTNAME= ser
+PORTVERSION= 0.9.4
+CATEGORIES= net
+MASTER_SITES= ftp://ftp.iptel.org/pub/ser/0.9.4/src/
+
+MAINTAINER= andrei at iptel.org
+
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} >= 501000
+# FreeBSD 5.1 wants COMMENT and it doesn't like pkg-comment
+COMMENT= Sip Express Router, very fast and configurable SIP proxy
+COMMENTFILE= 
+.endif
+
+MAN8=ser.8
+MAN5=ser.cfg.5
+MANCOMPRESSED= no
+
+
+USE_GMAKE= yes
+# we override the DISTFILE NAME
+DISTNAME= ${PORTNAME}-${PORTVERSION}_src
+WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
+
+# build by default mysql and jabber
+MAKE_ENV= include_modules="mysql jabber cpl-c pa"
+
+
+
+
+# depends on mysql and libexpat because of the above modules
+BUILD_DEPENDS= ${LOCALBASE}/include/expat.h:${PORTSDIR}/textproc/expat* \
+               ${LOCALBASE}/include/mysql/mysql.h:${PORTSDIR}/databases/mysql*-client \
+               ${LOCALBASE}/include/libxml2/libxml/uri.h:${PORTSDIR}/textproc/libxml2* 
+LIB_DEPENDS=   expat:${PORTSDIR}/textproc/expat* \
+               mysqlclient:${PORTSDIR}/databases/mysql*-client \
+               xml2:${PORTSDIR}/textproc/libxml2
+
+pre-fetch:
+
+
+.include <bsd.port.post.mk>
+
+
diff --git a/pkg/ser/freebsd/distinfo b/pkg/ser/freebsd/distinfo
new file mode 100644
index 0000000..995bc51
--- /dev/null
+++ b/pkg/ser/freebsd/distinfo
@@ -0,0 +1 @@
+MD5 (ser-0.9.4_src.tar.gz) = d12d56d76c86b59dd51a43b3251b7d3a
diff --git a/pkg/ser/freebsd/pkg-comment b/pkg/ser/freebsd/pkg-comment
new file mode 100644
index 0000000..6cef836
--- /dev/null
+++ b/pkg/ser/freebsd/pkg-comment
@@ -0,0 +1 @@
+Sip Express Router, very fast and configurable SIP proxy
diff --git a/pkg/ser/freebsd/pkg-descr b/pkg/ser/freebsd/pkg-descr
new file mode 100644
index 0000000..af5e7bf
--- /dev/null
+++ b/pkg/ser/freebsd/pkg-descr
@@ -0,0 +1,15 @@
+ser or SIP Express Router is a very fast and flexible SIP (RFC3621)
+proxy server. Written entirely in C, ser can handle thousands calls
+per second even on low-budget hardware. C Shell like scripting language
+provides full control over the server's behaviour. It's modular
+architecture allows only required functionality to be loaded.
+Currently the following modules are available: Digest Authentication,
+CPL scripts, Instant Messaging, MySQL support, Presence Agent, Radius
+Authentication, Record Routing, SMS Gateway, Jabber Gateway, Transaction
+Module, Registrar, User Location, NAT Traversal, a.s.o.
+
+
+WWW: http://www.iptel.org/ser/
+
+- Andrei Pelinescu-Onciul
+andrei at iptel.org
diff --git a/pkg/ser/freebsd/pkg-plist b/pkg/ser/freebsd/pkg-plist
new file mode 100644
index 0000000..c6825ed
--- /dev/null
+++ b/pkg/ser/freebsd/pkg-plist
@@ -0,0 +1,104 @@
+etc/ser/dictionary.ser
+etc/ser/ser.cfg
+lib/ser/modules/acc_db.so
+lib/ser/modules/acc_syslog.so
+lib/ser/modules/auth.so
+lib/ser/modules/auth_db.so
+lib/ser/modules/avp.so
+lib/ser/modules/avp_db.so
+lib/ser/modules/avpops.so
+lib/ser/modules/cpl-c.so
+lib/ser/modules/ctl.so
+lib/ser/modules/db_ops.so
+lib/ser/modules/dbtext.so
+lib/ser/modules/dialog.so
+lib/ser/modules/dispatcher.so
+lib/ser/modules/domain.so
+lib/ser/modules/enum.so
+lib/ser/modules/eval.so
+lib/ser/modules/exec.so
+lib/ser/modules/flatstore.so
+lib/ser/modules/gflags.so
+lib/ser/modules/jabber.so
+lib/ser/modules/lcr.so
+lib/ser/modules/maxfwd.so
+lib/ser/modules/mediaproxy.so
+lib/ser/modules/msilo.so
+lib/ser/modules/mysql.so
+lib/ser/modules/nathelper.so
+lib/ser/modules/options.so
+lib/ser/modules/pa.so
+lib/ser/modules/pdt.so
+lib/ser/modules/permissions.so
+lib/ser/modules/pike.so
+lib/ser/modules/print.so
+lib/ser/modules/ratelimit.so
+lib/ser/modules/registrar.so
+lib/ser/modules/rr.so
+lib/ser/modules/sl.so
+lib/ser/modules/sms.so
+lib/ser/modules/speeddial.so
+lib/ser/modules/textops.so
+lib/ser/modules/timer.so
+lib/ser/modules/tm.so
+lib/ser/modules/uac.so
+lib/ser/modules/uri.so
+lib/ser/modules/uri_db.so
+lib/ser/modules/usrloc.so
+lib/ser/modules/xlog.so
+lib/ser/modules/xmlrpc.so
+sbin/ser
+sbin/ser_mysql.sh
+sbin/serunix
+share/doc/ser/AUTHORS
+share/doc/ser/INSTALL
+share/doc/ser/NEWS
+share/doc/ser/README
+share/doc/ser/README-MODULES
+share/doc/ser/README.acc_db
+share/doc/ser/README.acc_syslog
+share/doc/ser/README.auth
+share/doc/ser/README.auth_db
+share/doc/ser/README.avp
+share/doc/ser/README.avp_db
+share/doc/ser/README.avpops
+share/doc/ser/README.cpl-c
+share/doc/ser/README.ctl
+share/doc/ser/README.db_ops
+share/doc/ser/README.dbtext
+share/doc/ser/README.dialog
+share/doc/ser/README.dispatcher
+share/doc/ser/README.domain
+share/doc/ser/README.enum
+share/doc/ser/README.eval
+share/doc/ser/README.exec
+share/doc/ser/README.flatstore
+share/doc/ser/README.gflags
+share/doc/ser/README.jabber
+share/doc/ser/README.lcr
+share/doc/ser/README.maxfwd
+share/doc/ser/README.msilo
+share/doc/ser/README.nathelper
+share/doc/ser/README.options
+share/doc/ser/README.pa
+share/doc/ser/README.pdt
+share/doc/ser/README.permissions
+share/doc/ser/README.pike
+share/doc/ser/README.print
+share/doc/ser/README.registrar
+share/doc/ser/README.rr
+share/doc/ser/README.sl
+share/doc/ser/README.sms
+share/doc/ser/README.speeddial
+share/doc/ser/README.textops
+share/doc/ser/README.tm
+share/doc/ser/README.uac
+share/doc/ser/README.uri
+share/doc/ser/README.uri_db
+share/doc/ser/README.usrloc
+share/doc/ser/README.xlog
+share/doc/ser/README.xmlrpc
+ at dirrm share/doc/ser
+ at dirrm etc/ser
+ at dirrm lib/ser/modules
+ at dirrm lib/ser
diff --git a/pkg/ser/gentoo/ChangeLog b/pkg/ser/gentoo/ChangeLog
new file mode 100644
index 0000000..dd14747
--- /dev/null
+++ b/pkg/ser/gentoo/ChangeLog
@@ -0,0 +1,78 @@
+# ChangeLog for net-misc/sip-router
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+*sip-router-3.3.2 (17 Oct 2012)
+
+  17 Oct 2012; Claudio G. Furrer <elcaio at gmail.com> +sip-router.3.3.2.ebuild:
+  Version bump (series 3.3.x).
+
+*sip-router-3.3.1 (5 Oct 2012)
+
+  5 Oct 2012; Claudio G. Furrer <elcaio at gmail.com> +sip-router.3.3.1.ebuild:
+  Version bump (series 3.3.x).
+
+*sip-router-3.2.4 (4 Oct 2012)
+
+  4 Oct 2012; Claudio G. Furrer <elcaio at gmail.com> +sip-router.3.2.4.ebuild:
+  Version bump (series 3.2.x).
+
+*sip-router-3.1.6 (3 Oct 2012)
+
+  3 Oct 2012; Claudio G. Furrer <elcaio at gmail.com> +sip-router.3.1.6.ebuild:
+  Version bump (series 3.1.x).
+
+
+*sip-router-3.2.3 (26 Apr 2012)
+
+  26 Apr 2012; Claudio G. Furrer <elcaio at gmail.com> +sip-router.3.2.3.ebuild:
+  Version bump.
+
+*sip-router-3.2.2 (15 Feb 2012)
+
+  15 Feb 2012; Claudio G. Furrer <elcaio at gmail.com> +sip-router.3.2.2.ebuild:
+  Version bump.
+
+*sip-router-3.2.1 (25 Jan 2012)
+
+  25 Jan 2012; Claudio G. Furrer <elcaio at gmail.com> +sip-router.3.2.1.ebuild:
+  Version bump.
+
+*sip-router-3.1.5 (21 Sep 2011)
+
+  21 Sep 2011; Claudio G. Furrer <elcaio at gmail.com> +sip-router.3.1.5.ebuild:
+  Version bump.
+
+  21 Sep 2011; Claudio G. Furrer <elcaio at gmail.com> -sip-router-3.1.2.ebuild,
+  -sip-router-3.1.3.ebuild, -sip-router-3.1.4.ebuild, -sip-router-3.1.4-r1.ebuild,
+  -files/siprouter.confd, -files/siprouter.init:
+  Older versions than 3.1.4-r2 are no longer packaged.
+
+*sip-router-3.1.4 (13 Sep 2011)
+  
+  13 Sep 2011; Claudio G. Furrer <elcaio at gmail.com> +sip-router-3.1.4-r2.ebuild,
+  +files/ser.confd, +files/ser.initd:
+  Fix installation paths and names based on flavour specified in the USE flag
+  (ser or kamailio).
+
+  24 Aug 2011; Claudio G. Furrer <elcaio at gmail.com> sip-router-3.1.4-r1.ebuild:
+  Added kamailio-specific groups (group_k*) in USE flags.
+
+  31 May 2011; Claudio G. Furrer <elcaio at gmail.com> sip-router-3.1.4.ebuild:
+  Version bump.
+
+*sip-router-3.1.3 (03 May 2011)
+  
+  03 May 2011; Claudio G. Furrer <elcaio at gmail.com> sip-router-3.1.3.ebuild:
+  Version bump.
+
+*sip-router-3.1.2 (21 Mar 2011)
+  
+  23 Mar 2011; Claudio G. Furrer <elcaio at gmail.com> sip-router-3.1.2.ebuild,
+  +metadata.xml:
+  Added flavours USE setup for kamailio/ser/sip-router options.
+  Also was added metadata file.
+
+  22 Mar 2011; Claudio G. Furrer <elcaio at gmail.com> sip-router-3.1.2.ebuild:
+  Added initial ChangeLog which should be updated whenever the package is
+  updated in any way.
diff --git a/pkg/ser/gentoo/Manifest b/pkg/ser/gentoo/Manifest
new file mode 100644
index 0000000..2d24582
--- /dev/null
+++ b/pkg/ser/gentoo/Manifest
@@ -0,0 +1,16 @@
+AUX ser.confd 514 SHA256 fec2d2b5c1f222bfd413ece424c2ee6b7fdff2fc71f8b95abb6b31118f209770 SHA512 3745b3bdc1ae2dd2d4cf7c4dbdcb5dc8a2667dcbb50bcff89ea01ac3f95ff213b93ae0402c45703305781fd9c6f4968f59f1a9c509670f54f4cf58a788d53c55 WHIRLPOOL 645a88d3442a34d755eed69a7586c96f219ea3fb096ba6a86aaf13314d306c59d9dd5a656787612b1c0a7e784f148d712641f3c2869383a542e11c9525cd881b
+AUX ser.initd 800 SHA256 c9b748c5756e1bf2ee72ff0350b5f9ad1b8489d41008a00d66e335b276252a44 SHA512 57f558a42cfeee7eb78583ba68d64874e3d162c67ec064034061cf37e47d42e2924f0a37ecc47c25d7df1cab9281ac0d0f06ccb3b1bdebde8894f4450b3a8696 WHIRLPOOL cb6a2ff4d7ae5c88d87f1341ab38c787454b7074c9780cf93ebf52a06623720413ae636f40027beff18d828669194b47c5395ac368036db5bf8b543f6fdef54f
+DIST kamailio-3.1.5_src.tar.gz 7025269 SHA256 5d1a2db3f9bea3cfac76777646627be24e6033876a5bf60200882be00cefe9ca SHA512 5090e656ea3af12ea9dbbb09d2b1fbfaca4b7089f695d3652a64802d1e763678c2b2a03796eebb1a5d47530a786a4b88e9e5ee5bf80c260f4bd75033be3008cf WHIRLPOOL 68538eb109a4c5f8ab75e58a06453d80a2c80fcb777b42042369a8ed730a59634aaec1cb84a8c9c1e17dbc2a940851a698beb63f9afa2420748d6694a61c5686
+DIST kamailio-3.1.6_src.tar.gz 7002535 SHA256 eb69af9d5bf851c802618ffe9f901200a750366fe9a68e0fc7e5ed233997f4b5 SHA512 66347f73e8b48cb746e950c57b726a3e7640ae7ec78575307fb250103cab5660c93b1e186bdd89589a62f0d3ea329ea659afdf21723fd0bb9d89a041231850ff WHIRLPOOL fe309ab3c317b534e920605f749654f37670cb86f19417461f56692a26b54a54857a8c62c2332e25c9a308924974227e2a815bbbcaf84498bd866a9888d48fc9
+DIST kamailio-3.2.3_src.tar.gz 7227846 SHA256 673253bb3ec2f0cccba0fcddc8c93b3a41da4a1f63b5220736ee348d5ca3d131 SHA512 59dae999b0a598156032ba86e29cabf2053de1e7cb6dcb4a3b0ad76e4f0acc18980c804185a8edb545a360247676be13cbab77f2465875bb9591ca3885e85368 WHIRLPOOL b7978bba572724d709744a6c4e61aef740c611e011ef20469b51f9a419e88776329e4936ac664b1bce2c2b4b0b861c17ac927935637d0795c124597a1f163b2c
+DIST kamailio-3.2.4_src.tar.gz 7253378 SHA256 f367de0957807479f6c3f1df6ad3033819504c99f6007b90bc73ff0535657ab7 SHA512 9fe97296ac4321f8c9c052011b66ba298951499b4c27d16cb3b3e8aa6b9619e7ef91679c5ce22f4b0639bb06ceedc859efd2df3199338fb5da73005f11926eac WHIRLPOOL bf020eaab1b1e339165e51628ec37de8cbf9defde92248a37b519689516ee200287638a2ec489a180c05633bd9d7ddd933793f50ca97f360ad3a8310599d1493
+DIST kamailio-3.3.1_src.tar.gz 7468878 SHA256 45c153776efad809ec1f88710d7d3cd57c9f805050611378eaccf99bed63a122 SHA512 aa14c17fe113502266819f7824b377d8856aa48380ed4e66f2540d86a646cd19052b5e6da7f28f4b92fcbdd57b4182969536702f6f8f27119295a5c944242883 WHIRLPOOL c01fb645893284e7941f82dd61b3f79761600ac217dc8326614b16580c7d28d5a263c7235379901846948ec80dca695e69a6f617b2df5e1e0802d111432700bd
+DIST kamailio-3.3.2_src.tar.gz 7483530 SHA256 dae3ca1c6372ae5a01a7b8e9d49e297c1cee01032b77524d00e6d5082fbeef61 SHA512 4b1ed2d6b6028a3cc3c18ee7f5e54143c15a7d6a4fc6cf7710f3d70415355bfe2e893c7384b94acc0f67c09abf670b87ea15afce0917b085d0419a05b6e771b9 WHIRLPOOL df4a6497c221af621a0f72a84fecad0dc0c09eb485bb40444f35518406cab340fd6eceef6c558283e30c39901f44b0e22ba595503b3f2354dd329bb6adc3edc1
+EBUILD sip-router-3.1.5.ebuild 8024 SHA256 1adb67682eaa5a9dfee306473023bf7403068199a0e8916db521e230452b1e78 SHA512 8e8bf4b491e9dd5c17230fdd338138188f16a584e9a4e22baea4ac22a767ff8e40860618a630afd959f57fcf0948d7081827ddbcc1a6b62d691518d4716e6a2f WHIRLPOOL 820bbfcb11137d0a9414a9f9ebbb5be6930b269d1341c1b323ea682a55d1514312b918f7150b33034722c4d239f2f4b66a8edf41bec587f382ad24a140278088
+EBUILD sip-router-3.1.6.ebuild 8106 SHA256 a2959cdeef926236cdbadf06b4c2340ffca7cde1338499a14ca511c60ab3556a SHA512 ac238b7dd0a669a16caa047c99d74c0d0425759340b59785b1a3e593ae9e245d1e8dcf71b052070d8681c5b0db03abf2e7250b7f20fb09837d727809272f2515 WHIRLPOOL d3d332d549b9e73a6e685bbbe8e093372d794fd506e0826103450cc8a59bfa4c7f939d3893dab09ed845541c74ff64d8d04c3aad24ffea9b6964457806e7d387
+EBUILD sip-router-3.2.3.ebuild 8115 SHA256 fa4b3c79a93ee13bfa8ed47952c549e848b452689d78fac8d8596b4e2966864f SHA512 e257ecf83f44f446098ec6fc7b0565e5ca6b7eb7dbeddc34baacb5592825065ef93a05ca24c3f85b6c817e4c23e407861e7c1bc79d883f4882f7153a88bbc928 WHIRLPOOL 0a44d52e6fbae7e79f2f69b115734174af30cd6b662205e81b84b92b92158e7fb94416fa4d35b5b3c0f6048f6ca7b269c46c860602a276c872b5605cd1b018f0
+EBUILD sip-router-3.2.4.ebuild 8155 SHA256 4efbbf1cea7d46f065947869723db90dc43453b6451b6830dcf5f5363a3ff5b8 SHA512 2c20dfdee22e54f8a429e4aedcc7c0771c2e03b53a7632a11fdc47335d81ed33fc89070d22775c7cba68f7874fec97ac8441338b44f62be30654092ac0f239af WHIRLPOOL 53a960bc2d8bbd3a1a0a4fc3eee5ded932fd2576b57f12e1030a58913aeab2b61e089a23849c5b65afb41abd299cb7aa9496db343a6f472fc5438de27ef7f67c
+EBUILD sip-router-3.3.1.ebuild 8327 SHA256 12ab91b617bda58321dfa4d256628f533e299bd78632f7617a1ee7d35800f416 SHA512 d1aba8330182465234f7d64969a64fd412fb1866c22b51ae02b7866aa1936eb2fbe462aa8f43379e1ae19b38e973d9e8663f1faf0412566ca776b6e214423442 WHIRLPOOL f8fb38968d94576f8191dbafdda2c0709511b7f98ae24b3855e53990c55abacb98cbca3bd6c1440656cc41ee5d81e9b57c0765fbaa2ca413d9ce98438ec7207b
+EBUILD sip-router-3.3.2.ebuild 8327 SHA256 12ab91b617bda58321dfa4d256628f533e299bd78632f7617a1ee7d35800f416 SHA512 d1aba8330182465234f7d64969a64fd412fb1866c22b51ae02b7866aa1936eb2fbe462aa8f43379e1ae19b38e973d9e8663f1faf0412566ca776b6e214423442 WHIRLPOOL f8fb38968d94576f8191dbafdda2c0709511b7f98ae24b3855e53990c55abacb98cbca3bd6c1440656cc41ee5d81e9b57c0765fbaa2ca413d9ce98438ec7207b
+MISC ChangeLog 2480 SHA256 a8bdaddc1f1f468f25499b534236fae5980466ba0333a3aaad7fd8b406f37f9d SHA512 2fc633bfbf0363822764121de7f1dda66c2264ee122ff0843b7647b84b25ad45a04fd0ce3797d84883b35defbf525b17bd67d6b4afd33cdbcff4e22dcda5d7c5 WHIRLPOOL bec2be2ad6cecadadde47f8767d4640ceaae06fc6698fb12b27c174c27c5305199cf2de7c9b277ae53adc629043a5a3dce87e3617e103000b4991e1f2914f400
+MISC metadata.xml 234 SHA256 4009ad9d312db0ece6fd53e9dfabda98e2c1037ec540eb64d6ab43fe318c1a25 SHA512 cca7444682a294c6173682dc78d73ee82ff19a6a8bc052d6850dab0a49056c0bcca347b83cd592360540399f21016fc360ea29a2234dd8fa1d6e13f6feedee16 WHIRLPOOL a37bbdac2e9489e68e1e0871eb8847dd04df20c4aae756173e7c6a13622ee60c87508f6f26e24b1dbe9c5cb929f57cb86c65042945d8129d3ba1ef8d7338b314
diff --git a/pkg/ser/gentoo/files/ser.confd b/pkg/ser/gentoo/files/ser.confd
new file mode 100644
index 0000000..4b1f248
--- /dev/null
+++ b/pkg/ser/gentoo/files/ser.confd
@@ -0,0 +1,16 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+# Additional options to start Sip-Router with.
+#
+# see "sip-router -h" for a list of options
+#
+# default: run SER as user:group = ser:ser
+#
+MAIN_NAME="sip-router"
+SR_USER="sip-router"
+SR_GROUP="sip-router"
+CONFIGFILE="${CONFIGFILE:-/etc/${MAIN_NAME}/sip-router.cfg}"
+CONFIGDEFS="" # eg: "-A WITH_DEBUG -A WITH_NAT -A WITH_TLS"
+SR_OPTS="-u $SR_USER -g $SR_GROUP -f ${CONFIGFILE} ${CONFIGDEFS}"
diff --git a/pkg/ser/gentoo/files/ser.initd b/pkg/ser/gentoo/files/ser.initd
new file mode 100644
index 0000000..99d0fbe
--- /dev/null
+++ b/pkg/ser/gentoo/files/ser.initd
@@ -0,0 +1,34 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+depend() {
+	need net
+}
+
+check_config() {
+	out=`(/usr/sbin/sip-router -f ${CONFIGFILE} -c > /dev/null || true) 2>&1`
+	echo "$out" | grep -q 'config file ok, exiting...'
+	if [ "$?" == 1 ]; then
+		echo -e "There are errors in the configuration. Please fix them first"
+		echo -e "\n$out\n"
+		return 1
+	fi
+}
+
+start() {
+	check_config || return 1
+	ebegin "Starting sip-router"
+	start-stop-daemon --start --quiet --pidfile /var/run/sip-router.pid \
+		--exec /usr/sbin/sip-router -- -P /var/run/sip-router.pid \
+                ${SR_OPTS}
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping sip-router"
+	start-stop-daemon --stop --quiet --pidfile /var/run/sip-router.pid
+	eend $?
+}
+
diff --git a/pkg/ser/gentoo/metadata.xml b/pkg/ser/gentoo/metadata.xml
new file mode 100644
index 0000000..d48077a
--- /dev/null
+++ b/pkg/ser/gentoo/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<herd>voip</herd>
+	<maintainer>
+		<email>maintainer-needed at gentoo.org</email>
+	</maintainer>
+</pkgmetadata>
+
diff --git a/pkg/ser/gentoo/sip-router-3.1.5.ebuild b/pkg/ser/gentoo/sip-router-3.1.5.ebuild
new file mode 100644
index 0000000..cd0f9a8
--- /dev/null
+++ b/pkg/ser/gentoo/sip-router-3.1.5.ebuild
@@ -0,0 +1,250 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+DESCRIPTION="Sip-Router (Kamailio/SER) is an Open Source SIP Server"
+HOMEPAGE="http://sip-router.org/"
+MY_P="${P/sip-router/kamailio}"
+SRC_URI="http://www.kamailio.org/pub/kamailio/${PV}/src/${MY_P}_src.tar.gz"
+S=${WORKDIR}/${MY_P}
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+#Documentation can be found here: http://www.kamailio.org/docs/modules/3.1.x/
+IUSE="flavour_kamailio flavour_ser debug ipv6 sctp
+group_standard group_standard_dep group_mysql group_radius group_postgres group_presence group_stable group_experimental
+group_kstandard group_kmysql group_kradius group_kpostgres group_kpresence group_kxml group_kperl group_kldap
+acc acc_radius alias_db app_lua app_python auth auth_identity auth_db auth_diameter auth_radius avpops
+benchmark blst
+call_control carrierroute cfg_db cfg_rpc cfgutils counters cpl-c ctl
+db_berkeley db_flatstore db_mysql db_oracle db_postgres db_text db_unixodbc
+debugger dialog dialplan dispatcher diversion domain domainpolicy drouting
+enum exec
+geoip group
+h350 htable imc iptrtpproxy jabber kex
+lcr ldap
+matrix maxfwd mediaproxy memcached misc_radius mi_datagram mi_fifo mi_rpc mi_xmlrpc mqueue msilo mtree
+nathelper nat_traversal
+osp
+path pdb pdt peering perl perlvdb permissions pike pipelimit prefix_route
+presence presence_conference presence_dialoginfo presence_mwi presence_xml
+pua pua_bla pua_dialoginfo pua_mi pua_usrloc pua_xmpp purple pv
+qos
+ratelimit regex registrar rls rtimer rr rtpproxy
+sanity seas siptrace siputils sl sms snmpstats speeddial sqlops statistics sst
+textops textopsx tls tm tmx topoh
+uac uac_redirect uri_db userblacklist usrloc utils
+xcap_client xcap_server xhttp xlog xmlops xmlrpc xmpp"
+
+#osp? ( net-libs/osptoolkit )
+#pdb? ( pdb-server )
+#seas? ( www.wesip.eu )
+
+RDEPEND="
+	>=sys-libs/ncurses-5.7
+	>=sys-libs/readline-6.1_p2
+	group_mysql? ( >=dev-db/mysql-5.1.50 sys-libs/zlib )
+	group_radius? ( >=net-dialup/radiusclient-ng-0.5.0 )
+	group_presence? ( dev-libs/libxml2 net-misc/curl )
+	group_postgres? ( dev-db/postgresql-base )
+	group_standard? ( dev-libs/libxml2 dev-libs/openssl net-misc/curl )
+	group_kmysql? ( >=dev-db/mysql-5.1.50 sys-libs/zlib )
+	group_kradius? ( >=net-dialup/radiusclient-ng-0.5.0 )
+	group_kpresence? ( dev-libs/libxml2 net-misc/curl )
+	group_kpostgres? ( dev-db/postgresql-base )
+	group_kstandard? ( dev-libs/libxml2 dev-libs/openssl net-misc/curl )
+	group_kxml? ( dev-libs/libxml2 dev-libs/xmlrpc-c )
+	group_kperl? ( dev-lang/perl dev-perl/perl-ldap )
+	group_kldap? ( net-nds/openldap )
+	acc_radius? ( net-dialup/radiusclient-ng )
+	app_lua? ( dev-lang/lua )
+	app_python? ( dev-lang/python )
+	auth_identity? ( dev-libs/openssl net-misc/curl )
+	carrierroute? ( dev-libs/confuse )
+	cpl-c? ( dev-libs/libxml2 )
+	db_berkeley? ( >=sys-libs/db-4.6 )
+	db_mysql? ( >=dev-db/mysql-5.1.50 )
+	db_oracle? ( dev-db/oracle-instantclient-basic )
+	db_postgres? ( dev-db/postgresql-base )
+        db_unixodbc? ( dev-db/unixODBC )
+	dialplan? ( dev-libs/libpcre )
+	geoip? ( dev-libs/geoip )
+	h350? ( net-nds/openldap )
+	jabber? ( dev-libs/expat )
+	lcr? ( dev-libs/libpcre )
+	ldap? ( net-nds/openldap )
+	memcached? ( dev-libs/libmemcache net-misc/memcached )
+	mi_xmlrpc? ( dev-libs/libxml2 dev-libs/xmlrpc-c )
+	peering? ( net-dialup/radiusclient-ng )
+	perl? ( dev-lang/perl dev-perl/perl-ldap )
+	presence? ( dev-libs/libxml2 )
+	presence_conference? ( dev-libs/libxml2 )
+	presence_xml? ( dev-libs/libxml2 )
+	pua? ( dev-libs/libxml2 )
+	pua_bla? ( dev-libs/libxml2 )
+	pua_dialoginfo? ( dev-libs/libxml2 )
+	pua_usrloc? ( dev-libs/libxml2 )
+	pua_xmpp? ( dev-libs/libxml2 )
+	purple? ( net-im/pidgin )
+	regex? ( dev-libs/libpcre )
+	rls? ( dev-libs/libxml2 )
+	snmpstats? ( net-analyzer/net-snmp sys-apps/lm_sensors )
+	tls? (
+		sys-libs/zlib
+		>=dev-libs/openssl-1.0.0a-r1
+	)
+	utils? ( net-misc/curl )
+	xcap_client? ( dev-libs/libxml2 net-misc/curl )
+	xcap_server? ( dev-libs/libxml2 )
+	xmlops? ( dev-libs/libxml2 )
+	xmpp? ( dev-libs/expat )
+"
+DEPEND="${RDEPEND}
+	>=sys-devel/bison-1.35
+	>=sys-devel/flex-2.5.4a
+	app-text/docbook2X"
+
+src_unpack() {
+	unpack ${A}
+	cd "${S}"
+
+	use ipv6 || \
+		sed -i -e "s/-DUSE_IPV6//g" Makefile.defs || die
+}
+
+src_compile() {
+	# iptrtpproxy broken as the needed netfilter module is not supported
+	local mod_exc="iptrtpproxy"
+	local group_inc=""
+	local k=""
+	if use flavour_kamailio; then
+		k="k"
+		use group_kxml && group_inc="${group_inc} kxml"
+		use group_kperl && group_inc="${group_inc} kperl"
+		use group_kldap && group_inc="${group_inc} kldap"
+	fi
+	# you can USE flavour=kamailio but also group_standard. It will be converted to group_kstandard
+	# same as mysql/kmysql, postgres/kpostgres, radius/kradius, presence/kpresence
+	(use group_standard || use group_kstandard) && group_inc="${group_inc} ${k}standard"
+	use group_standard_dep && group_inc="${group_inc} standard_dep"
+	(use group_mysql || use group_kmysql) && group_inc="${group_inc} ${k}mysql"
+	(use group_radius || use group_kradius) && group_inc="${group_inc} ${k}radius"
+	(use group_postgres || use group_kpostgres) && group_inc="${group_inc} ${k}postgres"
+	(use group_presence || use group_kpresence) && group_inc="${group_inc} ${k}presence"
+	use group_stable && group_inc="${group_inc} stable"
+	use group_experimental && group_inc="${group_inc} experimental"
+	# TODO: skip_modules?
+
+	local mod_inc=""
+	# some IUSE flags must not be included here in mod_inc
+	# e.g.: flavour_kamailio, flavour_ser, debug, sctp, ipv6
+	for i in ${IUSE[@]}; do
+		for j in ${i[@]}; do
+			[[ ! "${i}" =~ "flavour_" ]] && \
+				[ ! "${i}" == "debug" ] && \
+				[ ! "${i}" == "ipv6" ] && \
+				[ ! "${i}" == "sctp" ] && \
+				[[ ! "${i}" =~ "group_" ]] && \
+			use "${i}" && mod_inc="${mod_inc} ${i}"
+		done
+	done
+
+	if use tls; then
+		tls_hooks=1
+	else
+		tls_hooks=0
+	fi
+
+	if use debug; then
+		mode=debug
+	else
+		mode=release
+	fi
+
+	if use flavour_kamailio; then
+		flavour=kamailio
+	else
+		flavour=ser # defaults to SER compatibility names
+	fi
+
+	if use sctp; then
+		sctp=1
+	else
+		sctp=0
+	fi
+
+	emake \
+		CC="$(tc-getCC)" \
+		CPU_TYPE="$(get-flag march)" \
+		SCTP="${sctp}" \
+		CC_EXTRA_OPTS=-I/usr/gnu/include \
+		mode="${mode}" \
+		TLS_HOOKS="${tls_hooks}" \
+		FLAVOUR="${flavour}" \
+		group_include="${group_inc}" \
+		include_modules="${mod_inc}" \
+		exclude_modules="${mod_exc}" \
+		prefix="/" \
+		all || die "emake all failed"
+}
+
+src_install() {
+	emake -j1 \
+		BASEDIR="${D}" \
+		FLAVOUR="${flavour}" \
+		prefix="/" \
+		bin_dir=/usr/sbin/ \
+		cfg_dir=/etc/${flavour}/ \
+		lib_dir=/usr/$(get_libdir)/${flavour}/ \
+		modules_dir="/usr/$(get_libdir)/${flavour}/" \
+		man_dir="/usr/share/man/" \
+		doc_dir="/usr/share/doc/${flavour}/" \
+		install || die "emake install failed"
+
+	sed -e "s/sip-router/${flavour}/g" \
+		${FILESDIR}/ser.initd > ${flavour}.initd || die
+	sed -e "s/sip-router/${flavour}/g" \
+		${FILESDIR}/ser.confd > ${flavour}.confd || die
+
+	newinitd "${flavour}".initd "${flavour}"
+	newconfd "${flavour}".confd "${flavour}"
+}
+
+pkg_preinst() {
+	if [[ -z "$(egetent passwd ${flavour})" ]]; then
+		einfo "Adding ${flavour} user and group"
+		enewgroup "${flavour}"
+		enewuser  "${flavour}" -1 -1 /dev/null "${flavour}"
+	fi
+
+	chown -R root:"${flavour}"  "${D}/etc/${flavour}"
+	chmod -R u=rwX,g=rX,o= "${D}/etc/${flavour}"
+
+	has_version <="${CATEGORY}/ser-0.9.8"
+	previous_installed_version=$?
+	if [[ $previous_installed_version = 1 ]] ; then
+		elog "You have a previous version of SER on ${ROOT}etc/ser"
+		elog "Consider or verify to remove it (emerge -C ser)."
+		elog
+		elog "Sip-Router may not could be installed/merged. See your elog."
+	fi
+}
+
+pkg_postinst() {
+	if [ use mediaproxy ]; then
+		einfo "You have enabled mediaproxy support. In order to use it, you have
+		to run it somewhere."
+	fi
+	if [ use rtpproxy ]; then
+		einfo "You have enabled rtpproxy support. In order to use it, you have
+		to run it somewhere."
+	fi
+}
+
+pkg_prerm () {
+	/etc/init.d/"${flavour}" stop >/dev/null
+}
diff --git a/pkg/ser/gentoo/sip-router-3.1.6.ebuild b/pkg/ser/gentoo/sip-router-3.1.6.ebuild
new file mode 100644
index 0000000..8635ecc
--- /dev/null
+++ b/pkg/ser/gentoo/sip-router-3.1.6.ebuild
@@ -0,0 +1,251 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+DESCRIPTION="Sip-Router (Kamailio/SER) is an Open Source SIP Server"
+HOMEPAGE="http://sip-router.org/"
+MY_P="${P/sip-router/kamailio}"
+SRC_URI="http://www.kamailio.org/pub/kamailio/${PV}/src/${MY_P}_src.tar.gz"
+S=${WORKDIR}/${MY_P}
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+#Documentation can be found here: http://www.kamailio.org/docs/modules/3.1.x/
+IUSE="flavour_kamailio flavour_ser debug ipv6 sctp
+group_standard group_standard_dep group_mysql group_radius group_postgres group_presence group_stable group_experimental
+group_kstandard group_kmysql group_kradius group_kpostgres group_kpresence group_kxml group_kperl group_kldap
+acc acc_radius alias_db app_lua app_python auth auth_identity auth_db auth_diameter auth_radius avpops
+benchmark blst
+call_control carrierroute cfg_db cfg_rpc cfgutils counters cpl-c ctl
+db_berkeley db_flatstore db_mysql db_oracle db_postgres db_text db_unixodbc
+debugger dialog dialplan dispatcher diversion domain domainpolicy drouting
+enum exec
+geoip group
+h350 htable imc iptrtpproxy jabber kex
+lcr ldap
+matrix maxfwd mediaproxy memcached misc_radius mi_datagram mi_fifo mi_rpc mi_xmlrpc mqueue msilo mtree
+nathelper nat_traversal
+osp
+path pdb pdt peering perl perlvdb permissions pike pipelimit prefix_route
+presence presence_conference presence_dialoginfo presence_mwi presence_xml
+pua pua_bla pua_dialoginfo pua_mi pua_usrloc pua_xmpp purple pv
+qos
+ratelimit regex registrar rls rtimer rr rtpproxy
+sanity seas siptrace siputils sl sms snmpstats speeddial sqlops statistics sst
+textops textopsx tls tm tmx topoh
+uac uac_redirect uri_db userblacklist usrloc utils
+xcap_client xcap_server xhttp xlog xmlops xmlrpc xmpp"
+
+#osp? ( net-libs/osptoolkit )
+#pdb? ( pdb-server )
+#seas? ( www.wesip.eu )
+
+RDEPEND="
+	>=sys-libs/ncurses-5.7
+	>=sys-libs/readline-6.1_p2
+	group_experimental? ( dev-libs/openssl dev-db/oracle-instantclient-basic )
+	group_mysql? ( >=dev-db/mysql-5.1.50 sys-libs/zlib )
+	group_radius? ( >=net-dialup/radiusclient-ng-0.5.0 )
+	group_presence? ( dev-libs/libxml2 net-misc/curl )
+	group_postgres? ( dev-db/postgresql-base )
+	group_standard? ( dev-libs/libxml2 dev-libs/openssl net-misc/curl )
+	group_kmysql? ( >=dev-db/mysql-5.1.50 sys-libs/zlib )
+	group_kradius? ( >=net-dialup/radiusclient-ng-0.5.0 )
+	group_kpresence? ( dev-libs/libxml2 net-misc/curl )
+	group_kpostgres? ( dev-db/postgresql-base )
+	group_kstandard? ( dev-libs/libxml2 dev-libs/openssl net-misc/curl )
+	group_kxml? ( dev-libs/libxml2 dev-libs/xmlrpc-c )
+	group_kperl? ( dev-lang/perl dev-perl/perl-ldap )
+	group_kldap? ( net-nds/openldap )
+	acc_radius? ( net-dialup/radiusclient-ng )
+	app_lua? ( >=dev-lang/lua-5.1 )
+	app_python? ( dev-lang/python )
+	auth_identity? ( dev-libs/openssl net-misc/curl )
+	carrierroute? ( dev-libs/confuse )
+	cpl-c? ( dev-libs/libxml2 )
+	db_berkeley? ( >=sys-libs/db-4.6 )
+	db_mysql? ( >=dev-db/mysql-5.1.50 )
+	db_oracle? ( dev-db/oracle-instantclient-basic )
+	db_postgres? ( dev-db/postgresql-base )
+        db_unixodbc? ( dev-db/unixODBC )
+	dialplan? ( dev-libs/libpcre )
+	geoip? ( dev-libs/geoip )
+	h350? ( net-nds/openldap )
+	jabber? ( dev-libs/expat )
+	lcr? ( dev-libs/libpcre )
+	ldap? ( net-nds/openldap )
+	memcached? ( dev-libs/libmemcache net-misc/memcached )
+	mi_xmlrpc? ( dev-libs/libxml2 dev-libs/xmlrpc-c )
+	peering? ( net-dialup/radiusclient-ng )
+	perl? ( dev-lang/perl dev-perl/perl-ldap )
+	presence? ( dev-libs/libxml2 )
+	presence_conference? ( dev-libs/libxml2 )
+	presence_xml? ( dev-libs/libxml2 )
+	pua? ( dev-libs/libxml2 )
+	pua_bla? ( dev-libs/libxml2 )
+	pua_dialoginfo? ( dev-libs/libxml2 )
+	pua_usrloc? ( dev-libs/libxml2 )
+	pua_xmpp? ( dev-libs/libxml2 )
+	purple? ( net-im/pidgin )
+	regex? ( dev-libs/libpcre )
+	rls? ( dev-libs/libxml2 )
+	snmpstats? ( net-analyzer/net-snmp sys-apps/lm_sensors )
+	tls? (
+		sys-libs/zlib
+		>=dev-libs/openssl-1.0.0a-r1
+	)
+	utils? ( net-misc/curl )
+	xcap_client? ( dev-libs/libxml2 net-misc/curl )
+	xcap_server? ( dev-libs/libxml2 )
+	xmlops? ( dev-libs/libxml2 )
+	xmpp? ( dev-libs/expat )
+"
+DEPEND="${RDEPEND}
+	>=sys-devel/bison-1.35
+	>=sys-devel/flex-2.5.4a
+	app-text/docbook2X"
+
+src_unpack() {
+	unpack ${A}
+	cd "${S}"
+
+	use ipv6 || \
+		sed -i -e "s/-DUSE_IPV6//g" Makefile.defs || die
+}
+
+src_compile() {
+	# iptrtpproxy broken as the needed netfilter module is not supported
+	local mod_exc="iptrtpproxy"
+	local group_inc=""
+	local k=""
+	if use flavour_kamailio; then
+		k="k"
+		use group_kxml && group_inc="${group_inc} kxml"
+		use group_kperl && group_inc="${group_inc} kperl"
+		use group_kldap && group_inc="${group_inc} kldap"
+	fi
+	# you can USE flavour=kamailio but also group_standard. It will be converted to group_kstandard
+	# same as mysql/kmysql, postgres/kpostgres, radius/kradius, presence/kpresence
+	(use group_standard || use group_kstandard) && group_inc="${group_inc} ${k}standard"
+	use group_standard_dep && group_inc="${group_inc} standard_dep"
+	(use group_mysql || use group_kmysql) && group_inc="${group_inc} ${k}mysql"
+	(use group_radius || use group_kradius) && group_inc="${group_inc} ${k}radius"
+	(use group_postgres || use group_kpostgres) && group_inc="${group_inc} ${k}postgres"
+	(use group_presence || use group_kpresence) && group_inc="${group_inc} ${k}presence"
+	use group_stable && group_inc="${group_inc} stable"
+	use group_experimental && group_inc="${group_inc} experimental"
+	# TODO: skip_modules?
+
+	local mod_inc=""
+	# some IUSE flags must not be included here in mod_inc
+	# e.g.: flavour_kamailio, flavour_ser, debug, sctp, ipv6
+	for i in ${IUSE[@]}; do
+		for j in ${i[@]}; do
+			[[ ! "${i}" =~ "flavour_" ]] && \
+				[ ! "${i}" == "debug" ] && \
+				[ ! "${i}" == "ipv6" ] && \
+				[ ! "${i}" == "sctp" ] && \
+				[[ ! "${i}" =~ "group_" ]] && \
+			use "${i}" && mod_inc="${mod_inc} ${i}"
+		done
+	done
+
+	if use tls; then
+		tls_hooks=1
+	else
+		tls_hooks=0
+	fi
+
+	if use debug; then
+		mode=debug
+	else
+		mode=release
+	fi
+
+	if use flavour_kamailio; then
+		flavour=kamailio
+	else
+		flavour=ser # defaults to SER compatibility names
+	fi
+
+	if use sctp; then
+		sctp=1
+	else
+		sctp=0
+	fi
+
+	emake \
+		CC="$(tc-getCC)" \
+		CPU_TYPE="$(get-flag march)" \
+		SCTP="${sctp}" \
+		CC_EXTRA_OPTS=-I/usr/gnu/include \
+		mode="${mode}" \
+		TLS_HOOKS="${tls_hooks}" \
+		FLAVOUR="${flavour}" \
+		group_include="${group_inc}" \
+		include_modules="${mod_inc}" \
+		exclude_modules="${mod_exc}" \
+		prefix="/" \
+		all || die "emake all failed"
+}
+
+src_install() {
+	emake -j1 \
+		BASEDIR="${D}" \
+		FLAVOUR="${flavour}" \
+		prefix="/" \
+		bin_dir=/usr/sbin/ \
+		cfg_dir=/etc/${flavour}/ \
+		lib_dir=/usr/$(get_libdir)/${flavour}/ \
+		modules_dir="/usr/$(get_libdir)/${flavour}/" \
+		man_dir="/usr/share/man/" \
+		doc_dir="/usr/share/doc/${flavour}/" \
+		install || die "emake install failed"
+
+	sed -e "s/sip-router/${flavour}/g" \
+		${FILESDIR}/ser.initd > ${flavour}.initd || die
+	sed -e "s/sip-router/${flavour}/g" \
+		${FILESDIR}/ser.confd > ${flavour}.confd || die
+
+	newinitd "${flavour}".initd "${flavour}"
+	newconfd "${flavour}".confd "${flavour}"
+}
+
+pkg_preinst() {
+	if [[ -z "$(egetent passwd ${flavour})" ]]; then
+		einfo "Adding ${flavour} user and group"
+		enewgroup "${flavour}"
+		enewuser  "${flavour}" -1 -1 /dev/null "${flavour}"
+	fi
+
+	chown -R root:"${flavour}"  "${D}/etc/${flavour}"
+	chmod -R u=rwX,g=rX,o= "${D}/etc/${flavour}"
+
+	has_version <="${CATEGORY}/ser-0.9.8"
+	previous_installed_version=$?
+	if [[ $previous_installed_version = 1 ]] ; then
+		elog "You have a previous version of SER on ${ROOT}etc/ser"
+		elog "Consider or verify to remove it (emerge -C ser)."
+		elog
+		elog "Sip-Router may not could be installed/merged. See your elog."
+	fi
+}
+
+pkg_postinst() {
+	if [ use mediaproxy ]; then
+		einfo "You have enabled mediaproxy support. In order to use it, you have
+		to run it somewhere."
+	fi
+	if [ use rtpproxy ]; then
+		einfo "You have enabled rtpproxy support. In order to use it, you have
+		to run it somewhere."
+	fi
+}
+
+pkg_prerm () {
+	/etc/init.d/"${flavour}" stop >/dev/null
+}
diff --git a/pkg/ser/gentoo/sip-router-3.2.3.ebuild b/pkg/ser/gentoo/sip-router-3.2.3.ebuild
new file mode 100644
index 0000000..6b00f62
--- /dev/null
+++ b/pkg/ser/gentoo/sip-router-3.2.3.ebuild
@@ -0,0 +1,251 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+DESCRIPTION="Sip-Router (Kamailio/SER) is an Open Source SIP Server"
+HOMEPAGE="http://sip-router.org/"
+MY_P="${P/sip-router/kamailio}"
+SRC_URI="http://www.kamailio.org/pub/kamailio/${PV}/src/${MY_P}_src.tar.gz"
+S=${WORKDIR}/${MY_P}
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+#Documentation can be found here: http://www.kamailio.org/docs/modules/3.2.x/
+IUSE="flavour_kamailio flavour_ser debug ipv6 sctp
+group_standard group_standard_dep group_mysql group_radius group_postgres group_presence group_stable group_experimental
+group_kstandard group_kmysql group_kradius group_kpostgres group_kpresence
+group_kxml group_kperl group_kldap group_kjson
+acc acc_radius alias_db app_lua app_python async auth auth_identity auth_db auth_diameter auth_radius avpops
+benchmark blst
+call_control carrierroute cfg_db cfg_rpc cfgutils counters cpl-c ctl
+db_berkeley db_flatstore db_mysql db_oracle db_postgres db_text db_unixodbc
+db_sqlite ndb_redis
+debugger dialog dialplan dispatcher diversion domain domainpolicy drouting dmq
+enum exec geoip group
+h350 htable imc ipops iptrtpproxy jabber json jsonrpc-c kex
+lcr ldap
+matrix maxfwd mediaproxy memcached misc_radius mi_datagram mi_fifo mi_rpc mi_xmlrpc mqueue msilo mtree
+nathelper nat_traversal
+osp
+p_usrloc
+path pdb pdt peering perl perlvdb permissions pike pipelimit prefix_route
+presence presence_conference presence_dialoginfo presence_mwi presence_reginfo presence_xml
+pua pua_bla pua_dialoginfo pua_mi pua_reginfo pua_usrloc pua_xmpp purple pv
+qos
+ratelimit regex registrar rls rtimer rr rtpproxy
+sanity sdpops seas sipcapture siptrace siputils sl sms snmpstats speeddial sqlops statistics sst
+textops textopsx tls tm tmx topoh
+uac uac_redirect uri_db userblacklist usrloc utils
+xcap_client xcap_server xhttp xlog xmlops xmlrpc xmpp"
+
+#pdb? ( pdb-server )
+#seas? ( www.wesip.eu )
+
+RDEPEND="
+	>=sys-libs/ncurses-5.7
+	>=sys-libs/readline-6.1_p2
+	group_experimental? ( dev-libs/openssl dev-db/redis )
+	group_mysql? ( >=dev-db/mysql-5.1.50 sys-libs/zlib )
+	group_radius? ( >=net-dialup/radiusclient-ng-0.5.0 )
+	group_presence? ( dev-libs/libxml2 net-misc/curl )
+	group_postgres? ( dev-db/postgresql-base )
+	group_standard? ( dev-libs/libxml2 dev-libs/openssl net-misc/curl )
+	group_kmysql? ( >=dev-db/mysql-5.1.50 sys-libs/zlib )
+	group_kradius? ( >=net-dialup/radiusclient-ng-0.5.0 )
+	group_kpresence? ( dev-libs/libxml2 net-misc/curl )
+	group_kpostgres? ( dev-db/postgresql-base )
+	group_kstandard? ( dev-libs/libxml2 dev-libs/openssl net-misc/curl )
+	group_kxml? ( dev-libs/libxml2 dev-libs/xmlrpc-c )
+	group_kperl? ( dev-lang/perl dev-perl/perl-ldap )
+	group_kldap? ( net-nds/openldap )
+	group_kjson? ( dev-libs/json-c dev-libs/libevent )
+	acc_radius? ( net-dialup/radiusclient-ng )
+	app_lua? ( dev-lang/lua )
+	app_python? ( dev-lang/python )
+	auth_identity? ( dev-libs/openssl net-misc/curl )
+	carrierroute? ( dev-libs/confuse )
+	cpl-c? ( dev-libs/libxml2 )
+	db_berkeley? ( >=sys-libs/db-4.6 )
+	db_mysql? ( >=dev-db/mysql-5.1.50 )
+	db_oracle? ( dev-db/oracle-instantclient-basic )
+	db_postgres? ( dev-db/postgresql-base )
+	db_sqlite? ( >=dev-db/sqlite-3 )
+	db_unixodbc? ( dev-db/unixODBC )
+	ndb_redis? ( dev-db/redis )
+	dialplan? ( dev-libs/libpcre )
+	geoip? ( dev-libs/geoip )
+	h350? ( net-nds/openldap )
+	jabber? ( dev-libs/expat )
+	lcr? ( dev-libs/libpcre )
+	ldap? ( net-nds/openldap )
+	memcached? ( dev-libs/libmemcache net-misc/memcached )
+	mi_xmlrpc? ( dev-libs/libxml2 dev-libs/xmlrpc-c )
+	osp? ( net-libs/osptoolkit )
+	peering? ( net-dialup/radiusclient-ng )
+	perl? ( dev-lang/perl dev-perl/perl-ldap )
+	presence? ( dev-libs/libxml2 )
+	presence_conference? ( dev-libs/libxml2 )
+	presence_xml? ( dev-libs/libxml2 )
+	pua? ( dev-libs/libxml2 )
+	pua_bla? ( dev-libs/libxml2 )
+	pua_dialoginfo? ( dev-libs/libxml2 )
+	pua_usrloc? ( dev-libs/libxml2 )
+	pua_xmpp? ( dev-libs/libxml2 )
+	purple? ( net-im/pidgin )
+	regex? ( dev-libs/libpcre )
+	rls? ( dev-libs/libxml2 )
+	snmpstats? ( net-analyzer/net-snmp sys-apps/lm_sensors )
+	tls? (
+		sys-libs/zlib
+		>=dev-libs/openssl-1.0.0a-r1
+	)
+	utils? ( net-misc/curl )
+	xcap_client? ( dev-libs/libxml2 net-misc/curl )
+	xcap_server? ( dev-libs/libxml2 )
+	xmlops? ( dev-libs/libxml2 )
+	xmpp? ( dev-libs/expat )
+"
+DEPEND="${RDEPEND}
+	>=sys-devel/bison-1.35
+	>=sys-devel/flex-2.5.4a
+	app-text/docbook2X"
+
+src_unpack() {
+	unpack ${A}
+	cd "${S}"
+
+	use ipv6 || \
+		sed -i -e "s/-DUSE_IPV6//g" Makefile.defs || die
+}
+
+src_compile() {
+	# iptrtpproxy broken as the needed netfilter module is not supported
+	local mod_exc="iptrtpproxy"
+	local group_inc=""
+	local k=""
+	if use flavour_kamailio; then
+		k="k"
+		use group_kxml && group_inc="${group_inc} kxml"
+		use group_kperl && group_inc="${group_inc} kperl"
+		use group_kldap && group_inc="${group_inc} kldap"
+		use group_kjson && group_inc="${group_inc} kjson"
+	fi
+	# you can USE flavour=kamailio but also group_standard. It will be converted to group_kstandard
+	# same as mysql/kmysql, postgres/kpostgres, radius/kradius, presence/kpresence
+	(use group_standard || use group_kstandard) && group_inc="${group_inc} ${k}standard"
+	use group_standard_dep && group_inc="${group_inc} standard_dep"
+	(use group_mysql || use group_kmysql) && group_inc="${group_inc} ${k}mysql"
+	(use group_radius || use group_kradius) && group_inc="${group_inc} ${k}radius"
+	(use group_postgres || use group_kpostgres) && group_inc="${group_inc} ${k}postgres"
+	(use group_presence || use group_kpresence) && group_inc="${group_inc} ${k}presence"
+	use group_stable && group_inc="${group_inc} stable"
+	use group_experimental && group_inc="${group_inc} experimental"
+	# TODO: skip_modules?
+
+	local mod_inc=""
+	# some IUSE flags must not be included here in mod_inc
+	# e.g.: flavour_kamailio, flavour_ser, debug, sctp, ipv6
+	for i in ${IUSE[@]}; do
+		for j in ${i[@]}; do
+			[[ ! "${i}" =~ "flavour_" ]] && \
+				[ ! "${i}" == "debug" ] && \
+				[ ! "${i}" == "ipv6" ] && \
+				[ ! "${i}" == "sctp" ] && \
+				[[ ! "${i}" =~ "group_" ]] && \
+			use "${i}" && mod_inc="${mod_inc} ${i}"
+		done
+	done
+
+	if use tls; then
+		tls_hooks=1
+	else
+		tls_hooks=0
+	fi
+
+	if use debug; then
+		mode=debug
+	else
+		mode=release
+	fi
+
+	if use flavour_kamailio; then
+		flavour=kamailio
+	else
+		flavour=ser # defaults to SER compatibility names
+	fi
+
+	if use sctp; then
+		sctp=1
+	else
+		sctp=0
+	fi
+
+	emake \
+		CC="$(tc-getCC)" \
+		CPU_TYPE="$(get-flag march)" \
+		SCTP="${sctp}" \
+		CC_EXTRA_OPTS=-I/usr/gnu/include \
+		mode="${mode}" \
+		TLS_HOOKS="${tls_hooks}" \
+		FLAVOUR="${flavour}" \
+		group_include="${group_inc}" \
+		include_modules="${mod_inc}" \
+		exclude_modules="${mod_exc}" \
+		prefix="/" \
+		all || die "emake all failed"
+}
+
+src_install() {
+	emake -j1 \
+		BASEDIR="${D}" \
+		FLAVOUR="${flavour}" \
+		prefix="/" \
+		bin_dir=/usr/sbin/ \
+		cfg_dir=/etc/${flavour}/ \
+		lib_dir=/usr/$(get_libdir)/${flavour}/ \
+		modules_dir="/usr/$(get_libdir)/${flavour}/" \
+		man_dir="/usr/share/man/" \
+		doc_dir="/usr/share/doc/${flavour}/" \
+		share_dir="/usr/share/${flavour}/" \
+		data_dir="/usr/share/${flavour}/" \
+		install || die "emake install failed"
+
+	sed -e "s/sip-router/${flavour}/g" \
+		${FILESDIR}/ser.initd > ${flavour}.initd || die
+	sed -e "s/sip-router/${flavour}/g" \
+		${FILESDIR}/ser.confd > ${flavour}.confd || die
+
+	newinitd "${flavour}".initd "${flavour}"
+	newconfd "${flavour}".confd "${flavour}"
+}
+
+pkg_preinst() {
+	if [[ -z "$(egetent passwd ${flavour})" ]]; then
+		einfo "Adding ${flavour} user and group"
+		enewgroup "${flavour}"
+		enewuser  "${flavour}" -1 -1 /dev/null "${flavour}"
+	fi
+
+	chown -R root:"${flavour}"  "${D}/etc/${flavour}"
+	chmod -R u=rwX,g=rX,o= "${D}/etc/${flavour}"
+
+}
+
+pkg_postinst() {
+	if [ use mediaproxy ]; then
+		einfo "You have enabled mediaproxy support. In order to use it, you have
+		to run it somewhere."
+	fi
+	if [ use rtpproxy ]; then
+		einfo "You have enabled rtpproxy support. In order to use it, you have
+		to run it somewhere."
+	fi
+}
+
+pkg_prerm () {
+	/etc/init.d/"${flavour}" stop >/dev/null
+}
diff --git a/pkg/ser/gentoo/sip-router-3.2.4.ebuild b/pkg/ser/gentoo/sip-router-3.2.4.ebuild
new file mode 100644
index 0000000..9eae9c6
--- /dev/null
+++ b/pkg/ser/gentoo/sip-router-3.2.4.ebuild
@@ -0,0 +1,251 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+DESCRIPTION="Sip-Router (Kamailio/SER) is an Open Source SIP Server"
+HOMEPAGE="http://sip-router.org/"
+MY_P="${P/sip-router/kamailio}"
+SRC_URI="http://www.kamailio.org/pub/kamailio/${PV}/src/${MY_P}_src.tar.gz"
+S=${WORKDIR}/${MY_P}
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+#Documentation can be found here: http://www.kamailio.org/docs/modules/3.2.x/
+IUSE="flavour_kamailio flavour_ser debug ipv6 sctp
+group_standard group_standard_dep group_mysql group_radius group_postgres group_presence group_stable group_experimental
+group_kstandard group_kmysql group_kradius group_kpostgres group_kpresence
+group_kxml group_kperl group_kldap group_kjson
+acc acc_radius alias_db app_lua app_python async auth auth_identity auth_db auth_diameter auth_radius avpops
+benchmark blst
+call_control carrierroute cfg_db cfg_rpc cfgutils counters cpl-c ctl
+db_berkeley db_flatstore db_mysql db_oracle db_postgres db_text db_unixodbc
+db_sqlite ndb_redis
+debugger dialog dialplan dispatcher diversion domain domainpolicy drouting dmq
+enum exec geoip group
+h350 htable imc ipops iptrtpproxy jabber json jsonrpc-c kex
+lcr ldap
+matrix maxfwd mediaproxy memcached misc_radius mi_datagram mi_fifo mi_rpc mi_xmlrpc mqueue msilo mtree
+nathelper nat_traversal
+osp
+p_usrloc
+path pdb pdt peering perl perlvdb permissions pike pipelimit prefix_route
+presence presence_conference presence_dialoginfo presence_mwi presence_reginfo presence_xml
+pua pua_bla pua_dialoginfo pua_mi pua_reginfo pua_usrloc pua_xmpp purple pv
+qos
+ratelimit regex registrar rls rtimer rr rtpproxy
+sanity sdpops seas sipcapture siptrace siputils sl sms snmpstats speeddial sqlops statistics sst
+textops textopsx tls tm tmx topoh
+uac uac_redirect uri_db userblacklist usrloc utils
+xcap_client xcap_server xhttp xlog xmlops xmlrpc xmpp"
+
+#pdb? ( pdb-server )
+#seas? ( www.wesip.eu )
+
+RDEPEND="
+	>=sys-libs/ncurses-5.7
+	>=sys-libs/readline-6.1_p2
+	group_experimental? ( dev-libs/openssl dev-db/redis dev-db/oracle-instantclient-basic )
+	group_mysql? ( >=dev-db/mysql-5.1.50 sys-libs/zlib )
+	group_radius? ( >=net-dialup/radiusclient-ng-0.5.0 )
+	group_presence? ( dev-libs/libxml2 net-misc/curl )
+	group_postgres? ( dev-db/postgresql-base )
+	group_standard? ( dev-libs/libxml2 dev-libs/openssl net-misc/curl )
+	group_kmysql? ( >=dev-db/mysql-5.1.50 sys-libs/zlib )
+	group_kradius? ( >=net-dialup/radiusclient-ng-0.5.0 )
+	group_kpresence? ( dev-libs/libxml2 net-misc/curl )
+	group_kpostgres? ( dev-db/postgresql-base )
+	group_kstandard? ( dev-libs/libxml2 dev-libs/openssl net-misc/curl )
+	group_kxml? ( dev-libs/libxml2 dev-libs/xmlrpc-c )
+	group_kperl? ( dev-lang/perl dev-perl/perl-ldap )
+	group_kldap? ( net-nds/openldap )
+	group_kjson? ( dev-libs/json-c dev-libs/libevent )
+	acc_radius? ( net-dialup/radiusclient-ng )
+	app_lua? ( >=dev-lang/lua-5.1 )
+	app_python? ( dev-lang/python )
+	auth_identity? ( dev-libs/openssl net-misc/curl )
+	carrierroute? ( dev-libs/confuse )
+	cpl-c? ( dev-libs/libxml2 )
+	db_berkeley? ( >=sys-libs/db-4.6 )
+	db_mysql? ( >=dev-db/mysql-5.1.50 )
+	db_oracle? ( dev-db/oracle-instantclient-basic )
+	db_postgres? ( dev-db/postgresql-base )
+	db_sqlite? ( >=dev-db/sqlite-3 )
+	db_unixodbc? ( dev-db/unixODBC )
+	ndb_redis? ( dev-db/redis )
+	dialplan? ( dev-libs/libpcre )
+	geoip? ( dev-libs/geoip )
+	h350? ( net-nds/openldap )
+	jabber? ( dev-libs/expat )
+	lcr? ( dev-libs/libpcre )
+	ldap? ( net-nds/openldap )
+	memcached? ( dev-libs/libmemcache net-misc/memcached )
+	mi_xmlrpc? ( dev-libs/libxml2 dev-libs/xmlrpc-c )
+	osp? ( net-libs/osptoolkit )
+	peering? ( net-dialup/radiusclient-ng )
+	perl? ( dev-lang/perl dev-perl/perl-ldap )
+	presence? ( dev-libs/libxml2 )
+	presence_conference? ( dev-libs/libxml2 )
+	presence_xml? ( dev-libs/libxml2 )
+	pua? ( dev-libs/libxml2 )
+	pua_bla? ( dev-libs/libxml2 )
+	pua_dialoginfo? ( dev-libs/libxml2 )
+	pua_usrloc? ( dev-libs/libxml2 )
+	pua_xmpp? ( dev-libs/libxml2 )
+	purple? ( net-im/pidgin )
+	regex? ( dev-libs/libpcre )
+	rls? ( dev-libs/libxml2 )
+	snmpstats? ( net-analyzer/net-snmp sys-apps/lm_sensors )
+	tls? (
+		sys-libs/zlib
+		>=dev-libs/openssl-1.0.0a-r1
+	)
+	utils? ( net-misc/curl )
+	xcap_client? ( dev-libs/libxml2 net-misc/curl )
+	xcap_server? ( dev-libs/libxml2 )
+	xmlops? ( dev-libs/libxml2 )
+	xmpp? ( dev-libs/expat )
+"
+DEPEND="${RDEPEND}
+	>=sys-devel/bison-1.35
+	>=sys-devel/flex-2.5.4a
+	app-text/docbook2X"
+
+src_unpack() {
+	unpack ${A}
+	cd "${S}"
+
+	use ipv6 || \
+		sed -i -e "s/-DUSE_IPV6//g" Makefile.defs || die
+}
+
+src_compile() {
+	# iptrtpproxy broken as the needed netfilter module is not supported
+	local mod_exc="iptrtpproxy"
+	local group_inc=""
+	local k=""
+	if use flavour_kamailio; then
+		k="k"
+		use group_kxml && group_inc="${group_inc} kxml"
+		use group_kperl && group_inc="${group_inc} kperl"
+		use group_kldap && group_inc="${group_inc} kldap"
+		use group_kjson && group_inc="${group_inc} kjson"
+	fi
+	# you can USE flavour=kamailio but also group_standard. It will be converted to group_kstandard
+	# same as mysql/kmysql, postgres/kpostgres, radius/kradius, presence/kpresence
+	(use group_standard || use group_kstandard) && group_inc="${group_inc} ${k}standard"
+	use group_standard_dep && group_inc="${group_inc} standard_dep"
+	(use group_mysql || use group_kmysql) && group_inc="${group_inc} ${k}mysql"
+	(use group_radius || use group_kradius) && group_inc="${group_inc} ${k}radius"
+	(use group_postgres || use group_kpostgres) && group_inc="${group_inc} ${k}postgres"
+	(use group_presence || use group_kpresence) && group_inc="${group_inc} ${k}presence"
+	use group_stable && group_inc="${group_inc} stable"
+	use group_experimental && group_inc="${group_inc} experimental"
+	# TODO: skip_modules?
+
+	local mod_inc=""
+	# some IUSE flags must not be included here in mod_inc
+	# e.g.: flavour_kamailio, flavour_ser, debug, sctp, ipv6
+	for i in ${IUSE[@]}; do
+		for j in ${i[@]}; do
+			[[ ! "${i}" =~ "flavour_" ]] && \
+				[ ! "${i}" == "debug" ] && \
+				[ ! "${i}" == "ipv6" ] && \
+				[ ! "${i}" == "sctp" ] && \
+				[[ ! "${i}" =~ "group_" ]] && \
+			use "${i}" && mod_inc="${mod_inc} ${i}"
+		done
+	done
+
+	if use tls; then
+		tls_hooks=1
+	else
+		tls_hooks=0
+	fi
+
+	if use debug; then
+		mode=debug
+	else
+		mode=release
+	fi
+
+	if use flavour_kamailio; then
+		flavour=kamailio
+	else
+		flavour=ser # defaults to SER compatibility names
+	fi
+
+	if use sctp; then
+		sctp=1
+	else
+		sctp=0
+	fi
+
+	emake \
+		CC="$(tc-getCC)" \
+		CPU_TYPE="$(get-flag march)" \
+		SCTP="${sctp}" \
+		CC_EXTRA_OPTS=-I/usr/gnu/include \
+		mode="${mode}" \
+		TLS_HOOKS="${tls_hooks}" \
+		FLAVOUR="${flavour}" \
+		group_include="${group_inc}" \
+		include_modules="${mod_inc}" \
+		exclude_modules="${mod_exc}" \
+		prefix="/" \
+		all || die "emake all failed"
+}
+
+src_install() {
+	emake -j1 \
+		BASEDIR="${D}" \
+		FLAVOUR="${flavour}" \
+		prefix="/" \
+		bin_dir=/usr/sbin/ \
+		cfg_dir=/etc/${flavour}/ \
+		lib_dir=/usr/$(get_libdir)/${flavour}/ \
+		modules_dir="/usr/$(get_libdir)/${flavour}/" \
+		man_dir="/usr/share/man/" \
+		doc_dir="/usr/share/doc/${flavour}/" \
+		share_dir="/usr/share/${flavour}/" \
+		data_dir="/usr/share/${flavour}/" \
+		install || die "emake install failed"
+
+	sed -e "s/sip-router/${flavour}/g" \
+		${FILESDIR}/ser.initd > ${flavour}.initd || die
+	sed -e "s/sip-router/${flavour}/g" \
+		${FILESDIR}/ser.confd > ${flavour}.confd || die
+
+	newinitd "${flavour}".initd "${flavour}"
+	newconfd "${flavour}".confd "${flavour}"
+}
+
+pkg_preinst() {
+	if [[ -z "$(egetent passwd ${flavour})" ]]; then
+		einfo "Adding ${flavour} user and group"
+		enewgroup "${flavour}"
+		enewuser  "${flavour}" -1 -1 /dev/null "${flavour}"
+	fi
+
+	chown -R root:"${flavour}"  "${D}/etc/${flavour}"
+	chmod -R u=rwX,g=rX,o= "${D}/etc/${flavour}"
+
+}
+
+pkg_postinst() {
+	if [ use mediaproxy ]; then
+		einfo "You have enabled mediaproxy support. In order to use it, you have
+		to run it somewhere."
+	fi
+	if [ use rtpproxy ]; then
+		einfo "You have enabled rtpproxy support. In order to use it, you have
+		to run it somewhere."
+	fi
+}
+
+pkg_prerm () {
+	/etc/init.d/"${flavour}" stop >/dev/null
+}
diff --git a/pkg/ser/gentoo/sip-router-3.3.1.ebuild b/pkg/ser/gentoo/sip-router-3.3.1.ebuild
new file mode 100644
index 0000000..dcd11cd
--- /dev/null
+++ b/pkg/ser/gentoo/sip-router-3.3.1.ebuild
@@ -0,0 +1,255 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+DESCRIPTION="Sip-Router (Kamailio/SER) is an Open Source SIP Server"
+HOMEPAGE="http://sip-router.org/"
+MY_P="${P/sip-router/kamailio}"
+SRC_URI="http://www.kamailio.org/pub/kamailio/${PV}/src/${MY_P}_src.tar.gz"
+S=${WORKDIR}/${MY_P}
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+#Documentation can be found here: http://www.kamailio.org/docs/modules/3.3.x/
+IUSE="flavour_kamailio flavour_ser
+debug ipv6 sctp
+group_standard group_standard_dep group_mysql group_radius group_postgres group_presence group_stable group_experimental
+group_kstandard group_kmysql group_kradius group_kpostgres group_kpresence
+group_kxml group_kperl group_kldap group_kjson
+acc acc_radius alias_db app_lua app_python app_mono async auth auth_identity auth_db auth_diameter auth_radius avpops
+benchmark blst
+call_control carrierroute cfg_db cfg_rpc cfgutils counters cpl-c ctl
+db_berkeley db_flatstore db_mysql db_oracle db_postgres db_text db_unixodbc
+db_sqlite ndb_redis db_cassandra db_cluster
+debugger dialog dialplan dispatcher diversion domain domainpolicy drouting dmq
+enum exec geoip group
+h350 htable imc ipops iptrtpproxy jabber json jsonrpc-c kex
+lcr ldap
+matrix maxfwd msrp mediaproxy memcached misc_radius mi_datagram mi_fifo mi_rpc mi_xmlrpc mqueue msilo mtree
+nathelper nat_traversal
+osp
+p_usrloc
+path pdb pdt peering perl perlvdb permissions pike pipelimit prefix_route
+presence presence_conference presence_dialoginfo presence_mwi presence_profile presence_reginfo presence_xml
+pua pua_bla pua_dialoginfo pua_mi pua_reginfo pua_usrloc pua_xmpp purple pv
+qos
+ratelimit regex registrar rls rtimer rr rtpproxy
+sanity sdpops seas sipcapture siptrace siputils sl sms snmpstats speeddial sqlops statistics sst
+textops textopsx tls tm tmx tmrec topoh
+uac uac_redirect uri_db userblacklist usrloc utils
+xcap_client xcap_server xhttp xhttp_rpc xlog xmlops xmlrpc xmpp"
+
+# FIXME: no ebuilds for them
+#db_cassandra? ( thrift dev-db/cassandra )
+#pdb? ( pdb-server )
+#seas? ( www.wesip.eu )
+
+RDEPEND="
+	>=sys-libs/ncurses-5.7
+	>=sys-libs/readline-6.1_p2
+	group_experimental? ( dev-libs/openssl dev-db/redis dev-db/oracle-instantclient-basic )
+	group_mysql? ( >=dev-db/mysql-5.1.50 sys-libs/zlib )
+	group_radius? ( >=net-dialup/radiusclient-ng-0.5.0 )
+	group_presence? ( dev-libs/libxml2 net-misc/curl )
+	group_postgres? ( dev-db/postgresql-base )
+	group_standard? ( dev-libs/libxml2 dev-libs/openssl net-misc/curl )
+	group_kmysql? ( >=dev-db/mysql-5.1.50 sys-libs/zlib )
+	group_kradius? ( >=net-dialup/radiusclient-ng-0.5.0 )
+	group_kpresence? ( dev-libs/libxml2 net-misc/curl )
+	group_kpostgres? ( dev-db/postgresql-base )
+	group_kstandard? ( dev-libs/libxml2 dev-libs/openssl net-misc/curl )
+	group_kxml? ( dev-libs/libxml2 dev-libs/xmlrpc-c )
+	group_kperl? ( dev-lang/perl dev-perl/perl-ldap )
+	group_kldap? ( net-nds/openldap )
+	group_kjson? ( dev-libs/json-c dev-libs/libevent )
+	acc_radius? ( net-dialup/radiusclient-ng )
+	app_lua? ( >=dev-lang/lua-5.1 )
+	app_python? ( dev-lang/python )
+	app_mono? ( dev-lang/mono )
+	auth_identity? ( dev-libs/openssl net-misc/curl )
+	carrierroute? ( dev-libs/confuse )
+	cpl-c? ( dev-libs/libxml2 )
+	db_berkeley? ( >=sys-libs/db-4.6 )
+	db_mysql? ( >=dev-db/mysql-5.1.50 )
+	db_oracle? ( dev-db/oracle-instantclient-basic )
+	db_postgres? ( dev-db/postgresql-base )
+	db_sqlite? ( >=dev-db/sqlite-3 )
+	db_unixodbc? ( dev-db/unixODBC )
+	ndb_redis? ( dev-db/redis )
+	dialplan? ( dev-libs/libpcre )
+	geoip? ( dev-libs/geoip )
+	h350? ( net-nds/openldap )
+	jabber? ( dev-libs/expat )
+	lcr? ( dev-libs/libpcre )
+	ldap? ( net-nds/openldap )
+	memcached? ( dev-libs/libmemcache net-misc/memcached )
+	mi_xmlrpc? ( dev-libs/libxml2 dev-libs/xmlrpc-c )
+	osp? ( net-libs/osptoolkit )
+	peering? ( net-dialup/radiusclient-ng )
+	perl? ( dev-lang/perl dev-perl/perl-ldap )
+	presence? ( dev-libs/libxml2 )
+	presence_conference? ( dev-libs/libxml2 )
+	presence_xml? ( dev-libs/libxml2 )
+	pua? ( dev-libs/libxml2 )
+	pua_bla? ( dev-libs/libxml2 )
+	pua_dialoginfo? ( dev-libs/libxml2 )
+	pua_usrloc? ( dev-libs/libxml2 )
+	pua_xmpp? ( dev-libs/libxml2 )
+	purple? ( net-im/pidgin )
+	regex? ( dev-libs/libpcre )
+	rls? ( dev-libs/libxml2 )
+	snmpstats? ( net-analyzer/net-snmp sys-apps/lm_sensors )
+	tls? (
+		sys-libs/zlib
+		>=dev-libs/openssl-1.0.0a-r1
+	)
+	utils? ( net-misc/curl )
+	xcap_client? ( dev-libs/libxml2 net-misc/curl )
+	xcap_server? ( dev-libs/libxml2 )
+	xmlops? ( dev-libs/libxml2 )
+	xmpp? ( dev-libs/expat )
+"
+DEPEND="${RDEPEND}
+	>=sys-devel/bison-1.35
+	>=sys-devel/flex-2.5.4a
+	app-text/docbook2X"
+
+src_unpack() {
+	unpack ${A}
+	cd "${S}"
+
+	use ipv6 || \
+		sed -i -e "s/-DUSE_IPV6//g" Makefile.defs || die
+}
+
+src_compile() {
+	# iptrtpproxy broken as the needed netfilter module is not supported
+	local mod_exc="iptrtpproxy"
+	local group_inc=""
+	local k=""
+	if use flavour_kamailio; then
+		k="k"
+		use group_kxml && group_inc="${group_inc} kxml"
+		use group_kperl && group_inc="${group_inc} kperl"
+		use group_kldap && group_inc="${group_inc} kldap"
+		use group_kjson && group_inc="${group_inc} kjson"
+	fi
+	# you can USE flavour=kamailio but also group_standard. It will be converted to group_kstandard
+	# same as mysql/kmysql, postgres/kpostgres, radius/kradius, presence/kpresence
+	(use group_standard || use group_kstandard) && group_inc="${group_inc} ${k}standard"
+	use group_standard_dep && group_inc="${group_inc} standard_dep"
+	(use group_mysql || use group_kmysql) && group_inc="${group_inc} ${k}mysql"
+	(use group_radius || use group_kradius) && group_inc="${group_inc} ${k}radius"
+	(use group_postgres || use group_kpostgres) && group_inc="${group_inc} ${k}postgres"
+	(use group_presence || use group_kpresence) && group_inc="${group_inc} ${k}presence"
+	use group_stable && group_inc="${group_inc} stable"
+	use group_experimental && group_inc="${group_inc} experimental"
+	# TODO: skip_modules?
+
+	local mod_inc=""
+	# some IUSE flags must not be included here in mod_inc
+	# e.g.: flavour_kamailio, flavour_ser, debug, sctp, ipv6
+	for i in ${IUSE[@]}; do
+		for j in ${i[@]}; do
+			[[ ! "${i}" =~ "flavour_" ]] && \
+				[ ! "${i}" == "debug" ] && \
+				[ ! "${i}" == "ipv6" ] && \
+				[ ! "${i}" == "sctp" ] && \
+				[[ ! "${i}" =~ "group_" ]] && \
+			use "${i}" && mod_inc="${mod_inc} ${i}"
+		done
+	done
+
+	if use tls; then
+		tls_hooks=1
+	else
+		tls_hooks=0
+	fi
+
+	if use debug; then
+		mode=debug
+	else
+		mode=release
+	fi
+
+	if use flavour_kamailio; then
+		flavour=kamailio
+	else
+		flavour=ser # defaults to SER compatibility names
+	fi
+
+	if use sctp; then
+		sctp=1
+	else
+		sctp=0
+	fi
+
+	emake \
+		CC="$(tc-getCC)" \
+		CPU_TYPE="$(get-flag march)" \
+		SCTP="${sctp}" \
+		CC_EXTRA_OPTS=-I/usr/gnu/include \
+		mode="${mode}" \
+		TLS_HOOKS="${tls_hooks}" \
+		FLAVOUR="${flavour}" \
+		group_include="${group_inc}" \
+		include_modules="${mod_inc}" \
+		exclude_modules="${mod_exc}" \
+		prefix="/" \
+		all || die "emake all failed"
+}
+
+src_install() {
+	emake -j1 \
+		BASEDIR="${D}" \
+		FLAVOUR="${flavour}" \
+		prefix="/" \
+		bin_dir=/usr/sbin/ \
+		cfg_dir=/etc/${flavour}/ \
+		lib_dir=/usr/$(get_libdir)/${flavour}/ \
+		modules_dir="/usr/$(get_libdir)/${flavour}/" \
+		man_dir="/usr/share/man/" \
+		doc_dir="/usr/share/doc/${flavour}/" \
+		share_dir="/usr/share/${flavour}/" \
+		data_dir="/usr/share/${flavour}/" \
+		install || die "emake install failed"
+
+	sed -e "s/sip-router/${flavour}/g" \
+		${FILESDIR}/ser.initd > ${flavour}.initd || die
+	sed -e "s/sip-router/${flavour}/g" \
+		${FILESDIR}/ser.confd > ${flavour}.confd || die
+
+	newinitd "${flavour}".initd "${flavour}"
+	newconfd "${flavour}".confd "${flavour}"
+}
+
+pkg_preinst() {
+	if [[ -z "$(egetent passwd ${flavour})" ]]; then
+		einfo "Adding ${flavour} user and group"
+		enewgroup "${flavour}"
+		enewuser  "${flavour}" -1 -1 /dev/null "${flavour}"
+	fi
+
+	chown -R root:"${flavour}"  "${D}/etc/${flavour}"
+	chmod -R u=rwX,g=rX,o= "${D}/etc/${flavour}"
+
+}
+
+pkg_postinst() {
+	if [ use mediaproxy ]; then
+		einfo "You have enabled mediaproxy support. In order to use it, you have
+		to run it somewhere."
+	fi
+	if [ use rtpproxy ]; then
+		einfo "You have enabled rtpproxy support. In order to use it, you have
+		to run it somewhere."
+	fi
+}
+
+pkg_prerm () {
+	/etc/init.d/"${flavour}" stop >/dev/null
+}
diff --git a/pkg/ser/gentoo/sip-router-3.3.2.ebuild b/pkg/ser/gentoo/sip-router-3.3.2.ebuild
new file mode 100644
index 0000000..dcd11cd
--- /dev/null
+++ b/pkg/ser/gentoo/sip-router-3.3.2.ebuild
@@ -0,0 +1,255 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+DESCRIPTION="Sip-Router (Kamailio/SER) is an Open Source SIP Server"
+HOMEPAGE="http://sip-router.org/"
+MY_P="${P/sip-router/kamailio}"
+SRC_URI="http://www.kamailio.org/pub/kamailio/${PV}/src/${MY_P}_src.tar.gz"
+S=${WORKDIR}/${MY_P}
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+#Documentation can be found here: http://www.kamailio.org/docs/modules/3.3.x/
+IUSE="flavour_kamailio flavour_ser
+debug ipv6 sctp
+group_standard group_standard_dep group_mysql group_radius group_postgres group_presence group_stable group_experimental
+group_kstandard group_kmysql group_kradius group_kpostgres group_kpresence
+group_kxml group_kperl group_kldap group_kjson
+acc acc_radius alias_db app_lua app_python app_mono async auth auth_identity auth_db auth_diameter auth_radius avpops
+benchmark blst
+call_control carrierroute cfg_db cfg_rpc cfgutils counters cpl-c ctl
+db_berkeley db_flatstore db_mysql db_oracle db_postgres db_text db_unixodbc
+db_sqlite ndb_redis db_cassandra db_cluster
+debugger dialog dialplan dispatcher diversion domain domainpolicy drouting dmq
+enum exec geoip group
+h350 htable imc ipops iptrtpproxy jabber json jsonrpc-c kex
+lcr ldap
+matrix maxfwd msrp mediaproxy memcached misc_radius mi_datagram mi_fifo mi_rpc mi_xmlrpc mqueue msilo mtree
+nathelper nat_traversal
+osp
+p_usrloc
+path pdb pdt peering perl perlvdb permissions pike pipelimit prefix_route
+presence presence_conference presence_dialoginfo presence_mwi presence_profile presence_reginfo presence_xml
+pua pua_bla pua_dialoginfo pua_mi pua_reginfo pua_usrloc pua_xmpp purple pv
+qos
+ratelimit regex registrar rls rtimer rr rtpproxy
+sanity sdpops seas sipcapture siptrace siputils sl sms snmpstats speeddial sqlops statistics sst
+textops textopsx tls tm tmx tmrec topoh
+uac uac_redirect uri_db userblacklist usrloc utils
+xcap_client xcap_server xhttp xhttp_rpc xlog xmlops xmlrpc xmpp"
+
+# FIXME: no ebuilds for them
+#db_cassandra? ( thrift dev-db/cassandra )
+#pdb? ( pdb-server )
+#seas? ( www.wesip.eu )
+
+RDEPEND="
+	>=sys-libs/ncurses-5.7
+	>=sys-libs/readline-6.1_p2
+	group_experimental? ( dev-libs/openssl dev-db/redis dev-db/oracle-instantclient-basic )
+	group_mysql? ( >=dev-db/mysql-5.1.50 sys-libs/zlib )
+	group_radius? ( >=net-dialup/radiusclient-ng-0.5.0 )
+	group_presence? ( dev-libs/libxml2 net-misc/curl )
+	group_postgres? ( dev-db/postgresql-base )
+	group_standard? ( dev-libs/libxml2 dev-libs/openssl net-misc/curl )
+	group_kmysql? ( >=dev-db/mysql-5.1.50 sys-libs/zlib )
+	group_kradius? ( >=net-dialup/radiusclient-ng-0.5.0 )
+	group_kpresence? ( dev-libs/libxml2 net-misc/curl )
+	group_kpostgres? ( dev-db/postgresql-base )
+	group_kstandard? ( dev-libs/libxml2 dev-libs/openssl net-misc/curl )
+	group_kxml? ( dev-libs/libxml2 dev-libs/xmlrpc-c )
+	group_kperl? ( dev-lang/perl dev-perl/perl-ldap )
+	group_kldap? ( net-nds/openldap )
+	group_kjson? ( dev-libs/json-c dev-libs/libevent )
+	acc_radius? ( net-dialup/radiusclient-ng )
+	app_lua? ( >=dev-lang/lua-5.1 )
+	app_python? ( dev-lang/python )
+	app_mono? ( dev-lang/mono )
+	auth_identity? ( dev-libs/openssl net-misc/curl )
+	carrierroute? ( dev-libs/confuse )
+	cpl-c? ( dev-libs/libxml2 )
+	db_berkeley? ( >=sys-libs/db-4.6 )
+	db_mysql? ( >=dev-db/mysql-5.1.50 )
+	db_oracle? ( dev-db/oracle-instantclient-basic )
+	db_postgres? ( dev-db/postgresql-base )
+	db_sqlite? ( >=dev-db/sqlite-3 )
+	db_unixodbc? ( dev-db/unixODBC )
+	ndb_redis? ( dev-db/redis )
+	dialplan? ( dev-libs/libpcre )
+	geoip? ( dev-libs/geoip )
+	h350? ( net-nds/openldap )
+	jabber? ( dev-libs/expat )
+	lcr? ( dev-libs/libpcre )
+	ldap? ( net-nds/openldap )
+	memcached? ( dev-libs/libmemcache net-misc/memcached )
+	mi_xmlrpc? ( dev-libs/libxml2 dev-libs/xmlrpc-c )
+	osp? ( net-libs/osptoolkit )
+	peering? ( net-dialup/radiusclient-ng )
+	perl? ( dev-lang/perl dev-perl/perl-ldap )
+	presence? ( dev-libs/libxml2 )
+	presence_conference? ( dev-libs/libxml2 )
+	presence_xml? ( dev-libs/libxml2 )
+	pua? ( dev-libs/libxml2 )
+	pua_bla? ( dev-libs/libxml2 )
+	pua_dialoginfo? ( dev-libs/libxml2 )
+	pua_usrloc? ( dev-libs/libxml2 )
+	pua_xmpp? ( dev-libs/libxml2 )
+	purple? ( net-im/pidgin )
+	regex? ( dev-libs/libpcre )
+	rls? ( dev-libs/libxml2 )
+	snmpstats? ( net-analyzer/net-snmp sys-apps/lm_sensors )
+	tls? (
+		sys-libs/zlib
+		>=dev-libs/openssl-1.0.0a-r1
+	)
+	utils? ( net-misc/curl )
+	xcap_client? ( dev-libs/libxml2 net-misc/curl )
+	xcap_server? ( dev-libs/libxml2 )
+	xmlops? ( dev-libs/libxml2 )
+	xmpp? ( dev-libs/expat )
+"
+DEPEND="${RDEPEND}
+	>=sys-devel/bison-1.35
+	>=sys-devel/flex-2.5.4a
+	app-text/docbook2X"
+
+src_unpack() {
+	unpack ${A}
+	cd "${S}"
+
+	use ipv6 || \
+		sed -i -e "s/-DUSE_IPV6//g" Makefile.defs || die
+}
+
+src_compile() {
+	# iptrtpproxy broken as the needed netfilter module is not supported
+	local mod_exc="iptrtpproxy"
+	local group_inc=""
+	local k=""
+	if use flavour_kamailio; then
+		k="k"
+		use group_kxml && group_inc="${group_inc} kxml"
+		use group_kperl && group_inc="${group_inc} kperl"
+		use group_kldap && group_inc="${group_inc} kldap"
+		use group_kjson && group_inc="${group_inc} kjson"
+	fi
+	# you can USE flavour=kamailio but also group_standard. It will be converted to group_kstandard
+	# same as mysql/kmysql, postgres/kpostgres, radius/kradius, presence/kpresence
+	(use group_standard || use group_kstandard) && group_inc="${group_inc} ${k}standard"
+	use group_standard_dep && group_inc="${group_inc} standard_dep"
+	(use group_mysql || use group_kmysql) && group_inc="${group_inc} ${k}mysql"
+	(use group_radius || use group_kradius) && group_inc="${group_inc} ${k}radius"
+	(use group_postgres || use group_kpostgres) && group_inc="${group_inc} ${k}postgres"
+	(use group_presence || use group_kpresence) && group_inc="${group_inc} ${k}presence"
+	use group_stable && group_inc="${group_inc} stable"
+	use group_experimental && group_inc="${group_inc} experimental"
+	# TODO: skip_modules?
+
+	local mod_inc=""
+	# some IUSE flags must not be included here in mod_inc
+	# e.g.: flavour_kamailio, flavour_ser, debug, sctp, ipv6
+	for i in ${IUSE[@]}; do
+		for j in ${i[@]}; do
+			[[ ! "${i}" =~ "flavour_" ]] && \
+				[ ! "${i}" == "debug" ] && \
+				[ ! "${i}" == "ipv6" ] && \
+				[ ! "${i}" == "sctp" ] && \
+				[[ ! "${i}" =~ "group_" ]] && \
+			use "${i}" && mod_inc="${mod_inc} ${i}"
+		done
+	done
+
+	if use tls; then
+		tls_hooks=1
+	else
+		tls_hooks=0
+	fi
+
+	if use debug; then
+		mode=debug
+	else
+		mode=release
+	fi
+
+	if use flavour_kamailio; then
+		flavour=kamailio
+	else
+		flavour=ser # defaults to SER compatibility names
+	fi
+
+	if use sctp; then
+		sctp=1
+	else
+		sctp=0
+	fi
+
+	emake \
+		CC="$(tc-getCC)" \
+		CPU_TYPE="$(get-flag march)" \
+		SCTP="${sctp}" \
+		CC_EXTRA_OPTS=-I/usr/gnu/include \
+		mode="${mode}" \
+		TLS_HOOKS="${tls_hooks}" \
+		FLAVOUR="${flavour}" \
+		group_include="${group_inc}" \
+		include_modules="${mod_inc}" \
+		exclude_modules="${mod_exc}" \
+		prefix="/" \
+		all || die "emake all failed"
+}
+
+src_install() {
+	emake -j1 \
+		BASEDIR="${D}" \
+		FLAVOUR="${flavour}" \
+		prefix="/" \
+		bin_dir=/usr/sbin/ \
+		cfg_dir=/etc/${flavour}/ \
+		lib_dir=/usr/$(get_libdir)/${flavour}/ \
+		modules_dir="/usr/$(get_libdir)/${flavour}/" \
+		man_dir="/usr/share/man/" \
+		doc_dir="/usr/share/doc/${flavour}/" \
+		share_dir="/usr/share/${flavour}/" \
+		data_dir="/usr/share/${flavour}/" \
+		install || die "emake install failed"
+
+	sed -e "s/sip-router/${flavour}/g" \
+		${FILESDIR}/ser.initd > ${flavour}.initd || die
+	sed -e "s/sip-router/${flavour}/g" \
+		${FILESDIR}/ser.confd > ${flavour}.confd || die
+
+	newinitd "${flavour}".initd "${flavour}"
+	newconfd "${flavour}".confd "${flavour}"
+}
+
+pkg_preinst() {
+	if [[ -z "$(egetent passwd ${flavour})" ]]; then
+		einfo "Adding ${flavour} user and group"
+		enewgroup "${flavour}"
+		enewuser  "${flavour}" -1 -1 /dev/null "${flavour}"
+	fi
+
+	chown -R root:"${flavour}"  "${D}/etc/${flavour}"
+	chmod -R u=rwX,g=rX,o= "${D}/etc/${flavour}"
+
+}
+
+pkg_postinst() {
+	if [ use mediaproxy ]; then
+		einfo "You have enabled mediaproxy support. In order to use it, you have
+		to run it somewhere."
+	fi
+	if [ use rtpproxy ]; then
+		einfo "You have enabled rtpproxy support. In order to use it, you have
+		to run it somewhere."
+	fi
+}
+
+pkg_prerm () {
+	/etc/init.d/"${flavour}" stop >/dev/null
+}
diff --git a/pkg/ser/netbsd/COMMENT b/pkg/ser/netbsd/COMMENT
new file mode 100644
index 0000000..6cef836
--- /dev/null
+++ b/pkg/ser/netbsd/COMMENT
@@ -0,0 +1 @@
+Sip Express Router, very fast and configurable SIP proxy
diff --git a/pkg/ser/netbsd/DESCR b/pkg/ser/netbsd/DESCR
new file mode 100644
index 0000000..91c29ad
--- /dev/null
+++ b/pkg/ser/netbsd/DESCR
@@ -0,0 +1,16 @@
+ser or SIP Express Router is a very fast and flexible SIP (RFC3621)
+proxy server. Written entirely in C, ser can handle thousands calls
+per second even on low-budget hardware. C Shell like scripting language
+provides full control over the server's behaviour. It's modular
+architecture allows only required functionality to be loaded.
+Currently the following modules are available: Digest Authentication,
+CPL scripts, Instant Messaging, MySQL support, Presence Agent, Radius
+Authentication, Record Routing, SMS Gateway, Jabber Gateway, Transaction
+Module, Registrar, User Location, NAT Traversal, a.s.o.
+
+
+WWW: http://www.iptel.org/ser/
+
+- Andrei Pelinescu-Onciul
+andrei at iptel.org
+
diff --git a/pkg/ser/netbsd/Makefile b/pkg/ser/netbsd/Makefile
new file mode 100644
index 0000000..502ab4c
--- /dev/null
+++ b/pkg/ser/netbsd/Makefile
@@ -0,0 +1,50 @@
+# New ports collection makefile for:    ser
+# Date created:        6 November 2002
+# Whom:                andrei
+#
+# $NetBSD$
+#
+# $Id$
+#
+
+COMMENT= "SIP Express Router"
+
+PORTNAME= ser
+PORTVERSION= 0.9.4
+CATEGORIES= net
+MASTER_SITES= ftp://ftp.iptel.org/pub/ser/0.9.4/src/
+
+MAINTAINER= andrei at iptel.org
+
+MAN8=ser.8
+MAN5=ser.cfg.5
+# MANCOMPRESSED must not be specified (if defined is assumed to be yes)
+
+# netbsd 2.0
+USE_TOOLS+=	gmake
+#netbsd 1.6
+USE_GMAKE= yes     
+# we override the DISTFILE NAME
+DISTNAME= ${PORTNAME}-${PORTVERSION}
+DISTFILES= ${DISTNAME}_src.tar.gz
+WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
+
+# build by default mysql and jabber
+MAKE_ENV= include_modules="mysql jabber cpl-c pa"
+
+# depends on expat, mysqlclient and libxml2 because of the above modules
+DEPENDS= expat-[0-9]*:../../textproc/expat \
+         mysql-client>=3.23.35:../../databases/mysql-client \
+         libxml2*:../../textproc/libxml2
+
+#.include "/usr/pkgsrc/mk/bsd.prefs.mk"
+
+pre-fetch:
+
+.include "../../textproc/expat/buildlink3.mk"
+.include "../../databases/mysql-client/buildlink3.mk"
+.include "../../textproc/libxml2/buildlink3.mk"
+
+.include "../../mk/bsd.pkg.mk"
+
+
diff --git a/pkg/ser/netbsd/PLIST b/pkg/ser/netbsd/PLIST
new file mode 100644
index 0000000..4231118
--- /dev/null
+++ b/pkg/ser/netbsd/PLIST
@@ -0,0 +1,102 @@
+etc/ser/dictionary.ser
+etc/ser/ser.cfg
+lib/ser/modules/acc_db.so
+lib/ser/modules/acc_syslog.so
+lib/ser/modules/auth.so
+lib/ser/modules/auth_db.so
+lib/ser/modules/avp.so
+lib/ser/modules/avp_db.so
+lib/ser/modules/avpops.so
+lib/ser/modules/cpl-c.so
+lib/ser/modules/ctl.so
+lib/ser/modules/db_ops.so
+lib/ser/modules/dbtext.so
+lib/ser/modules/dialog.so
+lib/ser/modules/dispatcher.so
+lib/ser/modules/domain.so
+lib/ser/modules/enum.so
+lib/ser/modules/exec.so
+lib/ser/modules/flatstore.so
+lib/ser/modules/gflags.so
+lib/ser/modules/jabber.so
+lib/ser/modules/lcr.so
+lib/ser/modules/maxfwd.so
+lib/ser/modules/mediaproxy.so
+lib/ser/modules/msilo.so
+lib/ser/modules/mysql.so
+lib/ser/modules/nathelper.so
+lib/ser/modules/options.so
+lib/ser/modules/pa.so
+lib/ser/modules/pdt.so
+lib/ser/modules/permissions.so
+lib/ser/modules/pike.so
+lib/ser/modules/print.so
+lib/ser/modules/ratelimit.so
+lib/ser/modules/registrar.so
+lib/ser/modules/rr.so
+lib/ser/modules/sl.so
+lib/ser/modules/sms.so
+lib/ser/modules/speeddial.so
+lib/ser/modules/textops.so
+lib/ser/modules/tm.so
+lib/ser/modules/uac.so
+lib/ser/modules/uri.so
+lib/ser/modules/uri_db.so
+lib/ser/modules/usrloc.so
+lib/ser/modules/xlog.so
+lib/ser/modules/xmlrpc.so
+sbin/ser
+sbin/ser_mysql.sh
+sbin/serunix
+share/doc/ser/AUTHORS
+share/doc/ser/INSTALL
+share/doc/ser/NEWS
+share/doc/ser/README
+share/doc/ser/README-MODULES
+share/doc/ser/README.acc_db
+share/doc/ser/README.acc_syslog
+share/doc/ser/README.auth
+share/doc/ser/README.auth_db
+share/doc/ser/README.avp
+share/doc/ser/README.avp_db
+share/doc/ser/README.avpops
+share/doc/ser/README.cpl-c
+share/doc/ser/README.dbtext
+share/doc/ser/README.dialog
+share/doc/ser/README.dispatcher
+share/doc/ser/README.domain
+share/doc/ser/README.enum
+share/doc/ser/README.eval
+share/doc/ser/README.exec
+share/doc/ser/README.flatstore
+share/doc/ser/README.gflags
+share/doc/ser/README.jabber
+share/doc/ser/README.lcr
+share/doc/ser/README.maxfwd
+share/doc/ser/README.msilo
+share/doc/ser/README.nathelper
+share/doc/ser/README.options
+share/doc/ser/README.pa
+share/doc/ser/README.pdt
+share/doc/ser/README.permissions
+share/doc/ser/README.pike
+share/doc/ser/README.print
+share/doc/ser/README.ratelimit
+share/doc/ser/README.registrar
+share/doc/ser/README.rr
+share/doc/ser/README.sl
+share/doc/ser/README.sms
+share/doc/ser/README.speeddial
+share/doc/ser/README.textops
+share/doc/ser/README.timer
+share/doc/ser/README.tm
+share/doc/ser/README.uac
+share/doc/ser/README.uri
+share/doc/ser/README.uri_db
+share/doc/ser/README.usrloc
+share/doc/ser/README.xlog
+share/doc/ser/README.xmlrpc
+ at dirrm share/doc/ser
+ at dirrm etc/ser
+ at dirrm lib/ser/modules
+ at dirrm lib/ser
diff --git a/pkg/ser/netbsd/distinfo b/pkg/ser/netbsd/distinfo
new file mode 100644
index 0000000..995bc51
--- /dev/null
+++ b/pkg/ser/netbsd/distinfo
@@ -0,0 +1 @@
+MD5 (ser-0.9.4_src.tar.gz) = d12d56d76c86b59dd51a43b3251b7d3a
diff --git a/pkg/ser/openbsd/Makefile b/pkg/ser/openbsd/Makefile
new file mode 100644
index 0000000..69109d1
--- /dev/null
+++ b/pkg/ser/openbsd/Makefile
@@ -0,0 +1,54 @@
+# New ports collection makefile for:    ser
+# Date created:        6 November 2002
+# Whom:                andrei
+#
+# $OpenBSD$
+#
+# $Id$
+#
+
+COMMENT= "SIP Express Router"
+
+PORTNAME= ser
+PORTVERSION= 0.9.4
+CATEGORIES= net
+MASTER_SITES= ftp://ftp.iptel.org/pub/ser/0.9.4/src/
+
+MAINTAINER= andrei at iptel.org 
+
+MAN8=ser.8
+MAN5=ser.cfg.5
+# MANCOMPRESSED must not be defined in openbsd (defined==yes)
+
+# GPL
+PERMIT_PACKAGE_CDROM=	Yes
+PERMIT_PACKAGE_FTP=	Yes
+PERMIT_DISTFILES_CDROM=	Yes
+PERMIT_DISTFILES_FTP=	Yes
+
+
+USE_GMAKE= yes
+# we override the DISTFILE NAME
+DISTNAME= ${PORTNAME}-${PORTVERSION}
+DISTFILES= ${DISTNAME}_src.tar.gz
+WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
+
+# build by default mysql and jabber
+MAKE_ENV= include_modules="mysql jabber cpl-c pa"
+
+# depends on mysql and libexpat because of the above modules
+BUILD_DEPENDS= :expat-1.*:textproc/expat \
+               :mysql-client-[3-].*:databases/mysql \
+               :libxml-2.*:textproc/libxml
+LIB_DEPENDS=   expat.2:expat-1.*:textproc/expat \
+               lib/mysql/mysqlclient.10:mysql-client-[3-].*:databases/mysql \
+               xml2:libxml-2.*:textproc/libxml
+
+
+
+pre-fetch:
+
+
+.include <bsd.port.mk>
+
+
diff --git a/pkg/ser/openbsd/distinfo b/pkg/ser/openbsd/distinfo
new file mode 100644
index 0000000..995bc51
--- /dev/null
+++ b/pkg/ser/openbsd/distinfo
@@ -0,0 +1 @@
+MD5 (ser-0.9.4_src.tar.gz) = d12d56d76c86b59dd51a43b3251b7d3a
diff --git a/pkg/ser/openbsd/pkg/COMMENT b/pkg/ser/openbsd/pkg/COMMENT
new file mode 100644
index 0000000..6cef836
--- /dev/null
+++ b/pkg/ser/openbsd/pkg/COMMENT
@@ -0,0 +1 @@
+Sip Express Router, very fast and configurable SIP proxy
diff --git a/pkg/ser/openbsd/pkg/DESCR b/pkg/ser/openbsd/pkg/DESCR
new file mode 100644
index 0000000..af5e7bf
--- /dev/null
+++ b/pkg/ser/openbsd/pkg/DESCR
@@ -0,0 +1,15 @@
+ser or SIP Express Router is a very fast and flexible SIP (RFC3621)
+proxy server. Written entirely in C, ser can handle thousands calls
+per second even on low-budget hardware. C Shell like scripting language
+provides full control over the server's behaviour. It's modular
+architecture allows only required functionality to be loaded.
+Currently the following modules are available: Digest Authentication,
+CPL scripts, Instant Messaging, MySQL support, Presence Agent, Radius
+Authentication, Record Routing, SMS Gateway, Jabber Gateway, Transaction
+Module, Registrar, User Location, NAT Traversal, a.s.o.
+
+
+WWW: http://www.iptel.org/ser/
+
+- Andrei Pelinescu-Onciul
+andrei at iptel.org
diff --git a/pkg/ser/openbsd/pkg/PLIST b/pkg/ser/openbsd/pkg/PLIST
new file mode 100644
index 0000000..2c560cc
--- /dev/null
+++ b/pkg/ser/openbsd/pkg/PLIST
@@ -0,0 +1,106 @@
+etc/ser/dictionary.ser
+etc/ser/ser.cfg
+lib/ser/modules/acc_db.so
+lib/ser/modules/acc_syslog.so
+lib/ser/modules/auth.so
+lib/ser/modules/auth_db.so
+lib/ser/modules/avp.so
+lib/ser/modules/avp_db.so
+lib/ser/modules/avpops.so
+lib/ser/modules/cpl-c.so
+lib/ser/modules/ctl.so
+lib/ser/modules/db_ops.so
+lib/ser/modules/dbtext.so
+lib/ser/modules/dialog.so
+lib/ser/modules/dispatcher.so
+lib/ser/modules/domain.so
+lib/ser/modules/enum.so
+lib/ser/modules/eval.so
+lib/ser/modules/exec.so
+lib/ser/modules/flatstore.so
+lib/ser/modules/gflags.so
+lib/ser/modules/jabber.so
+lib/ser/modules/lcr.so
+lib/ser/modules/maxfwd.so
+lib/ser/modules/mediaproxy.so
+lib/ser/modules/msilo.so
+lib/ser/modules/mysql.so
+lib/ser/modules/nathelper.so
+lib/ser/modules/options.so
+lib/ser/modules/pa.so
+lib/ser/modules/pdt.so
+lib/ser/modules/permissions.so
+lib/ser/modules/pike.so
+lib/ser/modules/print.so
+lib/ser/modules/ratelimit.so
+lib/ser/modules/registrar.so
+lib/ser/modules/rr.so
+lib/ser/modules/sl.so
+lib/ser/modules/sms.so
+lib/ser/modules/speeddial.so
+lib/ser/modules/textops.so
+lib/ser/modules/timer.so
+lib/ser/modules/tm.so
+lib/ser/modules/uac.so
+lib/ser/modules/uri.so
+lib/ser/modules/uri_db.so
+lib/ser/modules/usrloc.so
+lib/ser/modules/xlog.so
+lib/ser/modules/xmlrpc.so
+sbin/ser
+sbin/ser_mysql.sh
+sbin/serunix
+share/doc/ser/AUTHORS
+share/doc/ser/INSTALL
+share/doc/ser/NEWS
+share/doc/ser/README
+share/doc/ser/README-MODULES
+share/doc/ser/README.acc_db
+share/doc/ser/README.acc_syslog
+share/doc/ser/README.auth
+share/doc/ser/README.auth_db
+share/doc/ser/README.avp
+share/doc/ser/README.avp_db
+share/doc/ser/README.avpops
+share/doc/ser/README.cpl-c
+share/doc/ser/README.ctl
+share/doc/ser/README.db_ops
+share/doc/ser/README.dbtext
+share/doc/ser/README.dialog
+share/doc/ser/README.dispatcher
+share/doc/ser/README.domain
+share/doc/ser/README.enum
+share/doc/ser/README.eval
+share/doc/ser/README.exec
+share/doc/ser/README.flatstore
+share/doc/ser/README.gflags
+share/doc/ser/README.jabber
+share/doc/ser/README.lcr
+share/doc/ser/README.maxfwd
+share/doc/ser/README.msilo
+share/doc/ser/README.nathelper
+share/doc/ser/README.options
+share/doc/ser/README.pa
+share/doc/ser/README.pdt
+share/doc/ser/README.permissions
+share/doc/ser/README.pike
+share/doc/ser/README.print
+share/doc/ser/README.ratelimit
+share/doc/ser/README.registrar
+share/doc/ser/README.rr
+share/doc/ser/README.sl
+share/doc/ser/README.sms
+share/doc/ser/README.speeddial
+share/doc/ser/README.textops
+share/doc/ser/README.timer
+share/doc/ser/README.tm
+share/doc/ser/README.uac
+share/doc/ser/README.uri
+share/doc/ser/README.uri_db
+share/doc/ser/README.usrloc
+share/doc/ser/README.xlog
+share/doc/ser/README.xmlrpc
+ at dirrm share/doc/ser
+ at dirrm etc/ser
+ at dirrm lib/ser/modules
+ at dirrm lib/ser
diff --git a/pkg/ser/opensuse/ser.init.SuSE b/pkg/ser/opensuse/ser.init.SuSE
new file mode 100644
index 0000000..8bde2b8
--- /dev/null
+++ b/pkg/ser/opensuse/ser.init.SuSE
@@ -0,0 +1,136 @@
+#! /bin/sh
+# Copyright (c) 2002 Frauenhofer Gesellschaft FOKUS, Germany.
+# All rights reserved.
+#
+# Author: Nils Ohlmeier <ohlmeier at fokus.fhg.de>
+#
+# /etc/init.d/ser
+#
+### BEGIN INIT INFO
+# Provides:          sip
+# Required-Start:    $network
+# X-UnitedLinux-Should-Start: $network
+# Required-Stop:     $network
+# X-UnitedLinux-Should-Stop: $network
+# Default-Start:     3 5
+# Default-Stop:      0 1 2 6
+# Short-Description: SIP Express Router
+# Description:       Start SER and provide the routing of SIP requests.
+### END INIT INFO
+
+
+# Check for missing binaries (stale symlinks should not happen)
+SER_BIN=/usr/sbin/ser
+test -x $SER_BIN || exit 5
+
+# Check for existence of needed config file and read it
+SER_CONFIG=/etc/ser/ser.cfg
+test -r $SER_CONFIG || exit 6
+#. $SER_CONFIG
+
+# Shell functions sourced from /etc/rc.status:
+#      rc_check         check and set local and overall rc status
+#      rc_status        check and set local and overall rc status
+#      rc_status -v     ditto but be verbose in local rc status
+#      rc_status -v -r  ditto and clear the local rc status
+#      rc_status -s     display "skipped" and exit with status 3
+#      rc_status -u     display "unused" and exit with status 3
+#      rc_failed        set local and overall rc status to failed
+#      rc_failed <num>  set local and overall rc status to <num>
+#      rc_reset         clear local rc status (overall remains)
+#      rc_exit          exit appropriate to overall rc status
+#      rc_active	checks whether a service is activated by symlinks
+#      rc_splash arg    sets the boot splash screen to arg (if active)
+. /etc/rc.status
+
+# Reset status of this service
+rc_reset
+
+# Return values acc. to LSB for all commands but status:
+# 0	  - success
+# 1       - generic or unspecified error
+# 2       - invalid or excess argument(s)
+# 3       - unimplemented feature (e.g. "reload")
+# 4       - user had insufficient privileges
+# 5       - program is not installed
+# 6       - program is not configured
+# 7       - program is not running
+# 8--199  - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
+# 
+# Note that starting an already running service, stopping
+# or restarting a not-running service as well as the restart
+# with force-reload (in case signaling is not supported) are
+# considered a success.
+
+case "$1" in
+    start)
+	echo -n "Starting SIP Express Router "
+	## Start daemon with startproc(8). If this fails
+	## the return value is set appropriately by startproc.
+	startproc $SER_BIN -f $SER_CONFIG
+
+	# Remember status and be verbose
+	rc_status -v
+	;;
+    stop)
+	echo -n "Shutting down SIP Express Router "
+	## Stop daemon with killproc(8) and if this fails
+	## killproc sets the return value according to LSB.
+
+	killproc -TERM $SER_BIN
+
+	# Remember status and be verbose
+	rc_status -v
+	;;
+    restart)
+	## Stop the service and regardless of whether it was
+	## running or not, start it again.
+	$0 stop
+	$0 start
+
+	# Remember status and be quiet
+	rc_status
+	;;
+    force-reload)
+	## Signal the daemon to reload its config. Most daemons
+	## do this on signal 1 (SIGHUP).
+	## If it does not support it, restart.
+
+	echo -n "Reload service SIP Express Router "
+	## Otherwise:
+	$0 stop  &&  $0 start
+	rc_status
+	;;
+    reload)
+	## Like force-reload, but if daemon does not support
+	## signaling, do nothing (!)
+
+	## Otherwise if it does not support reload:
+	rc_failed 3
+	rc_status -v
+	;;
+    status)
+	echo -n "Checking for service SIP Express Router "
+	## Check status with checkproc(8), if process is running
+	## checkproc will return with exit status 0.
+
+	# Return value is slightly different for the status command:
+	# 0 - service up and running
+	# 1 - service dead, but /var/run/  pid  file exists
+	# 2 - service dead, but /var/lock/ lock file exists
+	# 3 - service not running (unused)
+	# 4 - service status unknown :-(
+	# 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
+	
+	# NOTE: checkproc returns LSB compliant status values.
+	checkproc $SER_BIN
+	# NOTE: rc_status knows that we called this init script with
+	# "status" option and adapts its messages accordingly.
+	rc_status -v
+	;;
+    *)
+	echo "Usage: $0 {start|stop|status|restart}"
+	exit 1
+	;;
+esac
+rc_exit
diff --git a/pkg/ser/opensuse/ser.spec b/pkg/ser/opensuse/ser.spec
new file mode 100644
index 0000000..2164049
--- /dev/null
+++ b/pkg/ser/opensuse/ser.spec
@@ -0,0 +1,333 @@
+%define EXCLUDED_MODULES	mysql jabber auth_radius group_radius uri_radius postgres snmp cpl cpl-c extcmd 
+%define MYSQL_MODULES		mysql
+%define JABBER_MODULES		jabber
+%define RADIUS_MODULES		auth_radius group_radius uri_radius
+%define RADIUS_MOD_PATH		modules/auth_radius modules/group_radius modules/uri_radius
+
+
+Summary:      SIP Express Router, very fast and flexible SIP Proxy
+Name:         ser
+Version:      0.9.6
+Release:      22.1
+Packager:     Peter Nixon <peter+rpmspam at suntel.com.tr>
+License:      GPL
+Group:        Productivity/Telephony/SIP/Servers
+Source:       http://iptel.org/ser/stable/%{name}-%{version}_src.tar.bz2
+Source2:      ser.init.SuSE
+%ifarch x86_64
+Patch:        Makefile.defs.patch
+%endif
+URL:          http://www.iptel.org/ser
+Vendor:       FhG Fokus
+BuildRoot:    /var/tmp/%{name}-%{version}-root
+Conflicts:    ser < %{version}, ser-mysql < %{version}, ser-jabber < %{version}, ser-radius < %{version}
+BuildPrereq:  make flex bison 
+BuildRequires: mysql-devel, radiusclient, expat
+
+%description
+SIP Express Router (SER) is a very fast and flexible SIP (RFC3621)
+proxy server. Written entirely in C, SER can handle thousands calls
+per second even on low-budget hardware. A C Shell like scripting language
+provides full control over the server's behaviour. It's modular
+architecture allows only required functionality to be loaded.
+Currently the following modules are available: digest authentication,
+CPL scripts, instant messaging, MySQL support, a presence agent, radius
+authentication, record routing, an SMS Gateway, a jabber gateway, a 
+transaction module, registrar and user location.
+
+%package  mysql
+Summary:  MySQL connectivity for the SIP Express Router.
+Group:    Productivity/Telephony/SIP/Servers
+Requires: ser = %{version}
+BuildPrereq: mysql-devel zlib-devel
+
+%description mysql
+The ser-mysql package contains MySQL database connectivity that you
+need to use digest authentication module or persistent user location
+entries.
+
+%package  jabber
+Summary:  sip jabber message translation support for the SIP Express Router.
+Group:    Productivity/Telephony/SIP/Servers
+Requires: ser = %{version}
+BuildPrereq: expat
+
+%description jabber
+The ser-jabber package contains a sip to jabber message translator.
+
+%package  radius
+Summary:  ser radius authentication, group and uri check modules.
+Group:    Productivity/Telephony/SIP/Servers
+Requires: ser = %{version}
+BuildPrereq:  radiusclient
+
+%description radius
+The ser-radius package contains modules for radius authentication, group
+ membership and uri checking.
+
+%prep
+%setup
+%ifarch x86_64
+%patch
+%endif
+
+%build
+make all skip_modules="%EXCLUDED_MODULES" \
+%ifarch x86_64
+		modules-dir=/lib64/ser/modules/ \
+%endif
+		cfg-target=/%{_sysconfdir}/ser/
+make modules modules="modules/%MYSQL_MODULES" \
+%ifarch x86_64
+		modules-dir=/lib64/ser/modules/ \
+%endif
+		cfg-target=/%{_sysconfdir}/ser/
+make modules modules="modules/%JABBER_MODULES" \
+%ifarch x86_64
+		modules-dir=/lib64/ser/modules/ \
+%endif
+		cfg-target=/%{_sysconfdir}/ser/
+make modules modules="%RADIUS_MOD_PATH" \
+%ifarch x86_64
+		modules-dir=/lib64/ser/modules/ \
+%endif
+		cfg-target=/%{_sysconfdir}/ser/
+
+%install
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
+
+make install skip_modules="%EXCLUDED_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+%ifarch x86_64
+		modules-dir=/lib64/ser/modules/ \
+%endif
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/ser/ \
+		doc-prefix=$RPM_BUILD_ROOT \
+		doc-dir=/%{_docdir}/ser/
+make install-modules modules="modules/%MYSQL_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+%ifarch x86_64
+		modules-dir=/lib64/ser/modules/ \
+%endif
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/ser/ \
+		doc-prefix=$RPM_BUILD_ROOT \
+		doc-dir=/%{_docdir}/ser/
+make install-modules modules="modules/%JABBER_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+%ifarch x86_64
+		modules-dir=/lib64/ser/modules/ \
+%endif
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/ser/ \
+		doc-prefix=$RPM_BUILD_ROOT \
+		doc-dir=/%{_docdir}/ser/
+make install-modules modules="%RADIUS_MOD_PATH" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+%ifarch x86_64
+		modules-dir=/lib64/ser/modules/ \
+%endif
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/ser/ \
+		doc-prefix=$RPM_BUILD_ROOT \
+		doc-dir=/%{_docdir}/ser/
+make install-doc modules="modules/%JABBER_MODULES %RADIUS_MOD_PATH" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+%ifarch x86_64
+		modules-dir=/lib64/ser/modules/ \
+%endif
+		doc-prefix=$RPM_BUILD_ROOT \
+		doc-dir=/%{_docdir}/ser/
+
+
+mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/init.d
+install -m755 $RPM_SOURCE_DIR/ser.init.SuSE \
+              $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/ser
+ln -sf ../../etc/init.d/ser $RPM_BUILD_ROOT/usr/sbin/rcser
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+%post
+sbin/insserv etc/init.d/ser
+
+%preun
+if [ $1 = 0 ]; then
+    etc/init.d/ser stop > /dev/null 2>&1
+fi
+
+%postun
+sbin/insserv etc/init.d/
+
+%files
+%defattr(-,root,root)
+%dir %{_docdir}/ser
+%doc %{_docdir}/ser/*
+
+%dir %{_sysconfdir}/ser
+%config(noreplace) %{_sysconfdir}/ser/*
+%config %{_sysconfdir}/init.d/*
+
+#%ifarch x86_64
+#%else
+%dir %{_libdir}/ser
+%dir %{_libdir}/ser/modules
+%{_libdir}/ser/modules/acc.so
+%{_libdir}/ser/modules/auth.so
+%{_libdir}/ser/modules/auth_db.so
+%{_libdir}/ser/modules/auth_diameter.so
+%{_libdir}/ser/modules/dbtext.so
+%{_libdir}/ser/modules/domain.so
+%{_libdir}/ser/modules/enum.so
+%{_libdir}/ser/modules/exec.so
+%{_libdir}/ser/modules/group.so
+%{_libdir}/ser/modules/mangler.so
+%{_libdir}/ser/modules/maxfwd.so
+%{_libdir}/ser/modules/mediaproxy.so
+%{_libdir}/ser/modules/msilo.so
+%{_libdir}/ser/modules/nathelper.so
+%{_libdir}/ser/modules/pdt.so
+%{_libdir}/ser/modules/permissions.so
+%{_libdir}/ser/modules/pike.so
+%{_libdir}/ser/modules/print.so
+%{_libdir}/ser/modules/registrar.so
+%{_libdir}/ser/modules/rr.so
+%{_libdir}/ser/modules/sl.so
+%{_libdir}/ser/modules/sms.so
+%{_libdir}/ser/modules/textops.so
+%{_libdir}/ser/modules/tm.so
+%{_libdir}/ser/modules/uri.so
+%{_libdir}/ser/modules/usrloc.so
+%{_libdir}/ser/modules/xlog.so
+
+%{_libdir}/ser/modules/avp.so
+%{_libdir}/ser/modules/avp_db.so
+%{_libdir}/ser/modules/avpops.so
+%{_libdir}/ser/modules/dispatcher.so
+%{_libdir}/ser/modules/diversion.so
+%{_libdir}/ser/modules/flatstore.so
+%{_libdir}/ser/modules/gflags.so
+%{_libdir}/ser/modules/options.so
+%{_libdir}/ser/modules/speeddial.so
+%{_libdir}/ser/modules/uri_db.so
+#%endif
+%{_sbindir}/ser
+%{_sbindir}/serctl
+%{_sbindir}/serunix
+/usr/sbin/rcser
+
+%{_mandir}/man5/*
+%{_mandir}/man8/*
+
+
+%files mysql
+%defattr(-,root,root)
+
+#%ifarch x86_64
+#%else
+%{_libdir}/ser/modules/mysql.so
+#%endif
+%{_sbindir}/ser_mysql.sh
+
+%files jabber
+%defattr(-,root,root)
+#%ifarch x86_64
+#%else
+%{_libdir}/ser/modules/jabber.so
+#%endif
+%doc %{_docdir}/ser/README.jabber
+
+%files radius
+%defattr(-,root,root)
+#%{_libdir}/ser/modules/auth_radius.so
+#%{_libdir}/ser/modules/group_radius.so
+#%{_libdir}/ser/modules/uri_radius.so
+%doc %{_docdir}/ser/README.auth_radius
+%doc %{_docdir}/ser/README.group_radius
+%doc %{_docdir}/ser/README.uri_radius
+
+
+
+
+%changelog
+
+* Tue Jul 26 2005 Peter Nixon - Suntel Communications <peter+rpmspam at suntel.com.tr>
+- include SUSE version in the rpm filename(s)
+- changed version to 0.9.3 (new upstream release)
+- update rpm package group to match SUSE 9.3
+- removed files no longer in tarball
+- enabled radius modules
+- add symlink for rcser
+
+* Tue Jul 27 2004 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- changed vesion to 0.8.14 (new upstream release)
+- added ext to the modules list, removed the radius modules (they depend on radiusclient-ng now)
+
+* Fri Nov 14 2003 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- changed vesion to 0.8.12 (new upstream release)
+- added auth_diameter, pdt & mangler to the modules list
+
+* Wed Aug 28 2003 Nils Ohlmeier <nils at iptel.org>
+- replaced modules Conflicts with required Ser version
+- fixed doc installation for SuSE pathes
+- added doc for jabber and radius
+
+* Wed Aug 28 2003 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- added doc (READMEs, NEWS, AUTHORS a.s.o)
+- added xlog to the modules list
+
+* Wed Aug 27 2003 Nils Ohlmeier <nils at iptel.org>
+- fixed module dependencys
+- added Conflicts for modules
+
+* Wed Aug 27 2003 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- changed vesion to 0.8.11
+- gen_ha1 is now left in _sbindir
+- removed harv_ser.sh
+- added Conflicts
+
+* Mon Jun 2 2003 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- added a separate rpm for the radius modules
+- updated to the new makefile variables (removed lots of unnecessary stuff)
+
+* Tue Nov 12 2002 Nils Ohlmeier <ohlmeier at fokus.fhg.de>
+- replaced expat-devel with expat
+- removed leading + from a few lines
+
+* Tue Nov 12 2002 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.gmd.de>
+- added a separate rpm for the jabber modules
+- moved all the binaries to sbin
+- removed obsolete installs (make install installs everything now)
+
+* Mon Oct 28 2002 Nils Ohlmeier <ohlmeier at fokus.fhg.de>
+- Added mysql and mysql-devel to the Req for the ser-mysql rpm.
+
+* Thu Sep 26 2002 Nils Ohlmeier <ohlmeier at fokus.fhg.de>
+- Added library path to mysql/Makefile to build on SuSE 8.0
+
+* Thu Sep 26 2002 Nils Ohlmeier <ohlmeier at fokus.fhg.de>
+- Added 'make [modules|modules-install]' to adapted Makefile changes
+
+* Wed Sep 25 2002 Andrei Pelinescu - Onciul  <pelinescu-onciul at fokus.gmd.de>
+- modified make install & make: added cfg-target & modules-target
+
+* Wed Sep 25 2002 Nils Ohlmeier <ohlmeier at fokus.fhg.de>
+- Copyed mysql connectivity subpackage from orig rpm.spec.
+
+* Fri Sep 06 2002 Nils Ohlmeier <ohlmeier at fokus.fhg.de>
+- Adaptation to SuSE.
+
+* Mon Sep 02 2002 Jan Janak <J.Janak at sh.cvut.cz>
+- gen_ha1 utility added, scripts added.
+
+* Tue Aug 28 2002 Jan Janak <J.Janak at sh.cvut.cz>
+- Finished the first version of the spec file.
+
+* Sun Aug 12 2002 Jan Janak <J.Janak at sh.cvut.cz>
+- First version of the spec file.
diff --git a/pkg/ser/rpm/ser.init b/pkg/ser/rpm/ser.init
new file mode 100755
index 0000000..c9637b1
--- /dev/null
+++ b/pkg/ser/rpm/ser.init
@@ -0,0 +1,72 @@
+#!/bin/bash
+#
+# Startup script for SER
+#
+# chkconfig: 345 85 15
+# description: Ser is a fast SIP Proxy.
+#
+# processname: ser
+# pidfile: /var/run/ser.pid
+# config: /etc/ser/ser.cfg
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+ser=/usr/sbin/ser
+prog=ser
+RETVAL=0
+
+start() {
+        echo -n $"Starting $prog: "
+	ulimit -c unlimited
+	ulimit -n 16384
+        daemon $ser $OPTIONS
+        RETVAL=$?
+        echo
+        [ $RETVAL = 0 ] && touch /var/lock/subsys/ser
+        return $RETVAL
+}
+
+stop() {
+	echo -n $"Stopping $prog: "
+	killproc $ser
+	RETVAL=$?
+	echo
+	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/ser /var/run/ser.pid
+}
+
+reload() {
+	echo -n $"Reloading $prog: "
+	killproc $ser -HUP
+	RETVAL=$?
+	echo
+}
+
+# See how we were called.
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  status)
+        status $ser
+	RETVAL=$?
+	;;
+  restart)
+	stop
+	start
+	;;
+  condrestart)
+	if [ -f /var/run/ser.pid ] ; then
+		stop
+		start
+	fi
+	;;
+  *)
+	echo $"Usage: $prog {start|stop|restart|condrestart|status|help}"
+	exit 1
+esac
+
+exit $RETVAL
diff --git a/pkg/ser/rpm/ser.spec-4.1 b/pkg/ser/rpm/ser.spec-4.1
new file mode 100644
index 0000000..0e44c19
--- /dev/null
+++ b/pkg/ser/rpm/ser.spec-4.1
@@ -0,0 +1,328 @@
+%define name    ser
+%define ver     2.1.0
+%define rel     dev23b
+
+%define EXCLUDED_MODULES	mysql jabber auth_radius group_radius uri_radius postgres snmp cpl cpl-c extcmd ldap
+%define MYSQL_MODULES		mysql
+%define JABBER_MODULES		jabber
+%define RADIUS_MODULES		auth_radius group_radius uri_radius
+%define RADIUS_MOD_PATH		modules/auth_radius modules/group_radius modules/uri_radius
+
+Summary:      SIP Express Router, very fast and flexible SIP Proxy
+Name:         %name
+Version:      %ver
+Release:      %rel
+Packager:     Jan Janak <jan at iptel.org>
+Copyright:    GPL
+Group:        System Environment/Daemons
+Source:       http://ftp.iptel.org/pub/ser/%{ver}/src/%{name}-%{ver}-%{rel}_src.tar.gz
+Source2:      ser.init
+URL:          http://iptel.org/ser
+Vendor:       FhG FOKUS
+BuildRoot:    /var/tmp/%{name}-%{ver}-root
+Conflicts:    ser-mysql < %ver, ser-jabber < %ver, ser-radius < %ver
+BuildPrereq:  make flex bison
+
+
+%description
+Ser or SIP Express Router is a very fast and flexible SIP (RFC3621)
+proxy server. Written entirely in C, ser can handle thousands calls
+per second even on low-budget hardware. A C Shell like scripting language
+provides full control over the server's behaviour. It's modular
+architecture allows only required functionality to be loaded.
+Currently the following modules are available: digest authentication,
+CPL scripts, instant messaging, MySQL support, a presence agent, radius
+authentication, record routing, an SMS gateway, a jabber gateway, a 
+transaction module, registrar and user location.
+
+%package  mysql
+Summary:  MySQL connectivity for the SIP Express Router.
+Group:    System Environment/Daemons
+Requires: ser = %ver
+BuildPrereq:  mysql-devel zlib-devel
+
+%description mysql
+The ser-mysql package contains MySQL database connectivity that you
+need to use digest authentication module or persistent user location
+entries.
+
+%package  jabber
+Summary:  sip jabber message translation support for the SIP Express Router.
+Group:    System Environment/Daemons
+Requires: ser = %ver
+BuildPrereq:  expat-devel
+
+%description jabber
+The ser-jabber package contains a sip to jabber message translator.
+
+#%package  radius
+#Summary:  ser radius authentication, group and uri check modules.
+#Group:    System Environment/Daemons
+#Requires: ser = %ver
+#BuildPrereq:  radiusclient-devel
+
+#%description radius
+#The ser-radius package contains modules for radius authentication, group
+# membership and uri checking.
+
+%prep
+%setup -n %{name}-%{ver}-%{rel}
+
+%build
+make all include_modules="tls" skip_modules="%EXCLUDED_MODULES"      cfg-target=/%{_sysconfdir}/ser/
+make modules modules="modules/%MYSQL_MODULES"  cfg-target=/%{_sysconfdir}/ser/
+make modules modules="modules/%JABBER_MODULES" cfg-target=/%{_sysconfdir}/ser/
+make modules modules="%RADIUS_MOD_PATH"        cfg-target=/%{_sysconfdir}/ser/
+
+
+%install
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
+
+make install include_modules="tls" skip_modules="%EXCLUDED_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/ser/ 
+make install-modules modules="modules/%MYSQL_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/ser/ 
+make install-modules modules="modules/%JABBER_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/ser/ 
+make install-doc modules="modules/%JABBER_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/ser/ 
+#make install-modules modules="%RADIUS_MOD_PATH" \
+#		basedir=$RPM_BUILD_ROOT \
+#		prefix=/usr \
+#		cfg-prefix=$RPM_BUILD_ROOT \
+#		cfg-target=/%{_sysconfdir}/ser/ 
+#make install-doc modules="%RADIUS_MOD_PATH" \
+#		basedir=$RPM_BUILD_ROOT \
+#		prefix=/usr \
+#		cfg-prefix=$RPM_BUILD_ROOT \
+#		cfg-target=/%{_sysconfdir}/ser/ 
+
+mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d
+install -m755 $RPM_SOURCE_DIR/ser.init \
+              $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/ser
+
+
+
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+%post
+/sbin/chkconfig --add ser
+
+%preun
+if [ $1 = 0 ]; then
+    /sbin/service ser stop > /dev/null 2>&1
+    /sbin/chkconfig --del ser
+fi
+
+
+%files
+%defattr(-,root,root)
+%dir %{_docdir}/ser
+%doc %{_docdir}/ser/AUTHORS
+%doc %{_docdir}/ser/NEWS
+%doc %{_docdir}/ser/INSTALL
+%doc %{_docdir}/ser/README
+%doc %{_docdir}/ser/README-MODULES
+%doc %{_docdir}/ser/README.acc_syslog
+%doc %{_docdir}/ser/README.auth
+%doc %{_docdir}/ser/README.auth_db
+%doc %{_docdir}/ser/README.avp
+%doc %{_docdir}/ser/README.avp_db
+%doc %{_docdir}/ser/README.cfg_db
+%doc %{_docdir}/ser/README.db_ops
+%doc %{_docdir}/ser/README.dispatcher
+%doc %{_docdir}/ser/README.diversion
+%doc %{_docdir}/ser/README.domain
+%doc %{_docdir}/ser/README.enum
+%doc %{_docdir}/ser/README.eval
+%doc %{_docdir}/ser/README.exec
+%doc %{_docdir}/ser/README.flatstore
+%doc %{_docdir}/ser/README.gflags
+%doc %{_docdir}/ser/README.lcr
+%doc %{_docdir}/ser/README.maxfwd
+%doc %{_docdir}/ser/README.msilo
+%doc %{_docdir}/ser/README.nathelper
+%doc %{_docdir}/ser/README.options
+%doc %{_docdir}/ser/README.pdt
+%doc %{_docdir}/ser/README.permissions
+%doc %{_docdir}/ser/README.pike
+%doc %{_docdir}/ser/README.prefix_route
+%doc %{_docdir}/ser/README.print
+%doc %{_docdir}/ser/README.ratelimit
+%doc %{_docdir}/ser/README.registrar
+%doc %{_docdir}/ser/README.rr
+%doc %{_docdir}/ser/README.sanity
+%doc %{_docdir}/ser/README.sl
+%doc %{_docdir}/ser/README.sms
+%doc %{_docdir}/ser/README.speeddial
+%doc %{_docdir}/ser/README.textops
+%doc %{_docdir}/ser/README.timer
+%doc %{_docdir}/ser/README.tls
+%doc %{_docdir}/ser/README.tm
+%doc %{_docdir}/ser/README.uac
+%doc %{_docdir}/ser/README.uri
+%doc %{_docdir}/ser/README.uri_db
+%doc %{_docdir}/ser/README.usrloc
+%doc %{_docdir}/ser/README.xlog
+
+%dir %{_sysconfdir}/ser
+%config(noreplace) %{_sysconfdir}/ser/*
+%config %{_sysconfdir}/rc.d/init.d/*
+
+%dir %{_libdir}/ser
+%{_libdir}/ser/libser_cds.so
+%{_libdir}/ser/libser_cds.so.0
+%{_libdir}/ser/libser_cds.so.0.1
+%dir %{_libdir}/ser/modules
+%{_libdir}/ser/modules/acc_db.so
+%{_libdir}/ser/modules/acc_syslog.so
+%{_libdir}/ser/modules/auth.so
+%{_libdir}/ser/modules/auth_db.so
+%{_libdir}/ser/modules/avp.so
+%{_libdir}/ser/modules/avp_db.so
+%{_libdir}/ser/modules/blst.so
+%{_libdir}/ser/modules/cfg_db.so
+%{_libdir}/ser/modules/cfg_rpc.so
+%{_libdir}/ser/modules/ctl.so
+%{_libdir}/ser/modules/db_ops.so
+%{_libdir}/ser/modules/dispatcher.so
+%{_libdir}/ser/modules/diversion.so
+%{_libdir}/ser/modules/domain.so
+%{_libdir}/ser/modules/enum.so
+%{_libdir}/ser/modules/eval.so
+%{_libdir}/ser/modules/exec.so
+%{_libdir}/ser/modules/fifo.so
+%{_libdir}/ser/modules/flatstore.so
+%{_libdir}/ser/modules/gflags.so
+%{_libdir}/ser/modules/lcr.so
+%{_libdir}/ser/modules/maxfwd.so
+%{_libdir}/ser/modules/mediaproxy.so
+%{_libdir}/ser/modules/msilo.so
+%{_libdir}/ser/modules/nathelper.so
+%{_libdir}/ser/modules/options.so
+%{_libdir}/ser/modules/pdt.so
+%{_libdir}/ser/modules/permissions.so
+%{_libdir}/ser/modules/pike.so
+%{_libdir}/ser/modules/prefix_route.so
+%{_libdir}/ser/modules/print.so
+%{_libdir}/ser/modules/ratelimit.so
+%{_libdir}/ser/modules/registrar.so
+%{_libdir}/ser/modules/rr.so
+%{_libdir}/ser/modules/sanity.so
+%{_libdir}/ser/modules/sl.so
+%{_libdir}/ser/modules/sms.so
+%{_libdir}/ser/modules/speeddial.so
+%{_libdir}/ser/modules/textops.so
+%{_libdir}/ser/modules/timer.so
+%{_libdir}/ser/modules/tls.so
+%{_libdir}/ser/modules/tm.so
+%{_libdir}/ser/modules/uac.so
+%{_libdir}/ser/modules/uri.so
+%{_libdir}/ser/modules/uri_db.so
+%{_libdir}/ser/modules/usrloc.so
+%{_libdir}/ser/modules/xlog.so
+
+%{_sbindir}/ser
+%{_sbindir}/sercmd
+
+%{_mandir}/man5/*
+%{_mandir}/man8/*
+
+
+%files mysql
+%defattr(-,root,root)
+
+%{_libdir}/ser/modules/mysql.so
+%{_sbindir}/ser_mysql.sh
+/usr/share/ser/*.sql
+
+%files jabber
+%defattr(-,root,root)
+%doc %{_docdir}/ser/README.jabber
+
+%{_libdir}/ser/modules/jabber.so
+
+#%files radius
+#%defattr(-,root,root)
+#%doc %{_docdir}/ser/README.auth_radius
+#%doc %{_docdir}/ser/README.group_radius
+#%doc %{_docdir}/ser/README.uri_radius
+
+#%{_libdir}/ser/modules/auth_radius.so
+#%{_libdir}/ser/modules/group_radius.so
+#%{_libdir}/ser/modules/uri_radius.so
+
+
+%changelog
+* Thu Feb 22 2007 Alfred E. Heggestad <aeh at db.org>
+- Updated for release 2.0.0
+
+* Fri Jul 23 2004 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- changed vesion to 0.8.14 (new upstream release)
+- added ext to the modules list, removed the radius modules (they depend on radiusclient-ng now)
+
+* Fri Nov 14 2003 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- changed vesion to 0.8.12 (new upstream release)
+- added auth_diameter, pdt & mangler to the modules list
+
+* Wed Aug 27 2003 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- changed vesion to 0.8.11
+- gen_ha1 is now left in _sbindir
+- removed harv_ser.sh
+- added xlog to the modules list
+
+* Fri Jun 6 2003 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- added Conflicts:, changed vesion to 0.8.11pre30
+
+* Mon Jun 2 2003 Daniel-Constantin Mierla <mierla at fokus.fraunhofer.de>
+- added README files for ser-jabber and ser-radius packages
+- spec file updated to work with rpm v4.1+
+
+* Sun Jun 1 2003 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- added a separate rpm for the radius modules
+- updated to the new makefile variables (removed lots of unnecessary stuff)
+
+* Thu Nov 14 2002 Jan Janak <J.Janak at sh.cvut.cz>
+- Installing harv_ser.sh again
+- quick hack to move gen_ha1 to bin directory instead of sbin (should
+  be done from the Makefile next time)
+
+* Tue Nov 12 2002 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.gmd.de>
+- added a separate rpm for the jabber modules
+- moved all the binaries to sbin
+- removed obsolete installs (make install installs everything now)
+
+* Fri Oct 25 2002 Jan Janak <J.Janak at sh.cvut.cz>
+- Minor description fixes
+
+* Fri Oct  4 2002 Jiri Kuthan <jiri at iptel.org>
+- exec module introduced
+
+* Wed Sep 25 2002 Andrei Pelinescu - Onciul  <pelinescu-onciul at fokus.gmd.de>
+- modified make install & make: added cfg-target & modules-target
+
+* Sun Sep 08 2002 Jan Janak <J.Janak at sh.cvut.cz>
+- Created subpackage containing mysql connectivity support.
+
+* Mon Sep 02 2002 Jan Janak <J.Janak at sh.cvut.cz>
+- gen_ha1 utility added, scripts added.
+
+* Tue Aug 28 2002 Jan Janak <J.Janak at sh.cvut.cz>
+- Finished the first version of the spec file.
+
+* Sun Aug 12 2002 Jan Janak <J.Janak at sh.cvut.cz>
+- First version of the spec file.
diff --git a/pkg/ser/rpm/ser.spec.fedora b/pkg/ser/rpm/ser.spec.fedora
new file mode 100644
index 0000000..5f362f1
--- /dev/null
+++ b/pkg/ser/rpm/ser.spec.fedora
@@ -0,0 +1,296 @@
+%define EXCLUDED_MODULES	mysql jabber auth_radius group_radius uri_radius avp_radius pa postgres snmp cpl cpl-c ext extcmd
+%define MYSQL_MODULES		mysql
+%define JABBER_MODULES		jabber
+%define RADIUS_MODULES		auth_radius group_radius uri_radius avp_radius
+%define CPL_MODULES		cpl-c
+%define PA_MODULES		pa
+%define POSTGRES_MODULES		postgres
+%define ACC_MODULE		acc
+%define RADIUS_MOD_PATH		modules/auth_radius modules/group_radius modules/uri_radius
+
+
+Summary:      SIP Express Router, very fast and flexible SIP Proxy
+Name:         ser
+Version:      0.9.4
+Release:      fc2.0
+Copyright:    GPL
+Group:        System Environment/Daemons
+Source:       http://iptel.org/ser/stable/%{name}-%{version}_src.tar.gz
+Source1:      ser.init
+URL:          http://iptel.org/ser
+Vendor:       FhG Fokus
+BuildRoot:    /var/tmp/%{name}-%{version}-root
+Conflicts:    ser-mysql < %{version}, ser-jabber < %{version}, ser-radius < %{version}
+BuildPrereq:  make flex bison
+
+
+%description
+Ser or SIP Express Router is a very fast and flexible SIP (RFC3621)
+proxy server. Written entirely in C, ser can handle thousands calls
+per second even on low-budget hardware. A C Shell like scripting language
+provides full control over the server's behaviour. It's modular
+architecture allows only required functionality to be loaded.
+Currently the following modules are available: digest authentication,
+CPL scripts, instant messaging, MySQL support, a presence agent, radius
+authentication, record routing, an SMS gateway, a jabber gateway, a 
+transaction module, registrar and user location.
+
+
+%package  mysql
+Summary:  MySQL connectivity for the SIP Express Router.
+Group:    System Environment/Daemons
+Requires: ser = %{version}
+BuildPrereq:  mysql-devel zlib-devel
+
+
+%description mysql
+The ser-mysql package contains MySQL database connectivity that you
+need to use digest authentication module or persistent user location
+entries.
+
+
+%package  jabber
+Summary:  sip jabber message translation support for the SIP Express Router.
+Group:    System Environment/Daemons
+Requires: ser = %{version}
+BuildPrereq:  expat-devel
+
+
+%description jabber
+The ser-jabber package contains a sip to jabber message translator.
+
+
+# commented out due to missing libradiusclient-ng
+#%package  radius
+#Summary:  ser radius authentication, group and uri check modules.
+#Group:    System Environment/Daemons
+#Requires: ser = %{version}
+#BuildPrereq:  radiusclient-ng-devel
+
+
+#%description radius
+#The ser-radius package contains modules for radius authentication, group
+# membership and uri checking.
+
+%package  cpl 
+Summary:  CPL support.
+Group:    System Environment/Daemons
+Requires: ser = %{version}
+BuildPrereq:  xml2-devel
+
+%package  pa 
+Summary:  presence server support.
+Group:    System Environment/Daemons
+Requires: ser = %{version}
+BuildPrereq:  xml2-devel
+
+%package  postgres
+Summary:  postgres connectivity for the SIP Express Router.
+Group:    System Environment/Daemons
+Requires: ser = %{version}
+BuildPrereq:  libpq-devel
+
+
+
+%prep
+%setup
+
+
+%build
+make all skip_modules="%EXCLUDED_MODULES"      cfg-target=/%{_sysconfdir}/ser/
+make modules modules="modules/%MYSQL_MODULES"  cfg-target=/%{_sysconfdir}/ser/
+make modules modules="modules/%JABBER_MODULES" cfg-target=/%{_sysconfdir}/ser/
+#make modules modules="%RADIUS_MOD_PATH"        cfg-target=/%{_sysconfdir}/ser/
+make modules modules="modules/%CPL_MODULES"    cfg-target=/%{_sysconfdir}/ser/
+make modules modules="modules/%PA_MODULES"     cfg-target=/%{_sysconfdir}/ser/
+make modules modules="modules/%POSTGRES_MODULES" cfg-target=/%{_sysconfdir}/ser/
+
+
+%install
+rm -rf %{buildroot}
+make install skip_modules="%EXCLUDED_MODULES" \
+		basedir=%{buildroot} \
+		prefix=%{_prefix} \
+		cfg-prefix=%{buildroot} \
+		cfg-target=/%{_sysconfdir}/ser/ 
+make install-modules-all modules="modules/%MYSQL_MODULES" \
+		basedir=%{buildroot} \
+		prefix=%{_prefix} \
+		cfg-prefix=%{buildroot} \
+		cfg-target=/%{_sysconfdir}/ser/ 
+make install-modules-all modules="modules/%JABBER_MODULES" \
+		basedir=%{buildroot} \
+		prefix=%{_prefix} \
+		cfg-prefix=%{buildroot} \
+		cfg-target=/%{_sysconfdir}/ser/ 
+#make install-modules modules="%RADIUS_MOD_PATH" \
+#		basedir=%{buildroot} \
+#		prefix=%{_prefix} \
+#		cfg-prefix=%{buildroot} \
+#		cfg-target=/%{_sysconfdir}/ser/ 
+#make install-doc modules="%RADIUS_MOD_PATH" \
+#		basedir=%{buildroot} \
+#		prefix=%{_prefix} \
+#		cfg-prefix=%{buildroot} \
+#		cfg-target=/%{_sysconfdir}/ser/ 
+make install-modules-all modules="modules/%CPL_MODULES" \
+		basedir=%{buildroot} \
+		prefix=%{_prefix} \
+		cfg-prefix=%{buildroot} \
+		cfg-target=/%{_sysconfdir}/ser/ 
+make install-modules-all modules="modules/%PA_MODULES" \
+		basedir=%{buildroot} \
+		prefix=%{_prefix} \
+		cfg-prefix=%{buildroot} \
+		cfg-target=/%{_sysconfdir}/ser/ 
+make install-modules-all modules="modules/%POSTGRES_MODULES" \
+		basedir=%{buildroot} \
+		prefix=%{_prefix} \
+		cfg-prefix=%{buildroot} \
+		cfg-target=/%{_sysconfdir}/ser/ 
+install -m755 -D %{SOURCE1} %{buildroot}/%{_initrddir}/ser
+
+
+%clean
+rm -rf %{buildroot}
+
+
+%post
+/sbin/chkconfig --add ser
+
+
+%preun
+if [ $1 = 0 ]; then
+    /sbin/service ser stop > /dev/null 2>&1
+    /sbin/chkconfig --del ser
+fi
+
+
+%files
+%defattr(-,root,root)
+%doc %{_docdir}/ser/*
+%config(noreplace) %{_sysconfdir}/ser/*
+%config %{_initrddir}/ser
+%{_libdir}/ser/modules/*
+%{_sbindir}/*
+%{_mandir}/man5/*
+%{_mandir}/man8/*
+%exclude %{_libdir}/ser/modules/mysql.so
+%exclude %{_sbindir}/ser_mysql.sh
+%exclude %{_docdir}/ser/README.jabber
+%exclude %{_libdir}/ser/modules/jabber.so
+#%exclude %{_docdir}/ser/README.*_radius
+#%exclude %{_libdir}/ser/modules/*_radius.so
+%exclude %{_docdir}/ser/README.cpl-c
+%exclude %{_libdir}/ser/modules/cpl-c.so
+%exclude %{_docdir}/ser/README.pa
+%exclude %{_libdir}/ser/modules/pa.so
+%exclude %{_docdir}/ser/README.postgres
+%exclude %{_libdir}/ser/modules/postgres.so
+
+
+%files mysql
+%defattr(-,root,root)
+%{_libdir}/ser/modules/mysql.so
+%{_sbindir}/ser_mysql.sh
+
+
+%files jabber
+%defattr(-,root,root)
+%doc %{_docdir}/ser/README.jabber
+%{_libdir}/ser/modules/jabber.so
+
+
+#%files radius
+#%defattr(-,root,root)
+#%doc %{_docdir}/ser/README.*_radius
+#%{_libdir}/ser/modules/*_radius.so
+
+
+%files cpl 
+%defattr(-,root,root)
+%doc %{_docdir}/ser/README.cpl-c
+%{_libdir}/ser/modules/cpl-c.so
+
+
+%files pa 
+%defattr(-,root,root)
+%doc %{_docdir}/ser/README.pa
+%{_libdir}/ser/modules/pa.so
+
+
+%files postgres 
+%defattr(-,root,root)
+%doc %{_docdir}/ser/README.postgres
+%{_libdir}/ser/modules/postgres.so
+
+
+%changelog
+
+* Fri Sep 02 2005 Andrei Pelinescu - Onciul <andrei at iptel.org>
+- changed vesion to 0.9.4 (new upstream release)
+
+* Fri Jun 28 2005 Andrei Pelinescu - Onciul <andrei at iptel.org>
+- changed vesion to 0.9.3 (new upstream release)
+- added cpl, pa and postgres to the modules list
+
+* Tue Nov 23 2004 Gabriel Somlo <somlo at acns.colostate.edu>
+- reworked spec file for fedora core 2
+- replaced absolute paths with macros wherever possible
+- globbed main package filelist
+
+* Fri Jul 23 2004 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- changed vesion to 0.8.14 (new upstream release)
+- added ext to the modules list, removed the radius modules (they depend on radiusclient-ng now)
+
+* Fri Nov 14 2003 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- changed vesion to 0.8.12 (new upstream release)
+- added auth_diameter, pdt & mangler to the modules list
+
+* Wed Aug 27 2003 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- changed vesion to 0.8.11
+- gen_ha1 is now left in _sbindir
+- removed harv_ser.sh
+- added xlog to the modules list
+
+* Fri Jun 6 2003 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- added Conflicts:, changed vesion to 0.8.11pre30
+
+* Mon Jun 2 2003 Daniel-Constantin Mierla <mierla at fokus.fraunhofer.de>
+- added README files for ser-jabber and ser-radius packages
+- spec file updated to work with rpm v4.1+
+
+* Sun Jun 1 2003 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- added a separate rpm for the radius modules
+- updated to the new makefile variables (removed lots of unnecessary stuff)
+
+* Thu Nov 14 2002 Jan Janak <J.Janak at sh.cvut.cz>
+- Installing harv_ser.sh again
+- quick hack to move gen_ha1 to bin directory instead of sbin (should
+  be done from the Makefile next time)
+
+* Tue Nov 12 2002 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.gmd.de>
+- added a separate rpm for the jabber modules
+- moved all the binaries to sbin
+- removed obsolete installs (make install installs everything now)
+
+* Fri Oct 25 2002 Jan Janak <J.Janak at sh.cvut.cz>
+- Minor description fixes
+
+* Fri Oct  4 2002 Jiri Kuthan <jiri at iptel.org>
+- exec module introduced
+
+* Wed Sep 25 2002 Andrei Pelinescu - Onciul  <pelinescu-onciul at fokus.gmd.de>
+- modified make install & make: added cfg-target & modules-target
+
+* Sun Sep 08 2002 Jan Janak <J.Janak at sh.cvut.cz>
+- Created subpackage containing mysql connectivity support.
+
+* Mon Sep 02 2002 Jan Janak <J.Janak at sh.cvut.cz>
+- gen_ha1 utility added, scripts added.
+
+* Tue Aug 28 2002 Jan Janak <J.Janak at sh.cvut.cz>
+- Finished the first version of the spec file.
+
+* Sun Aug 12 2002 Jan Janak <J.Janak at sh.cvut.cz>
+- First version of the spec file.
diff --git a/pkg/ser/solaris/pkginfo b/pkg/ser/solaris/pkginfo
new file mode 100644
index 0000000..041b71f
--- /dev/null
+++ b/pkg/ser/solaris/pkginfo
@@ -0,0 +1,9 @@
+PKG=IPTELser
+ARCH=sparc
+VERSION=0.9.4
+CATEGORY=application
+EMAIL=andrei at iptel.org
+NAME= ser or SIP Express Router is a very fast and flexible SIP proxy server
+SUNW_ISA=sparcv9
+BASEDIR=/usr/local
+CLASSES=none
diff --git a/pkg/ser/solaris/prototype b/pkg/ser/solaris/prototype
new file mode 100644
index 0000000..48879fb
--- /dev/null
+++ b/pkg/ser/solaris/prototype
@@ -0,0 +1,106 @@
+# $Id$
+i pkginfo=pkginfo
+d none etc 0755 bin bin
+d none etc/ser 0755 bin bin
+e none etc/ser/dictionary.ser 0644 bin bin
+e none etc/ser/ser.cfg 0644 bin bin
+d none sbin 0755 bin bin
+f none sbin/ser 0755 bin bin
+f none sbin/ser_mysql.sh 0755 bin bin
+f none sbin/serctl 0755 bin bin
+f none sbin/serunix 0755 bin bin
+d none lib 0755 bin bin
+d none lib/ser 2755 bin bin
+d none lib/ser/modules 2755 bin bin
+f none lib/ser/modules/acc.so 0755 bin bin
+f none lib/ser/modules/auth.so 0755 bin bin
+f none lib/ser/modules/auth_db.so 0755 bin bin
+f none lib/ser/modules/auth_diameter.so 0755 bin bin
+f none lib/ser/modules/avp.so 0755 bin bin
+f none lib/ser/modules/avp_db.so 0755 bin bin
+f none lib/ser/modules/avpops.so 0755 bin bin
+f none lib/ser/modules/cpl-c.so 0755 bin bin
+f none lib/ser/modules/dbtext.so 0755 bin bin
+f none lib/ser/modules/dispatcher.so 0755 bin bin
+f none lib/ser/modules/diversion.so 0755 bin bin
+f none lib/ser/modules/domain.so 0755 bin bin
+f none lib/ser/modules/enum.so 0755 bin bin
+f none lib/ser/modules/exec.so 0755 bin bin
+f none lib/ser/modules/flatstore.so 0755 bin bin
+f none lib/ser/modules/gflags.so 0755 bin bin
+f none lib/ser/modules/group.so 0755 bin bin
+f none lib/ser/modules/jabber.so 0755 bin bin
+f none lib/ser/modules/mangler.so 0755 bin bin
+f none lib/ser/modules/maxfwd.so 0755 bin bin
+f none lib/ser/modules/mediaproxy.so 0755 bin bin
+f none lib/ser/modules/msilo.so 0755 bin bin
+f none lib/ser/modules/mysql.so 0755 bin bin
+f none lib/ser/modules/nathelper.so 0755 bin bin
+f none lib/ser/modules/options.so 0755 bin bin
+f none lib/ser/modules/pa.so 0755 bin bin
+f none lib/ser/modules/pdt.so 0755 bin bin
+f none lib/ser/modules/permissions.so 0755 bin bin
+f none lib/ser/modules/pike.so 0755 bin bin
+f none lib/ser/modules/print.so 0755 bin bin
+f none lib/ser/modules/registrar.so 0755 bin bin
+f none lib/ser/modules/rr.so 0755 bin bin
+f none lib/ser/modules/sl.so 0755 bin bin
+f none lib/ser/modules/sms.so 0755 bin bin
+f none lib/ser/modules/speeddial.so 0755 bin bin
+f none lib/ser/modules/textops.so 0755 bin bin
+f none lib/ser/modules/tm.so 0755 bin bin
+f none lib/ser/modules/uri.so 0755 bin bin
+f none lib/ser/modules/uri_db.so 0755 bin bin
+f none lib/ser/modules/usrloc.so 0755 bin bin
+f none lib/ser/modules/xlog.so 0755 bin bin
+d none doc 0755 bin bin
+d none doc/ser 0755 bin bin
+f none doc/ser/README 0644 bin bin
+f none doc/ser/INSTALL 0644 bin bin
+f none doc/ser/README-MODULES 0644 bin bin
+f none doc/ser/AUTHORS 0644 bin bin
+f none doc/ser/NEWS    0644 bin bin
+f none doc/ser/README.acc 0644 bin bin
+f none doc/ser/README.auth 0644 bin bin
+f none doc/ser/README.auth_db 0644 bin bin
+f none doc/ser/README.auth_diameter 0644 bin bin
+f none doc/ser/README.avp 0644 bin bin
+f none doc/ser/README.avp_db 0644 bin bin
+f none doc/ser/README.avpops 0644 bin bin
+f none doc/ser/README.cpl-c 0644 bin bin
+f none doc/ser/README.dbtext  0644 bin bin
+f none doc/ser/README.dispatcher  0644 bin bin
+f none doc/ser/README.diversion  0644 bin bin
+f none doc/ser/README.domain  0644 bin bin
+f none doc/ser/README.enum    0644 bin bin
+f none doc/ser/README.exec 0644 bin bin
+f none doc/ser/README.flatstore 0644 bin bin
+f none doc/ser/README.gflags 0644 bin bin
+f none doc/ser/README.group 0644 bin bin
+f none doc/ser/README.jabber 0644 bin bin
+f none doc/ser/README.mangler 0644 bin bin
+f none doc/ser/README.maxfwd 0644 bin bin
+f none doc/ser/README.msilo 0644 bin bin
+f none doc/ser/README.nathelper 0644 bin bin
+f none doc/ser/README.options 0644 bin bin
+f none doc/ser/README.pa 0644 bin bin
+f none doc/ser/README.pdt 0644 bin bin
+f none doc/ser/README.permissions 0644 bin bin
+f none doc/ser/README.pike 0644 bin bin
+f none doc/ser/README.print 0644 bin bin
+f none doc/ser/README.registrar 0644 bin bin
+f none doc/ser/README.rr 0644 bin bin
+f none doc/ser/README.sl 0644 bin bin
+f none doc/ser/README.sms 0644 bin bin
+f none doc/ser/README.speeddial 0644 bin bin
+f none doc/ser/README.textops 0644 bin bin
+f none doc/ser/README.tm 0644 bin bin
+f none doc/ser/README.uri 0644 bin bin
+f none doc/ser/README.uri_db 0644 bin bin
+f none doc/ser/README.usrloc 0644 bin bin
+f none doc/ser/README.xlog 0644 bin bin
+d none man 0755 bin bin
+d none man/man8 0755 bin bin
+f none man/man8/ser.8 0644 bin bin
+d none man/man5 0755 bin bin
+f none man/man5/ser.cfg.5 0644 bin bin
diff --git a/pkg/ser/suse/ser.init b/pkg/ser/suse/ser.init
new file mode 100755
index 0000000..ccafea2
--- /dev/null
+++ b/pkg/ser/suse/ser.init
@@ -0,0 +1,136 @@
+#! /bin/sh
+# Copyright (c) 2002 Frauenhofer Gesellschaft FOKUS, Germany.
+# All rights reserved.
+#
+# Author: Nils Ohlmeier <ohlmeier at fokus.fhg.de>
+#
+# /etc/init.d/ser
+#
+### BEGIN INIT INFO
+# Provides:          sip
+# Required-Start:    $network
+# X-UnitedLinux-Should-Start: $network
+# Required-Stop:     $network
+# X-UnitedLinux-Should-Stop: $network
+# Default-Start:     3 5
+# Default-Stop:      0 1 2 6
+# Short-Description: SIP Express Router
+# Description:       Start SER and provide the routing of SIP requests.
+### END INIT INFO
+
+
+# Check for missing binaries (stale symlinks should not happen)
+SER_BIN=/usr/sbin/ser
+test -x $SER_BIN || exit 5
+
+# Check for existence of needed config file and read it
+SER_CONFIG=/etc/ser/ser.cfg
+test -r $SER_CONFIG || exit 6
+#. $FOO_CONFIG
+
+# Shell functions sourced from /etc/rc.status:
+#      rc_check         check and set local and overall rc status
+#      rc_status        check and set local and overall rc status
+#      rc_status -v     ditto but be verbose in local rc status
+#      rc_status -v -r  ditto and clear the local rc status
+#      rc_status -s     display "skipped" and exit with status 3
+#      rc_status -u     display "unused" and exit with status 3
+#      rc_failed        set local and overall rc status to failed
+#      rc_failed <num>  set local and overall rc status to <num>
+#      rc_reset         clear local rc status (overall remains)
+#      rc_exit          exit appropriate to overall rc status
+#      rc_active	checks whether a service is activated by symlinks
+#      rc_splash arg    sets the boot splash screen to arg (if active)
+. /etc/rc.status
+
+# Reset status of this service
+rc_reset
+
+# Return values acc. to LSB for all commands but status:
+# 0	  - success
+# 1       - generic or unspecified error
+# 2       - invalid or excess argument(s)
+# 3       - unimplemented feature (e.g. "reload")
+# 4       - user had insufficient privileges
+# 5       - program is not installed
+# 6       - program is not configured
+# 7       - program is not running
+# 8--199  - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
+# 
+# Note that starting an already running service, stopping
+# or restarting a not-running service as well as the restart
+# with force-reload (in case signaling is not supported) are
+# considered a success.
+
+case "$1" in
+    start)
+	echo -n "Starting SIP Express Router "
+	## Start daemon with startproc(8). If this fails
+	## the return value is set appropriately by startproc.
+	startproc $SER_BIN -f $SER_CONFIG
+
+	# Remember status and be verbose
+	rc_status -v
+	;;
+    stop)
+	echo -n "Shutting down SIP Express Router "
+	## Stop daemon with killproc(8) and if this fails
+	## killproc sets the return value according to LSB.
+
+	killproc -TERM $SER_BIN
+
+	# Remember status and be verbose
+	rc_status -v
+	;;
+    restart)
+	## Stop the service and regardless of whether it was
+	## running or not, start it again.
+	$0 stop
+	$0 start
+
+	# Remember status and be quiet
+	rc_status
+	;;
+    force-reload)
+	## Signal the daemon to reload its config. Most daemons
+	## do this on signal 1 (SIGHUP).
+	## If it does not support it, restart.
+
+	echo -n "Reload service SIP Express Router "
+	## Otherwise:
+	$0 stop  &&  $0 start
+	rc_status
+	;;
+    reload)
+	## Like force-reload, but if daemon does not support
+	## signaling, do nothing (!)
+
+	## Otherwise if it does not support reload:
+	rc_failed 3
+	rc_status -v
+	;;
+    status)
+	echo -n "Checking for service SIP Express Router "
+	## Check status with checkproc(8), if process is running
+	## checkproc will return with exit status 0.
+
+	# Return value is slightly different for the status command:
+	# 0 - service up and running
+	# 1 - service dead, but /var/run/  pid  file exists
+	# 2 - service dead, but /var/lock/ lock file exists
+	# 3 - service not running (unused)
+	# 4 - service status unknown :-(
+	# 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
+	
+	# NOTE: checkproc returns LSB compliant status values.
+	checkproc $SER_BIN
+	# NOTE: rc_status knows that we called this init script with
+	# "status" option and adapts its messages accordingly.
+	rc_status -v
+	;;
+    *)
+	echo "Usage: $0 {start|stop|status|restart}"
+	exit 1
+	;;
+esac
+rc_exit
diff --git a/pkg/ser/suse/ser.spec b/pkg/ser/suse/ser.spec
new file mode 100644
index 0000000..1dfd7ab
--- /dev/null
+++ b/pkg/ser/suse/ser.spec
@@ -0,0 +1,341 @@
+%define EXCLUDED_MODULES	mysql jabber auth_radius group_radius uri_radius postgres snmp cpl cpl-c extcmd 
+%define MYSQL_MODULES		mysql
+%define JABBER_MODULES		jabber
+%define RADIUS_MODULES		auth_radius group_radius uri_radius
+%define RADIUS_MOD_PATH		modules/auth_radius modules/group_radius modules/uri_radius
+
+%define distroversion generic
+%{!?suse_version:%define suse_version 0}
+%{!?sles_version:%define sles_version 0}
+%if %suse_version > 0
+	%define distroversion	suse%{suse_version}
+%endif
+%if %sles_version > 0
+	%define distroversion	sles%{sles_version}
+%endif
+
+
+Summary:      SIP Express Router, very fast and flexible SIP Proxy
+Name:         ser
+Version:      0.9.3
+Release:      0.%{distroversion}
+Packager:     Nils Ohlmeier <nils at iptel.org>
+Copyright:    GPL
+Group:        Productivity/Telephony/SIP/Servers
+Source:       http://iptel.org/ser/stable/%{name}-%{version}_src.tar.gz
+Source2:      ser.init.SuSE
+URL:          http://www.iptel.org/ser
+Vendor:       FhG Fokus
+BuildRoot:    /var/tmp/%{name}-%{ver}-root
+Conflicts:    ser < %{version}, ser-mysql < %{version}, ser-jabber < %{version}, ser-radius < %{version}
+BuildPrereq:  make flex bison 
+
+%description
+Ser or SIP Express Router is a very fast and flexible SIP (RFC3621)
+proxy server. Written entirely in C, ser can handle thousands calls
+per second even on low-budget hardware. A C Shell like scripting language
+provides full control over the server's behaviour. It's modular
+architecture allows only required functionality to be loaded.
+Currently the following modules are available: digest authentication,
+CPL scripts, instant messaging, MySQL support, a presence agent, radius
+authentication, record routing, an SMS Gateway, a jabber gateway, a 
+transaction module, registrar and user location.
+
+%package  mysql
+Summary:  MySQL connectivity for the SIP Express Router.
+Group:    Productivity/Telephony/SIP/Servers
+Requires: ser = %{version}
+BuildPrereq: mysql-devel zlib-devel
+
+%description mysql
+The ser-mysql package contains MySQL database connectivity that you
+need to use digest authentication module or persistent user location
+entries.
+
+%package  jabber
+Summary:  sip jabber message translation support for the SIP Express Router.
+Group:    Productivity/Telephony/SIP/Servers
+Requires: ser = %{version}
+BuildPrereq: expat
+
+%description jabber
+The ser-jabber package contains a sip to jabber message translator.
+
+%package  radius
+Summary:  ser radius authentication, group and uri check modules.
+Group:    Productivity/Telephony/SIP/Servers
+Requires: ser = %{version}
+BuildPrereq:  radiusclient
+
+%description radius
+The ser-radius package contains modules for radius authentication, group
+ membership and uri checking.
+
+%prep
+%setup
+
+%build
+make all skip_modules="%EXCLUDED_MODULES"      cfg-target=/%{_sysconfdir}/ser/
+make modules modules="modules/%MYSQL_MODULES"  cfg-target=/%{_sysconfdir}/ser/
+make modules modules="modules/%JABBER_MODULES" cfg-target=/%{_sysconfdir}/ser/
+make modules modules="%RADIUS_MOD_PATH"        cfg-target=/%{_sysconfdir}/ser/
+
+%install
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
+
+make install skip_modules="%EXCLUDED_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/ser/ \
+		doc-prefix=$RPM_BUILD_ROOT \
+		doc-dir=/%{_docdir}/ser/
+make install-modules modules="modules/%MYSQL_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/ser/ \
+		doc-prefix=$RPM_BUILD_ROOT \
+		doc-dir=/%{_docdir}/ser/
+make install-modules modules="modules/%JABBER_MODULES" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/ser/ \
+		doc-prefix=$RPM_BUILD_ROOT \
+		doc-dir=/%{_docdir}/ser/
+make install-modules modules="%RADIUS_MOD_PATH" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		cfg-prefix=$RPM_BUILD_ROOT \
+		cfg-target=/%{_sysconfdir}/ser/ \
+		doc-prefix=$RPM_BUILD_ROOT \
+		doc-dir=/%{_docdir}/ser/
+make install-doc modules="modules/%JABBER_MODULES %RADIUS_MOD_PATH" \
+		basedir=$RPM_BUILD_ROOT \
+		prefix=/usr \
+		doc-prefix=$RPM_BUILD_ROOT \
+		doc-dir=/%{_docdir}/ser/
+
+
+mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/init.d
+install -m755 $RPM_SOURCE_DIR/ser.init.SuSE \
+              $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/ser
+ln -sf ../../etc/init.d/ser $RPM_BUILD_ROOT/usr/sbin/rcser
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+%post
+sbin/insserv etc/init.d/ser
+
+%preun
+if [ $1 = 0 ]; then
+    etc/init.d/ser stop > /dev/null 2>&1
+fi
+
+%postun
+sbin/insserv etc/init.d/
+
+%files
+%defattr(-,root,root)
+%dir %{_docdir}/ser
+%doc %{_docdir}/ser/AUTHORS
+%doc %{_docdir}/ser/NEWS
+%doc %{_docdir}/ser/INSTALL
+%doc %{_docdir}/ser/README
+%doc %{_docdir}/ser/README-MODULES
+%doc %{_docdir}/ser/README.acc
+%doc %{_docdir}/ser/README.auth
+%doc %{_docdir}/ser/README.auth_db
+%doc %{_docdir}/ser/README.auth_diameter
+%doc %{_docdir}/ser/README.avp
+%doc %{_docdir}/ser/README.avp_db
+%doc %{_docdir}/ser/README.avpops
+%doc %{_docdir}/ser/README.dbtext
+%doc %{_docdir}/ser/README.dispatcher
+%doc %{_docdir}/ser/README.diversion
+%doc %{_docdir}/ser/README.domain
+%doc %{_docdir}/ser/README.enum
+%doc %{_docdir}/ser/README.exec
+%doc %{_docdir}/ser/README.flatstore
+%doc %{_docdir}/ser/README.gflags
+%doc %{_docdir}/ser/README.group
+%doc %{_docdir}/ser/README.mangler
+%doc %{_docdir}/ser/README.maxfwd
+%doc %{_docdir}/ser/README.msilo
+%doc %{_docdir}/ser/README.nathelper
+%doc %{_docdir}/ser/README.options
+%doc %{_docdir}/ser/README.pdt
+%doc %{_docdir}/ser/README.permissions
+%doc %{_docdir}/ser/README.pike
+%doc %{_docdir}/ser/README.print
+%doc %{_docdir}/ser/README.registrar
+%doc %{_docdir}/ser/README.rr
+%doc %{_docdir}/ser/README.sl
+%doc %{_docdir}/ser/README.sms
+%doc %{_docdir}/ser/README.speeddial
+%doc %{_docdir}/ser/README.textops
+%doc %{_docdir}/ser/README.tm
+%doc %{_docdir}/ser/README.uri
+%doc %{_docdir}/ser/README.uri_db
+%doc %{_docdir}/ser/README.usrloc
+%doc %{_docdir}/ser/README.xlog
+
+%dir %{_sysconfdir}/ser
+%config(noreplace) %{_sysconfdir}/ser/*
+%config %{_sysconfdir}/init.d/*
+
+%dir %{_libdir}/ser
+%dir %{_libdir}/ser/modules
+%{_libdir}/ser/modules/acc.so
+%{_libdir}/ser/modules/auth.so
+%{_libdir}/ser/modules/auth_db.so
+%{_libdir}/ser/modules/auth_diameter.so
+%{_libdir}/ser/modules/dbtext.so
+%{_libdir}/ser/modules/domain.so
+%{_libdir}/ser/modules/enum.so
+%{_libdir}/ser/modules/exec.so
+%{_libdir}/ser/modules/group.so
+%{_libdir}/ser/modules/mangler.so
+%{_libdir}/ser/modules/maxfwd.so
+%{_libdir}/ser/modules/mediaproxy.so
+%{_libdir}/ser/modules/msilo.so
+%{_libdir}/ser/modules/nathelper.so
+%{_libdir}/ser/modules/pdt.so
+%{_libdir}/ser/modules/permissions.so
+%{_libdir}/ser/modules/pike.so
+%{_libdir}/ser/modules/print.so
+%{_libdir}/ser/modules/registrar.so
+%{_libdir}/ser/modules/rr.so
+%{_libdir}/ser/modules/sl.so
+%{_libdir}/ser/modules/sms.so
+%{_libdir}/ser/modules/textops.so
+%{_libdir}/ser/modules/tm.so
+%{_libdir}/ser/modules/uri.so
+%{_libdir}/ser/modules/usrloc.so
+%{_libdir}/ser/modules/xlog.so
+
+%{_libdir}/ser/modules/avp.so
+%{_libdir}/ser/modules/avp_db.so
+%{_libdir}/ser/modules/avpops.so
+%{_libdir}/ser/modules/dispatcher.so
+%{_libdir}/ser/modules/diversion.so
+%{_libdir}/ser/modules/flatstore.so
+%{_libdir}/ser/modules/gflags.so
+%{_libdir}/ser/modules/options.so
+%{_libdir}/ser/modules/speeddial.so
+%{_libdir}/ser/modules/uri_db.so
+
+%{_sbindir}/ser
+%{_sbindir}/serctl
+%{_sbindir}/serunix
+/usr/sbin/rcser
+
+%{_mandir}/man5/*
+%{_mandir}/man8/*
+
+
+%files mysql
+%defattr(-,root,root)
+
+%{_libdir}/ser/modules/mysql.so
+%{_sbindir}/ser_mysql.sh
+
+%files jabber
+%defattr(-,root,root)
+%{_libdir}/ser/modules/jabber.so
+%doc %{_docdir}/ser/README.jabber
+
+%files radius
+%defattr(-,root,root)
+#%{_libdir}/ser/modules/auth_radius.so
+#%{_libdir}/ser/modules/group_radius.so
+#%{_libdir}/ser/modules/uri_radius.so
+%doc %{_docdir}/ser/README.auth_radius
+%doc %{_docdir}/ser/README.group_radius
+%doc %{_docdir}/ser/README.uri_radius
+
+
+
+
+%changelog
+
+* Fri Aug 26 2005 Peter Nixon - Suntel Communications <peter+rpmspam at suntel.com.tr>
+- Remove some needless junk
+- Add a generic tag for non SUSE versions of linux so build doesnt fail on them
+
+* Tue Jul 26 2005 Peter Nixon - Suntel Communications <peter+rpmspam at suntel.com.tr>
+- changed version to 0.9.3 (new upstream release)
+- include SUSE version in the rpm filename(s)
+- update rpm package group to match SUSE 9.3
+- removed files no longer in tarball
+- enabled radius module
+- add symlink for rcser
+
+* Tue Jul 27 2004 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- changed vesion to 0.8.14 (new upstream release)
+- added ext to the modules list, removed the radius modules (they depend on radiusclient-ng now)
+
+* Fri Nov 14 2003 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- changed vesion to 0.8.12 (new upstream release)
+- added auth_diameter, pdt & mangler to the modules list
+
+* Wed Aug 28 2003 Nils Ohlmeier <nils at iptel.org>
+- replaced modules Conflicts with required Ser version
+- fixed doc installation for SuSE pathes
+- added doc for jabber and radius
+
+* Wed Aug 28 2003 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- added doc (READMEs, NEWS, AUTHORS a.s.o)
+- added xlog to the modules list
+
+* Wed Aug 27 2003 Nils Ohlmeier <nils at iptel.org>
+- fixed module dependencys
+- added Conflicts for modules
+
+* Wed Aug 27 2003 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- changed vesion to 0.8.11
+- gen_ha1 is now left in _sbindir
+- removed harv_ser.sh
+- added Conflicts
+
+* Mon Jun 2 2003 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.fraunhofer.de>
+- added a separate rpm for the radius modules
+- updated to the new makefile variables (removed lots of unnecessary stuff)
+
+* Tue Nov 12 2002 Nils Ohlmeier <ohlmeier at fokus.fhg.de>
+- replaced expat-devel with expat
+- removed leading + from a few lines
+
+* Tue Nov 12 2002 Andrei Pelinescu - Onciul <pelinescu-onciul at fokus.gmd.de>
+- added a separate rpm for the jabber modules
+- moved all the binaries to sbin
+- removed obsolete installs (make install installs everything now)
+
+* Mon Oct 28 2002 Nils Ohlmeier <ohlmeier at fokus.fhg.de>
+- Added mysql and mysql-devel to the Req for the ser-mysql rpm.
+
+* Thu Sep 26 2002 Nils Ohlmeier <ohlmeier at fokus.fhg.de>
+- Added library path to mysql/Makefile to build on SuSE 8.0
+
+* Thu Sep 26 2002 Nils Ohlmeier <ohlmeier at fokus.fhg.de>
+- Added 'make [modules|modules-install]' to adapted Makefile changes
+
+* Wed Sep 25 2002 Andrei Pelinescu - Onciul  <pelinescu-onciul at fokus.gmd.de>
+- modified make install & make: added cfg-target & modules-target
+
+* Wed Sep 25 2002 Nils Ohlmeier <ohlmeier at fokus.fhg.de>
+- Copyed mysql connectivity subpackage from orig rpm.spec.
+
+* Fri Sep 06 2002 Nils Ohlmeier <ohlmeier at fokus.fhg.de>
+- Adaptation to SuSE.
+
+* Mon Sep 02 2002 Jan Janak <J.Janak at sh.cvut.cz>
+- gen_ha1 utility added, scripts added.
+
+* Tue Aug 28 2002 Jan Janak <J.Janak at sh.cvut.cz>
+- Finished the first version of the spec file.
+
+* Sun Aug 12 2002 Jan Janak <J.Janak at sh.cvut.cz>
+- First version of the spec file.
diff --git a/pvapi.c b/pvapi.c
index 7f5fcc2..c2966bb 100644
--- a/pvapi.c
+++ b/pvapi.c
@@ -1473,8 +1473,10 @@ int pv_elem_free_all(pv_elem_p log)
 void pv_value_destroy(pv_value_t *val)
 {
 	if(val==0) return;
+
 	if(val->flags&PV_VAL_PKG) pkg_free(val->rs.s);
-	if(val->flags&PV_VAL_SHM) shm_free(val->rs.s);
+	else if(val->flags&PV_VAL_SHM) shm_free(val->rs.s);
+
 	memset(val, 0, sizeof(pv_value_t));
 }
 
diff --git a/re.c b/re.c
index a90fe37..cf6a485 100644
--- a/re.c
+++ b/re.c
@@ -310,6 +310,7 @@ found_re:
 		goto error;
 	}
 	memset((void*)se, 0, sizeof(struct subst_expr));
+	se->re=regex;
 	se->replacement.len=repl_end-repl;
 	if (se->replacement.len > 0) {
 		if ((se->replacement.s=pkg_malloc(se->replacement.len))==0){
@@ -321,7 +322,6 @@ found_re:
 	} else {
 		se->replacement.s = NULL;
 	}
-	se->re=regex;
 	se->replace_all=replace_all;
 	se->n_escapes=rw_no;
 	se->max_pmatch=max_pmatch;
diff --git a/resolve.c b/resolve.c
index d0ef16c..9712033 100644
--- a/resolve.c
+++ b/resolve.c
@@ -1601,7 +1601,7 @@ struct hostent* no_naptr_srv_sip_resolvehost(str* name, unsigned short* port, ch
 			he=srv_sip_resolvehost(&srv_name, 0, port, proto, 1, 0);
 			#endif
 			if (he!=0) {
-				*proto = srv_proto_list[i].proto;
+				if(proto) *proto = srv_proto_list[i].proto;
 				return he;
 			}
 		}
diff --git a/route.c b/route.c
index 1c5897c..2a3e1b9 100644
--- a/route.c
+++ b/route.c
@@ -1886,8 +1886,7 @@ inline static int eval_elem(struct run_act_ctx* h, struct expr* e,
 			if (e->r_type==MYSELF_ST){
 				if (parse_sip_msg_uri(msg)<0) ret=-1;
 				else ret=check_self_op(e->op, &msg->parsed_uri.host,
-						       msg->parsed_uri.port_no?
-						       msg->parsed_uri.port_no:SIP_PORT);
+								GET_URI_PORT(&msg->parsed_uri));
 			}else{
 				ret=comp_str(e->op, &msg->new_uri,
 								e->r_type, &e->r, msg, h);
@@ -1896,8 +1895,7 @@ inline static int eval_elem(struct run_act_ctx* h, struct expr* e,
 			if (e->r_type==MYSELF_ST){
 				if (parse_sip_msg_uri(msg)<0) ret=-1;
 				else ret=check_self_op(e->op, &msg->parsed_uri.host,
-						       msg->parsed_uri.port_no?
-						       msg->parsed_uri.port_no:SIP_PORT);
+								GET_URI_PORT(&msg->parsed_uri));
 			}else{
 				ret=comp_str(e->op, &msg->first_line.u.request.uri,
 								e->r_type, &e->r, msg, h);
@@ -1917,8 +1915,7 @@ inline static int eval_elem(struct run_act_ctx* h, struct expr* e,
 				LOG(L_ERR, "ERROR: eval_elem: bad uri in From:\n");
 				goto error;
 			}
-			ret=check_self_op(e->op, &uri.host,
-					  uri.port_no?uri.port_no:SIP_PORT);
+			ret=check_self_op(e->op, &uri.host, GET_URI_PORT(&uri));
 		}else{
 			ret=comp_str(e->op, &get_from(msg)->uri,
 							e->r_type, &e->r, msg, h);
@@ -1939,8 +1936,7 @@ inline static int eval_elem(struct run_act_ctx* h, struct expr* e,
 				LOG(L_ERR, "ERROR: eval_elem: bad uri in To:\n");
 				goto error;
 			}
-			ret=check_self_op(e->op, &uri.host,
-					  uri.port_no?uri.port_no:SIP_PORT);
+			ret=check_self_op(e->op, &uri.host, GET_URI_PORT(&uri));
 		}else{
 			ret=comp_str(e->op, &get_to(msg)->uri,
 							e->r_type, &e->r, msg, h);
diff --git a/rpc_lookup.h b/rpc_lookup.h
index 7988e04..53d40b6 100644
--- a/rpc_lookup.h
+++ b/rpc_lookup.h
@@ -33,7 +33,7 @@ extern rpc_export_t** rpc_sarray;
 extern int rpc_sarray_crt_size;
 
 int init_rpcs(void);
-int destroy_rpcs(void);
+void destroy_rpcs(void);
 
 rpc_export_t* rpc_lookup(const char* name, int len);
 int rpc_register(rpc_export_t* rpc);
diff --git a/rvalue.c b/rvalue.c
index ddc97c2..8e5ba20 100644
--- a/rvalue.c
+++ b/rvalue.c
@@ -2554,6 +2554,7 @@ struct rval_expr* mk_rval_expr_v(enum rval_type rv_type, void* val,
 			s=(str*)val;
 			v.s.s=pkg_malloc(s->len+1 /*0*/);
 			if (v.s.s==0){
+				pkg_free(rve);
 				ERR("memory allocation failure\n");
 				return 0;
 			}
diff --git a/select.c b/select.c
index 772b371..f82f64c 100644
--- a/select.c
+++ b/select.c
@@ -385,6 +385,10 @@ int resolve_select(select_t* s)
 		}
 	}
 
+	if (t==NULL) {
+		BUG ("final node not found\n");
+		goto not_found;
+	}
 	if (t->table[table_idx].flags & SEL_PARAM_EXPECTED) {
 		BUG ("final node has SEL_PARAM_EXPECTED set (no more parameters available)\n");
 		goto not_found;
diff --git a/stats.h b/stats.h
index 7ab3596..f079541 100644
--- a/stats.h
+++ b/stats.h
@@ -32,7 +32,7 @@
 
 #include <ctype.h>
 #include <sys/mman.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
 #include <sys/time.h>
 #include <time.h>
 #include <sys/utsname.h>
diff --git a/switch.c b/switch.c
index b254a7b..c1feabc 100644
--- a/switch.c
+++ b/switch.c
@@ -538,8 +538,8 @@ static int fix_match(struct action* t)
 			if (default_found){
 				LOG(L_ERR, "ERROR: fix_match: more then one \"default\""
 						" label found (%d, %d)\n",
-						c->ct_rve->fpos.s_line,
-						c->ct_rve->fpos.s_col);
+						(c->ct_rve)?c->ct_rve->fpos.s_line:0,
+						(c->ct_rve)?c->ct_rve->fpos.s_col:0);
 				ret=E_UNSPEC;
 				goto error;
 			}
diff --git a/tcp_main.c b/tcp_main.c
index 6444074..5a43d2c 100644
--- a/tcp_main.c
+++ b/tcp_main.c
@@ -150,7 +150,7 @@
 #ifdef HAVE_SELECT
 #include <sys/select.h>
 #endif
-#include <sys/poll.h>
+#include <poll.h>
 
 
 #include "ip_addr.h"
@@ -4517,9 +4517,12 @@ static inline void tcpconn_destroy_all(void)
 #ifdef USE_TLS
 				if (fd>0 && (c->type==PROTO_TLS || c->type==PROTO_WSS))
 					tls_close(c, fd);
+				if (unlikely(c->type==PROTO_TLS || c->type==PROTO_WSS))
+					(*tls_connections_no)--;
 #endif
-				_tcpconn_rm(c);
+				(*tcp_connections_no)--;
 				c->flags &= ~F_CONN_HASHED;
+				_tcpconn_rm(c);
 				if (fd>0) {
 #ifdef TCP_FD_CACHE
 					if (likely(cfg_get(tcp, tcp_cfg, fd_cache)))
@@ -4527,9 +4530,6 @@ static inline void tcpconn_destroy_all(void)
 #endif /* TCP_FD_CACHE */
 					tcp_safe_close(fd);
 				}
-				(*tcp_connections_no)--;
-				if (unlikely(c->type==PROTO_TLS || c->type==PROTO_WSS))
-					(*tls_connections_no)--;
 			c=next;
 		}
 	}
@@ -4934,6 +4934,17 @@ int tcp_init_children()
 			}
 		}
 	}
+#ifdef USE_TLS
+	for(si=tls_listen; si; si=si->next) {
+		if(si->workers>0) {
+			si->workers_tcpidx = i - si->workers + 1;
+			for(r=0; r<si->workers; r++) {
+				tcp_children[i].mysocket = si;
+				i--;
+			}
+		}
+	}
+#endif
 	tcp_sockets_gworkers = (i != tcp_children_no-1)?(1 + i + 1):0;
 
 	/* create the tcp sock_info structures */
diff --git a/utils/kamctl/kamctl b/utils/kamctl/kamctl
index b286d55..b44e552 100755
--- a/utils/kamctl/kamctl
+++ b/utils/kamctl/kamctl
@@ -2447,7 +2447,7 @@ usrloc() {
 			fi
 
 			$CTLCMD ul_add "$USRLOC_TABLE" "$OSERUSER@$OSERDOMAIN" "$2" \
-"$UL_EXPIRES" "1.00" "$UL_PATH" "$UL_FLAGS" "$BR_FLAGS" "$ALL_METHODS"
+"$UL_EXPIRES" "$DEFAULT_Q" "$UL_PATH" "$UL_FLAGS" "$BR_FLAGS" "$ALL_METHODS"
 			exit $?
 			;;
 		rm)
diff --git a/utils/kamctl/kamdbctl.base b/utils/kamctl/kamdbctl.base
index c4e0307..b4ed9ad 100644
--- a/utils/kamctl/kamdbctl.base
+++ b/utils/kamctl/kamdbctl.base
@@ -41,7 +41,7 @@ STANDARD_TABLES=${STANDARD_TABLES:-version acc dbaliases domain domain_attrs
 EXTRA_TABLES=${EXTRA_TABLES:-imc_members imc_rooms cpl sip_trace domainpolicy
 		carrierroute carrier_name domain_name carrierfailureroute userblacklist
 		globalblacklist htable purplemap uacreg pl_pipes mtree mtrees
-		sca_subscriptions mohqcalls mohqueues}
+		sca_subscriptions mohqcalls mohqueues rtpproxy}
 PRESENCE_TABLES=${PRESENCE_TABLES:-presentity active_watchers watchers xcap 
 		pua rls_presentity rls_watchers}
 DBUID_TABLES=${UID_TABLES:-uid_credentials uid_domain uid_domain_attrs
@@ -81,7 +81,8 @@ STANDARD_MODULES=${STANDARD_MODULES:-standard acc lcr domain group
 PRESENCE_MODULES=${PRESENCE_MODULES:-presence rls}
 
 EXTRA_MODULES=${EXTRA_MODULES:-imc cpl siptrace domainpolicy carrierroute
-		userblacklist htable purple uac pipelimit mtree sca mohqueue}
+		userblacklist htable purple uac pipelimit mtree sca mohqueue
+		rtpproxy}
 
 DBUID_MODULES=${UID_MODULES:-uid_auth_db uid_avp_db uid_domain uid_gflags
 		uid_uri_db}
diff --git a/utils/pdbt/debian/control b/utils/pdbt/debian/control
index 42076c6..8adecb3 100644
--- a/utils/pdbt/debian/control
+++ b/utils/pdbt/debian/control
@@ -7,7 +7,6 @@ Standards-Version: 3.6.2
 
 Package: pdb-tools
 Architecture: any
-Depends: ui-pdb-tools-config
 Description: Tools for handling the PDB
  Tools for building a mmap image of the PDB and running queries on this
  mmap image.
diff --git a/utils/sercmd/sercmd.c b/utils/sercmd/sercmd.c
index 7bb435a..fb9c0a3 100644
--- a/utils/sercmd/sercmd.c
+++ b/utils/sercmd/sercmd.c
@@ -47,6 +47,7 @@
 #include <netinet/in.h> /* udp sock */
 #include <sys/uio.h> /* writev */
 #include <netdb.h> /* gethostbyname */
+#include <fcntl.h>
 #include <time.h> /* time */
 
 #ifdef USE_READLINE
@@ -718,8 +719,24 @@ static int get_reply(int s, unsigned char* reply_buf, int max_reply_size,
 				goto error;
 			}
 			msg_end=hdr_end+in_pkt->tlen;
-			if ((int)(msg_end-reply_buf)>max_reply_size)
+			if ((int)(msg_end-reply_buf)>max_reply_size) {
+				/* reading the rest from the socket */
+				struct timeval timeout_save;
+				unsigned sizeoft = sizeof(timeout_save);
+				if (getsockopt(s, SOL_SOCKET, SO_RCVTIMEO,
+							&timeout_save, &sizeoft)==0) {
+					struct timeval timeout;
+					timeout.tv_sec = 1;
+					timeout.tv_usec = 0;
+					if (setsockopt (s, SOL_SOCKET, SO_RCVTIMEO,
+								(char*)&timeout,sizeof(timeout))==0) {
+						while(read(s, reply_buf, max_reply_size)>0);
+						setsockopt(s, SOL_SOCKET, SO_RCVTIMEO,
+								(char*)&timeout_save,sizeof(timeout_save));
+					}
+				}
 				goto error_toolong;
+			}
 		}
 	}while(crt<msg_end);
 	
@@ -1482,7 +1499,7 @@ static int get_mi_list(int s)
 	/* alloc the mi_cmds array */
 	mi_cmds=malloc(mi_which_results*sizeof(*mi_cmds));
 	if (mi_cmds==0) goto error_mem;
-	memset(mi_cmds, 0, mi_which_results* sizeof(mi_cmds));
+	memset(mi_cmds, 0, mi_which_results* sizeof(*mi_cmds));
 	/* get the mi names list */
 	for (r=0; r<mi_which_no; r++){
 		if (mi_which_array[r].type!=BINRPC_T_STR)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/kamailio.git



More information about the Pkg-voip-commits mailing list