Merge pull request #2013 from surendratiwari3/no_evapi_client_send_failed
authorDaniel-Constantin Mierla <miconda@gmail.com>
Fri, 19 Jul 2019 07:56:45 +0000 (09:56 +0200)
committerGitHub <noreply@github.com>
Fri, 19 Jul 2019 07:56:45 +0000 (09:56 +0200)
evapi:return code and log fixed for no evapi client while sending

586 files changed:
.github/CONTRIBUTING.md
.travis.yml
Makefile
doc/tutorials/tcp_tunning.txt
etc/kamailio.cfg
misc/examples/exec/exec.cfg
misc/examples/kemi/kamailio-basic-kemi-jsdt.js
misc/examples/kemi/kamailio-basic-kemi.cfg
misc/tools/kemi/README.md [new file with mode: 0644]
misc/tools/kemi/kemi-code-gen.py [new file with mode: 0644]
pkg/docker
pkg/kamailio/alpine/APKBUILD
pkg/kamailio/deb/bionic/changelog
pkg/kamailio/deb/buster/changelog
pkg/kamailio/deb/debian/backports/bionic
pkg/kamailio/deb/debian/backports/buster
pkg/kamailio/deb/debian/backports/sid
pkg/kamailio/deb/debian/backports/stretch
pkg/kamailio/deb/debian/changelog
pkg/kamailio/deb/debian/control
pkg/kamailio/deb/jessie/changelog
pkg/kamailio/deb/precise/changelog
pkg/kamailio/deb/sid/changelog
pkg/kamailio/deb/stretch/changelog
pkg/kamailio/deb/stretch/control
pkg/kamailio/deb/trusty/changelog
pkg/kamailio/deb/wheezy/changelog
pkg/kamailio/deb/xenial/changelog
pkg/kamailio/obs/kamailio.spec
pkg/kamailio/obs/meta
src/Makefile
src/Makefile.defs
src/Makefile.groups
src/core/action.c
src/core/basex.c
src/core/cfg.lex
src/core/cfg.y
src/core/cfg_core.c
src/core/cfg_core.h
src/core/config.h
src/core/core_cmd.c
src/core/data_lump.c
src/core/dset.c
src/core/dset.h
src/core/dst_blacklist.c
src/core/globals.h
src/core/ip_addr.h
src/core/kemi.c
src/core/kemi.h
src/core/locking.c
src/core/mem/pkg.h
src/core/mod_fix.c
src/core/mod_fix.h
src/core/msg_translator.c
src/core/onsend.h
src/core/parser/contact/contact.c
src/core/parser/contact/contact.h
src/core/parser/msg_parser.h
src/core/parser/parse_param.c
src/core/parser/parse_param.h
src/core/ppcfg.c
src/core/ppcfg.h
src/core/pvapi.c
src/core/pvar.h
src/core/receive.c
src/core/resolve.c
src/core/resolve.h
src/core/socket_info.c
src/core/socket_info.h
src/core/tcp_main.c
src/core/timer.c
src/core/timer.h
src/core/timer_proc.c
src/core/timer_proc.h
src/core/udp_server.c
src/core/ut.c
src/core/xavp.c
src/core/xavp.h
src/lib/srdb1/db.c
src/lib/srdb1/db_id.c
src/lib/srdb1/db_query.c
src/lib/srdb1/schema/acc.xml
src/lib/srdb1/schema/dialog.xml
src/lib/srdb1/schema/entities.xml
src/lib/srdb1/schema/location.xml
src/lib/srdb1/schema/missed_calls.xml
src/lib/srdb1/schema/pr_active_watchers.xml
src/lib/srdb1/schema/pr_pua.xml
src/lib/srdb1/schema/rls_watchers.xml
src/lib/srdb1/schema/sca.xml
src/lib/srdb1/schema/sip_trace.xml
src/lib/srutils/sha256.c
src/lib/srutils/sha256.h
src/lib/srutils/shautils.c
src/lib/srutils/shautils.h
src/lib/srutils/tmrec.c
src/lib/srutils/tmrec.h
src/main.c
src/modules/acc/README
src/modules/acc/acc_cdr.c
src/modules/acc/acc_mod.c
src/modules/acc/doc/acc_admin.xml
src/modules/acc_json/README
src/modules/acc_json/doc/acc_json_admin.xml
src/modules/app_jsdt/app_jsdt_api.c
src/modules/app_lua/README
src/modules/app_lua/app_lua_api.c
src/modules/app_lua/app_lua_api.h
src/modules/app_lua/app_lua_kemi_export.c
src/modules/app_lua/app_lua_mod.c
src/modules/app_lua/doc/app_lua_admin.xml
src/modules/app_lua/modapi.h [new file with mode: 0644]
src/modules/app_lua/utils/app_lua_ctl
src/modules/app_lua_sr/Makefile [new file with mode: 0644]
src/modules/app_lua_sr/README [new file with mode: 0644]
src/modules/app_lua_sr/app_lua_sr_api.c [moved from src/modules/app_lua/app_lua_sr.c with 61% similarity]
src/modules/app_lua_sr/app_lua_sr_api.h [moved from src/modules/app_lua/app_lua_sr.h with 83% similarity]
src/modules/app_lua_sr/app_lua_sr_exp.c [moved from src/modules/app_lua/app_lua_exp.c with 96% similarity]
src/modules/app_lua_sr/app_lua_sr_exp.h [moved from src/modules/app_lua/app_lua_exp.h with 94% similarity]
src/modules/app_lua_sr/app_lua_sr_mod.c [new file with mode: 0644]
src/modules/app_lua_sr/doc/Makefile [new file with mode: 0644]
src/modules/app_lua_sr/doc/app_lua_sr.xml [new file with mode: 0644]
src/modules/app_lua_sr/doc/app_lua_sr_admin.xml [new file with mode: 0644]
src/modules/app_mono/app_mono_api.c
src/modules/app_python/app_python_mod.c
src/modules/app_python/apy_kemi.c
src/modules/app_python3/app_python3_mod.c
src/modules/app_python3/apy_kemi.c [changed mode: 0755->0644]
src/modules/app_ruby/app_ruby_api.c
src/modules/app_sqlang/app_sqlang_api.c
src/modules/auth/api.c [changed mode: 0755->0644]
src/modules/auth/api.h
src/modules/auth_ephemeral/authorize.c
src/modules/call_control/README
src/modules/call_control/doc/call_control_admin.xml
src/modules/call_obj/call_obj_mod.c
src/modules/carrierroute/parser_carrierroute.c
src/modules/cdp/peerstatemachine.c
src/modules/cfgutils/cfgutils.c
src/modules/cnxcc/README
src/modules/cnxcc/cnxcc_mod.c
src/modules/cnxcc/doc/cnxcc_admin.xml
src/modules/corex/corex_lib.c
src/modules/corex/corex_lib.h
src/modules/corex/corex_mod.c
src/modules/corex/corex_nio.h
src/modules/corex/corex_rpc.c
src/modules/corex/corex_rpc.h
src/modules/corex/corex_var.c
src/modules/crypto/api.c [new file with mode: 0644]
src/modules/crypto/api.h [new file with mode: 0644]
src/modules/crypto/crypto_mod.c
src/modules/crypto/crypto_uuid.c
src/modules/crypto/crypto_uuid.h
src/modules/db_mongodb/mongodb_dbase.c
src/modules/db_mysql/db_mysql.c
src/modules/db_mysql/km_dbase.c
src/modules/db_mysql/km_my_con.c
src/modules/db_mysql/km_res.c
src/modules/db_mysql/my_cmd.c
src/modules/db_mysql/my_con.c
src/modules/db_mysql/my_fld.c
src/modules/db_mysql/my_res.c
src/modules/db_mysql/my_uri.c
src/modules/db_oracle/Makefile
src/modules/db_postgres/Makefile
src/modules/db_postgres/km_dbase.c
src/modules/db_postgres/km_pg_con.c
src/modules/db_postgres/km_res.c
src/modules/db_postgres/km_val.c
src/modules/db_postgres/pg_cmd.c
src/modules/db_postgres/pg_con.c
src/modules/db_postgres/pg_fld.c
src/modules/db_postgres/pg_mod.c
src/modules/db_postgres/pg_res.c
src/modules/db_postgres/pg_sql.c
src/modules/db_postgres/pg_uri.c
src/modules/db_text/README
src/modules/db_text/dbt_base.c
src/modules/db_text/dbt_file.c
src/modules/db_text/doc/db_text_admin.xml
src/modules/dialog/README
src/modules/dialog/dialog.c
src/modules/dialog/dlg_cseq.c
src/modules/dialog/dlg_handlers.c
src/modules/dialog/dlg_handlers.h
src/modules/dialog/dlg_hash.c
src/modules/dialog/dlg_hash.h
src/modules/dialog/dlg_transfer.c
src/modules/dialog/doc/dialog_admin.xml
src/modules/dialplan/README
src/modules/dialplan/dialplan.c
src/modules/dialplan/doc/dialplan_admin.xml
src/modules/dialplan/dp_repl.c
src/modules/dispatcher/README
src/modules/dispatcher/dispatch.c
src/modules/dispatcher/dispatch.h
src/modules/dispatcher/dispatcher.c
src/modules/dispatcher/doc/dispatcher_admin.xml
src/modules/dmq/notification_peer.c
src/modules/dmq_usrloc/usrloc_sync.c
src/modules/evapi/evapi_dispatch.c
src/modules/evrexec/README
src/modules/evrexec/doc/evrexec_admin.xml
src/modules/evrexec/evrexec_mod.c
src/modules/exec/README
src/modules/exec/doc/exec_admin.xml
src/modules/exec/exec.c
src/modules/exec/exec.h
src/modules/exec/exec_mod.c
src/modules/gzcompress/gzcompress_mod.c
src/modules/htable/README
src/modules/htable/api.c
src/modules/htable/api.h
src/modules/htable/doc/htable_admin.xml
src/modules/htable/ht_api.c
src/modules/htable/ht_dmq.c
src/modules/htable/ht_var.c
src/modules/htable/htable.c
src/modules/http_async_client/README
src/modules/http_async_client/async_http.c
src/modules/http_async_client/async_http.h
src/modules/http_async_client/doc/http_async_client_admin.xml
src/modules/http_async_client/hm_hash.h
src/modules/http_async_client/http_async_client_mod.c
src/modules/http_async_client/http_multi.c
src/modules/imc/README
src/modules/imc/doc/imc_admin.xml
src/modules/imc/imc.c
src/modules/imc/imc.h
src/modules/imc/imc_cmd.c
src/modules/imc/imc_cmd.h
src/modules/imc/imc_mng.c
src/modules/ims_auth/pvt_message.c [changed mode: 0755->0644]
src/modules/ims_ipsec_pcscf/README
src/modules/ims_ipsec_pcscf/cmd.c
src/modules/ims_ipsec_pcscf/cmd.h
src/modules/ims_ipsec_pcscf/doc/ims_ipsec_pcscf_admin.xml
src/modules/ims_ipsec_pcscf/ims_ipsec_pcscf_mod.c
src/modules/ims_ipsec_pcscf/ipsec.c
src/modules/ims_ipsec_pcscf/ipsec.h
src/modules/ims_ipsec_pcscf/port_gen.c [new file with mode: 0644]
src/modules/ims_ipsec_pcscf/port_gen.h [new file with mode: 0644]
src/modules/ims_ipsec_pcscf/sec_agree.c [new file with mode: 0644]
src/modules/ims_ipsec_pcscf/sec_agree.h [new file with mode: 0644]
src/modules/ims_ipsec_pcscf/spi_gen.c
src/modules/ims_ipsec_pcscf/spi_list.c
src/modules/ims_ipsec_pcscf/spi_list_tests.c
src/modules/ims_isc/README
src/modules/ims_isc/checker.c
src/modules/ims_isc/checker.h
src/modules/ims_isc/doc/ims_isc_admin.xml
src/modules/ims_isc/third_party_reg.c
src/modules/ims_isc/third_party_reg.h
src/modules/ims_qos/ims_qos_mod.c
src/modules/ims_registrar_pcscf/ims_registrar_pcscf_mod.c
src/modules/ims_registrar_pcscf/save.c
src/modules/ims_registrar_pcscf/sec_agree.c
src/modules/ims_registrar_pcscf/sec_agree.h
src/modules/ims_registrar_scscf/config.c
src/modules/ims_registrar_scscf/registrar_notify.c
src/modules/ims_registrar_scscf/registrar_notify.h
src/modules/ims_registrar_scscf/screensharing.log [deleted file]
src/modules/ims_registrar_scscf/sip_msg.c
src/modules/ims_registrar_scscf/userdata_parser.c
src/modules/ims_usrloc_pcscf/udomain.c
src/modules/ims_usrloc_pcscf/udomain.h
src/modules/ims_usrloc_pcscf/ul_callback.c
src/modules/ims_usrloc_pcscf/ul_callback.h
src/modules/ims_usrloc_pcscf/usrloc.c
src/modules/ims_usrloc_pcscf/usrloc.h
src/modules/ims_usrloc_pcscf/usrloc_db.c
src/modules/ims_usrloc_pcscf/usrloc_db.h
src/modules/ims_usrloc_scscf/NewFile.xml [deleted file]
src/modules/ims_usrloc_scscf/README [new file with mode: 0644]
src/modules/ims_usrloc_scscf/doc/Makefile [new file with mode: 0644]
src/modules/ims_usrloc_scscf/doc/ims_usrloc_scscf.xml [new file with mode: 0644]
src/modules/ims_usrloc_scscf/doc/ims_usrloc_scscf_admin.xml [new file with mode: 0644]
src/modules/ims_usrloc_scscf/doc/ims_usrloc_scscf_faq.xml [new file with mode: 0644]
src/modules/ims_usrloc_scscf/usrloc.h
src/modules/ipops/detailed_ip_type.c
src/modules/jansson/jansson_funcs.c
src/modules/jansson/jansson_utils.c
src/modules/janssonrpcc/README
src/modules/janssonrpcc/doc/janssonrpcc_admin.xml
src/modules/janssonrpcc/janssonrpc_connect.c
src/modules/janssonrpcc/janssonrpc_server.h
src/modules/janssonrpcc/janssonrpc_srv.h
src/modules/janssonrpcc/janssonrpcc_mod.c
src/modules/jsonrpcs/README
src/modules/jsonrpcs/doc/jsonrpcs_admin.xml
src/modules/jsonrpcs/jsonrpcs_mod.c
src/modules/kazoo/kz_amqp.c
src/modules/kazoo/kz_hash.c
src/modules/kemix/Makefile [new file with mode: 0644]
src/modules/kemix/README [new file with mode: 0644]
src/modules/kemix/doc/Makefile [new file with mode: 0644]
src/modules/kemix/doc/kemix.xml [new file with mode: 0644]
src/modules/kemix/doc/kemix_admin.xml [new file with mode: 0644]
src/modules/kemix/kemix_mod.c [new file with mode: 0644]
src/modules/kex/README
src/modules/kex/doc/kex_admin.xml
src/modules/kex/mod_stats.c
src/modules/lcr/README
src/modules/lcr/doc/lcr.xml
src/modules/lcr/doc/lcr_admin.xml
src/modules/lcr/lcr_mod.c
src/modules/lcr/lcr_mod.h
src/modules/lcr/lcr_rpc.c
src/modules/mqueue/api.h
src/modules/mqueue/mqueue_api.c
src/modules/mqueue/mqueue_api.h
src/modules/mqueue/mqueue_mod.c
src/modules/msrp/msrp_mod.c
src/modules/ndb_mongodb/mongodb_client.c
src/modules/ndb_mongodb/ndb_mongodb_mod.c
src/modules/ndb_redis/redis_client.c
src/modules/p_usrloc/dlist.c
src/modules/p_usrloc/p_usrloc_mod.c
src/modules/p_usrloc/udomain.c
src/modules/p_usrloc/ul_db.c
src/modules/p_usrloc/ul_db_watch.c
src/modules/p_usrloc/ul_mi.c
src/modules/pdb/pdb.c
src/modules/phonenum/README
src/modules/phonenum/doc/phonenum_admin.xml
src/modules/pike/pike_funcs.c
src/modules/pipelimit/README
src/modules/pipelimit/doc/pipelimit_admin.xml
src/modules/pipelimit/pipelimit.c
src/modules/pipelimit/pl_ht.c
src/modules/pipelimit/pl_ht.h
src/modules/presence/Makefile
src/modules/presence/README
src/modules/presence/bind_presence.c
src/modules/presence/bind_presence.h
src/modules/presence/doc/presence_admin.xml
src/modules/presence/event_list.c
src/modules/presence/event_list.h
src/modules/presence/hash.c
src/modules/presence/hash.h
src/modules/presence/notify.c
src/modules/presence/notify.h
src/modules/presence/presence.c
src/modules/presence/presence.h
src/modules/presence/presence_dmq.c
src/modules/presence/presence_dmq.h
src/modules/presence/presentity.c
src/modules/presence/presentity.h
src/modules/presence/publish.c
src/modules/presence/publish.h
src/modules/presence/subscribe.c
src/modules/presence/subscribe.h
src/modules/presence/utils_func.c
src/modules/presence/utils_func.h
src/modules/presence_mwi/add_events.c
src/modules/presence_profile/add_events.c
src/modules/presence_profile/add_events.h
src/modules/presence_profile/presence_profile.c
src/modules/presence_profile/presence_profile.h
src/modules/presence_reginfo/add_events.c
src/modules/presence_reginfo/add_events.h
src/modules/presence_reginfo/presence_reginfo.c
src/modules/presence_reginfo/presence_reginfo.h
src/modules/presence_xml/Makefile
src/modules/presence_xml/add_events.c
src/modules/presence_xml/add_events.h
src/modules/presence_xml/api.h
src/modules/presence_xml/notify_body.c
src/modules/presence_xml/notify_body.h
src/modules/presence_xml/pidf.c
src/modules/presence_xml/pidf.h
src/modules/presence_xml/pres_check.c
src/modules/presence_xml/pres_check.h
src/modules/presence_xml/presence_xml.c
src/modules/presence_xml/presence_xml.h
src/modules/presence_xml/xcap_auth.c
src/modules/presence_xml/xcap_auth.h
src/modules/pv/README
src/modules/pv/doc/pv_admin.xml
src/modules/pv/pv.c
src/modules/pv/pv_branch.c
src/modules/pv/pv_branch.h
src/modules/pv/pv_core.c
src/modules/pv/pv_core.h
src/modules/pv/pv_time.c
src/modules/pv/pv_trans.c
src/modules/pv/pv_xavp.c
src/modules/pv/pv_xavp.h
src/modules/registrar/README
src/modules/registrar/doc/registrar_admin.xml
src/modules/registrar/lookup.c
src/modules/registrar/registrar.c
src/modules/registrar/regpv.c
src/modules/rls/Makefile
src/modules/rls/README
src/modules/rls/doc/rls_admin.xml
src/modules/rls/rls.c
src/modules/rr/README
src/modules/rr/doc/rr_admin.xml
src/modules/rr/loose.c
src/modules/rtimer/rtimer_mod.c
src/modules/rtjson/rtjson_mod.c
src/modules/rtjson/rtjson_routing.c
src/modules/rtp_media_server/README
src/modules/rtp_media_server/config_example/kamailio.cfg
src/modules/rtp_media_server/doc/design_notes.txt [new file with mode: 0644]
src/modules/rtp_media_server/doc/rtp_media_server.xml
src/modules/rtp_media_server/doc/rtp_media_server_admin.xml
src/modules/rtp_media_server/docker/Dockerfile [new file with mode: 0644]
src/modules/rtp_media_server/docker/build.sh [new file with mode: 0755]
src/modules/rtp_media_server/docker/rtp_media_server.sh [new file with mode: 0755]
src/modules/rtp_media_server/rms_dialog_info.c [new file with mode: 0644]
src/modules/rtp_media_server/rms_dialog_info.h [new file with mode: 0644]
src/modules/rtp_media_server/rms_media.c
src/modules/rtp_media_server/rms_media.h
src/modules/rtp_media_server/rms_sdp.c
src/modules/rtp_media_server/rms_sdp.h
src/modules/rtp_media_server/rms_util.h
src/modules/rtp_media_server/rtp_media_server.c
src/modules/rtp_media_server/rtp_media_server.h
src/modules/rtpengine/README
src/modules/rtpengine/bencode.h
src/modules/rtpengine/compat.h [new file with mode: 0644]
src/modules/rtpengine/doc/rtpengine.xml
src/modules/rtpengine/doc/rtpengine_admin.xml
src/modules/rtpengine/rtpengine.c
src/modules/rtpengine/rtpengine.h
src/modules/rtpengine/rtpengine_funcs.c
src/modules/sanity/sanity.c
src/modules/sctp/sctp_server.c
src/modules/sdpops/README
src/modules/sdpops/doc/sdpops_admin.xml
src/modules/sdpops/sdpops_mod.c
src/modules/secfilter/README
src/modules/secfilter/doc/secfilter_admin.xml
src/modules/secfilter/secfilter.c
src/modules/secfilter/secfilter.h
src/modules/secfilter/secfilter_rpc.c
src/modules/sipcapture/hep.c
src/modules/sipcapture/sipcapture.c
src/modules/sipt/ss7_parser.c
src/modules/siptrace/README
src/modules/siptrace/doc/siptrace_admin.xml
src/modules/siptrace/siptrace.c
src/modules/siptrace/siptrace_data.h
src/modules/siptrace/siptrace_send.c
src/modules/siputils/contact_ops.c
src/modules/siputils/options.c
src/modules/siputils/options.h
src/modules/siputils/siputils.c
src/modules/sl/README
src/modules/sl/doc/sl_functions.xml
src/modules/sl/doc/sl_params.xml
src/modules/sl/sl.c
src/modules/sl/sl_funcs.c
src/modules/sl/sl_funcs.h
src/modules/sqlops/sql_api.c
src/modules/sqlops/sql_api.h
src/modules/sqlops/sqlops.c
src/modules/stun/kam_stun.c
src/modules/tcpops/README
src/modules/tcpops/doc/functions.xml
src/modules/tcpops/doc/params.xml
src/modules/tcpops/tcpops.c
src/modules/tcpops/tcpops.h
src/modules/tcpops/tcpops_mod.c
src/modules/timer/timer.c
src/modules/tls/Makefile
src/modules/tls/README
src/modules/tls/doc/tls.xml
src/modules/tls/sbufq.h
src/modules/tls/tls_domain.c
src/modules/tls/tls_init.c
src/modules/tls/tls_select.c
src/modules/tls/tls_server.c
src/modules/tls/utils/openssl_mutex_shared/Makefile [new file with mode: 0644]
src/modules/tls/utils/openssl_mutex_shared/README.md [new file with mode: 0644]
src/modules/tls/utils/openssl_mutex_shared/openssl_mutex_shared.c [new file with mode: 0644]
src/modules/tm/README
src/modules/tm/dlg.c
src/modules/tm/doc/functions.xml
src/modules/tm/doc/params.xml
src/modules/tm/h_table.c
src/modules/tm/h_table.h
src/modules/tm/rpc_uac.c
src/modules/tm/t_funcs.c
src/modules/tm/t_funcs.h
src/modules/tm/t_fwd.c
src/modules/tm/t_hooks.c
src/modules/tm/t_lookup.c
src/modules/tm/t_lookup.h
src/modules/tm/t_msgbuilder.c
src/modules/tm/t_reply.c
src/modules/tm/t_suspend.c
src/modules/tm/timer.c
src/modules/tm/tm.c
src/modules/tm/tm_load.c
src/modules/tm/tm_load.h
src/modules/tm/uac.c
src/modules/tmx/tmx_mod.c
src/modules/topoh/th_mask.c
src/modules/topoh/th_msg.c
src/modules/topoh/topoh_mod.c
src/modules/topos/topos_mod.c
src/modules/topos/tps_msg.c
src/modules/topos_redis/topos_redis_storage.c
src/modules/tsilo/README
src/modules/tsilo/doc/tsilo_admin.xml
src/modules/tsilo/ts_store.c
src/modules/uac/README
src/modules/uac/api.h
src/modules/uac/doc/uac_admin.xml
src/modules/uac/replace.c
src/modules/uac/replace.h
src/modules/uac/uac.c
src/modules/uac/uac_reg.c
src/modules/uac_redirect/README
src/modules/uac_redirect/doc/uac_redirect_admin.xml
src/modules/uac_redirect/rd_funcs.c
src/modules/uac_redirect/rd_funcs.h
src/modules/uac_redirect/uac_redirect.c
src/modules/userblacklist/README
src/modules/userblacklist/doc/userblacklist_admin.xml
src/modules/usrloc/README
src/modules/usrloc/doc/usrloc_admin.xml
src/modules/usrloc/ucontact.c
src/modules/usrloc/ucontact.h
src/modules/usrloc/udomain.c
src/modules/usrloc/ul_rpc.c
src/modules/usrloc/usrloc.h
src/modules/usrloc/usrloc_mod.c
src/modules/websocket/ws_conn.c
src/modules/websocket/ws_frame.c
src/modules/websocket/ws_frame.h
src/modules/xhttp/xhttp_mod.c
src/modules/xhttp_prom/Makefile [new file with mode: 0644]
src/modules/xhttp_prom/README [new file with mode: 0644]
src/modules/xhttp_prom/doc/Makefile [new file with mode: 0644]
src/modules/xhttp_prom/doc/xhttp_prom.xml [new file with mode: 0644]
src/modules/xhttp_prom/doc/xhttp_prom_admin.xml [new file with mode: 0644]
src/modules/xhttp_prom/prom.c [new file with mode: 0644]
src/modules/xhttp_prom/prom.h [new file with mode: 0644]
src/modules/xhttp_prom/prom_metric.c [new file with mode: 0644]
src/modules/xhttp_prom/prom_metric.h [new file with mode: 0644]
src/modules/xhttp_prom/xhttp_prom.c [new file with mode: 0644]
src/modules/xhttp_prom/xhttp_prom.h [new file with mode: 0644]
src/modules/xmlrpc/doc/xmlrpc_admin.xml
src/modules/xmlrpc/xmlrpc.c
src/modules/xprint/xp_lib.c
test/travis/build_travis.sh
utils/db_oracle/Makefile
utils/kamctl/db_redis/kamailio/location
utils/kamctl/db_sqlite/acc-create.sql
utils/kamctl/db_sqlite/dialog-create.sql
utils/kamctl/db_sqlite/presence-create.sql
utils/kamctl/db_sqlite/rls-create.sql
utils/kamctl/db_sqlite/sca-create.sql
utils/kamctl/db_sqlite/siptrace-create.sql
utils/kamctl/kamctl
utils/kamctl/kamctl.base
utils/kamctl/kamctl.ctlbase
utils/kamctl/kamctl.rpcfifo
utils/kamctl/kamctl.sqlbase
utils/kamctl/kamctlrc
utils/kamctl/kamdbctl
utils/kamctl/mysql/acc-create.sql
utils/kamctl/mysql/dialog-create.sql
utils/kamctl/mysql/ims_charging-create.sql [moved from utils/kamctl/mysql/ims_charging_create.sql with 100% similarity]
utils/kamctl/mysql/ims_usrloc_pcscf-create.sql
utils/kamctl/mysql/presence-create.sql
utils/kamctl/mysql/rls-create.sql
utils/kamctl/mysql/sca-create.sql
utils/kamctl/mysql/siptrace-create.sql
utils/kamctl/oracle/acc-create.sql
utils/kamctl/oracle/dialog-create.sql
utils/kamctl/oracle/presence-create.sql
utils/kamctl/oracle/rls-create.sql
utils/kamctl/oracle/sca-create.sql
utils/kamctl/oracle/siptrace-create.sql
utils/kamctl/postgres/acc-create.sql
utils/kamctl/postgres/dialog-create.sql
utils/kamctl/postgres/presence-create.sql
utils/kamctl/postgres/rls-create.sql
utils/kamctl/postgres/sca-create.sql
utils/kamctl/postgres/siptrace-create.sql

index a09a8c0..d22cbc0 100644 (file)
@@ -14,8 +14,10 @@ changes to this document in a pull request.
   * [Overview](#overview)
   * [Contributing Code Or Content](#contributing-code-or-content)
     * [Basic Rules](#basic-rules)
-    * [Commit Message Format](#commit-message-format)
-      * [Examples Of Commit Messages](#examples-of-commit-messages)
+    * [Commit Message Rules](#commit-message-rules)
+      * [Commit Message Format](#commit-message-format)
+      * [Commit Message Content](#commit-message-content)
+      * [Commit Message Examples](#commit-message-examples)
       * [See Also](#see-also)
   * [Reporting Issues](#reporting-issues)
   * [License](#license)
@@ -34,7 +36,7 @@ and commit history, there are several *rules* required for each contribution.
 
 ### Basic Rules ###
 
-  * github pull requests are the favourited mechanism to submit contributions
+  * github pull request is the favorited mechanism to submit contributions
   (patches)
   * make a pull request against **master branch**
     * commit can be later backported to stable branch(es)
@@ -47,39 +49,26 @@ and commit history, there are several *rules* required for each contribution.
     * an internal library (code inside subfolder lib/)
     * a module (code inside subfolder modules/)
     * a tool (code inside subfolder utils/)
-    * an example or main configs (files inside subfolders etc/ or examples/)
-  * commit messages **has to be formatted** as specified in the next section
-  * commit message must describe the changes done by the patch
-    * other details (e.g., how to reproduce, backtrace, sip packets, ...) belong
-    to content (comments) of the pull request
-  * avoid emoticons and non-technical statements in commit messages
-    * e.g., if it was a feature request by John Smith, don't mention that in
-    commit message, especially don't write it owns you now a beer
-  * credits can be given within commit message as a short statement, mentioning
-  the name of the person or entity
-    * for commits introducing a new module, credits must not be included in the
-    commit message, being expected that the respective entity will own the
-    copyright and it is reflected in the README or copyright header of each file
-  * when the case, make references to the item on bug tracker, using GH #XYZ
-  -- replace XYZ with issue number id
-    * e.g.,: - issue reported by John Smith, GH #123
-  * changes to **README** file of modules **must** not be done directly in that
+    * an example or main configs (files inside subfolders etc/ or misc/examples/)
+  * commit message format **has to follow the rules** specified in the next section
+  * commit message content **has to follow the rules** specified in the next section 
+  * changes to the **README** file of a module **must not** be done directly in that
   file. Instead, edit the xml files located in **modules/modname/doc/** folder
     * to regenerate the README, run **make modules-readme modules=modules/modname**
     * docbook utils and xsl packages are needed for the above command to work
-    * it is ok to modify only the xml doc file, the readme can be regenerated by
-    another developer who has the required tools installed
-    * if it is a change to README that needs to be backported, make separate
-    commits to xml doc file and README. The changes to README files are very
-    likely to rise merge conflicts. With separate commit, that won't be
-    backported, only the commit to xml doc file, then README will be manually
-    regenerated in the corresponding branch.
+    * it is only necessary to modify and commit the xml doc file, the **README**
+    will be regenerated by a automatic script that is executed every few hours
+    * so if you modify an existing module **README** don't commit the changes
+    of this file to the git repository
+    * if you create a new module that includes also a **README** file, you
+    need to commit the README to the git repository one time
   * code **should** be formatted with **clang-format** or to match the style of
   the component that the commit applies to. The `.clang-format` file is part of
   Kamailio source code tree, in the root folder.
 
+### Commit Message Rules ###
 
-### Commit Message Format ###
+#### Commit Message Format ####
 
 Please create the commit messages following the GIT convention:
 
@@ -93,14 +82,66 @@ as "Subject" in the generated commit emails and it will also be used when
 generating the Changelog (e.g. git log --pretty=oneline).
 
 Please start always with the prefix of the component (subsystem) that is modified by the commit, for example:
-  * `core`: typo fixes to log messages
-  * `tcp`: stun fixes
-  * `mem`: added faster malloc
-  * `module_name`: support for foo rfc extension
-  * `lib_name`: critical bug fix for abc case
+  * `core`: more fixup helper functions
+    * `core`: tcp - support for haproxy protocol
+    * `core`: mem - added faster malloc
+  * `modname`: support for foo rfc extension
+    * `usrloc`: support for gruu rfc extension
+  * `lib`: srutils - critical bug fix for abc case
   * `kamctl`: added support for management of module xyz
 
-#### Examples Of Commit Messages ####
+#### Commit Message Content ####
+
+  * first line (subject line) has to contain meaningful text about what that commit
+  does, do not put just a reference to bug tracker or pull request items
+  * t
+  * commit message must describe the changes done by the patch
+    * other details (e.g., how to reproduce, backtrace, sip packets, ...) belong
+    to content (comments) of the pull request. Example:
+```
+core: added latency_limit_cfg global parameter
+
+- print execution time for configuration script only if it exceeds this value
+- default is 0 - print always (behaviour so far)
+- it is printed to latency_cfg_log level
+```
+  * avoid emoticons and non-technical statements in commit messages
+    * e.g., if it was a feature request by John Smith, don't mention that in
+    commit message, especially don't write it owns you now a beer
+  * credits can be given within commit message as a short statement, mentioning
+  the name of the person or entity
+    * for commits introducing a new module, credits must not be included in the
+    commit message, being expected that the respective entity will own the
+    copyright and it is reflected in the README or copyright header of each file
+  * when the case, make references in the commit body (not in the subject/first line)
+  to the items on bug tracker or pull requests, using GH #XYZ
+  -- replace XYZ with issue number id. Example:
+
+```
+dialplan: basic safety for concurrent rpc reload
+
+- reported by GH #1874
+```
+  * commits related to reports by static analyzers or other tools must describe
+  what was fixed or changed. The tool, if a well known one, can be mentioned in
+  the body of the commit message, after the technical details presenting the
+  changes. For example, do not use commit messages like:
+```
+...: fix for whatever-tool reports
+```
+  * do not reference non-public resources (e.g., private links, id of non-public
+  static analyzer reports,  ...). For example, do not use commit messages like:
+```
+...: fix for whatever-tool report #1234
+```
+```
+...: fix for http://private-tracker.lab/1234
+```
+  * do not mention any developer name or yourself when fixing an issue introduced
+  by an old commit done by that developer or you. That commit can be referenced
+  by hash id.
+
+#### Commit Message Examples ####
 
   * change to usrloc module from modules
 
index 11eae2d..73638bb 100644 (file)
@@ -4,7 +4,7 @@ compiler:
   - gcc
   - clang
 env:
-  - DIST=stretch
+  - DIST=buster
   - DIST=sid
 services:
   - docker
index f0df1b6..6d4abe6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,9 @@ KSR_DIR ?= src/
 # default target for makefile
 .DEFAULT_GOAL := default
 
+ifneq ($(wildcard modules),)
+$(warning "old Kamailio modules directory found, you should clean that")
+endif
 
 # strip the src/ from the path to modules
 SMODPARAM=
index 39097d5..aca6a12 100644 (file)
@@ -19,22 +19,22 @@ For now it deals only with Linux specific optimizations.
 
 net.core.somaxconn             -  limit of the listen() backlog, default 128
 net.ipv4.tcp_max_syn_backlog   -  default 1024 or 128
-net.ipv4.tcp_timestamps        - default on., should be on (along with 
+net.ipv4.tcp_timestamps        - default on., should be on (along with
                                  tcp_tw_recycle and timestamp supporting
                                  peers allows for fast connections rates)
 
-1.2 connection in close_wait
+1.2 Connection in close_wait
 
- Connection should stay as little as possible
- in close_wait to quickly free the fd/resources for new connections attempts
- WARNING: this could break normal TCP use, use it only if you know what you are
 Connection should stay as little as possible
 in close_wait to quickly free the fd/resources for new connections attempts
 WARNING: this could break normal TCP use, use it only if you know what you are
   doing
+
 net.ipv4.tcp_max_tw_buckets - maximum number of timewait sockets
                               (the default seems to be ok)
 net.ipv4.tcp_tw_recycle     - enables fast time wait sockets recycling (default
                               off), should be enabled if you have lots of short
-                              lived connections 
+                              lived connections
                               WARNING: see the above warning
 net.ipv4.tcp_tw_reuse       - allows reusing of time-wait sockets (default off)
                               WARNING: see above
@@ -49,10 +49,26 @@ net.ipv4.ip_local_port_range - should be increased (e.g. 4096-65534)
 1.4 Open file descriptors
 
 fs.file-max                 - maximum number of fds that will be allocated
-                              (you probably need to increase it, default 
+                              (you probably need to increase it, default
                                depends on installed memory)
 
-1.5 other sysctl that might affect tcp connection rate or the maximum number
+1.5 Buffers size
+
+  When dealing with large data, check the values for network sockets buffers
+  to be sufficient, among them:
+
+net.core.rmem_max
+net.core.wmem_max
+net.core.rmem_default
+net.core.wmem_default
+net.ipv4.tcp_mem
+net.ipv4.tcp_rmem
+net.ipv4.tcp_wmem
+
+  Note: sysctl -w net.ipv4.route.flush=1 - enusre that immediatly subsequent
+  connections use the values
+
+1.6 Other sysctl that might affect tcp connection rate or the maximum number
     of open connections
 
 fs.epoll.max_user_instances - maximum number of devices - per user (2.6.27.8+)
index d17c719..20871fb 100644 (file)
@@ -1,6 +1,6 @@
 #!KAMAILIO
 #
-# Kamailio (OpenSER) SIP Server v5.2 - default configuration script
+# Kamailio (OpenSER) SIP Server v5.3 - default configuration script
 #     - web: https://www.kamailio.org
 #     - git: https://github.com/kamailio/kamailio
 #
@@ -158,12 +158,16 @@ memlog=5
 log_facility=LOG_LOCAL0
 log_prefix="{$mt $hdr(CSeq) $ci} "
 
-/* number of SIP routing processes */
+/* number of SIP routing processes for each UDP socket
+ * - value inherited by tcp_children and sctp_children when not set explicitely */
 children=8
 
 /* uncomment the next line to disable TCP (default on) */
 # disable_tcp=yes
 
+/* number of SIP routing processes for all TCP/TLS sockets */
+# tcp_children=8
+
 /* uncomment the next line to disable the auto discovery of local aliases
  * based on reverse DNS on IPs (default on) */
 # auto_aliases=no
@@ -175,14 +179,20 @@ children=8
  * bind on a specific interface/port/proto (default bind on all available) */
 # listen=udp:10.0.0.10:5060
 
-#!ifdef WITH_TLS
-enable_tls=yes
-#!endif
-
 /* life time of TCP connection when there is no traffic
  * - a bit higher than registration expires to cope with UA behind NAT */
 tcp_connection_lifetime=3605
 
+/* upper limit for TCP connections (it includes the TLS connections) */
+tcp_max_connections=2048
+
+#!ifdef WITH_TLS
+enable_tls=yes
+
+/* upper limit for TLS connections */
+tls_max_connections=2048
+#!endif
+
 ####### Custom Parameters #########
 
 /* These parameters can be modified runtime via RPC interface
@@ -300,6 +310,9 @@ modparam("jsonrpcs", "pretty_format", 1)
 /* set the path to RPC unix socket control file */
 # modparam("ctl", "binrpc", "unix:/var/run/kamailio/kamailio_ctl")
 
+# ----- sanity params -----
+modparam("sanity", "autodrop", 0)
+
 # ----- tm params -----
 # auto-discard branches from previous serial forking leg
 modparam("tm", "failure_reply_mode", 3)
@@ -544,6 +557,13 @@ route[RELAY] {
 
 # Per SIP request initial checks
 route[REQINIT] {
+       # no connect for sending replies
+       set_reply_no_connect();
+       if(has_totag()) {
+               # no connect for requests within dialog
+               set_forward_no_connect();
+       }
+
 #!ifdef WITH_ANTIFLOOD
        # flood detection from same IP and traffic ban for a while
        # be sure you exclude checking trusted peers, such as pstn gateways
@@ -561,7 +581,7 @@ route[REQINIT] {
                }
        }
 #!endif
-       if($ua =~ "friendly-scanner|sipcli|VaxSIPUserAgent") {
+       if($ua =~ "friendly-scanner|sipcli|sipvicious|VaxSIPUserAgent") {
                # silent drop for scanners - uncomment next line if want to reply
                # sl_send_reply("200", "OK");
                exit;
@@ -578,7 +598,7 @@ route[REQINIT] {
        }
 
        if(!sanity_check("17895", "7")) {
-               xlog("Malformed SIP message from $si:$sp\n");
+               xlog("Malformed SIP request from $si:$sp\n");
                exit;
        }
 }
@@ -811,6 +831,11 @@ route[NATMANAGE] {
                                set_contact_alias();
                }
        }
+
+       if(isbflagset(FLB_NATB)) {
+               # no connect message in a dialog involving NAT traversal
+               set_forward_no_connect();
+       }
 #!endif
        return;
 }
@@ -929,6 +954,14 @@ branch_route[MANAGE_BRANCH] {
 }
 
 # Manage incoming replies
+reply_route {
+       if(!sanity_check("17604", "6")) {
+               xlog("Malformed SIP response from $si:$sp\n");
+               drop;
+       }
+}
+
+# Manage incoming replies in transaction context
 onreply_route[MANAGE_REPLY] {
        xdbg("incoming reply\n");
        if(status=~"[12][0-9][0-9]") {
index b0cfe43..30a3a6e 100644 (file)
@@ -1,5 +1,4 @@
-#
-# $Id$
+#!KAMAILIO
 #
 # this example shows use of ser as stateless redirect server
 # which rewrites URIs using an exernal utility
@@ -7,17 +6,18 @@
 
 # ------------------ module loading ----------------------------------
 
-loadmodule "modules/exec/exec.so"
-loadmodule "modules/sl/sl.so"
+loadmodule "exec.so"
+loadmodule "sl.so"
+loadmodule "xlog.so"
 
 # -------------------------  request routing logic -------------------
 
 # main routing logic
 
-route{
+request_route {
        # for testing purposes, simply okay all REGISTERs
        if (method=="REGISTER") {
-               log("REGISTER");
+               xlog("REGISTER");
                sl_send_reply("200", "ok");
                break;
        };
@@ -30,7 +30,7 @@ route{
                sl_send_reply("300", "Redirect");
        } else {
                sl_reply_error();
-               log(1, "alas, rewriting failed\n");
+               xlog("rewriting failed\n");
        };
 }
 
index ea45b5a..040af86 100644 (file)
@@ -18,7 +18,7 @@ var FLB_NATSIPPING=7
 function ksr_request_route()
 {
        // KSR.sl.sl_send_reply(100,"Intelligent trying");
-       // KSR.info("===== request - from kamailio lua script\n");
+       // KSR.info("===== request - from kamailio javascript script\n");
 
        // per request initial checks
        ksr_route_reqinit();
index 805d78c..9245056 100644 (file)
@@ -114,14 +114,32 @@ memlog=5
 log_prefix="LUA {$rm}: "
 #!else
 #!ifdef WITH_CFGPYTHON
-log_prefix="PYT {$rm}: "
+log_prefix="PY2 {$rm}: "
+#!else
+#!ifdef WITH_CFGPYTHON3
+log_prefix="PY3 {$rm}: "
+#!else
+#!ifdef WITH_CFGJSDT
+log_prefix="JSC {$rm}: "
+#!else
+#!ifdef WITH_CFGSQLANG
+log_prefix="SQL {$rm}: "
+#!else
+#!ifdef WITH_CFGJRUBY
+log_prefix="RUB {$rm}: "
 #!else
 log_prefix="NAT {$rm}: "
 #!endif
 #!endif
+#!endif
+#!endif
+#!endif
+#!endif
 
 latency_cfg_log=2
-
+latency_log=2
+latency_limit_action=100000
+latency_limit_db=200000
 log_facility=LOG_LOCAL0
 
 fork=yes
@@ -215,10 +233,18 @@ loadmodule "app_lua.so"
 loadmodule "app_python.so"
 #!endif
 
+#!ifdef WITH_CFGPYTHON3
+loadmodule "app_python3.so"
+#!endif
+
 #!ifdef WITH_CFGJSDT
 loadmodule "app_jsdt.so"
 #!endif
 
+#!ifdef WITH_CFGRUBY
+loadmodule "app_ruby.so"
+#!endif
+
 #!ifdef WITH_CFGSQLANG
 loadmodule "app_sqlang.so"
 #!endif
@@ -355,12 +381,16 @@ modparam("htable", "htable", "ipban=>size=8;autoexpire=300;")
 #!endif
 
 #!ifdef WITH_CFGPYTHON
-modparam("app_python", "script_name", "/usr/local/etc/kamailio/kamailio-basic-kemi-python.py")
+modparam("app_python", "load", "/usr/local/etc/kamailio/kamailio-basic-kemi-python.py")
+cfgengine "python"
+#!else
+
+#!ifdef WITH_CFGPYTHON3
+modparam("app_python3", "load", "/usr/local/etc/kamailio/kamailio-basic-kemi-python.py")
 cfgengine "python"
 #!else
 
 #!ifdef WITH_CFGLUA
-modparam("app_lua", "reload", 1)
 modparam("app_lua", "load", "/usr/local/etc/kamailio/kamailio-basic-kemi-lua.lua")
 cfgengine "lua"
 #!else
@@ -369,10 +399,16 @@ cfgengine "lua"
 modparam("app_jsdt", "load", "/usr/local/etc/kamailio/kamailio-basic-kemi-jsdt.js")
 cfgengine "jsdt"
 #!else
+
 #!ifdef WITH_CFGSQLANG
 modparam("app_sqlang", "load", "/usr/local/etc/kamailio/kamailio-basic-kemi-sqlang.sq")
 cfgengine "sqlang"
 #!else
+
+#!ifdef WITH_CFGRUBY
+modparam("app_ruby", "load", "/usr/local/etc/kamailio/kamailio-basic-kemi-ruby.rb")
+cfgengine "ruby"
+#!else
 cfgengine "native"
 include_file "/usr/local/etc/kamailio/kamailio-basic-kemi-native.cfg"
 #!endif
@@ -383,3 +419,6 @@ include_file "/usr/local/etc/kamailio/kamailio-basic-kemi-native.cfg"
 
 #!endif
 
+#!endif
+
+#!endif
diff --git a/misc/tools/kemi/README.md b/misc/tools/kemi/README.md
new file mode 100644 (file)
index 0000000..589e1a2
--- /dev/null
@@ -0,0 +1,4 @@
+# Helper Tools For KEMI #
+
+Scripts and other tools that help managing the code for Kamailio Embedded Interpreters (KEMI).
+
diff --git a/misc/tools/kemi/kemi-code-gen.py b/misc/tools/kemi/kemi-code-gen.py
new file mode 100644 (file)
index 0000000..8593c15
--- /dev/null
@@ -0,0 +1,291 @@
+# Python 3 helper program for KEMI
+# - print IF conditions with param types for KEMI interpreters
+# - print typedefs for functions
+
+PRINTPARAMS=4
+# - print mode: typedefs, js, lua, python, pythonparams, ruby, sqlang
+PRINTMODE="sqlang"
+# - two tabs for python params, three for the other cases
+# PRINTTABS="\t\t"
+PRINTTABS="\t\t\t"
+PRINTELSE=""
+
+def printCodeFuncTypedefs(prefix):
+       sfunc = "typedef int (*sr_kemi_fm" + prefix + "_f)(sip_msg_t*"
+       ", str*, str*, str*, str*, str*);"
+       for i, c in enumerate(prefix):
+               if c == 's':
+                       sfunc += ", str*"
+               else:
+                       sfunc += ", int"
+       sfunc += ");"
+       print(sfunc)
+
+
+def printCodeIfEnd(sretfunc):
+       print(PRINTTABS + "} else {")
+       print(PRINTTABS + "\tLM_ERR(\"invalid parameters for: %.*s\\n\", fname->len, fname->s);")
+       print(PRINTTABS + "\treturn " + sretfunc + ";")
+       print(PRINTTABS + "}")
+
+
+def printCodeIfJS(prefix):
+       global PRINTELSE
+       sfunc = PRINTTABS + "\tret = ((sr_kemi_fm" + prefix + "_f)(ket->func))(env_J->msg,\n" + PRINTTABS + "\t\t\t"
+       for i, c in enumerate(prefix):
+               if i==0:
+                       if c == 's':
+                               print(PRINTTABS + PRINTELSE + "if(ket->ptypes[0]==SR_KEMIP_STR")
+                               sfunc += "&vps[" + str(i) +"].s, "
+                       else:
+                               print(PRINTTABS + PRINTELSE + "if(ket->ptypes[0]==SR_KEMIP_INT")
+                               sfunc += "vps[" + str(i) +"].n, "
+                       PRINTELSE = "} else "
+               elif i==PRINTPARAMS-1:
+                       if c == 's':
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_STR) {")
+                               sfunc += "&vps[" + str(i) +"].s);"
+                       else:
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_INT) {")
+                               sfunc += "vps[" + str(i) +"].n);"
+               else:
+                       if c == 's':
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_STR")
+                               sfunc += "&vps[" + str(i) +"].s, "
+                       else:
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_INT")
+                               sfunc += "vps[" + str(i) +"].n, "
+
+       print(sfunc)
+       print(PRINTTABS + "\treturn sr_kemi_jsdt_return_int(J, ket, ret);")
+
+
+def printCodeIfLua(prefix):
+       global PRINTELSE
+       sfunc = PRINTTABS + "\tret = ((sr_kemi_fm" + prefix + "_f)(ket->func))(env_L->msg,\n" + PRINTTABS + "\t\t\t"
+       for i, c in enumerate(prefix):
+               if i==0:
+                       if c == 's':
+                               print(PRINTTABS + PRINTELSE + "if(ket->ptypes[0]==SR_KEMIP_STR")
+                               sfunc += "&vps[" + str(i) +"].s, "
+                       else:
+                               print(PRINTTABS + PRINTELSE + "if(ket->ptypes[0]==SR_KEMIP_INT")
+                               sfunc += "vps[" + str(i) +"].n, "
+                       PRINTELSE = "} else "
+               elif i==PRINTPARAMS-1:
+                       if c == 's':
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_STR) {")
+                               sfunc += "&vps[" + str(i) +"].s);"
+                       else:
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_INT) {")
+                               sfunc += "vps[" + str(i) +"].n);"
+               else:
+                       if c == 's':
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_STR")
+                               sfunc += "&vps[" + str(i) +"].s, "
+                       else:
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_INT")
+                               sfunc += "vps[" + str(i) +"].n, "
+
+       print(sfunc)
+       print(PRINTTABS + "\treturn sr_kemi_lua_return_int(L, ket, ret);")
+
+
+def printCodeIfPython(prefix):
+       global PRINTELSE
+       sfunc = PRINTTABS + "\tret = ((sr_kemi_fm" + prefix + "_f)(ket->func))(lmsg,\n" + PRINTTABS + "\t\t\t"
+       for i, c in enumerate(prefix):
+               if i==0:
+                       if c == 's':
+                               print(PRINTTABS + PRINTELSE + "if(ket->ptypes[0]==SR_KEMIP_STR")
+                               sfunc += "&vps[" + str(i) +"].s, "
+                       else:
+                               print(PRINTTABS + PRINTELSE + "if(ket->ptypes[0]==SR_KEMIP_INT")
+                               sfunc += "vps[" + str(i) +"].n, "
+                       PRINTELSE = "} else "
+               elif i==PRINTPARAMS-1:
+                       if c == 's':
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_STR) {")
+                               sfunc += "&vps[" + str(i) +"].s);"
+                       else:
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_INT) {")
+                               sfunc += "vps[" + str(i) +"].n);"
+               else:
+                       if c == 's':
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_STR")
+                               sfunc += "&vps[" + str(i) +"].s, "
+                       else:
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_INT")
+                               sfunc += "vps[" + str(i) +"].n, "
+
+       print(sfunc)
+       print(PRINTTABS + "\treturn sr_kemi_apy_return_int(ket, ret);")
+
+
+def printCodeIfPythonParams(prefix):
+       global PRINTELSE
+       sfunc = PRINTTABS + "\tif(!PyArg_ParseTuple(args, \"" + prefix + ":kemi-param-" + prefix + "\",\n" + PRINTTABS + "\t\t\t"
+       slen = ""
+       sdbg = PRINTTABS + "\tLM_DBG(\"params[%d] for: %.*s are:"
+       sval = ""
+       for i, c in enumerate(prefix):
+               if i==0:
+                       if c == 's':
+                               print(PRINTTABS + PRINTELSE + "if(ket->ptypes[0]==SR_KEMIP_STR")
+                               sfunc += "&vps[" + str(i) +"].s.s, "
+                               slen += PRINTTABS + "\tvps[" + str(i) + "].s.len = strlen(vps[" + str(i) + "].s.s);\n"
+                               sdbg += " [%s]"
+                               sval += "vps[" + str(i) + "].s.s, "
+                       else:
+                               print(PRINTTABS + PRINTELSE + "if(ket->ptypes[0]==SR_KEMIP_INT")
+                               sfunc += "&vps[" + str(i) +"].n, "
+                               sdbg += " [%d]"
+                               sval += "vps[" + str(i) + "].n, "
+                       PRINTELSE = "} else "
+               elif i==PRINTPARAMS-1:
+                       if c == 's':
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_STR) {")
+                               sfunc += "&vps[" + str(i) +"].s.s)) {"
+                               slen += PRINTTABS + "\tvps[" + str(i) + "].s.len = strlen(vps[" + str(i) + "].s.s);\n"
+                               sdbg += " [%s]"
+                               sval += "vps[" + str(i) + "].s.s"
+                       else:
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_INT) {")
+                               sfunc += "&vps[" + str(i) +"].n)) {"
+                               sdbg += " [%d]"
+                               sval += "vps[" + str(i) + "].n"
+               else:
+                       if c == 's':
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_STR")
+                               sfunc += "&vps[" + str(i) +"].s.s, "
+                               slen += PRINTTABS + "\tvps[" + str(i) + "].s.len = strlen(vps[" + str(i) + "].s.s);\n"
+                               sdbg += " [%s]"
+                               sval += "vps[" + str(i) + "].s.s, "
+                       else:
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_INT")
+                               sfunc += "&vps[" + str(i) +"].n, "
+                               sdbg += " [%d]"
+                               sval += "vps[" + str(i) + "].n, "
+       print(sfunc)
+       print(PRINTTABS + "\t\tLM_ERR(\"unable to retrieve " + prefix + " params %d\\n\", i);")
+       print(PRINTTABS + "\t\treturn sr_kemi_apy_return_false();")
+       print(PRINTTABS + "\t}")
+       print(slen)
+       print(sdbg + "\\n\",\n" + PRINTTABS + "\t\t\t" + "i, fname.len, fname.s,")
+       print(PRINTTABS + "\t\t\t" + sval + ");")
+
+
+def printCodeIfRuby(prefix):
+       global PRINTELSE
+       sfunc = PRINTTABS + "\tret = ((sr_kemi_fm" + prefix + "_f)(ket->func))(env_R->msg,\n" + PRINTTABS + "\t\t\t"
+       for i, c in enumerate(prefix):
+               if i==0:
+                       if c == 's':
+                               print(PRINTTABS + PRINTELSE + "if(ket->ptypes[0]==SR_KEMIP_STR")
+                               sfunc += "&vps[" + str(i) +"].s, "
+                       else:
+                               print(PRINTTABS + PRINTELSE + "if(ket->ptypes[0]==SR_KEMIP_INT")
+                               sfunc += "vps[" + str(i) +"].n, "
+                       PRINTELSE = "} else "
+               elif i==PRINTPARAMS-1:
+                       if c == 's':
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_STR) {")
+                               sfunc += "&vps[" + str(i) +"].s);"
+                       else:
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_INT) {")
+                               sfunc += "vps[" + str(i) +"].n);"
+               else:
+                       if c == 's':
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_STR")
+                               sfunc += "&vps[" + str(i) +"].s, "
+                       else:
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_INT")
+                               sfunc += "vps[" + str(i) +"].n, "
+
+       print(sfunc)
+       print(PRINTTABS + "\treturn sr_kemi_ruby_return_int(ket, ret);")
+
+
+def printCodeIfSQLang(prefix):
+       global PRINTELSE
+       sfunc = PRINTTABS + "\tret = ((sr_kemi_fm" + prefix + "_f)(ket->func))(env_J->msg,\n" + PRINTTABS + "\t\t\t"
+       for i, c in enumerate(prefix):
+               if i==0:
+                       if c == 's':
+                               print(PRINTTABS + PRINTELSE + "if(ket->ptypes[0]==SR_KEMIP_STR")
+                               sfunc += "&vps[" + str(i) +"].s, "
+                       else:
+                               print(PRINTTABS + PRINTELSE + "if(ket->ptypes[0]==SR_KEMIP_INT")
+                               sfunc += "vps[" + str(i) +"].n, "
+                       PRINTELSE = "} else "
+               elif i==PRINTPARAMS-1:
+                       if c == 's':
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_STR) {")
+                               sfunc += "&vps[" + str(i) +"].s);"
+                       else:
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_INT) {")
+                               sfunc += "vps[" + str(i) +"].n);"
+               else:
+                       if c == 's':
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_STR")
+                               sfunc += "&vps[" + str(i) +"].s, "
+                       else:
+                               print(PRINTTABS + "\t\t&& ket->ptypes[" + str(i) + "]==SR_KEMIP_INT")
+                               sfunc += "vps[" + str(i) +"].n, "
+
+       print(sfunc)
+       print(PRINTTABS + "\treturn sr_kemi_sqlang_return_int(J, ket, ret);")
+
+
+# generated possible strings of length k with chars from set.
+def printAllKLength(cset, k):
+
+       n = len(cset)
+       printAllKLengthRec(cset, "", n, k)
+
+
+def printAllKLengthRec(cset, prefix, n, k):
+
+       if (k == 0) :
+               # print(prefix)
+               if PRINTMODE == "js":
+                       printCodeIfJS(prefix)
+               elif PRINTMODE == "lua":
+                       printCodeIfLua(prefix)
+               elif PRINTMODE == "python":
+                       printCodeIfPython(prefix)
+               elif PRINTMODE == "pythonparams":
+                       printCodeIfPythonParams(prefix)
+               elif PRINTMODE == "ruby":
+                       printCodeIfRuby(prefix)
+               elif PRINTMODE == "sqlang":
+                       printCodeIfSQLang(prefix)
+               else:
+                       printCodeFuncTypedefs(prefix)
+               return
+
+       for i in range(n):
+               newPrefix = prefix + cset[i]
+               printAllKLengthRec(cset, newPrefix, n, k - 1)
+
+
+# main statements
+if __name__ == "__main__":
+
+       charset = ['s', 'n']
+       k = PRINTPARAMS
+       printAllKLength(charset, k)
+       if PRINTMODE == "js":
+               printCodeIfEnd("app_jsdt_return_false(J)")
+       elif PRINTMODE == "lua":
+               printCodeIfEnd("app_lua_return_false(L)")
+       elif PRINTMODE == "python":
+               printCodeIfEnd("sr_kemi_apy_return_false()")
+       elif PRINTMODE == "pythonparams":
+               printCodeIfEnd("sr_kemi_apy_return_false()")
+       elif PRINTMODE == "ruby":
+               printCodeIfEnd("Qfalse")
+       elif PRINTMODE == "sqlang":
+               printCodeIfEnd("app_sqlang_return_false(J)")
+
+
index 97353c5..b92a1c8 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 97353c545936e6b51e2e2e8ccb13fc9688197206
+Subproject commit b92a1c899b8c474afadd0cf29dd7cb4ea01a3466
index ffcaa13..57c1c4b 100644 (file)
@@ -178,17 +178,17 @@ _mod_list_sqlite="db_sqlite"
 _mod_list_oracle="db_oracle"
 
 # - modules depending on json library
-_mod_list_json="json jsonrpcc jsonrpcs"
+_mod_list_json="json jsonrpcc jsonrpcs pua_json"
 
 # - modules depending on redis library
-_mod_list_redis="ndb_redis topos_redis"
+_mod_list_redis="db_redis ndb_redis topos_redis"
 
 # - modules depending on mono library
 _mod_list_mono="app_mono"
 
 # - modules related to IMS extensions
 _mod_list_ims="cdp cdp_avp ims_dialog ims_diameter_server ims_auth ims_isc ims_icscf ims_qos \
-               ims_registrar_pcscf ims_registrar_scscf ims_usrloc_pcscf \
+               ims_ocs ims_registrar_pcscf ims_registrar_scscf ims_usrloc_pcscf \
                ims_usrloc_scscf ims_charging"
 
 # - modules depending on osp toolkit library
@@ -216,7 +216,7 @@ _mod_list_kazoo="kazoo"
 _mod_list_mongodb="db_mongodb ndb_mongodb"
 
 # - modules depending on jansson library
-_mod_list_jansson="jansson janssonrpcc"
+_mod_list_jansson="acc_json jansson janssonrpcc"
 
 # - modules depending on libm
 _mod_list_jsdt="app_jsdt"
index 1986109..52596cf 100644 (file)
@@ -1,3 +1,27 @@
+kamailio (5.3.0~dev6) unstable; urgency=medium
+
+  * version set 5.3.0~dev6
+
+ -- Victor Seva <vseva@debian.org>  Wed, 12 Jun 2019 09:50:46 +0200
+
+kamailio (5.3.0~dev5) unstable; urgency=medium
+
+  * version set 5.3.0~dev5
+
+ -- Victor Seva <vseva@debian.org>  Thu, 18 Apr 2019 17:08:48 +0200
+
+kamailio (5.3.0~dev4) unstable; urgency=medium
+
+  * version set 5.3.0~dev4
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 09:03:17 +0100
+
+kamailio (5.3.0~dev3) unstable; urgency=medium
+
+  * version set 5.3.0~dev3
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 08:59:48 +0100
+
 kamailio (5.3.0~dev2) unstable; urgency=medium
 
   * version set 5.3.0~dev2
index 1986109..52596cf 100644 (file)
@@ -1,3 +1,27 @@
+kamailio (5.3.0~dev6) unstable; urgency=medium
+
+  * version set 5.3.0~dev6
+
+ -- Victor Seva <vseva@debian.org>  Wed, 12 Jun 2019 09:50:46 +0200
+
+kamailio (5.3.0~dev5) unstable; urgency=medium
+
+  * version set 5.3.0~dev5
+
+ -- Victor Seva <vseva@debian.org>  Thu, 18 Apr 2019 17:08:48 +0200
+
+kamailio (5.3.0~dev4) unstable; urgency=medium
+
+  * version set 5.3.0~dev4
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 09:03:17 +0100
+
+kamailio (5.3.0~dev3) unstable; urgency=medium
+
+  * version set 5.3.0~dev3
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 08:59:48 +0100
+
 kamailio (5.3.0~dev2) unstable; urgency=medium
 
   * version set 5.3.0~dev2
index dbbe2fc..8512ae4 100755 (executable)
@@ -25,6 +25,9 @@ sed -i -e '/^export JAVA_HOME/d' ${DIST}/rules
 sed -i -e 's/ java[ ,$]*/ /' ${DIST}/rules
 sed -i -e '/^EXCLUDED_MODULES=/s/$/ java/' ${DIST}/rules
 
+# libssl1.0-dev conflicts with libcurl4-openssl-dev dependencies
+sed -i -e 's/libssl-dev (<<1.1)/libssl-dev/' ${DIST}/control
+
 wrap-and-sort -sat -d ${DIST}
 
 # clean backports scripts
index 82a41a8..a4c4473 100755 (executable)
@@ -25,6 +25,9 @@ sed -i -e '/^export JAVA_HOME/d' ${DIST}/rules
 sed -i -e 's/ java[ ,$]*/ /' ${DIST}/rules
 sed -i -e '/^EXCLUDED_MODULES=/s/$/ java/' ${DIST}/rules
 
+# no libssl-dev 1.0
+sed -i -e 's/libssl-dev (<<1.1)/libssl-dev/' ${DIST}/control
+
 wrap-and-sort -sat -d ${DIST}
 
 # clean backports scripts
index 8161de7..6b1c5d4 100755 (executable)
@@ -25,6 +25,9 @@ sed -i -e '/^export JAVA_HOME/d' ${DIST}/rules
 sed -i -e 's/ java[ ,$]*/ /' ${DIST}/rules
 sed -i -e '/^EXCLUDED_MODULES=/s/$/ java/' ${DIST}/rules
 
+# no libssl-dev 1.0
+sed -i -e 's/libssl-dev (<<1.1)/libssl-dev/' ${DIST}/control
+
 wrap-and-sort -sat -d ${DIST}
 
 # clean backports scripts
index cf528bd..0f9780a 100755 (executable)
@@ -22,6 +22,9 @@ sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ dnssec/' ${DIST}/rules
 sed -i 's/libmongoc-dev/libbson-dev,\n libmongoc-dev/' \
        ${DIST}/control
 
+# use libssl1.0-dev
+sed -i -e 's/libssl-dev (<<1.1)/libssl1.0-dev/' ${DIST}/control
+
 wrap-and-sort -sat -d ${DIST}
 
 # clean backports scripts
index 1986109..52596cf 100644 (file)
@@ -1,3 +1,27 @@
+kamailio (5.3.0~dev6) unstable; urgency=medium
+
+  * version set 5.3.0~dev6
+
+ -- Victor Seva <vseva@debian.org>  Wed, 12 Jun 2019 09:50:46 +0200
+
+kamailio (5.3.0~dev5) unstable; urgency=medium
+
+  * version set 5.3.0~dev5
+
+ -- Victor Seva <vseva@debian.org>  Thu, 18 Apr 2019 17:08:48 +0200
+
+kamailio (5.3.0~dev4) unstable; urgency=medium
+
+  * version set 5.3.0~dev4
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 09:03:17 +0100
+
+kamailio (5.3.0~dev3) unstable; urgency=medium
+
+  * version set 5.3.0~dev3
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 08:59:48 +0100
+
 kamailio (5.3.0~dev2) unstable; urgency=medium
 
   * version set 5.3.0~dev2
index e807728..ffe8437 100644 (file)
@@ -43,7 +43,7 @@ Build-Depends:
  libsctp-dev,
  libsnmp-dev,
  libsqlite3-dev,
- libssl-dev,
+ libssl-dev (<<1.1),
  libsystemd-dev,
  libunistring-dev,
  libval-dev,
index 1986109..52596cf 100644 (file)
@@ -1,3 +1,27 @@
+kamailio (5.3.0~dev6) unstable; urgency=medium
+
+  * version set 5.3.0~dev6
+
+ -- Victor Seva <vseva@debian.org>  Wed, 12 Jun 2019 09:50:46 +0200
+
+kamailio (5.3.0~dev5) unstable; urgency=medium
+
+  * version set 5.3.0~dev5
+
+ -- Victor Seva <vseva@debian.org>  Thu, 18 Apr 2019 17:08:48 +0200
+
+kamailio (5.3.0~dev4) unstable; urgency=medium
+
+  * version set 5.3.0~dev4
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 09:03:17 +0100
+
+kamailio (5.3.0~dev3) unstable; urgency=medium
+
+  * version set 5.3.0~dev3
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 08:59:48 +0100
+
 kamailio (5.3.0~dev2) unstable; urgency=medium
 
   * version set 5.3.0~dev2
index 1986109..52596cf 100644 (file)
@@ -1,3 +1,27 @@
+kamailio (5.3.0~dev6) unstable; urgency=medium
+
+  * version set 5.3.0~dev6
+
+ -- Victor Seva <vseva@debian.org>  Wed, 12 Jun 2019 09:50:46 +0200
+
+kamailio (5.3.0~dev5) unstable; urgency=medium
+
+  * version set 5.3.0~dev5
+
+ -- Victor Seva <vseva@debian.org>  Thu, 18 Apr 2019 17:08:48 +0200
+
+kamailio (5.3.0~dev4) unstable; urgency=medium
+
+  * version set 5.3.0~dev4
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 09:03:17 +0100
+
+kamailio (5.3.0~dev3) unstable; urgency=medium
+
+  * version set 5.3.0~dev3
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 08:59:48 +0100
+
 kamailio (5.3.0~dev2) unstable; urgency=medium
 
   * version set 5.3.0~dev2
index 1986109..52596cf 100644 (file)
@@ -1,3 +1,27 @@
+kamailio (5.3.0~dev6) unstable; urgency=medium
+
+  * version set 5.3.0~dev6
+
+ -- Victor Seva <vseva@debian.org>  Wed, 12 Jun 2019 09:50:46 +0200
+
+kamailio (5.3.0~dev5) unstable; urgency=medium
+
+  * version set 5.3.0~dev5
+
+ -- Victor Seva <vseva@debian.org>  Thu, 18 Apr 2019 17:08:48 +0200
+
+kamailio (5.3.0~dev4) unstable; urgency=medium
+
+  * version set 5.3.0~dev4
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 09:03:17 +0100
+
+kamailio (5.3.0~dev3) unstable; urgency=medium
+
+  * version set 5.3.0~dev3
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 08:59:48 +0100
+
 kamailio (5.3.0~dev2) unstable; urgency=medium
 
   * version set 5.3.0~dev2
index 1986109..52596cf 100644 (file)
@@ -1,3 +1,27 @@
+kamailio (5.3.0~dev6) unstable; urgency=medium
+
+  * version set 5.3.0~dev6
+
+ -- Victor Seva <vseva@debian.org>  Wed, 12 Jun 2019 09:50:46 +0200
+
+kamailio (5.3.0~dev5) unstable; urgency=medium
+
+  * version set 5.3.0~dev5
+
+ -- Victor Seva <vseva@debian.org>  Thu, 18 Apr 2019 17:08:48 +0200
+
+kamailio (5.3.0~dev4) unstable; urgency=medium
+
+  * version set 5.3.0~dev4
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 09:03:17 +0100
+
+kamailio (5.3.0~dev3) unstable; urgency=medium
+
+  * version set 5.3.0~dev3
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 08:59:48 +0100
+
 kamailio (5.3.0~dev2) unstable; urgency=medium
 
   * version set 5.3.0~dev2
index 7e87c25..2fbd439 100644 (file)
@@ -44,7 +44,7 @@ Build-Depends:
  libsctp-dev,
  libsnmp-dev,
  libsqlite3-dev,
- libssl-dev,
+ libssl1.0-dev,
  libsystemd-dev,
  libunistring-dev,
  libxml2-dev,
index 1986109..52596cf 100644 (file)
@@ -1,3 +1,27 @@
+kamailio (5.3.0~dev6) unstable; urgency=medium
+
+  * version set 5.3.0~dev6
+
+ -- Victor Seva <vseva@debian.org>  Wed, 12 Jun 2019 09:50:46 +0200
+
+kamailio (5.3.0~dev5) unstable; urgency=medium
+
+  * version set 5.3.0~dev5
+
+ -- Victor Seva <vseva@debian.org>  Thu, 18 Apr 2019 17:08:48 +0200
+
+kamailio (5.3.0~dev4) unstable; urgency=medium
+
+  * version set 5.3.0~dev4
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 09:03:17 +0100
+
+kamailio (5.3.0~dev3) unstable; urgency=medium
+
+  * version set 5.3.0~dev3
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 08:59:48 +0100
+
 kamailio (5.3.0~dev2) unstable; urgency=medium
 
   * version set 5.3.0~dev2
index 1986109..52596cf 100644 (file)
@@ -1,3 +1,27 @@
+kamailio (5.3.0~dev6) unstable; urgency=medium
+
+  * version set 5.3.0~dev6
+
+ -- Victor Seva <vseva@debian.org>  Wed, 12 Jun 2019 09:50:46 +0200
+
+kamailio (5.3.0~dev5) unstable; urgency=medium
+
+  * version set 5.3.0~dev5
+
+ -- Victor Seva <vseva@debian.org>  Thu, 18 Apr 2019 17:08:48 +0200
+
+kamailio (5.3.0~dev4) unstable; urgency=medium
+
+  * version set 5.3.0~dev4
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 09:03:17 +0100
+
+kamailio (5.3.0~dev3) unstable; urgency=medium
+
+  * version set 5.3.0~dev3
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 08:59:48 +0100
+
 kamailio (5.3.0~dev2) unstable; urgency=medium
 
   * version set 5.3.0~dev2
index 1986109..52596cf 100644 (file)
@@ -1,3 +1,27 @@
+kamailio (5.3.0~dev6) unstable; urgency=medium
+
+  * version set 5.3.0~dev6
+
+ -- Victor Seva <vseva@debian.org>  Wed, 12 Jun 2019 09:50:46 +0200
+
+kamailio (5.3.0~dev5) unstable; urgency=medium
+
+  * version set 5.3.0~dev5
+
+ -- Victor Seva <vseva@debian.org>  Thu, 18 Apr 2019 17:08:48 +0200
+
+kamailio (5.3.0~dev4) unstable; urgency=medium
+
+  * version set 5.3.0~dev4
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 09:03:17 +0100
+
+kamailio (5.3.0~dev3) unstable; urgency=medium
+
+  * version set 5.3.0~dev3
+
+ -- Victor Seva <vseva@debian.org>  Wed, 20 Mar 2019 08:59:48 +0100
+
 kamailio (5.3.0~dev2) unstable; urgency=medium
 
   * version set 5.3.0~dev2
index bd174fa..8fd4254 100644 (file)
@@ -17,6 +17,8 @@
 %bcond_without memcached
 %bcond_without mongodb
 %bcond_without perl
+%bcond_without phonenum
+%bcond_without python3
 %bcond_without rabbitmq
 %bcond_without redis
 %bcond_without ruby
@@ -40,6 +42,8 @@
 %bcond_without memcached
 %bcond_without mongodb
 %bcond_without perl
+%bcond_without phonenum
+%bcond_without python3
 %bcond_without rabbitmq
 %bcond_without redis
 %bcond_without ruby
 %bcond_without memcached
 %bcond_without mongodb
 %bcond_without perl
+%bcond_without phonenum
+%bcond_without python3
+%bcond_without rabbitmq
+%bcond_without redis
+%bcond_without ruby
+%bcond_without sctp
+%bcond_without websocket
+%bcond_without xmlrpc
+%endif
+
+%if 0%{?fedora} == 30
+%define dist_name fedora
+%define dist_version %{?fedora}
+%bcond_without cnxcc
+%bcond_with dnssec
+%bcond_without geoip
+%bcond_without http_async_client
+%bcond_without ims
+%bcond_without jansson
+%bcond_without json
+%bcond_without lua
+%bcond_without kazoo
+%bcond_without memcached
+%bcond_without mongodb
+%bcond_without perl
+%bcond_without phonenum
+%bcond_without python3
 %bcond_without rabbitmq
 %bcond_without redis
 %bcond_without ruby
 %bcond_with cnxcc
 %bcond_without dnssec
 %bcond_without geoip
-%bcond_with http_async_client
+%bcond_without http_async_client
 %bcond_without ims
-%bcond_with jansson
-%bcond_with json
+%bcond_without jansson
+%bcond_without json
 %bcond_without lua
-%bcond_with kazoo
+%bcond_without kazoo
 %bcond_without memcached
 %bcond_with mongodb
 %bcond_without perl
+%bcond_with phonenum
+%bcond_with python3
 %bcond_with rabbitmq
 %bcond_with redis
 %bcond_with ruby
 %bcond_without memcached
 %bcond_without mongodb
 %bcond_without perl
+%bcond_without phonenum
+%bcond_without python3
 %bcond_without rabbitmq
 %bcond_without redis
 %bcond_without ruby
 %bcond_without memcached
 %bcond_with mongodb
 %bcond_without perl
+%bcond_with phonenum
+%bcond_without python3
 %bcond_with rabbitmq
 %bcond_without redis
 %bcond_without ruby
 %bcond_with memcached
 %bcond_with mongodb
 %bcond_with perl
+%bcond_with phonenum
+%bcond_with python3
 %bcond_with rabbitmq
 %bcond_with redis
 %bcond_with ruby
 %bcond_with memcached
 %bcond_without mongodb
 %bcond_without perl
+%bcond_with phonenum
+%bcond_with python3
 %bcond_with rabbitmq
 %bcond_without redis
 %bcond_with ruby
 %bcond_without xmlrpc
 %endif
 
+# Defining missing macros on RHEL/CentOS 6
+%if 0%{?rhel} == 6
+%define _rundir %{_localstatedir}/run
+%endif
+
 # redefine buggy openSUSE Leap _sharedstatedir macro. More info at https://bugzilla.redhat.com/show_bug.cgi?id=183370
 %if 0%{?suse_version} == 1315
 %define _sharedstatedir /var/lib
@@ -233,8 +279,8 @@ Conflicts:  kamailio-outbound < %ver, kamailio-perl < %ver
 Conflicts:  kamailio-postgresql < %ver, kamailio-presence < %ver
 Conflicts:  kamailio-python < %ver
 Conflicts:  kamailio-radius < %ver, kamailio-redis < %ver
-Conflicts:  kamailio-regex < %ver, kamailio-ruby < %ver, kamailio-sctp < %ver
-Conflicts:  kamailio-sipdump < %ver
+Conflicts:  kamailio-regex < %ver, kamailio-ruby < %ver
+Conflicts:  kamailio-sctp < %ver, kamailio-secfilter < %ver, kamailio-sipdump < %ver
 Conflicts:  kamailio-snmpstats < %ver, kamailio-sqlang < %ver, kamailio-sqlite < %ver
 Conflicts:  kamailio-tls < %ver, kamailio-unixodbc < %ver
 Conflicts:  kamailio-utils < %ver, kamailio-websocket < %ver
@@ -246,12 +292,7 @@ BuildRequires:  bison, flex
 Requires:  filesystem
 BuildRequires:  systemd-mini, shadow
 %endif
-%if 0%{?fedora} == 27
-BuildRequires:  python3-devel
-%endif
-%if 0%{?fedora} == 28
-BuildRequires:  python3-devel
-%endif
+
 
 %description
 Kamailio (former OpenSER) is an Open Source SIP Server released under GPL, able
@@ -270,6 +311,14 @@ like Asteriskâ„¢, FreeSWITCHâ„¢ or SEMS.
 %package    acc_json
 Summary:    Account transaction information in a JSON dictionary
 Group:      %{PKGGROUP}
+Requires:   kamailio = %ver
+%if 0%{?rhel} == 6
+Requires:   libevent2
+BuildRequires:  libevent2-devel
+%else
+Requires:   libevent
+BuildRequires:  libevent-devel
+%endif
 %if 0%{?suse_version}
 Requires:   libjansson
 BuildRequires:  libjansson-devel
@@ -356,7 +405,7 @@ Module which provides a mechanism to limit call duration based on credit informa
 %package    cpl
 Summary:    CPL (Call Processing Language) interpreter for Kamailio
 Group:      %{PKGGROUP}
-Requires:   libxml2, kamailio = %ver
+Requires:   which, libxml2, kamailio = %ver
 BuildRequires:  libxml2-devel
 
 %description    cpl
@@ -445,8 +494,14 @@ Compressed body (SIP and HTTP) handling for kamailio.
 %package    http_async_client
 Summary:    Async HTTP client module for Kamailio
 Group:      %{PKGGROUP}
-Requires:   libevent, kamailio = %ver
-BuildRequires: libevent-devel
+Requires:   kamailio = %ver
+%if 0%{?rhel} == 6
+Requires:   libevent2
+BuildRequires:  libevent2-devel
+%else
+Requires:   libevent
+BuildRequires:  libevent-devel
+%endif
 %if 0%{?suse_version}
 Requires:   libcurl4
 BuildRequires:  libcurl-devel
@@ -491,7 +546,14 @@ IMS modules and extensions module for Kamailio.
 %package    jansson
 Summary:    JSON string handling and RPC modules for Kamailio using JANSSON library
 Group:      %{PKGGROUP}
-Requires:   libevent, kamailio = %ver
+Requires:   kamailio = %ver
+%if 0%{?rhel} == 6
+Requires:   libevent2
+BuildRequires:  libevent2-devel
+%else
+Requires:   libevent
+BuildRequires:  libevent-devel
+%endif
 %if 0%{?suse_version}
 Requires:   libjson-c2
 BuildRequires:  libjansson-devel
@@ -509,8 +571,14 @@ JSON string handling and RPC modules for Kamailio using JANSSON library.
 %package    json
 Summary:    JSON string handling and RPC modules for Kamailio
 Group:      %{PKGGROUP}
-Requires:   libevent, kamailio = %ver
+Requires:   kamailio = %ver
+%if 0%{?rhel} == 6
+Requires:   libevent2
+BuildRequires:  libevent2-devel
+%else
+Requires:   libevent
 BuildRequires:  libevent-devel
+%endif
 %if 0%{?suse_version}
 Requires:   libjson-c2
 BuildRequires:  libjson-c-devel
@@ -528,8 +596,15 @@ JSON string handling and RPC modules for Kamailio.
 %package    kazoo
 Summary:    Kazoo middle layer connector support for Kamailio
 Group:      %{PKGGROUP}
-Requires:   libuuid, librabbitmq, json-c, libevent, kamailio = %ver
-BuildRequires:  libuuid-devel, librabbitmq-devel, json-c-devel, libevent-devel
+Requires:   libuuid, librabbitmq, json-c, kamailio = %ver
+BuildRequires:  libuuid-devel, librabbitmq-devel, json-c-devel
+%if 0%{?rhel} == 6
+Requires:   libevent2
+BuildRequires:  libevent2-devel
+%else
+Requires:   libevent
+BuildRequires:  libevent-devel
+%endif
 
 %description    kazoo
 Kazoo module for Kamailio.
@@ -645,6 +720,19 @@ Perl extensions and database driver for Kamailio.
 %endif
 
 
+%if %{with phonenum}
+%package    phonenum
+Summary:    Phonenum module the Kamailio
+Group:      %{PKGGROUP}
+Requires:   kamailio = %ver
+Requires:   libphonenumber
+BuildRequires:  libphonenumber-devel libicu-devel protobuf-devel
+
+%description    phonenum
+Phonenum module the Kamailio.
+%endif
+
+
 %package    postgresql
 Summary:    PostgreSQL database connectivity for Kamailio
 Group:      %{PKGGROUP}
@@ -683,6 +771,16 @@ Summary:    Python extensions for Kamailio
 Group:      %{PKGGROUP}
 Requires:   python, kamailio = %ver
 BuildRequires:  python, python-devel
+%if %{with python3}
+%if 0%{?rhel} == 7
+Requires:   python36, kamailio = %ver
+BuildRequires:  python36, python36-devel
+%else
+Requires:   python3, kamailio = %ver
+BuildRequires:  python3, python3-devel
+%endif
+%endif
+
 
 %description    python
 Python extensions for Kamailio.
@@ -771,10 +869,19 @@ SCTP transport for Kamailio.
 %endif
 
 
+%package    secfilter
+Summary:    Additional layer of security over our communications
+Group:      %{PKGGROUP}
+Requires:   kamailio = %ver
+
+%description    secfilter
+Additional layer of security over our communications.
+
+
 %package    sipcapture-daemon-config
 Summary:    Reference config for sipcapture daemon
 Group:      %{PKGGROUP}
-Requires:   kamailio-sipcapture = %ver
+Requires:   kamailio = %ver
 %if 0%{?suse_version}
 Requires:  filesystem
 %endif
@@ -997,13 +1104,19 @@ UUID module for Kamailio.
 %prep
 %setup -n %{name}-%{ver}
 
+%if "%{__python2}" != ""
+    sed -i -e 's:#!/usr/bin/python:#!%{__python2}:' utils/kamctl/dbtextdb/dbtextdb.py
+%endif
+
 ln -s ../obs pkg/kamailio/fedora/27
 ln -s ../obs pkg/kamailio/fedora/28
 ln -s ../obs pkg/kamailio/fedora/29
+ln -s ../obs pkg/kamailio/fedora/30
 ln -s ../obs pkg/kamailio/rhel/6
 ln -s ../obs pkg/kamailio/rhel/7
 ln -s ../obs pkg/kamailio/opensuse/1315
 ln -s ../obs pkg/kamailio/opensuse/1330
+ln -s ../obs pkg/kamailio/opensuse/1500
 ln -s ../obs pkg/kamailio/opensuse/1550
 ln -s ../obs pkg/kamailio/centos/6
 ln -s ../obs pkg/kamailio/centos/7
@@ -1073,7 +1186,14 @@ make every-module skip_modules="app_mono db_cassandra db_oracle iptrtpproxy \
 %if %{with perl}
     kperl \
 %endif
-    kpostgres kpresence kpython kradius \
+%if %{with phonenum}
+    kphonenum \
+%endif
+    kpostgres kpresence kpython \
+%if %{with python3}
+    kpython3 \
+%endif
+    kradius \
 %if %{with redis}
     kredis \
 %endif
@@ -1150,7 +1270,14 @@ make install-modules-all skip_modules="app_mono db_cassandra db_oracle \
 %if %{with perl}
     kperl \
 %endif
-    kpostgres kpresence kpython kradius \
+%if %{with phonenum}
+    kphonenum \
+%endif
+    kpostgres kpresence kpython \
+%if %{with python3}
+    kpython3 \
+%endif
+    kradius \
 %if %{with redis}
     kredis \
 %endif
@@ -1682,6 +1809,7 @@ fi
 %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
@@ -1821,6 +1949,14 @@ fi
 %endif
 
 
+%if %{with phonenum}
+%files      phonenum
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.phonenum
+%{_libdir}/kamailio/modules/phonenum.so
+%endif
+
+
 %files      postgresql
 %defattr(-,root,root)
 %doc %{_docdir}/kamailio/modules/README.db_postgres
@@ -1877,6 +2013,10 @@ fi
 %defattr(-,root,root)
 %doc %{_docdir}/kamailio/modules/README.app_python
 %{_libdir}/kamailio/modules/app_python.so
+%if %{with python3}
+%doc %{_docdir}/kamailio/modules/README.app_python3
+%{_libdir}/kamailio/modules/app_python3.so
+%endif
 
 
 %if %{with rabbitmq}
@@ -1955,6 +2095,12 @@ fi
 %endif
 
 
+%files      secfilter
+%defattr(-,root,root)
+%doc %{_docdir}/kamailio/modules/README.secfilter
+%{_libdir}/kamailio/modules/secfilter.so
+
+
 %files      sipdump
 %defattr(-,root,root)
 %doc %{_docdir}/kamailio/modules/README.sipdump
@@ -2006,6 +2152,8 @@ fi
 %doc %{_docdir}/kamailio/modules/README.tls
 %{_libdir}/kamailio/modules/auth_identity.so
 %{_libdir}/kamailio/modules/tls.so
+%dir %{_libdir}/kamailio/openssl_mutex_shared
+%{_libdir}/kamailio/openssl_mutex_shared/openssl_mutex_shared.so
 
 
 %files      tcpops
@@ -2069,6 +2217,10 @@ fi
 
 
 %changelog
+* Sat Mar 30 2019 Sergey Safarov <s.safarov@gmail.com> 5.3.0-0
+  - Added support of openSUSE:Leap:15.0, openSUSE:Leap:15.1 and Fedora 30 dists
+* Thu Feb 21 2019 Sergey Safarov <s.safarov@gmail.com> 5.3.0-0
+  - Added secfilter package
 * Tue Dec 11 2018 Sergey Safarov <s.safarov@gmail.com> 5.2.0-1
   - Added Ruby package
 * Sun Nov 04 2018 Sergey Safarov <s.safarov@gmail.com> 5.2.0-0
index 41bf574..bec3a6b 100644 (file)
     <path project="openSUSE:Leap:42.2:Update" repository="standard"/>
     <arch>x86_64</arch>
   </repository>
+  <repository name="openSUSE_Leap_15.1">
+    <path project="openSUSE:Leap:15.1" repository="standard"/>
+    <arch>x86_64</arch>
+  </repository>
+  <repository name="openSUSE_Leap_15.0">
+    <path project="openSUSE:Leap:15.0" repository="standard"/>
+    <arch>x86_64</arch>
+  </repository>
   <repository name="RHEL_7">
     <path project="Fedora:EPEL:7" repository="RHEL"/>
     <arch>x86_64</arch>
index 5b67d7a..cd772c8 100644 (file)
@@ -1019,6 +1019,51 @@ install_initd_centos install-initd-centos:
                   -d /var/run/$(NAME) $(NAME)
        chown $(NAME):$(NAME) /var/run/$(NAME)
 
+.PHONY: install_systemd_debian install-systemd-debian
+install_systemd_debian install-systemd-debian:
+       sed -e "s#ExecStart=/usr/sbin/kamailio#ExecStart=$(bin_prefix)/$(bin_dir)$(NAME)#g" \
+               -e "s#Description=Kamailio#Description=$(NAME)#g" \
+               -e "s#/var/run/kamailio/kamailio.pid#/var/run/$(NAME)/$(NAME).pid#g" \
+               -e "s#EnvironmentFile=-/etc/default/kamailio#EnvironmentFile=-/etc/default/$(NAME)#g" \
+               -e "s#CFGFILE=/etc/kamailio/kamailio.cfg#CFGFILE=$(cfg_prefix)/$(cfg_dir)$(NAME).cfg#g" \
+               < ../pkg/kamailio/deb/debian/kamailio.service \
+               > /etc/systemd/system/$(NAME).service
+       sed -e "s#RUN_KAMAILIO=no#RUN_KAMAILIO=yes#g" \
+               < ../pkg/kamailio/deb/debian/kamailio.default \
+               > /etc/default/$(NAME)
+       mkdir -p /var/run/$(NAME)
+       adduser --quiet --system --group --disabled-password \
+        --shell /bin/false --gecos "$(NAME)" \
+        --home /var/run/$(NAME) $(NAME)
+       chown $(NAME):$(NAME) /var/run/$(NAME)
+       echo "D /run/$(NAME) 0700 $(NAME) $(NAME) -" > /etc/tmpfiles.d/$(NAME).conf
+       @echo
+       @echo "* to enable kamailio service run:"
+       @echo "    systemctl enable kamailio"
+       @echo "    systemctl daemon-reload"
+.PHONY: install_systemd_centos install-systemd-centos
+install_systemd_centos install-systemd-centos:
+       sed -e "s#ExecStart=/usr/sbin/kamailio#ExecStart=$(bin_prefix)/$(bin_dir)$(NAME)#g" \
+               -e "s#Description=Kamailio#Description=$(NAME)#g" \
+               -e "s#/var/run/kamailio/kamailio.pid#/var/run/$(NAME)/$(NAME).pid#g" \
+               -e "s#EnvironmentFile=-/etc/sysconfig/kamailio#EnvironmentFile=-/etc/sysconfig/$(NAME)#g" \
+               -e "s#CFGFILE=/etc/kamailio/kamailio.cfg#CFGFILE=$(cfg_prefix)/$(cfg_dir)$(NAME).cfg#g" \
+               < ../pkg/kamailio/obs/kamailio.service \
+               > /etc/systemd/system/$(NAME).service
+       cp ../pkg/kamailio/obs/kamailio.sysconfig \
+               /etc/sysconfig/$(NAME)
+       mkdir -p /var/run/$(NAME)
+       chmod 0700 /var/run/$(NAME)
+       groupadd --system $(NAME)
+       useradd $(NAME) --system --shell /sbin/nologin -g $(NAME) --home /var/run/$(NAME)
+       chown $(NAME):$(NAME) /var/run/$(NAME)
+       echo "D /run/$(NAME) 0700 $(NAME) $(NAME) -" > /etc/tmpfiles.d/$(NAME).conf
+       @echo
+       @echo "* to enable kamailio service run:"
+       @echo "    systemctl daemon-reload"
+       @echo "    systemctl enable kamailio"
+       @echo "    systemctl start kamailio"
+
 .PHONY: dbschema
 dbschema:
        -@echo "Build database schemas"
index 4ea0903..3d66d83 100644 (file)
@@ -107,7 +107,7 @@ INSTALL_FLAVOUR=$(FLAVOUR)
 VERSION = 5
 PATCHLEVEL = 3
 SUBLEVEL =  0
-EXTRAVERSION = -dev2
+EXTRAVERSION = -dev6
 
 # memory manager switcher
 # 0 - f_malloc (fast malloc)
@@ -255,8 +255,10 @@ ifneq (,$(findstring gcc, $(CC_LONGVER)))
                                        -e 's/7\.[0-9]\..*/7.0+/' \
                                        -e 's/7\.[0-9]$$/7.0+/' \
                                        -e 's/8\.[0-9]\..*/8.0+/' \
-                                       -e 's/8\.[0-9]$$/8.0+/')
-ifeq (,$(strip $(filter-out 3.0 3.4 4.x 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+,$(CC_SHORTVER))))
+                                       -e 's/8\.[0-9]$$/8.0+/' \
+                                       -e 's/9\.[0-9]\..*/9.0+/' \
+                                       -e 's/9\.[0-9]$$/9.0+/')
+ifeq (,$(strip $(filter-out 3.0 3.4 4.x 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
        # dependencies can be generated on-the-fly while compiling *.c
        CC_MKDEP_OPTS=-MMD -MP
 endif # 3.0 <= $(CC_SHORTVER) <= 4.x
@@ -321,7 +323,8 @@ ppc64_macros= __ppc64__ _ARCH_PPC64
 
 mips_macros= __mips__ __mips _MIPS_ARCH_MIPS1
 mips2_macros= _MIPS_ISA_MIPS2 _MIPS_ISA_MIPS3 _MIPS_ISA_MIPS4 \
-                       _MIPS_ARCH_MIPS2 _MIPS_ARCH_MIPS3 _MIPS_ARCH_MIPS4
+                       _MIPS_ARCH_MIPS2 _MIPS_ARCH_MIPS3 _MIPS_ARCH_MIPS4 \
+                       _MIPS_ISA_MIPS32
 mips64_macros= _MIPS_ISA_MIPS64 _MIPS_ARCH_MIPS64
 
 alpha_macros= __alpha__ __alpha _M_ALPHA_
@@ -875,8 +878,8 @@ ifeq                ($(CC_NAME), gcc)
                                C_DEFS+=-DCC_GCC_LIKE_ASM
                                #common stuff
                                CFLAGS=-g $(CC_OPT) -funroll-loops  -Wcast-align $(PROFILE)
-                       #if gcc 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
-ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+,$(CC_SHORTVER))))
+                       #if gcc 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
 $(call                         set_if_empty,CPUTYPE,generic)
                                        CFLAGS+=-m32 -minline-all-stringops \
                                                        -falign-loops \
@@ -925,7 +928,7 @@ endif                       # CC_SHORTVER, 2.9x
 endif                  # CC_SHORTVER, 3.0
 endif                  # CC_SHORTVER, 3.4
 endif                  # CC_SHORTVER, 4.x
-endif                  # CC_SHORTVER, 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
+endif                  # CC_SHORTVER, 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
 
 else           # CC_NAME, gcc
 ifeq           ($(CC_NAME), clang)
@@ -958,7 +961,7 @@ ifeq                ($(CC_NAME), gcc)
                                #common stuff
                                CFLAGS=-g $(CC_OPT) -funroll-loops  -Wcast-align $(PROFILE)
                        #if gcc 4.5+
-ifeq                   ($(CC_SHORTVER),$(filter $(CC_SHORTVER),4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+))
+ifeq                   ($(CC_SHORTVER),$(filter $(CC_SHORTVER),4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+))
 $(call                         set_if_empty,CPUTYPE,generic)
                                        CFLAGS+=-m64 -minline-all-stringops \
                                                        -falign-loops \
@@ -1007,7 +1010,7 @@ endif                     # CC_SHORTVER, 2.9x
 endif                  # CC_SHORTVER, 3.0
 endif                  # CC_SHORTVER, 3.4
 endif                  # CC_SHORTVER, 4.x
-endif                  # CC_SHORTVER, 8.0+, 7.0+, 6.0+, 5.0+, 4.5+
+endif                  # CC_SHORTVER, 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+
 
 else           # CC_NAME, gcc
 ifeq            ($(CC_NAME), clang)
@@ -1042,8 +1045,8 @@ ifeq              ($(CC_NAME), gcc)
                                CFLAGS=-g $(CC_OPT) -funroll-loops  $(PROFILE) \
                                        #-Wcast-align \
                                        #-Wmissing-prototypes
-                               #if gcc 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
-ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+,$(CC_SHORTVER))))
+                               #if gcc 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
 $(call                         set_if_empty,CPUTYPE,ultrasparc)
                                        #use 32bit for now
                                        CFLAGS+=-m64 -mcpu=ultrasparc  \
@@ -1109,7 +1112,7 @@ endif                     #CC_SHORTVER, 2.9x
 endif                  #CC_SHORTVER, 3.0
 endif                  #CC_SHORTVER, 3.4
 endif                  #CC_SHORTVER, 4.x
-endif                  #CC_SHORTVER, 8.0+ 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
+endif                  #CC_SHORTVER, 9.0+ 8.0+ 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
 
 else           #CC_NAME, gcc
 ifeq           ($(CC_NAME), suncc)
@@ -1137,7 +1140,7 @@ ifeq              ($(CC_NAME), gcc)
                                        #-Wcast-align \
                                        #-Wmissing-prototypes
                                #if gcc 5.0+, 4.5+ or 4.2+
-ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+,$(CC_SHORTVER))))
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
 $(call                         set_if_empty,CPUTYPE,v8)
                                        #use 32bit for now
                                        CFLAGS+= -mtune=$(CPUTYPE) \
@@ -1178,7 +1181,7 @@ endif                     #CC_SHORTVER, 2.9x
 endif                  #CC_SHORTVER, 3.0
 endif                  #CC_SHORTVER, 3.4
 endif                  #CC_SHORTVER, 4.x
-endif                  #CC_SHORTVER, 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
+endif                  #CC_SHORTVER, 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
 
 else           #CC_NAME, gcc
 ifeq           ($(CC_NAME), suncc)
@@ -1202,7 +1205,7 @@ ifeq              ($(CC_NAME), gcc)
                                #common stuff
                                CFLAGS=-marm -march=armv5t $(CC_OPT) -funroll-loops -fsigned-char $(PROFILE)
                        #if gcc 4.5+ or 4.2+
-ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+,$(CC_SHORTVER))))
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
                                        CFLAGS+= -ftree-vectorize -fno-strict-overflow
                                        # not supported on arm: -minline-all-stringops
 else
@@ -1234,7 +1237,7 @@ endif                     # CC_SHORTVER, 2.9x
 endif                  # CC_SHORTVER, 3.0
 endif                  # CC_SHORTVER, 3.4
 endif                  # CC_SHORTVER, 4.x
-endif                  # CC_SHORTVER, 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
+endif                  # CC_SHORTVER, 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
 
 else           # CC_NAME, gcc
                                #other compilers
@@ -1251,7 +1254,7 @@ ifeq              ($(CC_NAME), gcc)
                                CFLAGS=-march=armv6 $(CC_OPT) -funroll-loops -fsigned-char \
                                                $(PROFILE)
                        #if gcc 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
-ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+,$(CC_SHORTVER))))
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
                                        CFLAGS+= -ftree-vectorize -fno-strict-overflow
 else
                        #if gcc 4.x+
@@ -1281,7 +1284,7 @@ endif                     # CC_SHORTVER, 2.9x
 endif                  # CC_SHORTVER, 3.0
 endif                  # CC_SHORTVER, 3.4
 endif                  # CC_SHORTVER, 4.x
-endif                  # CC_SHORTVER, 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
+endif                  # CC_SHORTVER, 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
 
 else           # CC_NAME, gcc
                                #other compilers
@@ -1296,8 +1299,8 @@ ifeq              ($(CC_NAME), gcc)
                                C_DEFS+=-DCC_GCC_LIKE_ASM
                                #common stuff
                                CFLAGS=$(CC_OPT) -funroll-loops  $(PROFILE)
-                       #if gcc 8.0+, 7.0+, 6.0, 5.0+, 4.5+ or 4.2+
-ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+,$(CC_SHORTVER))))
+                       #if gcc 9.0+ 8.0+, 7.0+, 6.0, 5.0+, 4.5+ or 4.2+
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
                                        CFLAGS+=-mfp32 -march=r3000 \
                                                        -ftree-vectorize -fno-strict-overflow
                        # not supported on mips: -minline-all-stringops
@@ -1330,7 +1333,7 @@ endif                     # CC_SHORTVER, 2.9x
 endif                  # CC_SHORTVER, 3.0
 endif                  # CC_SHORTVER, 3.4
 endif                  # CC_SHORTVER, 4.x
-endif                  # CC_SHORTVER, 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
+endif                  # CC_SHORTVER, 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
 
 else           # CC_NAME, gcc
                                #other compilers
@@ -1344,9 +1347,9 @@ ifeq      ($(ARCH), mips2)
 ifeq           ($(CC_NAME), gcc)
                                C_DEFS+=-DCC_GCC_LIKE_ASM
                                #common stuff
-                               CFLAGS= -mips2 $(CC_OPT) -funroll-loops $(PROFILE)
-                       #if gcc 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
-ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+,$(CC_SHORTVER))))
+                               CFLAGS= $(CC_OPT) -funroll-loops $(PROFILE)
+                       #if gcc 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
                                        CFLAGS+=-ftree-vectorize -fno-strict-overflow
                        # not supported on mips: -minline-all-stringops
 else
@@ -1376,7 +1379,7 @@ endif                     # CC_SHORTVER, 2.9x
 endif                  # CC_SHORTVER, 3.0
 endif                  # CC_SHORTVER, 3.4
 endif                  # CC_SHORTVER, 4.x
-endif                  # CC_SHORTVER, 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
+endif                  # CC_SHORTVER, 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
 
 else           # CC_NAME, gcc
                                #other compilers
@@ -1390,9 +1393,9 @@ ifeq      ($(ARCH), mips64)
 ifeq           ($(CC_NAME), gcc)
                                C_DEFS+=-DCC_GCC_LIKE_ASM
                                #common stuff
-                               CFLAGS= -mips64 $(CC_OPT) -funroll-loops $(PROFILE)
-                       #if gcc 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
-ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+,$(CC_SHORTVER))))
+                               CFLAGS= $(CC_OPT) -funroll-loops $(PROFILE)
+                       #if gcc 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
                                        CFLAGS+=-ftree-vectorize -fno-strict-overflow
                        # not supported on mips: -minline-all-stringops
 
@@ -1423,7 +1426,7 @@ endif                     # CC_SHORTVER, 2.9x
 endif                  # CC_SHORTVER, 3.0
 endif                  # CC_SHORTVER, 3.4
 endif                  # CC_SHORTVER, 4.x
-endif                  # CC_SHORTVER, 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
+endif                  # CC_SHORTVER, 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
 
 else           # CC_NAME, gcc
                                #other compilers
@@ -1439,7 +1442,7 @@ ifeq              ($(CC_NAME), gcc)
                                #common stuff
                                CFLAGS= $(CC_OPT) -funroll-loops $(PROFILE)
                        #if gcc 5.0+, 4.5 or 4.2+
-ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+,$(CC_SHORTVER))))
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
                                        CFLAGS+= -fno-strict-overflow
                                        # not supported: -minline-all-stringops
 else
@@ -1469,7 +1472,7 @@ endif                     # CC_SHORTVER, 2.9x
 endif                  # CC_SHORTVER, 3.0
 endif                  # CC_SHORTVER, 3.4
 endif                  # CC_SHORTVER, 4.x
-endif                  # CC_SHORTVER, 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
+endif                  # CC_SHORTVER, 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
 
 else           # CC_NAME, gcc
                                #other compilers
@@ -1484,8 +1487,8 @@ ifeq              ($(CC_NAME), gcc)
                                C_DEFS+=-DCC_GCC_LIKE_ASM
                                #common stuff
                                CFLAGS=
-                       #if gcc 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
-ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+,$(CC_SHORTVER))))
+                       #if gcc 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
 $(call                         set_if_empty,CPUTYPE,powerpc)
 ifeq                           ($(NOALTIVEC),)
                                                CFLAGS += $(CC_OPT) -funroll-loops -fsigned-char $(PROFILE)
@@ -1526,7 +1529,7 @@ endif                     # CC_SHORTVER, 2.9x
 endif                  # CC_SHORTVER, 3.0
 endif                  # CC_SHORTVER, 3.4
 endif                  # CC_SHORTVER, 4.x
-endif                  # CC_SHORTVER, 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
+endif                  # CC_SHORTVER, 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
 
 else           # CC_NAME, gcc
                                #other compilers
@@ -1541,8 +1544,8 @@ ifeq              ($(CC_NAME), gcc)
                                C_DEFS+=-DCC_GCC_LIKE_ASM
                                #common stuff
                                CFLAGS= $(CC_OPT) -funroll-loops -fsigned-char $(PROFILE)
-                       #if gcc 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
-ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+,$(CC_SHORTVER))))
+                       #if gcc 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+ 7.0+ 8.0+ 9.0+,$(CC_SHORTVER))))
 $(call                         set_if_empty,CPUTYPE,powerpc64)
                                        CFLAGS+=-ftree-vectorize \
                                                        -fno-strict-overflow \
@@ -1575,7 +1578,7 @@ endif                     # CC_SHORTVER, 2.9x
 endif                  # CC_SHORTVER, 3.0
 endif                  # CC_SHORTVER, 3.4
 endif                  # CC_SHORTVER, 4.x
-endif                  # CC_SHORTVER, 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
+endif                  # CC_SHORTVER, 9.0+ 8.0+, 7.0+, 6.0+, 5.0+, 4.5+ or 4.2+
 
 else           # CC_NAME, gcc
                                #other compilers
index 90f62e0..4d6236b 100644 (file)
@@ -22,7 +22,7 @@ mod_list_extra=avp auth_diameter call_control call_obj dmq domainpolicy msrp \
                        carrierroute pdb qos sca seas sms sst timer tmrec uac_redirect \
                        xhttp xhttp_rpc xprint jsonrpcs nosip dmq_usrloc statsd rtjson \
                        log_custom keepalive ss7ops app_sqlang acc_diameter evrexec \
-                       sipjson
+                       sipjson xhttp_prom
 
 # - common modules depending on database
 mod_list_db=acc alias_db auth_db avpops cfg_db db_text db_flatstore \
@@ -115,7 +115,7 @@ mod_list_presence=presence presence_conference presence_dialoginfo \
 
 
 # - modules depending on lua library
-mod_list_lua=app_lua
+mod_list_lua=app_lua app_lua_sr
 
 # - modules depending on perl library
 mod_list_perldeps=app_perl db_perlvdb
index ca55861..45581ba 100644 (file)
@@ -1434,6 +1434,9 @@ match_cleanup:
                                ret=E_BUG;
                                goto error;
                        }
+                       LM_DBG("setting send-socket to [%.*s]\n",
+                                       ((struct socket_info*)a->val[0].u.data)->sock_str.len,
+                                       ((struct socket_info*)a->val[0].u.data)->sock_str.s);
                        set_force_socket(msg, (struct socket_info*)a->val[0].u.data);
                        ret=1; /* continue processing */
                        break;
@@ -1527,7 +1530,9 @@ int run_actions(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
 {
        struct action* t;
        int ret;
-       unsigned int ms = 0;
+       struct timeval tvb = {0}, tve = {0};
+       struct timezone tz;
+       unsigned int tdiff;
 
        ret=E_UNSPEC;
        h->rec_lev++;
@@ -1555,8 +1560,11 @@ int run_actions(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
        }
 
        for (t=a; t!=0; t=t->next){
-               if(unlikely(cfg_get(core, core_cfg, latency_limit_action)>0))
-                       ms = TICKS_TO_MS(get_ticks_raw());
+
+               if(unlikely(cfg_get(core, core_cfg, latency_limit_action)>0)
+                               && is_printable(cfg_get(core, core_cfg, latency_log))) {
+                       gettimeofday(&tvb, &tz);
+               }
                _cfg_crt_action = t;
                if(unlikely(log_prefix_mode==1)) {
                        log_prefix_set(msg);
@@ -1566,16 +1574,19 @@ int run_actions(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
                if(unlikely(log_prefix_mode==1)) {
                        log_prefix_set(msg);
                }
-               if(unlikely(cfg_get(core, core_cfg, latency_limit_action)>0)) {
-                       ms = TICKS_TO_MS(get_ticks_raw()) - ms;
-                       if(ms >= cfg_get(core, core_cfg, latency_limit_action)) {
+               if(unlikely(cfg_get(core, core_cfg, latency_limit_action)>0)
+                               && is_printable(cfg_get(core, core_cfg, latency_log))) {
+                       gettimeofday(&tve, &tz);
+                       tdiff = (tve.tv_sec - tvb.tv_sec) * 1000000
+                                          + (tve.tv_usec - tvb.tv_usec);
+                       if(tdiff >= cfg_get(core, core_cfg, latency_limit_action)) {
                                LOG(cfg_get(core, core_cfg, latency_log),
                                                "alert - action [%s (%d)]"
-                                               " cfg [%s:%d] took too long [%u ms]\n",
+                                               " cfg [%s:%d] took too long [%u us]\n",
                                                is_mod_func(t) ?
                                                        ((cmd_export_t*)(t->val[0].u.data))->name
                                                        : "corefunc",
-                                               t->type, (t->cfile)?t->cfile:"", t->cline, ms);
+                                               t->type, (t->cfile)?t->cfile:"", t->cline, tdiff);
                        }
                }
                /* break, return or drop/exit stop execution of the current
@@ -1685,7 +1696,7 @@ int run_child_one_init_route(void)
                } else {
                        bctx = sr_kemi_act_ctx_get();
                        sr_kemi_act_ctx_set(&ctx);
-                       if(keng->froute(fmsg, EVENT_ROUTE,
+                       if(sr_kemi_route(keng, fmsg, EVENT_ROUTE,
                                                &kemi_event_route_callback, &evname)<0) {
                                LM_ERR("error running event route kemi callback\n");
                                return -1;
index d3e0e34..592ea0c 100644 (file)
@@ -336,7 +336,7 @@ char* b58_decode(char *outb, int *outbszp, char *b58, int b58sz)
        }
        *outbszp += zerocount;
 
-       return outb + outbsz - (*outbszp);
+       return outb + i;
 }
 
 /**
index 6e4d697..dd1b935 100644 (file)
                struct sr_yy_fname *next;
        } *sr_yy_fname_list = 0;
 
-       static str  *pp_define_get(int len, const char * text);
+       str  *pp_define_get(int len, const char * text);
        static int  pp_ifdef_type(int pos);
        static void pp_ifdef_var(int len, const char * text);
        static void pp_ifdef();
@@ -309,6 +309,7 @@ DNS_TCP_PREF        dns_tcp_pref|dns_tcp_preference
 DNS_TLS_PREF   dns_tls_pref|dns_tls_preference
 DNS_SCTP_PREF  dns_sctp_pref|dns_sctp_preference
 DNS_RETR_TIME  dns_retr_time
+DNS_SLOW_QUERY_MS      dns_slow_query_ms
 DNS_RETR_NO            dns_retr_no
 DNS_SERVERS_NO dns_servers_no
 DNS_USE_SEARCH dns_use_search_list
@@ -328,6 +329,7 @@ DNS_CACHE_DEL_NONEXP        dns_cache_del_nonexp|dns_cache_delete_nonexpired
 DNS_CACHE_REC_PREF     dns_cache_rec_pref
 /* ipv6 auto bind */
 AUTO_BIND_IPV6         auto_bind_ipv6
+BIND_IPV6_LINK_LOCAL   bind_ipv6_link_local
 /* blacklist */
 DST_BLST_INIT  dst_blacklist_init
 USE_DST_BLST           use_dst_blacklist
@@ -454,6 +456,8 @@ KEMI     "kemi"
 ONSEND_ROUTE_CALLBACK  "onsend_route_callback"
 REPLY_ROUTE_CALLBACK   "reply_route_callback"
 EVENT_ROUTE_CALLBACK   "event_route_callback"
+RECEIVED_ROUTE_CALLBACK        "received_route_callback"
+RECEIVED_ROUTE_MODE            "received_route_mode"
 
 MAX_RECURSIVE_LEVEL            "max_recursive_level"
 MAX_BRANCHES_PARAM             "max_branches"
@@ -462,6 +466,7 @@ LATENCY_CFG_LOG                     latency_cfg_log
 LATENCY_LOG                            latency_log
 LATENCY_LIMIT_DB               latency_limit_db
 LATENCY_LIMIT_ACTION   latency_limit_action
+LATENCY_LIMIT_CFG              latency_limit_cfg
 
 MSG_TIME       msg_time
 ONSEND_RT_REPLY                "onsend_route_reply"
@@ -723,6 +728,8 @@ IMPORTFILE      "import_file"
                                                                return DNS_SCTP_PREF; }
 <INITIAL>{DNS_RETR_TIME}       { count(); yylval.strval=yytext;
                                                                return DNS_RETR_TIME; }
+<INITIAL>{DNS_SLOW_QUERY_MS}   { count(); yylval.strval=yytext;
+                                                               return DNS_SLOW_QUERY_MS; }
 <INITIAL>{DNS_RETR_NO} { count(); yylval.strval=yytext;
                                                                return DNS_RETR_NO; }
 <INITIAL>{DNS_SERVERS_NO}      { count(); yylval.strval=yytext;
@@ -757,6 +764,8 @@ IMPORTFILE      "import_file"
                                                                return DNS_CACHE_REC_PREF; }
 <INITIAL>{AUTO_BIND_IPV6}      { count(); yylval.strval=yytext;
                                                                return AUTO_BIND_IPV6; }
+<INITIAL>{BIND_IPV6_LINK_LOCAL}        { count(); yylval.strval=yytext;
+                                                               return BIND_IPV6_LINK_LOCAL; }
 <INITIAL>{DST_BLST_INIT}       { count(); yylval.strval=yytext;
                                                                return DST_BLST_INIT; }
 <INITIAL>{USE_DST_BLST}        { count(); yylval.strval=yytext;
@@ -949,6 +958,8 @@ IMPORTFILE      "import_file"
 <INITIAL>{REPLY_ROUTE_CALLBACK}  { count(); yylval.strval=yytext; return REPLY_ROUTE_CALLBACK;}
 <INITIAL>{ONSEND_ROUTE_CALLBACK}  { count(); yylval.strval=yytext; return ONSEND_ROUTE_CALLBACK;}
 <INITIAL>{EVENT_ROUTE_CALLBACK}  { count(); yylval.strval=yytext; return EVENT_ROUTE_CALLBACK;}
+<INITIAL>{RECEIVED_ROUTE_CALLBACK}  { count(); yylval.strval=yytext; return RECEIVED_ROUTE_CALLBACK;}
+<INITIAL>{RECEIVED_ROUTE_MODE}  { count(); yylval.strval=yytext; return RECEIVED_ROUTE_MODE;}
 <INITIAL>{MAX_RECURSIVE_LEVEL}  { count(); yylval.strval=yytext; return MAX_RECURSIVE_LEVEL;}
 <INITIAL>{MAX_BRANCHES_PARAM}  { count(); yylval.strval=yytext; return MAX_BRANCHES_PARAM;}
 <INITIAL>{LATENCY_LOG}  { count(); yylval.strval=yytext; return LATENCY_LOG;}
@@ -957,6 +968,7 @@ IMPORTFILE      "import_file"
 <INITIAL>{ONSEND_RT_REPLY}     { count(); yylval.strval=yytext; return ONSEND_RT_REPLY; }
 <INITIAL>{LATENCY_LIMIT_DB}  { count(); yylval.strval=yytext; return LATENCY_LIMIT_DB;}
 <INITIAL>{LATENCY_LIMIT_ACTION}  { count(); yylval.strval=yytext; return LATENCY_LIMIT_ACTION;}
+<INITIAL>{LATENCY_LIMIT_CFG}  { count(); yylval.strval=yytext; return LATENCY_LIMIT_CFG;}
 <INITIAL>{CFG_DESCRIPTION}     { count(); yylval.strval=yytext; return CFG_DESCRIPTION; }
 <INITIAL>{LOADMODULE}  { count(); yylval.strval=yytext; return LOADMODULE; }
 <INITIAL>{LOADPATH}            { count(); yylval.strval=yytext; return LOADPATH; }
@@ -1709,7 +1721,7 @@ static int sr_pop_yy_state()
 
 /* define/ifdef support */
 
-#define MAX_DEFINES    256
+#define MAX_DEFINES    512
 static ksr_ppdefine_t pp_defines[MAX_DEFINES];
 static int pp_num_defines = 0;
 static int pp_define_type = 0;
@@ -1719,7 +1731,7 @@ static int pp_define_index = -1;
  * ifdef(defined), ifndef(undefined), or the opposite of these
  * two, but in an else branch
  */
-#define MAX_IFDEFS    256
+#define MAX_IFDEFS    512
 static int pp_ifdef_stack[MAX_IFDEFS];
 static int pp_sptr = 0; /* stack pointer */
 
@@ -1856,7 +1868,7 @@ int pp_define_set(int len, char *text)
        return 0;
 }
 
-static str *pp_define_get(int len, const char * text)
+str *pp_define_get(int len, const char * text)
 {
        str var = {(char *)text, len};
        int i;
index df187db..4c7dcd1 100644 (file)
@@ -337,6 +337,7 @@ extern char *default_routename;
 %token DNS_TLS_PREF
 %token DNS_SCTP_PREF
 %token DNS_RETR_TIME
+%token DNS_SLOW_QUERY_MS
 %token DNS_RETR_NO
 %token DNS_SERVERS_NO
 %token DNS_USE_SEARCH
@@ -356,6 +357,7 @@ extern char *default_routename;
 
 /* ipv6 auto bind */
 %token AUTO_BIND_IPV6
+%token BIND_IPV6_LINK_LOCAL
 
 /*blacklist*/
 %token DST_BLST_INIT
@@ -488,12 +490,15 @@ extern char *default_routename;
 %token ONSEND_ROUTE_CALLBACK
 %token REPLY_ROUTE_CALLBACK
 %token EVENT_ROUTE_CALLBACK
+%token RECEIVED_ROUTE_CALLBACK
+%token RECEIVED_ROUTE_MODE
 %token MAX_RECURSIVE_LEVEL
 %token MAX_BRANCHES_PARAM
 %token LATENCY_CFG_LOG
 %token LATENCY_LOG
 %token LATENCY_LIMIT_DB
 %token LATENCY_LIMIT_ACTION
+%token LATENCY_LIMIT_CFG
 %token MSG_TIME
 %token ONSEND_RT_REPLY
 
@@ -827,6 +832,8 @@ assign_stm:
        | DNS_SCTP_PREF error { yyerror("number expected"); }
        | DNS_RETR_TIME EQUAL NUMBER   { default_core_cfg.dns_retr_time=$3; }
        | DNS_RETR_TIME error { yyerror("number expected"); }
+       | DNS_SLOW_QUERY_MS EQUAL NUMBER   { default_core_cfg.dns_slow_query_ms=$3; }
+       | DNS_SLOW_QUERY_MS error { yyerror("number expected"); }
        | DNS_RETR_NO EQUAL NUMBER   { default_core_cfg.dns_retr_no=$3; }
        | DNS_RETR_NO error { yyerror("number expected"); }
        | DNS_SERVERS_NO EQUAL NUMBER   { default_core_cfg.dns_servers_no=$3; }
@@ -861,6 +868,8 @@ assign_stm:
        | DNS_CACHE_REC_PREF error { yyerror("boolean value expected"); }
        | AUTO_BIND_IPV6 EQUAL NUMBER {IF_AUTO_BIND_IPV6(auto_bind_ipv6 = $3);}
        | AUTO_BIND_IPV6 error { yyerror("boolean value expected"); }
+       | BIND_IPV6_LINK_LOCAL EQUAL NUMBER {sr_bind_ipv6_link_local = $3;}
+       | BIND_IPV6_LINK_LOCAL error { yyerror("boolean value expected"); }
        | DST_BLST_INIT EQUAL NUMBER   { IF_DST_BLACKLIST(dst_blacklist_init=$3); }
        | DST_BLST_INIT error { yyerror("boolean value expected"); }
        | USE_DST_BLST EQUAL NUMBER {
@@ -1442,6 +1451,19 @@ assign_stm:
                }
                free_socket_id_lst($3);
        }
+       | LISTEN EQUAL id_lst ADVERTISE listen_id {
+               for(lst_tmp=$3; lst_tmp; lst_tmp=lst_tmp->next) {
+                       if (add_listen_advertise_iface( lst_tmp->addr_lst->name,
+                                                                       lst_tmp->addr_lst->next,
+                                                                       lst_tmp->port, lst_tmp->proto,
+                                                                       $5, 0,
+                                                                       lst_tmp->flags)!=0) {
+                               LM_CRIT("cfg. parser: failed to add listen address\n");
+                               break;
+                       }
+               }
+               free_socket_id_lst($3);
+       }
        | LISTEN EQUAL  error { yyerror("ip address, interface name or"
                                                                        " hostname expected"); }
        | ALIAS EQUAL  id_lst {
@@ -1624,6 +1646,18 @@ assign_stm:
                        }
                }
        | KEMI DOT EVENT_ROUTE_CALLBACK EQUAL error { yyerror("string expected"); }
+       | KEMI DOT RECEIVED_ROUTE_CALLBACK EQUAL STRING {
+                       kemi_received_route_callback.s = $5;
+                       kemi_received_route_callback.len = strlen($5);
+                       if(kemi_received_route_callback.len==4
+                                       && strcasecmp(kemi_received_route_callback.s, "none")==0) {
+                               kemi_received_route_callback.s = "";
+                               kemi_received_route_callback.len = 0;
+                       }
+               }
+       | KEMI DOT RECEIVED_ROUTE_CALLBACK EQUAL error { yyerror("string expected"); }
+    | RECEIVED_ROUTE_MODE EQUAL intno { ksr_evrt_received_mode=$3; }
+       | RECEIVED_ROUTE_MODE EQUAL error  { yyerror("number  expected"); }
     | MAX_RECURSIVE_LEVEL EQUAL NUMBER { set_max_recursive_level($3); }
     | MAX_BRANCHES_PARAM EQUAL NUMBER { sr_dst_max_branches = $3; }
     | LATENCY_LOG EQUAL intno { default_core_cfg.latency_log=$3; }
@@ -1634,6 +1668,8 @@ assign_stm:
        | LATENCY_LIMIT_DB EQUAL error  { yyerror("number  expected"); }
     | LATENCY_LIMIT_ACTION EQUAL NUMBER { default_core_cfg.latency_limit_action=$3; }
        | LATENCY_LIMIT_ACTION EQUAL error  { yyerror("number  expected"); }
+    | LATENCY_LIMIT_CFG EQUAL NUMBER { default_core_cfg.latency_limit_cfg=$3; }
+       | LATENCY_LIMIT_CFG EQUAL error  { yyerror("number  expected"); }
     | MSG_TIME EQUAL NUMBER { sr_msg_time=$3; }
        | MSG_TIME EQUAL error  { yyerror("number  expected"); }
        | ONSEND_RT_REPLY EQUAL NUMBER { onsend_route_reply=$3; }
index d8e3fdd..d0b409f 100644 (file)
@@ -78,6 +78,7 @@ struct cfg_group_core default_core_cfg = {
        10,  /*!< tls transport preference (for naptr) */
        20,  /*!< sctp transport preference (for naptr) */
        -1, /*!< dns_retr_time */
+       0,  /*!< dns_slow_query_ms */
        -1, /*!< dns_retr_no */
        -1, /*!< dns_servers_no */
        1,  /*!< dns_search_list */
@@ -119,6 +120,7 @@ struct cfg_group_core default_core_cfg = {
        L_ERR, /*!< latency log */
        0, /*!< latency limit db */
        0, /*!< latency limit action */
+       0, /*!< latency limit cfg */
        2048,  /*!< pv_cache_limit */
        0  /*!< pv_cache_action */
 };
@@ -224,6 +226,8 @@ cfg_def_t core_cfg_def[] = {
                "sctp protocol preference when doing NAPTR lookups"},
        {"dns_retr_time",       CFG_VAR_INT,    0, 0, 0, resolv_reinit,
                "time in s before retrying a dns request"},
+       {"dns_slow_query_ms",   CFG_VAR_INT,    0, 0, 0, resolv_reinit,
+               "max time in ms before a dns request is considered slow"},
        {"dns_retr_no",         CFG_VAR_INT,    0, 0, 0, resolv_reinit,
                "number of dns retransmissions before giving up"},
        {"dns_servers_no",      CFG_VAR_INT,    0, 0, 0, resolv_reinit,
@@ -324,6 +328,8 @@ cfg_def_t core_cfg_def[] = {
                "limit in ms for alerting on time consuming db commands"},
        {"latency_limit_action",                CFG_VAR_INT|CFG_ATOMIC, 0, 0, 0, 0,
                "limit in ms for alerting on time consuming config actions"},
+       {"latency_limit_cfg",           CFG_VAR_INT|CFG_ATOMIC, 0, 0, 0, 0,
+               "limit in ms for alerting on time consuming config execution"},
        {"pv_cache_limit",              CFG_VAR_INT|CFG_ATOMIC, 0, 0, 0, 0,
                "limit to alert if too many vars in pv cache"},
        {"pv_cache_action",             CFG_VAR_INT|CFG_ATOMIC, 0, 0, 0, 0,
index f11f803..e44d596 100644 (file)
@@ -67,6 +67,7 @@ struct cfg_group_core {
        int dns_tls_pref;
        int dns_sctp_pref;
        int dns_retr_time;
+       int dns_slow_query_ms;
        int dns_retr_no;
        int dns_servers_no;
        int dns_search_list;
@@ -107,6 +108,7 @@ struct cfg_group_core {
        int latency_log; /*!< log level for latency limits messages */
        int latency_limit_db; /*!< alert limit of running db commands */
        int latency_limit_action; /*!< alert limit of running cfg actions */
+       int latency_limit_cfg; /*!< alert limit of running cfg routing script */
        int pv_cache_limit; /*!< alert limit of having too many vars in pv cache */
        int pv_cache_action; /*!< action to be taken on pv cache limit */
 };
index bdc7657..a891328 100644 (file)
 
 #define MAX_PRINT_TEXT                 256     /*!< max length of the text of fifo 'print' command */
 
-#define MAX_REDIRECTION_LEN    512     /*!< maximum length of Contact header field in redirection replies */
+#define MAX_REDIRECTION_LEN    4096    /*!< maximum length of Contact header field in redirection replies */
 
 /*! \brief used by FIFO statistics in module to terminate line;
    extra whitespaces are used to overwrite remainders of
index ea38e60..5b1c462 100644 (file)
@@ -1090,7 +1090,7 @@ static rpc_export_t core_rpc_methods[] = {
 #endif
        {"core.tcp_info",          core_tcpinfo,           core_tcpinfo_doc,    0},
        {"core.tcp_options",       core_tcp_options,       core_tcp_options_doc,0},
-       {"core.tcp_list",          core_tcp_list,          core_tcp_list_doc,0},
+       {"core.tcp_list",          core_tcp_list,          core_tcp_list_doc, RET_ARRAY},
        {"core.udp4_raw_info",     core_udp4rawinfo,       core_udp4rawinfo_doc,
                0},
        {"core.aliases_list",      core_aliases_list,      core_aliases_list_doc, 0},
index 007c5de..a15f3e3 100644 (file)
@@ -291,14 +291,14 @@ struct lump* del_lump(struct sip_msg* msg, int offset, int len, enum _hdr_types_
 
        /* extra checks */
        if (offset>msg->len){
-               LM_CRIT("offset exceeds message size (%d > %d) aborting...\n",
+               LM_CRIT("offset exceeds message size (%d > %d)\n",
                                        offset, msg->len);
-               abort();
+               return 0;
        }
        if (offset+len>msg->len){
                LM_CRIT("offset + len exceeds message size (%d + %d > %d)\n",
                                        offset, len,  msg->len);
-               abort();
+               return 0;
        }
        if (len==0){
                LM_WARN("0 len (offset=%d)\n", offset);
@@ -348,9 +348,9 @@ struct lump* anchor_lump(struct sip_msg* msg, int offset, int len, enum _hdr_typ
        
        /* extra checks */
        if (offset>msg->len){
-               LM_CRIT("offset exceeds message size (%d > %d) aborting...\n",
+               LM_CRIT("offset exceeds message size (%d > %d)\n",
                                        offset, msg->len);
-               abort();
+               return 0;
        }
        if (len){
                LM_WARN("len !=0 (%d)\n", len);
@@ -408,9 +408,9 @@ struct lump* anchor_lump2(struct sip_msg* msg, int offset, int len, enum _hdr_ty
        
        /* extra checks */
        if (offset>msg->len){
-               LM_CRIT("offset exceeds message size (%d > %d) aborting...\n",
+               LM_CRIT("offset exceeds message size (%d > %d)\n",
                                        offset, msg->len);
-               abort();
+               return 0;
        }
        if (len){
                LM_WARN("len !=0 (%d)\n", len);
index a534366..1803155 100644 (file)
@@ -39,6 +39,7 @@
 #include "dset.h"
 #include "mem/mem.h"
 #include "ip_addr.h"
+#include "strutils.h"
 
 #define CONTACT "Contact: "
 #define CONTACT_LEN (sizeof(CONTACT) - 1)
 #define CONTACT_DELIM ", "
 #define CONTACT_DELIM_LEN (sizeof(CONTACT_DELIM) - 1)
 
-#define Q_PARAM ">;q="
+#define Q_PARAM ";q="
 #define Q_PARAM_LEN (sizeof(Q_PARAM) - 1)
 
+#define ROUTE_PARAM "?Route="
+#define ROUTE_PARAM_LEN (sizeof(ROUTE_PARAM) - 1)
+
+#define FLAGS_PARAM ";flags="
+#define FLAGS_PARAM_LEN (sizeof(FLAGS_PARAM) - 1)
 
 /* 
  * Where we store URIs of additional transaction branches
@@ -466,108 +472,144 @@ int append_branch(struct sip_msg* msg, str* uri, str* dst_uri, str* path,
 }
 
 
-/*
- * Create a Contact header field from the dset
- * array
+/*! \brief
+ * Combines the given elements into a Contact header field
+ * dest = target buffer, will be updated to new position after the printed contact
+ * uri, q = contact elements
+ * end = end of target buffer
+ * Returns 0 on success or -1 on error (buffer is too short)
  */
-char* print_dset(struct sip_msg* msg, int* len) 
+static int print_contact_str(char **dest, str *uri, qvalue_t q, str *path, unsigned int flags, char *end, int options)
 {
-       int cnt, i;
-       unsigned int qlen;
-       qvalue_t q;
-       str uri;
-       char* p, *qbuf;
-       int crt_branch;
-       static char dset[MAX_REDIRECTION_LEN];
+       char *p = *dest;
+       str buf;
 
-       if (msg->new_uri.s) {
-               cnt = 1;
-               *len = msg->new_uri.len + 1 /*'<'*/;
-               if (ruri_q != Q_UNSPECIFIED) {
-                       *len += Q_PARAM_LEN + len_q(ruri_q);
-               } else {
-                       *len += 1 /*'>'*/;
+       /* uri */
+       if (p + uri->len + 2 > end) {
+               return -1;
+       }
+       *p++ = '<';
+       memcpy(p, uri->s, uri->len);
+       p += uri->len;
+
+       /* uri parameters */
+       /* path vector as route header parameter */
+       if ((options & DS_PATH) && path->len > 0) {
+               if (p + ROUTE_PARAM_LEN + path->len > end) {
+                       return -1;
                }
-       } else {
-               cnt = 0;
-               *len = 0;
+               memcpy(p, ROUTE_PARAM, ROUTE_PARAM_LEN);
+               p += ROUTE_PARAM_LEN;
+               /* copy escaped path into dest */
+               buf.s = p;
+               buf.len = end - p;
+               if (escape_param(path, &buf) < 0) {
+                       return -1;
+               }
+               p += buf.len;
        }
 
-       /* backup current branch index to restore it later */
-       crt_branch = get_branch_iterator();
+       /* end of uri parameters */
+       *p++ = '>';
 
-       init_branch_iterator();
-       while ((uri.s = next_branch(&uri.len, &q, 0, 0, 0, 0, 0, 0, 0))) {
-               cnt++;
-               *len += uri.len + 1 /*'<'*/;
-               if (q != Q_UNSPECIFIED) {
-                       *len += Q_PARAM_LEN + len_q(q);
-               } else {
-                       *len += 1 /*'>'*/;
+       /* header parameters */
+       /* q value */
+       if (q != Q_UNSPECIFIED) {
+               buf.s = q2str(q, (unsigned int*)&buf.len);
+               if (p + Q_PARAM_LEN + buf.len > end) {
+                       return -1;
                }
+               memcpy(p, Q_PARAM, Q_PARAM_LEN);
+               p += Q_PARAM_LEN;
+               memcpy(p, buf.s, buf.len);
+               p += buf.len;
        }
 
-       if (cnt == 0) return 0; 
+       /* branch flags (not SIP standard conformant) */
+       if (options & DS_FLAGS) {
+               buf.s = int2str(flags, &buf.len);
+               if (p + FLAGS_PARAM_LEN + buf.len > end) {
+                       return -1;
+               }
+               memcpy(p, FLAGS_PARAM, FLAGS_PARAM_LEN);
+               p += FLAGS_PARAM_LEN;
+               memcpy(p, buf.s, buf.len);
+               p += buf.len;
+       }
 
-       *len += CONTACT_LEN + CRLF_LEN + (cnt - 1) * CONTACT_DELIM_LEN;
+       *dest = p;
+       return 0;
+}
 
-       if (*len + 1 > MAX_REDIRECTION_LEN) {
-               LM_ERR("redirection buffer length exceed\n");
-               goto error;
-       }
 
-       memcpy(dset, CONTACT, CONTACT_LEN);
-       p = dset + CONTACT_LEN;
-       if (msg->new_uri.s) {
-               *p++ = '<';
+/*
+ * Create a Contact header field from the dset
+ * array
+ */
+char* print_dset(struct sip_msg* msg, int* len, int options)
+{
+       int cnt = 0;
+       qvalue_t q;
+       str uri, path;
+       unsigned int flags;
+       char *p;
+       int crt_branch;
+       static char dset[MAX_REDIRECTION_LEN];
+       char *end = dset + MAX_REDIRECTION_LEN;
 
-               memcpy(p, msg->new_uri.s, msg->new_uri.len);
-               p += msg->new_uri.len;
+       /* backup current branch index to restore it later */
+       crt_branch = get_branch_iterator();
 
-               if (ruri_q != Q_UNSPECIFIED) {
-                       memcpy(p, Q_PARAM, Q_PARAM_LEN);
-                       p += Q_PARAM_LEN;
+       /* contact header name */
+       if (CONTACT_LEN + CRLF_LEN + 1 > MAX_REDIRECTION_LEN) {
+               goto memfail;
+       }
+       memcpy(dset, CONTACT, CONTACT_LEN);
+       p = dset + CONTACT_LEN;
 
-                       qbuf = q2str(ruri_q, &qlen);
-                       memcpy(p, qbuf, qlen);
-                       p += qlen;
-               } else {
-                       *p++ = '>';
+       /* current uri */
+       if (msg->new_uri.s) {
+               if (print_contact_str(&p, &msg->new_uri, ruri_q, &msg->path_vec, ruri_bflags, end, options) < 0) {
+                       goto memfail;
                }
-               i = 1;
-       } else {
-               i = 0;
+               cnt++;
        }
 
+       /* branches */
        init_branch_iterator();
-       while ((uri.s = next_branch(&uri.len, &q, 0, 0, 0, 0, 0, 0, 0))) {
-               if (i) {
+       while ((uri.s = next_branch(&uri.len, &q, 0, &path, &flags, 0, 0, 0, 0))) {
+               if (cnt > 0) {
+                       if (p + CONTACT_DELIM_LEN > end) {
+                               goto memfail;
+                       }
                        memcpy(p, CONTACT_DELIM, CONTACT_DELIM_LEN);
                        p += CONTACT_DELIM_LEN;
                }
 
-               *p++ = '<';
+               if (print_contact_str(&p, &uri, q, &path, flags, end, options) < 0) {
+                       goto memfail;
+               }
 
-               memcpy(p, uri.s, uri.len);
-               p += uri.len;
-               if (q != Q_UNSPECIFIED) {
-                       memcpy(p, Q_PARAM, Q_PARAM_LEN);
-                       p += Q_PARAM_LEN;
+               cnt++;
+       }
 
-                       qbuf = q2str(q, &qlen);
-                       memcpy(p, qbuf, qlen);
-                       p += qlen;
-               } else {
-                       *p++ = '>';
-               }
-               i++;
+       if (cnt == 0) {
+               LM_WARN("no r-uri or branches\n");
+               goto error;
        }
 
+       if (p + CRLF_LEN + 1 > end) {
+               goto memfail;
+       }
        memcpy(p, CRLF " ", CRLF_LEN + 1);
+       *len = p - dset + CRLF_LEN;
        set_branch_iterator(crt_branch);
        return dset;
 
+memfail:
+       LM_ERR("redirection buffer length exceed\n");
 error:
+       *len = 0;
        set_branch_iterator(crt_branch);
        return 0;
 }
index 603b202..65b54c3 100644 (file)
@@ -37,6 +37,9 @@
 extern unsigned int nr_branches;
 extern int ruri_is_new;
 
+#define DS_FLAGS    1
+#define DS_PATH     2
+
 /*! \brief
  * Structure for storing branch attributes
  */
@@ -158,7 +161,7 @@ void clear_branches(void);
  * Create a Contact header field from the
  * list of current branches
  */
-char* print_dset(struct sip_msg* msg, int* len);
+char* print_dset(struct sip_msg* msg, int* len, int options);
 
 
 /*! \brief
index 5259c34..da2718c 100644 (file)
@@ -164,13 +164,12 @@ static int init_blst_callback_lst(struct blst_callbacks_lst*  cb_lst, int max)
        cb_lst->max_hooks=MAX_BLST_HOOKS;
        cb_lst->last_idx=0;
        cb_lst->hooks=pkg_malloc(cb_lst->max_hooks*sizeof(struct blacklist_hook));
-       if (cb_lst->hooks==0)
-               PKG_MEM_ERROR;
-               goto error;
+       if (cb_lst->hooks==0) {
+               PKG_MEM_ERROR;
+               return -1;
+       }
        memset(cb_lst->hooks, 0, cb_lst->max_hooks*sizeof(struct blacklist_hook));
        return 0;
-error:
-       return -1;
 }
 
 
index 301965b..3790058 100644 (file)
@@ -140,6 +140,7 @@ extern char* mcast;
 #endif /* USE_MCAST */
 
 extern int auto_bind_ipv6;
+extern int sr_bind_ipv6_link_local;
 
 extern int tos;
 extern int pmtu_discovery;
@@ -193,6 +194,9 @@ extern int mlock_pages;
 /* execute onsend_route for replies */
 extern int onsend_route_reply;
 
+extern int ksr_evrt_received_mode;
+extern str kemi_received_route_callback;
+
 /* real time stuff */
 extern int real_time;
 extern int rt_prio;
index aa5af2b..668179c 100644 (file)
@@ -167,6 +167,7 @@ typedef struct sr_net_info {
        dest_info_t* dst;
 } sr_net_info_t;
 
+sr_net_info_t *ksr_evrt_rcvnetinfo_get(void);
 
 #define SND_FLAGS_INIT(sflags) \
        do{ \
index d15e021..3ca2e90 100644 (file)
@@ -31,6 +31,8 @@
 #include "data_lump.h"
 #include "data_lump_rpl.h"
 #include "strutils.h"
+#include "select_buf.h"
+#include "pvar.h"
 #include "mem/shm.h"
 #include "parser/parse_uri.h"
 #include "parser/parse_from.h"
@@ -47,6 +49,11 @@ str kemi_onsend_route_callback = str_init("ksr_onsend_route");
 str kemi_reply_route_callback = str_init("ksr_reply_route");
 str kemi_event_route_callback = str_init("");
 
+/**
+ *
+ */
+static sr_kemi_xval_t _sr_kemi_xval = {0};
+
 /**
  *
  */
@@ -992,6 +999,95 @@ static int sr_kemi_core_is_method_prack(sip_msg_t *msg)
        return sr_kemi_core_is_method_type(msg, METHOD_PRACK);
 }
 
+/**
+ *
+ */
+static int sr_kemi_core_is_proto_udp(sip_msg_t *msg)
+{
+       return (msg->rcv.proto == PROTO_UDP)?SR_KEMI_TRUE:SR_KEMI_FALSE;
+}
+
+/**
+ *
+ */
+static int sr_kemi_core_is_proto_tcp(sip_msg_t *msg)
+{
+       return (msg->rcv.proto == PROTO_TCP)?SR_KEMI_TRUE:SR_KEMI_FALSE;
+}
+
+/**
+ *
+ */
+static int sr_kemi_core_is_proto_tls(sip_msg_t *msg)
+{
+       return (msg->rcv.proto == PROTO_TLS)?SR_KEMI_TRUE:SR_KEMI_FALSE;
+}
+
+/**
+ *
+ */
+static int sr_kemi_core_is_proto_ws(sip_msg_t *msg)
+{
+       return (msg->rcv.proto == PROTO_WS)?SR_KEMI_TRUE:SR_KEMI_FALSE;
+}
+
+/**
+ *
+ */
+static int sr_kemi_core_is_proto_wss(sip_msg_t *msg)
+{
+       return (msg->rcv.proto == PROTO_WSS)?SR_KEMI_TRUE:SR_KEMI_FALSE;
+}
+
+/**
+ *
+ */
+static int sr_kemi_core_is_proto_sctp(sip_msg_t *msg)
+{
+       return (msg->rcv.proto == PROTO_SCTP)?SR_KEMI_TRUE:SR_KEMI_FALSE;
+}
+
+/**
+ *
+ */
+static int sr_kemi_core_is_af_ipv4(sip_msg_t *msg)
+{
+       if(msg==NULL || msg->rcv.bind_address==NULL) {
+               return SR_KEMI_FALSE;
+       }
+       return (msg->rcv.bind_address->address.af==AF_INET)?SR_KEMI_TRUE:SR_KEMI_FALSE;
+}
+
+/**
+ *
+ */
+static int sr_kemi_core_is_af_ipv6(sip_msg_t *msg)
+{
+       if(msg==NULL || msg->rcv.bind_address==NULL) {
+               return SR_KEMI_FALSE;
+       }
+       return (msg->rcv.bind_address->address.af==AF_INET6)?SR_KEMI_TRUE:SR_KEMI_FALSE;
+}
+
+/**
+ *
+ */
+static int sr_kemi_core_is_src_port(sip_msg_t *msg, int vport)
+{
+       return (vport == (int)msg->rcv.src_port)?SR_KEMI_TRUE:SR_KEMI_FALSE;
+}
+
+/**
+ *
+ */
+static int sr_kemi_core_is_dst_port(sip_msg_t *msg, int vport)
+{
+       if(msg==NULL || msg->rcv.bind_address==NULL) {
+               return SR_KEMI_FALSE;
+       }
+       return (vport == (int)msg->rcv.bind_address->port_no)?SR_KEMI_TRUE:SR_KEMI_FALSE;
+}
+
 /**
  *
  */
@@ -1510,6 +1606,56 @@ static sr_kemi_t _sr_kemi_core[] = {
                { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
                        SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
        },
+       { str_init(""), str_init("is_UDP"),
+               SR_KEMIP_BOOL, sr_kemi_core_is_proto_udp,
+               { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init(""), str_init("is_TCP"),
+               SR_KEMIP_BOOL, sr_kemi_core_is_proto_tcp,
+               { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init(""), str_init("is_TLS"),
+               SR_KEMIP_BOOL, sr_kemi_core_is_proto_tls,
+               { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init(""), str_init("is_WS"),
+               SR_KEMIP_BOOL, sr_kemi_core_is_proto_ws,
+               { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init(""), str_init("is_WSS"),
+               SR_KEMIP_BOOL, sr_kemi_core_is_proto_wss,
+               { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init(""), str_init("is_SCTP"),
+               SR_KEMIP_BOOL, sr_kemi_core_is_proto_sctp,
+               { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init(""), str_init("is_IPv4"),
+               SR_KEMIP_BOOL, sr_kemi_core_is_af_ipv4,
+               { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init(""), str_init("is_IPv6"),
+               SR_KEMIP_BOOL, sr_kemi_core_is_af_ipv6,
+               { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init(""), str_init("is_src_port"),
+               SR_KEMIP_BOOL, sr_kemi_core_is_src_port,
+               { SR_KEMIP_INT, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init(""), str_init("is_dst_port"),
+               SR_KEMIP_BOOL, sr_kemi_core_is_dst_port,
+               { SR_KEMIP_INT, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
 
        { {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
 };
@@ -1539,7 +1685,8 @@ static int sr_kemi_hdr_append(sip_msg_t *msg, str *txt)
        memcpy(hdr, txt->s, txt->len);
        /* anchor after last header */
        anchor = anchor_lump(msg, msg->unparsed - msg->buf, 0, 0);
-       if(insert_new_lump_before(anchor, hdr, txt->len, 0) == 0) {
+       if((anchor==NULL)
+                       || (insert_new_lump_before(anchor, hdr, txt->len, 0) == 0)) {
                LM_ERR("can't insert lump\n");
                pkg_free(hdr);
                return -1;
@@ -1604,13 +1751,15 @@ static int sr_kemi_hdr_append_after(sip_msg_t *msg, str *txt, str *hname)
                anchor = anchor_lump(msg, hf->name.s + hf->len - msg->buf, 0, 0);
        }
 
-       LM_DBG("append after [%.*s] the hf: [%.*s]\n", hname->len, hname->s,
-                       txt->len, txt->s);
-       if(insert_new_lump_before(anchor, hdr, txt->len, 0) == 0) {
+       if((anchor==NULL)
+                       || (insert_new_lump_before(anchor, hdr, txt->len, 0) == 0)) {
                LM_ERR("can't insert lump\n");
                pkg_free(hdr);
                return -1;
        }
+       LM_DBG("appended after [%.*s] the hf: [%.*s]\n", hname->len, hname->s,
+                       txt->len, txt->s);
+
        return 1;
 }
 
@@ -1731,7 +1880,8 @@ static int sr_kemi_hdr_insert(sip_msg_t *msg, str *txt)
        memcpy(hdr, txt->s, txt->len);
        /* anchor before first header */
        anchor = anchor_lump(msg, msg->headers->name.s - msg->buf, 0, 0);
-       if(insert_new_lump_before(anchor, hdr, txt->len, 0) == 0) {
+       if((anchor==NULL)
+                       || (insert_new_lump_before(anchor, hdr, txt->len, 0) == 0)) {
                LM_ERR("can't insert lump\n");
                pkg_free(hdr);
                return -1;
@@ -1794,16 +1944,47 @@ static int sr_kemi_hdr_insert_before(sip_msg_t *msg, str *txt, str *hname)
        } else { /* before hf */
                anchor = anchor_lump(msg, hf->name.s - msg->buf, 0, 0);
        }
-       LM_DBG("insert before [%.*s] the hf: %.*s\n", hname->len, hname->s,
-                       txt->len, txt->s);
-       if(insert_new_lump_before(anchor, hdr, txt->len, 0) == 0) {
+       if((anchor==NULL)
+                       || (insert_new_lump_before(anchor, hdr, txt->len, 0) == 0)) {
                LM_ERR("can't insert lump\n");
                pkg_free(hdr);
                return -1;
        }
+       LM_DBG("inserted before [%.*s] the hf: %.*s\n", hname->len, hname->s,
+                       txt->len, txt->s);
+
        return 1;
 }
 
+/**
+ *
+ */
+static int sr_kemi_hdr_rmappend(sip_msg_t *msg, str *hrm, str *hadd)
+{
+       int ret;
+
+       ret = sr_kemi_hdr_remove(msg, hrm);
+       if(ret<0) {
+               return ret;
+       }
+       return sr_kemi_hdr_append(msg, hadd);
+}
+
+/**
+ *
+ */
+static int sr_kemi_hdr_rminsert(sip_msg_t *msg, str *hrm, str *hadd)
+{
+       int ret;
+
+       ret = sr_kemi_hdr_remove(msg, hrm);
+       if(ret<0) {
+               return ret;
+       }
+       return sr_kemi_hdr_insert(msg, hadd);
+}
+
+
 /**
  *
  */
@@ -1822,6 +2003,92 @@ static int sr_kemi_hdr_append_to_reply(sip_msg_t *msg, str *txt)
        return 1;
 }
 
+/**
+ *
+ */
+static sr_kemi_xval_t* sr_kemi_hdr_get_mode(sip_msg_t *msg, str *hname, int rmode)
+{
+       char hbuf[256];
+       str s;
+       hdr_field_t shdr;
+       hdr_field_t *ihdr;
+
+       memset(&_sr_kemi_xval, 0, sizeof(sr_kemi_xval_t));
+
+       if(msg==NULL) {
+               sr_kemi_xval_null(&_sr_kemi_xval, rmode);
+               return &_sr_kemi_xval;
+       }
+       /* we need to be sure we have parsed all headers */
+       if(parse_headers(msg, HDR_EOH_F, 0)<0) {
+               LM_ERR("error parsing headers\n");
+               sr_kemi_xval_null(&_sr_kemi_xval, rmode);
+               return &_sr_kemi_xval;
+       }
+       if(hname->len>=252) {
+               LM_ERR("header name too long\n");
+               sr_kemi_xval_null(&_sr_kemi_xval, rmode);
+               return &_sr_kemi_xval;
+       }
+
+       memcpy(hbuf, hname->s, hname->len);
+       hbuf[hname->len] = ':';
+       hbuf[hname->len+1] = '\0';
+       s.s = hbuf;
+       s.len = hname->len + 1;
+
+       if (parse_hname2_short(s.s, s.s + s.len, &shdr)==0) {
+               LM_ERR("error parsing header name [%.*s]\n", s.len, s.s);
+               sr_kemi_xval_null(&_sr_kemi_xval, rmode);
+               return &_sr_kemi_xval;
+       }
+       for (ihdr=msg->headers; ihdr; ihdr=ihdr->next) {
+               if (shdr.type!=HDR_OTHER_T && shdr.type!=HDR_ERROR_T) {
+                       /* find by type */
+                       if (shdr.type==ihdr->type) {
+                               break;
+                       }
+               } else {
+                       /* find by name */
+                       if (cmp_hdrname_str(&ihdr->name, hname)==0) {
+                               break;
+                       }
+               }
+       }
+       if(ihdr==NULL) {
+               sr_kemi_xval_null(&_sr_kemi_xval, rmode);
+               return &_sr_kemi_xval;
+       }
+
+       _sr_kemi_xval.vtype = SR_KEMIP_STR;
+       _sr_kemi_xval.v.s = ihdr->body;
+       return &_sr_kemi_xval;
+}
+
+/**
+ *
+ */
+static sr_kemi_xval_t* sr_kemi_hdr_get(sip_msg_t *msg, str *hname)
+{
+       return sr_kemi_hdr_get_mode(msg, hname, SR_KEMI_XVAL_NULL_NONE);
+}
+
+/**
+ *
+ */
+static sr_kemi_xval_t* sr_kemi_hdr_gete(sip_msg_t *msg, str *hname)
+{
+       return sr_kemi_hdr_get_mode(msg, hname, SR_KEMI_XVAL_NULL_EMPTY);
+}
+
+/**
+ *
+ */
+static sr_kemi_xval_t* sr_kemi_hdr_getw(sip_msg_t *msg, str *hname)
+{
+       return sr_kemi_hdr_get_mode(msg, hname, SR_KEMI_XVAL_NULL_PRINT);
+}
+
 /**
  *
  */
@@ -1851,6 +2118,16 @@ static sr_kemi_t _sr_kemi_hdr[] = {
                { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
                        SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
        },
+       { str_init("hdr"), str_init("rmappend"),
+               SR_KEMIP_INT, sr_kemi_hdr_rmappend,
+               { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init("hdr"), str_init("rminsert"),
+               SR_KEMIP_INT, sr_kemi_hdr_rminsert,
+               { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
        { str_init("hdr"), str_init("is_present"),
                SR_KEMIP_INT, sr_kemi_hdr_is_present,
                { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
@@ -1861,10 +2138,379 @@ static sr_kemi_t _sr_kemi_hdr[] = {
                { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
                        SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
        },
+       { str_init("hdr"), str_init("get"),
+               SR_KEMIP_XVAL, sr_kemi_hdr_get,
+               { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init("hdr"), str_init("gete"),
+               SR_KEMIP_XVAL, sr_kemi_hdr_gete,
+               { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init("hdr"), str_init("getw"),
+               SR_KEMIP_XVAL, sr_kemi_hdr_getw,
+               { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
 
        { {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
 };
 
+
+/**
+ *
+ */
+void sr_kemi_xval_null(sr_kemi_xval_t *xval, int rmode)
+{
+       if(rmode==SR_KEMI_XVAL_NULL_PRINT) {
+               xval->vtype = SR_KEMIP_STR;
+               xval->v.s = *pv_get_null_str();
+       } else if(rmode==SR_KEMI_XVAL_NULL_EMPTY) {
+               xval->vtype = SR_KEMIP_STR;
+               xval->v.s = *pv_get_empty_str();
+       } else {
+               xval->vtype = SR_KEMIP_NULL;
+               xval->v.s.s = NULL;
+               xval->v.s.len = 0;
+       }
+}
+
+/**
+ *
+ */
+static sr_kemi_xval_t* sr_kemi_pv_get_mode(sip_msg_t *msg, str *pvn, int rmode)
+{
+       pv_spec_t *pvs;
+       pv_value_t val;
+       int pl;
+
+       memset(&_sr_kemi_xval, 0, sizeof(sr_kemi_xval_t));
+
+       LM_DBG("pv get: %.*s\n", pvn->len, pvn->s);
+       pl = pv_locate_name(pvn);
+       if(pl != pvn->len) {
+               LM_ERR("invalid pv [%.*s] (%d/%d)\n", pvn->len, pvn->s, pl, pvn->len);
+               sr_kemi_xval_null(&_sr_kemi_xval, rmode);
+               return &_sr_kemi_xval;
+       }
+       pvs = pv_cache_get(pvn);
+       if(pvs==NULL) {
+               LM_ERR("cannot get pv spec for [%.*s]\n", pvn->len, pvn->s);
+               sr_kemi_xval_null(&_sr_kemi_xval, rmode);
+               return &_sr_kemi_xval;
+       }
+
+       memset(&val, 0, sizeof(pv_value_t));
+       if(pv_get_spec_value(msg, pvs, &val) != 0) {
+               LM_ERR("unable to get pv value for [%.*s]\n", pvn->len, pvn->s);
+               sr_kemi_xval_null(&_sr_kemi_xval, rmode);
+               return &_sr_kemi_xval;
+       }
+       if(val.flags&PV_VAL_NULL) {
+               sr_kemi_xval_null(&_sr_kemi_xval, rmode);
+               return &_sr_kemi_xval;
+       }
+       if(val.flags&PV_TYPE_INT) {
+               _sr_kemi_xval.vtype = SR_KEMIP_INT;
+               _sr_kemi_xval.v.n = val.ri;
+               return &_sr_kemi_xval;
+       }
+       _sr_kemi_xval.vtype = SR_KEMIP_STR;
+       _sr_kemi_xval.v.s = val.rs;
+       return &_sr_kemi_xval;
+}
+
+/**
+ *
+ */
+static sr_kemi_xval_t* sr_kemi_pv_get(sip_msg_t *msg, str *pvn)
+{
+       return sr_kemi_pv_get_mode(msg, pvn, SR_KEMI_XVAL_NULL_NONE);
+}
+
+/**
+ *
+ */
+static sr_kemi_xval_t* sr_kemi_pv_getw(sip_msg_t *msg, str *pvn)
+{
+       return sr_kemi_pv_get_mode(msg, pvn, SR_KEMI_XVAL_NULL_PRINT);
+}
+
+/**
+ *
+ */
+static sr_kemi_xval_t* sr_kemi_pv_gete(sip_msg_t *msg, str *pvn)
+{
+       return sr_kemi_pv_get_mode(msg, pvn, SR_KEMI_XVAL_NULL_EMPTY);
+}
+
+/**
+ *
+ */
+static void sr_kemi_pv_push_valx (sr_kemi_xval_t *xval, int rmode, int vi, str *vs)
+{
+       if(rmode==1) {
+               xval->vtype = SR_KEMIP_INT;
+               xval->v.n = vi;
+       } else {
+               xval->vtype = SR_KEMIP_STR;
+               xval->v.s = *vs;
+       }
+}
+
+/**
+ *
+ */
+static sr_kemi_xval_t* sr_kemi_pv_get_valx (sip_msg_t *msg, str *pvn, str *xsval,
+               int xival, int rmode)
+{
+       pv_spec_t *pvs;
+       pv_value_t val;
+       int pl;
+
+       memset(&_sr_kemi_xval, 0, sizeof(sr_kemi_xval_t));
+
+       LM_DBG("pv get: %.*s\n", pvn->len, pvn->s);
+       pl = pv_locate_name(pvn);
+       if(pl != pvn->len) {
+               LM_ERR("invalid pv [%.*s] (%d/%d)\n", pvn->len, pvn->s, pl, pvn->len);
+               sr_kemi_pv_push_valx(&_sr_kemi_xval, rmode, xival, xsval);
+               return &_sr_kemi_xval;
+       }
+       pvs = pv_cache_get(pvn);
+       if(pvs==NULL) {
+               LM_ERR("cannot get pv spec for [%.*s]\n", pvn->len, pvn->s);
+               sr_kemi_pv_push_valx(&_sr_kemi_xval, rmode, xival, xsval);
+               return &_sr_kemi_xval;
+       }
+
+       memset(&val, 0, sizeof(pv_value_t));
+       if(pv_get_spec_value(msg, pvs, &val) != 0) {
+               LM_ERR("unable to get pv value for [%.*s]\n", pvn->len, pvn->s);
+               sr_kemi_pv_push_valx(&_sr_kemi_xval, rmode, xival, xsval);
+               return &_sr_kemi_xval;
+       }
+       if(val.flags&PV_VAL_NULL) {
+               sr_kemi_pv_push_valx(&_sr_kemi_xval, rmode, xival, xsval);
+               return &_sr_kemi_xval;
+       }
+       if(val.flags&PV_TYPE_INT) {
+               _sr_kemi_xval.vtype = SR_KEMIP_INT;
+               _sr_kemi_xval.v.n = val.ri;
+               return &_sr_kemi_xval;
+       }
+       _sr_kemi_xval.vtype = SR_KEMIP_STR;
+       _sr_kemi_xval.v.s = val.rs;
+       return &_sr_kemi_xval;
+}
+
+/**
+ *
+ */
+static sr_kemi_xval_t* sr_kemi_pv_getvs (sip_msg_t *msg, str *pvn, str *xsval)
+{
+       return sr_kemi_pv_get_valx (msg, pvn, xsval, 0, 0);
+}
+
+/**
+ *
+ */
+static sr_kemi_xval_t* sr_kemi_pv_getvn (sip_msg_t *msg, str *pvn, int xival)
+{
+       return sr_kemi_pv_get_valx (msg, pvn, NULL, xival, 1);
+}
+
+/**
+ *
+ */
+static int sr_kemi_pv_seti (sip_msg_t *msg, str *pvn, int ival)
+{
+       pv_spec_t *pvs;
+       pv_value_t val;
+       int pl;
+
+       LM_DBG("pv get: %.*s\n", pvn->len, pvn->s);
+       pl = pv_locate_name(pvn);
+       if(pl != pvn->len) {
+               LM_ERR("invalid pv [%.*s] (%d/%d)\n", pvn->len, pvn->s, pl, pvn->len);
+               return SR_KEMI_FALSE;
+       }
+       pvs = pv_cache_get(pvn);
+       if(pvs==NULL) {
+               LM_ERR("cannot get pv spec for [%.*s]\n", pvn->len, pvn->s);
+               return SR_KEMI_FALSE;
+       }
+
+       memset(&val, 0, sizeof(pv_value_t));
+       val.ri = ival;
+       val.flags |= PV_TYPE_INT|PV_VAL_INT;
+
+       if(pv_set_spec_value(msg, pvs, 0, &val)<0) {
+               LM_ERR("unable to set pv [%.*s]\n", pvn->len, pvn->s);
+               return SR_KEMI_FALSE;
+       }
+
+       return SR_KEMI_TRUE;
+}
+
+/**
+ *
+ */
+static int sr_kemi_pv_sets (sip_msg_t *msg, str *pvn, str *sval)
+{
+       pv_spec_t *pvs;
+       pv_value_t val;
+       int pl;
+
+       LM_DBG("pv set: %.*s\n", pvn->len, pvn->s);
+       pl = pv_locate_name(pvn);
+       if(pl != pvn->len) {
+               LM_ERR("invalid pv [%.*s] (%d/%d)\n", pvn->len, pvn->s, pl, pvn->len);
+               return SR_KEMI_FALSE;
+       }
+       pvs = pv_cache_get(pvn);
+       if(pvs==NULL) {
+               LM_ERR("cannot get pv spec for [%.*s]\n", pvn->len, pvn->s);
+               return SR_KEMI_FALSE;
+       }
+
+       memset(&val, 0, sizeof(pv_value_t));
+       val.rs = *sval;
+       val.flags |= PV_VAL_STR;
+
+       if(pv_set_spec_value(msg, pvs, 0, &val)<0) {
+               LM_ERR("unable to set pv [%.*s]\n", pvn->len, pvn->s);
+               return SR_KEMI_FALSE;
+       }
+
+       return SR_KEMI_TRUE;
+}
+
+/**
+ *
+ */
+static int sr_kemi_pv_unset (sip_msg_t *msg, str *pvn)
+{
+       pv_spec_t *pvs;
+       pv_value_t val;
+       int pl;
+
+       LM_DBG("pv unset: %.*s\n", pvn->len, pvn->s);
+       pl = pv_locate_name(pvn);
+       if(pl != pvn->len) {
+               LM_ERR("invalid pv [%.*s] (%d/%d)\n", pvn->len, pvn->s, pl, pvn->len);
+               return SR_KEMI_FALSE;
+       }
+       pvs = pv_cache_get(pvn);
+       if(pvs==NULL) {
+               LM_ERR("cannot get pv spec for [%.*s]\n", pvn->len, pvn->s);
+               return SR_KEMI_FALSE;
+       }
+       memset(&val, 0, sizeof(pv_value_t));
+       val.flags |= PV_VAL_NULL;
+       if(pv_set_spec_value(msg, pvs, 0, &val)<0) {
+               LM_ERR("unable to unset pv [%.*s]\n", pvn->len, pvn->s);
+               return SR_KEMI_FALSE;
+       }
+
+       return SR_KEMI_TRUE;
+}
+
+/**
+ *
+ */
+static int sr_kemi_pv_is_null (sip_msg_t *msg, str *pvn)
+{
+       pv_spec_t *pvs;
+       pv_value_t val;
+       int pl;
+
+       LM_DBG("pv is null test: %.*s\n", pvn->len, pvn->s);
+       pl = pv_locate_name(pvn);
+       if(pl != pvn->len) {
+               LM_ERR("invalid pv [%.*s] (%d/%d)\n", pvn->len, pvn->s, pl, pvn->len);
+               return SR_KEMI_TRUE;
+       }
+       pvs = pv_cache_get(pvn);
+       if(pvs==NULL) {
+               LM_ERR("cannot get pv spec for [%.*s]\n", pvn->len, pvn->s);
+               return SR_KEMI_TRUE;
+       }
+
+       memset(&val, 0, sizeof(pv_value_t));
+       if(pv_get_spec_value(msg, pvs, &val) != 0) {
+               LM_NOTICE("unable to get pv value for [%.*s]\n", pvn->len, pvn->s);
+               return SR_KEMI_TRUE;
+       }
+       if(val.flags&PV_VAL_NULL) {
+               return SR_KEMI_TRUE;
+       } else {
+               return SR_KEMI_FALSE;
+       }
+}
+
+/**
+ *
+ */
+static sr_kemi_t _sr_kemi_pv[] = {
+       { str_init("pv"), str_init("get"),
+               SR_KEMIP_XVAL, sr_kemi_pv_get,
+               { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init("pv"), str_init("getw"),
+               SR_KEMIP_XVAL, sr_kemi_pv_getw,
+               { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init("pv"), str_init("gete"),
+               SR_KEMIP_XVAL, sr_kemi_pv_gete,
+               { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init("pv"), str_init("getvn"),
+               SR_KEMIP_XVAL, sr_kemi_pv_getvn,
+               { SR_KEMIP_STR, SR_KEMIP_INT, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init("pv"), str_init("getvs"),
+               SR_KEMIP_XVAL, sr_kemi_pv_getvs,
+               { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init("pv"), str_init("seti"),
+               SR_KEMIP_BOOL, sr_kemi_pv_seti,
+               { SR_KEMIP_STR, SR_KEMIP_INT, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init("pv"), str_init("sets"),
+               SR_KEMIP_BOOL, sr_kemi_pv_sets,
+               { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init("pv"), str_init("unset"),
+               SR_KEMIP_BOOL, sr_kemi_pv_unset,
+               { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+       { str_init("pv"), str_init("is_null"),
+               SR_KEMIP_BOOL, sr_kemi_pv_is_null,
+               { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
+
+       { {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
+};
+
+/**
+ *
+ */
+sr_kemi_t* sr_kemi_exports_get_pv(void)
+{
+       return _sr_kemi_pv;
+}
+
 #define SR_KEMI_MODULES_MAX_SIZE       1024
 static int _sr_kemi_modules_size = 0;
 static sr_kemi_module_t _sr_kemi_modules[SR_KEMI_MODULES_MAX_SIZE];
@@ -1883,6 +2529,10 @@ int sr_kemi_modules_add(sr_kemi_t *klist)
                _sr_kemi_modules[_sr_kemi_modules_size].mname = _sr_kemi_core[0].mname;
                _sr_kemi_modules[_sr_kemi_modules_size].kexp = _sr_kemi_core;
                _sr_kemi_modules_size++;
+               LM_DBG("adding pv module\n");
+               _sr_kemi_modules[_sr_kemi_modules_size].mname = _sr_kemi_pv[0].mname;
+               _sr_kemi_modules[_sr_kemi_modules_size].kexp = _sr_kemi_pv;
+               _sr_kemi_modules_size++;
                LM_DBG("adding hdr module\n");
                _sr_kemi_modules[_sr_kemi_modules_size].mname = _sr_kemi_hdr[0].mname;
                _sr_kemi_modules[_sr_kemi_modules_size].kexp = _sr_kemi_hdr;
@@ -2201,7 +2851,7 @@ static sr_kemi_param_map_t _sr_kemi_param_map[] = {
        { SR_KEMIP_INT,    str_init("int") },
        { SR_KEMIP_STR,    str_init("str") },
        { SR_KEMIP_BOOL,   str_init("bool") },
-       { SR_KEMIP_INTSTR, str_init("int-str") },
+       { SR_KEMIP_XVAL,   str_init("xval") },
        { 0, STR_NULL }
 };
 
@@ -2265,3 +2915,36 @@ done:
        sret.len = strlen(sret.s);
        return &sret;
 }
+
+/**
+ *
+ */
+int sr_kemi_route(sr_kemi_eng_t *keng, sip_msg_t *msg, int rtype,
+               str *ename, str *edata)
+{
+       flag_t sfbk;
+       int ret;
+
+       sfbk = getsflags();
+       setsflagsval(0);
+       reset_static_buffer();
+       ret = keng->froute(msg, rtype, ename, edata);
+       setsflagsval(sfbk);
+       return ret;
+}
+
+/**
+ *
+ */
+int sr_kemi_ctx_route(sr_kemi_eng_t *keng, run_act_ctx_t *ctx, sip_msg_t *msg,
+               int rtype, str *ename, str *edata)
+{
+       run_act_ctx_t *bctx;
+       int ret;
+
+       bctx = sr_kemi_act_ctx_get();
+       sr_kemi_act_ctx_set(ctx);
+       ret = sr_kemi_route(keng, msg, rtype, ename, edata);
+       sr_kemi_act_ctx_set(bctx);
+       return ret;
+}
index 51ea72b..7824ce2 100644 (file)
@@ -30,7 +30,8 @@
 #define SR_KEMIP_INT   (1<<0)  /* type integer */
 #define SR_KEMIP_STR   (1<<1)  /* type str* */
 #define SR_KEMIP_BOOL  (1<<2)  /* type boolean (0/1) */
-#define SR_KEMIP_INTSTR        (1<<3)  /* type integer or str* */
+#define SR_KEMIP_XVAL  (1<<3)  /* type extended value (integer, str*, ...) */
+#define SR_KEMIP_NULL  (1<<4)  /* type NULL */
 
 #define SR_KEMI_FALSE  0
 #define SR_KEMI_TRUE   1
@@ -65,6 +66,14 @@ typedef union {
        str s;
 } sr_kemi_val_t;
 
+typedef struct sr_kemi_xval {
+       int vtype;
+       union {
+               int n;
+               str s;
+       } v;
+} sr_kemi_xval_t;
+
 /* only sip_msg_t */
 typedef int (*sr_kemi_fm_f)(sip_msg_t*);
 
@@ -108,11 +117,54 @@ typedef int (*sr_kemi_fmssss_f)(sip_msg_t*, str*, str*, str*, str*);
 
 /* sip_msg_t and five int|str params */
 typedef int (*sr_kemi_fmsssss_f)(sip_msg_t*, str*, str*, str*, str*, str*);
+typedef int (*sr_kemi_fmssssn_f)(sip_msg_t*, str*, str*, str*, str*, int);
+typedef int (*sr_kemi_fmsssns_f)(sip_msg_t*, str*, str*, str*, int, str*);
+typedef int (*sr_kemi_fmsssnn_f)(sip_msg_t*, str*, str*, str*, int, int);
+typedef int (*sr_kemi_fmssnss_f)(sip_msg_t*, str*, str*, int, str*, str*);
+typedef int (*sr_kemi_fmssnsn_f)(sip_msg_t*, str*, str*, int, str*, int);
 typedef int (*sr_kemi_fmssnns_f)(sip_msg_t*, str*, str*, int, int, str*);
+typedef int (*sr_kemi_fmssnnn_f)(sip_msg_t*, str*, str*, int, int, int);
+typedef int (*sr_kemi_fmsnsss_f)(sip_msg_t*, str*, int, str*, str*, str*);
+typedef int (*sr_kemi_fmsnssn_f)(sip_msg_t*, str*, int, str*, str*, int);
+typedef int (*sr_kemi_fmsnsns_f)(sip_msg_t*, str*, int, str*, int, str*);
+typedef int (*sr_kemi_fmsnsnn_f)(sip_msg_t*, str*, int, str*, int, int);
+typedef int (*sr_kemi_fmsnnss_f)(sip_msg_t*, str*, int, int, str*, str*);
+typedef int (*sr_kemi_fmsnnsn_f)(sip_msg_t*, str*, int, int, str*, int);
+typedef int (*sr_kemi_fmsnnns_f)(sip_msg_t*, str*, int, int, int, str*);
+typedef int (*sr_kemi_fmsnnnn_f)(sip_msg_t*, str*, int, int, int, int);
+typedef int (*sr_kemi_fmnssss_f)(sip_msg_t*, int, str*, str*, str*, str*);
+typedef int (*sr_kemi_fmnsssn_f)(sip_msg_t*, int, str*, str*, str*, int);
+typedef int (*sr_kemi_fmnssns_f)(sip_msg_t*, int, str*, str*, int, str*);
+typedef int (*sr_kemi_fmnssnn_f)(sip_msg_t*, int, str*, str*, int, int);
+typedef int (*sr_kemi_fmnsnss_f)(sip_msg_t*, int, str*, int, str*, str*);
+typedef int (*sr_kemi_fmnsnsn_f)(sip_msg_t*, int, str*, int, str*, int);
+typedef int (*sr_kemi_fmnsnns_f)(sip_msg_t*, int, str*, int, int, str*);
+typedef int (*sr_kemi_fmnsnnn_f)(sip_msg_t*, int, str*, int, int, int);
+typedef int (*sr_kemi_fmnnsss_f)(sip_msg_t*, int, int, str*, str*, str*);
+typedef int (*sr_kemi_fmnnssn_f)(sip_msg_t*, int, int, str*, str*, int);
+typedef int (*sr_kemi_fmnnsns_f)(sip_msg_t*, int, int, str*, int, str*);
+typedef int (*sr_kemi_fmnnsnn_f)(sip_msg_t*, int, int, str*, int, int);
+typedef int (*sr_kemi_fmnnnss_f)(sip_msg_t*, int, int, int, str*, str*);
+typedef int (*sr_kemi_fmnnnsn_f)(sip_msg_t*, int, int, int, str*, int);
+typedef int (*sr_kemi_fmnnnns_f)(sip_msg_t*, int, int, int, int, str*);
+typedef int (*sr_kemi_fmnnnnn_f)(sip_msg_t*, int, int, int, int, int);
 
 /* sip_msg_t and six int|str params */
 typedef int (*sr_kemi_fmssssss_f)(sip_msg_t*, str*, str*, str*, str*, str*, str*);
 
+/* return xval, params only sip_msg_t */
+typedef sr_kemi_xval_t* (*sr_kemi_xfm_f)(sip_msg_t*);
+
+/* return xval, params sip_msg_t and one int|str param */
+typedef sr_kemi_xval_t* (*sr_kemi_xfmn_f)(sip_msg_t*, int);
+typedef sr_kemi_xval_t* (*sr_kemi_xfms_f)(sip_msg_t*, str*);
+
+/* return xval, params sip_msg_t and two int|str params */
+typedef sr_kemi_xval_t* (*sr_kemi_xfmnn_f)(sip_msg_t*, int, int);
+typedef sr_kemi_xval_t* (*sr_kemi_xfmns_f)(sip_msg_t*, int, str*);
+typedef sr_kemi_xval_t* (*sr_kemi_xfmsn_f)(sip_msg_t*, str*, int);
+typedef sr_kemi_xval_t* (*sr_kemi_xfmss_f)(sip_msg_t*, str*, str*);
+
 sr_kemi_t* sr_kemi_lookup(str *mname, int midx, str *fname);
 
 int sr_kemi_modules_add(sr_kemi_t *klist);
@@ -145,4 +197,16 @@ str *sr_kemi_param_map_get_params(int *ptypes);
 
 int sr_kemi_core_set_drop(sip_msg_t *msg);
 
+int sr_kemi_route(sr_kemi_eng_t *keng, sip_msg_t *msg, int rtype,
+               str *ename, str *edata);
+int sr_kemi_ctx_route(sr_kemi_eng_t *keng, run_act_ctx_t *ctx, sip_msg_t *msg,
+               int rtype, str *ename, str *edata);
+
+sr_kemi_t* sr_kemi_exports_get_pv(void);
+
+#define SR_KEMI_XVAL_NULL_NONE 0
+#define SR_KEMI_XVAL_NULL_PRINT 1
+#define SR_KEMI_XVAL_NULL_EMPTY 2
+void sr_kemi_xval_null(sr_kemi_xval_t *xval, int rmode);
+
 #endif
index aced1d2..c03fb15 100644 (file)
@@ -107,7 +107,6 @@ rec_lock_set_t* rec_lock_set_alloc(int n)
                ls->size=n;
        }
        return ls;
-       return NULL;
 }
 
 /**
@@ -153,4 +152,4 @@ void rec_lock_set_release(rec_lock_set_t* lset, int i)
 {
        rec_lock_release(&lset->locks[i]);
        return;
-}
\ No newline at end of file
+}
index 6dad39f..2d8dc2c 100644 (file)
@@ -123,7 +123,7 @@ void pkg_print_manager(void);
 #define PKG_MEM_ERROR_FMT(...) LM_ERR("could not allocate private memory from sys pool" __VA_ARGS__)
 #define PKG_MEM_CRITICAL_FMT(...) LM_CRIT("could not allocate private memory from sys pool" __VA_ARGS__)
 #else
-#define PKG_MEM_ERROR_FMT(fmt, args...) LM_ERROR("could not allocate private memory from sys pool - " fmt , ## args)
+#define PKG_MEM_ERROR_FMT(fmt, args...) LM_ERR("could not allocate private memory from sys pool - " fmt , ## args)
 #define PKG_MEM_CRITICAL_FMT(fmt, args...) LM_CRIT("could not allocate private memory from sys pool - " fmt , ## args)
 #endif
 
index f90237b..27cdac4 100644 (file)
@@ -617,6 +617,14 @@ int fixup_igp_all(void** param, int param_no)
        return fixup_igp_null(param, 1);
 }
 
+/**
+ *
+ */
+int fixup_free_igp_all(void** param, int param_no)
+{
+       return fixup_free_igp_null(param, 1);
+}
+
 /**
  *
  */
@@ -707,4 +715,4 @@ int fixup_free_none_spve(void** param, int param_no)
        if(param_no==2)
                return fixup_free_spve_null(param, 1);
        return 0;
-}
\ No newline at end of file
+}
index b3ab9b9..f040fc1 100644 (file)
@@ -140,6 +140,7 @@ int fixup_free_spve_str(void** param, int param_no);
 int fixup_spve_all(void** param, int param_no);
 int fixup_free_spve_all(void** param, int param_no);
 int fixup_igp_all(void** param, int param_no);
+int fixup_free_igp_all(void** param, int param_no);
 
 int fixup_spve_igp(void** param, int param_no);
 int fixup_free_spve_igp(void** param, int param_no);
index c785190..25f9cce 100644 (file)
@@ -3194,6 +3194,7 @@ int build_sip_msg_from_buf(struct sip_msg *msg, char *buf, int len,
 
        memset(msg, 0, sizeof(sip_msg_t));
        msg->id = id;
+       msg->pid = my_pid();
        msg->buf = buf;
        msg->len = len;
        if (parse_msg(buf, len, msg)!=0) {
index 90dbf8c..e435a27 100644 (file)
@@ -93,7 +93,7 @@ static inline int run_onsend(sip_msg_t* orig_msg, dest_info_t* dst,
                        if(keng) {
                                bctx = sr_kemi_act_ctx_get();
                                sr_kemi_act_ctx_set(&ra_ctx);
-                               ret=keng->froute(orig_msg, ONSEND_ROUTE, NULL, NULL);
+                               ret=sr_kemi_route(keng, orig_msg, ONSEND_ROUTE, NULL, NULL);
                                sr_kemi_act_ctx_set(bctx);
                        } else {
                                ret=run_actions(&ra_ctx, onsend_rt.rlist[DEFAULT_RT], orig_msg);
index 06b85dd..650740b 100644 (file)
@@ -182,6 +182,9 @@ int parse_contacts(str* _s, contact_t** _c)
 {
        contact_t* c;
        param_hooks_t hooks;
+       str sv;
+
+       sv = *_s;
 
        while(1) {
                /* Allocate and clear contact structure */
@@ -220,6 +223,10 @@ int parse_contacts(str* _s, contact_t** _c)
                }
 
                trim(&c->uri);
+               if((c->uri.len <= 0) || (c->uri.s + c->uri.len > sv.s + sv.len)) {
+                       LM_ERR("invlid contact uri\n");
+                       goto error;
+               }
 
                if (_s->len == 0) goto ok;
 
@@ -244,6 +251,7 @@ int parse_contacts(str* _s, contact_t** _c)
                        c->methods = hooks.contact.methods;
                        c->instance = hooks.contact.instance;
                        c->reg_id = hooks.contact.reg_id;
+                       c->flags = hooks.contact.flags;
 
                        if (_s->len == 0) goto ok;
                }
@@ -264,6 +272,8 @@ int parse_contacts(str* _s, contact_t** _c)
        }
 
 error:
+       LM_ERR("