diff --git a/.travis.yml b/.travis.yml index 9cb4d9dc049..a05dabddd65 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ branches: notifications: irc: channels: - - "chat.freenode.net#Kamailio" + - "chat.freenode.net#kamailio-dev" on_success: never on_failure: always email: diff --git a/ChangeLog b/ChangeLog index 746f9b78e77..7b274292c9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8914 +1,15727 @@ -===================== 2015-06-10 Version 4.3.0 Released ===================== +===================== 2016-11-09 Version 4.4.4 Released ===================== -===================== Changes Since Version 4.2.0 =========================== +===================== Changes Since Version 4.4.3 =========================== -commit 56a4ba2d0cd29c87f61da8c1c9f88112886b643f +commit 4ae9f8a97cbea9004454d3d8a56394bf8b017f87 Author: Daniel-Constantin Mierla -Date: Wed Jun 10 15:04:15 2015 +0200 +Date: Wed Nov 9 14:25:42 2016 +0100 - Makefile.defs: version set to 4.3.0 - - - new major release + Makefile.defs: version set to 4.4.4 -commit 73092b89f24b98d7c524b8f429609c642d310769 +commit 610b040bc8884d7354da3f489e00a7e0ecd1c3ea Author: Daniel-Constantin Mierla -Date: Wed Jun 10 14:48:00 2015 +0200 +Date: Wed Nov 9 13:40:21 2016 +0100 - core: several updates to the README - - (cherry picked from commit 92b155e570490771e2b62e1c6185bbfacf770971) + pkg: version set to 4.4.4 in rpm specs -commit f2dcd03c33721e92f6cd4ba7a035be2ea5bbd37f -Author: Daniel-Constantin Mierla -Date: Wed Jun 10 14:25:37 2015 +0200 +commit 570663ae61c20449a0d0d840868cd0b225bf2d24 +Author: Victor Seva +Date: Wed Nov 9 13:03:21 2016 +0100 - db_text: include header file for atoi() to avoid clang warnings - - (cherry picked from commit d7c0ae494a5f1a5a8c808a4c45c9bfbbbda7388c) + pkg/kamailio/deb: version set to 4.4.4 -commit e50d62dd346d660796c1542a4bd42abace64f66f +commit c5f34b50ae910eca44a0fd9d2564d4451617ba00 Author: Daniel-Constantin Mierla -Date: Wed Jun 10 13:31:51 2015 +0200 +Date: Mon Nov 7 17:22:27 2016 +0100 - pkg/rpm: updated spec files for v4.3.0 + textops: handle return code for parse_headers() + + (cherry picked from commit a4da385baf396a3ef123f3a19ec314126d6f4822) -commit b9723c9bed68495e0367fc4376a988ed5343ab04 +commit 5d9aeb79ed0b2511b58b23f07a8b9d80b48ed365 Author: Daniel-Constantin Mierla -Date: Wed Jun 10 13:10:23 2015 +0200 +Date: Sun Nov 6 22:55:11 2016 +0100 - siputils: proper indentation for analysing code blocks + pv: return false if pv_unset() fails - (cherry picked from commit 1dfde28a60b5a6c11d6e95eefbf760200c86384c) - -commit 6c545cd0032db2c257f8ee1c1e6291fb028f5e24 -Author: lazedo -Date: Wed Jun 10 11:52:20 2015 +0100 + (cherry picked from commit ce745f3837a668b67506bfd404c7ef619936de7a) - db_text : missing conversion in raw query - (cherry picked from commit a0b02584b76fced6d98f76ec02ae60d75bbccfa2) - -commit 344634dc8a52ab898777c5c256d0fe4ee505036e -Author: Victor Seva -Date: Wed Jun 10 13:07:08 2015 +0200 - - pkg/kamailio/deb: update version to 4.3.0 - -commit ade2e05d41af057db3004fcc521ba04e7657e0f2 -Author: Mikko Lehto -Date: Tue Jun 9 13:33:58 2015 +0300 +commit f9b5b08ea48923a6eedfb53978ff2d18fa2ac793 +Author: Daniel-Constantin Mierla +Date: Sun Nov 6 22:49:53 2016 +0100 - modules/nat_traversal: avoid clang warnings with cast to (enum _hdr_types_t) + pv: pv_var_to_xavp() - proper test for type int of script var - nat_traversal.c:1477:54: warning: implicit conversion from 'hdr_flags_t' (aka 'unsigned long long') to 'enum _hdr_types_t' changes value from 18446744073709551615 to -1 [-Wconstant-conversion] - nat_traversal.c:1487:49: warning: implicit conversion from 'hdr_flags_t' (aka 'unsigned long long') to 'enum _hdr_types_t' changes value from 18446744073709551615 to -1 [-Wconstant-conversion] - (cherry picked from commit 658932119824a0576ce708ed0d09fd43c95addfc) + (cherry picked from commit de65e91dc69d41277d2ba9459f0f82bcf80a01f5) -commit 3a05838bbd408490b660764a3601653f022a9752 -Author: Mikko Lehto -Date: Tue Jun 9 12:24:48 2015 +0300 +commit 691fc954638f7cca0843c4334b0317c0d9056697 +Author: Daniel-Constantin Mierla +Date: Sun Nov 6 22:40:42 2016 +0100 - modules/call_control: change type to fix clang compiler warning + corex: handle return code for ftell - call_control.c:503:19: warning: implicit conversion from 'hdr_flags_t' (aka 'unsigned long long') to 'int' changes value from 18446744073709551615 to -1 [-Wconstant-conversion] - (cherry picked from commit f6fc513ad968c40d1c990024c4985fa285ba93b6) + (cherry picked from commit 5488a913c53d16449146625da278eec8779fdbc5) -commit d9f15d4050422ebb16d6ad674a9e17a56068d330 -Author: Victor Seva -Date: Mon Jun 8 15:45:28 2015 +0200 +commit 9e38edfe368c2433f5bc418b211c7d8afa46c420 +Author: Daniel-Constantin Mierla +Date: Sat Nov 5 13:32:05 2016 +0100 - lib/srdb1: use 6 digits for db_double2str + usrloc: handle return code when registering the timer routine - acc module was getting values rounded by this - - (cherry picked from commit e1dcdf5a48cae9802c51c1d516d6fbc862855dcb) - -commit ea59701448584445ae692fb2ed5a408721e8a143 -Author: Victor Seva -Date: Tue Jun 9 11:03:28 2015 +0200 + (cherry picked from commit 9a152cbd15a84191418ecd3bbb56dff48438bfd1) - update version to 4.3.0~rc2 - -commit fa175afbfb0eeebccf1df65e5dd82d413f82551f +commit 2c6719c846a8d0bc6d2af5eae1bd6cd52f4cedfe Author: Daniel-Constantin Mierla -Date: Tue Jun 9 10:39:36 2015 +0200 +Date: Fri Nov 4 11:57:55 2016 +0100 - Makefile.defs: version set to 4.3.0-rc2 + tm: print warn messages when failing to update r-uri and path + + (cherry picked from commit 9f9e3162cd92b564323c9e77689f57c9dd0600bc) -commit f050389b568aaab3717484b67b9b157199c63bbc +commit 028a9698fd73f8db393f0b3a52d92c44c71591c6 Author: Daniel-Constantin Mierla -Date: Mon Jun 8 07:34:47 2015 +0200 +Date: Fri Nov 4 09:49:50 2016 +0100 - tm: extended docs for t_reply() + app_lua: safety check of returned anchor before using it - (cherry picked from commit a221ec34074c25838f470070cb6c7e604a33fc98) + (cherry picked from commit f109109a194abcc105f6d6a2e398d28e21870941) -commit 1a08fa07b601c5f9636c6dba223230ec91301768 +commit 2bee2094cdb212334b35ad438d0bfafd2409e3a8 Author: Daniel-Constantin Mierla -Date: Mon Jun 8 07:34:22 2015 +0200 +Date: Thu Nov 3 12:55:31 2016 +0100 - sl: extended docs for sl_send_reply() + auth_ephemeral: re-ordered code so access to sip msg is done after NULL check - (cherry picked from commit 29aa683f7c3d507a88b83ecd84d9023c5e162ab1) + (cherry picked from commit a471e4723206cdce7e9e319af344145b92444698) -commit 1eb9aacfc5f5b6936bcd6a4f4f219733c7cb7974 +commit 6a277771a8b70681f1525da34488a20cc0af658d Author: Daniel-Constantin Mierla -Date: Fri Jun 5 11:42:06 2015 +0200 +Date: Thu Nov 3 08:50:13 2016 +0100 - core: resolve negative index for dset before checking if it is last branch + lib/binrpc: memset addr variable to avoind uninitialized fields - - faster dropping of last branch - - (cherry picked from commit f8f40045e1370002076f568a1e73e0b4b67e9d66) + (cherry picked from commit 0cc0b643ee6442a13f257e3d72b826f257501204) -commit e5452003a5219e50d26baa72e773fa1690b45a3d +commit 681390a210666a854b4d43ca82bf9fe73f2c4c63 Author: Daniel-Constantin Mierla -Date: Fri Jun 5 11:41:21 2015 +0200 +Date: Thu Nov 3 08:47:01 2016 +0100 - pv: convert negative index to positive position for $branch(...) + rtpengine: init all struct to get rid of compile warnings - - better access to branch structures - - (cherry picked from commit 6461b799ce64315b72b8e2f4f7e4617603330833) + (cherry picked from commit 76e2a0dd05aa1a6fb3148c231d57cd2278ced9d2) -commit 6ebecf0eb1ec1c171adda651ce4aff775cd75547 +commit 6ee1432b37f9e2c14a99dbf1b8bfd277b2aa66b6 Author: Daniel-Constantin Mierla -Date: Wed Jun 3 14:49:01 2015 +0200 +Date: Wed Nov 2 23:37:43 2016 +0100 - mtree: readme regenerated + mi_rpc: init structures to avoid access to invalid content in case of errors - (cherry picked from commit c36b93f61a7fe76321aab8e62e1bbeee5122c5ed) + (cherry picked from commit f609a83e58eccae409a5966a002edba389bbc372) -commit 9e05772c277f487d0c5bacdb33b1aaa8634e133f +commit b24b6ee427c4b70c4a0508705f7ca9cd77537c17 Author: Daniel-Constantin Mierla -Date: Wed Jun 3 14:48:38 2015 +0200 +Date: Wed Nov 2 23:23:20 2016 +0100 - mtree: more details about what module does and max prefix size + mi_fifo: close fifo stream in case of errors - (cherry picked from commit 74fadc549929d3dc873ce3b8b1db20559562ab54) + (cherry picked from commit 66bb1a55f4e1b6e8dbfd8fbc3c6625e356daa734) -commit bfe40dd69e154b90820d8e87ea5ea46e51601e54 +commit 00b0447dee3d4c061ffde8b2a2660d518e5a2deb Author: Daniel-Constantin Mierla -Date: Wed Jun 3 14:38:24 2015 +0200 +Date: Wed Nov 2 23:18:00 2016 +0100 - mtree: internal prefix max size set to 64 + ctl: proper trim for long error messages to avoid out of bounds access - - allow for larger prefix values to be used (e.g., case of uuid, ipv6) - - db corresponding field still set to varchar(32) - - (cherry picked from commit 47086a4ee0a6ee6a766d7591e91e5663acf31562) - -commit 626de5dac2715507c5fb19f8056183b4ca6a1da8 -Author: Carsten Bock -Date: Mon Jun 8 13:47:55 2015 +0200 - - ims_charging: In case of Tel-URIs, use type END_USER_E164 and STRIP tel: (Bugfix) + (cherry picked from commit aeb9b5af7099ef3f8d3df02dcde1617fe22e4e46) -commit 803321f14153fb0ae87f99771c5d03ec6783dddd -Author: Mikko Lehto -Date: Wed Jun 3 15:44:52 2015 +0300 +commit 4aa0ee1c31f3bd2e4fca7f129e17c8b90a601511 +Author: Daniel-Constantin Mierla +Date: Wed Nov 2 16:33:03 2016 +0100 - modules/call_control: fixes clang compile warning + debugger: re-order loop condition to avoid out of bounds access - - warning: expression which evaluates to zero treated as a null pointer constant of type 'void *' [-Wnon-literal-null-conversion] - (cherry picked from commit 18038c2ea3b22cad9099719ecc999266b90e8786) + (cherry picked from commit ef4d771a2511ba6c288d85c6312ea25990a76669) -commit 04f86d265a0d26f8dd25bf0ed353ee173b614204 -Author: Victor Seva -Date: Wed Jun 3 09:56:06 2015 +0200 +commit cd0f82569d840fff3ad86dcacebdbfd4875bd912 +Author: Emmanuel Schmidbauer +Date: Wed Nov 2 13:18:15 2016 -0400 - seas: fix gcc warnings: + janssonrpc-c: fix double free introduced by + cf8d6066afc102d5904dddec0275079885f0ead1 - statistics.h:76:20: warning: ‘destroy_seas_stats_table’ declared ‘static’ but never defined [-Wunused-function] - statistics.h:82:19: warning: ‘print_stats_info’ declared ‘static’ but never defined [-Wunused-function] - - (cherry picked from commit 6d9abe14cf63e8c4683a8753ad6ae417f6f21ff0) + (cherry picked from commit c73a7eab210c7806c9d5fadacac1d3acc0ad6580) -commit 9371b5326bd1b8e01172e184b721d24de9768d0f -Author: Victor Seva -Date: Fri May 22 11:00:15 2015 +0200 +commit d04cab42b74e9dcff08ece0fd2b371d18f9de6bc +Author: Daniel-Constantin Mierla +Date: Wed Nov 2 15:42:55 2016 +0100 - tls: fix gcc warnings: - - tls_domain.c:507:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] - tls_domain.c:537:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] - tls_domain.c:544:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] - tls_domain.c:576:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] - tls_domain.c:1096:5: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] - tls_domain.c:1104:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] - tls_domain.c:1111:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] - tls_server.c:222:3: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] - tls_server.c:565:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] - tls_server.c:843:5: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] - tls_server.c:877:5: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] - tls_server.c:1231:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] - tls_server.c:1265:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] + ratelimit: close file pointer in case of scan error - (cherry picked from commit 7a33987ab4e74266cd0ccecbe14f7196f97a0f05) - -commit a4e9f2234f29928520cca83843d5d6aa387518ad -Author: Carsten Bock -Date: Tue Jun 2 20:20:17 2015 +0200 - - registrar: ptr->sock may not be available, as we received the info on a different channel (e.g. reginfo) (bugfix) - -commit ba0ca983042d5632d3b90e12a6530a41b812f5ef -Author: Victor Seva -Date: Tue Jun 2 13:12:17 2015 +0200 + (cherry picked from commit 90284a0f43a6782d0241e1e48c0dcfc3b084ddeb) - pkg/kamailio/deb: update version to 4.3.0~rc1 - -commit 8492893110c972af5f2b1ee3ffd45ba0ef5fd9f5 +commit 23a74318bcf9eff7e6782e927abe010be67cef4a Author: Daniel-Constantin Mierla -Date: Tue Jun 2 12:04:17 2015 +0200 +Date: Wed Nov 2 15:37:50 2016 +0100 - Makefile.defs: version set to 4.3.0-rc1 + mi_fifo: close reply stream in case of continuing due to no response + + (cherry picked from commit 29c96974fe80b1f19200314231f961fbf2689673) -commit b63dd52685970914e11c670bae5ac6b2191595f1 +commit 72e2f13cba93572399cd09b793652b0fac4fcecf Author: Daniel-Constantin Mierla -Date: Tue Jun 2 11:51:35 2015 +0200 +Date: Wed Nov 2 15:26:53 2016 +0100 - kex: fix some pkg.stats value for PROC_NOCHLDINIT rank + core: init structure to 0 for pass fd operations - - initialization of stats cannot be executed in child_init() for such - case, do it with first rpc request - - (cherry picked from commit 6fc4065f56d2d7929494f0e6f3dfcdb80ef0a4ec) + (cherry picked from commit d6d15685e170693048a92a535620117003fe882c) -commit 78b7a2ebef0d9d4997d130a4190f24408c2c7e96 +commit 16ee8fe47cb368cccc7eef675eae9528bc85150d Author: Daniel-Constantin Mierla -Date: Tue Jun 2 11:12:19 2015 +0200 +Date: Wed Nov 2 15:21:28 2016 +0100 - uac: re-enable TM callback when needing to do authentication for uac_req_send() + app_python: dname is always allocated in system memory - - regretion introduced by ebb1594a0 + - pointing it to static string will crash the free at shutdown - (cherry picked from commit 422c77fecfaed995f08cc11264a63ee0ff61efba) + (cherry picked from commit 46daf3011d077e359274ff3322440d50625ce5e5) -commit 80f6513abe1831748f1dffa283647abe21c23232 -Author: Carsten Bock -Date: Mon Jun 1 17:15:59 2015 +0200 +commit ef41e57c7a2045ae32c99f226aa2d17512be7362 +Author: Emmanuel Schmidbauer +Date: Wed Nov 2 10:15:49 2016 -0400 - uac: Execute event-route [uac:reply], if evroute is set (Bugfix) + janssonrpc-c: fix shared memory leak on notification requests - (cherry picked from commit ebb1594a0d95548673697f1e9553a10c93fc460e) + (cherry picked from commit cf8d6066afc102d5904dddec0275079885f0ead1) -commit 28a8c966ba4334ea68ef90d74e49d705dfdff830 -Author: Victor Seva -Date: Fri May 29 12:47:03 2015 +0200 +commit 89c2dd3c1e42b18a4df74970c33ca429c5b73ba8 +Author: Daniel-Constantin Mierla +Date: Wed Nov 2 15:08:42 2016 +0100 - uac: fix spelling error + dialog: secure space in case \r\n needs to be added after extra headers - (cherry picked from commit a2de9d6f3af59951c06d0a12e205e1d5814213a6) + (cherry picked from commit e4d17429ce0437fe9ba2ff7fe3e1ef7947b8f97e) -commit aac276a7fe9b518c147bc99cd31e732de2f3eadd -Author: Camille Oudot -Date: Tue Jun 2 10:24:49 2015 +0200 +commit 57a6012fdc07c3405f68330c58ac6f63ce9027f1 +Author: Daniel-Constantin Mierla +Date: Wed Nov 2 14:07:36 2016 +0100 - mem: TLSF remove unused function - - this removes one compiler warning from the issue #185 + rtpengine: free addrinfo in case of unknown address family - (cherry picked from commit 0fcbe4eb0fb5037f52e7d8338cff4f88b03a7969) + (cherry picked from commit a311bfba4c03bc261403d8d06fcec1a396b4284d) -commit d97561918588f792a2ddfbb0affbd5538f28f4a6 -Author: Victor Seva -Date: Tue May 26 22:36:37 2015 +0200 +commit 4dbabb65047f2b80fea23e4df69a91a7bbd691ab +Author: Daniel-Constantin Mierla +Date: Wed Nov 2 14:04:39 2016 +0100 - pkg/kamailio/deb: add erlang package module + statsd: one more increase for milliseconds buffer - (cherry picked from commit da3e31a20b95c86a17c8eb43a1a016b055fb8c9b) + (cherry picked from commit 8084551cee27f7eea3011a0379622009601e0366) -commit 7e13d0a450e0b9d9f3dd1ca90a66f906107596bc -Author: Victor Seva -Date: Tue May 26 22:59:43 2015 +0200 +commit c4cefde21c3c31c8812a844712722f6e1a0bf8ea +Author: Daniel-Constantin Mierla +Date: Wed Nov 2 14:01:52 2016 +0100 - Makefile.groups: add statsd and rtjson to extra group + statsd: free srv variable in error handling - (cherry picked from commit 5e59fb4f7e156eb78f821fb170b0d02c77fa1ea9) + (cherry picked from commit f6f6c7f55d5d1a60c1beb6091744116a6b85b397) -commit 3a9c5494958fd0a9d9072804860c19474af14432 -Author: Seudin Kasumovic -Date: Thu May 28 18:12:02 2015 +0200 +commit 20b9a54e3890e1880e7a325499b69b0ddd3e731c +Author: Daniel-Constantin Mierla +Date: Wed Nov 2 13:58:07 2016 +0100 - erlang: fix build on squeeze and precise - - Check if defined decode of unicode atoms type. + statsd: increase buffer for miliseconds printing as function uses 21 size - (cherry picked from commit 63127b261668e0efdea5b0ddb5f16a03dd9f02bc) + (cherry picked from commit 511b324fc89109de1665144bea0b9162aea35eac) -commit 6bb3aed24281ece3c117c583c9a317def949e884 -Author: Hugh Waite -Date: Fri May 22 09:28:52 2015 +0100 +commit bca73e920b2fa434a46fe5c3c9cab8f69cb1a29c +Author: Daniel-Constantin Mierla +Date: Wed Nov 2 13:54:39 2016 +0100 - registrar: Fix insertion of ulattrs xavp into position 0 + auth_identity: safer condition not to overflow building date header - - If the first entry is an XTYPE_NULL entry it is replaced, not pushed down the stack - (cherry picked from commit 12098415cda75ed10d4d7c75602630b90ef6afd1) + (cherry picked from commit 1f2b5af4bb8f0dd562ef33589736c9ab4b48b7e1) -commit b30f6c85d40b66049fd118a7f60bad3adc52e7bc -Author: Hugh Waite -Date: Tue May 26 16:30:23 2015 +0100 +commit 1542b89f9b77b84303bc92f9855b144c9d27112d +Author: Daniel-Constantin Mierla +Date: Wed Nov 2 13:50:42 2016 +0100 - core: Fix typo in xavp header file + presence: free cloned dialog_id in case of errors - - Corrected avpx_free to xavp_free - (cherry picked from commit c1b486d199349efc931975dc90924962e8b2b353) - -commit a3be39c63bdfef9d75cd554859e64d2f0cacbe26 -Author: Victor Seva -Date: Tue May 26 20:57:15 2015 +0200 - - pkg/kamailio/deb: update version to 4.3.0~rc0 + (cherry picked from commit 1d2c16c2c65d65bc6bb348800a935712eacfaca9) -commit 3552120b39f7728ab0aeae8654a02ca491ceb6d4 +commit 852a82c330d5c73b6c402e519e3d6ec8ac610665 Author: Daniel-Constantin Mierla -Date: Mon May 25 23:49:00 2015 +0200 +Date: Wed Nov 2 13:39:44 2016 +0100 - Makefile.defs: version set to 4.3.0-rc0 - - - branch for release series 4.3 + jansson: init structure to avoid compile warnings -commit 9e6a94861ff9529b016f4babfd58260d01e16a0c -Author: Seudin Kasumovic -Date: Mon May 25 15:24:38 2015 +0200 +commit ca4083f37326188cc5c64a148854b239234515df +Author: Daniel-Constantin Mierla +Date: Wed Nov 2 13:36:36 2016 +0100 - erlang: prefix exported pseudo-variables - - - add prefix 'erl' to exported PVs - - update documentation - - regenerate README + xmpp: shift head of connection list when first is closed -commit 88b2ab74801441cb3857245863a5eee2a67c8063 -Author: jaybeepee -Date: Mon May 25 12:28:12 2015 +0200 +commit d29fd2852f9125f88e52312cf6b0f78355a5db3a +Author: Kamailio Dev +Date: Wed Nov 2 11:01:24 2016 +0100 - modules/ims_usrloc_scscf: strip off port param when searching for term user + modules: readme files regenerated - crypto ... -commit 15b0626f57f2b5dbe56e668a9435d683034a0277 -Author: Seudin Kasumovic -Date: Mon May 25 10:52:44 2015 +0200 +commit e20230bb36f0ca63cdb0dd81c1d6a87279fe40bf +Author: Daniel-Constantin Mierla +Date: Wed Nov 2 09:39:57 2016 +0100 - erlang: fix compile warnings + core: parser/parse_diversion - allow comma separated bodies - Avoid compile warnings on 64bit. - -commit 01f4a230dc15b9564c101d03811eac9189f91210 -Author: Seudin Kasumovic -Date: Mon May 25 11:00:27 2015 +0200 - - erlang: fix Makefile problem + - still only the first body is cacshed in msg->diversion + - reported by GH #841 - Read from Erlang shell include and library path. + (cherry picked from commit 47f1ff4d31101c8a8d16a08b3c2f1069b85b3d47) -commit d46f3f642f491968e06faea4eb1aab30ff7582fd -Author: lucian balanceanu -Date: Mon May 25 10:49:36 2015 +0300 +commit d4169f1b598c6e92a470d2f12259333cec7a5d56 +Author: Daniel-Constantin Mierla +Date: Tue Nov 1 15:37:08 2016 +0100 - acc, dialog: change cdr dialog duration + janssonrpc-c: declare variables at beginning of netstring_read_fd() - - CDR duration for timed out acknowledged dialogs is no longer left empty + (cherry picked from commit 30cdc11f30e10bca5821609d86d31ffc1b5bd3c8) -commit cc8536657abe6d98db1634d4672465aae924faf1 -Merge: b7a0782 e76577a +commit 05a7e71cca01325095cfcd2315f6ea66d5c21913 Author: Daniel-Constantin Mierla -Date: Mon May 25 09:01:34 2015 +0200 +Date: Tue Nov 1 15:33:16 2016 +0100 - Merge pull request #172 from mslehto/patch-2 + rr: removed unused assignment - modules/tmx doc: t_reply_callid() works also for other requests than INVITE + (cherry picked from commit 6b1d18c3ba184b60a7be567f23ba4cda6efee4af) -commit b7a078289d0a2e58a1b10c97e067df956f3527ec -Author: Seudin Kasumovic -Date: Sun May 24 20:22:03 2015 +0200 +commit 36c939dfe75cec797cfdd7caa3f9aed83d554a28 +Author: Daniel-Constantin Mierla +Date: Tue Nov 1 15:30:18 2016 +0100 - erlang: remove annoying logs + core: parser/sdp - init pf variable to avoid compile time warnings - Remove unnecessary LM_INFO logs. + (cherry picked from commit d7871cd82e22bfe8444e2d150b38565265343223) -commit 922f4b0b383223b3ba75ec69a5cf5e292950d353 -Author: Seudin Kasumovic -Date: Sun May 24 16:40:48 2015 +0200 +commit b813a47ea5aa8ee322f238e529fc008d1acbcfff +Author: Daniel-Constantin Mierla +Date: Tue Nov 1 15:14:41 2016 +0100 - erlang: New pseudo variable for Erlang reference + mi_datagram: safety check so the length of mi socket doesn't result in overflow - - introduce new pseudo variable for Erlang reference. - - document $ref variable + (cherry picked from commit d4f3c96cdf2efc8db8fa115a35f7ea9545ea4c9f) -commit fd98d373882f5e48070db2a58a50a92b9a688c78 -Author: Seudin Kasumovic -Date: Sun May 24 15:33:55 2015 +0200 +commit 2cffb6ffd4e6b082098301cf584f613df1b8072f +Author: Daniel-Constantin Mierla +Date: Tue Nov 1 15:07:54 2016 +0100 - erlang: Fix parameter capabilities check + domain: fixed typo in the log message + + - fixed warning on allocating hash_table with a different size than the + content of the pointer + - coherent indentation and whitespacing - Fix check getters of erl_send parameters. + (cherry picked from commit 96fea675022cc923e4f253454b5095fa810ab313) -commit 70e177fe1ba1792e8842efa9d5746bda75380b65 -Author: Seudin Kasumovic -Date: Sun May 24 12:42:29 2015 +0200 +commit fd5b6e83ffac3137d43792edd5feef9e4ff7f74c +Author: Mikko Lehto +Date: Thu Oct 20 23:13:31 2016 +0300 - erlang: Fix memory leak + modules/crypto: fix small typo in documentation - Free memory used for format/print Erlang process id PV. + (cherry picked from commit bb62b0f32543e6961972679cfe34c48091329a63) -commit e76577a2c6d8d0628ff9548e5cbfee0302a41e15 +commit c54fc3126fb5f4139b41e016aaf320a954c2f9ab Author: Mikko Lehto -Date: Sun May 24 20:11:55 2015 +0300 +Date: Wed Oct 19 22:14:14 2016 +0300 - modules/tmx doc: t_reply_callid() works also for other requests than INVITE + modules/dispatcher: fix small typo in documentation + + (cherry picked from commit 02482d1b71dc618467978b060bc23bfedaa502fb) -commit 5469dcda0d4ad7b29fa1ede5ffdd62e45af3315a -Author: Richard Good -Date: Sat May 23 14:16:39 2015 +0200 +commit 2e7869c8dfd059f4cf5d5d0f7d31fd8a2b2692f0 +Author: Mikko Lehto +Date: Thu Sep 15 07:38:25 2016 +0300 - modules/ims_registrar_scscf: send full notify information when contact changes instead of partial + modules/sanity: fix small typo in documentation + + (cherry picked from commit 463569b8b0c2e29da1c82683e8edab0c2f67a9da) -commit fe7351d586b56237669a29f15dcdf83b78136cb4 -Author: Juha Heinanen -Date: Sat May 23 09:20:05 2015 +0300 +commit e3b8f63bfe3f6e220672c5cb9de1ee8e8150ffa2 +Author: Mikko Lehto +Date: Mon Sep 12 18:31:17 2016 +0300 - modules/usrloc: added note about handle_lost_tcp in DB-Only scheme + modules/nathelper: fix small typo in documentation + + (cherry picked from commit 90781fc664ab3b843390c67f6367240a513828c0) -commit e15e6d8cfd70b0abbeb499fb1483cc468624c0f9 -Merge: 75ba3ef 9863657 -Author: Seudin Kasumovic -Date: Fri May 22 22:50:02 2015 +0200 +commit e94ff2a8f9347e3d61bb1b5e7e9fdd2f33800a44 +Author: Daniel-Constantin Mierla +Date: Mon Oct 31 20:48:45 2016 +0100 - Merge branch 'seudin/erl_send' + lib/srutils: srjson - init number value for null, true and false + + (cherry picked from commit 2c22664610de2a007bbb881fead5640048ed24ba) -commit 98636573959ac17901e8640c116b2fcac2694440 -Author: Seudin Kasumovic -Date: Fri May 22 17:48:08 2015 +0200 +commit 7e85486f93c101f69df8aec97492ea36a14bd2f8 +Author: Daniel-Constantin Mierla +Date: Mon Oct 31 20:45:18 2016 +0100 - erlang: erl_send function + jsonrpc-s: switched to use json helper macros for numbers - - erl_send function sends Erlang message to process - - appropriate API function send - - documentation for erl_send and API - - examples according to el_send usage - - regenerate README + (cherry picked from commit 2853500cc73a5dfc66654e6f3555c1c40e072817) -commit 75ba3ef01c08027e5694419e9c923fef02262daa -Author: Seudin Kasumovic -Date: Fri May 22 15:46:11 2015 +0200 +commit 704a21b462dcc740cd8763c1c80229304edc0241 +Author: Daniel-Constantin Mierla +Date: Mon Oct 31 20:36:13 2016 +0100 - erlang: Fix detecting event route + rtjson: use json macros to retrieve int values - Ensure proper detect event route and lost connection in erl_reply. + (cherry picked from commit b8d6b99a36e57b65f7b7d9fba321e2088032178b) -commit 2143d1eb56bd3a9a775494afaa0e71d6f584d5bb -Merge: c02e165 a19337d -Author: Victor Seva -Date: Fri May 22 15:03:27 2015 +0200 +commit d6daa134c5b908a7c202af213758cff12ba4517e +Author: Daniel-Constantin Mierla +Date: Mon Oct 31 20:25:13 2016 +0100 - Merge pull request #170 from kamailio/vseva/distclean + htable: switched to json macros for numbers in dmq operations - Makefile: use distclean as shortcut of maintainer-clean + (cherry picked from commit 114ec80c58f06c876fc76d884b73095c5dcc8bff) -commit a19337d305ba13ade7c30bfaa2926ee1d63930d9 -Author: Victor Seva -Date: Fri May 22 13:50:44 2015 +0200 +commit 2a37ae7f9c712951034d41107ab2aa9aec1be736 +Author: Daniel-Constantin Mierla +Date: Mon Oct 31 20:18:34 2016 +0100 - Makefile: use distclean as shortcut of maintainer-clean + dmq_usrloc: use usigned int for contact info values - Fixes: #167 - Nowadays people expect distclean to be the rule to do the cleaning + - switched to using json helper macros for numbers + + (cherry picked from commit f68f0864c77e8556e48db4d5681ba8dc3ea06f62) -commit c02e165cc7a44e525dd55714c4471f1236e96b43 +commit e443eba3010a24a02bb73d15f1f7d55cf826b777 Author: Daniel-Constantin Mierla -Date: Fri May 22 12:43:55 2015 +0200 +Date: Mon Oct 31 20:12:58 2016 +0100 - lib/srdb1: use last @ as delimiter for start of host in db url + dialog: converted to use json helper macros for dlg profile - - allow @ to be part of password - - reported by GH#169, Debojit Kakoti + (cherry picked from commit d7653eb9e7e6ffe21988f2a616deae0c01083c57) -commit 46cc69f229e5e005cca60f64ec6c40c910e2043b -Merge: f9be1bd e15d415 -Author: Victor Seva -Date: Fri May 22 11:15:46 2015 +0200 +commit eb63cc8639e10a9fe413b6a29c31ab5d07a028eb +Author: Daniel-Constantin Mierla +Date: Mon Oct 31 20:10:36 2016 +0100 - Merge pull request #168 from kamailio/vseva/gcc_warnings + lib/srutils: removed valueint field from json struct + + - numbers are stored in the valuedouble + - helper macros added to retrivie fixed type numbers - clean some gcc warnings + (cherry picked from commit ecd22245336f2d3d6d2f9404ebfdd4369f19bd97) -commit f9be1bd71323244af598a54380d941722b60b40c -Merge: a5b3917 77382a7 -Author: Seudin Kasumovic -Date: Fri May 22 11:12:12 2015 +0200 +commit 5bb035929c81ab16b06694316b67582c599b88ea +Author: Daniel-Constantin Mierla +Date: Mon Oct 31 15:28:22 2016 +0100 - erlang: Merge fix error messages + ndb_redis: get the srv structure after checking parameter sanity + + (cherry picked from commit c5681600a5fdd650a4830e77aca2b4804766ccfa) -commit 77382a7ff2ee3144991b013e5cabd535028e3e1e -Author: Seudin Kasumovic -Date: Fri May 22 10:53:44 2015 +0200 +commit b38167923bd13abb6bbe4d58a57ed053faa5e68e +Author: Daniel-Constantin Mierla +Date: Mon Oct 31 13:54:21 2016 +0100 - erlang: Fix error messages + uac: safety check for new uri to include only printable characters - Fix wrong function name in error messages. + - related to GH #833 + + (cherry picked from commit 49dd3315b7298addeaa85dd1628cd0a25ddef5b1) -commit e15d415323b44a93acd2d811fa3609af141e814e -Author: Victor Seva -Date: Thu May 21 23:33:39 2015 +0200 +commit d506cd01562cb23ddd1fa22d662a17b1ed3a5d86 +Author: Daniel-Constantin Mierla +Date: Mon Oct 31 13:21:27 2016 +0100 - purple: clean gcc warnings + uac: coherent indentation of code for replace from/to values - hashtable.c:39:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] - hashtable.c:39:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] - hashtable.c:39:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] - hashtable.c:39:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] - hashtable.c:43:2: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] - hashtable.c:43:2: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] - hashtable.c:43:2: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] - hashtable.c:43:2: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] - purple_sip.c:77:36: warning: variable ‘cipid_ns’ set but not used [-Wunused-but-set-variable] + (cherry picked from commit 00571fd1d07edbfb5950ca6786e898ecbc0b33f5) -commit a52859a6ed8c1ea2590e51e0c20d1f2553da1ec9 -Author: Victor Seva -Date: Thu May 21 23:21:25 2015 +0200 +commit ac19fef4e452fa7e4e29c41b96527f4a5a70f4ee +Author: albertollamaso +Date: Mon Oct 31 11:47:44 2016 +0100 - ims_isc: clean gcc warnings + permissions: doc typo fixed - mark.c:341:9: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 10 has type ‘int’ [-Wformat] - mark.c:341:9: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 8 has type ‘int’ [-Wformat] - mark.c:341:1: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 8 has type ‘int’ [-Wformat] - mark.c:341:1: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 6 has type ‘int’ [-Wformat] - mark.c:350:9: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 10 has type ‘int’ [-Wformat] - mark.c:350:9: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 8 has type ‘int’ [-Wformat] - mark.c:350:1: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 8 has type ‘int’ [-Wformat] - mark.c:350:1: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 6 has type ‘int’ [-Wformat] - mark.c:357:9: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 13 has type ‘int’ [-Wformat] - mark.c:357:9: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 11 has type ‘int’ [-Wformat] - mark.c:357:1: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 11 has type ‘int’ [-Wformat] - mark.c:357:1: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 9 has type ‘int’ [-Wformat] + (cherry picked from commit 26c41e16512f04b7d83d66432a78f277852a8664) -commit c051cb8da9759676395603af1bfb4f1f26f9d2f6 -Author: Victor Seva -Date: Thu May 21 22:49:07 2015 +0200 +commit 5ae104fcf8753b13cce40b699249038a9ddac071 +Author: Daniel-Constantin Mierla +Date: Mon Oct 31 11:44:03 2016 +0100 - snmpstats: clean gcc warnings + core: parse addr spec - removed old style log message prefixes - hashTable.c:168:22: warning: variable ‘previousRecord’ set but not used [-Wunused-but-set-variable] - kamailioNet.c:973:18: warning: variable ‘value’ set but not used [-Wunused-but-set-variable] - snmpSIPRegUserLookupTable.c:462:25: warning: variable ‘var’ set but not used [-Wunused-but-set-variable] - snmpSIPStatusCodesTable.c:493:30: warning: variable ‘var’ set but not used [-Wunused-but-set-variable] + (cherry picked from commit 1a2918e2d962e2a61a8c185974e49fe9cc09c631) -commit 1874dd1062fbc186316ddc91ae87a22b18d16951 -Author: Victor Seva -Date: Thu May 21 22:45:05 2015 +0200 +commit 3b8172225eefcffee04c87851424a58319b3748e +Author: Daniel-Constantin Mierla +Date: Mon Oct 31 09:37:12 2016 +0100 - db_perlvdb: clean gcc warning + core: parser - use square brakets for log messages of addr-spec parsing - perlvdb_conv.c:99:2: warning: enumeration value ‘DB1_UNKNOWN’ not handled in switch [-Wswitch] + - replace angle brakets, which can mislead because they are part of + values + + (cherry picked from commit 7c43359e3c2ebe9aab8a69717225f83737d18345) -commit 0a1bb3f044ccf5dbb79eb03caec19553166c228e -Author: Victor Seva -Date: Thu May 21 22:16:21 2015 +0200 +commit 5f9c8a2966eccf977fd8c17a715446b180fd8ca3 +Author: Daniel-Constantin Mierla +Date: Fri Oct 28 16:09:02 2016 +0200 - pua_reginfo: clean gcc warnings + pua: fix propagation of ua_flag - it is func param, not in subs - usrloc_cb.c:68:6: warning: variable ‘buf_len’ set but not used [-Wunused-but-set-variable] + (cherry picked from commit 62c5d0d9cbd87a6b47c1a211588230ebc2652b8f) -commit 21f437840123471daa65da65999ff108ad11b33b -Author: Victor Seva -Date: Thu May 21 22:08:25 2015 +0200 +commit 6966751ea1fcf9cde904dc0762f20ff7592ac4df +Author: Daniel-Constantin Mierla +Date: Thu Oct 27 23:37:47 2016 +0200 - db_berkeley: clean gcc warnings + pua: one more proper propagation of ua_flags in subs_cbparam_indlg() - pg_cmd.c:183:17: warning: variable ‘pcmd’ set but not used [-Wunused-but-set-variable] - pg_cmd.c:372:17: warning: variable ‘pcmd’ set but not used [-Wunused-but-set-variable] - pg_cmd.c:396:17: warning: variable ‘pcmd’ set but not used [-Wunused-but-set-variable] - bdb_cmd.c:512:13: warning: variable ‘bcon’ set but not used [-Wunused-but-set-variable] - bdb_cmd.c:511:13: warning: variable ‘bres’ set but not used [-Wunused-but-set-variable] - bdb_con.c:52:13: warning: variable ‘buri’ set but not used [-Wunused-but-set-variable] - km_bdb_res.c:405:2: warning: enumeration value ‘DB1_UNKNOWN’ not handled in switch [-Wswitch] - km_bdb_res.c:498:2: warning: enumeration value ‘DB1_UNKNOWN’ not handled in switch [-Wswitch] - km_bdb_val.c:105:2: warning: enumeration value ‘DB1_UNKNOWN’ not handled in switch [-Wswitch] - km_db_berkeley.c:779:6: warning: variable ‘i’ set but not used [-Wunused-but-set-variable] - km_db_berkeley.c:907:6: warning: variable ‘i’ set but not used [-Wunused-but-set-variable] + (cherry picked from commit 1e2060c0e0aa28fc1c2129d5e5fe3e210827e850) -commit 70ad498b2ccc41db77b14c4c79393548cac8426d -Author: Victor Seva -Date: Thu May 21 21:56:50 2015 +0200 +commit 3f7c250a14f77c35e7dc5fd1678513705d859c7d +Author: Daniel-Constantin Mierla +Date: Thu Oct 27 23:36:03 2016 +0200 - db_postgres: remove gcc warnings + pua: copy over subs flag in subscribe_cbparam() - pg_cmd.c:183:17: warning: variable ‘pcmd’ set but not used [-Wunused-but-set-variable] - pg_cmd.c:372:17: warning: variable ‘pcmd’ set but not used [-Wunused-but-set-variable] - pg_cmd.c:396:17: warning: variable ‘pcmd’ set but not used [-Wunused-but-set-variable] + (cherry picked from commit 82e22fb36c5155d920b60e8cad689578eec8fb70) -commit 7b6aba346a8529187762c25f00609ec376fb3529 -Author: Victor Seva -Date: Thu May 21 21:24:39 2015 +0200 +commit 33aa99a906bf7f352fc6ba1d021348e314ba76b1 +Author: Daniel-Constantin Mierla +Date: Thu Oct 27 23:29:49 2016 +0200 - db_text: clean gcc warning + htable: earlier init of jdoc used for dmq for proper clean on error cases - dbt_raw_util.c:169:6: warning: unused variable ‘n’ [-Wunused-variable] + (cherry picked from commit 13ff91b1955d7248f8aaaf350675275e425443dc) -commit a5b39176e6195da22cd39a65e3ddb7c9fdf53592 -Merge: 301793c a61f325 -Author: Victor Seva -Date: Thu May 21 15:21:30 2015 +0200 +commit f82b12c5a34c299b7e37c5f1049ed9cac6e493c4 +Author: Daniel-Constantin Mierla +Date: Thu Oct 27 23:19:44 2016 +0200 - Merge pull request #166 from linuxmaniac/vseva/usrloc_callbacks + db_postgres: safety check of str buffer pointer before writing - usrloc: run callbacks after updating the info on DB_ONLY mode + (cherry picked from commit 8ed8d8349dad1e2abd2ac026b4540e9a296c866b) -commit a61f325589a3bef6164b1eca8bd93ca3dace4549 -Author: Victor Seva -Date: Thu May 21 14:08:07 2015 +0200 +commit e17aba9e458743c93c5637982afbc62799679719 +Author: Daniel-Constantin Mierla +Date: Thu Oct 27 23:13:31 2016 +0200 - usrloc: run callbacks after updating the info on DB_ONLY mode + lib/srdb1: fix the memset to 0 in util function + + (cherry picked from commit d7431dd190bb1f4aba8e2373807047ac6fe8db90) -commit 301793c4f10c860e263a243863f7b833ba3bb0f6 -Author: Juha Heinanen -Date: Thu May 21 14:28:57 2015 +0300 +commit 7fdfb649cc4a6992be70a67555aff1f8ef59fc9f +Author: Timmo Verlaan +Date: Mon Oct 24 22:19:51 2016 +0200 - modules/db_mysql: include (start of) mysql query to async query error message + rr: use default port for protocol if it is omitted in route header + + When using double route headers the selection of the outgoing + socket is only done on IP address if the port is omitted in that + route header. This fix defaults the port to 5060/5061 depending on + protocol so the correct listen socket is chosen. When no socket is + found it will fallback to the current behaviour keeping backwards + interoperability. + + (cherry picked from commit aaec127fbf1f3be41e49601330d7eafe7353c53a) -commit fbbadfde175ac1e414b10fc6a01abd09b4539fef -Merge: 7afe761 8810c00 -Author: Camille Oudot -Date: Wed May 20 22:57:31 2015 +0200 +commit 306cf67a03f07f55ec8d7049eaaa623f02b1cfd3 +Author: Ovidiu Sas +Date: Thu Oct 27 12:57:21 2016 -0400 - Merge pull request #164 from kamailio/tmp/tlsf_debug + permissions: update doc with missing MI and RPC commands: + mi: perm_domain_dump + rpc: permissions.domainDump - mem: TLSF memory summary and sums implementation + (cherry picked from commit 5b5ac65cc8adcecf940cf9098d99ad7bbaaddc07) -commit 7afe76191e9757770d2933e8c26f305c6ed388a3 +commit d8e27514f9f576d4653a15ebe8210f0d2739e661 Author: Daniel-Constantin Mierla -Date: Wed May 20 21:44:15 2015 +0200 +Date: Thu Oct 27 11:26:43 2016 +0200 - usrloc: use domain for testing db if use_domain parameter is set + rr: fixed typo in log message + + - due to previous commit + - reported by Alberto Llamas - - rework from the patch by Erik Davidson, GH#161 + (cherry picked from commit e310762f71afd3e290e709f2d6786d44ce15ee1a) -commit 408778069d24a31885df9ecd9f86bc3f9fce0af9 +commit 402fd315a9239806a669701827e6d47a6df7ddda Author: Daniel-Constantin Mierla -Date: Wed May 20 21:32:00 2015 +0200 +Date: Thu Oct 27 09:41:51 2016 +0200 - tm: restore to the disabled async mutex by define + rr: more log details when 2nd rr with r2=on is not matching a local socket - - following commits trying to remove it completely were removing the - internal transaction flags which were not related to mutex at all - -commit db13cefcaa39330b93bd06cf9337c7c1afe221a9 -Author: Victor Seva -Date: Tue May 19 21:12:31 2015 +0200 + (cherry picked from commit b814c5aadc690ceeca75e6ce25bf850ddfc4b44a) - manpage: sip-router.8 fix hyphen-used-as-minus-sign +commit e28a66fb3fd42226f477bc0efc8bbac59e5a2456 +Author: Holger Hans Peter Freyther +Date: Tue Oct 25 19:29:36 2016 +0200 -commit 8810c00f837a585d4dc6079640abc3251f0e70ca -Author: Camille Oudot -Date: Tue May 19 19:58:57 2015 +0200 - - mem: TLSF memory summary and sums implementation + pv: Use memcpy to copy len bytes instead of strcpy - TLSF now has a debug mode, that will dump every memory block when xxx_status() - is called, and a summary of still allocated blocks when xxx_sums() is called. + The sipcapture plugin stores bytes with VAR_VAL_STR and when + copying the data it would end up being truncated. Use memcpy + instead of strncpy and assume that the original string already + has the NUL termination (or not as with the hep plugin). - configure build with + Config example: - make MEMDBG=1 MEMMNG=2 cfg + $var(payload) = hep(0x00f) - to enable maximum debuging informations (source location of mallocs and frees) + (cherry picked from commit 2531dd069bc76f945c5c19253e35fe8b1ef9ed15) -commit a3f0fa72c7686df57d655391032236b3fca7ef50 -Author: Luis Azedo -Date: Tue May 19 17:36:53 2015 +0100 +commit 0d82942a6d7c30c577b60e7eda7e88480512847a +Author: Camille Oudot +Date: Tue Oct 25 11:32:35 2016 +0200 - kazoo : fix json transform + mem: TLSF bit ops cleanup / 64 bits improvement - $(kzE{Element[$var(idx)]}) was not evaluating $var(idx) - -commit 967ed551845044123f4e93c60091d7a1fa43692f -Author: Daniel-Constantin Mierla -Date: Tue May 19 15:13:49 2015 +0200 - - core: enable log_prefix for sip responses + - remove unsupproted compilers + - use 64 bits __builtin_clzl() instead of twice 32 bits __builtin_clz() - - reported by Klaus Darilion + (cherry picked from commit 0683df11e319aa3db45cd9b18af3a3c3b02088a8) -commit 497b6ad2cee8481ba1f3568ed7d8a836e508016a -Author: Hugh Waite -Date: Mon May 18 17:00:08 2015 +0100 +commit 4fb274c9654769468ecd1a7fd386b05bc6123b01 +Author: Emmanuel Schmidbauer +Date: Mon Oct 24 15:53:29 2016 -0400 - core: Fix crash in xavp.c + janssonrpc-c: fix memory leak when using janssonrpc_notification - - Inserting an xavp into a list can crash when inserting XTYPE_NULL padding entries + (cherry picked from commit c6b38e437387aba003bef8ef9496d5a7568e9c97) -commit fe379acb5f5956f60ac3304d8c01a3fa0719e0be -Author: Camille Oudot -Date: Mon May 18 12:27:12 2015 +0200 +commit a53c91ccf933a500e1858bac778f192592abe230 +Author: Daniel-Constantin Mierla +Date: Mon Oct 17 12:27:08 2016 +0200 - mem: fix TLSF max pool limit + dialog: propre reparse of msg structure when doing cseq refresh ops + + - triggering parsing from scratch always resulted in improper + propagation of parsing flags and failure to detect end of headers + - credits to Jöran Vinzens for assistance with troubleshooting + - GH #819 + + (cherry picked from commit dd0b7e403404a977707aa1524783111190cc5f3e) -commit 111aefd82f4f885be5a4d4d6a4a2ad432dba9e5e -Author: Camille Oudot -Date: Mon May 18 11:47:10 2015 +0200 +commit cc7b222b2752601648fc512d390aaaf1f79b7008 +Author: Chocolatbuddha +Date: Tue Oct 4 09:14:59 2016 +0200 - Revert "mem: TLSF use larger first level bitmap" + Presence: Fix startup inconsistency in presentity hash table - back to using 32bits bitmaps, limiting the maximum pool size to 512 GiB + pres_htable_restore(): Remove check of expired presentity entries when + initially filling the hash table to represent the number of expired + + valid entries. Because hash.c::delete_phtable() decrements publ_count on + removal of _every_ expired DB entry. + get_p_notify_body(): Compensate the fix on hash table restore by + checking for the expires time on building the NOTIFY. This also fixes a + problem when a SUBSCRIBE is received for an expired entry before the + cleaner can remove the entry from the DB. - This reverts commit 5e04515410c7d7ebedf6c4bc8c917f736b37acba. + (cherry picked from commit 1dceaa24ded727aba5870f28fb63e26ed98464f3) -commit 6de859e5a762c0c34382a4de99173fad2c6999c9 -Author: Victor Seva -Date: Mon May 18 11:20:00 2015 +0200 +commit 8ded27355991a098f22e1b70f3f5cfaf2e689cef +Author: Daniel-Constantin Mierla +Date: Sat Oct 15 18:47:38 2016 +0200 - pkg/kamailio/deb: update version to 4.3.0~pre2 + Makefile.defs: option to disable raw sockets at compile time + + make RAW_SOCKS=no ... + + (cherry picked from commit 0f3123426d3c9d8e10b8e74557d0791a6df85648) -commit 7e6083e3e2604e2a835e1bf1dbdbf55e6256aba0 +commit 871f864bd18643f5d5a64d3bbd989fc9fe992ed7 Author: Daniel-Constantin Mierla -Date: Mon May 18 10:34:49 2015 +0200 +Date: Sat Oct 15 18:39:05 2016 +0200 - Makefile.defs: version set to 4.3.0-pre2 + ctl: take in consideration runtime_dir when creation the ctl socket + + (cherry picked from commit 99f25469c5ce8070210769f9dfe2a16b7333c14d) -commit 6d32e8df95bd015202f75e9f313654aa41146e7e -Merge: e58d150 746152b -Author: Seudin Kasumovic -Date: Fri May 15 08:35:48 2015 +0200 +commit 293c8dbe6fb93162976d4bc8a8f0a654ba3bbdbf +Author: Daniel-Constantin Mierla +Date: Sat Oct 15 18:31:32 2016 +0200 - Merge pull request #163 from kamailio/seudin_erlang_fixes + ctl: split the definition of default ctl socket - erlang: fixes and new PV + (cherry picked from commit 26ed56da94fde2df51fa0e12e67a790922116d37) -commit e58d150a13ba3d0ef8ff3a15877f0cf891e57be8 +commit 4c60c2205923513d15761f248d9e64bdfbe503a4 Author: Daniel-Constantin Mierla -Date: Thu May 14 19:38:14 2015 +0200 +Date: Fri Oct 14 15:20:53 2016 +0200 - tcpops: return if connection is null when trying to set the lifetime + core: msg parser - more log message for get body function + + (cherry picked from commit 69a89021f95b19c803cff3919bf38be2cb1dbbd2) -commit 1db6fdf41dbb4b6c95e0f86dfebc4c793858d8b5 +commit 02f4834bc002717bd0527615b07a5f38946d820e Author: Daniel-Constantin Mierla -Date: Thu May 14 19:21:25 2015 +0200 +Date: Fri Oct 14 15:12:29 2016 +0200 - sipcapture: fix not to access freed pointer during shut down + core: msg parser - relocated static inline functions from header file + + - copes beter with latest compiler versions + - coherent whitespacing and indentation + + (cherry picked from commit a830e5271c4567073cef4fee0cde65f7c0979176) -commit ec438b45696e17af0a3b19bb7ac12b221f897517 +commit c7d59bd0daefd677e70a8ec2b69e8197c46dbe72 Author: Daniel-Constantin Mierla -Date: Thu May 14 19:16:26 2015 +0200 +Date: Thu Oct 13 14:27:44 2016 +0200 - core: safety check for linker when inserting xavp with index + core: print the len for added header in debug message + + (cherry picked from commit eb9d4e0fe99b0b81e9f33106e080112be22b28a5) -commit abdc02f1cb26c71b4118044d8c45dec728992e15 -Author: Daniel-Constantin Mierla -Date: Thu May 14 14:51:06 2015 +0200 +commit a84f0e1ec76a6999d3a5285e6e23007532d8e232 +Author: Phil Lavin +Date: Mon Sep 19 21:25:22 2016 +0100 - regex: replaced allocated memory initialization with a for loop to one memset + purple: Fix multiple memory leaks in DB code + + (cherry picked from commit a361686b2c872cad6493804eb71b8b8e7e151a4f) -commit f03c86ade6af9bc529a52f7fd50004721278ae19 +commit 3484127bedefd9ca7dc882ef2b458036b58ce099 Author: Daniel-Constantin Mierla -Date: Thu May 14 14:41:44 2015 +0200 +Date: Sun Sep 18 09:32:07 2016 +0200 - rr: reset lump pointer to avoid using it after free for remove rr function + pua_xmpp: fixed misleading missing guard for if block + + - coherent whitespacing + + (cherry picked from commit 52424c5e3748dbad9802a8c92bfda7c8457a9a62) -commit 5e5866b2ac8390caa9373f49345ed877c6e5f037 +commit 4ea04ef7c5c317d30c691915b9790bb3c3279c6f Author: Daniel-Constantin Mierla -Date: Thu May 14 14:36:24 2015 +0200 +Date: Sun Sep 18 09:17:32 2016 +0200 - regex: safety to check to avoid working with zero size allocations + presence: remove unused variable + + - coherent whitespacing + + (cherry picked from commit 1014788aa32468e734cd082d9c770adc7daa05e4) -commit ca220afe0f738f2353d16c96dd16ab279ffdcf74 +commit 07a023d03700a73b545a82b9de6930a5e9997e95 Author: Daniel-Constantin Mierla -Date: Thu May 14 14:29:12 2015 +0200 - - textops: safety check to know there is a string to add via lump - -commit 746152b878b8b2956d51db039633dc9a4e961337 -Author: Seudin Kasumovic -Date: Thu May 14 16:33:47 2015 +0200 +Date: Sun Sep 18 09:16:57 2016 +0200 - erlang: update documentation + db_perlvdb: fixed warning of using static function inside inline one - - document use of pseudo variable $pid(name) - - regenerate README + (cherry picked from commit 0f791078260f2ccfd22a268831fb8dcfb00b24f3) -commit f14a5c32a6ce77449f9191d672c24a0938f45558 -Author: Seudin Kasumovic -Date: Thu May 14 16:20:10 2015 +0200 +commit 0b2d30d79670e473c87d119ee305551723ba2f4a +Author: Daniel-Constantin Mierla +Date: Sun Sep 18 09:09:28 2016 +0200 - erlang: new pseudo variable for Erlang process id + ldap: removed unused variable - - introduce new PV for Erlang pid type - - export sender pid in event route of pseudo registered process + (cherry picked from commit 564f5c612999d762b24bcaf2047bb063d1d5ecbf) -commit 11667d316e92287affeb5034fe522679ea989ec5 -Author: Seudin Kasumovic -Date: Thu May 14 16:10:50 2015 +0200 +commit 98ffcd408ff536361faa70c91cd1c570f33005f2 +Author: Daniel-Constantin Mierla +Date: Sat Sep 17 11:38:12 2016 +0200 - erlang: correcting documetation + pv: adjusted indentation after if blocks to avoid gcc 6.2 warnings - - correcting title of example + (cherry picked from commit 8c169ba0919e46222f1732d6ab084f499ea2972b) -commit 7f76c92a7b2ddac30faa1f075111fc20b652ef69 -Author: Seudin Kasumovic -Date: Thu May 14 09:40:57 2015 +0200 +commit 592aad9ad1cb53ae868cb2a9e6f5e010790e6f58 +Author: Daniel-Constantin Mierla +Date: Sat Sep 17 11:31:14 2016 +0200 - erlang: delete unused code + tm: fixed misleading indentation of block after an IF (reported by gcc 6.2) - Delete unused function from code. + (cherry picked from commit b20b076e292fc7720352f64ccabb3caafbfae1d3) -commit 4a480ba9745b6874f86808fc21dcd750e00febd3 -Merge: 88b6757 733f5ad -Author: Hugh Waite -Date: Thu May 14 16:00:02 2015 +0100 +commit 1873b4536e5371e33a7135fafe862c2da81d452f +Author: Daniel-Constantin Mierla +Date: Thu Sep 15 15:35:04 2016 +0200 - Merge pull request #162 from que273/master + core: parser - removed level and function prefix from log messages for identity info - app_lua: Fix memory leak in sr.modf + (cherry picked from commit d7b0c68b825222f139aaa16a73de23fe2c07312a) -commit 733f5ad7c9b2515c52b00875fb5dac689ddd9a17 -Author: Hugh Waite -Date: Thu May 14 13:54:20 2015 +0100 +commit 81df84b840bcb053400063f5b96d3d84179b11c5 +Author: Daniel-Constantin Mierla +Date: Fri Sep 16 22:06:06 2016 +0200 - app_lua: Fix memory leak in sr.modf + tls: updated bio functions to support libssl v1.1.0 api - - Free pkg memory allocated to store cloned function parameters + (cherry picked from commit fe99687608929b19be62412c334cf41e84845f81) -commit 88b67575f9457312d0277e16dc06103be3a31965 +commit 58daa3156bd4d22fa18ca00c99a99c426eeb76b1 Author: Daniel-Constantin Mierla -Date: Thu May 14 13:40:11 2015 +0200 +Date: Fri Sep 16 14:26:10 2016 +0200 - tm: safety check not to allocate 0 bytes in rpc command + tls: updates for compatibilty with libssl v1.1.0 api + + (cherry picked from commit ef021552162e281c694a4f4b420aa1c642db5066) -commit af9deb9026a271aa3a1bdbb5685b63e3e78772bd +commit f97df2e6d4b9c721c97bcbd3b5930530604a127a Author: Daniel-Constantin Mierla -Date: Thu May 14 13:33:50 2015 +0200 +Date: Fri Sep 16 12:49:50 2016 +0200 - core: safety checks for swich statements with no case branch + crypto: updated to be compatible with api from libssl v1.1.0 + + (cherry picked from commit 8d83571658471f162e35cb54ba7e3baecbe7970d) -commit 0db313f0047fc512dec2976cac168989b60d49c8 +commit b29217e8036ead0d09c52616000d6b68d4512f86 Author: Daniel-Constantin Mierla -Date: Thu May 14 13:24:38 2015 +0200 +Date: Thu Sep 15 19:33:04 2016 +0200 - tmx: check for empty result not to allocate 0 bytes + auth_identity: still use ASN1_STRING_data() for libssl < v1.1.0 + + - from libssl v1.1.0, ASN1_STRING_data() is deprecated, but before it + doesn't exist + - reported by Victor Seva, GH #685 - - allocation of 0 size is undefined when using system malloc + (cherry picked from commit 8a46f415fb13b76fa3b071eecd7dc0401f99759e) -commit 646bcf919e5c33dac21985254a0065d41a03f62d +commit 0f2a129e4f1790f8d6502ac224b480d60126fb09 Author: Daniel-Constantin Mierla -Date: Thu May 14 13:19:58 2015 +0200 +Date: Thu Sep 15 16:30:30 2016 +0200 - db_text: fixed leak for raw query where bulding + auth_identity: switched to use pointer of X509_STORE_CTX + + - starting with libssl 1.1.0 the size of X509_STORE_CTX is not known at + compile time, throwing error: + + error: storage size of 'ca_ctx' isn't known + X509_STORE_CTX ca_ctx; + + - reported by Victor Seva, GH #685 + + (cherry picked from commit 46f0f1c0f492c45c1b1bbcfd4a0cc63eb56480ea) -commit 2d40e14d2b0b150acd34ac2d1df25936d8faaca9 -Author: Daniel-Constantin Mierla -Date: Thu May 14 13:15:06 2015 +0200 +commit 0cd00fc0c84b1d3d80fff9ae809835057bbe6a4e +Author: Federico Cabiddu +Date: Wed Oct 19 11:31:54 2016 +0200 - presence_xml: better error handling to free all allocated vars + modules/tmx: fix mi command t_uac_cancel + + (cherry picked from commit 81be737f29cbb9e4fd67a09cf2207150b2649e91) -commit 1b20aa04048d15d0861b3f5291fd3b9a1614fdf5 -Author: Daniel-Constantin Mierla -Date: Thu May 14 13:09:47 2015 +0200 +commit df4bba3f82b97fb9dc1b86b681060b8250a9be20 +Author: Federico Cabiddu +Date: Mon Oct 17 09:50:36 2016 +0200 - pua: mark that tupple was allocated so can be freed in case of errors + tmx: fix condition for private copy of the message + + (cherry picked from commit 6913d30ccf2ea5a818180053453ace4b482b8d30) -commit 379667e878c9e0795998f600edbcbb3974846f71 +commit e91aec21e7f7a6f86120d1c9167b04d420369294 Author: Daniel-Constantin Mierla -Date: Thu May 14 13:01:18 2015 +0200 +Date: Mon Oct 10 11:41:24 2016 +0200 - regex: reset pointer after free to avoid double free if an error occurs + websocket: catch CRLFCRLF pings over websocket connections + + - reported by GH #810 + + (cherry picked from commit 8fa51e52e9cf9dbae45069c9354cfeb36997dff9) -commit 29d7ca71fdfc8c52fb5e68fcf3bccf98dde0d089 +commit 19b4c38c9612e88cb8664fd21c98d86bb78b71b6 Author: Daniel-Constantin Mierla -Date: Thu May 14 12:54:18 2015 +0200 +Date: Mon Oct 10 11:40:41 2016 +0200 - imc: better condition to catch no result of database query + core: defined macro for CRLFCRLF + + - used in pinging over tcp, makes it more coherent to use + + (cherry picked from commit 6649cdf51520cfcc366f2839316c8d45c233421b) -commit c24329ed483ea3abd720af73411a2331acc947e4 -Author: Daniel-Constantin Mierla -Date: Thu May 14 12:28:29 2015 +0200 +commit 41806a15be4dfb99a2b4c708ffe521bc6ea53326 +Author: Dmitri Savolainen +Date: Fri Oct 7 19:23:41 2016 +0300 - presence: initialize result to avoid freeing garbage in case of other errors + presence: fix crush if dialog id is NULL + + - check dialog_id is not NULL before call delete_presentity_if_dialog_id_exists + + (cherry picked from commit d68d01262e59593e7976afea1b1c458815448e7a) -commit bd189f4239403b4b673f3d5b0ce3b6e5c7f4bacc +commit a45e9f67482e896ef83c061e3816af2ca0be5896 Author: Daniel-Constantin Mierla -Date: Thu May 14 12:25:33 2015 +0200 +Date: Wed Oct 5 17:19:17 2016 +0200 - mi_datagram: init structure before conditions to jump to err label + websocket: handle CRLF received inside a frame (as SIP layer ping) + + - reported by André Freitas, GH #810 - - garbage condition would have been made in err case + (cherry picked from commit 585c60f2cdbf4199b749f74fe795ec583ae9f99c) -commit c5ef9569d524ab49d538e85a905520b72e1d8dea +commit 28e622cf15b3fb220b5d02e3ad237417bdaaa66c Author: Daniel-Constantin Mierla -Date: Thu May 14 12:03:28 2015 +0200 +Date: Tue Sep 20 13:43:01 2016 +0200 - presence: initialize variable to avoid compile warning + core: print sip message on error related to missing body + + (cherry picked from commit 1ed9c2712fcfaf378875bc7e478b9481013841d4) -commit 23b476ed7c7b48ddd7cacf3d88e9c104db06d5dc +commit 65cb4a63c572260bcdc96a84a421c66cf3086dcb Author: Daniel-Constantin Mierla -Date: Thu May 14 10:25:47 2015 +0200 +Date: Tue Sep 20 11:40:07 2016 +0200 - core: init vars for socket ttl helper function to avoid warnings + core: rely on msg->last_header to get the anchor inside sr_hdr_add() + + - might fix GH #789 + + (cherry picked from commit 9483b5491f82dd18bbdaeee72fd43ec6e1fbfb8c) -commit f93d3c70b1b14665ddc11ca2c39e1d114390e5f9 +commit fad61c4b4e3c3b4430ac9f4d05cb3698f39c1c0c Author: Daniel-Constantin Mierla -Date: Thu May 14 10:17:56 2015 +0200 +Date: Sun Sep 18 09:22:58 2016 +0200 - dispatcher: init socket pointer to null + utils: coherent indentation for xcap functions + + - fix for gcc 6.2 misleading blocks warnings - - covers all situations, also when the afferent avp name is not set + (cherry picked from commit 883629aecc143528396fae0f88d434bfc0a047ca) -commit 80977adc1bd70479c1e32d867563e4e684060b25 +commit 3a32d65bbe103ea0caae418b946168ce774948c5 Author: Daniel-Constantin Mierla -Date: Thu May 14 10:04:26 2015 +0200 +Date: Sat Sep 17 11:17:44 2016 +0200 - pua: safety checks for str pointers + counters: fixed rpc command to get counter by group and name + + (cherry picked from commit f8e47835950fa472ef313b7f303b0989b76f9dbe) -commit 2c425c16efdc70e76d7471156f9f2c6eefa4b001 +commit 2372150f292363fd8c1705dfd69184e9a898f86a Author: Daniel-Constantin Mierla -Date: Thu May 14 09:59:58 2015 +0200 +Date: Thu Sep 15 16:26:43 2016 +0200 - drouting: extra safety checks for str pointers + auth_identity: fix misleading indentation level + + (cherry picked from commit e5532f05d7b2b6b8d90d01fd9e934a412c7168e0) -commit ed1322414eb46c75b9db22e76b6f9e64ce191ad4 +commit c0f428406a8ccc7fbbd910150e4d45a6addbae49 Author: Daniel-Constantin Mierla -Date: Thu May 14 09:55:20 2015 +0200 +Date: Thu Sep 15 15:30:13 2016 +0200 - tls: avoid compiler warning with extra check on char pointer + core: ut - fix misleading indentation for IF blocks + + - reported by latest gcc on debian sid + + (cherry picked from commit b7aa4b2cac495397f36fecb2e5bd5a0b80844346) -commit a318866c1c0efe4fb73d7f6c3cde538a67daa171 +commit 11971cbb21f9e7cface65251e7a991ffe8c9efc5 Author: Daniel-Constantin Mierla -Date: Thu May 14 09:51:07 2015 +0200 +Date: Thu Sep 15 15:26:39 2016 +0200 - ipops: init variables to avoid compiler warnings + core: proper code block when saving chosen naptr record - - use define wrapper for safety printing null strings + (cherry picked from commit a4b43f962a4493defb3fd608d1d2fad3ee58794a) -commit c7a8b95e02e286335d3b1ff531a0d2245525e629 +commit 7790adcfcd97540aeceb73a8ef556ae827007902 Author: Daniel-Constantin Mierla -Date: Thu May 14 09:43:14 2015 +0200 +Date: Thu Sep 15 15:19:37 2016 +0200 - userblacklist: initialize vars to avoid compiler warnings + core: fixed misleading indentation for return statement + + (cherry picked from commit fc65a118d15e7942adccd332996701cdb6f1b0c7) -commit 8b4a8d6a9f06ab66e718f9b0956d17bfc374a1d5 +commit 80bb7f1559017aafcfc0377538e7c9aa79150ff0 Author: Daniel-Constantin Mierla -Date: Thu May 14 09:38:13 2015 +0200 +Date: Thu Sep 15 11:16:12 2016 +0200 - rtjson: removed unnecessary variable + presence: expire value kept and printed in logs as unsigned int + + - code compacted for extracting subscription data - - it was mistakenly used in some expressions + (cherry picked from commit 770bae3ce1e1f561d575df689df067a7639f64c4) -commit cf1d885ae8b7c75e41373a0a649a6eb1c161efc7 +commit d546d5ea8a1ce442dcaad8592df55459666c7da5 Author: Daniel-Constantin Mierla -Date: Wed May 13 23:57:50 2015 +0200 +Date: Fri Oct 7 10:08:14 2016 +0200 - db_mysql: set back tick as quoting char for table and column names + core: allow '_' in event route name + + - reported by GH #811 + + (cherry picked from commit 5806703c1ff72243457ff55758f41c3f557d26fd) -commit ffbe9c2c0007cea5f6fd78dd14917be11643ac64 +commit 64a8927bd1f891c757a44fd31265ba4cd3a3d150 Author: Daniel-Constantin Mierla -Date: Wed May 13 23:55:35 2015 +0200 +Date: Wed Sep 28 16:41:42 2016 +0200 - lib/srdb1: mechanism to be able to quote table and column names + dialog: no need to release the dialog when refreshing cseq - - new field in db1_con_t with the char for quoting + - no direct reference was triggered inside the function + + (cherry picked from commit 3f9969d1790dd8d9349c0fa450c589f8038c43cc) -commit 98f2b39450ef3e99f557fdf5bb291646b610ba28 +commit 1987a419fbd551b6bc4550fe4f991a2a9d2ed2fb Author: Daniel-Constantin Mierla -Date: Wed May 13 22:24:28 2015 +0200 +Date: Wed Sep 28 11:54:32 2016 +0200 - kamctl: regenerated mysql creation scripts + dialog: wrapper defines for ref/unref operations to get file name and line + + (cherry picked from commit be77f34091f63042b4df4d5445fc16c1da3ddcd9) -commit 15516b1e4ab3c85a7b65336d843b25b81164ae35 +commit a83ca56b8481d7f0a13f6b4ba7aee7f2dbf4bb52 Author: Daniel-Constantin Mierla -Date: Wed May 13 22:23:43 2015 +0200 +Date: Thu Sep 29 09:19:37 2016 +0200 - doc/stylesheets: xsl template to quote mysql table and column names + http_client Terminate exported commands list + + The list of exported functions was not terminated, which caused a + segfault in find_mod_export_record() when reading outside the + list. + + - backport of 166e6d80308adb822c9342cf75ac1ca8158e2f78 -commit eb889f41f036afb4248303fd6a1c7db393724c58 +commit 94ef3dcaa99680cb12897db27d81d39e0e1e2d5e Author: Daniel-Constantin Mierla -Date: Wed May 13 15:56:23 2015 +0200 +Date: Wed Sep 28 09:28:02 2016 +0200 - evapi: use internal log functions and free io struct if client failed to connect + dispatcher: proper selection of the gateway when the maxload is 0 + + - reported and patch by Carlos Cruz Luengo, GH #800 + + (cherry picked from commit a0521f714a29fe205f83cd176f961344c8d9c79d) -commit 83180ee7602b69d9c9cee85925c0282baf6f58b8 -Author: jaybeepee -Date: Wed May 13 11:05:01 2015 +0200 +commit e43d82db89e57a47418d4ccdd283d8b2de82e7e6 +Author: Victor Seva +Date: Fri Sep 23 11:11:56 2016 +0200 - modules/ims_charging: return false if Ro CCR returns with GSU <=0 - - This caters for strange case where OCS returns CCR success - with a GSU of 0 (or less) seconds.... + presence: fix crash when no dialog.id on dialog-info xml + + Fix #794 + + (cherry picked from commit 53b139567cd2c828cf2cf387029396ef55351289) -commit cab5fa6a307dff2cebaf3c6a4b6fbb366e16a4b7 -Author: jaybeepee -Date: Wed May 13 09:14:44 2015 +0200 +commit ae2b64d90d0e4652e50afb7d06342f6f6b7bcedb +Author: Victor Seva +Date: Tue Sep 20 10:44:19 2016 +0200 - modules/tm: removed no longer needed ASYNC mutex + pkg/kamailio/deb: add Ubuntu Xenial support -commit 1da0f06d896ed8a99728846437322a3719241fbc -Author: jaybeepee -Date: Wed May 13 09:14:44 2015 +0200 +commit 659b912231d81dff8eac2b486f39919f0b7c45cb +Author: Phil Lavin +Date: Mon Sep 19 21:27:54 2016 +0100 - modules/tm: removed no longer needed ASYNC mutex + presence: Fix memory leak in DB code + + (cherry picked from commit 0c36c1b62efef176ae6e9322f14096e3a63ed348) -commit cf03a43958b61c6a66657bfb4912c71e4941b032 -Author: jaybeepee -Date: Wed May 13 09:05:07 2015 +0200 +commit 1c740e85cabe62dec9314589dd0cb0141ffd1010 +Author: Daniel-Constantin Mierla +Date: Mon Sep 19 20:57:42 2016 +0200 - Revert "modules/tm: removed no longer needed ASYNC mutex" + presence: free db result when get_dialog_state() retrieves no rows - This reverts commit 7ca0e1e87a84f323bbfbaf1ea4985fbfecec00ed. + - db result and columns in the query are allocated + + (cherry picked from commit 7289417c39939f61ea116fe8dc8d23cdea6401be) -commit 7ca0e1e87a84f323bbfbaf1ea4985fbfecec00ed -Author: jaybeepee -Date: Wed May 13 08:51:59 2015 +0200 +commit ce3d1dd8360567fdf2c8e36fbb4a4238dab8f036 +Author: Daniel-Constantin Mierla +Date: Fri Sep 16 22:22:57 2016 +0200 + + presence: test if event is dialog for checking terminated state in presentity update + + - reported by Juha Heinanen + + (cherry picked from commit f2ef2a9016f41e97d3466b34b4039e66505d53a1) - modules/tm: removed no longer needed ASYNC mutex -commit ad37a28efe2fa40e031e542433fc566366f48853 -Author: Victor Seva -Date: Tue May 12 22:14:04 2015 +0200 +===================== 2016-08-14 Version 4.4.3 Released ===================== - pkg/kamailio/deb: fix pre version '-' vs '~' +===================== Changes Since Version 4.4.2 =========================== -commit 5695978137225cc16cbe1cf8282c3eb31262257d -Author: Victor Seva -Date: Tue May 12 21:38:58 2015 +0200 +commit b93f3a119acb74bbd3aa00b2e5d74d13c9ec82e8 +Author: Daniel-Constantin Mierla +Date: Wed Sep 14 15:40:52 2016 +0200 - travisci: use regex to select 4.X branches + Makefile.defs: version set to 4.4.3 -commit 7048d597b9e74d22fa32b6e5c809986089462c39 -Author: lucian balanceanu -Date: Tue May 12 14:46:50 2015 +0300 +commit 872bd92c4b1881e959a5b5837d38c941c1f6ef12 +Author: Victor Seva +Date: Wed Sep 14 15:28:10 2016 +0200 - rtpengine: decrease log level of a message - - - decrease logging level for "force_send_ip_str not specified in .cfg - file" to DBG + pkg/kamailio/deb: set version to 4.4.3 -commit 4e856f952575722914fa0f609a538ef3fc670a94 -Author: Daniel-Constantin Mierla -Date: Tue May 12 10:13:39 2015 +0200 +commit fbfaa30bc9f3e7fe63f05c0a488e3c331436b9c3 +Author: Kamailio Dev +Date: Wed Sep 14 15:16:16 2016 +0200 - rtjon: fixed compile warnings and branch index iteration + modules: readme files regenerated - textops ... -commit 6390b0506856529849ef02001a992db9057c795f +commit d83ee9787f3df8da718b69e41d2e8d452ea2bc26 Author: Daniel-Constantin Mierla -Date: Mon May 11 22:13:31 2015 +0200 +Date: Wed Sep 14 15:00:03 2016 +0200 - presence_dialoginfo: fixed several libxml2 API usage leaks + textops: more details for set_body_multipart() and need of msg_apply_changes() - - reported by dkovik, GH#155 + (cherry picked from commit ba3df9a65aaa60b9236f3ac6d3c748079174ecd5) -commit 0e22abe2b89be8936df4b8230955fbaf43ad40e7 +commit e6199c49b940013ec79d6ff999de5be209ee2621 Author: Daniel-Constantin Mierla -Date: Mon May 11 17:15:10 2015 +0200 +Date: Wed Sep 14 14:49:53 2016 +0200 - dialog: don't send keepalive if dialog not in confirmed state - - - if dialog is in deleted state, remove it from keep alive list - immediately + pkg/rpm: spec files updated for v4.4.3 -commit d3a0cad18d3a38af7c56b9317a0ca59e19a87724 -Author: Richard Good -Date: Mon May 11 15:43:19 2015 +0200 +commit beaaff9498f6de263823a97e6c13094339da6db7 +Author: Kamailio Dev +Date: Wed Sep 14 14:01:18 2016 +0200 - modules/dialog.c: added MI command dlg_end_dlg + modules: readme files regenerated - db_mongodb ... -commit 96b84ba4d7f5ee4a763fe7db81bbf4f9a6a3ef77 +commit 18874f11abadaf300e83e2d166ebffd0246d35da Author: Daniel-Constantin Mierla -Date: Sun May 10 18:18:00 2015 +0200 +Date: Tue Sep 13 13:04:14 2016 +0200 - tm: disabled use of dedicated mutex for async continue + ndb_mongodb: elaborated the docs for usage with tls module - - it can be enabled by defining ENABLE_ASYNC_MUTEX - - reply mutex is re-entrant and protects better the transaction - strucutre - - a dedicated lock for async continue exposes a race on removing from - timer when suspended transaction is resument at the same time when the - timer fires expiration event + (cherry picked from commit 361dc128016a4bd6611e802a775f7c395905d9b7) -commit a151e1fd67d3fb6d7f61646df8f0125e4f034162 -Merge: a786c3f b525ada +commit 0f247434cddc1652565b3d088166b8d444948c4f Author: Daniel-Constantin Mierla -Date: Sun May 10 18:17:07 2015 +0200 +Date: Tue Sep 13 13:03:40 2016 +0200 - Merge pull request #154 from grumvalski/set_contact_alias_fix + db_mongodb: elaborated the docs for usage with tls module - modules/nathelper: don't include enclosing brackets in contact uri in set_contact_alias + (cherry picked from commit d8ba1694a63ec65efebe9761ea6e85aef7032050) -commit b525ada2d12bf85c385a5f97859afd5d52405354 -Author: Federico Cabiddu -Date: Sat May 9 18:16:28 2015 +0200 +commit c4e3bbce01708b19fd1b96ef5ab59eac6b47e318 +Author: Daniel-Constantin Mierla +Date: Mon Sep 12 17:36:49 2016 +0200 - modules/nathelper: don't include enclosing bracket in contact uri in set_contact_alias + janssonrpc-c: set the cmd pipe for all child processes + + (cherry picked from commit 875c8ed09917825b4d4cd4e3f04e2665d957104a) -commit a786c3f4a108f7df94cb555ee25444227c7e5c3b +commit f5017b0e352a23b000f6927875fcb8758b31ffff Author: Daniel-Constantin Mierla -Date: Fri May 8 09:55:44 2015 +0200 +Date: Mon Sep 12 17:31:36 2016 +0200 - kamctl: get aliases table db scripts up to date + jsonrpc-c: set the cpm pipe for all child processes + + - reported by Ian Yu-Hsun Lin, GH #713 + + (cherry picked from commit 3b31c51bd66737891b549895dea068494929926c) -commit 7046d22486b80fe7f9facf2facc844fd0c0267d7 +commit 3ef7c98b352adba67aec25cbb99a0efa8da25600 Author: Daniel-Constantin Mierla -Date: Fri May 8 09:54:29 2015 +0200 +Date: Thu Sep 8 14:53:48 2016 +0200 - lib/srdb1: aliases table needs to be same structure as location + evapi: fixed the communication with dispatcher after initializing it as rpc worker + + (cherry picked from commit 72580f250a2322ac1d5e71a92826fd8b11225b04) -commit 762d3309e42e8b9fb56e764c57153535f58dd82d -Author: Daniel-Constantin Mierla -Date: Fri May 8 09:44:20 2015 +0200 +commit 4378bb1816d26d1c4fdaaaf84d3c028da1d670c2 +Author: Kamailio Dev +Date: Thu Sep 8 13:46:25 2016 +0200 - usrloc: table version for location set to 8 + modules: readme files regenerated - avpops ... -commit 70727c69b950d2e8e6fc56c4aee868d35a9e3a70 -Author: Daniel-Constantin Mierla -Date: Fri May 8 09:42:06 2015 +0200 +commit 27571b0cb2410c1a1525f9d84984130e64bae8df +Author: Olle E. Johansson +Date: Thu Sep 8 10:13:02 2016 +0200 - kamctl: regenerated db creation scripts + utils Add missing semi-colons to documentation + + (cherry picked from commit 31cbec1a9be35beb446d17ee6b21bf753462dc8d) + +commit 4236d74386e31681bf2e247eb886ab65d55f5409 +Author: rdboisvert +Date: Wed Sep 7 16:39:21 2016 -0400 + + mohqueue: prevent calls sticking in queue + + - query RTP to see if the link is active + - update user-agent version + - fixed edge case where REFER response arrives after call closed + (cherry picked from commit a051bd98652dd92a93175b7cab1e239bab851160) -commit b01d40e86300aa45e147e2526cbe3f43115725e3 +commit 3b4f39948f5a66352c05d64051023379443cb144 Author: Daniel-Constantin Mierla -Date: Fri May 8 09:41:42 2015 +0200 +Date: Wed Sep 7 15:19:40 2016 +0200 - lib/srdb1: location table version set to 8 in sql schema + uac: updated the docs for uac registration refresh rpc command + + (cherry picked from commit 130951e12941d63e069c6f420be5441b1140fba3) -commit 5d298d69cbb24a6d099418b2ad6f3e980be6d017 +commit f2c1a96a64b73be0d138e782ea26c1d07bc34dea Author: Daniel-Constantin Mierla -Date: Wed May 6 18:11:58 2015 +0200 +Date: Wed Sep 7 12:10:57 2016 +0200 - kamctl: regenerated db schema for location table + core: try to catch dash immediately after ID in define/ifdef + + - reported by GH #743 + + (cherry picked from commit 38b4bbd8b90859b7f90187103f5e7faf04ccd8bd) -commit 3f45175dec711f1ece8b377469054a3dbd7cc72c +commit c42342a4338781c58966312e2318ed39595d1799 Author: Daniel-Constantin Mierla -Date: Wed May 6 18:11:08 2015 +0200 +Date: Tue Sep 6 14:54:49 2016 +0200 - nathelper: set the max partition for keepalives in usrloc + http_client: added semicolons in the examples + + - use generic domain for examples - - used to distribute registration records for db only mode in usrloc + (cherry picked from commit b7907be6231bd3eb8160300c87ddf58e3fffb206) -commit 8f8d4f5d8c4e492f3864cb82bb898d6a82605005 +commit 94023685e98106fc4a0246b0878c081d7ad5a1d8 Author: Daniel-Constantin Mierla -Date: Wed May 6 18:09:39 2015 +0200 +Date: Tue Sep 6 13:05:08 2016 +0200 - usrloc: fetching of records for nat keepalives in db only is done using partion column + topos: proper check if the last char in headr value is eol - - don't use the module over auto incremented column, not being common to - all db engines + (cherry picked from commit b933550a50d61534747e97ce5031c18c4c12f1eb) -commit 65651271cadd5499f8469b77d4d4ad38fa6867e8 +commit 4a19097ec7ce7e104fd6c3a5a2117134360220ac Author: Daniel-Constantin Mierla -Date: Wed May 6 18:08:50 2015 +0200 +Date: Tue Sep 6 12:49:34 2016 +0200 - srdb1: added partition column for location table + topos: trim values before reinserting the route header - - to be used for db-only nat keepalives distribution + (cherry picked from commit 5bc9394024690e6d931b141d708ecd2815be40ce) -commit 39112fce88d53e842a261d87b7d0d323b00d3dd7 -Merge: 04410ae d29930e +commit 00c3a46f04c097318cf1cf854b2a4a23660c3454 Author: Daniel-Constantin Mierla -Date: Fri May 8 09:29:41 2015 +0200 +Date: Tue Sep 6 12:49:16 2016 +0200 - Merge pull request #153 from sn4kebite/pv-vn-fix + core: macro helper to trim zeros from str value - pv: Fixed assigning $null to $vn(name) pvs + (cherry picked from commit fe1fdbaf24ac0e4e18527e0bdfd2f2e1b217dc1b) -commit d29930e2af84431abf112f1182f92defe6efee01 -Author: Jon Bergli Heier -Date: Thu May 7 16:02:44 2015 +0200 +commit a3edba73dd3671b32bb39ac4d955ce18d50684a5 +Author: Camille Oudot +Date: Tue Sep 6 10:46:43 2016 +0200 - pv: Fixed assigning $null to $vn(name) pvs + tcpops: add documentation for tcp:closed - Pass NULL as value to set_var_value when assigning a NULL or - PV_VAL_NULL value to a pv with the VAR_TYPE_NULL flag set. + (cherry picked from commit 3d4dda0cdc4dc452ae7f796e74fd6056e09662df) -commit 04410aef38f5ed40c8f4a6796d95658407e1597c +commit 94fdc2c315c6facc064358190664570ebe2dc1f8 Author: Daniel-Constantin Mierla -Date: Thu May 7 13:23:43 2015 +0200 +Date: Mon Sep 5 09:23:57 2016 +0200 - dialog: check if dialog is still in confirmed state when processing keepalive reply + topos: more appropriate error log when attepting to delete header + + (cherry picked from commit 5f780a202b2132c4d622859a388432f0f6cbb3c7) -commit b2260dcad877488799fde3da55a53261f55a27ba -Merge: 883760d ace37c7 +commit 5eeef6dfed86159f2ed409ba8c20dc02b2ef255e Author: Daniel-Constantin Mierla -Date: Thu May 7 11:49:55 2015 +0200 +Date: Thu Sep 1 17:24:07 2016 +0200 - Merge pull request #151 from sn4kebite/htable-deadlock-fix + dialog: ensure all headers are parsed to find the custom ones for cseq refresh - htable: Add missing ht_slot_unlock in ht_cell_value_add + - GH #752 + + (cherry picked from commit 648704f209d8916a1840ae5f3de8b404edb3d8ab) -commit ace37c7a60e5d931216339c179de6e91615dac7e -Author: Jon Bergli Heier -Date: Thu May 7 11:08:08 2015 +0200 +commit eea24204cd2b3c1cfb863ce5e5ef2da6fb65758e +Author: Daniel-Constantin Mierla +Date: Thu Sep 1 14:15:51 2016 +0200 - htable: Add missing ht_slot_unlock in ht_cell_value_add + jansson: test if pkg-config knows about jansson library + + (cherry picked from commit a04755addf8f930fa51b1913a1ff5b6361785418) -commit 883760dc931418eb722975a2ba0c665e5393d500 +commit 59b2b76fa07e99176f0a602fae15680b009cd5d7 Author: Daniel-Constantin Mierla -Date: Thu May 7 00:17:27 2015 +0200 +Date: Thu Sep 1 13:33:23 2016 +0200 - lib/binrpc: initialize val to avoid compiler warnings + topos: store record route set only for initial 200ok response - - reported by Juha Heinanen + (cherry picked from commit 41727b768406383924d87b3d426d5f79df0f45be) -commit 0870a36d4c94f70d88f4c6e80aafd12ec402fb22 +commit 81c75df51676216568aabdba9d431aef7e23f9c7 Author: Daniel-Constantin Mierla -Date: Thu May 7 00:09:58 2015 +0200 +Date: Thu Sep 1 13:01:15 2016 +0200 - app_lua: fixed index of param array for some mongo api functions + path: added section ids in docs - - reported by Juha Heinanen + (cherry picked from commit 040106fc3f7b807d978cb8112c2637419ffb9926) -commit 4d24e42e127d4157e040512cac81a9548623748b +commit 99c8daf7015eb75d3003680ee9147041f5732025 Author: Daniel-Constantin Mierla -Date: Wed May 6 23:49:37 2015 +0200 +Date: Thu Sep 1 12:55:37 2016 +0200 - uac: relocate setting flag for outgoing registration + topos: error message about missing uuid when loading dlg made dbg + + - this can be the case of local generated requests that are not handled + by topos + - reported by Daniel Tryba - - avoid letting it set in case of low shared memory - - removed redundate reset of the same flag + (cherry picked from commit 3fec5152c85844ab4fe950d8564c4cc47eef0529) -commit 73d8d719497d596ab42cf37e94c8ea4a412f2141 -Merge: 451fbec 177b0d2 +commit f450fead2ccb64e9f9fb7971ca514979b5c0d226 Author: Daniel-Constantin Mierla -Date: Wed May 6 09:43:35 2015 +0200 +Date: Wed Aug 31 15:05:51 2016 +0200 - Merge pull request #150 from mslehto/patch-2 + core: tcp read - proper safety when priting log messages for read error case - sctp: fix typo scp_register_rpc -> sctp_register_rpc + - related to GH #748 + + (cherry picked from commit 48195546d7b5762be897c748bd3631f6b6a5c1d0) -commit 177b0d2807763b13d30148f44c1cc4d3d765d67c -Author: Mikko Lehto -Date: Wed May 6 06:32:30 2015 +0300 +commit cfa3a6ff2f8ab0d7b2da4c643a24dde28019d24b +Author: Daniel-Constantin Mierla +Date: Wed Aug 31 14:54:13 2016 +0200 - sctp: fix typo scp_register_rpc -> sctp_register_rpc + core: handle return code for tcp read headers/ws before printing extra debug logs + + - reported by GH #748 + + (cherry picked from commit 71b9765462d3df1686274c4b6380c71cf02dc099) -commit 451fbec2819e8e32450c44eff7e76cbbf3d81abe -Author: Carsten Bock -Date: Tue May 5 22:01:36 2015 +0200 +commit 4f8ced942105747f8c797bedf81db2a15ced1cea +Author: Daniel-Constantin Mierla +Date: Tue Aug 30 17:31:17 2016 +0200 - ims_*_scscf: Safety checks for the locks + dialog: proper refresh of cseq for requests withing dialog after an increment + + - reported by GH #752 + + (cherry picked from commit 73dbed5c33b757476e01098b957694b2344bb0a0) -commit 36b1cfe97ff2736b693f3a0beff6b2052a942fdd -Author: Carsten Bock -Date: Tue May 5 21:59:39 2015 +0200 +commit fbec5dbebbcde14ebaca4a0d2b97c0e44a0a87cf +Author: Daniel-Constantin Mierla +Date: Tue Aug 30 16:43:15 2016 +0200 - ims_*_scscf: Safety checks for the locks + dialog: proper safety test if cseq value in via is larger than hdr + + (cherry picked from commit 68a0d66e77354a9a6aaf641efe381098064bf18d) -commit e2dcb543ba1a2bdb5a61180965d30f1154050b71 -Merge: dd5a1dc d2ef375 +commit 52484d3a31247f062c4857e4a4196b808e628694 Author: Daniel-Constantin Mierla -Date: Tue May 5 21:26:17 2015 +0200 +Date: Tue Aug 30 15:13:26 2016 +0200 - Merge pull request #146 from lazedo/lazedo/db_text_raw_query + topos: record routing storage for handling sip responses - db_text : proper db_raw_query support + (cherry picked from commit 24a792d23c30a258a95bfc29fe4dc20bc4bce8c8) -commit dd5a1dc46bf9f61053772571153cd998c90d7f06 -Merge: c0fd507 c63d6b6 +commit 414c07ffc79b1d9f19f6d40e21bffd5d885df24a Author: Daniel-Constantin Mierla -Date: Tue May 5 21:23:07 2015 +0200 +Date: Fri Aug 26 14:43:13 2016 +0200 - Merge pull request #142 from smititelu/master + dialog: refresh cseq update if it was incremented in the past - Added implementation for force_send_interface to also support IPv6. + - reported by GH #752 + + (cherry picked from commit e349af55168e6b4de97a36d35b475dc295edc2e2) -commit c0fd507e5bf4a588acdfd71064f15b5a79418cd5 -Merge: b47c4f0 201dc5b +commit faac1510a473315387d5080f9601a05b4dd8645f Author: Daniel-Constantin Mierla -Date: Tue May 5 21:20:56 2015 +0200 +Date: Fri Aug 26 09:26:47 2016 +0200 - Merge pull request #147 from mslehto/patch-1 + core: parser - safety check and clean log messages for disposition header - pua_mi: document missing mi_pua_publish MI input parameter "id" + (cherry picked from commit 8086de823e57689cee134fc6e7947a1c38880dec) -commit 201dc5b600d8516368a54c70af6f02c3ea06353b -Author: Mikko Lehto -Date: Tue May 5 21:54:22 2015 +0300 +commit e705508954967638ab1c3dbdf11883a128d651e2 +Author: Dragos Oancea +Date: Fri Aug 19 16:34:32 2016 +0200 - pua_mi: document missing mi_pua_publish parameter "id" + core: fix double free on clearing lump + + (cherry picked from commit c1ea48cfe38e6c52c50e6f1d698254a789e988f1) -commit d2ef3754a8081c92a932fb19492f1b6d7eee67eb -Author: Luis Azedo -Date: Tue May 5 19:13:11 2015 +0100 +commit ba671c6e234cea45894cffd77c80828688899a4d +Author: Dragos Oancea +Date: Mon Aug 22 09:58:07 2016 +0200 - db_text : raw_query support + core: fix double free on clearing hdr - bug fix - uninitialised pointers + (cherry picked from commit df83103bb4756b0a3c3e42927396f78aa8210ec4) -commit b47c4f0d71281f32d7efe90c1f8dd381c6aa3742 -Author: Victor Seva -Date: Tue May 5 10:53:25 2015 +0200 +commit 9af2b4a12162a27be44a14a06161ab4a9be8ef9f +Author: Dragos Oancea +Date: Fri Aug 19 15:26:58 2016 +0200 - pkg/kamailio/deb: update version to 4.3.0-pre1 + presence: fix multiple double free on shutdown caught with memlog=1 + + (cherry picked from commit dc6962fb7e02cf44a145e0bafa455873c73ebc2d) -commit 8d7bef26cb4a774fe2f55628cab0d2bcfc868fa1 +commit 88886ddb181abcf94f8fc81050e92dac76fd1cd1 Author: Daniel-Constantin Mierla -Date: Tue May 5 10:19:31 2015 +0200 +Date: Fri Aug 19 08:34:18 2016 +0200 - Makefile.defs: version set to 4.3.0-pre1 + outbound: use pkg-config for libcrypto in makefile + + (cherry picked from commit cfb806e41ecde8392105a12c4e8ace31f1345352) -commit e731e6693c7a20ab1ddc0c2f80e3ae2d4ed06af6 -Author: Daniel-Constantin Mierla -Date: Mon May 4 21:22:51 2015 +0200 +commit c595cccd8582dfba41a8f0f49946fff55ab65d2d +Author: Dragos Oancea +Date: Tue Aug 16 19:03:08 2016 +0200 - jsonrpc-s: extended docs for fifo_name parameter + core: fix some logging in tcp_read.c + + (cherry picked from commit d61ff2e4cf49479a811019c2f01ace46344cacc2) -commit d7c1520ad4dd83e949ebe1b64ec07c6963982390 +commit 1b812ddc3c100bbc36349c7f367085804d25572f Author: Daniel-Constantin Mierla -Date: Mon May 4 21:20:42 2015 +0200 - - jsonrpc-s: take in consideration run_dir value if fifo path is not absolute - -commit 2b9e25a746afd7023bfe0aea885bd75d840976f1 -Author: Luis Azedo -Date: Mon May 4 16:45:14 2015 +0100 +Date: Tue Aug 9 15:43:23 2016 +0200 - db_text : add db_raw_query support + topos: force checking of Contact header for INVITE only - example - . select watcher_username, called from active_watchers where expires <> -1 + - follow up on GH #715 - current limitations - - . only select statements - . where clause always uses "and" + (cherry picked from commit a91ca63395b9a172c685e051f8a2255a5f1f31c9) -commit e1d68c3cb8c5a0630fc81313a8bb176646e9ccb6 -Author: Daniel-Constantin Mierla -Date: Tue Apr 28 15:34:44 2015 +0200 +commit af6ec7b2a5c5fdd59ef5cdd932cee4bdd6ccfd04 +Author: Dmitri Savolainen +Date: Tue Aug 9 12:01:59 2016 +0300 - etc: don't set fifo and ctl socket in config files + dialog: set DLG_FLAG_CHANGED for changed dialog variables - - modparams were commented, to be used as samples if needed to be - changed - - the default values are enough for proper packaging and use of run_dir - in order to avoid security exposures of /tmp dir + improper flag setting has been the cause of the not DB saving in some scenarios + + (cherry picked from commit 43c77faa00021c7c0ee350ecc9965fd517ead92f) -commit a9a21822a6a4ec3c886f42be1447e8e8cc4a3291 -Author: Daniel-Constantin Mierla -Date: Tue Apr 28 15:32:03 2015 +0200 +commit 14661f07f38316fc88224db502c0f090142ada8d +Author: lazedo +Date: Sun Aug 7 13:32:50 2016 +0100 - core/docbook: updated the entity for ctl socket file name + presence: fix crash when field value is null + (cherry picked from commit 26249603066a13cdb8cb11b45af8410cd7adb82b) -commit 106b1afa6135e82c58aa942e8a4be67debddb8a7 -Author: Daniel-Constantin Mierla -Date: Tue Apr 28 15:31:26 2015 +0200 +commit be8263d18169311bc0cb1f16feaa945427026ad6 +Author: Alex Hermann +Date: Fri Aug 5 14:40:01 2016 +0200 - ctl: updates about the default value for binrpc parameter + sl: Reset timeout before sending the message - - it creates the ctl file inside /var/run/kamailio - -commit 294427ca8343391616b1db6be670a7acb66b069c -Author: Daniel-Constantin Mierla -Date: Tue Apr 28 15:21:58 2015 +0200 - - mi_fifo: updated documentation for fifo_name parameter + Fix a common race where the reply would arrive before resetting the timeout. + + (cherry picked from commit d2f695d63266a5e1762db2e762396e7943687180) -commit e5dc15061be9d3866a8972af9732a3a7a753cc40 +commit 3db80e091727fa5a4ebf0c832ddf8c7750f19f46 Author: Daniel-Constantin Mierla -Date: Tue Apr 28 15:15:32 2015 +0200 +Date: Fri Aug 5 08:27:41 2016 +0200 - mi_fifo: if fifo_name does not start with /, create it in run_dir + topos: skip comma at the end when reinserting rr headers - - better security, /tmp exposes insecure operations, as reported by - Debian project a while ago - - run_dir is by default /var/run/kamailio - - defualt value for fifo_name is now 'kamailio_fifo' - - full default path for fifo is /var/run/kamailio/kamailio_fifo - -commit c63d6b6094cdf7c0651f087e989590a05f1f1dd8 -Author: Stefan Mititelu -Date: Mon Apr 27 09:42:42 2015 +0300 - - rtpengine: update documentation for IPv6 force_send_interface. + - reported by GH #716 - - Updated documentation with an example of how to use IPv6 with rtpengine. + (cherry picked from commit 65336276f219454210556b36f3d37a0e957d9c1c) -commit 3f42d6bcc79430b1669fbdf5bb9bffd6388e9475 -Author: Stefan Mititelu -Date: Mon Apr 27 09:24:47 2015 +0300 +commit 259aaa2ea705d886e30ad5f133030241a2363c55 +Author: Alex Hermann +Date: Thu Jul 21 13:29:38 2016 +0200 - rtpengine: add support for IPv6 force_send_interface + core: Don't bind to IPv6 addresses if auto_bind_ipv6 is disabled - - Add support for data exchange with rtpproxy over IPv6. + With the following listen statement: + listen=udp:eth0:5060 + Kamailio would try to bind to the IPv6 address(es) on that interface and fail with: + + ERROR: [udp_server.c:369]: udp_init(): might be caused by using a link local address, try site local or global + (cherry picked from commit 8102ca5f67de979a3597a97f96a05c99d13fb29d) -commit 1bb85845ded7cd4d66080a3dab2a98d28544b1ba -Author: Daniel-Constantin Mierla -Date: Sun Apr 26 10:21:42 2015 +0200 +commit 931612a5311fe25db1ab01d56547ed7f590c6055 +Author: Alex Hermann +Date: Mon Jul 4 16:41:18 2016 +0200 - pv: initialize sbranch via function and check return value + jsonrpc_s: Return an error when JSON parsing fails - - reported by Anthony Messina, GH#141 + (cherry picked from commit bbacab495841ef270f98b743352ad8aca9649b47) -commit bf713d842269c1e3916038ca2f612303d55c5c4c -Author: Camille Oudot -Date: Thu Apr 23 17:27:04 2015 +0200 +commit c7594a1a06cca096a4d7e5483776bc6c05b2ab7b +Author: Alex Hermann +Date: Thu May 12 16:05:29 2016 +0200 - mem: TLSF compile-time selection improvement + tmx: Try to get branch_index for all replies - now use + Just check if the tm context is set and return its branch_index. - make MEMMNG=2 cfg + The check for CORE_ONREPLY_ROUTE is flawed as the transaction may have + been set anyway (by t_check_trans() for example). - to switch to TLSF malloc + (cherry picked from commit 72ae9283fa969c13ba1c6d599c2844e1473883f4) -commit 48288db22e64a31ba8e3d599aee56d9c4c123d93 -Author: Camille Oudot -Date: Thu Apr 23 17:25:29 2015 +0200 +commit 8bc5c20f71e6f5222499489170f47356ee0373e0 +Author: Alex Hermann +Date: Thu Nov 13 10:55:29 2014 +0100 - mem: TLSF integration for pkg memory + mqueu: Convert items to single linked list + + The doubly-lined feature is not used as the prev attribute was write-only-memory. + + (cherry picked from commit d33e8efc93446c1d5a092740b5a2387dea5de1fc) -commit 57910f3982125779c31a2d78220d42bed2b2c8bc -Author: Daniel-Constantin Mierla -Date: Mon Apr 27 18:04:14 2015 +0200 +commit 5654760725263d7ab023278ae99453be6a6e321b +Author: Alex Hermann +Date: Wed Nov 5 22:14:21 2014 +0100 - app_lua: removed one more static initializer of array + core: Enable SIGUSR1 for child processes + + Allow dumping of memory statistics during runtime + + (cherry picked from commit cf085a870e33bcdef5dad91a3de92f25e159e669) -commit cf1f8daebc83ce91c2a62fc11c23d78d5ca78796 -Author: Daniel-Constantin Mierla -Date: Mon Apr 27 18:01:39 2015 +0200 +commit 4c930dcb105ae5abc39bf91d7906fe320b74bdb4 +Author: Alex Hermann +Date: Mon Oct 27 14:38:03 2014 +0100 - app_lua: removed static initialization of arrays + pv: xavp: log error message when memory allocation fails - - not supported by all compilers - - reported by Juha Heinanen + (cherry picked from commit fa11a6bd50aa00994c71561b8de8b0dc8659fe55) -commit 5baede3d4c7ca926434052ac2fbf6a763f32445c -Author: Juha Heinanen -Date: Mon Apr 27 18:40:23 2015 +0300 +commit 7c8811ed44a8822dab28d014c73a09f3eb42f6c0 +Author: Alex Hermann +Date: Mon Nov 5 12:40:07 2012 +0100 - modules/msilo: updated version number of silo table + dispatcher: free memory on shutdown + + Debugging memleaks is easier when the list of alloc'ed shmem is shorter. + + (cherry picked from commit db15dbfd66acaba17d525a391c0973d3fa8a7b4a) -commit a02299d514f742120f4f82d2a08f49eba3ee6e43 -Merge: 647fb3d 4017dc3 -Author: Seudin Kasumovic -Date: Mon Apr 27 16:49:49 2015 +0200 +commit 32fb71b615e5862e86dc711a32ffe8f0087af0fd +Author: Alex Hermann +Date: Thu Nov 13 16:13:21 2014 +0100 - Merge pull request #144 from kamailio/seudin/erlang_connect_fix + rtimer: Validate mode parameter - erlang: Reconnect after lost connection + (cherry picked from commit 3c3fa1ef9b984c284c19989544256eb3128b7146) -commit 4017dc3a2443e2dc445b77bdb94a754071d043b4 -Author: Seudin Kasumovic -Date: Sat Apr 25 00:32:47 2015 +0200 +commit 4034f35d04e543ea55f293af02a73f152dedeb82 +Author: Alex Hermann +Date: Mon Oct 29 15:23:19 2012 +0100 - erlang: Reconnect after lost connection + tm: Set tcx.branch_index to picked branch before running failure route. - - ensure connect to Erlang node after lost connection or not connected on start + This makes the picked branch index available in $T_branch_idx for failure_route. + + (cherry picked from commit e604493579440f38f2066c4c8301cdfa88137f74) -commit 647fb3d0ce0dea645eaa50444364febe5800c3a9 -Author: Victor Seva -Date: Mon Apr 27 14:43:19 2015 +0200 +commit 4838a3b71f2f20e712be7f0fb3ee6c0f3088e47f +Author: Daniel-Constantin Mierla +Date: Sun Jul 31 11:42:55 2016 +0200 - dispatcher: refresh README + dialog: jump to error if fails to parse requests in cseq update callback + + (cherry picked from commit ee7992d30a73e61af056c47f9bd961c86fdf592c) -commit a412047b1fab70931f69a799ab12f97d1f545e78 -Author: Andrew Pogrebennyk -Date: Mon Apr 27 14:22:42 2015 +0200 +commit 985230e4d3a7c4f7eb0eb31161ba9b80bd7faf4e +Author: Rick +Date: Fri Jul 29 10:54:53 2016 +0200 - dispatcher: update doc after 121cb0f4 and fix missing ds_is_from_list function name + core: msg_parser log output adaptations - Fixes: #143 + - switched LM_ERR to ERR + - removed ERROR, DEBUG form log message string + - removed function name from log message string + - changed LOG(L_CRIT, "BUG: ....") to BUG("...") + (cherry picked from commit 8baf73ad348fa17c12e54a7b0411f021af98b29e) -commit dd56c2821b2f0f7f47137b7875d90f0a6d421e35 +commit 56e866ac3d8053eebac3563247b2424492d7fe13 Author: Daniel-Constantin Mierla -Date: Sun Apr 26 10:21:42 2015 +0200 +Date: Fri Jul 29 06:25:42 2016 +0200 - pv: initialize sbranch via function and check return value + http_async_client: fixed small typo in docs - - reported by Anthony Messina, GH#141 + (cherry picked from commit 095d6b41f83bb40610ae68a1390e49374ac7d26f) -commit e3f8d678103b7e2378b883c48349d8caed9dc74d -Merge: 5e04515 636c6f9 -Author: Camille Oudot -Date: Fri Apr 24 11:49:10 2015 +0200 +commit 978a5331fde323013e51de25e1a6f175d1d879cc +Author: Alex Hermann +Date: Fri Sep 30 16:59:41 2011 +0200 - Merge pull request #139 from kamailio/tmp/TLSF_pkg + uac: uac_reg: fix uac_reg_get_byuser() - mem: enable TLSF for pkg mem + The calculated hash was compared with uuid hash instead of user hash + + (cherry picked from commit fe16198f0d2698cc2bf2f719e0185371484b392c) -commit 5e04515410c7d7ebedf6c4bc8c917f736b37acba -Author: Camille Oudot -Date: Fri Apr 24 11:26:36 2015 +0200 +commit 2100fdf408ccebd603bf1e92cc4003b28161be07 +Author: Phil Lavin +Date: Wed Jul 27 14:53:42 2016 +0100 - mem: TLSF use larger first level bitmap + presentity: don't update terminated presentity entries in the database - The current settings on 64 bits arch require a 33 bits wide first level bitmap. - Use unsigned long instead of int. + - Fixes a race condition caused by, for example, the call being answered + at almost exactly the same time as the caller cancels. This causes + a terminated state to change back to completed. The dialog is then + removed from the database and the presentity entry stays in place + until it expires. + - This fix explicitly prevents terminated entries being updated as the + state machine in RFC 4235 prohibits this behaviour. + + (cherry picked from commit 839cf89b02f8817156487a960ff62013e3cde530) -commit 636c6f96d84be559a09251ba87322b685e28f9b0 -Author: Camille Oudot -Date: Thu Apr 23 17:27:04 2015 +0200 +commit bb5e7ab3e107078486a092652c738276f79fe2cf +Author: Phil Lavin +Date: Wed Jul 27 11:25:40 2016 +0100 - mem: TLSF compile-time selection improvement + presence: log when presentity is deleted due to already existing - now use + (cherry picked from commit 3b206c864126a75a00c2c6abe4afed766d278b04) + +commit 7805d05df7db754c5f3ffb6c986d91de72a2b4c1 +Author: AndreasHuber-CH +Date: Tue Jul 26 09:00:35 2016 +0200 + + registrar: Check max URI size of contact also for first contact header - make MEMMNG=2 cfg + The URI size of contacts is checked against a max size to ensure that it fits into the database column. + This check was already present before but was done only for the contact header fields other than the first header field + which made that REGISTER with a single contact were not checked for max size and were truncated later when stored to the database. + With this fix all contact URIs of all contact header fields are checked against the max size. - to switch to TLSF malloc + (cherry picked from commit c0697d76fc2ae8ea9676aa9a9b57db442b9c678f) -commit 144da7f3aef010bb6c51b93c399875c233500189 -Author: Camille Oudot -Date: Thu Apr 23 17:16:20 2015 +0200 +commit 2725e74909646a71555eb630c03acfedaab1b0da +Author: AndreasHuber-CH +Date: Tue Jul 26 08:41:20 2016 +0200 - mem: TLSF fix max fragments macro + registrar: Add warnings if contact is invalid and REGISTER will be rejected + + Added some warnings in case a REGISTER is rejected because of an invalid contact header field. + Before, kamailio might answer a 400 Bad Request for a too long contact URI for example without logging any message. + + (cherry picked from commit cc0b07d2bcadbd95b2f0dbfdcc873306acca8f2d) -commit 63b7c711c26557b7caafb76b98a89e6b28ec3593 -Author: Camille Oudot -Date: Thu Apr 23 17:25:29 2015 +0200 +commit 8d29d2d74965004d689deb54327df7325b17e147 +Author: Phil Lavin +Date: Mon Jul 25 14:39:35 2016 +0100 - mem: TLSF integration for pkg memory + presence: fix memory leak introduced by last commit + + (cherry picked from commit 3c09579d5e677ac7a27b2386545dc580697934b5) -commit 48663e4239f819b42e7035d9f4023c161eb71d05 +commit 2f90bc6546a0124812679ccc3ec7d5afe9e549c6 Author: Daniel-Constantin Mierla -Date: Thu Apr 23 16:34:35 2015 +0200 +Date: Sun Jul 24 15:19:27 2016 +0200 - permissions: fixed reload trusted rpc command + core: print content when failing to parse rr body - - reported by Emmanuel Schmidbauer, GH#138 + (cherry picked from commit 1562c31c799cbaeeb7453e73183950f6818534b6) -commit 89642d3cddd90ba3e3f6d310e239492634fa6405 +commit ac0e8c09072cdda56390a0904ba4d2dcbf35b4fd Author: Daniel-Constantin Mierla -Date: Thu Apr 23 16:23:01 2015 +0200 +Date: Sun Jul 24 08:27:00 2016 +0200 - permissions: store src ip in zero terminated string for trusted table + core: parse rr - removed function name from logs + + - it is added automatically + - coherent indentation - - it is printed as string via rpc, resulting in invalid chars in the - output - - reported by Emmanuel Schmidbauer, GH#137 + (cherry picked from commit 697c285be7f52c6586b70fa4188e5f5b94f4e785) -commit 9c3b650b96272bc792e9e52963ce987b410227ae -Author: jaybeepee -Date: Thu Apr 23 10:59:07 2015 +0200 +commit f56225119b8bb6f92141a357d9a1bd29b2375fd3 +Author: Phil Lavin +Date: Fri Jul 22 10:45:24 2016 +0100 - modules/ims_regisrar_pcscf: added optinal extra parameter for lookup_transport - - allows avp,pv,etc to be used as URI in search for lookup_transport + presence: Always check if a record exists for this dialog before inserting + + - The presence implementation is a little dubious, to say the least. + It probably wants re-writing at some stage. However, this fixes a + race condition that could have a number of causes in which the PUA + is unaware of the eTag at the point it sends the PUBLISH. + + (cherry picked from commit 122e9b423d1c25bf34f6d7be995b992ca61c2fa3) -commit 32cbfb23c4f4e40fe4deaf65e7b3f88de90712a5 -Author: Victor Seva -Date: Thu Apr 23 09:59:25 2015 +0200 +commit 70c9e9284ed6049cce3030960aee784da57ac100 +Author: IMS root +Date: Tue Jul 19 18:07:17 2016 +0200 - pkg/kamailio/deb: update debian version to 4.3.0-pre0 + presence: fix potential double free in shutdown routine + + (cherry picked from commit 134fcbd3b2fbb91e4206cceb1de9d1a3a0690ef6) -commit 0d0e7fa2d50caca5a4aa0a59a3ad64f4a98b5bdb +commit 9e25d5339b80af9050dd2c624cf4a0817908391c Author: Daniel-Constantin Mierla -Date: Thu Apr 23 09:54:24 2015 +0200 +Date: Tue Jul 19 15:36:43 2016 +0200 - Makefile.defs: version set to 4.3.0-pre0 + topos: skip options from contact header check + + - reported by Daren Crew, GH #715 - - pre-release phase - testing period, no new features till branching 4.3 + (cherry picked from commit ab27f988cffcbd060ca84abd118050cb3c5c923f) -commit 0d799c41291be74d23a5cbda39fac645f37903ac -Merge: 6ef943d aa87b85 +commit ff61a6014289f0a8b86ff1d83bab5d13164af7d6 Author: Daniel-Constantin Mierla -Date: Thu Apr 23 09:38:16 2015 +0200 +Date: Mon Jul 18 10:43:48 2016 +0200 - Merge pull request #135 from mikomarrache/patch-1 + tls: print ssl memory functions if they cannot be set - db_mongodb: fix typo + (cherry picked from commit 966513b374eef598434c5310a43eac2735adfd2e) -commit 6ef943d5ee1376527e7ce173c1bba0fcf1dd4e90 -Merge: 5803387 df7773a +commit 9a5f70a3a61aec7e834d1465ba5e337c87cb3b99 Author: Daniel-Constantin Mierla -Date: Thu Apr 23 09:37:24 2015 +0200 +Date: Thu Jul 14 12:34:21 2016 +0200 - Merge pull request #136 from lazedo/db_text_simple_raw + tls: added note in docs about loading tls module first - db_text : simple raw support for select + (cherry picked from commit 7d04380ff628d6c99f89b220c904b727a1c0f47f) -commit 5803387da3a056de7cf08e85f49616810186b202 +commit c30a13969b4734b69bc0a859c98e2a26128dfdfe Author: Daniel-Constantin Mierla -Date: Thu Apr 23 09:35:26 2015 +0200 +Date: Thu Jul 14 12:29:06 2016 +0200 - rtjson: added sample json document for routing + tls: coherent whitespacing and indentation + + (cherry picked from commit a444035d9ede8317d42877afa5e230acb203f6d5) -commit 8cb435dcf3ec408c6c3f95ee699932f7aeb78a18 +commit ae500791d60a16c1ab5d2d5ad2f69262fa519609 Author: Daniel-Constantin Mierla -Date: Thu Apr 23 09:31:45 2015 +0200 +Date: Thu Jul 14 12:25:06 2016 +0200 - rtjson: filled rtjson_update_branch() + tls: more detailed log message when tls module cannot set libssl memory manager + + (cherry picked from commit 8bec45f3d0581747da4b807229b4de64511aa5e2) -commit 09e5b31a39af5d09757f8d02f500a98933e2bf71 +commit 9e2eabdd48df02da952f55fc799bddc65c335c7c Author: Daniel-Constantin Mierla -Date: Wed Apr 22 23:35:41 2015 +0200 +Date: Thu Jul 14 08:43:05 2016 +0200 - rtjson: new module facilitating routing based on json documents + tm: wrap uri values in brackets inside error messages - - routing attributes such as r-uri, outbound proxy, etc. can be read from a - json document. Retrieving the document can be done with other modules - such as evapi, utils (http query), a.s.o. + - easier to spot invalid empty chars + - useless spaces removed + + (cherry picked from commit d3bdf14a2e0ae113092aa33c89698131c020d209) -commit 70321a7786b91870409752d3b3017db1e24ca20e +commit c60b762531a596d292caf7f31af1fe0040c2cdd5 Author: Daniel-Constantin Mierla -Date: Wed Apr 22 23:10:36 2015 +0200 +Date: Wed Jul 13 10:18:07 2016 +0200 - app_lua: exported the APIs from uac and ndb_mongodb modules + dialog: cseq update callback implemented inside the module + + - keep related code together as it needs access to dlg vars + + (cherry picked from commit cc5e86d79538395d2ce03abd10e0ac1ed5d723f5) -commit 40a598387f744cd3ccec5ca18e155547b5ea890e +commit 0d76481bb77d37b1d50e3c48eee6109113384c6a Author: Daniel-Constantin Mierla -Date: Wed Apr 22 22:46:34 2015 +0200 +Date: Wed Jul 13 10:17:40 2016 +0200 - uac: uac_replace_to() exported via inter-module api + uac: use cseq update callback exported by dialog via core srapi + + (cherry picked from commit d236312676a3f7e9a66d5cc904ed6a377f5e36ef) -commit 318bbb047d3493354b97f3cae102be606bfb49bf +commit 30e1153b34787347fd9f6c70d5800e02fc3cd109 Author: Daniel-Constantin Mierla -Date: Wed Apr 22 22:41:34 2015 +0200 +Date: Wed Jul 13 10:17:04 2016 +0200 - tm: t_set_fr() function exported via inter-module api + core: add header helper uses after lump anchor insert + + (cherry picked from commit 3ccb1b83216b874405b7a63a73b2966aa7f91253) -commit df7773afce1c7ea5719c5311cda799e5197feeb6 -Author: lazedo -Date: Mon Apr 13 17:13:12 2015 +0100 +commit f52eb44494e5eb148cbb7fc8ec889e3fdd1b7499 +Author: Daniel-Constantin Mierla +Date: Wed Jul 13 10:16:23 2016 +0200 - db_text : simple raw support for select + core: srapi - cseq update field update to be a function + + (cherry picked from commit 2880cd627802920b20514a62fc90ff450a5c6b30) -commit 3640d634a457c000b5a643f569719186ac5dc982 -Author: Camille Oudot -Date: Wed Apr 22 18:49:19 2015 +0200 +commit a6a0aebbe67adfd01fbf9d4d5c55659b3d2cc8ff +Author: Daniel-Constantin Mierla +Date: Wed Jul 13 08:40:56 2016 +0200 - mem: TLSF: fix typo + missing declaration + core: helper functions to add headers with str parameters + + (cherry picked from commit 4e49312d0d7a90f0234b8a29036867452771a8b7) -commit aa87b852fbfd333f2073ac7390c3f3b6568e0024 -Author: mikomarrache -Date: Wed Apr 22 15:04:40 2015 +0300 +commit 0bc6dd18a55441501a749ac1af659b5c146861e9 +Author: Daniel-Constantin Mierla +Date: Tue Jul 12 17:51:53 2016 +0200 - db_mongodb: fix typo + avpops: note that avp_copy() is reversing the order of the values + + - reported by GH #706 + + (cherry picked from commit 5f2c2bb5883a43cb01140b730aa126fc5d2f58d6) -commit 2f615e19e7dff2a27e68576f5878c4b322082e26 -Merge: 41b6295 7488275 -Author: Camille Oudot -Date: Wed Apr 22 11:49:14 2015 +0200 +commit 388a1257bfc12dea04382654b03045018a7434f3 +Author: Daniel-Constantin Mierla +Date: Tue Jul 12 17:44:39 2016 +0200 - mem: Merge TLSF branch + dialog: parse all headers to check if cseq increment is needed + + - jump over the full custom header when sending out + + (cherry picked from commit c4a57e29883597869838f48d6a9f3a8a76a94240) -commit 41b629519969bde65f09d0789e811012297c70b7 -Author: Camille Oudot -Date: Wed Apr 22 11:48:41 2015 +0200 +commit b3cb7e062aa52f4fc71f90e96b771630f6375289 +Author: Daniel-Constantin Mierla +Date: Mon Jul 11 16:03:07 2016 +0200 - mem: fix shm_available() def for TLSF + core: added mem_status_mode parameter + + - if set to 1, qm allocator dumps used fragments in memory status + + (cherry picked from commit 8e2d45cb1cd71ec81852a5c0e329c9b3e9d141c5) -commit 7488275e059efe48704b821991c6598f43d3a556 -Author: Richard Good -Date: Wed Apr 22 11:10:46 2015 +0200 +commit 30069ddfd7983c9949760f96d81fe4213b658cdd +Author: Daniel-Constantin Mierla +Date: Mon Jul 11 15:40:04 2016 +0200 - modules/ims_qos: subscribe to DLG_FAILED callback + dialog: buffer-based remove of custome header tracking cseq updates + + (cherry picked from commit 5be968a37cfb976339bfb8f3faa8b712c169ed03) -commit 92dcf770474436ece25a775ed81cb70d23902064 -Author: Camille Oudot -Date: Tue Apr 21 17:03:06 2015 +0200 +commit 302cb1bc4551129cbc62bb1ad54ebfb1da9c04f3 +Author: Daniel-Constantin Mierla +Date: Mon Jul 11 15:38:24 2016 +0200 - mem: TLSF allocator integration in kamailio + core: fix offset to in hdr add helper added recently + + - one char was jumped over - - kamailio memory counters for statistics - - use - MEMMNG=1 MEMDBG=0 extra_defs='-DTLSF_MALLOC=1 - to enable - - support for > 4GB memory (current limit is now 1TB) + (cherry picked from commit 9e5617324f1194f20e4292446922695439e2f9d7) -commit 10cf40d8fc83e63bed1395b69d99b318aaf395b9 +commit 9cf3dd6086bf810c684429c85a9efb049fe4ef9e Author: Daniel-Constantin Mierla -Date: Wed Apr 22 10:16:32 2015 +0200 +Date: Mon Jul 11 13:47:05 2016 +0200 - auth_xkeys: rpc commands to manage the keys + core: mem/qm - test cfg core mem_status_all to print memory status + + (cherry picked from commit acccc6cd6bd1dbb83513175edd391cfb35ed95cc) -commit 98d2f1c5f477974ffe3962731d0c60d2e6ac5fb3 -Author: Victor Seva -Date: Wed Apr 22 10:14:05 2015 +0200 +commit 92adadfd794ba744e45166c9207b805698a41bc4 +Author: Daniel-Constantin Mierla +Date: Mon Jul 11 13:45:41 2016 +0200 - utils/kamctl: upgrade schema for msilo + core: mem_status_all - added to cfg core structure + + - allow selecting of dumping memory status also for used fragments + + (cherry picked from commit 160ce1659e9d3fd376f9fc2d6e56216b190fa529) -commit 257af3bcbabd8e1466b981c8a3edb43de8df4ee8 -Author: Camille Oudot -Date: Wed Apr 22 10:10:24 2015 +0200 +commit 183435ad7225abf4c66782080efd8a482631d559 +Author: Daniel-Constantin Mierla +Date: Mon Jul 11 13:44:11 2016 +0200 - mem: introducing TLSF malloc + core: mem - qm: coherent indentation and whitespacing - TLSF is a real-time oriented dynamic allocator, with O(1) malloc() and free() costs + (cherry picked from commit 4b9618f119b43adafb861bae5c64204ec732726b) -commit d4281041fbecf844fbad5f1bade965fc0c6c5be3 -Author: Victor Seva -Date: Wed Apr 22 09:50:18 2015 +0200 +commit 759f068c02ba7ca069a1ad3a3e5b4abc8d24872c +Author: Daniel-Constantin Mierla +Date: Mon Jul 11 13:19:30 2016 +0200 - lib/srdb1/schema: bump silo version missing on f5e02f7be4fcf6 + core/mem: qm - test and print status for chunks start/end markers for mem status + + (cherry picked from commit ef50e77b80d0b33b317263018101d5801c0860f8) -commit 8e955bad80bbc8d05ed71dca00f51dbad684f1ae -Author: Charles Chance -Date: Tue Apr 21 22:13:19 2015 +0100 +commit 92f9b4fbc7c0df7ebc5b961bd3245aeaf8173bae +Author: Daniel-Constantin Mierla +Date: Mon Jul 11 13:16:31 2016 +0200 - dmq: check for duplicate nodes when multi_notify enabled + tls: test if ssl crypto locking callback is already set - - also avoids adding self if we are one of the resolved IPs + - don't start if yes, ssl lib needs to use shared memory + + (cherry picked from commit 9f338d7525edf72f10bfed3b37b8db5a2870431f) -commit 8ac3d00f64f9bcd011be3ce088010d9f6e18cd1f -Author: Charles Chance -Date: Tue Apr 21 22:07:23 2015 +0100 +commit d1f3972adebe130a2a9c2029cc28914492f3ab51 +Author: murfur +Date: Mon Jul 11 13:24:21 2016 +0300 - dmq: regenerate readme + modules/ipops: fix subnet matching for mask /0 + + (cherry picked from commit 2c26f8b574e1b8adb0e4fa5a6db7a54ab455ee21) -commit c55ec2ba2dcbcfda504339bfd8070b000c9bee52 -Author: Charles Chance -Date: Tue Apr 21 21:48:53 2015 +0100 +commit 6877ffc356e7a2bc1153e9d3abf2c4b8f0a5ebd4 +Author: Dmitri Savolainen +Date: Sat Jul 9 17:05:09 2016 +0300 - dmq: resolve multiple IPv4/IPv6 addresses for a single notification address + core: fix regex error for modules parameters - - optionally enabled by new parameter "multi_notify" - - includes addresses from DNS SRV records, A and AAAA records - - patch provided by Robert Boisvert on sr-dev list + Ambiguous was possible in params for multiple modules in one config line. + + (cherry picked from commit 198b116b0d58e61d9c35fdd0988ce97192b8f61e) -commit ca1358f21efab04146eaf438daac160cd901f19d +commit 81871f9858eb960b644064689d73984c0e26c333 Author: Daniel-Constantin Mierla -Date: Tue Apr 21 21:20:10 2015 +0200 +Date: Fri Jul 8 13:48:48 2016 +0200 - core: added global parameter run_dir + rtpproxy: comment about child init rank filtering - - to be used to build the path for runtime files (fifo, ctl) + (cherry picked from commit c3acb864688656ef57d5a0a5263556fcf67d09d4) -commit 0d4d530ef0140eac7c85d404257171ae868b30bc -Author: Stefan Mititelu -Date: Tue Apr 21 21:07:15 2015 +0200 +commit f7e0b25c309d0b811c1c0bc37101b5a4e397e46e +Author: Daniel-Constantin Mierla +Date: Fri Jul 8 10:26:33 2016 +0200 - core: added core parameter dns_cache_rec_pref + pv: return 5061 for port variables (e.g., $dp) when transport is tls + + - reported by Colin Morelli, GH #700 + + (cherry picked from commit 0421bf53c6ec193238b15907cf4a7c83bbae4401) -commit 69ebc551a5303c04cc7cf5fee3f1f61308d80902 -Author: Victor Seva -Date: Tue Apr 14 11:14:46 2015 +0200 +commit b0780a56f926f9cc47da647747fc654dace3c738 +Author: Daniel-Constantin Mierla +Date: Thu Jul 7 11:47:40 2016 +0200 - usrloc: get_all_db_ucontacts use new field keepalive to filter + db_mongodb: fix warning for bool comparison + + - reported by Olle E. Johansson, GH #696 - This is WIP: - - TODO: use part_idx and part_max + (cherry picked from commit f32e12b3159cf3cd411505f875ccc8c56cf7c68f) -commit bc5ac8caee55f8d197992fb00b4cb098eeb69843 +commit 67bca90c6b6070be56f7285e8baf2c1c7d42c3c9 Author: Daniel-Constantin Mierla -Date: Tue Apr 21 19:10:01 2015 +0200 +Date: Wed Jul 6 16:59:32 2016 +0200 - textopsx: fixed clang compile warning on comparing bool with char + dialog: use cookie header to detect cseq auth increment needs + + (cherry picked from commit 34f35b51e79f4265bdfb3d654866c698bde84c01) -commit 23c6328b45115fb59797a15f0923e7f854fa4421 +commit 1b68b03c5b844a022af2d82b420604304e0b33fc Author: Daniel-Constantin Mierla -Date: Tue Apr 21 19:09:04 2015 +0200 +Date: Wed Jul 6 16:51:37 2016 +0200 - Makefile.groups: added group for erlang module + core: helper functions for header management with strz values - - not compiled by default + (cherry picked from commit aaec020b5cd033a7d7821dd4a3e447405bbbecad) -commit bc96c20de0a0544b1fbcd75e61c3383a3c699467 +commit 35deae643668e967c29ff262380531c88c37074c Author: Daniel-Constantin Mierla -Date: Tue Apr 21 16:42:37 2015 +0200 +Date: Wed Jul 6 16:49:35 2016 +0200 - pv: function to manage ruri and branches using $sbranch(key) + uac: add cookie header for cseq tracking + + - mark the request to handle it in retransmissions + - GH #679 - - sbranch_set_ruri() -- use the $sbranch(key) attributes to update first - branch fields (corresponding to r-uri) - - sbranch_append() -- use the $sbranch(key) attributes to append a - branch (alternative to append_branch() which is not affecting r-uri - branch) - - sbranch_reset() -- reset the attributes of $sbranch(key) + (cherry picked from commit b0c6db1a30b9d49f34f614d47e2bfe28b9dac62d) -commit 0f8da1746e79066a423b0808195c061701bb29da +commit 0d0719f50c5b7ea95da297a383feb11b1d91d943 Author: Daniel-Constantin Mierla -Date: Tue Apr 21 12:18:37 2015 +0200 +Date: Wed Jul 6 16:27:08 2016 +0200 - pv: new config var - $sbranch(key) + dialog: pass info on cseq update tracking via cfg environment - - a static branch structure that can be used for config operations - - the key can be like for $branch(key) - - the static branch is not used for outbound routing, it is just a - local container + (cherry picked from commit cddcf1daa0c3747c12ed54734c1c91c0e7deefd6) -commit 6d45054c3c886c0a28efa860d8f26d8c877cdd21 -Merge: 7d4d360 b3e7a54 +commit 7630aaa2c63a17c832025fdba01b022dc16bb829 Author: Daniel-Constantin Mierla -Date: Tue Apr 21 19:02:58 2015 +0200 +Date: Wed Jul 6 16:22:44 2016 +0200 - Merge pull request #132 from seudin/module_erlang + core: structure to pass cfg env attributes between components - ERLANG module + (cherry picked from commit 4af9116951d0be9c3d042eabd632971b13df8ad1) -commit 7d4d360cf9bdf2f8096147faaad5ca14f54a75f8 -Author: Federico Cabiddu -Date: Tue Apr 21 16:44:53 2015 +0200 +commit ef428c2f576d2935fba90d5019e450bf6b67372f +Author: Daniel-Constantin Mierla +Date: Wed Jun 29 18:23:54 2016 +0200 - modules/tsilo: README update + Makefile.rules: exclude test folder from tags generation paths + + (cherry picked from commit 68b7a13b9950a24455e19913e740f92baa8674dc) -commit 97345fc366b51c4c24128be39cc6b689fc254a10 -Author: Federico Cabiddu -Date: Tue Apr 21 16:44:19 2015 +0200 +commit 7164e5d3d587149e03c7ad69feb3e9139ac30757 +Author: Camille Oudot +Date: Tue Aug 30 11:43:26 2016 +0200 - modules/tsilo: documentation update + http_async_client: init PV API sooner + + fixes #760 + + (cherry picked from commit 597242dfbfd883d136aa49d88266fc9edb6b8e09) -commit b1f4cdf542e4f1436888a3420bbeac0dbe3adee7 -Merge: d7bac1d 40730e2 -Author: Federico Cabiddu -Date: Tue Apr 21 16:43:16 2015 +0200 +commit 384e9006469ed0176dce922eb49e133c969975e3 +Author: Federico Cabiddu +Date: Fri Aug 12 14:36:27 2016 +0200 - Merge branch 'master' of ssh+git://github.com/kamailio/kamailio + http_async_client: don't stop routing script execution for a POST query if transaction is not suspended + + (cherry picked from commit eb6b48f03b794ba7430e50b47402ba9cf091f96d) -commit d7bac1deed7c543f9d9d9ec140f9c37725cc92ab -Author: Federico Cabiddu -Date: Tue Apr 21 16:40:02 2015 +0200 +commit ab9403494300d5a07a7fe307c3666df8dbc23847 +Author: lazedo +Date: Sat Aug 6 12:41:14 2016 +0100 - modules/tsilo: use use_domain inherited from usrloc + kazoo: init cfg framework in child processes - - if usrloc use_domain is set, use the domain part of the ruri to store - the transaction, otherwise (the default) use only the username part. + fixes crashing since commit c7bec3320f6907c4edd8416a5e5cfa89b071a411 + (cherry picked from commit d63869cd31a0ac0a61f218b3144de7a9f400e0ae) -commit 40730e28f1a6c469a034e61698265cff37277284 -Merge: db0628e a4a9b6d -Author: Victor Seva -Date: Tue Apr 21 16:40:21 2015 +0200 +commit 12777af81509e3f6aa3e88c6aacb8844403d1e0b +Author: Daniel-Constantin Mierla +Date: Wed Jul 13 16:03:32 2016 +0200 - Merge pull request #134 from linuxmaniac/vseva/mysql_errors + janssonrpc-c: init cfg framework for additional process - kamctl: fixing mysql creation errors + - revealed by GH #708 + + (cherry picked from commit 5d8d565331111b80d72a20d19f2bcb14ea6301a4) -commit db0628effa6898a5c1376c2719e54be201b195bb -Author: jaybeepee -Date: Tue Apr 21 16:32:04 2015 +0200 - - modules/dialog_ng: only delete dlg iff all dlg_outs have completed - -commit a4a9b6d27ae35ee651840a683a5d70ba52ec232f -Author: Victor Seva -Date: Tue Apr 21 16:24:02 2015 +0200 - - kamctl: upgrade silo schema - -commit f5e02f7be4fcf629728254afff2e1c4c257d563c -Author: Victor Seva -Date: Tue Apr 21 16:23:00 2015 +0200 +commit c86610943d5c84e0c6ae8fd9e8d40f29e936b4ea +Author: Daniel-Constantin Mierla +Date: Wed Jul 13 15:36:09 2016 +0200 - lib/srdb1/schema: silo removed BLOB/TEXT defaults + tm: execut cfg_update() inside t_continue() + + - refresh the values changed inside cfg framework + - reported by Victor Seva, GH #708 - From https://dev.mysql.com/doc/refman/5.0/en/blob.html - "BLOB and TEXT columns cannot have DEFAULT values." + (cherry picked from commit c7bec3320f6907c4edd8416a5e5cfa89b071a411) -commit b847ff224ac8e738e07f9631cb7ba27091d9b22b -Author: Victor Seva -Date: Tue Apr 21 16:18:39 2015 +0200 +commit 1a5e83216e8699cab3680ff321a62a9be7c3c85f +Author: Daniel-Constantin Mierla +Date: Thu Jul 7 14:53:28 2016 +0200 - kamctl: upgrade schema for acc + rtpproxy: init rtpproxy sockets array after allocation + + - do not init sockets for PROC_MAIN (for for=yes) and PROC_INIT to + avoid duplicating sockets with child processed + + (cherry picked from commit 0fbac693b4d3ed913b64c2d000f27a96903b7e09) -commit 4295f7977a5696be9f381058cc2dcdbb6d6af3d6 -Author: Victor Seva -Date: Tue Apr 21 16:15:19 2015 +0200 +commit 9aae641cd6e9fcb28d1f4a7b1c9bb8be1adcf7ef +Author: Daniel-Constantin Mierla +Date: Thu Jul 7 14:51:24 2016 +0200 - lib/srdb1/schema: fix defaults acc_cdrs introduced by 045e2f5 + rtpengine: init rtp engine sockets array after allocation + + - it can result in closing the random values found in memory, which can + overlap with valid sockets, due to follow up execution of + build_rtpp_socks() + - do not init sockets for PROC_MAIN (for for=yes) and PROC_INIT to avoid + duplicating sockets with child processed + + (cherry picked from commit d76761bf95a5745240d655ee63241b8d4652611d) -commit b3e7a54e22c3cbdf6422860974c76e43e70013cb -Author: Seudin Kasumovic -Date: Tue Apr 21 11:03:52 2015 +0200 +commit 0a274283514a34525daa471cf8e781fb339a870c +Author: grumvalski +Date: Thu Jul 7 16:06:51 2016 +0200 - ERLANG module + tm: check branch uri against current uri when deciding if append a new branch - This module provides interact with Erlang node. The module allows sending, - receiving Erlang messages and RPC calls between each other. + (cherry picked from commit 335e44635aa69ab73ec76f713a7d5ce7ce06748c) -commit d6472f226e71739cc2d1c71197def5aaba9113b4 +commit 50da2ea87ceaabd2b9d6ef631c623cfcb3dcbdc2 Author: Daniel-Constantin Mierla -Date: Mon Apr 20 22:40:45 2015 +0200 +Date: Wed Jul 6 15:48:58 2016 +0200 - pv: simplified access to $branch by avoiding temporary storage of fields in str + dialog: open db connection from rpc processes + + - might be requered by rpc commands when db realtime is set + - reported by Dirk Teurlings + + (cherry picked from commit a7e7486b57f1b9d025f09c055a3dc360c131fa5b) -commit bca93fd8f6f8a5d3d8872e387585945329fe8205 +commit 7c108788a516c91869e95a01dafc508da473a031 Author: Daniel-Constantin Mierla -Date: Mon Apr 20 22:40:02 2015 +0200 - - core: helper function for pvs to return values based on pairs (char*, len) - -commit 6030a2256f29350021fc94fdcb41a2b8155ba715 -Author: Victor Seva -Date: Mon Apr 20 12:33:06 2015 +0200 - - Makefile: don't create run_dir on install-utils +Date: Mon Jul 4 15:11:01 2016 +0200 -commit a03b03acc8fae06d8827844f19230d6019746a98 -Merge: efa9b09 b10abba -Author: Victor Seva -Date: Mon Apr 20 11:01:47 2015 +0200 - - Merge pull request #131 from linuxmaniac/vseva/make_no_rundir + rr: refactored the check route params to detect properly if same message is used - Makefile: don't create run_dir on standard installation + - cached pointers may get invalid depending on the type of route block + - reported by GH #663 + + (cherry picked from commit 4949ebb7258aff41b2fd3a075bdc1a1af4684b5c) -commit b10abbaac7732fcd2dc605b8f3227399e9c06f97 +commit 1ca980fc2d6856d08bd725ffdbb799225ed09885 Author: Victor Seva -Date: Mon Apr 20 10:33:52 2015 +0200 - - Makefile: don't create run_dir on standard installation +Date: Wed Jun 29 17:19:25 2016 +0200 -commit efa9b09e79cdedd8c7e4ec67f22d2802f85dcaea -Author: Daniel-Constantin Mierla -Date: Sun Apr 19 21:36:57 2015 +0200 - - doc: documentation for xavp_params_explode() + rr: fix spelling errors catched by lintian #688 + + (cherry picked from commit 8f984a1be0726ec64cb4797a569fb44d1a7a9afd) -commit 2b53f673b5888cf8b88b858d8b9a1da57313217b +commit 7d9423448708330f197021d23e94e1b2d13ab8b8 Author: Daniel-Constantin Mierla -Date: Sun Apr 19 00:09:37 2015 +0200 +Date: Wed Jul 6 11:19:08 2016 +0200 - pv: new function xavp_params_explode(p, x) + userblacklist: fixed copy-paste typo when evaluating table parameter - - convert a string formatted as SIP params in xavp attributes - - e.g., xavp_params_explode("a=b;c=d;e=d", "x") results in: - $xavp(x=>a) = "b"; - $xavp(x=>c) = "d"; - $xavp(x=>e) = "f"; + (cherry picked from commit 5d285e90b0f145410acd15a7abf96d3b339a31b5) -commit e242b2cb0e4940f3299a375fe91d7135358dafa9 +commit 67fbc93eadbd07c0433d27c293336b845d30c1e9 Author: Daniel-Constantin Mierla -Date: Sat Apr 18 19:43:06 2015 +0200 +Date: Tue Jul 5 20:04:42 2016 +0200 - uac: uac_req_send() exported via api + userblacklist: more debug info when failing to do the query + + - renamed some parameters in order to be suggestive for their purpose + - code reformatting for long line + + (cherry picked from commit dce52ed68cf67375a7a9afbe34c8cc479b40c2c5) -commit 344b59580dd01a8d2ae7c24cf20d78b5128b4091 +commit 89c556b5839959d8ef6dce3f0ba7ab6a27c53f3e Author: Daniel-Constantin Mierla -Date: Sat Apr 18 19:17:12 2015 +0200 +Date: Tue Jul 5 15:33:00 2016 +0200 - uac: refreshed the content of readme + userblacklist: fix typo on evaluating the table parameter + + - regression introduced in previous commit, when converting to use core + fixup helpers + - reported by Tim Balmer + + (cherry picked from commit 3ad232e1d1ff8533fca425d3c4ee3ccaa1456916) -commit 54475ed0472fa0d7d3862748020e7428a6a03dbd -Author: Daniel-Constantin Mierla -Date: Sat Apr 18 19:16:36 2015 +0200 +commit 379e6df158837c2510592c75d4a71c19c32f4d13 +Author: Kamailio Dev +Date: Tue Jul 5 12:01:18 2016 +0200 - uac: docbook for event_route[uac:reply] + modules: readme files regenerated - topos ... -commit 356ef94bded6d6e63f659b405dc6758de17b694a -Author: Daniel-Constantin Mierla -Date: Sat Apr 18 17:12:12 2015 +0200 +commit 795556061412439618c640ef19e8579486f0c58a +Author: Spencer Thomason +Date: Fri Jul 1 09:14:12 2016 -0700 - uac: option to execute event_route[uac:reply] for uac_req_send() replies + core: ensure cfg_block structure is 8 byte aligned + + - prevents bus error on stricter cpu architectures like sparc + - reported by GH #655 - - $uac(evroute) has to be set to 1 and event_route[uac:reply] defined - - inside event_route[uac_reply] the $uac_req(...) variable is restored - back as before uac_req_send(), having the values from that time, - excepting: - - $uac_req(evcode) is set to the reply code - - $uac_req(evtype) is set to 1 if the reply was received or to 2 if - the reply was self generated (e.g., case of transmission timeout) - - if $uac_req(evtype)==1, the message processed inside the event route is the - received reply, otherwise is a faked request with no relation to the - request sent out by uac_req_send() + (cherry picked from commit 0fd0715d015a2396b0ec66cb0bc83ec0b61c0d08) -commit 52d08e0bde1c16ae19506b8053e6bd1c6c006d21 -Author: Daniel-Constantin Mierla -Date: Sat Apr 18 14:24:39 2015 +0200 +commit 301017af120d0e7c75821c00dad07892b6a366c2 +Author: Spencer Thomason +Date: Thu Jun 30 13:35:36 2016 -0700 - uac: new fields in $uac_req() to allow execution of event route on reply + uid_avp_db: remove GCC specific -Wall - - attributes: - - evroute - set to 1 to enable execution of event route - - evparam - generic string value that will be available in event route - - evcode - sip reply code, available in event route - - evtype - type of the reply - received or local generated (e.g., - timout) + (cherry picked from commit 4fc8d37df84d856b848fd4e894c21e0fbf02bb56) -commit c7fdbbf2dceee2d93902274c0c5da2766b928cbf -Author: Daniel-Constantin Mierla -Date: Sat Apr 18 14:19:14 2015 +0200 +commit c5d8095c7fa548a7199a03bf1f5d69d56202568a +Author: Spencer Thomason +Date: Thu Jun 30 13:22:57 2016 -0700 - lib: wrapper function to get next faked msg + ctl: remove return statement from void function - - does initialization of faked msg if not done before + (cherry picked from commit 16e6bdf814576e26a5f5f46bdfcb98ab1fd4e04d) -commit 38bf1ef014ce39454a602a34045a3eb247c18201 -Author: Daniel-Constantin Mierla -Date: Sat Apr 18 11:32:33 2015 +0200 +commit aea83a031cfb9a774d855462f50e4311cf9f7b43 +Author: Spencer Thomason +Date: Thu Jun 30 13:21:17 2016 -0700 - app_lua: exported ndb_mongodb cmd to lua + dialog: remove return statement from void functions + + (cherry picked from commit d90f3b86299223cd37fc21bf6af718540c76b380) -commit dcce311f4fd4a3a330d80294fc1137b66ea1f7d9 -Author: Daniel-Constantin Mierla -Date: Fri Apr 17 15:46:06 2015 +0200 +commit 33073d2af70ed0f289de6cfa2d754763e037ce1b +Author: Spencer Thomason +Date: Thu Jun 30 13:18:00 2016 -0700 - ndb_mongodb: exported inter-module api + counters: fix return statement in void function + + (cherry picked from commit 37355281dffccc42b1d83f413e3d528bdcf6cdd0) -commit 32b153592f6ec0d7ef8037731102a27c166a9220 -Merge: f09551a d67c004 -Author: Victor Seva -Date: Fri Apr 17 10:11:02 2015 +0200 +commit bed895fcdd3cc7bc3ea131873405df0c90f8eb18 +Author: Spencer Thomason +Date: Thu Jun 30 12:44:11 2016 -0700 - Merge pull request #130 from linuxmaniac/vseva/travis_install + core: fix Sun Studio build + + - update Makefile.defs for recent versions of Solaris Studio - test/travis: add installation to the test + (cherry picked from commit 2a3915d456289cfc1685b081ab351fc00c1e3dfb) -commit d67c0040058035088fd299f122cb37ba55c3256f -Author: Victor Seva -Date: Thu Apr 16 16:17:33 2015 +0200 +commit e2874495b1ecad9e85b47f6d8bdb847fceb0c3ad +Author: Giovanni Mele +Date: Fri Jul 1 14:51:12 2016 +0200 - test/travis: add installation to the test + db_unixodbc: detect DB disconnection with generic HY000 status - - only for gcc. It seems to fail on travis with clang o_0 + (cherry picked from commit d80376f9ea087328a0c46d97b908993baeb5b1b4) -commit f09551a9a806d404e77bff4710c2410a1d9887ee -Author: lucian balanceanu -Date: Thu Apr 16 11:16:06 2015 +0300 +commit 915edc834c9a694026b09d8b77dcfc4165d2998f +Author: Daniel-Constantin Mierla +Date: Thu Jun 30 14:39:28 2016 +0200 - cr: add param to avoid failed dests + topos: note in docs that masking callid is not implemented yet - - adding config param avoid_failed_destinations to toggle on/off the - avoidance of already failed destinations in cr_route + (cherry picked from commit 3c358de7683a15573dc1ee608e539ebb2e0122bf) -commit 71d65437e3eda77075d0dac38d8257f1a4dba97e -Author: jaybeepee -Date: Thu Apr 16 15:29:10 2015 +0200 - - modules/ims_qos: release dialog after referencing it in lookup +commit 87d37554e111760ad4362f0be1698ef1978ab944 +Author: Kamailio Dev +Date: Wed Jun 29 11:46:17 2016 +0200 -commit ffe18c0876dc0dec39ad9581fe20b53166ed6ff0 -Author: jaybeepee -Date: Thu Apr 16 15:29:10 2015 +0200 + modules: readme files regenerated - dmq ... - modules/ims_qos: release dialog after referencing it in lookup +commit 78a990946a1acd49e349ce46595f8641d6130781 +Author: Olle E. Johansson +Date: Wed Jun 29 11:37:40 2016 +0200 -commit d323d0cfdf3d100bd14fa01f631e2d65ed1ede95 -Author: Victor Seva -Date: Thu Apr 16 13:36:48 2015 +0200 + dmq Correct README + + Reported by Jan Hazenberg on mailing list + + (cherry picked from commit 0fbc629089328c35ac8041c5d453230de5334505) - Makefile: runbasedir should not use PREFIX. - kamcmd: add missing new RUN_DIR definition -commit b5d6699d413c201a092d1c080e5f414417c89a18 -Author: Victor Seva -Date: Thu Apr 16 14:35:39 2015 +0200 +===================== 2016-06-28 Version 4.4.2 Released ===================== - ctl: fix DEFAULT_CTL_SOCKER path +===================== Changes Since Version 4.4.1 =========================== -commit 26543b90f80791b9e2b763fb97d78a8c90e445dc +commit 3e7ab9e84893b349bbc819027c963f5c72b922b5 Author: Daniel-Constantin Mierla -Date: Thu Apr 16 11:59:30 2015 +0200 +Date: Tue Jun 28 15:08:44 2016 +0200 - acc: warning set to debug level if request is missing for dialog cdrs - - - self generating bye requests don't have incoming request + Makefile.defs: version set to 4.4.2 -commit 06177b12936146d48378cc5f6c6e1b157ebd519b -Merge: 6e26044 6909de0 -Author: Victor Seva -Date: Thu Apr 16 11:58:23 2015 +0200 +commit afad9210bd0f3b87ed18182572cc7f233bccd117 +Author: Daniel-Constantin Mierla +Date: Tue Jun 28 15:00:23 2016 +0200 - Merge pull request #89 from linuxmaniac/vseva/defaults - - set defaults of fifo and ctl to /var/run/kamailio - - Closes: #48 - Closes: #89 + pkg/kamailio: version updates in some spec files -commit 6e2604464e64cfaaf1e0327228f53f4787b69470 -Author: Timo Teräs -Date: Mon Mar 9 16:30:53 2015 +0200 +commit da1728b658cfb144713ebb9593ae742aeb5ca8fe +Author: Daniel-Constantin Mierla +Date: Tue Jun 28 14:55:59 2016 +0200 - sqlops: fix use-after-free by deep copying result name - - When creating a new result handle, deep copy the result name. - Otherwise we might end up accessing the name after it's freed. + pkg/rpm: update spec files for v4.4.2 -commit 08d7b66310e7c09a70db296f533f98b32d2e4ad8 +commit 8c3bf5423fc5d8be97a0a85c47ea4cdc9b59dc1f Author: Daniel-Constantin Mierla -Date: Thu Apr 16 10:51:36 2015 +0200 +Date: Tue Jun 28 14:38:11 2016 +0200 - uac: reset the ongoing registration flags in case of error in tm callback + userblacklist: user core fixup helpers for string parameters + + - it allows both static and dynamic string parameters + - should fix the issue of using static strings, the parameters were no + longer evaluated and empty values were used - - resulted in being stuck in a state that didn't retry registration - - reported by AndyJRobinson, GH#124 + (cherry picked from commit 54562b873c2c3d0a04f0587e7706188a3eb19a74) -commit 572d4c8e886b7b7d0bbc975ecf1a4d20bf9e18b9 -Author: jaybeepee -Date: Wed Apr 15 21:35:36 2015 +0200 +commit bd9c32da743edacc8a2d6de48711c709ad1a7845 +Author: Victor Seva +Date: Tue Jun 28 14:22:36 2016 +0200 - modules/dialog_ng: add release_dlg api function + pkg/kamailio/deb: version set to 4.4.2 -commit 265dc95aac8eb4b5cee7992dde55ff08c92a7ac5 -Author: Daniel-Constantin Mierla -Date: Wed Apr 15 18:04:10 2015 +0200 +commit 5f2b1721d1df12c2c3c9f7787b980cfb4e79af52 +Author: Victor Seva +Date: Tue Jun 28 14:19:34 2016 +0200 - dialog: run both DLGCB_TERMINATED and DLGCB_TERMINATED_CONFIRMED callbacks for local BYE + pkg/kamailio/deb: mention that http_client is included at kamailio-utils-modules package - - only DLGCB_TERMINATED was run, but that resulted in CDRs not being - stored by acc for that situation - - on a report by Mickael Marrache + (cherry picked from commit 90c90480c0de001c6c3010bae67a617b24b1ee4a) -commit 1e7e0279bbf53c4a530aa3a8c1d322a68d8090f9 +commit a5866ef926ff6770227931c755188eb6178be07e Author: Daniel-Constantin Mierla -Date: Wed Apr 15 18:03:40 2015 +0200 +Date: Tue Jun 28 12:38:23 2016 +0200 - acc: DLGCB_TERMINATED callback can be run without received request + acc: proper value for double representation of time for db accouting on 32b - - the case of local generated bye + (cherry picked from commit 4fe259ab61212bed926cff8380239980b4fe6b19) -commit 74c93c2f11dbf70e108f0a5a568f957b953a5efd -Merge: 3b8aa15 fa90ad3 +commit e81e15068b9733c2ed1ec21eb1fb4b5972bde36b Author: Daniel-Constantin Mierla -Date: Wed Apr 15 17:33:28 2015 +0200 +Date: Tue Jun 28 09:42:00 2016 +0200 - Merge pull request #129 from mikomarrache/patch-8 + http_client: removed unnecessary cloning of proxy parameter - dialog: add new flag for expired dialogs + - the value is already zero terminated and this way avoid memory leak + - wrap returning code to cfg in order to avoid 0 values + - backported from master branch commit + be677c2f8930f967277438b7b661baeacd7a5a53 -commit 3b8aa15602a11cd67d8101f84016d55969c05e27 -Author: Richard Good -Date: Wed Apr 15 15:42:22 2015 +0200 +commit 0350b416a4d8f09312ecba44bcfd44be15f3545a +Author: Kamailio Dev +Date: Mon Jun 27 16:17:55 2016 +0200 - modules: ims_registrar_scscf: Added support to receive RTR on Cx/Dx interface + modules: readme files regenerated - acc ... -commit 077c4002025188a49475fa6bd3f279a680b870f5 -Author: Richard Good -Date: Wed Apr 15 15:41:32 2015 +0200 +commit fcc8266555d8e0846d0330d010b14fd6e8245290 +Author: Victor Seva +Date: Mon Jun 27 13:44:00 2016 +0200 - modules:ims_usrloc_scscf: added new API method to expire contact + sca: sca_call_info_update() document missing parameter + + (cherry picked from commit 0d0d42fa4bda5f37618af4c383f40bbb9ba46067) -commit fa90ad3daef2dc34b97c4c13c0b97bf5f04165d5 -Author: mikomarrache -Date: Wed Apr 15 16:28:47 2015 +0300 +commit 968afa0ba6a896cdba3a426fafb90607b2c96b12 +Author: Victor Seva +Date: Mon Jun 27 13:39:24 2016 +0200 - dialog: set DLG_FLAG_EXPIRED flag when timeout + sca: doc indent using tabs + + (cherry picked from commit a71aa0d3338a3e925053002d875d5f3ad969065c) -commit 216fc94cf3f2aa708f50797de3c74e58e28cc6fe -Author: mikomarrache -Date: Wed Apr 15 16:00:47 2015 +0300 +commit 55bca3abc0703a70cc65b769f419a532b820cb08 +Author: Victor Seva +Date: Mon Jun 27 13:10:20 2016 +0200 - dialog: add new flag for expired dialogs + sca: add section ids + + (cherry picked from commit 730b4b0ca839bbcf248c3f7ddfee6974c1fa0c84) -commit c178f4427af82d6d33101677835c60de1c343073 -Author: Daniel-Constantin Mierla -Date: Wed Apr 15 11:25:18 2015 +0200 +commit 1464e0d46da6de4e662ba1fea5dd97c8f9848be6 +Author: Victor Seva +Date: Mon Jun 27 13:04:06 2016 +0200 - tls: updated to use shm_available_safe() + sca: fix indent doc files + + (cherry picked from commit 6e9061bc101591d8ce8a9c7b7cbf696574d7545d) -commit c4d48f3ae363fb6f6a7d789a0f32b28eb60c2404 +commit c64209b200d82c3be78cf32254333f55d0b92afb Author: Daniel-Constantin Mierla -Date: Wed Apr 15 11:22:36 2015 +0200 +Date: Mon Jun 27 13:04:50 2016 +0200 - tls: removed inline specifier and renamed safe_shm_available() + userblacklist: removed errorneous extra checks in fixup parameters function + + - parsing the parameters should be enough for validity + - no need to attempt to parse to integer first parameter, it's not + expected and results in a crash for static string parameters + - reported by Jan Hazenberg - - became shm_available_safe() to have the shm_ prefix which common for - shm functions - - declaring inline in c header file and implementing in c source file - makes clang throw compile warnings + (cherry picked from commit 5fd2c91f512b7311f11c76023da45758fb8c4365) -commit 6b078c89facce89cfcd1e8cd8148f419b63ac5af -Merge: 1f29210 1fe36fa +commit 5aeffff693e8d7498f25b42ce9949f28901fb953 Author: Daniel-Constantin Mierla -Date: Wed Apr 15 11:19:09 2015 +0200 +Date: Mon Jun 27 11:54:08 2016 +0200 - Merge pull request #126 from kamailio/coudot/tls_shm_available_bug + auth_identity: include openssl/x509_vfy.h + + - looks like being required by openssl 1.1.0 to get the definition of + X509_STORE_CTX + - reported by Victor Seva, GH #685 - fix race condition in tls module when checking available memory limits + (cherry picked from commit 21321c70358997f354326be048b22c7b2dfb045a) -commit 1f2921097316925600573402793b5332a6535e7d -Author: Daniel-Constantin Mierla -Date: Wed Apr 15 11:16:01 2015 +0200 +commit 2e82a8bb035843f31a5add7ef83f9c3721f0f657 +Author: Dmitri Savolainen +Date: Mon Jun 27 12:53:01 2016 +0300 - usrloc: change log level from info to dbg when socket is not local + nat_traversal: set via branch according to "z9hG4bK..." format (instead of "branch=0") - - common scenario when working with shared db, reducing the syslog - thoughput - - based on a patch by Mickael Marrache + (cherry picked from commit 5261c1d0723a5b59edd231c93e42d1c963eb6375) -commit 045e2f56e2558c6d29e42eb1dd60802c4c100e93 -Author: Daniel-Constantin Mierla -Date: Wed Apr 15 11:10:51 2015 +0200 +commit ffd5b68651c24546e38c2dfff4e64937db131077 +Author: Dmitri Savolainen +Date: Mon Jun 27 12:50:19 2016 +0300 - kamctl: regenerated db/sql creation scripts for acc_cdrs updates + nathelper: set via branch according to "z9hG4bK..." format (instead of "branch=0") + + (cherry picked from commit 1edb4298ca5b890c40f9d7df5f29199a90b0c4fd) -commit f2b468ab50e6ce2cc698486c88080f2d93ed057d -Merge: 2835291 287884b +commit 00f6c9f6c2f2665d455f9ad686198eae40758c19 Author: Daniel-Constantin Mierla -Date: Wed Apr 15 11:08:17 2015 +0200 +Date: Thu Jun 23 21:04:47 2016 +0200 - Merge pull request #125 from mikomarrache/patch-7 + utils: safe wrapper in case http status code is returned 0 - acc: use appropriate types for core values - -commit 28352916336644540a14dcf0c31e217c7621799a -Author: Sven Neuhaus -Date: Wed Apr 15 11:03:38 2015 +0200 - - dispatcher: fix socket selection + - returning it will stop config processing, replace the return code with + -1 in such case - - wrong variable was used for scanning the value stored in avp + (cherry picked from commit afb5bb99960d951217c6c94465cda92b10394e1a) -commit 1fe36fa983b8f271165750977120d758faf84d01 -Author: Camille Oudot -Date: Tue Apr 14 19:41:38 2015 +0200 +commit 601f47e71a3980d28663249e77b98a93bfdc27a0 +Author: Spencer Thomason +Date: Fri Jun 24 00:20:13 2016 -0700 - tls: use multiprocess-safe shm_available() + core: fix logging macros for Solaris Studio - under high load, the values returned by shm_available() can be inconsistent. - Use safe_shm_available() instead. + (cherry picked from commit 5244959b3089370e5df01d26e77d31211fce9370) -commit 51e263de80532e297546f17d2f2ed528ffe9731b -Author: Camille Oudot -Date: Tue Apr 14 19:38:14 2015 +0200 +commit e3f53ef6158057b090c398f5afc0b2bcdf747430 +Author: Spencer Thomason +Date: Fri Jun 24 00:01:59 2016 -0700 - mem: add a multiprocess-safe shm_available() + db_postgres: rename ntohll and htonll functions - new safe_shm_available() function secured with shm_lock() + - fix namespace conflict on platforms where these are present in system libs + + (cherry picked from commit 2ebdbec8af56027c9c94fe5e67975c9a319b9620) -commit 287884ba9183da3eed2eb4fba1e31d287730fe26 -Author: mikomarrache -Date: Tue Apr 14 20:37:37 2015 +0300 +commit d7ddbd5fa460e701484dc76ba4f0c6b5a9861483 +Author: Daniel-Constantin Mierla +Date: Thu Jun 23 07:25:47 2016 +0200 - acc: update schema and version + acc: don't multiply seconds with 1000 for time mode 2 + - it can go out of range for 32bit arch - Change type of columns: - -> start_time and end_time as datetime - -> duration as float - Also increment version of acc_cdrs table. + (cherry picked from commit 0c6653bf1c3ee7b64e811bc752e03fa0adfb0dfe) -commit ebf6483650c0cff88703e071383184b3f4ac7309 -Author: Mickael Marrache -Date: Tue Apr 14 18:18:30 2015 +0200 +commit a11ebb7d0e3c5fe7e160a2679a21c7c00bb11e99 +Author: Daniel-Constantin Mierla +Date: Wed Jun 22 18:41:40 2016 +0200 - db_mongodb: change warn to info for log message on unhandled data type log + log_custom: debug message before setting custom log function - - less verbosity to syslog + (cherry picked from commit 6c36b242f085367dd1d869bfbceb6454dcb2e006) -commit 82ea7fd9a292d15d66b2cd71a621333095bba216 +commit e47f912cc889e7e5ed50304924cb42292cff10be Author: Daniel-Constantin Mierla -Date: Tue Apr 14 17:17:38 2015 +0200 +Date: Wed Jun 22 18:34:40 2016 +0200 - registrar: regenerated readme + log_custom: use buffer size for printing functions + + (cherry picked from commit 071556e9b75557dad756951f2fad71504469ca32) -commit ddffe3d1958ad4b76b99f370a5289c67155dc773 +commit 8814e5fc2e44f792cbff8e83d184034b3d1ebc59 Author: Daniel-Constantin Mierla -Date: Tue Apr 14 17:17:18 2015 +0200 +Date: Mon Jun 20 22:39:08 2016 +0200 - registrar: fixed ending tag names in xml docs + tm: detect blind uac branch to avoid generating cancel for it + + (cherry picked from commit e36eebf36b72819b1b23c39469d60206f5df2bcf) -commit d6404937cfb7498dd85c4329f07269ee7c64f157 -Author: mikomarrache -Date: Tue Apr 14 15:53:29 2015 +0300 +commit f087e6211f92484a5f0e625bc145479ba91b31a6 +Author: Daniel-Constantin Mierla +Date: Mon Jun 20 19:16:26 2016 +0200 - acc: fix copy/paste error + tm: cleaned always enabled TM_UAC_FLAGS define + + (cherry picked from commit 4e7599064a75b8e6d0e6fbf228690cd628bfd508) -commit b38874078ccf23b093bc94484e08bf1a4ba53f90 -Author: mikomarrache -Date: Tue Apr 14 15:29:02 2015 +0300 +commit 6f8ff98f10a6df21a1b669881fef5df91254446b +Author: Giovanni Mele +Date: Fri Jun 17 16:57:48 2016 +0200 - acc: change type of core fields to real types - + db_unixodbc: do not consider SQL_NO_DATA return code as an error - Change the type of the core fields as follows: - -> start and end as dates (instead of string) - -> duration as double (instead of string) - Then, set the db_val with appropriate value and type. + (cherry picked from commit feb195b2d9c801bc3591b1e95de6b70956e76dfe) -commit 9801ad5b4e7aaf1fd20c82d2923aa7aaedd1c2f4 -Author: mikomarrache -Date: Tue Apr 14 15:22:29 2015 +0300 +commit 81e55b894d1585adb0e48a88460a3b5e6a5ceb4d +Author: Daniel-Constantin Mierla +Date: Fri Jun 17 15:58:36 2016 +0200 - acc: add new types + tm: actions triggered by t_coninue() executed as FAILURE_ROUTE type + - the callback for scripting routing blocks are already those for + failure route and the transaction is already created, all processing + happing in the context of invalidating the "suspended" special branch + - should prevent mistaken use of functions restricted for request route, + such as msg_apply_changes() + - following a report by Victor Seva, GH #676 - Add new types to support core fields of type date (for start and end date) and double (for duration). + (cherry picked from commit f121e7c099ebf862dedcd5bdc1652d188446aa72) -commit a95abdfe84f6f2af37097e3571816abab11d218b +commit f8aa9240ef8ea284b54789abf5556886066a7fa3 Author: Daniel-Constantin Mierla -Date: Tue Apr 14 12:38:59 2015 +0200 +Date: Fri Jun 17 15:24:48 2016 +0200 - presence: retrieve order used everywhere for generating notify request + textops: more details in doc about limitations of msg_apply_changes() - - it was not used in some cases - -commit f56776826584de2dd0023bc3185107d3ff9491bb -Author: Vicente Hernando -Date: Tue Apr 14 11:57:13 2015 +0200 + (cherry picked from commit 474ab2280309574236f796f76e3b61251d8d23bd) - ndb_redis: init_without_redis continue only if connection or starting commands fail. - -commit 398f2c12d9ad8bac07444ba7670dcb4b1f335431 -Merge: 2c4e8ef 025887d -Author: vhernando -Date: Tue Apr 14 11:14:01 2015 +0200 +commit 57e0caee3ce86aca54f8eb7d15e0e65a5fb942ab +Author: Olle E. Johansson +Date: Wed Jun 15 22:30:07 2016 +0200 - Merge pull request #121 from giavac/master + imc Fix formatting - Optionally init ndb_redis when redis is not available - -commit 2c4e8ef671a3b38b7a3a52f36bbd6191f620b4c6 -Author: Richard Good -Date: Tue Apr 14 10:03:21 2015 +0200 - - modules/ims_qos: fixed stat typo - -commit 51578d83811129c895428cce0828b613be044130 -Author: Richard Good -Date: Tue Apr 14 10:01:02 2015 +0200 - - modules:ims_qos: separated stat aar_replies_received into media_aar_replies_received and registration_aar_replies_received - -commit aa8d1ff214630f2b3bc2bc6d03c57e6b17a995a4 -Author: jaybeepee -Date: Tue Apr 14 09:46:22 2015 +0200 - - modules/ims_charging: added extra stat replies received for CCRs (reverted from commit 90d0a995a150b32f5300e919dca22bd0176642a2) - -commit e7e9095238d8fb2cd420e80641398d5f7c654065 -Author: jaybeepee -Date: Tue Apr 14 09:46:22 2015 +0200 - - modules/ims_charging: added extra stat replies received for CCRs (reverted from commit 90d0a995a150b32f5300e919dca22bd0176642a2) - -commit 90d0a995a150b32f5300e919dca22bd0176642a2 -Author: jaybeepee -Date: Tue Apr 14 09:30:08 2015 +0200 - - modules/ims_charging: added extra stat replies received for CCRs - -commit 9ebf9a1461b4da608e211fc5ba68f517584b03dc -Author: Richard Good -Date: Tue Apr 14 09:37:43 2015 +0200 - - modules:ims_qos: Added new stat aar_replies_received + (cherry picked from commit 8fa5c9f915b3aadb93835ae18a4f88a08b799f5e) -commit b7075b103d27b3fe2b2c02e27e826b7638951c30 -Author: jaybeepee -Date: Tue Apr 14 09:30:08 2015 +0200 +commit 3c45fb4674837b2302876a116c446e4abdd31196 +Author: Federico Favaro +Date: Wed Jun 15 09:15:47 2016 +0200 - modules/ims_charging: added extra stat replies received for CCRs + cdp: Change debug level of peer state to DBG + + IMHO debug level of message telling the state + of the peer should be DBG. If any problem + occurs on peers proper message will be written + on log. This way we have lighter log + + (cherry picked from commit 79d022fbd50684e89d98afab66b66c08f259f4eb) -commit 0e8ef73c2095a7564735a1dab9ed32e3531fc59e -Author: Camille Oudot -Date: Mon Apr 13 17:04:41 2015 +0200 +commit df5859f3269acbc2443ef77d951afd9c63ba7465 +Author: Daniel-Constantin Mierla +Date: Tue Jun 14 15:26:06 2016 +0200 - pv: fix memory leak when getting $conid + rtpproxy: added section ids and small adjustments to content and format + + (cherry picked from commit daa89b4e206dac49607c25bf67748915b9f280a2) -commit 025887dea5be7f40c6c9b1ba7e2b2cf522c4c9f0 -Author: Giacomo Vacca -Date: Mon Apr 13 10:19:01 2015 -0400 +commit 0106c43e75a87d9ead0016489330b66e6c0b0b72 +Author: Daniel-Constantin Mierla +Date: Mon Jun 13 12:50:04 2016 +0200 - ndb_redis: update README with init_without_redis + kamdbctl: more error help for missing .pgpass file + + (cherry picked from commit 8a724a70859f68431094acab2a8f9ce000bbd89b) -commit 7b18dcc3017baeb5b918c98765f1526f22438788 -Author: Giacomo Vacca -Date: Mon Apr 13 16:15:51 2015 +0200 +commit 21304177dd9586e7bb3a04d40a8329464abcd9c1 +Author: Daniel-Constantin Mierla +Date: Mon Jun 13 12:33:28 2016 +0200 - ndb_redis: update doc with init_without_redis + kamdbct: fixed typo in pgpass name + + (cherry picked from commit 631b69c43ffccbcecc3f43c3ebe4e614fe5f105d) -commit 2058793b61d1e4ad251ded334750bf4ec1ff1f6b -Author: Giacomo Vacca -Date: Mon Apr 13 16:09:03 2015 +0200 +commit b3a320a6f7af03f12b832272c5bee3d34d596604 +Author: Victor Seva +Date: Fri Jun 10 16:47:02 2016 +0200 - ndb_redis: optionally allow mod init with redis unavailable + textops: filter_body() remove previous \r\n that belongs to the boundary + + we were removing only '--boundary\r\n' but we must remove '\r\n--boundary\r\n' + + (cherry picked from commit c5dca6096785296c89acbfa4b2f7a7fd8a16d9a2) -commit fb1e33801ab22320aecbc0609d8b6faafd657bf3 +commit 41fb662fed24e2edab8535059f5e6eb1bd7e0ca0 Author: Daniel-Constantin Mierla -Date: Sat Apr 11 12:45:58 2015 +0200 +Date: Thu Jun 9 13:06:20 2016 +0200 - app_lua: update to make it compile against lua 4.2 + rr: use msg->pid to match cached route params - - testing at runtime should still be done + - could be related to GH #663 + + (cherry picked from commit 8f4ec60795294d17597d3bbd20e68f4f03c98495) -commit 74f3d852389b1aa50dd1b34d73e25f62de152339 +commit 1c943ebeb1b4689b36a8d77c3283e0ad894cc403 Author: Daniel-Constantin Mierla -Date: Sat Apr 11 09:07:19 2015 +0200 +Date: Thu Jun 9 13:04:47 2016 +0200 - app_lua: detect lua 4.2 + uac: debug message if contact not matched for 200ok and jump to done - - enable module compat mode + (cherry picked from commit 0ad04a5847ceb6709c7c948a5a6ac958555c0265) -commit bb3a6a64e31dd011bd4267121021f30d8e7f975a +commit e6e45a4f1bf6abacdf2485b94e197881eac0c361 Author: Daniel-Constantin Mierla -Date: Fri Apr 10 16:46:28 2015 +0200 +Date: Wed Jun 8 15:00:48 2016 +0200 - ndb_mongodb: documented mongodb_find_one(...) cfg command + purple: added note in the docs that the module is not actively maintained + + (cherry picked from commit 4a681437a22ededb8392d06db6bfd0d377649051) -commit ed4d7fbee914c7fc4c5da438f4c4f021648d1e75 +commit 7814715fe05d327d2995d73eab6233b210d63983 Author: Daniel-Constantin Mierla -Date: Fri Apr 10 16:39:37 2015 +0200 +Date: Wed Jun 8 14:42:03 2016 +0200 - ndb_mongodb: added mongodb_find_one() + async: small update to copyright year to test auto-generation of readme - - find first matching document and return it - - faster when knowing it is supposed to be only one, or needing only one + (cherry picked from commit 8ccb20adf51035aebf4512dbba71c8c1c9db4f92) -commit 4a7ad5eedbc956277a65af4b57b1aaea8fcf389b -Author: Juha Heinanen -Date: Fri Apr 10 16:36:53 2015 +0300 +commit 6d694df0f0731602768bae2d52871bd3c62e67e3 +Author: Daniel-Constantin Mierla +Date: Wed Jun 8 14:40:47 2016 +0200 - rtpengine: added weights to rtpengine_sock example + app_java: added note in makefile about generating the readme on a system without java + + (cherry picked from commit 816ece3d35fea26d656addb38f73412d3f7c33b3) -commit c6eff0f5f6ec33fba5d61e4a6616d1bddfe6f958 +commit 6f9f6ae1524a7ccfa6ae297d2c37036bbd2162dd Author: Daniel-Constantin Mierla -Date: Fri Apr 10 11:32:20 2015 +0200 +Date: Wed Jun 8 13:58:39 2016 +0200 - ndb_mongodb: fixed name of the function in docs + app_java: skip throwing error of missing java for make readme + + - controlled by DOCBUILD=yes + + (cherry picked from commit bb1e6ceadacd2b38826ed996e44cc45f3d8d1a41) -commit 545037884e806df0d450fd6d7b425808c944d8a8 +commit 414d750be5117d7fe5fb5fe248b7bcadaec5dfa4 Author: Daniel-Constantin Mierla -Date: Wed Apr 8 16:29:33 2015 +0200 +Date: Wed Jun 8 10:39:25 2016 +0200 - kamctl: added help for 'db connect' command + core: mem/tlsf - return unsigned long for function giving available memory + + - aling it with mem api prototype + + (cherry picked from commit 0ea1b700458888f60d54f3ebf192e09b9ea56d37) -commit 1044cd532c57641881e21c9b59d523b8f9d59340 -Author: jaybeepee -Date: Wed Apr 8 15:33:03 2015 +0200 +commit 05f2de7eeec6ee6930b1163b481257488720faff +Author: Daniel-Constantin Mierla +Date: Wed Jun 8 10:28:32 2016 +0200 - modules/cdp: Fixed possible deadlock with sticky loadbalancing of CDP sessions + core: mem - qmalloc - cast size to unsigned long in debug messages + + - better for compatibility with C sepcs older than C99 + - newer specs allow %zu, but 'z' specifier is not in older + specs, %lu being the safer approach + + (cherry picked from commit f17ac878a555b9baad3954e0e8c6b390378bad5a) -commit 224e34a55b012ee46996bb4d86e662d99e4c0541 -Author: jaybeepee -Date: Wed Apr 8 15:26:06 2015 +0200 +commit 43dc23cf55bc7d63e0932c909ae3daf65b698c68 +Author: Daniel-Constantin Mierla +Date: Wed Jun 8 10:19:20 2016 +0200 - modules/ims_charging: return if no reply associated with dlg - - prevents possible segfault - - also removed old commented code + core: mem - fmalloc - cast size to unsigned long in debug messages + + - better for compatibility with C sepcs older than C99 + - newer specs allow %zu, but 'z' specifier is not in older specs, %lu + being the safer approach + + (cherry picked from commit 7e8b679b6a2c66b3695da3f1e076cfa525607d34) -commit e0c11e332b7cffc94cada674defb567ce2f6562e -Author: Richard Good -Date: Wed Apr 8 15:20:24 2015 +0200 +commit dc83ca0ba9cf77dd38d45d34294ef3b20de1bc4a +Author: Daniel-Constantin Mierla +Date: Wed Jun 8 10:04:08 2016 +0200 - modules/ims_qos: improved selection of identifier for Rx + core: mem - use size_t for tlsf memory management functions + + (cherry picked from commit 587e24a48094ad672aa625461a69363219de6922) -commit 6cc60c159c692b2f38d0fce6b07510b9cc88efd0 -Author: jaybeepee -Date: Wed Apr 8 15:18:21 2015 +0200 +commit eea33aad9bb67e8f4ef7413f44cdf52d1fc35b83 +Author: Daniel-Constantin Mierla +Date: Wed Jun 8 10:03:50 2016 +0200 - modules/dialog_ng: fix route_sets for callee_leg + core: mem - use size_t for qm memory management functions + + (cherry picked from commit 7a5c95d77f863d4af6115b2b744549bd7fe6fc89) -commit 285225c30fbe23c58361966020da1b9d089cca9e -Author: jaybeepee -Date: Wed Apr 8 15:17:04 2015 +0200 +commit dd2f601207d647c0d7c8e946daaa01eddc095444 +Author: Daniel-Constantin Mierla +Date: Wed Jun 8 10:03:18 2016 +0200 - modules/dialog_ng: end dialog on timeout + core: mem - use size_t for fm memory management functions + + (cherry picked from commit b2f1456ae03f2c75aceab8eea177464dc4cc3672) -commit 0e30a2d5223de2ca32cb90b7eb65055784f3b3e8 +commit f10511e04712242cd98efa443c1f870a5209db7f Author: Daniel-Constantin Mierla -Date: Wed Apr 8 11:02:06 2015 +0200 +Date: Wed Jun 8 10:01:51 2016 +0200 - acc: docs for cdr_on_failed parameter + core: mem - use size_t for memory management api prototypes + + - be compatible with standard malloc(...) prototype + + (cherry picked from commit bab8a6b172e2a0a6155515587e72d674205dbe0c) -commit 625b094d0ae669ce07bd321735809175f4269eb4 +commit 05fe8f8de5d83437f80fe3e18950450eb98e1bce Author: Daniel-Constantin Mierla -Date: Wed Apr 8 10:58:25 2015 +0200 +Date: Tue Jun 7 15:35:04 2016 +0200 - acc: cdr_on_failed default value set to be backward compatible + tm: relocated pointers in cfg group structure to align them to 8bytes + + - cope with stricter cpu architectures like sparc + - reported by GH #655 + + (cherry picked from commit 2717aed626b09298d6150c68463cb3bdb1a81906) -commit dde198813953bc722ae5aafecbcea4d2f26c38e8 +commit 96088fc7a1f39544175a4582be1e346db17611b4 Author: Daniel-Constantin Mierla -Date: Wed Apr 8 10:56:58 2015 +0200 +Date: Mon Jun 6 17:33:08 2016 +0200 - acc: new parameter cdr_on_failed to control writing cds for failed dialogs + utils/misc/vim: added few missing tokens to vim syntax highlighting + + (cherry picked from commit b7e36c57f47d1b17c375db2a554c84100e1f0ee8) -commit 59f1451db54be608f1417075001d2f0aa5be8786 -Author: Daniel-Constantin Mierla -Date: Tue Apr 7 12:34:34 2015 +0200 +commit c5ae53c738381f9b6d4c6163a6630717e7fb2ed0 +Author: Victor Seva +Date: Mon Jun 6 11:47:23 2016 +0200 - textops: fixed reply code on no-match for search_hf() with flag f + tls: fix compilation warning + + > tls_config.c:403:6: warning: ignoring return value of function declared with warn_unused_result attribute [-Wunused-result] + > write(out_fd, &ch, 1); + > ^~~~~ ~~~~~~~~~~~~~~ + > tls_config.c:408:5: warning: ignoring return value of function declared with warn_unused_result attribute [-Wunused-result] + > write(out_fd, &ch, 1); + > ^~~~~ ~~~~~~~~~~~~~~ + > 2 warnings generated. - - true instead of false was returned - - reported and patch by Paolo on sr-users + (cherry picked from commit f0ac15dc896f959cb92ad85fd1426fac1aa0bb55) -commit 1a3ce79cc058c57197a7b3736b3ec8b08be5c33f -Author: Daniel-Constantin Mierla -Date: Fri Apr 3 20:02:37 2015 +0200 +commit a60ba5506c64b7752cf55e9ef3292ce21dcd1741 +Author: Victor Seva +Date: Mon Jun 6 11:41:14 2016 +0200 - uac_redirect: updated the example script + app_java: fix compiler warning + + > java_msgobj.c:233:80: warning: comparison of array 'msg->add_to_branch_s' equal to a null pointer is always false [-Wtautological-pointer-compare] + > jStrParam = (*env)->NewStringUTF(env, (msg->add_to_branch_len <= 0 || msg->add_to_branch_s == NULL) ? "" : strdup(msg->add_to_branch_s)); + > ~~~~~^~~~~~~~~~~~~~~ ~~~~ + > 1 warning generated. + + (cherry picked from commit 44d17221c3a72401b1d3157cc969acf07cb80bd0) -commit 9ac723b84e37322f2b6771027de546a963eceb34 -Author: Robert Boisvert -Date: Fri Apr 3 10:23:51 2015 +0200 +commit a0fa55b3bd63b1bbd1d29e9a07d7e6e95fad789b +Author: Victor Seva +Date: Mon Jun 6 10:24:01 2016 +0200 - ipops: added documentation for new function and pv + cdp: fix compilation warnings + + > peerstatemachine.c:97:19: warning: implicit conversion from enumeration type 'peer_state_t' to different enumeration type 'peer_event_t' [-Wenum-conversion] + > next_event = I_Snd_Conn_Req(p); + > ~ ^~~~~~~~~~~~~~~~~ + > peerstatemachine.c:531:10: warning: implicit conversion from enumeration type 'peer_event_t' to different enumeration type 'peer_state_t' [-Wenum-conversion] + > return I_Rcv_Conn_NAck; + > ~~~~~~ ^~~~~~~~~~~~~~~ + > peerstatemachine.c:534:9: warning: implicit conversion from enumeration type 'peer_event_t' to different enumeration type 'peer_state_t' [-Wenum-conversion] + > return I_Rcv_Conn_Ack; + > ~~~~~~ ^~~~~~~~~~~~~~ + > 3 warnings generated. + + (cherry picked from commit 26d1426cfeb926ee440542716e7365d16b627801) -commit 7e89554a727bfb965c2cdc4dbbd7606988351e60 -Author: Robert Boisvert -Date: Thu Apr 2 21:24:24 2015 +0200 +commit b9b1aefa7e7e8d559e86e9cda2075d352a6eee43 +Author: Victor Seva +Date: Mon Jun 6 10:22:57 2016 +0200 - ipops: added function to perform dns srv query in config + cdp: fix compilation warning - - new config variable $srvquery(key) gives access to result + > peerstatemachine.c:97:19: warning: implicit conversion from enumeration type 'peer_state_t' to different enumeration type 'peer_event_t' [-Wenum-conversion] + > next_event = I_Snd_Conn_Req(p); + > ~ ^~~~~~~~~~~~~~~~~ + > peerstatemachine.c:531:10: warning: implicit conversion from enumeration type 'peer_event_t' to different enumeration type 'peer_state_t' [-Wenum-conversion] + > return I_Rcv_Conn_NAck; + > ~~~~~~ ^~~~~~~~~~~~~~~ + > peerstatemachine.c:534:9: warning: implicit conversion from enumeration type 'peer_event_t' to different enumeration type 'peer_state_t' [-Wenum-conversion] + > return I_Rcv_Conn_Ack; + > ~~~~~~ ^~~~~~~~~~~~~~ + > 3 warnings generated. + + (cherry picked from commit 007bd7e0c874f25ff73bfd36bd210b0fed2bac7a) -commit 6039fc5ef6c738c2272adda30e69e3783457fc13 -Author: Daniel-Constantin Mierla -Date: Thu Apr 2 12:36:02 2015 +0200 +commit 83a8709249c4b0197eb78b70bc7e37fdd146f3e4 +Author: Victor Seva +Date: Mon Jun 6 10:10:13 2016 +0200 - textopsx: selects moved to dedicated section + pua_xmpp: fix compilation warning + + > xmpp2simple.c:372:10: warning: expression which evaluates to zero treated as a null pointer constant of type 'char *' [-Wnon-literal-null-conversion] + > slash= '\0'; + > ^~~~ + > 1 warning generated. - - not belonging to the functions + (cherry picked from commit c3bbe6e059ade56959b68e6caae2f8521734f502) -commit f969ffc1393d6ffcd8437ec1aa35255dbf73a8dd -Author: Daniel-Constantin Mierla -Date: Thu Apr 2 12:04:20 2015 +0200 +commit 7d8e4e6b7b0ad43ec3920ddca941458bfe773841 +Author: Victor Seva +Date: Mon Jun 6 10:05:45 2016 +0200 - acc: uniformizing section ids + peering: fix compilation warning + + > verify.c:58:30: warning: comparison of array 'vp->strvalue' equal to a null pointer is always false [-Wtautological-pointer-compare] + > if (vp->lvalue==0 || vp->strvalue==0) + > ~~~~^~~~~~~~ ~ + > 1 warning generated. + + (cherry picked from commit bb545d02225f23e7d1d9c950f2e4645db3d33c4f) -commit f4d052b844452add3ed8bcdf6e6c78700e588205 -Author: Daniel-Constantin Mierla -Date: Wed Apr 1 14:36:52 2015 +0200 +commit 3bc6b9123c46dab10a53baafea95a84be62cfbf9 +Author: Victor Seva +Date: Mon Jun 6 10:03:42 2016 +0200 - msilo: documentation for skip_notification_flag parameter + misc_radius: fix compilation warning + + > functions.c:47:27: warning: comparison of array 'vp->strvalue' equal to a null pointer is always false [-Wtautological-pointer-compare] + > if (vp->lvalue==0 || vp->strvalue==0) + > ~~~~^~~~~~~~ ~ + > 1 warning generated. + + (cherry picked from commit 4e2f17dfc6ae25739cb40328f3d5636ea1ab6fca) -commit b6f5e5377003660543adf667efe16f43b63319eb -Author: Daniel-Constantin Mierla -Date: Wed Apr 1 14:31:36 2015 +0200 +commit ccb09869abe80d2b5d9d709431c0499514720969 +Author: Victor Seva +Date: Mon Jun 6 09:45:38 2016 +0200 + + auth_radius: fix compilation warning + + > authorize.c:110:8: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion] + > ret = AUTH_NONCE_REUSED; + > ~ ^~~~~~~~~~~~~~~~~ + > authorize.c:114:8: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion] + > ret = AUTH_STALE_NONCE; + > ~ ^~~~~~~~~~~~~~~~ + > authorize.c:120:8: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion] + > ret = AUTH_ERROR; + > ~ ^~~~~~~~~~ + > authorize.c:124:8: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion] + > ret = AUTH_NO_CREDENTIALS; + > ~ ^~~~~~~~~~~~~~~~~~~ + > authorize.c:131:8: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion] + > ret = AUTH_OK; + > ~ ^~~~~~~ + > authorize.c:148:9: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion] + > ret = AUTH_ERROR; + > ~ ^~~~~~~~~~ + > authorize.c:153:12: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion] + > ret = AUTH_ERROR; + > ~ ^~~~~~~~~~ + > authorize.c:159:12: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion] + > ret = AUTH_ERROR;; + > ~ ^~~~~~~~~~ + > authorize.c:186:12: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion] + > ret = AUTH_ERROR; + > ~ ^~~~~~~~~~ + > authorize.c:189:12: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion] + > ret = AUTH_OK; + > ~ ^~~~~~~ + > authorize.c:193:8: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion] + > ret = AUTH_INVALID_PASSWORD; + > ~ ^~~~~~~~~~~~~~~~~~~~~ + > 11 warnings generated. + + (cherry picked from commit 1db19f1672ebebcb916f4415c59f5c820a1b0068) + +commit de13f20446d0ee18ccc1033858caf21b11cd2437 +Author: Victor Seva +Date: Mon Jun 6 09:37:36 2016 +0200 - msilo: new parameter skip_notification_flag + db_berkeley: fix compilation warning + + > km_db_berkeley.c:486:58: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] + > if ((ret = bdb_get_columns(_tbc->dtp, *_r, lres, _nc)) < 0) + > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ + > km_db_berkeley.c:513:50: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] + > if ((ret=bdb_append_row( *_r, dbuf, lres, i)) < 0) + > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ + > km_db_berkeley.c:567:58: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] + > if ((ret = bdb_get_columns(_tbc->dtp, *_r, lres, _nc)) < 0) + > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ + > km_db_berkeley.c:572:47: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] + > if ((ret=bdb_convert_row( *_r, dbuf, lres)) < 0) + > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ + > 4 warnings generated. - - set to a flag value to be used to mark when the notification back to - sender shouldn't be sent - - feature request by Anthony Messina (amessina), GH#61 + (cherry picked from commit 6e376ee273cb95afae31b0183e3b7bf3468c4520) -commit 845bdb8884743f5e126a53eb6aeb34f1f6afb1ea -Author: Daniel-Constantin Mierla -Date: Tue Mar 31 15:15:27 2015 +0200 +commit b051f29e2064205d11ebf6f8d6b315089aa7de6f +Author: Olle E. Johansson +Date: Fri Jun 3 10:34:25 2016 +0200 - presence: query_str filled with value of the corresponding column + kamctl remove svn ID's and history - - static value was used that made setting of parameter for column names - not being considered + (cherry picked from commit e3cfe2adf3af1cb7b909c5f4d3c7a481d1cfa224) -commit 47d506cd6d6045bd09d89cafab0384d2a74a9c65 -Author: Daniel-Constantin Mierla -Date: Tue Mar 31 15:08:23 2015 +0200 +commit dfc6643fbbfb7f1c469c264e6f93b0be402d5a56 +Author: Lucian Balaceanu +Date: Thu Jun 2 17:34:39 2016 +0200 - presence: variable for last subscription uri made static and renamed + rtpengine: cookie is now $server_id_$mypid_$myseqn - - avoid eventual conflicts in the future because presence modules bind between - each other + (cherry picked from commit 3e92a47fb3c3f4fc97f7e3cdeb33f8b111c6b1f8) -commit 08acf091a4500d2eec3987a0d07fd87cf5df63e1 -Merge: 202506e 97f1909 -Author: lazedo -Date: Mon Mar 30 15:46:42 2015 +0100 +commit f265cad36b2cffc83cfcb517731aea98510cafc2 +Author: Carsten Bock +Date: Thu Jun 2 17:46:51 2016 +0300 - Merge pull request #118 from kamailio/lazedo/presence-subs + JANSSON: Improved support for JSON-Type "Integer", which can in fact be long (or even long long) - presence: add $subs pv for subscription access + (cherry picked from commit 691e088fe5b23faa39c2f32df19690ce4b7a7c7d) -commit 97f1909cc1bcb93d196067ce2171d9a5a9661328 -Author: Luis Azedo -Date: Mon Mar 30 13:23:44 2015 +0100 +commit 9d6a2aec05c77422a1e90dd89af5f63eed76c374 +Author: Mikko Lehto +Date: Thu Jun 2 16:50:35 2016 +0300 - presence: add $subs pv for subscription access + Revert "modules/ims_qos modules/ims_registrar_scscf: fix comparison of unsigned expression" + + This reverts commit 94b4c25640c0f486c578a9e0670dad0aa5dda0c1. - after handle_subscribe there is no safe way in script to obtain the presently - because re-subscription RURI is ip of kamailio and To-Uri may not contain - the presently. + (cherry picked from commit a787c38c241eec165c2cb8e0362ba68fa769141f) + +commit 2d0cb2ca09f0db87e7de02c169841c407bf41cf1 +Author: Lucian Balaceanu +Date: Thu Jun 2 13:50:02 2016 +0300 + + rtpengine: change cookie to hostname_pid_seqno - $subs(uri) will allow access to this value + - pid_seqno in gencookie() is not a unique identifictor in a multi kamailio setup - added as a pv to allow extension to get more properties from subscription + (cherry picked from commit 69e57b9260c6c09380fdb9cfd074ea67a459230a) -commit 202506eccabba3a405e43e7e388f00409c297ef0 -Merge: c28a887 fa4b3d4 +commit 7b77d4e218224c6fa6f3ccb8280b238da0e5e4e6 Author: Daniel-Constantin Mierla -Date: Mon Mar 30 13:38:06 2015 +0200 +Date: Thu Jun 2 08:34:16 2016 +0200 - Merge pull request #116 from kamailio/lazedo/sip-uri-match-4 + presence: new parameter to set the order by string for fetching records + + - used when retrieve_order is 1 + - new param: retrieve_order_by - default value is 'priority' - presence: add sip_uri_match module parameter + (cherry picked from commit 8c5432e5285564d6104189d6358774b8d8f3382b) -commit c28a887d3a51b471e0bcc111e6af65e17fc36a1b -Author: Richard Good -Date: Mon Mar 30 11:54:10 2015 +0200 +commit c2e87f015f821e44bdb8bbaed8d61e695343ea2d +Author: Daniel-Constantin Mierla +Date: Tue May 31 17:21:29 2016 +0200 - modules/ims_qos: check for called party id in request if P-Asserted-Id not present + misc/vim: syntax highlighting for log facility values + + (cherry picked from commit ab079178ab49d8c855f135d85d8e8acfb03ec6bd) -commit dac57a30ee194b401a7c149f2d54f83f6d077370 -Author: lucian balanceanu -Date: Mon Mar 30 09:49:23 2015 +0300 +commit c4566aa89a9564859dc856036363cd803219c825 +Author: Dragos Oancea +Date: Tue May 31 10:52:18 2016 +0200 - rtpengine: add queried_nodes_limit parameter + ims_registrar_pcscf: fix getContactP() for is_registered_fallback2ip param - so that script function pcscf_is_registered() actually finds the contact . - - queried_nodes_limit: configure the total number of nodes inside a set - to be tried before giving up selecting a rtpengine. + (cherry picked from commit e88ea4022af341bb67e959c42d2096a42ae3796d) -commit 932a5e8a452e59d27ad70f3c5b72591ad372894a +commit e80eee8be47cfe96fbaa08f96df325bdbfc78b09 Author: Stefan Mititelu -Date: Mon Mar 30 08:54:46 2015 +0300 +Date: Mon May 30 17:13:28 2016 +0300 - userblacklist: adding new fifo commands + mem: Add on-error log messages for q_/f_ functions + + Log some errors in case some memory API functions fail. - - adding dump_blacklist, check_blacklist, check_whitelist, check_userblacklist, - check_userwhitelist commands + (cherry picked from commit b0dea316a2aa471cf92f122e3432a6549cf0ff5c) -commit e7dc20f48c674b0eca5419c93e05a430a5b20e71 -Author: grumvalski -Date: Sun Mar 29 17:48:20 2015 +0200 +commit 995d4084ebe192a51b89bd6b901e4d4b6ddd9fd7 +Author: Daniel-Constantin Mierla +Date: Mon May 30 13:11:06 2016 +0200 - modules/tsilo: return from ts_store if transaction is not defined + core: setting the equivalent of IP_TOS socket option for IPv6 + + - reported in GH #598 + + (cherry picked from commit ff63e5c79592a37012018660552950a40a1a1581) -commit 8a7c70a5b831542cde77e7945e97d51901b95310 +commit 761f84a61745e433850cb286da020ea595752784 Author: Daniel-Constantin Mierla -Date: Sat Mar 28 15:00:48 2015 +0100 +Date: Mon May 30 12:38:32 2016 +0200 - tm: clone path vector back to pkg for faked message + evapi: start evapi dispatcher process with rpc rank - - it is cloned and can be changed, resulting in attempt to free a shm - pointer via pkg operation - - reported by Jose Seabra + - it may be used for handling responses from external app with sip + related functions + - reported by GH #622 + + (cherry picked from commit 2d1a7e453301cfdee2c71ccebcd66d86f4c62b3a) -commit 3957db5fb51e23535a89b15c8f05463e5702424d +commit fd6501f8fb220408c98daeb2e84cb3e17ade5d7c Author: Daniel-Constantin Mierla -Date: Sat Mar 28 14:31:59 2015 +0100 +Date: Mon May 30 12:03:02 2016 +0200 - tm: reply_lock per transaction made re-entrant + ndb_mongodb: note about mongodb c driver version and tls - - on a report by Jason Penton - - re-ordered some includes to get rid of cross dependencies in defines + (cherry picked from commit d1fbec620bdb923aace665170ddabedddd2a3697) -commit 44fdfff6b407bc3d541cd43f249700a69f1e0eb8 +commit 3968feedcb62ca39ae6088b3ec6c5bec875d6b37 Author: Daniel-Constantin Mierla -Date: Sat Mar 28 08:57:15 2015 +0100 +Date: Mon May 30 12:02:23 2016 +0200 - usrloc: proper init column names + db_mongodb: note about mongodb c driver version and tls - - reported and patch by Anthony Messina, GH#117 + (cherry picked from commit 59daee299909a7e27b5d0ec5d9a9967cd1e8e7e3) -commit 64dc2bbba40ccc2afc1d34c78a6d066892549fb3 +commit fbe8523a87637518aa9d1d9d2c2954156959d5f7 Author: Daniel-Constantin Mierla -Date: Fri Mar 27 15:57:53 2015 +0100 +Date: Mon May 30 11:54:34 2016 +0200 - usrloc: doc updated for the parameters of the new db table columns + tm: reset T_ASYNC_SUSPENDED flag at beginning of t_continue() + + - should allow doing t_suspend() inside the route executed by + t_continue() + - related to GH #644 and #645 + + (cherry picked from commit 827ec4fc2c9fcc2bf9f814b0545ae64784d8e3b0) -commit c3d74313a4ec98096878ba231859b5bf11fd0e54 +commit 4cc369335494f2be7ac71cbc2662c9635162a47b Author: Daniel-Constantin Mierla -Date: Fri Mar 27 15:47:22 2015 +0100 +Date: Mon May 30 10:35:38 2016 +0200 - kamctl: database creation scripts updated for new location table schema + tm: coherent indentation and whitespacing for t suspend code + + (cherry picked from commit d85dd4eab4eaf797ecf89a1d3540c02c207d2de4) -commit 5c817f8997cea3345f053129aa8945968b8b17bd -Author: Daniel-Constantin Mierla -Date: Fri Mar 27 15:46:58 2015 +0100 +commit c67edea82106d40f709fc60c47def88debf0f3c8 +Author: Olle E. Johansson +Date: Fri May 27 16:13:16 2016 +0200 - registrar: set server_id field for location record + sqlops Delete comment about modules_k + + (cherry picked from commit 1b29ea77e1ceef8c74da930c9df88409d47f744e) -commit 67e40ec09e4bdce7fe2454bd39e75769ee1581dd -Author: Daniel-Constantin Mierla -Date: Fri Mar 27 15:45:58 2015 +0100 +commit 3cca0eb13b151b7822ee97d4bcd4e315aaeb77b1 +Author: Olle E. Johansson +Date: Fri May 27 09:53:31 2016 +0200 - usrloc: store server_id, connection id and keepalive values for location records + acc_radius Remove SVN ID, history - - following the discussion on sr-dev to allow various optimizations for - db-only mode + (cherry picked from commit 18d614e6c2eb673c08871206e6cdc153cc3c8928) -commit 1a76fb05126d8154e59fc1524727d7f84d8cff2c +commit 13a361bec5cb2491ef9bc6f8b917e14e102814d4 Author: Daniel-Constantin Mierla -Date: Fri Mar 27 15:43:37 2015 +0100 +Date: Thu May 26 16:54:54 2016 +0200 - srdb1/schema: new columns to table location + pv: signed int string representation for avps - - server_id - store the value for server id - - connection_id - store the value for connection id of location record, - to be used for db only mode tcp optimizations (not restored after - restart) - - keepalive - set if the nat branch flag is set for the contact, to - speedup selection of records for nat keep alive in db only mode + (cherry picked from commit d6124b3d894b130e3ebeabb247230966a77c9ceb) -commit 66accf1a36ddba2371f404a8fdcc1e65dbd5e078 -Author: Daniel-Constantin Mierla -Date: Fri Mar 27 09:00:53 2015 +0100 +commit 52358d298f55e89841fa22899b7cb83826843c30 +Author: Andrew J Robinson +Date: Thu May 26 16:30:35 2016 +0200 - presence: increment presentity table version to 4 in code + uac: read all 12 columns from uacreg database table - - reported by Juha Heinanen + - fix when the database connector does not have DB_CAP_FETCH capability + - GH #642 + + (cherry picked from commit d3abee96d9ddfa6b0600d9e7f6864bd5786fdebe) -commit 3b029441f506dd85c6d4c827f2616d0076b7b8e9 -Author: Ovidiu Sas -Date: Thu Mar 26 21:42:57 2015 -0400 +commit 3e0f2436d57e46dda85a9f875beedbdf3eb7724c +Author: Mikko Lehto +Date: Wed May 25 13:49:39 2016 +0300 - registrar: fix compile errors introduced by commit b86ff789b86d2f7512c23fe0624d553b37ce11cb - - define w_registered3 - - define w_registered4 - - define registered_fixup + modules/ims_dialog: fix clang warning -Wparentheses-equality + + (cherry picked from commit 5395bbe6522ab9b9874162874935119cff8aa764) -commit 7b011b32be9bca6cf618e2eecd8364dce4041af6 -Author: Luis Azedo -Date: Fri Mar 27 01:36:45 2015 +0000 +commit eb9a338ba563919682e74306c33d87961be17414 +Author: Mikko Lehto +Date: Wed May 25 13:49:21 2016 +0300 - registrar: fix wrong var name + modules/ims_qos modules/ims_registrar_scscf: fix comparison of unsigned expression + + (cherry picked from commit 94b4c25640c0f486c578a9e0670dad0aa5dda0c1) -commit fa4b3d45c77015f70ab8d0c20e05fde8c0bd0dba -Author: Luis Azedo -Date: Fri Mar 27 01:19:29 2015 +0000 +commit 3b3481180be9878d8837f49b77cd76284cc11221 +Author: Mikko Lehto +Date: Mon May 23 23:49:59 2016 +0300 - presence: add sip_uri_match module parameter + modules/[call_control|mediaproxy]: proper assigment to NULL pointer - added param sip_uri_match - 0 - case sensitive (default) - 1 - case insensitive + CC (clang) [M mediaproxy.so] mediaproxy.o + mediaproxy.c:1929:27: warning: expression which evaluates to zero treated as a null pointer constant of type 'void *' [-Wnon-literal-null-conversion] + *_params->param = MPInactive; + ^~~~~~~~~~ - can be extended to a more compliant version, (sensitive user, insensitive domain). - the parameter sets the function to call to match uris. + (cherry picked from commit 700b334b51b39056c4c0004451ca41304510f164) -commit b86ff789b86d2f7512c23fe0624d553b37ce11cb -Merge: 4763dfa 34fd472 -Author: Daniel-Constantin Mierla -Date: Thu Mar 26 23:34:26 2015 +0100 +commit ad0f9f62fa761dcfcbe4ee21a92acc97be1c9c8f +Author: Mikko Lehto +Date: Tue May 24 12:37:44 2016 +0300 - Merge pull request #45 from grumvalski/cdp_src_addr + modules/sipcapture: fix possible NULL pointer dereference - modules/cdp: added src_addr parameter in peer definition + (cherry picked from commit a9cce1772d25e1f03cec3ee291ae5fb4a945f82f) -commit 4763dfab3bc02bdcab1c388802ae94c3f9568ecd -Merge: da5d414 7ba770c -Author: Daniel-Constantin Mierla -Date: Thu Mar 26 23:26:53 2015 +0100 +commit d84d8a800e504561fe9036bc8e0fd15bd17d334f +Author: Mikko Lehto +Date: Tue May 24 12:27:14 2016 +0300 - Merge pull request #115 from kamailio/lazedo/registrar-registered + modules/uid_domain: initialize variables - registrar : add optional params to registered function + (cherry picked from commit e6a3f6605f50d16f673724a2dc6cf22fc47bc717) -commit da5d414e2ad294f213a5c9aa5c3cf7dd78fe79a6 -Author: Daniel-Constantin Mierla -Date: Thu Mar 26 21:18:49 2015 +0100 +commit b351655cc53342137106cf9d6e4182950ee8ea0e +Author: Mikko Lehto +Date: Tue May 24 07:32:33 2016 +0300 - presence: update to README content based on latest docbook files + modules/rr: initialize to NULL + + (cherry picked from commit c00867e50de1c7855fed8a05745086092fef38a5) -commit 07fee9b2a24236aca9fd134a1e0c3748e643b8a8 -Author: Daniel-Constantin Mierla -Date: Thu Mar 26 21:18:21 2015 +0100 +commit c95ab90d1f8f6fcf3d172f774c8c501775a35999 +Author: Dmitri Savolainen +Date: Tue May 24 12:51:06 2016 +0300 - presence: documente new parameters xavp_cfg and retrieve_order + uac: reset UAC_REG_DISABLED flag (if need) after refresh + + (cherry picked from commit 8e0ae1f825c080a050c7e755eea67d2c56d6841f) -commit 352f05c9838ce3dcc33f5c5f83a9c8850b6543b0 +commit 877beb6b77baf44ddab3dc78965b3c065a2c1ee2 Author: Daniel-Constantin Mierla -Date: Thu Mar 26 21:03:40 2015 +0100 +Date: Tue May 24 09:07:32 2016 +0200 - presence: added section ids for parameters and functions + Makefile.defs: cleaned unnecessary whitespaces + + (cherry picked from commit 897d8319ddce6b7834c8277ddcc436ffdbe5d164) -commit 9f92b33c5eb35c32e5d07789bac86e850dfd0d83 -Author: Daniel-Constantin Mierla -Date: Thu Mar 26 20:43:45 2015 +0100 +commit 82b24524dc6df842d3d1c11bf5f5a1c16f2a8fa5 +Author: Mikko Lehto +Date: Sun May 22 02:43:18 2016 +0300 - presence: option to set priority for presentity documents + modules/presence_conference: re-organize preprocessor symbols - - xavp_cfg - new parameter to specify the name of xavp use to store - attributes for publish processing - - priority can be set inside xavp_cfg with $xavp(xavp_cfg=>priority) - - priority is stored in a new column inside database table presentity - for each publish that has the xavp set - - retrieve_order - new parameter to specify the order to retrieve the - records from database. Default value is 0 (retrieve by received_time - like so far). If set to 1, retrieve by priority value - - if xavp_cfg parameter is set but priority field inside it is not, then - inside the database is stored a value based on timestamp so the newest - records will have a higher value, preserving the old behaviour even - the retrieve_order=1 + Fixes compilation on FreeBSD where no special feature request is needed + + (cherry picked from commit 9852f751edb99b5190f16ffe68c62eb0f51f85bc) -commit 97389e4e84fb15a640767b9e4d5f1b9d63a105f6 -Author: Daniel-Constantin Mierla -Date: Thu Mar 26 19:57:12 2015 +0100 +commit 01698f47ab0be22f0d80cb0a66bbeb92f8177821 +Author: Mikko Lehto +Date: Wed May 18 02:18:52 2016 +0300 - kamctl: regenerated db schema - updates to sip_trace and presentity + lib/srdb1: fix compiler warning + + > CC (gcc) [L libsrdb1.so.1.0] db_ut.o + > db_ut.c:57:32: warning: extra tokens at end of #undef directive + > #undef _XOPEN_SOURCE_EXTENDED 1 /* solaris */ + > ^ + + (cherry picked from commit dee2478e521f2f829c66d025fb6ca17326138910) -commit bb407ad5afb41697be127b390e25ba959fa1b27b +commit 6787a5ecfec64202ec80c2e9fe85c149a31e75ff Author: Daniel-Constantin Mierla -Date: Thu Mar 26 19:54:40 2015 +0100 +Date: Fri May 20 07:16:46 2016 +0200 - srdb1/schema: added priority column to presentity table + dispatcher: get rid of compile warning about unreachable code - - version of the table increased to 4 - -commit beba4579778f8af0bc0d88c13a6f433dd9ffa8a0 -Author: Daniel-Constantin Mierla -Date: Thu Mar 26 15:51:54 2015 +0100 + (cherry picked from commit 5ac0f5c43da106e8130143a2ad83d4a131513a18) - presence: more use of variable for received_time column instead of static value +commit cac8f8df9dc1ccd6c97e80aaee1f4f3d766f1f7e +Author: Dmitri Savolainen +Date: Wed May 18 20:07:38 2016 +0300 -commit 8729aa8cde19f39eebce7ef9be7e31ea121b9a99 -Author: Daniel-Constantin Mierla -Date: Thu Mar 26 15:48:09 2015 +0100 + uac: uac.reg_refresh doc is supplemented + + (cherry picked from commit 3310aa311b76d44f33cf784d20b874db259b61b2) - presence: use name of received_time column from associated variable +commit 14c1376a8b1afecae229124d84acb629b60424cc +Author: Mikko Lehto +Date: Tue May 17 14:49:54 2016 +0300 -commit cb2ad9c0036a6390a9ca19d638fe220662d24b3c -Author: jaybeepee -Date: Thu Mar 26 15:40:53 2015 +0200 - - modules/CDP: added stickiness to loadbalancing of diameter peers - -commit 7ba770ca43485531eef4ad4ccbefe046d8fb2223 -Author: Luis Azedo -Date: Wed Mar 25 11:21:21 2015 +0000 - - registrar : add optional params to registered function + lib/srutils: fix gcc warning GH#612 - 3rd parameter as flag is used to optionally restrict contacts when searching. - values are - 1 - match_callid - 2 - match_received - 3 - match_contact + > sha256.c: In function 'sr_SHA256_Final': + > sha256.c:613:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] + > *(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; + > ^ + > sha256.c: In function 'SHA512_Last': + > sha256.c:930:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] + > *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1]; + > ^ + > sha256.c:931:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] + > *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0]; + > ^ - 4th parameter as flag to optionally perform action on positive match - values are - 1 - set xavp_rcd with value from matched contact - -commit e172b7a1b66edfb302da8d498eada7da9f21643e -Author: Richard Fuchs -Date: Fri Mar 20 09:43:36 2015 -0400 - - tmrec: update licensing and copyright info + (cherry picked from commit cfccbfa8590dffe9a1282dba6ce757f686f55599) -commit e6cdb91037abc5a7668e7919281072b15e758739 -Author: Daniel-Constantin Mierla -Date: Fri Mar 20 12:57:04 2015 +0100 +commit d26f29930d3ccc01419f0868637c7a1f1eb8173d +Author: Victor Seva +Date: Tue May 17 13:23:11 2016 +0200 - tm: formated the comment without + chars + presence_xml: fix compiler warning #612 + + > CC (gcc) [M presence_xml.so] pidf.o + > In file included from /usr/include/time.h:27:0, + > from pidf.c:50: + > /usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp] + > # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" + + (cherry picked from commit 9f1aa931dafc0d654af4d51b5e4ab6a72a71fb0c) -commit 0ee3dc5e3edc49cf62f97ddd87a40b12c59b73ff -Author: jaybeepee -Date: Fri Mar 20 13:29:34 2015 +0200 +commit ea3002aa6f7d1edf8cb25d9338903049132c33fe +Author: Victor Seva +Date: Tue May 17 13:22:18 2016 +0200 - modules/tm: restore code to set blind uac branch last_reply > 200 + presence_dialoginfo: fix compiler warnings #612 + + > CC (gcc) [M presence_dialoginfo.so] pidf.o + > In file included from /usr/include/time.h:27:0, + > from pidf.c:48: + > /usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp] + > # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" + + (cherry picked from commit e8c7b29e1d051619595f2d45276d8c775bc278a3) -commit 8960a3e7aa52f706676806c175e70d228cc11549 +commit 387ed0885d17d8210864b45f43ec0dea564777a4 Author: Victor Seva -Date: Tue Feb 17 14:23:31 2015 +0100 +Date: Tue May 17 13:20:45 2016 +0200 - dialplan: use PV_IDX_ITR + db2_ldap: fix compiler warnings #612 + + > CC (gcc) [M db2_ldap.so] ld_fld.o + > In file included from /usr/include/string.h:25:0, + > from ../../str.h:24, + > from ld_cfg.h:30, + > from ld_fld.h:37, + > from ld_fld.c:39: + > /usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp] + > # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" + + (cherry picked from commit 08927c98edab0c1201138fbd4f9760dcdf3a35c1) -commit 28553798f5b30a6204752ed38a69c42b78bc91cc +commit 5245837ff6af3c88f5a9bb8ee4f5266379fb97ff Author: Victor Seva -Date: Tue Feb 17 13:55:18 2015 +0100 +Date: Tue May 17 13:02:22 2016 +0200 - core: introduce '+' as PV_INDX_ITR + presence_conference: fix compiler warnings #612 - With this notation we want to check all values one by one not - the list of coma separated values + > CC (gcc) [M presence_conference.so] pidf.o + > In file included from /usr/include/time.h:27:0, + > from pidf.c:49: + > /usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp] + > # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" + + (cherry picked from commit 3976224f6bb4b790b1752a00174439a1e2de1665) -commit 82a441f1dd3ff4099d42d42758533fbcf6d7c8de +commit 2aa23040971693c9ebc598e3b4bea79e3d2a86de Author: Victor Seva -Date: Mon Jan 5 14:35:56 2015 +0100 +Date: Tue May 17 12:09:02 2016 +0200 - dialplan: using $(avp("key")[*]) on subst rules + db_mysql: fix compile warning #612 + + > CC (gcc) [M db_mysql.so] my_cmd.o + > In file included from /usr/include/string.h:25:0, + > from ../../lib/srdb2/../../str.h:24, + > from ../../lib/srdb2/db_gen.h:30, + > from ../../lib/srdb2/db_drv.h:29, + > from my_cmd.h:25, + > from my_cmd.c:33: + > /usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp] + > # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" + + (cherry picked from commit 3c4fa1250c8c3de74e9415a064ba75f97e1cbb4f) -commit 7d70bad74e6329dff0d22c3b215be8a56d696f79 +commit b6d341548abeb85f20c305b4cf0617e8f9a404ee Author: Victor Seva -Date: Fri Jan 2 18:58:00 2015 +0100 +Date: Fri May 13 10:36:45 2016 +0200 - dialplan: using $(avp("key")[*]) on match rules + lib/srdb1: fix compiler warning #612 + + > CC (gcc) [L libsrdb1.so.1.0] db_ut.o + > In file included from /usr/include/time.h:27:0, + > from db_ut.c:50: + > /usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp] + > # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" + + (cherry picked from commit 09470aed719b0fad6c600d9c18a339e343550f33) -commit e5f8c686acd2e4d7e7009476699280efbbe7b6d2 -Merge: 6484b19 5681e9c +commit 78192719edaa1327a4420a2f248ee5602eae91aa Author: Daniel-Constantin Mierla -Date: Thu Mar 19 16:42:17 2015 +0100 +Date: Tue May 17 08:16:12 2016 +0200 - Merge pull request #114 from giavac/master + cfgutils: added more to docs for route exists functions - Minor typos in textops README + (cherry picked from commit 472782d2f094b1971543b4d0c3733058d9086d78) -commit 5681e9c6e9850eedd15e53219ce2bc55fd38dd90 -Author: Giacomo Vacca -Date: Thu Mar 19 11:30:56 2015 -0400 +commit 0aa9f5458a59909a756b5a6f0d692ec264bb3fa3 +Author: Phil Lavin +Date: Mon May 16 15:17:04 2016 +0100 - textops: minor typos in README + pua_dialoginfo: reduce the log level of every call to dialog_publish + + Change the log level of calls to dialog_publish() from INFO to DBG + + (cherry picked from commit a5e89b42151ba3697835cff4a2a379422a9afc46) -commit 6c866c1296a34e0733bf33a1feac57ca8bfc64d7 -Author: Giacomo Vacca -Date: Thu Mar 19 11:28:58 2015 -0400 +commit e8a063a7001bad32144765f12928cf188b773e20 +Author: Daniel-Constantin Mierla +Date: Sun May 15 08:52:29 2016 +0200 - textops: minor typos in doc + usrloc: coonect to db from rpc processes + + - evapi consumers are using rpc rank and there can be save/lookup + operations + - reported by GH #622 + + (cherry picked from commit ee11732bdc1637d646b772ce22d43bd571f7a736) -commit 6484b199fb48acc2c55f318812f2c968b845ca80 +commit c6740e84d2dd42e7aa0da33d18228c516573de46 Author: Daniel-Constantin Mierla -Date: Wed Mar 18 19:50:09 2015 +0100 +Date: Sat May 14 10:11:33 2016 +0200 - tm: propagate the on_failure value in to the branch for t_suspend() + jansson: removed empty parameters section - - likely lost when on_failure was added to each branch structure - - reported by Mickael Marrache + - added section ids + + (cherry picked from commit 92dcec82b4f7e0de07e06d51bd57d612c949241c) -commit 768dc8b566e2af04411570ef7b4d55a210a1927d +commit feaae5a731c35778d8de32a7c87baead2def4987 Author: Daniel-Constantin Mierla -Date: Wed Mar 18 18:36:37 2015 +0100 +Date: Sat May 14 09:30:55 2016 +0200 - sqlops: fix column index for sqlops_is_null() + acc_radius: added section ids in docbook - - report and patch by Mihaly Zachar + (cherry picked from commit 38bdeee32afb895af3a759373e1c29a30e5e5560) -commit ab427110cbf5ec80f7791358573a31f318a4fc83 -Author: Olle E. Johansson -Date: Mon Mar 16 19:58:07 2015 +0100 +commit 27e2343d5e7da9c03fd37ecbe49e126d4a753d75 +Author: Victor Seva +Date: Fri May 13 10:34:33 2016 +0200 - db_text: Remove SVN ID, remove history notes + dispatcher: fix compiler warning #612 + + > CC (gcc) [M dispatcher.so] dispatch.o + > dispatch.c: In function 'ds_set_attrs': + > dispatch.c:263:8: warning: 'tmp_rweight' may be used uninitialized in this function [-Wmaybe-uninitialized] + > int tmp_rweight; + > ^ + > make[3]: 'libkmi.so.1.0' is up to date. + + (cherry picked from commit 6dd4b1f83cb041a42571ef1355832661be0ae492) -commit 32d992364a9fe812deac62f8f3edd632cf932080 -Merge: 53de5da 18e250f -Author: Olle E. Johansson -Date: Mon Mar 16 19:42:44 2015 +0100 +commit debffdc10887a0654ce1e6451dead14aa36083b2 +Author: Victor Seva +Date: Fri May 13 10:25:42 2016 +0200 + + dmq_usrloc: fix compiler warning #612 + + > CC (gcc) [M dmq_usrloc.so] usrloc_sync.o + > usrloc_sync.c: In function 'usrloc_dmq_handle_msg': + > usrloc_sync.c:403:12: warning: 'reg_id' may be used uninitialized in this function [-Wmaybe-uninitialized] + > ci.reg_id = reg_id; + > ^ + > usrloc_sync.c:401:13: warning: 'methods' may be used uninitialized in this function [-Wmaybe-uninitialized] + > ci.methods = methods; + > ^ + > usrloc_sync.c:405:19: warning: 'last_modified' may be used uninitialized in this function [-Wmaybe-uninitialized] + > ci.last_modified = last_modified; + > ^ + > usrloc_sync.c:394:7: warning: 'q' may be used uninitialized in this function [-Wmaybe-uninitialized] + > ci.q = q; + > ^ + > usrloc_sync.c:399:12: warning: 'cflags' may be used uninitialized in this function [-Wmaybe-uninitialized] + > ci.cflags = cflags; + > ^ + > usrloc_sync.c:397:11: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized] + > ci.flags = flags; + > ^ + > usrloc_sync.c:396:10: warning: 'cseq' may be used uninitialized in this function [-Wmaybe-uninitialized] + > ci.cseq = cseq; + > ^ + > usrloc_sync.c:393:13: warning: 'expires' may be used uninitialized in this function [-Wmaybe-uninitialized] + > ci.expires = expires; + > ^ + > usrloc_sync.c:407:2: warning: 'action' may be used uninitialized in this function [-Wmaybe-uninitialized] + > switch(action) { + > ^ + > make[3]: 'libsrutils.so.1.0' is up to date. + + (cherry picked from commit c7c8d31e4a4f9640673099aa1589e3fe96fad558) + +commit 1740d3861d0bcabe3897285fc1f64629da1433a0 +Author: Victor Seva +Date: Thu May 12 22:08:28 2016 +0200 + + sms: fix compiler warning #612 (#617) + + * show error message if error in write + + > CC (clang) [M sms.so] libsms_modem.o + > libsms_modem.c:77:2: warning: ignoring return value of function declared with warn_unused_result attribute [-Wunused-result] + > write(mdm->fd,cmd,cmd_len); + > ^~~~~ ~~~~~~~~~~~~~~~~~~~ + >1 warning generated. + (cherry picked from commit a61ff084bc87c7d3dd05b14afd35795b466d37dc) - uac: Add counters for active, disabled and total number of registrations +commit 644bc141ca91c86fdf83b0998558dd647e6a0693 +Author: Frank Carmickle +Date: Thu May 12 18:00:52 2016 +0200 -commit 18e250f15b02e3ea30ecc037f758e8d16be14969 -Author: Olle E. Johansson -Date: Mon Mar 16 19:37:17 2015 +0100 + tm: updated the reason text for canceled branches after one is answered + + - change answered elsewhere to call completed elsewhere + - "Call completed elsewhere", RFC3326, defines this as the string to send + - submited by William King , GH #610 + + (cherry picked from commit e75837afc7e146d0f43e637d394146c3f1d05eea) - Update documentation +commit 99e1c33b1bb16959273114eebcf1cf134d75997d +Author: Kamailio Dev +Date: Thu Jun 9 15:46:27 2016 +0200 -commit dab4692da5b0969f29259ca5476e874e6d318209 -Merge: 2cb8eb7 53de5da -Author: Olle E. Johansson -Date: Mon Mar 16 19:27:56 2015 +0100 - - Merge branch 'master' into uacregstat - - * master: (61 commits) - dialplan: Remove SVN ID's and history notes - pua: Remove SVN ID and history - siptrace: Remove SVN ID - xhttp_rpc: Remove SVN ID - xmlrpc: Remove SVN ID's - rtpengine: small addition to nh_show_rtpp - ndb_redis: enable authentication when reconnecting. - pkg/kamailio/deb: update version to 4.3.0~dev5 - jsonrpc-s: implementation of FIFO transport - Makefile.defs: version set to 4.3.0-dev5 - Makefile.groups: added module auth_xkeys in the main group - geoip: updated the documentation with contc - geoip2: added continet conde for new geoip api pv - geoip: continent code attribute name changed to contc - auth_xkeys: remove unused variable: hbody - db_mysql: Remove SVN ID's, remove history sections - xmlrpc: Improve doc - presence: Remove svn id, remove history - geoip: return continent id via contid attribute - ctl: use uid/gid from the core if not set for the module - ... + modules: readme files regenerated - dialog ... -commit 53de5da64ab71e0609db2b58a65651a0a7863f63 +commit a3b6c3f836e8988b843eb25d5f553ff554821df8 Author: Olle E. Johansson -Date: Mon Mar 16 19:26:36 2015 +0100 +Date: Thu Jun 9 15:42:42 2016 +0200 - dialplan: Remove SVN ID's and history notes + docbook Update location of our bug tracker -commit af62616212b543502cf09654f05a7ab0e055e719 -Author: Olle E. Johansson -Date: Mon Mar 16 19:22:23 2015 +0100 +commit b5d274b52619a935a71a346cb7cf24486a8474c5 +Author: Kamailio Dev +Date: Wed Jun 8 14:50:15 2016 +0200 + + modules: readme files regenerated - app_mono ... - pua: Remove SVN ID and history +commit 42be15030909cf31cedbb3642e2a6b51b2b5ae9f +Author: Victor Seva +Date: Tue May 17 13:24:05 2016 +0200 + + xmlrpc: fix compiler warning #612 + + > CC (gcc) [M xmlrpc.so] xmlrpc.o + > In file included from /usr/include/strings.h:26:0, + > from xmlrpc.c:28: + > /usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp] + > # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" + + (cherry picked from commit 947fe8673c3014f4d011583bed95d44408b907f4) + +commit 253909bf673c0a59e7adf578bb5df73eb157d0f2 +Author: Daniel-Constantin Mierla +Date: Tue Jun 7 15:21:06 2016 +0200 + + tls: proper check of libssl versions used for compilation and available on system + + - shift out the last 12bits, being the patch version and status (see man + SSLeay) + - reported by Victor Seva, GH #662 + + (cherry picked from commit c38b4c7345a6806f48a0cdb07841e10bc962e1bf) -commit 57e49875abfb2ae3ba1dbb6ef32bc84f2ba1f213 +commit bb07a9d6229bbd191078d3a886b82308d066dbda Author: Olle E. Johansson -Date: Mon Mar 16 19:18:46 2015 +0100 +Date: Tue Jun 7 14:25:31 2016 +0200 - siptrace: Remove SVN ID + dialog Document states of a dialog + + The states are stored in the state_column in the database, but was only explained in source code previously + + (cherry picked from commit 50346dbc671078cab8e1d9f21f410a96286c7a83) -commit c3a29047c21d278d60f0185e3e3b5d789605d238 +commit 9d4e2e1c987e2c5d15dd6f6c434e0467d678a46e Author: Olle E. Johansson -Date: Mon Mar 16 19:17:06 2015 +0100 +Date: Tue Jun 7 14:05:17 2016 +0200 - xhttp_rpc: Remove SVN ID + dialog Use correct default name for toroute_name database column + + (cherry picked from commit 6196309a05c5de13dab2606bd2e227cebd7fa477) -commit 01de786379c7814b21e6446e1015451d0414497a +commit 09cb608ee56ca4d336d5a02c8bf2fd5ea05ff4d0 Author: Olle E. Johansson -Date: Mon Mar 16 19:14:01 2015 +0100 +Date: Tue Jun 7 13:48:52 2016 +0200 - xmlrpc: Remove SVN ID's + dialog fix typo in README and doc + + The call_id_column variable was named callid_column in the doc. -commit d2db2229f83cdf584c1dbb3485c31f01bc3e7dab -Author: lucian balanceanu -Date: Mon Mar 16 09:42:09 2015 +0200 +commit 70a2ab1c64bc19d4b67e09b990b78a23593999ce +Author: jaybeepee +Date: Thu Jun 2 16:30:21 2016 +0200 - rtpengine: small addition to nh_show_rtpp + modules/ims_usrloc_scscf: do not use DB functions if db_mode not enabled. - - if a RTP proxy has been disabled by a mi command - a "(permanent)" quote will appear when printing the disabled - status. + (cherry picked from commit 06df7d591e56d48ddbc100e5be4dc917731fc1a4) -commit 7f55064f3a2eeee16b9659d3c5c29e531bc92e62 -Author: Vicente Hernando -Date: Fri Mar 13 14:10:48 2015 +0100 +commit 7a0de650d5d443f84fd3aeb8d6209663074dc6da +Author: grumvalski +Date: Sun Jun 5 08:27:37 2016 +0200 - ndb_redis: enable authentication when reconnecting. + cnxcc: release credit_data in terminate_all_calls + + - GH #563 + + (cherry picked from commit d0bdaa7567240b18794ab7512b09a55767c44240) -commit ab3f709c972b4ce4772e81b0642d9ebb6cc3ad78 +commit 12b0480169feab25ad68509c23f472155f10082b +Author: Victor Seva +Date: Fri Jun 3 13:55:42 2016 +0200 + + xmlrpc: remove redeclaration of snprintf and vsnprintf + + compilation was failling with clang: + + > CC (clang) [M xmlrpc.so] xmlrpc.o + > xmlrpc.c:152:5: error: expected parameter declarator + > int snprintf(char *str, size_t size, const char *format, ...); + > ^ + > /usr/include/x86_64-linux-gnu/bits/stdio2.h:69:39: note: expanded from macro 'snprintf' + > __builtin___snprintf_chk (str, len, __USE_FORTIFY_LEVEL - 1, __bos (str), \ + > ^ + > /usr/include/features.h:329:31: note: expanded from macro '__USE_FORTIFY_LEVEL' + > # define __USE_FORTIFY_LEVEL 2 + > ^ + > xmlrpc.c:152:5: error: expected ')' + > /usr/include/x86_64-linux-gnu/bits/stdio2.h:69:39: note: expanded from macro 'snprintf' + > __builtin___snprintf_chk (str, len, __USE_FORTIFY_LEVEL - 1, __bos (str), \ + > ^ + > /usr/include/features.h:329:31: note: expanded from macro '__USE_FORTIFY_LEVEL' + > # define __USE_FORTIFY_LEVEL 2 + > ^ + > xmlrpc.c:152:5: note: to match this '(' + > /usr/include/x86_64-linux-gnu/bits/stdio2.h:69:28: note: expanded from macro 'snprintf' + > __builtin___snprintf_chk (str, len, __USE_FORTIFY_LEVEL - 1, __bos (str), \ + > ^ + > xmlrpc.c:152:5: error: conflicting types for '__builtin___snprintf_chk' + > int snprintf(char *str, size_t size, const char *format, ...); + > ^ + > /usr/include/x86_64-linux-gnu/bits/stdio2.h:69:3: note: expanded from macro 'snprintf' + > __builtin___snprintf_chk (str, len, __USE_FORTIFY_LEVEL - 1, __bos (str), \ + > ^ + > xmlrpc.c:152:5: note: '__builtin___snprintf_chk' is a builtin with type 'int (char *, unsigned long, int, unsigned long, const char *, ...)' + > /usr/include/x86_64-linux-gnu/bits/stdio2.h:69:3: note: expanded from macro 'snprintf' + > __builtin___snprintf_chk (str, len, __USE_FORTIFY_LEVEL - 1, __bos (str), \ + > ^ + > 3 errors generated. + + (cherry picked from commit 358de10a94bef4df6b1811ac8e88ea4e7919542c) + +commit e4e5ad4c674d1b27f0c68b7932b679b36e50c08d Author: Victor Seva -Date: Thu Mar 12 15:59:23 2015 +0100 +Date: Fri Jun 3 11:17:07 2016 +0200 - pkg/kamailio/deb: update version to 4.3.0~dev5 + travis: remove rebuild twice for MEMDBG test + + (cherry picked from commit eb0d271af95ba0eb409716335d86351ea9e94343) -commit adde641c3ba63130337fc72e2c55db44ac935020 -Author: Daniel-Constantin Mierla -Date: Thu Mar 12 14:45:37 2015 +0100 +commit 520b6fcd3ae75575c61b31a41d49ddaeab87f24f +Author: Victor Seva +Date: Fri Jun 3 11:12:50 2016 +0200 - jsonrpc-s: implementation of FIFO transport + pkg/kamailio/deb: fix build rule for modules - - JSON-RPC commands can be sent now via a FIFO file, as alternative to (or - together with) HTTP/S - - it can be useful for using it from terminal with command line/shell - tools + (cherry picked from commit 2115943fb5beb11a4b461c14f16dc42df8f32ab3) -commit 39da19ff37f6b81a14916a6fb2f58e7687b3dd90 -Author: Daniel-Constantin Mierla -Date: Wed Mar 11 23:39:54 2015 +0100 +commit e5f76d42e98b70ad77b275c654b48a7f22b2df66 +Merge: 9bbe982 cad6a67 +Author: Olle E. Johansson +Date: Fri May 27 16:14:28 2016 +0200 - Makefile.defs: version set to 4.3.0-dev5 + Merge branch '4.4' of https://github.com/kamailio/kamailio into 4.4 + + Apologies + + * '4.4' of https://github.com/kamailio/kamailio: + uac: proper skip of uacreg records with empty attributes + uac: proper handling of empty attribute for uacreg refresh + Makefile.defs: detect gcc 6.x -commit 2202c1be2e014cbfacee71f197a63a537b24e67e -Author: Daniel-Constantin Mierla -Date: Wed Mar 11 23:39:27 2015 +0100 +commit 9bbe98204295df6a0a2eadc6aaf539c6597f99b5 +Author: Olle E. Johansson +Date: Fri May 27 16:12:43 2016 +0200 - Makefile.groups: added module auth_xkeys in the main group + sqlops Document return values for sql_query() + + (cherry picked from commit 639574e79200b5ffae4274b862ad595bd209da24) -commit 7a1fb3aec976c53709cd3a27f5e2d16a9859d0e9 +commit cad6a67a41c8085f126798859b38a64a7350fbf6 Author: Daniel-Constantin Mierla -Date: Thu Mar 12 10:04:52 2015 +0100 +Date: Fri May 27 11:39:09 2016 +0200 - geoip: updated the documentation with contc + uac: proper skip of uacreg records with empty attributes - - added remark about geoip2 module for using the new GeoIP API + (cherry picked from commit 451b19597c5436ba481a49ecc89cc113829a9425) -commit 4d1e4e815d4ba7dbfe913caff42715b2adb74720 -Author: Sergey Okhapkin -Date: Thu Mar 12 09:57:44 2015 +0100 +commit 3acfc0003915401f1a27120b9a5d329b2e52e78d +Author: Daniel-Constantin Mierla +Date: Fri May 27 11:14:26 2016 +0200 - geoip2: added continet conde for new geoip api pv + uac: proper handling of empty attribute for uacreg refresh + + - reg_db_set_attr() does a continue on empty value, but for this + operation was not used inside a loop + - reported by Dmitri Savolainen, GH #643 + + (cherry picked from commit a34b382002cf9efe13c913f547ffacec3bd7757f) -commit 0d0bf30963e24cd8218f2edd3f26a16dd6e66ee5 +commit 6a01019bf63cf897d2430d6ada085cd23465fa79 Author: Daniel-Constantin Mierla -Date: Thu Mar 12 09:48:08 2015 +0100 +Date: Tue May 24 00:00:34 2016 +0200 - geoip: continent code attribute name changed to contc + Makefile.defs: detect gcc 6.x + + - reported by Anthony Messina, GH #633 - - similar pattern like for the other attributes + (cherry picked from commit 1975ebdf37b9ffd325a38960bc0bf417466b432f) -commit 95e02eb1df87a0fc5733f1063124254a81da5d83 -Author: Ovidiu Sas -Date: Wed Mar 11 12:45:15 2015 -0400 +commit d6710fdaf1ea8705655025e231d27828ac89da82 +Author: Olle E. Johansson +Date: Tue May 24 10:42:38 2016 +0200 - auth_xkeys: remove unused variable: hbody + kex Fix spelling error and add "core" as an example of a module name + + (cherry picked from commit b5ef63f447e82caf95aa7f03d3c3c0e0e5de5503) -commit 7675bae5b99b79d80de13afac9fd7cdf41f531a2 -Merge: db26c5c 0dfb681 -Author: Eloy Coto -Date: Wed Mar 11 15:38:47 2015 +0000 +commit 63dea59a507c1e949c4eb605ca5b56163b25c8d4 +Author: Federico Cabiddu +Date: Tue May 17 14:06:56 2016 +0200 - Merge pull request #109 from eloycoto/master + http_async_client: workaround for dealing with HTTP Via format in replies - xmlrpc: Improve doc - -commit db26c5ceb8bb68afdbab9bd2fc93fcaf5b299110 -Author: Olle E. Johansson -Date: Wed Mar 11 16:26:21 2015 +0100 + (cherry picked from commit 2449f8591261b207c091f9a44ce6cf40bdb71ab6) - db_mysql: Remove SVN ID's, remove history sections +commit 053c522e45fedea8bdb2ed92bd1de0a82331a7bf +Author: Daniel-Constantin Mierla +Date: Thu May 12 16:52:34 2016 +0200 -commit 0dfb68143ceeccd613cc76e01dcc9bdce9d22ccb -Author: Eloy Coto -Date: Wed Mar 11 15:02:29 2015 +0000 + cfgutils: proper check for return code looking up routing block in route_exists() + + - when the route block doesn't exist, route_lookup() returns -1, which + was used to access routing actions due to condition expecting 0 on not + found. The fix should avoid crashing by accessing invalid addresses. + Reported by Alex Balashov + - fixed return codes in the configuration file to follow the rules with + positive being evaluated to true and negative to false + - route_exists() returns the code returned by running actions, like a + classic sub-route execution + + (cherry picked from commit 6a3fc200b19500ddd6ed9a2236db6e21f777564a) - xmlrpc: Improve doc -commit a00367f9fdb1fc689f071a419576aa5b5a96b3a1 -Author: Olle E. Johansson -Date: Wed Mar 11 15:30:50 2015 +0100 +===================== 2016-05-10 Version 4.4.1 Released ===================== - presence: Remove svn id, remove history +===================== Changes Since Version 4.4.0 =========================== -commit 1ace8a167b9a6515be2b9f4a79786909c9ffce37 +commit 8ccc17f316731492e668d2de0d07b6eb1e5cb4fc Author: Daniel-Constantin Mierla -Date: Wed Mar 11 11:02:26 2015 +0100 +Date: Tue May 10 16:45:21 2016 +0200 - geoip: return continent id via contid attribute + Makefile.defs: version set to 4.4.1 -commit 3b5633de56c2367d19122f0f3c01698af34a21e9 +commit 5e699d7bcdcffa457e3ff1945c5783e039c57380 Author: Daniel-Constantin Mierla -Date: Wed Mar 11 09:42:02 2015 +0100 +Date: Tue May 10 16:41:13 2016 +0200 - ctl: use uid/gid from the core if not set for the module - - - otherwise it cannot do clean created files at shut down + pkg/rpm: spec updated to 4.4.1 for centos, fedora and oracle-el -commit d7a10e6a5ea8852681b57586eb9b4d73b75f05bf +commit ea95ff497fbeb9742ff7af395e907a94814547c4 Author: Daniel-Constantin Mierla -Date: Wed Mar 11 09:40:52 2015 +0100 +Date: Tue May 10 16:39:04 2016 +0200 - core: set the global sock_uid/gid based on the user/group values - - - they were left with initial value, more or less being unused + pkg/rpm: version set to 4.4.1 in rpm specs -commit c6ddf3aec7eb6e8d6046b006fde64ab7479aab5e +commit f8449978ff36daba233b21c0017179f55815ebce Author: Daniel-Constantin Mierla -Date: Tue Mar 10 14:58:32 2015 +0100 +Date: Tue May 10 16:31:14 2016 +0200 - ldap: fixed copy&paste error added in previous commit + modules: acc_radius, kazoo, misc_radius - regenerated readmes -commit c5ae4020de8499e7a318783b21276dfd3fc0a6e3 +commit b09fc298bc21248486801c38a60fdb5829ea14e8 Author: Daniel-Constantin Mierla -Date: Tue Mar 10 14:52:08 2015 +0100 +Date: Tue May 10 16:27:18 2016 +0200 - ldap: more useful info on reconnect + misc_radius: fixed missing ending of docbook tag - - reconnect message made a notice level, being not an error situation - - print the chosen ldap server address at info level when reconnecting + (cherry picked from commit 17ebcb3ed9c62302c3950fd378401460bef1a6a0) -commit 941fbda5c66da6c8069b3bce3764249bbb58baaa +commit 436bd786616cdce3b15069eb1ba08aeb853916cd Author: Daniel-Constantin Mierla -Date: Tue Mar 10 14:38:38 2015 +0100 +Date: Tue May 10 16:26:29 2016 +0200 - sqlops: more verbose log message if execution of query fails + acc_radius: fixed ending docbook tags + + (cherry picked from commit a2419ccee9a4d2f0f84fc871dbc8afdd3cf7f471) -commit 8375f37cd7603216a2bb55a4e9985b3c5e54af91 -Author: Daniel-Constantin Mierla -Date: Tue Mar 10 13:54:11 2015 +0100 +commit 4ebbbaeaf3c2a2feb30266a7995fa334e3c0fe7b +Author: Victor Seva +Date: Tue May 10 12:07:55 2016 +0200 + + pkg/kamailio/deb: set version to 4.4.1 + +commit 56bc38856944ca7f8fdbef32c6430b4dac049634 +Author: Victor Seva +Date: Tue May 3 10:18:14 2016 +0200 - db_cluster: fix checking the capabilities for write operation with different priorities + pkg/kamailio/deb: use libradcli-dev for radius - - reported by Jan Hazenberg + https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=822338 + + kamailio-radius-modules depends on libfreeradius-client + libfreeradius-client has been deprecated in favor of radcli[1] + + (cherry picked from commit e0cb17c329c0f6fa03e55cf041d1ba2a97b6e64f) -commit d9ef80e8123bec0ebf09b5ce464a9829dd835f8f -Author: Daniel-Constantin Mierla -Date: Tue Mar 10 10:40:00 2015 +0100 +commit 25d1ab175d0abd75bf90db6d8bc9d5a10b03d958 +Author: Victor Seva +Date: Tue May 10 08:10:51 2016 +0200 - rr: new variable $rdir(key) + [acc|misc]_radius: update documentation related to radius client libs_ - - return the direction of the request within dialog - - $rdir(id) - returns integer 1 for downstream and 2 for upstream - - $rdir(name) - returns the strings 'downstream' or 'upstream' - - it requires append_fromtag to be set for rr module and has to be used - after loose_route() + (cherry picked from commit d4710de1f4e6009598acdf3d837991346023f30e) -commit 5f98fddd971a28dbc2f29d19337a1645e869f69a +commit 956d7f29bb99dec6d6dbc0fff2f5df72d38679fc +Author: Victor Seva +Date: Tue May 10 08:10:20 2016 +0200 + + core: support radius radcli lib + + (cherry picked from commit 8aae606809be6160dd48708788051bf7a4a6bc42) + +commit a164d19bbe74720ac428a2efd6074397cfb5180e Author: Daniel-Constantin Mierla -Date: Tue Mar 10 09:46:46 2015 +0100 +Date: Sun May 8 09:41:15 2016 +0200 - rr: new config variables $fti and $tti + smsops: safety checks for pkg malloc in pv get handler - - $fti - from tag as in initial INVITE - - $tti - to tag as in the response to the initial INVITE - - requires append_fromtag to be set in order to detect the direction for - requests within dialog + (cherry picked from commit d4a2ba2ef4323b4306109ab5ecccd1368e8c5f82) -commit 6e1b56cb6d640db820254b8c69f7fd6e20865465 -Author: Luis Azedo -Date: Tue Mar 10 08:22:05 2015 +0000 +commit a588ced38ff3460469e0d46a31c5786cb57fcaf8 +Author: Alexandr Dubovikov +Date: Mon May 9 09:31:02 2016 +0200 - kazoo: consumer unallocated structure prevents kazoo from starting on busy systems + modules/sipcapture updated modparam description - when kamailio starts, publisher begins to process without checking memory allocation initialized by consumer + (cherry picked from commit 6e9f1c045ae827ea4f6bec8ab62187ec41788255) + +commit a2697207977e43784fe8eba632b7f88f4c641802 +Author: Alexandr Dubovikov +Date: Mon May 9 09:21:32 2016 +0200 + + updated SQL and docs - allocate bind structure once at initialization - change the order of child process initialization - change targeted binding + (cherry picked from commit 76649e4bced09b45d5c470a696168929e1758111) -commit deb0e811cddd71c45ebb36db7b41faa8d9e9ca5e -Author: Luis Azedo -Date: Mon Mar 9 12:47:31 2015 +0000 +commit 1fb9685ea83353a1d32edd7f94f3b4dc7b755258 +Author: Tsvetomir Dimitrov +Date: Sat May 7 09:10:01 2016 +0200 - kazoo: only create tags if not empty + pkg/rpm: added missing modules to the SPEC file for CentOS 6 + + - cnxcc added as separate package + - GH #597 - to-tag and from-tag are created empty if not supplied in amp payload - this patch formats the dialog message to include the tags only if they are supplied in amp payload + (cherry picked from commit 35a861a89e946a771623001f36dc3d17117be602) -commit 0f5aaac47a6002bbd4fdfaf0e6897d307c2cbc0e +commit e16a2373eeb7e9add61058bda3ab2d5c3cee437e Author: Daniel-Constantin Mierla -Date: Mon Mar 9 12:33:58 2015 +0100 +Date: Sat May 7 08:58:16 2016 +0200 - textops: stop after substituting in first header if flag f is set for subst_hf() + smsops: safety check for pkg malloc result - - reported by Julia Boudniatsky + - allocated the biggest possible size to simplify the checks + + (cherry picked from commit fd01e587ed115a21284d27d7f402d51dc6f8743a) -commit f39b92acb2be15e03aa117bdf171087ea7a77050 +commit 31b69ed11536e1dd7ce4baef25d2da91697f1e74 Author: Daniel-Constantin Mierla -Date: Sat Mar 7 23:31:49 2015 +0100 +Date: Fri May 6 14:03:03 2016 +0200 - registrar: use proper iterator to get to the index of the $ulc() contact + kazoo: added some docs for pua_mode param based on lists discussions - - part of a patch by Luis Azedo + (cherry picked from commit df30b8c7c6021d84f560a6fb7d82a11cd0e1b3d5) -commit dbdf843cbdaf61dfadd2c10bf6ae5134a51f76ef -Merge: 8da7ee8 824c31c +commit fdeba44e840616e08a2309eb3cf1517a34ea29fa Author: Daniel-Constantin Mierla -Date: Sat Mar 7 23:18:58 2015 +0100 +Date: Thu May 5 10:10:59 2016 +0200 - Merge pull request #106 from kamailio/coudot/registrar_ulc_conid + core: print tos value if socket option for it cannot be set + + - to help with GH #598 - registrar: make connection id available in $ulc() + (cherry picked from commit 0118338d82e2471572990a1ea09593265161e4a4) -commit 8da7ee85d673e544dc4bfd1e6b6c3b69af5d492c +commit c5c4610fa293ce8afc15bd6cc04897e34fde797f Author: Daniel-Constantin Mierla -Date: Sat Mar 7 23:02:52 2015 +0100 +Date: Thu May 5 10:02:34 2016 +0200 - auth_xkeys: more details about the interaction between sender and receiver + corex: add section ids to docs + + (cherry picked from commit cb41e0146a73d9c91b0c590d65094e300ef67933) -commit e7c61b1acf8bbb92e90f81bda51eb169e0e9d241 +commit 316925662a3be833693eba6a2895b41661b4d0db Author: Daniel-Constantin Mierla -Date: Sat Mar 7 22:49:18 2015 +0100 +Date: Thu May 5 07:47:36 2016 +0200 - auth_xkeys: new module for auth using hashing with shared keys + cdp: use the function to check if it is shutdown phase + + - global variable is not accessible directly, breaking the build - issue + introduced with previous commit - - the module manages a list of shared secrets (keys) - - can add a custom header with the hash (sha256/384/512) over a - particular value and a selected key - - can check if a custom header has the expected hash value - - this is a module that offers an authentication mechanism that is quite - popular for API services - - todo: management of the keys via rpc + (cherry picked from commit e70283a0b6010e4a4c567a50b9008e0d7c1e27d5) -commit 9342bd2bf03bb2d07541ceeab80cd35bb1d28d01 -Author: Olle E. Johansson -Date: Sat Mar 7 20:46:29 2015 +0100 +commit b696390ac29225dd29bdeb1ec8fe01690e1c2608 +Author: Daniel-Constantin Mierla +Date: Wed May 4 20:01:37 2016 +0200 - htable: Remove SVN ID's + cdp: don't lock anymore for session during shutdown callbacks + + - if sigterm killed a worker in a locked zone, results in a deadlock at + shutdown. The cleanup is done by a sigle process, no other processes + run, therefore no more race + + (cherry picked from commit f3f87ca550d44364e3c6cc1653970258fdffaa2c) -commit d4aec99b2c33aafbb586ca9794a840824f6b2119 -Author: Olle E. Johansson -Date: Sat Mar 7 20:43:49 2015 +0100 +commit f739c6d0a861fce1808a93e4660546c746dc7672 +Author: Daniel-Constantin Mierla +Date: Tue May 3 10:18:11 2016 +0200 - test: Remove SVN ID's + sdpops: safety check if sdp pointer is null inside sdp_get() + + (cherry picked from commit cd67fbb8ecb83944f458ec8a127adc14d5b38aeb) -commit 1ceea975482013c88210d3d00e191fa8e77e2fdb -Author: Olle E. Johansson -Date: Sat Mar 7 10:11:54 2015 +0100 +commit 2189d14f20cf52c4802baffc258ecd5b9127c0c0 +Author: Daniel-Constantin Mierla +Date: Tue May 3 08:48:02 2016 +0200 + + sdpops: removed svn $Id$ lines, coherent indentation and whitespacing + + - added license header text + + (cherry picked from commit c4299225989d9ccf47c18e50b0014025270c65c7) - msrp: Remove SVN ID's +commit 6f60780e3fa3d8314e77b9960c04a127ede86b1f +Author: Konstantin S. Vishnivetsky +Date: Mon May 2 16:03:50 2016 +0200 -commit 7029720d715b6fb172a489caeb702669290dbefb -Author: Olle E. Johansson -Date: Sat Mar 7 10:10:19 2015 +0100 + pkg/rpm: added folders with rpm specs for oracle el6 and el7 + + (cherry picked from commit e72c7e068dd510a56033ce422343675aa0fdafe7) - dmq: Update author, copyright for README +commit c29e524283b50b74f61e704f0e32b86c7941da6b +Author: Jonas Böttner +Date: Mon May 2 14:20:25 2016 +0200 -commit bfd172042a117fc972a12dfc5aa9205c2f19fc41 -Author: Olle E. Johansson -Date: Sat Mar 7 10:09:59 2015 +0100 + enum: print out malformed uri in enum_query() + + - previous error message did not show up the username part of r-uri. + therefor debugging was difficult. + + (cherry picked from commit fd3c30f981d97622fb99f2122ce0bc950774edfb) + +commit aa39e12bf63a325effa52eae924a946005baee3c +Author: Jonas Böttner +Date: Mon May 2 14:19:30 2016 +0200 - dmq: Remove SVN ID's + enum: single digit is valid in function enum_query + + - is_e164() returns true for a single digit (previously two digits) + + (cherry picked from commit 86ecdb2ec109af536efa70c2b0e4b93c4072e8b5) -commit d280e6256bc445f1600f5cb45b2f50f93b15d3d0 +commit 1851ba4c67c8bfa48ae5f65ccecee076960870f8 Author: Olle E. Johansson -Date: Sat Mar 7 10:09:40 2015 +0100 +Date: Fri Apr 29 13:55:00 2016 +0200 - dmq: Adding KDMQ message example to documentation + msilo Minor edits to the README + + - Move the database field definitions close to the table definition + - Fix typos, rewrite some parts + + (cherry picked from commit ceccf4b9d178e895ae5972f2cddf28e3ef108910) -commit 7c6fa127baada59727df050658345976b24c38c3 -Author: Olle E. Johansson -Date: Sat Mar 7 09:32:26 2015 +0100 +commit e1b8cc38ba493f6de6a3c70519fb327841efad94 +Author: Konstantin S. Vishnivetsky +Date: Thu Apr 28 22:55:12 2016 +0200 - xhttp: Remove SVN ID's + pkg: added rpm spec file for Oracle Enterprise Linux 7 + + - includes adding shadow-utils dependency added to make %pre scriplet + work properly + - baed on PR #588 + + (cherry picked from commit b7ec49886264b52b15d22b80c1c74ac40a6fb314) -commit 910be93e5caebea5cef33335d0c48de636169ff5 +commit ea20338f8786fac2bb290a610f938fec8e7ece54 Author: Daniel-Constantin Mierla -Date: Thu Mar 5 21:26:36 2015 +0100 +Date: Tue May 3 16:59:06 2016 +0200 - enum: updated the docs in regards to max len for enum number + xmlrpc: user libxml function to get content of node if type not provided for param + + - it is considered to be string according to specs + - old implementation was using the pointer inside the xmlNode struct, + which may not be available later to free again by xmlrpc module + garbage collector + - reported by Juha Heinanen - - synced with the code, following on a report from Alex Balashov + (cherry picked from commit 6b23c27d8406780083a6b7bb774efa2a53aea540) -commit c3f9e82e35f805d923237fbeb8e1173dc9a5ae23 -Author: Camille Oudot -Date: Wed Feb 25 12:13:16 2015 +0100 +commit 72ddb3a70dfc88404eacf0a878f36cc56de2e74e +Author: Daniel-Constantin Mierla +Date: Mon May 2 11:46:30 2016 +0200 - usrloc: new param to close TCP connections + lib/srdb1: adjust the length of str time representation for no-quotes + + - used only by usrloc fix done in previous commit - the new `close_expired_tcp`, if set, forces Kamailio to close the TCP - connections of expired contacts + (cherry picked from commit f54c723d9d8b8dcd0ad09c3787f3bb2e823d82b8) -commit 824c31c22d32987384b4d72eb45f4e4cbc82c54d -Author: Camille Oudot -Date: Wed Mar 4 19:38:33 2015 +0100 +commit ffbc7449e315847a43e36ceab2cdc3fe05396115 +Author: Daniel-Constantin Mierla +Date: Mon May 2 10:26:35 2016 +0200 - registrar: make connection id available in $ulc() + usrloc: don't quote string representation of time for fetching contacts query - if an UA is registered using TCP (or TLS or WS(S)), make the internal - connection id avalilable in the $ulc(xxx=>conid) pv + - the db api adds quites around string values + - it results in double quotation, rising db query error + - reported by Giovanni Mele + + (cherry picked from commit aeb85ae3d9097bfd6aaad92a1d5b0c682bf5162c) -commit ec11b9ff061f6ac9a90abcf222cc1dccd9e116c7 -Merge: 0df102b a5245d5 -Author: Olle E. Johansson -Date: Wed Mar 4 17:30:47 2015 +0100 +commit ea7d88c8a857a53f071e85eb6e467b6ca1a52c73 +Author: Daniel-Constantin Mierla +Date: Mon May 2 10:25:21 2016 +0200 - Merge pull request #105 from SebastianThorn/master + lib/srdb1: added helper function to convert time to unquoted string - Fixed path ss -> ssl + (cherry picked from commit b3da13a1025f4380c4929fd53b619ca7fdd09a9d) -commit a5245d5c44cd49a699caa94f844dfb128a8d9764 -Author: Sebastian Thörn -Date: Wed Mar 4 17:16:22 2015 +0100 +commit 964c05c334b4bba0c2eeac20d9b8cc188927d0f4 +Author: Daniel-Constantin Mierla +Date: Sat Apr 30 09:57:54 2016 +0200 - Fixed path ss -> ssl + async: fixed list format for dependencies in docs + + (cherry picked from commit 4463258d5bb8cb1460f51791d2c3a367ec68e5fb) -commit 0df102bdddab7080fb8be41764561c1e564390cd -Author: jaybeepee -Date: Wed Mar 4 11:51:47 2015 +0200 +commit d82249bb42513e9c06828cae350e01b89a16b77e +Author: Daniel-Constantin Mierla +Date: Mon May 2 08:51:44 2016 +0200 - utils/kamctl/mysql: added sql creation definition for dialog_ng + core: pv - coherent indentation and whitespacing + + (cherry picked from commit 4ffe8b0f917ec49b3f68afa99d65e384fb011283) -commit c7a148c591401ea3f52f9fdfe6cdb1eabaac717e -Author: jaybeepee -Date: Wed Mar 4 11:40:59 2015 +0200 +commit f1fc28d0e42980dfc027b6631b1b807deb7f1a98 +Author: sergey-vb +Date: Thu Apr 28 22:32:14 2016 +0200 - modules/ims_charging: update - added access-network-information data to CCR - -change storage to dynamic str as opposed to fixed length field - -send PANI in Ro interim and stop CCRs + core: fix leak in case of error to get boundary inside check_boundaries() + + - impacted setting multi-part body function + + (cherry picked from commit 2b427a33937c6a86ab231de39d5a4574309dbfc6) -commit 71eadfae3d7947863bf1987afa25ccfbf294f78b -Author: Olle E. Johansson -Date: Wed Mar 4 08:31:33 2015 +0100 +commit 3550a23ac6a5845839b114b22077978da95740f2 +Author: sergey-vb +Date: Thu Apr 28 22:31:05 2016 +0200 - rr: Remove SVN ID's + textops: fix memory leak in when converting body to multipart with set_body_multipart() + + (cherry picked from commit 61435f40f0f4ca25521f7f1b8515e47954a69b2d) -commit be94ca47bb1d8f214591b7139687c8a317f0dae5 -Author: Carsten Bock -Date: Tue Mar 3 23:20:01 2015 +0100 +commit 3fd830cfe3bea3f5dde50a26f5ae40b835f7aad0 +Author: Mikko Lehto +Date: Thu Apr 28 15:02:29 2016 +0300 - dialog_ng: corrected PARAM_STR to PARAM_STRING (partial revert from 2d6d34b21320b269c6eceb5a44c5c91eb44740fc) + lib/binrpc modules/ctl utils/kamcmd : set UNIX_PATH_MAX to lowest common value + + sockaddr_un.sun_path[] seem to be either 104 or 108 in following Unices: + 104 - NetBSD, OpenBSD, FreeBSD, DragonFly BSD, MINIX, XNU(Apple OS X) + 108 - illumos, Solaris, Linux - PARAM_STRING is correct in some cases. + (cherry picked from commit bc783befbda947a7d789eebd70c64ec736892df5) -commit 891ba8972c70260d8213a1b9d665f7de5be50554 -Author: Camille Oudot -Date: Mon Mar 2 16:23:58 2015 +0100 +commit 24c6d38f93bc033cd79b90d4a4a24c99597f777c +Author: Daniel-Constantin Mierla +Date: Sun Apr 24 20:13:44 2016 +0200 - tcpops: fix documentation + registrar: coherent indentation and whitespacing + + (cherry picked from commit 90350e2a71c86e71f81590c80ad714cec6c7ea80) -commit 2549f7a6361de36e0dde14de3d5c4c076564871c +commit d59d68c367f17e54606e5edac22a1b653b1e91ad Author: Daniel-Constantin Mierla -Date: Sun Mar 1 21:16:46 2015 +0100 +Date: Sun Apr 24 18:59:38 2016 +0200 - core: cleaned debug messages and added safety check for bind address + siputils: coherent indentation and whitespacing + + (cherry picked from commit 5a31031e62f8872eafc79b41e9594f2f1289f8c3) -commit f5a7b12ce5f73749e9ae3d7a31e2a3616539421c -Author: Luis Azedo -Date: Wed Feb 25 18:16:48 2015 +0000 +commit e082fdc7e401d7f719eb6e12d6b57e2e2fd69215 +Author: Daniel-Constantin Mierla +Date: Thu Apr 21 13:25:33 2016 +0200 - usrloc - fix db_delete_ucontact_ruid + auth: coherent indentation and white spacing - when the contact is deleted using db_delete_ucontact_ruid (default) - the uldb_attrs_delete is not called leaving the location_attrs with unwanted records - - created uldb_attrs_delete_ruid to be called by db_delete_ucontact_ruid - redirected uldb_attrs_delete to uldb_attrs_delete_ruid when ul_db_ops_ruid == 1 + (cherry picked from commit c4b6428ce71e6d1b18ba2ea6b99c369864b56710) + +commit 2e179048a0ffb26719644f293cfd063b0fd6aad6 +Author: Daniel-Constantin Mierla +Date: Tue Apr 19 10:41:02 2016 +0200 + + htable: refreshed the readme file - (cherry picked from commit 09c51685af36071aad6054d84571c260be2ba9e2) + (cherry picked from commit 6adb2fac4a59a35fb1238b4eca5fd8e93c3659c9) -commit d3cbfb6aa0e4e3b9232a00e294e1353ee66b32d1 -Author: Camille Oudot -Date: Fri Feb 27 11:47:33 2015 +0100 +commit f583f0751a7e78bc8ba5ed19ff7fbfea68ce4f6e +Author: Daniel-Constantin Mierla +Date: Tue Apr 19 10:40:20 2016 +0200 - tls: initialize the per-socket lifetime + htable: coherent indentation and whitespacing + + (cherry picked from commit 79ad0e2d8a926e867b1f9e69a065e9b1727671ea) -commit 8eda24052be7f1a955074996245668b2c749fb4b -Author: Carsten Bock -Date: Thu Feb 26 22:02:19 2015 +0100 +commit 56f5009939e058ac4a9bc356f85b32ca35dc20bd +Author: Daniel-Constantin Mierla +Date: Tue Apr 19 10:39:55 2016 +0200 - dialog_ng: Safety check on create_cbs + htable: updated the list of exported variables + + (cherry picked from commit 866270a7cc45205deab5b067be68e5c6a66704e8) -commit 634db00a82f36c6c60d272ccada4a1d5338d1cbc +commit 2181edd60a2597a75eef7e2529faf0ed7948c1c7 Author: Daniel-Constantin Mierla -Date: Thu Feb 26 21:58:47 2015 +0100 +Date: Mon Apr 18 12:52:25 2016 +0200 - uac: skip only the invalid record when loading remote registration records + app_python: fix of buf memory allocation size for chars - - fixes loading only the good records before the wrong record, thus - working with partial valid data afterwards, even more valid records - were in the db + (cherry picked from commit 5042f309739460ad87dc9a064c43e602602da703) -commit 5fd0a0984950604f8ba4de39d9c560cc19340a2d -Author: Jason Penton -Date: Thu Feb 26 21:57:33 2015 +0200 +commit 0110a8b55ba9d48aa22123802d2a562fa2e89195 +Author: Daniel-Constantin Mierla +Date: Mon Apr 18 12:35:36 2016 +0200 - modules/ims_charging: added access-network-information data to CCR - -allows OCS to know location of UE when charge was made - -tested with 3GPP EUTRAN FDD using utran-cell-id-3gpp as base station id + app_python: coherent indetation and whitespacing + + (cherry picked from commit 8d7c12ab295fdb41390dd56744cc0b012851788b) -commit cfc48a9d624ddb416715e3c37ca5c51c7f495027 -Author: Jason Penton -Date: Thu Feb 26 21:49:12 2015 +0200 +commit d8a893d45d891bc3f8d00e3e76c9cd92195e164c +Author: Daniel-Constantin Mierla +Date: Tue Apr 12 13:48:22 2016 +0200 - modules/cdp_avp: added AVP for Access-Network-Information to imsapp + core: receive.c coherent indentation + + (cherry picked from commit 7de8a92fd805b73495cc929cf9ca981ecd509c9a) -commit 6def28cf5cd638f0db550089d60429fbf69dd309 -Author: Olle E. Johansson -Date: Thu Feb 26 20:47:54 2015 +0100 +commit 3616af6b5f2aae383c93507563a33913e3f723e9 +Author: Daniel-Constantin Mierla +Date: Mon Apr 11 12:57:31 2016 +0200 - sanity Remove SVN ID, change "ser" to "Kamailio" + Makefile.rules: added target tags as alias for target TAGS + + (cherry picked from commit b024f5aea72f172b39dd4d8947934be52f07dbe4) -commit db97ee7b7a7541f046525b5f7115dcf4efdc8153 -Author: Olle E. Johansson -Date: Thu Feb 26 20:45:37 2015 +0100 +commit 74052b4a0f50b19d42a6fbcae3df38136046f993 +Author: Daniel-Constantin Mierla +Date: Mon Apr 4 08:53:12 2016 +0200 - rls Remove svn ID + core: declare function parameter type to get rid of compile warning + + (cherry picked from commit ad2f899c1ad75c2b636cb17b6c1c49cb38daab27) -commit caf1dbe6db51fffbd4a5144f8fbede9755a1d619 -Author: Richard Good -Date: Thu Feb 26 10:57:29 2015 +0200 +commit 66e1479260a3a657c86e0a9d0ae3fd5c71954f95 +Author: Seudin Kasumovic +Date: Tue Apr 26 15:49:00 2016 +0200 - modules/ims_qos: Added stats framework and basic stats + erlang: fix where is registered pseudo process + + - check is event route exist for queried registered process + - check argument type and function arity + - ensure error message proper formatted + + (cherry picked from commit 0f52906f28fdf38e56fd37e6ed34155b2deee505) -commit 8bbed6e31296cfb88b7ce7c928aa9242b5df170f -Merge: 351bcf2 f12f243 -Author: lazedo -Date: Wed Feb 25 09:48:24 2015 +0000 +commit d29ff6a5f31f76ab9fb4e423c88b8c1cc9d4627d +Author: Seudin Kasumovic +Date: Tue Apr 26 14:04:41 2016 +0200 - Merge pull request #99 from kamailio/lazedo-presence_dialoginfo-patch1 + erlang: extend error message function with variable number of arguments - presence_dialoginfo: rfc4235 in dummy dialog + - wrap around vsnprintf + + (cherry picked from commit 3d002d8f42eb24e978bc86cd3b4565872e65eb1e) -commit 351bcf21428bbb7e12f47a7f57a738e1263482fa -Author: Jason Penton -Date: Wed Feb 25 11:05:08 2015 +0200 +commit dc58d67e400334759185b0eb672160482e067c74 +Author: Victor Seva +Date: Tue Apr 26 10:57:34 2016 +0200 - modules/ims_charging: changed stats to use counters instead + travis-ci: IRC notifications to #kamailio-dev channel + + (cherry picked from commit 0dfd44a0502abbf20269d73a230be983cbb97b8d) -commit 2cb8eb748e12bdf6799ac567ab6bf778cfd2c36b -Merge: 795bacb 4c4e576 -Author: Olle E. Johansson -Date: Wed Feb 25 09:14:52 2015 +0100 +commit 3fdf0463e2290ae891587dbac8cbd6b2d0e722fd +Author: Seudin Kasumovic +Date: Tue Apr 26 09:55:43 2016 +0200 - Merge branch 'master' into uacregstat + erlang: fix function call in event route + + - allow call functions for RPC and message send in event route + - detect RPC loop + - function/api call is possible in event route if event route is not + triggered by handling REX call (avoid deadlock) - * master: - mem Remove SVN ID, remove history - kazoo - fix compilation - kazoo - fix timer interval - userblacklist remove svn ID - modules/sipt: fix size check for optional pointer - modules/sipt: fix size check for optional pointer + (cherry picked from commit b0c04dd2eff3f288ac98c0074683db150727227a) -commit 4c4e57664848c2b22d7fcfb40c072722affb0a46 -Author: Olle E. Johansson -Date: Wed Feb 25 09:12:38 2015 +0100 +commit 615b252510cee01dc6f24ac7d12f07dcb6b50366 +Author: Daniel-Constantin Mierla +Date: Wed Apr 20 12:02:09 2016 +0200 - mem Remove SVN ID, remove history + Makefile.defs: detect kfreebsd OS and set its default compile flags + + - combine the options of Linux with FreeBSD to use kqueue if available + - reported by Victor Seva, GH #576 + + (cherry picked from commit 4c6f879563adbbdee7c730549533a0d852e6cbef) -commit e164aed586d4adef92e62350e30024560c19101c -Merge: 12af51d 8c2f3ab -Author: tsearle -Date: Wed Feb 25 08:37:02 2015 +0100 +commit 71f329c971d6ad18f7eda16a2b50b25e9efd3236 +Author: Daniel-Constantin Mierla +Date: Wed Apr 20 11:59:25 2016 +0200 - Merge pull request #98 from tsearle/master + core: remove ending parenthesis in ifdef condition + + warning: ISO C99 requires whitespace after the macro name + sched_yield.h:34:20: warning: extra tokens at end of #ifndef directive + #ifndef sched_yield() + + - reported by Victore Seva, GH #576 - modules/sipt: fix bounds check on ACM + (cherry picked from commit 34b67125424da7ce86b5cac77e30af0711fafac1) -commit 12af51df76e779c70470c57ef0b992831441f275 -Author: Luis Azedo -Date: Tue Feb 24 22:37:32 2015 +0000 +commit 528842d4dfea3d6785e6cee0cd3fb6411ee3dc7d +Author: Daniel-Constantin Mierla +Date: Mon Apr 25 08:56:00 2016 +0200 - kazoo - fix compilation + jsonrpc-c: replaced use of obsolete function json_object_object_get() + + (cherry picked from commit be02b3f11c269d3eeeb52e1cd0056d7d77be2e4c) -commit 7ae9f6693406c76d7d58389d5cf4ccaa44958a02 -Author: Luis Azedo -Date: Tue Feb 24 22:22:32 2015 +0000 +commit 2700d7b8df738f9e5db82dca87cbab5549f2e0d1 +Author: Daniel-Constantin Mierla +Date: Mon Apr 25 08:54:45 2016 +0200 - kazoo - fix timer interval + json: replaced use of obsolete function json_object_object_get() + + - reported by Olle E. Johansson, GH #579 - amqp timer and publish proc take all cpu - new param amqp_timmer_process_interval in MS - and removed the timeout on select from tcp workers + (cherry picked from commit 8b9fd4fa40abfc40ecd537948036aa91b908615d) -commit 766208cbb8c59a1bc15aefb253f13992d87a122a -Author: Olle E. Johansson -Date: Tue Feb 24 22:06:05 2015 +0100 +commit bf76f94e939c0d96ca25a2d75623e7fcff78c01e +Author: Seudin Kasumovic +Date: Wed Apr 20 11:36:40 2016 +0200 - userblacklist remove svn ID + erlang: fix parsing function params + + - remove double parsing function params + - free memory used in parsing params + + (cherry picked from commit 28b320088fcad8b8875f0528873a49cba9c74619) -commit 795bacbaa1900127cd5e94847c4be401ab86966e -Author: Olle E. Johansson -Date: Tue Feb 24 22:03:53 2015 +0100 +commit 2c650622cf7cd37dc1c5177ad314681113ac324d +Author: Seudin Kasumovic +Date: Wed Apr 20 11:10:39 2016 +0200 - uac Add counters for uac_reg + erlang: fix memory leak in debug macro + + - free temporary used encoding buffer + + (cherry picked from commit 2b11990929ae1d097bfb66848136bd247130263b) -commit f12f243e39c840b1306bf376c49ef4dab9e7564f -Author: lazedo -Date: Tue Feb 24 17:19:15 2015 +0000 +commit 8d07ef72e8280b4367e430bf081d54e0a0b5f4c1 +Author: Seudin Kasumovic +Date: Mon Apr 18 11:30:23 2016 +0200 - presence_dialoginfo: rfc4235 in dummy dialog + erlang: fix uninitialized member variable - according to rfc4235 the id element is mandatory. - granstream phones are affected by this. + - avoid conditional jump on uninitialized value + + (cherry picked from commit 0e3b19f4b99ea0b9e4eff2decb641e5da2488573) -commit 8c2f3ab244e147b8159fb6669cbc2cd3098c9a79 -Merge: 198969b c313144 -Author: Torrey Searle -Date: Tue Feb 24 17:40:39 2015 +0100 +commit c302b9e920342869721342c42f9014bd079fb456 +Author: Olle E. Johansson +Date: Tue Apr 19 21:24:31 2016 +0200 - Merge remote-tracking branch 'origin' + dialog Update README with explanation of in-dialog request behaviour - * origin: - modules/sipt: fix size check for optional pointer + (cherry picked from commit 19ef4f6ec8c22848eb4386f5f4996d5091c65688) -commit 198969bb4b2883530c6865f0c6f2afb574cead56 -Author: Torrey Searle -Date: Tue Feb 24 16:52:20 2015 +0100 +commit 19d4d3f5a1a49335377c9befd238b729b957f42b +Author: Olle E. Johansson +Date: Tue Apr 19 14:11:33 2016 +0200 - modules/sipt: fix size check for optional pointer + dialog Document shortest ka_interval + + (cherry picked from commit 9710f1c92baee8ec379d64b75531bed5cf7695fb) -commit c3131445da9d1eefbed22db529f428e67824d856 -Author: Torrey Searle -Date: Tue Feb 24 16:52:20 2015 +0100 +commit 22003d5cba54b5c0d0f0af06f62be24190bef231 +Author: Olle E. Johansson +Date: Mon Apr 18 13:43:15 2016 +0200 - modules/sipt: fix size check for optional pointer + http_client Clarify DNS resolver use for CURL + + (cherry picked from commit e85706b549e691404e3caf401fa4cf86c5ab90de) -commit 20d0a188701127dae34dd40d7f14be0037d0b888 -Author: Daniel-Constantin Mierla -Date: Tue Feb 24 12:29:51 2015 +0100 +commit 3356d6aca4c85e7c086b1d46cf06e56635fd4739 +Author: Victor Seva +Date: Fri Apr 15 09:09:08 2016 +0200 - tls: if port is 0 in tls client profile cfg definition, ignore matching port + app_perl: Fix "use UNIVERSAL" is a fatal error since perl 5.22 - - tcp port can be randomly allocated by OS, making hard to guess it in - advance + * Author: Julián Moreno Patiño + * Fix #516 + * from: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=821039 + + (cherry picked from commit b77ed54d33f171d170ca89252f0a31a0d23996fa) -commit 5e3880fb0f71821639610ea5b74cafe9a6675a4c -Author: Daniel-Constantin Mierla -Date: Tue Feb 24 12:20:10 2015 +0100 +commit 3e29e0bcfb14f0e95639eb99b777da84d46becf1 +Author: Seudin Kasumovic +Date: Wed Apr 13 00:34:41 2016 +0200 - tls: clone tokens for ipv6 address in tls profile for parsing + erlang: fix compile warning unused but set variable + + - get rid of this variable - - cfg parsing is moving the pointers, forgetting the previous parts + (cherry picked from commit 32c3435c8122903958834002ba843b93c49495f0) -commit c1bf2048de60c4abb9a5b8b343f50400deefa3bf -Author: Daniel-Constantin Mierla -Date: Mon Feb 23 23:27:48 2015 +0100 +commit 297d9732504290a1209ae7cf883127fadc1156aa +Author: Seudin Kasumovic +Date: Wed Apr 13 00:15:56 2016 +0200 - tls: try to lookup client profile via bind address + erlang: fix register server process with the local name server epmd - - local address connection can have a randomly allocated port by os + - use correct alive name when number of C nodes greater then 1 + - fix error check on register server process + + (cherry picked from commit 6f268b5a9d0bd07e689c401cb7221bb0f2c5f8be) -commit 0506b9898867c5d165defa0acf1501cad13513eb -Author: Luis Azedo -Date: Tue Feb 24 09:33:53 2015 +0000 +commit 02b17b881d63fe91221f5673dd3418831c943bd0 +Author: Camille Oudot +Date: Mon Apr 11 18:53:05 2016 +0200 - kazoo - fix crashing on heavy load + dialog: fix $dlg(from_bindaddr) getter -commit b9e5b9181c0f9c315e0f27ad96f69d5ca8cafba3 -Author: Luis Azedo -Date: Mon Feb 23 20:55:57 2015 +0000 +commit 1ec385ccd9054952b86cc976ae1debe70dc8d297 +Author: Camille Oudot +Date: Mon Apr 11 17:02:03 2016 +0200 - kazoo - fix timeouts + dialog: fix $dlg(from_bindaddr) name parsing - timeout should be ms not sec - set time before state so timeout check doesn't set timeout immediately - separate proc for handling timeouts + (cherry picked from commit f95789fd39fcce7b3aa3a0ab8665664afd8bc196) -commit 91596953115fe1bbe5c6f0dd0dd6e8d99cdbd285 +commit b21b9cd9cb6a08b9bfc9d025b4e6a64a12e50d65 Author: Daniel-Constantin Mierla -Date: Mon Feb 23 14:29:46 2015 +0100 +Date: Fri Apr 8 15:10:55 2016 +0200 - sdpops: safety check when location a= line not to exceed end of message + Makefile.defs: re-enable mem join define + + - lost when introduced the option to select the memory manager by + command line parameter -x + + (cherry picked from commit 33c6aafcd46269ce283908f49fbf70b9d73624b1) -commit 4b682e15fcd14fc3eb153865c2071162c7592220 +commit 49ec5fa5d9bb939b80ef3994b5f0c04e7525ab9f Author: Daniel-Constantin Mierla -Date: Mon Feb 23 11:23:53 2015 +0100 +Date: Wed Apr 6 19:22:58 2016 +0200 - tls: use proper start of ipv6 address in tls.cfg + core: common check for ifa->ifa_addr in add_intefaces - - reported by Anthony Messina + - if no ip address associated with the network interface, it is not + useful anyhow + + (cherry picked from commit c395ae00d7970be0a857265e9324a50bcb00f4d0) -commit 6a97c65c122400e46a4103b756c6973f7bea134e -Author: Juha Heinanen -Date: Sun Feb 22 01:10:12 2015 +0200 +commit 6684be6b4c405ab24dd6a5a19267ceef6aa95503 +Author: Daniel-Constantin Mierla +Date: Wed Apr 6 18:55:57 2016 +0200 - modules/siptrace: small README clarification + core: check if ifa_addr field is set while trying to skip AF_PACKET interfaces + + - reported by Juha Heinanen + + (cherry picked from commit 1545b8de396e8e5d0ef24c9102beff18b3cf36e5) -commit 3f6fc7d42100800f94a5f3b66409164013fffc96 +commit 87af066010ca0b89a4752fe593c091253b842d6c Author: Olle E. Johansson -Date: Sat Feb 21 18:56:12 2015 +0100 +Date: Sun Apr 3 21:45:37 2016 +0200 - Registrar Remove SVN ID and history + evapi Fix URL to library home page in README -commit 62cdec7eacc73fbdef2b993621fceef4084a9f34 +commit cf3457fd35909993c3e354e726d243f137dfe227 Author: Olle E. Johansson -Date: Sat Feb 21 18:51:23 2015 +0100 +Date: Fri Apr 1 20:28:50 2016 +0200 - xmlops Remove SVN ID - -commit 5c1a9df4fc8bd72f44066bcef13f381f01cd9d07 -Author: Daniel-Constantin Mierla -Date: Fri Feb 20 20:40:39 2015 +0100 - - xhttp: use proper function to set the ip addres of the fake via + Revert "db_flatstore Edit source code headers - change product name to Kamailio etc" - - for ipv6 it has to be enclosed in between [ ] - - reported by Sergey Okhapkin - -commit 7978bfd638ff1d6b644ff011fd69e64f68273aa5 -Author: Camille Oudot -Date: Fri Feb 20 15:00:07 2015 +0100 - - tcpops: rename set_connection_lifetime -> tcp_set_connection_lifetime + This reverts commit 9ecf2492b1952d71d4ec89ba4df5fde428a86a94. -commit 85c7a3d80dc44ec3bb0302656b3f11e6ee6713c5 -Author: Camille Oudot -Date: Fri Feb 20 14:27:41 2015 +0100 +commit 5d1f2e8ca6c44f35b070157c06811a8834615e47 +Author: Olle E. Johansson +Date: Fri Apr 1 20:28:39 2016 +0200 - tcpops: README update + Revert "db_flatstore Rename core module file to match module name" + + This reverts commit ddb1069e7c03544f80fc728503b7df1005ccf54d. -commit 99e65e1526f7720ffc861dd874eb74464e7c12ad -Author: Camille Oudot -Date: Thu Feb 19 17:51:36 2015 +0100 +commit cb8fd2fa94599dd37607c511c7dac2d12188cc57 +Author: Olle E. Johansson +Date: Fri Apr 1 20:28:27 2016 +0200 - tcpops: new function set_connection_lifetime() + Revert "registrar Rename core file to match module name" + + This reverts commit 932a08610b6d3d3537414d4dc401cf8a8942282c. -commit 0ec36aeacb30eafbbee36a7a8cc4254d0ca8a384 -Author: Jason Penton -Date: Fri Feb 20 15:23:45 2015 +0200 +commit eb6254b9e82e650f2471ba4a5f58636580cd66cd +Author: Olle E. Johansson +Date: Fri Apr 1 20:28:15 2016 +0200 - modules/ims_registrar_pcscf: lookup of contact should not be based on where request comes from + Revert "db_postgres Rename core files to match module name, rename SER to Kamailio and remove svn ID's" + + This reverts commit a4b3dfd711af986f3992ded4bf608eb0f60dea6f. -commit d335d21eb617a6c5018bb92411b47abd05c426fa +commit 26aa3b6c27e3598b075d923203af5af31f7c0efc Author: Olle E. Johansson -Date: Fri Feb 20 10:30:09 2015 +0100 +Date: Fri Apr 1 20:27:59 2016 +0200 - ldap Remove SVN ID and history + Revert "db_text Change core source code file name to match module name" + + This reverts commit 44c2ebd7ae7e744880af0397703dd405e8eb5d52. -commit 6a86333f63442380b28ce88d44f95ef0cdbcfcf6 -Merge: 486c069 2f14564 -Author: Camille Oudot -Date: Fri Feb 20 10:15:19 2015 +0100 +commit 947b86ca81d8f0205205f3bb8328b8110eb1daa2 +Author: Olle E. Johansson +Date: Fri Apr 1 20:27:44 2016 +0200 - Merge pull request #95 from kamailio/coudot/core_tcp_lifetime + Revert "db_mysql Rename core source code file to match module name" - core: add support for per-TCP connection lifetime + This reverts commit 29fda7288eba52ca73c893cb534bd14c66749827. -commit 486c069222462e4bc05da36b098062be941d672d -Author: Victor Seva -Date: Tue Feb 17 15:40:41 2015 +0100 +commit 7c62633751f6405ab183f054701280ab32b444ae +Author: Olle E. Johansson +Date: Fri Apr 1 20:27:30 2016 +0200 - nathelper: use always contact to build ruri and received field if available to send the ping + Revert "auth_identity Change product name" - Fixes #37 + This reverts commit 9aaff8933f4f4ee0da6accbf7773334fb187274b. -commit af59452ed6ab165e9554c2d814d778abd7441699 -Author: Victor Seva -Date: Tue Feb 17 15:03:22 2015 +0100 +commit d1b906d0c2acbec5f9daa22805d0a45211d60486 +Author: Olle E. Johansson +Date: Fri Apr 1 20:27:19 2016 +0200 - usrloc: return received field too in get_all_*_ucontacts() + Revert "lcr Change name of software, remove SVN ID and history" + + This reverts commit 853fadd1cd90460d78e8563d611e444dc786e654. -commit 2597c31eca105084ecbce964791d3bf965b23fdc -Merge: b88e165 cd58d9e -Author: Daniel-Constantin Mierla -Date: Thu Feb 19 21:46:24 2015 +0100 +commit 53a75276dec8d274b0ca843ce1e6773cfca3828f +Author: Olle E. Johansson +Date: Fri Apr 1 20:27:05 2016 +0200 - Merge pull request #71 from kamailio/oej/mohqueue + Revert "Dispatcher Minor edit to have proper name in source code file" - mohqueue: minor fixes + This reverts commit 651407857d129f464515c5cf80ce687257066395. -commit b88e165214296d1d7491cf389295800b499a5d34 -Author: Daniel-Constantin Mierla -Date: Thu Feb 19 21:13:39 2015 +0100 +commit d6abbc8e86ec43c216ba78197dfcf082507d6ca4 +Author: Olle E. Johansson +Date: Fri Apr 1 20:26:55 2016 +0200 - utils: cleanup CURL handle when the POST value can't be fetched from the PVAR + Revert "mediaproxy Rename SIP-router to Kamailio" - - patch provided by mikomarrache on GH #88 + This reverts commit 38a9ae753b4d68d8c229366fd4254839536e5669. -commit 367887d6437db5f1c5e70258d3838f3a2acbd084 -Merge: d5ac2a0 5adbfc6 -Author: lazedo -Date: Thu Feb 19 17:50:22 2015 +0000 +commit 7371ed72e20b7d25aa527d78a1fd50366e61a2ed +Author: Olle E. Johansson +Date: Fri Apr 1 20:26:32 2016 +0200 - Merge pull request #92 from kamailio/lazedo-patch-1 + Revert "auth_identity Remove SVN ID's" - db_text : missing OP_NEQ + This reverts commit 39360d98a6c1f80daa67fd1348fdab63bd8a5822. -commit 2f14564f7d87d1d51adb5deadae4ddb6b4ea4bee -Author: Camille Oudot -Date: Thu Feb 19 16:50:11 2015 +0100 +commit 22ac262cc88cdb78fba1329333412c7f7447128f +Author: Olle E. Johansson +Date: Fri Apr 1 20:26:20 2016 +0200 - core: add support for per-TCP connection lifetime + Revert "auth_radius Remove SVN ID's and history comments" + + This reverts commit 706e58ff60003a6dca09ad79efef7f1a423d232e. -commit d5ac2a0b21c51f0759c16ff39e6d28e1bc8730d7 -Author: Camille Oudot -Date: Thu Feb 19 14:29:21 2015 +0100 +commit 52160709baae08cde3902410a9a7b579d40445cd +Author: Olle E. Johansson +Date: Fri Apr 1 20:26:10 2016 +0200 - tcpops: check protocol of current message + Revert "auth_radius Rename module core file" + + This reverts commit db4b4b68ff91a8e2f00864b29af010514eadf233. -commit 1dbcc93952db87fb158886b05b03f82626ff933c -Merge: 3be5902 059c9a3 -Author: tsearle -Date: Thu Feb 19 10:24:43 2015 +0100 +commit 5534237dd155474932a518366b5f1c63f15bdef7 +Author: Olle E. Johansson +Date: Fri Apr 1 20:26:00 2016 +0200 - Merge pull request #93 from tsearle/master + Revert "websocket Rename core module name for consistensy" - modules/sipt: added the ability to modify the first byte of Backwards Call Indication Parameters + This reverts commit ac2043d1c0a4c921c0d41e5a1a9ff33530449bb6. -commit 3be5902a697caca2dd70fae2e17a1e0acb87c089 -Author: Daniel-Constantin Mierla -Date: Thu Feb 19 09:36:57 2015 +0100 +commit 4bb26a40f9a14e9d703d899abe76abee0fd5057d +Author: Olle E. Johansson +Date: Fri Apr 1 20:25:44 2016 +0200 - pv: fixed the definition of the new $sut variable + Revert "permissions remove svn ID's and history from source code" - - reported by Luis Azedo + This reverts commit 1538ba701438bf0bfc610af284d67987b9b47bb6. -commit 059c9a33fd451b59b83f913f86a0843e2c5bbefa -Author: Torrey Searle -Date: Thu Feb 19 09:24:37 2015 +0100 +commit 9ecf2492b1952d71d4ec89ba4df5fde428a86a94 +Author: Olle E. Johansson +Date: Fri Apr 1 18:25:42 2016 +0200 - modules/sipt: fix example values in documentation + db_flatstore Edit source code headers - change product name to Kamailio etc -commit 30460e263b9b5492872f1f1437fefdfbba69f92b -Author: Daniel-Constantin Mierla -Date: Thu Feb 19 09:19:56 2015 +0100 +commit ddb1069e7c03544f80fc728503b7df1005ccf54d +Author: Olle E. Johansson +Date: Fri Apr 1 18:22:39 2016 +0200 - pv: $su use the common core function to get the source address as uri + db_flatstore Rename core module file to match module name - - it has same value as received uri built by nathelper - - $sut - new variable that returns full uri for source address (it adds - transport=udp - missing transport will be equivalent, use $su if you - want that) + Issue #82 -commit 2df98c7afdc7ef574124912de01a5fd66f7aa6bb -Author: Daniel-Constantin Mierla -Date: Thu Feb 19 09:11:54 2015 +0100 +commit 932a08610b6d3d3537414d4dc401cf8a8942282c +Author: Olle E. Johansson +Date: Fri Apr 1 18:17:06 2016 +0200 - nathelper: received uri is using core function for generating source uri + registrar Rename core file to match module name - - transport value is now lower case + Issue #82 -commit b81dff6abab6d8c25892f28db0e663653daa6c2c -Author: Daniel-Constantin Mierla -Date: Thu Feb 19 09:09:14 2015 +0100 +commit a4b3dfd711af986f3992ded4bf608eb0f60dea6f +Author: Olle E. Johansson +Date: Fri Apr 1 18:14:04 2016 +0200 - core: unified function for returning string of a protocol + db_postgres Rename core files to match module name, rename SER to Kamailio and remove svn ID's - - returns variants for uppercase and lowecase, representation for uri or - bare proto: udp, tcp, tls, sctp, ws and wss - - in uri, PROTO_WS and PROTO_WSS are represented as transport=ws + Issue #82 -commit 5adbfc6cc62be393ac55d296cab79f7e60b17ae4 -Author: lazedo -Date: Wed Feb 18 23:01:57 2015 +0000 +commit 44c2ebd7ae7e744880af0397703dd405e8eb5d52 +Author: Olle E. Johansson +Date: Fri Apr 1 18:05:33 2016 +0200 - db_text : missing OP_NEQ + db_text Change core source code file name to match module name - this affects the presence package when it queries for active_watchers - -commit a7f8ee271acca095fa6a7c2dddf0dcba62102efd -Author: Torrey Searle -Date: Wed Feb 18 20:48:11 2015 +0100 - - add ability to modify BCI header + Issue #82 -commit 1e3e5217af1992e5c3474752de1a8c411a3e976e +commit 29fda7288eba52ca73c893cb534bd14c66749827 Author: Olle E. Johansson -Date: Wed Feb 18 17:19:19 2015 +0100 +Date: Fri Apr 1 18:03:10 2016 +0200 - app_python remove svn ID's + db_mysql Rename core source code file to match module name + + Issue #82 -commit 33cdf4f359e781b2698b9a1739823630f9883efd +commit 9aaff8933f4f4ee0da6accbf7773334fb187274b Author: Olle E. Johansson -Date: Wed Feb 18 17:13:41 2015 +0100 +Date: Fri Apr 1 17:59:59 2016 +0200 - sqlops Update Doxygen + auth_identity Change product name -commit bf058b3c401424976a28d24545b75cac4dd7b8d3 +commit 853fadd1cd90460d78e8563d611e444dc786e654 Author: Olle E. Johansson -Date: Wed Feb 18 17:11:39 2015 +0100 +Date: Fri Apr 1 17:58:38 2016 +0200 - sqlops remove SVN ID's + lcr Change name of software, remove SVN ID and history -commit 313e77d36137f2c3eecd10a84dff5aab5e99386b +commit 651407857d129f464515c5cf80ce687257066395 Author: Olle E. Johansson -Date: Wed Feb 18 17:09:28 2015 +0100 +Date: Fri Apr 1 17:54:48 2016 +0200 - sca Remove SVN ID, rename "sip-router" to "kamailio" + Dispatcher Minor edit to have proper name in source code file -commit f64d04a2608c1bff000eb6606a0711124cad396d +commit 38a9ae753b4d68d8c229366fd4254839536e5669 Author: Olle E. Johansson -Date: Wed Feb 18 17:02:00 2015 +0100 +Date: Fri Apr 1 17:53:04 2016 +0200 - sipcapture Remove SVN IDs + mediaproxy Rename SIP-router to Kamailio -commit 2e748c45e32cfcaa13b825896279b4d09c379281 +commit 39360d98a6c1f80daa67fd1348fdab63bd8a5822 Author: Olle E. Johansson -Date: Wed Feb 18 16:59:50 2015 +0100 +Date: Fri Apr 1 17:51:52 2016 +0200 - sms Remove SVN ID, remove history change "ser" => "Kamailio" + auth_identity Remove SVN ID's -commit a0368f9933a6c824c67c6cbeb757bfe960e085ea +commit 706e58ff60003a6dca09ad79efef7f1a423d232e Author: Olle E. Johansson -Date: Wed Feb 18 16:55:28 2015 +0100 +Date: Fri Apr 1 17:47:59 2016 +0200 - p_usrloc Remove SVN ID and history entries + auth_radius Remove SVN ID's and history comments -commit a926cd85e393913dadd1ccc0712335c23afbebef +commit db4b4b68ff91a8e2f00864b29af010514eadf233 Author: Olle E. Johansson -Date: Wed Feb 18 16:50:25 2015 +0100 +Date: Fri Apr 1 17:46:36 2016 +0200 - websocket Remove SVN ID's + auth_radius Rename module core file + + Issue #82 -commit f1f0abdeb100721a3e1cf23ef88490fba83a3e4c +commit ac2043d1c0a4c921c0d41e5a1a9ff33530449bb6 Author: Olle E. Johansson -Date: Wed Feb 18 16:48:18 2015 +0100 +Date: Fri Apr 1 17:42:31 2016 +0200 - uac_redirect Remove SVN ID, remove history + websocket Rename core module name for consistensy + + Issue #82 -commit 5e9ee1dd3e95790d48e57b07bff7389ac6c233c2 +commit 1538ba701438bf0bfc610af284d67987b9b47bb6 Author: Olle E. Johansson -Date: Wed Feb 18 16:37:58 2015 +0100 +Date: Fri Apr 1 17:36:39 2016 +0200 - xmpp Remove svn ID's + permissions remove svn ID's and history from source code -commit 6719a6db100d3ab63c2e95b0e1d076989c65fa12 -Author: Richard Good -Date: Wed Feb 18 17:20:55 2015 +0200 +commit e6dd2c172be3712e8c468cbe7e55ba94d81a7b62 +Author: Daniel-Constantin Mierla +Date: Fri Apr 1 11:10:46 2016 +0200 - modules/ims_qos: corrected fixup bug when passing in empty sub id and sub type + core: test if AF_PACKET is defined at compile time + + - mac os x (and perhaps *BSDs) doesn't have it + + (cherry picked from commit 8543993e1f702aef80887c0e72b9bf67c62c1617) -commit 848394fa7615b56d86d255d6e05d7c4690893d35 -Author: Federico Cabiddu -Date: Wed Feb 18 08:02:28 2015 +0100 +commit 4992dfbb9f15cfb8ade99be4e6d3087146cb8e22 +Author: schoberw +Date: Fri Apr 1 10:34:11 2016 +0200 - modules/dispatcher: fixed ds_print_mi_list when a gateway doesn't have attrs defined + core: skip address family AF_PACKET on -l iface_name - - reported by Luis Azedo + - socket_info.c: getifaddrs() returns AF_PACKET, AF_INET and AF_INET6 addressed of an interface. + AF_PACKET are of no use and breaks startup with an -l eth0:5060 cmd line param + (cherry picked from commit d7fca53e8c5409849ec044098a143e7254129c00) -commit a6510bbb2d3bcf29f672c2e649a9e4d63487bca7 + +===================== 2016-03-30 Version 4.4.0 Released ===================== + +===================== Changes Since Version 4.3.0 =========================== + +commit 665000690364dd2c0b59184885064d93343901bd Author: Daniel-Constantin Mierla -Date: Tue Feb 17 14:50:57 2015 +0100 +Date: Wed Mar 30 15:27:20 2016 +0200 - tls: regenerated the readme file + auth_xkeys: init var to get rid of compile warnings + + (cherry picked from commit f8a924874a17e15511ccf1f5ca284c5e2247d805) -commit 56389d7adcbc1a71551ba4b93900ba993a2291e6 +commit c1c1b39b25eb70bfc512ac9d9fee28355cce3cfb Author: Daniel-Constantin Mierla -Date: Tue Feb 17 14:50:43 2015 +0100 +Date: Wed Mar 30 15:25:29 2016 +0200 - tls: documentation for server_name and xavp_cfg + pkg/deb: version set to 4.4.0 in spec files -commit 9a36fb7aae0adc39efb17a967a88db2eebfd8c36 +commit a1f27b008994f309731818649274d449e1a28f71 Author: Daniel-Constantin Mierla -Date: Tue Feb 17 14:05:53 2015 +0100 +Date: Wed Mar 30 15:03:47 2016 +0200 - tls: set SNI for outbound connections via xavp - - - new parameter: xavp_cfg to set the name of the xavp that holds - attributes for tls connections - - server_name attribute can be used to specify SNI for outbound - connections: + cnxcc: incude stdlib.h to get rid of compile warnings for malloc/free - modparam("tls", "xavp_cfg", "tls") - ... - $xavp(tls=>server_name) = "kamailio.org"; - $du = "sip:kamailio.org:5061;transport=tls"; - route(RELAY); - - - note: kamailio tries to identify the client context from tls.cfg by ip, port - and server_name, but many OSes allocate a local random port when - initiating TCP/TLS connection, so it is hard to add such contexts, in - this case the client:default being used + (cherry picked from commit 8a8ed04d2bbd0547a08eeec328268cd171cc9419) -commit f37344dddf53514e35a3d8c0e2d47c0672a80825 +commit b944dad974cd55a05c2f2811af5606b3c6cae2b8 Author: Daniel-Constantin Mierla -Date: Tue Feb 17 12:02:04 2015 +0100 +Date: Wed Mar 30 14:59:56 2016 +0200 - tls: added server_name to module parameters - - - not that useful in the case of defining a single set of tls - attributes, but has to be coherent with the config options + Makefile.defs: version set to 4.4.0 -commit 44db9cdb44e6d2e11b6f423015350625a6d75637 -Merge: 7fb52e6 193e8b3 -Author: lazedo -Date: Tue Feb 17 12:08:34 2015 +0000 +commit 6bd9386e001f5843f5a46c387587e71a7d89c942 +Author: Olle E. Johansson +Date: Wed Mar 30 15:03:05 2016 +0200 - Merge pull request #87 from kamailio/lazedo/dbtext + http_client Remove the last traces of $curlredirect - db_text - add affected rows capability + Will continue working with this in master -commit 6909de08ab5b51c90fe226b325a2492905d3fa40 -Author: Victor Seva -Date: Tue Feb 17 10:08:18 2015 +0100 +commit 9589a0168c632e8d934ea45889352864e82d19d3 +Author: Olle E. Johansson +Date: Wed Mar 30 15:01:45 2016 +0200 - etc: change fifo default to /var/run/kamailio + http_client.c Remove code that doesn't even try to work -commit be486988bc2e27ba44961f1c4d2af48cecf06da3 -Author: Victor Seva -Date: Tue Feb 17 10:07:06 2015 +0100 +commit 5eabc7e56bd32694438801cc7730109e8d4c2359 +Author: Daniel-Constantin Mierla +Date: Wed Mar 30 14:56:12 2016 +0200 - utils/kamctl: change fifo default path to /var/run/kamailio + ChangeLog: refreshed the relevant changelog content for v4.4.0 -commit 850320cac86e6c5cee6f8d936340678eb32412d3 -Author: Victor Seva -Date: Tue Feb 17 10:03:35 2015 +0100 +commit 82a7f3c0f47d764ec734676c4da1a6a81ef81141 +Author: Daniel-Constantin Mierla +Date: Wed Mar 30 14:50:06 2016 +0200 - etc: set ctl "binrpc" to new /var/run/kamailio default value + pkg/rpm: version set to 4.4.0 in spec files -commit 084e68b337f3afbc841347a6d27398bacfaf191b -Author: Victor Seva -Date: Tue Feb 17 10:02:20 2015 +0100 +commit b235ca538735bc0580193585a3c0a71edf1c813d +Author: Daniel-Constantin Mierla +Date: Wed Mar 30 14:46:49 2016 +0200 + + README.md: travis status moved next line to the title + +commit 1c82c03c64b62a4fcf409912c50859018f103fa5 +Author: Daniel-Constantin Mierla +Date: Wed Mar 30 14:44:17 2016 +0200 - ctl: use RUN_DIR env to set DEFAULT_CTL_SOCKET + INSTALL: small cleanup -commit 7fb52e66c37d9fe22448a085db461fd8e8c28711 +commit fd9bcba70bd7ea14d6581ba011d06e3d043ac69c Author: Daniel-Constantin Mierla -Date: Tue Feb 17 00:25:00 2015 +0100 +Date: Wed Mar 30 14:40:53 2016 +0200 - .gitignore: added new path of kamcmd binary to ingnore list + README: polishing for v4.4 -commit cfade98e196aa96e36a33efcbf22489cf10ef979 +commit 090f0bf45b955cff303472978f00053c5277bd10 Author: Daniel-Constantin Mierla -Date: Tue Feb 17 00:22:19 2015 +0100 +Date: Wed Mar 30 14:37:45 2016 +0200 - tls: server side SNI support + topos: remove unused variables - - adapted from the patch of Klaus Darilion for Kamailio v1.5, which was - lost with the ser integration - - this is a partial patch of the original one, adding support for SNI - when accepting TLS connections + (cherry picked from commit 9aeaf65b042b7e65d962a9949b9a56e60743d89a) -commit 5b65ebb807661daf7132e084bee609aff1af49d1 +commit 3d3a255f4f34b765a835d94721d10aa6db3dda4b Author: Daniel-Constantin Mierla -Date: Tue Feb 17 00:20:52 2015 +0100 +Date: Wed Mar 30 14:28:27 2016 +0200 - Makefile: updated sercmd to kamcmd + topos: swapping direction handling for contact in response + + (cherry picked from commit 7c48b0fce5d59f237103cd26a61e616d74cabcb3) -commit 988d21b55087ed215921236ffc865f53b6942d84 +commit 53a6e2542118fc268d4b6333bf741c8287ad22ff Author: Daniel-Constantin Mierla -Date: Tue Feb 17 00:20:12 2015 +0100 +Date: Wed Mar 30 13:41:40 2016 +0200 - clt: updated name of the tool for installation to kamcmd + topos: reset the flags of dlg storage record on bye + + (cherry picked from commit ee67b5ee18dbd791f898ad5f472715b7bf818cfc) -commit f9e496f1fd25eb05f571f2e95c69c6c932692e33 +commit 1d71e863f52ba9cc5dc050d8db1d2b3c91d1bb07 Author: Daniel-Constantin Mierla -Date: Sat Feb 14 16:04:58 2015 +0100 +Date: Wed Mar 30 13:26:17 2016 +0200 - kamcmd: removed .cvsignore file + topos: clean not confrmed dialogs from db storage based on branch expires + + (cherry picked from commit 0103cc98b80a16081c1da39d6d674e9eba98f91b) -commit de1eacfec21379f9a8f8bcfbc2ce6e0e7c999c97 +commit dc6de500a862748463c8e3755b813b8c07ee68cb Author: Daniel-Constantin Mierla -Date: Sat Feb 14 16:04:38 2015 +0100 +Date: Wed Mar 30 13:19:01 2016 +0200 - sercmd: renamed sources to kamcmd + topos: update the db storeage for confirmed dialogs + + (cherry picked from commit ed262dfb056f94e2fc81bcb59cd744f4924a76ef) -commit 56e825ffbfdcf8050de034f8327b6bbda974c9cd -Author: Jason Penton -Date: Mon Feb 16 17:37:45 2015 +0200 +commit 1b0638e1e71d0c724d389524b9fd77fa6e6adb5a +Author: Daniel-Constantin Mierla +Date: Wed Mar 30 12:41:00 2016 +0200 - modules/ims_registrar_scscf: correctly loop through contact parameters + topos: use headers to pass dlg id between receive and send of dlg requests + + - it is no longer in the context to be used directly + + (cherry picked from commit 95572016c2d6764f75775230d5e6cf5d180c6e06) -commit 193e8b35a93b4fee7479cfc0d7c27aff08342230 -Author: Luis Azedo -Date: Mon Feb 16 15:47:13 2015 +0000 +commit f6697740e7d55f8eca2039c235feaff91f5aa14f +Author: Daniel-Constantin Mierla +Date: Wed Mar 30 00:30:57 2016 +0200 - db_text - fix indentation + topos: restore stripped headers when receiving a dlg request + + (cherry picked from commit 2cb59f1716931e58b00ba7c0c177b0609c796b17) -commit 981ba1beefcf50ab30712bb7a5ebee92df1305d6 -Author: Jason Penton -Date: Mon Feb 16 17:37:45 2015 +0200 +commit 486341c76bc09fb5ead0fa63b890adb260871740 +Author: Sergey Okhapkin +Date: Tue Mar 29 23:21:46 2016 +0200 - modules/ims_registrar_scscf: correctly loop through contact parameters + geoip2: Improve detection of addresses used by anonymous proxies + + (cherry picked from commit c49011c2cc63d35bca6904748da166814a792fc9) -commit 83d39ae5b8b523c70b6fba9699efc681595430f8 -Author: Victor Seva -Date: Mon Feb 16 16:13:11 2015 +0100 +commit 75df6618a6eaec8314480de193e2a9a7cbe25324 +Author: Daniel-Constantin Mierla +Date: Tue Mar 29 23:12:44 2016 +0200 - examples: fix bashism in /bin/sh script + pv: fix compile warning for shm_initialized() test - $/usr/bin/checkbashisms examples/sr - possible bashism in examples/sr line 41 (function names should only contain [a-z0-9_]): - sip-router_start() { - possible bashism in examples/sr line 43 ($HOST(TYPE|NAME)): - echo "before startup sip-router core found on `date` at $HOSTNAME" > $TMP - possible bashism in examples/sr line 63 (function names should only contain [a-z0-9_]): - sip-router_stop() { + - coherent whitepacing across the file - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=772314 + (cherry picked from commit d3d1592eb7148586cb70e93f549ff11fd5cf5316) -commit 1950e38d3c7eaef45c8cc5c96b5494b0dbfa5c43 -Author: Victor Seva -Date: Mon Feb 16 16:04:39 2015 +0100 +commit 20fd3b1a1e1663fc79b3b44e39a874ecbfc6ce5c +Author: Daniel-Constantin Mierla +Date: Tue Mar 29 23:07:19 2016 +0200 - pkg/kamailio/deb: exclude obsoleted examples + pv: coherent indentation and whitespacing - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=772314 + (cherry picked from commit 594d1090b1b4cea26892f14f0adebc46bc05314b) -commit c8533037c916497c328d0ed4e30a6ef51dfc8882 -Author: Luis Azedo -Date: Mon Feb 16 14:52:02 2015 +0000 +commit 14d9a00bd61b3f0248b39e0306445efe8a215fc7 +Author: Olle E. Johansson +Date: Wed Mar 30 11:12:20 2016 +0200 - db_text - fix indentation + auth_radius Update documentation to be more clear about the different libraries supported + + (cherry picked from commit 057abc8d5588139059c37de232c2dcfa4c0e04cd) -commit b93b7b39537f8858b34052f77e3ce0512cdc72c0 -Author: Luis Azedo -Date: Mon Feb 16 13:48:58 2015 +0000 +commit dc828be6da416b8bb1ba8fbcc52942221782314e +Author: Olle E. Johansson +Date: Mon Mar 28 19:09:21 2016 +0200 - db_text - add affected rows capability + http_client Add configurable authentication methods + + Attempt to fix issue #515 + + (cherry picked from commit 4bf3a517991b374308b033b85c82058c37e4e90a) -commit 2f4b6375429eeb7fa73d85909150bfd9377582d1 -Merge: bf39780 cf521e6 -Author: lazedo -Date: Mon Feb 16 13:26:28 2015 +0000 +commit 37e59b5d1d3d12a2358d24fc5e37f2f55ee2e41a +Author: Olle E. Johansson +Date: Mon Mar 28 11:54:53 2016 +0200 - Merge pull request #86 from kamailio/lazedo/usrloc-patch + http_client Debug http_proxy and add http_proxy usage to the http_client_query function - usrloc - fix column types not initialized on update + (cherry picked from commit 34ffef464fbb26c3526990a0bf8b9c5d1cd4ee97) -commit cf521e66825fea4b7498d615d435739628fe4c09 -Author: lazedo -Date: Mon Feb 16 13:14:06 2015 +0000 +commit cb26fbd82c9594bd670beb27cb3ee1b99603b6c6 +Author: Olle E. Johansson +Date: Mon Mar 28 12:08:25 2016 +0200 - usrloc - fix column types not initialized on update - - some columns were not initialized on update leading to errors in update + http_client Add error parsing for DNS issues with http_proxy - ERROR: db_text [dbt_lib.c:464]: dbt_is_neq_type(): invalid datatype -1001432832 - ERROR: db_text [dbt_base.c:560]: dbt_update(): incompatible types! - ERROR: db_text [dbt_base.c:599]: dbt_update(): failed to update the table! + (cherry picked from commit 438f91b8b5a43516d8904f23be2fa9898fdc465c) -commit bf39780f476a38da3ffe975b5e5e985568734982 -Author: Victor Seva -Date: Sat Feb 14 09:00:20 2015 +0100 +commit 78bc680355075304e6e93d91347a564ac8eed20f +Merge: 00a01a4 78a43ba +Author: Olle E. Johansson +Date: Wed Mar 30 08:53:57 2016 +0200 - pkg/kamailio/deb: use BASEDIR and clean usr/local + Merge branch '4.4' of https://github.com/kamailio/kamailio into 4.4 - since 8c2b9ae build process failed + * '4.4' of https://github.com/kamailio/kamailio: (32 commits) + Update hep.c + core: mem - updated defines to pkg mod stats + Makefile.defs: version set to 4.4.0-rc2 + Makefile.defs: re-enable pkg malloc + topos: reused stored branch attributes in case of retransmission + http_async_client: use pkg-config for libevent compile flags detection + mem: shm - updated macros for mod stats api + uuid: detect if pkg-config knows about uuid lib + mem/tlsf_malloc: updates to use new api names for module stats + mem/q_malloc: updates to use new api names for module stats + mem/f_malloc: updates to use new api names for module stats + core: mem/shm - use module stats fields for init of managers + core: mem/pkg - use module stats fields for init of managers q + core - mem: renamed api fields for module stats to repleft the purpose + tm: coherent indentation + p_usrloc: free allocated items in case of no more memory during domain add + core: mem - export pkg api even when using system malloc + presence: remove jumping to error from error in update_presentity() + http_client: check first if pointer is not exceeding limit + usrloc: if no location record loaded from db, then no attrs to look up + ... -commit d6793d74628baa77316cfdb7366fd3b580369697 -Author: Victor Seva -Date: Sat Feb 14 13:36:56 2015 +0100 +commit 00a01a4d7eb736a0ee481e10e2e8fe876e5edbeb +Author: Olle E. Johansson +Date: Mon Mar 28 19:56:36 2016 +0200 - app_java: Rename module interface file. fix e0a20eb1e4a0d876cc1cf91f160f2b74ad912a16 + http_client Fix typo - Issue #82 + ...and compile before commit... + + (cherry picked from commit 7a23fd2c9ec66332097b639d4bedde52731e2bae) -commit 2d6d34b21320b269c6eceb5a44c5c91eb44740fc -Author: Jason Penton -Date: Fri Feb 13 09:45:16 2015 +0200 +commit fadd19ed1832d88fdeea7df267557419191447f9 +Author: Olle E. Johansson +Date: Mon Mar 28 20:42:37 2016 +0200 - modules/dialog_ng: corrected PARAM_STRING to PARAM_STR + http_client Add note about empty string in configuration file + + (cherry picked from commit 68547d50668032c1a43e81f2eabf4d2b709ff049) -commit e88c96023f3709232c3a6fdd4eac8d4d0dd25025 -Author: Juha Heinanen -Date: Fri Feb 13 02:08:00 2015 +0200 +commit 78a43ba3f86c336295d5385c8d5ec3039c3c1032 +Merge: 24d31da ac90a7c +Author: Alexandr Dubovikov +Date: Tue Mar 29 23:17:03 2016 +0200 - modules/siptrace: added totag field to sip_trace table - - added sip_trace table version check + Merge pull request #554 from adubovikov/4.4 + + modules/sipcapture: fixed correlation_id pointer for HEPv2/v1 -commit 902935802bfbfaef94b3da6bad6d7669040c8f47 -Merge: c3a7a4f 265a38a -Author: lazedo -Date: Thu Feb 12 23:21:27 2015 +0000 +commit ac90a7c1066cc8a5e01152a1c6bfc704f6667d98 +Author: Alexandr Dubovikov +Date: Tue Mar 29 13:53:19 2016 +0200 - Merge pull request #78 from kamailio/lazedo/presence - - presence : add min_expires param + Update hep.c -commit c3a7a4fc929f82fe997cbcc6893bdd2f2679d85f +commit 24d31da6fea5f177a43b492853362d56e9298ef6 Author: Daniel-Constantin Mierla -Date: Thu Feb 12 13:40:00 2015 +0100 +Date: Mon Mar 28 14:37:59 2016 +0200 - Makefile: print run dir details in uninstall target + core: mem - updated defines to pkg mod stats - - exporte the runbasedir to config.mak + (cherry picked from commit 69f9328ddd959a70de8b94152704326dcca6a8cc) -commit 47359a915b7d59e8ce88504e868ada5943d9fc9f +commit 8ce95cbe27a0244ae1db2630bcc8c513485155ca Author: Daniel-Constantin Mierla -Date: Thu Feb 12 13:23:46 2015 +0100 +Date: Mon Mar 28 11:22:27 2016 +0200 - kamctl: use /tmp if $(basedir) is not set - - - it is used for temporary operations at install - - without it fails to install, trying to use / for these operations + Makefile.defs: version set to 4.4.0-rc2 -commit 8c2b9ae30b6adb22a6777b7493bf1e50e86e6c8d +commit 543958280f732c5a9de2fbc7f84ae227e6929098 Author: Daniel-Constantin Mierla -Date: Thu Feb 12 13:02:07 2015 +0100 +Date: Mon Mar 28 11:21:26 2016 +0200 - Makefile: define RUN_DIR at compile time + Makefile.defs: re-enable pkg malloc - - default to /var/run/kamailio - - obeys the PREFIX, becomeing $(PREFIX)/var/run/kamailio - - based on GH issue #80 + - was disabled for compile tests with system malloc -commit b40e466598fbc97e30ae21c6ebcbba3ce7acd768 -Author: Olle E. Johansson -Date: Wed Feb 11 21:59:12 2015 +0100 +commit acb67a89ceba1428e465b1ff8e052b7683241e61 +Author: Daniel-Constantin Mierla +Date: Mon Mar 28 10:56:14 2016 +0200 - xcap_client remove svn ID's, remove history + topos: reused stored branch attributes in case of retransmission + + (cherry picked from commit a4043c445b0673ca8f5ff7819caf9ac156da1e73) -commit 9e19227dd0f6760ff1185dbc7ebbcf940214d422 -Author: Olle E. Johansson -Date: Wed Feb 11 21:57:08 2015 +0100 +commit 94e0ca56f2fd7ed56b511ab3572484cd780279a6 +Author: Daniel-Constantin Mierla +Date: Mon Mar 28 10:22:10 2016 +0200 - pv Remove svn ID's + http_async_client: use pkg-config for libevent compile flags detection + + - re-enable pkg-config for libcurl + + (cherry picked from commit 88d8aabb748d2c0ab476cea9a4a17eb990b618f7) -commit e80e50904c0d22eda0e1eb3ac94e8fe8854fcdec -Author: Olle E. Johansson -Date: Wed Feb 11 21:42:54 2015 +0100 +commit ef8ee4cd13396bbd4fa2be1cd7b07a69bcd55eeb +Author: Daniel-Constantin Mierla +Date: Sun Mar 27 14:40:46 2016 +0200 - auth_db Remvoe SVN ID and history + mem: shm - updated macros for mod stats api + + (cherry picked from commit e5538f1814ed5b96a01c7006d15c9192238c9b19) -commit cde1e4b61f263b201f02a4795c84aa18e6a3fa0d -Author: Olle E. Johansson -Date: Wed Feb 11 21:41:42 2015 +0100 +commit 21cb1bf26aed825cc0a2e5d7bdee0d61e1a700cc +Author: Daniel-Constantin Mierla +Date: Sun Mar 27 14:40:09 2016 +0200 - auth_db Renamed include file + uuid: detect if pkg-config knows about uuid lib + + (cherry picked from commit 66fc01f48ea2d6fa8f20f39e1bcd01d498f8580d) -commit fdc4b11cc414100f5ff01cb82e3d21d51cf5629d -Author: Olle E. Johansson -Date: Wed Feb 11 21:40:27 2015 +0100 +commit 97c2f855920f1aca0d47ed339e11cb0b2188edde +Author: Daniel-Constantin Mierla +Date: Sun Mar 27 14:24:00 2016 +0200 - auth_db Rename main include file + mem/tlsf_malloc: updates to use new api names for module stats + + (cherry picked from commit 1eafbaf5b2d25879225b8e4c4797285dba2d460f) -commit 7aca62e45e86bcc5c6b31840079ef139a92cddab -Author: Olle E. Johansson -Date: Wed Feb 11 21:39:16 2015 +0100 +commit cb2c14f2dbdbc6fdcb7a0565b2718379241d655a +Author: Daniel-Constantin Mierla +Date: Sun Mar 27 14:23:46 2016 +0200 - auth_db Move main file + mem/q_malloc: updates to use new api names for module stats - (this commit will break compilation, but keep history) + (cherry picked from commit 8f2864b1845cfa2b520c0886e30d1f5df285eef6) -commit dfaf93c3cc9bd6e65dacafd01a8299f42abacbf5 -Author: Ovidiu Sas -Date: Wed Feb 11 15:30:42 2015 -0500 +commit d39d166e753ade7dfbd0f439db03f7d09f91a601 +Author: Daniel-Constantin Mierla +Date: Sun Mar 27 14:23:02 2016 +0200 - pua_dialoginfo: set expiration timeout to 10s for dialogs in terminated state - - this will avoid accumulation of expired dialogs + mem/f_malloc: updates to use new api names for module stats + + (cherry picked from commit ec15fc65bc6d38e74fdcf6a1fa6ef10053452365) -commit 2bbaa92b07f3174613644beec014adb736eaa652 -Author: Olle E. Johansson -Date: Wed Feb 11 21:28:25 2015 +0100 +commit 7c521fcbded0a14b8bfa5488511fe0a08f105085 +Author: Daniel-Constantin Mierla +Date: Sun Mar 27 14:22:37 2016 +0200 - app_java Remove svn IDs + core: mem/shm - use module stats fields for init of managers + + (cherry picked from commit 26dbc87aac8d117bf0928eb2124ecc91e512e20f) -commit e0a20eb1e4a0d876cc1cf91f160f2b74ad912a16 -Author: Olle E. Johansson -Date: Wed Feb 11 21:12:21 2015 +0100 +commit 792491709f30331e0d53bda610a7614eff6228ee +Author: Daniel-Constantin Mierla +Date: Sun Mar 27 14:21:55 2016 +0200 - app_java Rename module interface file + core: mem/pkg - use module stats fields for init of managers + q - Issue #82 + (cherry picked from commit b568c6533670b1400f7c12bd13169d41542c351a) -commit 888f8d6bb159408caf14360eb98ed5ff0bb52a78 -Author: Olle E. Johansson -Date: Wed Feb 11 21:01:21 2015 +0100 +commit bc63f4726541d694da2184a3f41becb78966c4be +Author: Daniel-Constantin Mierla +Date: Sun Mar 27 14:21:12 2016 +0200 - uac_redirect Rename module file #82 + core - mem: renamed api fields for module stats to repleft the purpose + + (cherry picked from commit 50ac46bfc233531f9f4be22be4aee07a8faa0325) -commit 265a38a08a21dbeab2b9d310bd521e9c25f5d24a -Author: Luis Azedo -Date: Wed Feb 11 17:39:27 2015 +0000 +commit 85a5b41599e9a8a27c10acdc17438b0571e5171d +Author: Daniel-Constantin Mierla +Date: Sun Mar 27 12:04:47 2016 +0200 - presence : add min_expires_action parameter + tm: coherent indentation - action to take when min_expires > 0 + - removed historical top comments - possible values are - 1 - RC compliant, return "423 Interval Too Brief" - 2 - force min_expires in the subscription + (cherry picked from commit 5d903fd40a9e89d601be25df282a008ba8ba421e) -commit 61d6b119398a87c4a877de3fba0dc9c6ec2830a7 +commit 1a1f3606bde2a4e45ade6212a440e5289de5af91 Author: Daniel-Constantin Mierla -Date: Wed Feb 11 13:05:41 2015 +0100 +Date: Sun Mar 27 11:48:33 2016 +0200 - sqlops: regenereated the readme file + p_usrloc: free allocated items in case of no more memory during domain add + + (cherry picked from commit b27384a0a7c6567a9ecebab3f987079ad0ff7366) -commit 112e83c2e8b72be04f7ad5b896db0bf3bcbdbe8f +commit dec9de968e5894fba808e01614a29655ce375141 Author: Daniel-Constantin Mierla -Date: Wed Feb 11 12:50:43 2015 +0100 +Date: Sun Mar 27 11:39:09 2016 +0200 - sqlops: added note to sql_async_query() about core async_workers + core: mem - export pkg api even when using system malloc - - the parameter must be set to enable the async framework used by this - function + (cherry picked from commit 33fe5e38d2eefc2244eccb6279c082a789ed0307) -commit 7ae56a331209adeff7c5da86e1ebd8321d586a35 +commit 745e5dd42d032f0343c88d033e3b924fa79cd5ae Author: Daniel-Constantin Mierla -Date: Wed Feb 11 12:37:22 2015 +0100 +Date: Sun Mar 27 11:38:17 2016 +0200 - db_mongodb: regenerated README file + presence: remove jumping to error from error in update_presentity() + + - coherent indentation + + (cherry picked from commit 07dbe3697bcad18f5766fc0d71a7fc48ff8a26d0) -commit 6940ce0e991fd5b6af9ef5822dc2b1a324319174 +commit f229c60396fa8590bbbb2d66cb8006dd31ab6521 Author: Daniel-Constantin Mierla -Date: Wed Feb 11 12:19:45 2015 +0100 - - db_mongodb: updated details in docs about the limitations +Date: Sat Mar 26 22:29:27 2016 +0100 -commit e31e4632f83e805775bbc1e208178bee11ab137b -Author: mikomarrache -Date: Wed Feb 11 11:47:17 2015 +0100 - - db_mongo_db: use mongoc_collection_update() for update operation + http_client: check first if pointer is not exceeding limit - - used instead of mongoc_collection_find_and_modify(), which returns the - document, but it is not needed - -commit 2a045585efc9a8e5b17123d320539d0c8cb6be77 -Author: mikomarrache -Date: Wed Feb 11 11:42:14 2015 +0100 - - db_mongodb: use $set operator to update a specific list of fields in a document + - then test its value not to be null char - - fix to keep all the other fields unchanged + (cherry picked from commit 47a776efcd3d5c2ffafdd780fa169edc85e436d2) -commit e122c5ee8c6055c033cc11f14e5308ed94461fe6 -Author: mikomarrache -Date: Wed Feb 11 11:37:26 2015 +0100 +commit b667c768dd87575873cec872abdf3caaf20c9ffc +Author: Daniel-Constantin Mierla +Date: Sat Mar 26 13:09:53 2016 +0100 - dialog: fix initialization of slot next_id to avoid colision after restart + usrloc: if no location record loaded from db, then no attrs to look up - - next_id was set to the highest id of a dialog loaded from database, - next new dialog was reusing the same value + (cherry picked from commit bedd6f4df9d2b5600bed5e31052bc49f8b18382f) -commit 82192d06218418ad2b03f4ba3e4549afddf24f1c -Author: lucian balanceanu -Date: Tue Feb 10 17:01:58 2015 +0200 +commit fd20bff1e420a93be588b2c0dd4189f6f7e8ea0b +Author: Daniel-Constantin Mierla +Date: Sat Mar 26 13:01:01 2016 +0100 - rtpengine: rtpengine_tout is now rtpengine_tout_ms + seas: init variable to get rid of compile warning - - rtpengine tout param is now expressed in millisecs + (cherry picked from commit 3a25e489d0ab8d55d4011ccf62de4f3d8d08b028) -commit bba3e53de1f79d51505273519bc6c358be1f42e2 -Author: Luis Azedo -Date: Wed Feb 11 05:39:47 2015 +0000 +commit ed9ad742f9e9cd0d6e75dc788923addf9984ce3d +Author: Daniel-Constantin Mierla +Date: Sat Mar 26 12:58:33 2016 +0100 - presence : add min_expires param + lib/trie: init variable to get rid of compile warnings - some UAs send very low values for subscriptions causing unwanted flooding of the server with subscribe/notify messages - this new parameter allows to set a minimum value for the subscription. - default value is 0 to preserve existing behaviour + (cherry picked from commit 5075cef8230202138bf08c402797d9dffcb8971d) -commit b06626e811edae93c5f28dc132eca7542a6dcc97 -Author: Mikko Lehto -Date: Tue Feb 10 09:57:31 2015 +0100 +commit b28b3d27597b898add46051f24120f833b035d3d +Author: Daniel-Constantin Mierla +Date: Sat Mar 26 11:26:29 2016 +0100 - sctp: fixes for FreeBSD 10.1 compile error and 2 warnings + ndb_redis: safety check for log message parameters - - missing argument for macro SCTP_EV_REMOTE_ERROR() and two extraneous - parentheses + (cherry picked from commit 0a51e8c941b1c916137eb3e57fa7db86ecb9a1f8) -commit 44b20f67e925ae2ba30f8bb16402dd2f5ec48b66 -Merge: a8783c0 fdb4c77 +commit 6a65b9ae0432491a1bcf540643f7b90cbc0c3ad1 Author: Daniel-Constantin Mierla -Date: Mon Feb 9 22:51:30 2015 +0100 +Date: Sat Mar 26 11:22:32 2016 +0100 - Merge pull request #70 from jda/master + dispatcher: proper check for ds active ping variable - fix compile errors in srutils/sha256 on SunOS (SmartOS) + (cherry picked from commit cafb1522b2c27aae404d97fe242324423ccdb99b) -commit a8783c033c8e00f57e9d3a5b074d0bb820a34cd6 -Merge: d60f014 91b3d9b -Author: Camille Oudot -Date: Mon Feb 9 16:41:58 2015 +0100 +commit 410bdba67ec77e87d2ff53f429bc260c03b10317 +Author: Daniel-Constantin Mierla +Date: Sat Mar 26 11:18:36 2016 +0100 - Merge pull request #73 from kamailio/coudot/rtpengine_pv_sdp + crypto: safety check for memory allocation and free on error cases - New parameter to return SDP in a pv instead of message body + (cherry picked from commit 181c3cfa266ec5897cc2fdd889d90928f90fcbb8) -commit 91b3d9b9483b488b8e18f45372c0e11b320b6d86 -Author: Camille Oudot -Date: Mon Feb 2 17:16:07 2015 +0100 +commit 4080d31080b5ad74504715b404e0829be090c731 +Author: Daniel-Constantin Mierla +Date: Sat Mar 26 11:11:25 2016 +0100 - modules/rtpengine: README update + cnxcc: use pkg-config for libevent compile flags + + (cherry picked from commit fa0d3267890e77a5184490d11f76fe4cb400e2df) -commit e6252246ea8056e06115d82a57372c8f241164a2 -Author: Camille Oudot -Date: Mon Feb 2 17:09:07 2015 +0100 +commit a45f580174ee5b21746e5e0172c55fccb421d25d +Author: Daniel-Constantin Mierla +Date: Sat Mar 26 10:23:02 2016 +0100 - modules/rtpengine: return the new SDP in an AVP + cnxcc: use pkg-config for hiredis lib compile flags - if the new module param `write_sdp_pv` is set to a valid $avp() or $var() - specifier, the SDP returned by rtpengine in the offer/answer operations is - returned in the specified pv instead of the message body + (cherry picked from commit 162ccdaeeb6bff185f49b3dc2e2b9b43687ec0fc) -commit d60f014e7aa1865cda4441b1560b4fb0d8aaae3c -Author: Olle E. Johansson -Date: Sun Feb 8 22:17:29 2015 +0100 +commit b04d257acd0dddd87051266493a81b93210de3bc +Author: Daniel-Constantin Mierla +Date: Sat Mar 26 11:05:26 2016 +0100 - sl remove SVN ID and history + ndb_redis: fix for broken output of pkg-config for hiredis + + (cherry picked from commit 4a40dd39cec713c569dc3480c905d808026aad39) -commit 15ab2ed22070b3483cc2de7652fb54a38ae8faf6 -Author: Victor Seva -Date: Sat Feb 7 18:33:36 2015 +0100 +commit b53bf975bddf16424d7b6416276371e12cf590f4 +Author: Daniel-Constantin Mierla +Date: Sat Mar 26 08:44:16 2016 +0100 - pkg/kamailio/deb: enable reproducible builds + ndb_redis: use pkg-config for compile flags + + (cherry picked from commit 57bcad1b336e7aae5c0933a83ac4ab16f6893896) -commit a5b3c63684cabc7293b1667416448094fb15cbb2 -Author: Victor Seva -Date: Sat Feb 7 17:54:26 2015 +0100 +commit 7423c33bfb56268bfa9cb3c03966c37c9a2d7d69 +Author: Daniel-Constantin Mierla +Date: Thu Mar 24 09:21:00 2016 +0100 - pkg/kamailio/deb: easier way to set CC_EXTRA_OPTS and LD_EXTRA_OPTS + dispatcher: coherent indentation and whitespacing + + (cherry picked from commit 1d401e0a9b4c3010c32b0084ec6a218fc46e4f78) -commit 6fcfc18c7de2ba5530905c2dc03941312e29b47c -Author: Olle E. Johansson -Date: Sat Feb 7 14:35:44 2015 +0100 +commit e8f230e7989eb0aef2510f52738e8718863b8567 +Author: Daniel-Constantin Mierla +Date: Wed Mar 23 16:08:48 2016 +0100 - qos Remove SVN ID, remove history + kamctl: refreshed definition of location table + + (cherry picked from commit 2ddf88df7deeebf2966344031eb905811b8e86cb) -commit de2596d518bae15e379342ee53bbc1632d0f90a1 -Author: Olle E. Johansson -Date: Sat Feb 7 14:26:02 2015 +0100 +commit d11cc80c3a4a2fdeb446837c550517e4f4a511a9 +Author: Juha Heinanen +Date: Wed Mar 23 16:32:06 2016 +0200 - dialog Document dependency on the PV module + srdb1/schema: removed unique constraint from connection_idx + + (cherry picked from commit d72ac166b152ca6906248d67e2605d5b283fa01e) -commit 2c6ad972426d4733202168d65bcdf2d37ef0934b +commit eee6382b683349395004627e7ebc5a7ae9216024 Author: Olle E. Johansson -Date: Sat Feb 7 14:21:42 2015 +0100 +Date: Wed Mar 16 15:01:08 2016 +0100 - websocket Document dependency on the TM module + http_client Adding support for HTTP proxy on a connection and default level + + Addresses issue #541 + + Documentation coming in separate commit -commit 8c2025c4072bd8da08fafbbf42f12fb5a7e30ab0 +commit 26026da13f76ffcea34d1482b925979e520631ad Author: Victor Seva -Date: Sat Feb 7 09:55:03 2015 +0100 +Date: Mon Mar 21 22:23:44 2016 +0100 - pkg/kamailio/deb: update version to 4.3.0~dev4 + pkg/kamailio/deb: update version to 4.4.0-rc1 -commit cd58d9eafc18edcc6a719d76cd1dbe252d88ae91 -Author: Olle E. Johansson -Date: Fri Feb 6 22:38:17 2015 +0100 +commit 16c087b459f9394723714ae597aa0d90fb12389c +Author: Daniel-Constantin Mierla +Date: Mon Mar 21 17:22:55 2016 +0100 - mohqueue Do not declare variables in middle of function, do error checking on all modparams possible before exit, add \n att error messages + Makefile.defs: version set to 4.4.0-rc1 -commit 589bd01f027122d56bdf5c1f384523f7e8f5abf8 -Author: Olle E. Johansson -Date: Fri Feb 6 22:20:27 2015 +0100 +commit ff3857597627fd4f650fbf53be60b7d5ad2a4543 +Author: Daniel-Constantin Mierla +Date: Mon Mar 21 17:09:51 2016 +0100 - xmlrpc Add dependency of SL to docs + topos: propagate via branch from receive to send event + + - identify properly the branch + + (cherry picked from commit 787c41c08eae9f9431f792ec616530145f66cc3c) -commit 326ccd52286c60758f98062f1499f26074097b13 -Author: Olle E. Johansson -Date: Fri Feb 6 22:13:37 2015 +0100 +commit a5a08f40481c2bdd2de200e6504dd0c330361bef +Author: Daniel-Constantin Mierla +Date: Mon Mar 21 14:46:23 2016 +0100 - tsilo Document dependency on SL module + kamctl: db script with larger topos fields + + (cherry picked from commit f8b9bbdcb95575b90bd75dba71b6117c76127bc1) -commit e03d1279f49709e0d320478fa1ff7c27161c30ed +commit 9acf49bc944b6c5ec1010087963b847bffd4dee4 Author: Daniel-Constantin Mierla -Date: Fri Feb 6 19:23:51 2015 +0100 +Date: Mon Mar 21 14:45:52 2016 +0100 - core: compile options to skip compile date or set a particular value + lib/srdb1: tags fields made larger - - default is current behaviour, date and time included in version string - - compile with no date and time: - make CC_EXTRA_OPTS="-DVERSION_NODATE" - - compile with a specific date and time: - make CC_EXTRA_OPTS='"-DVERSION_DATE=\"19:30:40 Feb 8 2015\""' + - store more fields for branch + + (cherry picked from commit 9eaca5332e4b6be9f2437806b47ef1077eb57959) -commit ad76e342a8235e4a752593dd5fab5b676a89425a -Author: Luis Azedo -Date: Fri Feb 6 17:29:25 2015 +0000 +commit ed0c8ed358883974775e00597cc06f61ca20b89c +Author: Daniel-Constantin Mierla +Date: Mon Mar 21 14:24:25 2016 +0100 - kazoo : revert uuid include + kamctl: further updates to topos db scripts + + (cherry picked from commit fedf9e8875791ff53188fb812a6d97aae9b1ceba) -commit 2977e98f6f19087cb4f755542b032f821c22f748 +commit 3470856a34b97526e848d0004cd643e198dac05f Author: Daniel-Constantin Mierla -Date: Fri Feb 6 17:32:57 2015 +0100 +Date: Mon Mar 21 14:23:35 2016 +0100 - Makefile.defs: versions set to 4.3.0-dev4 + lib/srdb1: fields for local sockets + + - replace src ip with full address column + + (cherry picked from commit 4efc9b3730e15f9e9f2274a8dfee59d76e5ecabd) -commit be279d8c388bd461ccc935d6dd62d6b20656be18 -Author: Victor Seva -Date: Fri Feb 6 17:25:48 2015 +0100 +commit 6f6b932bed271b9c677b57cfd6159db7c10f3dfb +Author: Daniel-Constantin Mierla +Date: Mon Mar 21 14:18:49 2016 +0100 - Makefile.group: add tcpops to basic group + topos: filling field for server record route values + + (cherry picked from commit dc4306e4e201d2cfbe5cc76698e8c7c3ec06d44a) -commit 5113c047d353724d1a6f5a204e5a895ff1dd519a -Author: Luis Azedo -Date: Fri Feb 6 16:08:54 2015 +0000 +commit 417c54b3e0f9b9929c7c34c6ebffb6f753b33fa1 +Author: Daniel-Constantin Mierla +Date: Mon Mar 21 11:40:04 2016 +0100 - kazoo : fix memset size error & includes + topos: don't detect direction based on route header ftag + + - the local server header is not re-added yet - kz_trans was calling memset with wrong size of structure - kx_amqp was including uuid.h from uuid directory + (cherry picked from commit ca4494d465eaec8c544f61e9034147387c861688) -commit 927de0d6fc0ab75212ae177c871085bdcc0115e2 -Author: Camille Oudot -Date: Fri Feb 6 12:26:07 2015 +0100 +commit a599f7ec14fc244d0cf2dd7545233538ce4879ed +Author: Daniel-Constantin Mierla +Date: Mon Mar 21 11:32:08 2016 +0100 - modules/tcpops: renamed functions to prevent conflicts + topos: split storage of record route for a, b and server sides + + (cherry picked from commit a215b926e3f1df0f2aca2f86e5ad1e3c9dde3796) -commit 5193ff25446ba6de8ee9c2fcaa82d402e4262075 -Author: Camille Oudot -Date: Wed Feb 4 15:59:30 2015 +0100 +commit c887f1a84a2755cae122bfc3887a2857fe986c29 +Author: Daniel-Constantin Mierla +Date: Mon Mar 21 11:01:53 2016 +0100 - modules/tcpops: new module to tweak TCP options + kamctl: updates to topos db scripts - This module adds the ability to control TCP options (currently only keepalive) - through the kamailio cfg, on demand, and on a per-socket basis. + (cherry picked from commit 6497b9a562386aeae47c0aaa10d09418269c6d8d) -commit ff114281fc2f523ed7bf87ea31448ce7327fdf93 -Author: Charles Chance -Date: Fri Feb 6 10:59:35 2015 +0000 +commit a67eed2e587ad8ed04c9069f188155ba62ddf093 +Author: Daniel-Constantin Mierla +Date: Mon Mar 21 11:01:11 2016 +0100 - dmq: add branches when replicating to multiple nodes + lib/srdb1: dbschema - split record route storage - - reported by Leonardo Arena + (cherry picked from commit d43986940878962a35883370a14f4330d2fd597a) -commit fdb4c7758f0d6d6ebed8cf9d01a412ed024efb8b -Author: Jon Auer -Date: Thu Feb 5 23:34:59 2015 +0000 +commit bea13a3ea4362a1f99a81b948c7839e2dbaedfe7 +Author: Daniel-Constantin Mierla +Date: Fri Mar 18 18:05:02 2016 +0100 - fix compile errors in srutils/sha256 on SunOS (SmartOS) + topos: added missing params to docs + + (cherry picked from commit 956b5ae838b0627710473a15746ffd2cd96dfbc0) -commit f9c248a66fdca5317e8820e53f1a0f99cd58ef8a -Author: lazedo -Date: Thu Feb 5 22:34:32 2015 +0000 +commit 0a3174f9c6f8f9819c1c92e3e83ee3ca7502f19e +Author: Daniel-Constantin Mierla +Date: Fri Mar 18 17:20:00 2016 +0100 - kazoo : less agressive log + topos: don't store dialog data for message request + + - only branches are enough - changed log from INFO to DEBUG when timeout is set + (cherry picked from commit 7993b4a7cf7281bc99bf1bae3777f3f0d18b24b1) -commit 7da783ac03329f4934d36c9a574bb2cd44019688 -Author: Jason Penton -Date: Fri Feb 6 00:25:35 2015 +0200 +commit c5336e36179a25dec1dd37804af79e12d0274a8a +Author: Daniel-Constantin Mierla +Date: Fri Mar 18 16:52:24 2016 +0100 - modules/cdp: added new counter(stat) for worker queuelenght - - this will give an indication that workers are not - keeping up with load if it gets too big + topos: shortcut to handle forwarded MESSAGE replies + + - no dialog created there + + (cherry picked from commit 6885748a5146d4531a0e235e67621df49df67d97) -commit 45c3dbee619f999ddafc79a88d1a49141b76fa9f -Author: Olle E. Johansson -Date: Thu Feb 5 21:18:07 2015 +0100 +commit d9dbd6f1ea43f566ef161794e1da9d49f069a1ca +Author: Daniel-Constantin Mierla +Date: Fri Mar 18 16:43:14 2016 +0100 - libkcore Disable checking of /proc files on non-linux systems + topos: MESSAGE may be without Contact header + + (cherry picked from commit 1c7f39389225ef5c1430bb8540b6fd9c249734bb) -commit ea93f1c6da68943fc71de07d9c45c74af697acb3 -Author: Olle E. Johansson -Date: Thu Feb 5 21:11:52 2015 +0100 +commit 0df89ce099641607ba38f2ce99061c6209babcda +Author: Daniel-Constantin Mierla +Date: Fri Mar 18 16:05:18 2016 +0100 - ratelimit Document dependency on sl + topos: no processing needed for 100 responses + + (cherry picked from commit 98f927149c2f6865dd6b709f4a3bb7be77e57f5c) -commit cc0b483499eabb6f8794098aaf7bc85155f1348a -Author: Olle E. Johansson -Date: Thu Feb 5 21:03:22 2015 +0100 +commit fa2f3ddc188d758d588177e254b1fcacdecc9bbd +Author: Daniel-Constantin Mierla +Date: Fri Mar 18 15:19:18 2016 +0100 - pipelimit Document dependency on the sl module + topos: cseq number and method linked to db - Closes issue #69 + (cherry picked from commit f591b7e0b0c71648a9ac62dd9604955d7c2acb75) -commit 3ee47957201cb5cc2824a82a94832a526aba0ccb -Merge: 0c3925e a593d8d -Author: Luis Azedo -Date: Thu Feb 5 19:35:48 2015 +0000 +commit 324a2cc72d260fa4f925198670373e7a36929167 +Author: Daniel-Constantin Mierla +Date: Fri Mar 18 15:15:57 2016 +0100 - Merge branch 'master' of https://github.com/kamailio/kamailio + kamctl: refreshed topos db scripts - # By Jason Penton - # Via Jason Penton - * 'master' of https://github.com/kamailio/kamailio: - modules/cdp: changed stats to use internal counters instead + (cherry picked from commit eb1e8e2ff46a1ecac81b05985dc09a37036ce1ab) -commit 0c3925e6f787c6e8d2e1bc7a45fec0c99ba203d8 -Author: Luis Azedo -Date: Thu Feb 5 19:35:37 2015 +0000 +commit 97212998731cc849a1ce64c21c4def4f65a64668 +Author: Daniel-Constantin Mierla +Date: Fri Mar 18 15:15:21 2016 +0100 - kazoo : timeout fixes & improvements + srdb1/schema: cseq stored as string for topos - 1) fixes names in parameters (timout corrected to timeout) + - no conversion from sip header - 2) kazoo_query was always using the same timeout value which could be a problem, since there are different kinds of request and some may be given more time to process. - solved by adding amqp_query_timeout_avp parameter to allow usage of different timeouts. + (cherry picked from commit 0dd9c526f762974ceb397cc2c7862fa7ff122ebf) -commit a593d8ddb5026bde0702eaa6b088bda639411c1e -Author: Jason Penton -Date: Thu Feb 5 16:52:46 2015 +0200 +commit 66387d3c6a425f1b4c2123dc3397351af8d9d616 +Author: Daniel-Constantin Mierla +Date: Fri Mar 18 14:58:27 2016 +0100 - modules/cdp: changed stats to use internal counters instead + topos: store method and cseq for dialogs and branches + + (cherry picked from commit c2e404b82f20a12b5909bbf610cbfb7f5d101c12) -commit 1b262d1ffd768717f9865525f29a65a2bea8577d -Author: Jason Penton -Date: Thu Feb 5 16:52:46 2015 +0200 +commit 40eca4ba61b8f068e5f9869ae86ea5a57c777096 +Author: Daniel-Constantin Mierla +Date: Fri Mar 18 14:08:53 2016 +0100 - modules/cdp: changed stats to use internal counters instead + kamctl: updated scripts for topos db + + (cherry picked from commit c8d25c34d8efa5c6e40fb26d523a9d4e5d66595c) -commit 23b4d93b9f8838298c7368d3efe8dae964426b50 -Author: Jason Penton -Date: Thu Feb 5 13:51:55 2015 +0200 +commit 46176217c8a6e61b353045243865b5f9e0e9f741 +Author: Daniel-Constantin Mierla +Date: Fri Mar 18 14:08:26 2016 +0100 - modules/dialog_ng: changed stats to use native counters instead - - suggested by Olle + lib/srdb1: topos schemas extended to store method and cseq + + (cherry picked from commit c8fb903b9649fc8ef49a1bfff455e58b2265d05a) -commit 790b42c8485672866919180992d1ee246422b87e -Author: Jason Penton -Date: Thu Feb 5 13:51:55 2015 +0200 +commit 22195053b664d20f4eea78a5bbf228f587a5eab4 +Author: Daniel-Constantin Mierla +Date: Fri Mar 18 13:23:06 2016 +0100 - modules/dialog_ng: changed stats to use native counters instead - - suggested by Olle + dialog: force cleanup of aged terminated dialogs + + - reported by Dmitri Savolainen, GH #545 + + (cherry picked from commit 23a3481302d5aca04be0e8d10f6d4ce23dbc36aa) -commit 280c3ee90c24d183b7866ea28804e71de7d0a5ab -Author: Jason Penton -Date: Thu Feb 5 13:51:55 2015 +0200 - - modules/dialog_ng: changed stats to use native counters instead - - suggested by Olle - -commit 2c4ed5922a2322f3b5059f6264884acfb5dec97f +commit 03862d7b6057ef08146cfea5ffe9debff35263ea Author: Daniel-Constantin Mierla -Date: Thu Feb 5 11:26:34 2015 +0100 +Date: Thu Mar 17 22:56:41 2016 +0100 - core: safety check for append_branch() when called with no uri and no msg + xhttp_rpc: added notes about how to use the module - - uri or msg parameter must be given, otherwise the new address cannot - be set - - get_redirects() from uac_redirect can execute this function with both - parameters invalid in case of invalid contact, reported by Javi - Gallart - -commit 8caaeff0a82db141e40e118597f667bcb01f1fbe -Author: Jason Penton -Date: Thu Feb 5 11:51:18 2015 +0200 - - modules/ims_charging: release S-CSCF contact (unref) after use - - failing to do this results in contact never being freed + (cherry picked from commit 68cbac03d95893f4f27b46a37233cf796a7484d9) -commit c22dfcd6359079f9ea3600bfeb31fe5edbf4f8b1 +commit 79940803b2a631b21bb851a6380b16806ce31981 Author: Daniel-Constantin Mierla -Date: Wed Feb 4 18:30:05 2015 +0100 - - core: removed log message used for troubleshooting - -commit f51f81c43419891c25b1d77cf0a9fd417989f390 -Author: Olle E. Johansson -Date: Wed Feb 4 18:28:37 2015 +0100 - - ratelimit Only output error message five times +Date: Thu Mar 17 22:47:02 2016 +0100 -commit 1dac6708935dafce2ff6398f98cce97ab5a56f4d -Author: Olle E. Johansson -Date: Wed Feb 4 18:27:14 2015 +0100 - - pipelimit Only output error five times - -commit 7225ab2c9a3f5524eabdbd729f2fd9c3fafbc56a -Merge: ea16d3c 44cc150 -Author: Olle E. Johansson -Date: Wed Feb 4 16:38:25 2015 +0100 - - Merge pull request #68 from linuxmaniac/vseva/corex_doc + pipelimit: set array result tipe for rpc commands - Corex: fix documentation of min_msg_len + - rpc stats and get pipes can return more than one item - Code and docs did not agree on the name. - -commit 44cc1508c32d8ffbf4fb56b487f6a2de494749c4 -Author: Victor Seva -Date: Wed Feb 4 16:33:25 2015 +0100 - - corex: regenerate README + (cherry picked from commit 1c22f395df81dab09288ff945e97b0040894daaf) -commit f31451996701d2183456c889bf37bf4ab9827b42 -Author: Victor Seva -Date: Wed Feb 4 16:31:45 2015 +0100 - - corex: fix parameter min_msg_len documentation. Closes: #65 - -commit ea16d3c0af778d12353ae78646e5d6c59a117ebb -Author: Victor Seva -Date: Wed Feb 4 16:02:31 2015 +0100 - - call_control: regenerate README - -commit ae487ac92d21c50cb805807bd6b24261903accac -Author: Victor Seva -Date: Wed Feb 4 15:57:06 2015 +0100 - - call_control: document pv module dependence. Closes #37 - -commit 9876a9cd1fbb66bbce3f01f015a52bf331deee59 -Author: Charles Chance -Date: Wed Feb 4 12:09:25 2015 +0000 - - dmq: fix indentation - -commit 436363806e61b4720c15d3cb559114b677904a01 +commit 3b0308db6e46b45a564975b9d49640f1454ce1d5 Author: Daniel-Constantin Mierla -Date: Tue Feb 3 21:34:31 2015 +0100 +Date: Tue Mar 15 12:40:09 2016 +0100 - usrloc: use defined OP_NEQ for sql not-equal operator + ims_registrar_pcscf: remove duplicate implementation and use _strnistr() from core + + (cherry picked from commit 331ab29e77e178067a23291bd20638201ba9b393) -commit 89d178f6bddb20f2599b7b3816646f83f03d2098 +commit c2dfad3ee3b5bd766f1c5fd2a35780472039ae54 Author: Daniel-Constantin Mierla -Date: Tue Feb 3 20:16:12 2015 +0100 +Date: Tue Mar 15 12:39:45 2016 +0100 - Makefile.groups: geiop2 module added to a dedicated group + sdpops: reuse _strnstr() from core instead of own implementation - - its dependency is not yet in commond stable OS distributions + (cherry picked from commit e69c3284231917f5c63871842b6ce6ab37b419eb) -commit f3ae358e937f4df6f0ee28e8d5df16f4245ae4b8 +commit 48136b5dc0a2a082621c828438371504e0a636b6 Author: Daniel-Constantin Mierla -Date: Tue Feb 3 18:48:42 2015 +0100 +Date: Tue Mar 15 12:39:16 2016 +0100 - db_mongodb: build proper complex filters for db operations + tm: _strnstr() moved to core - - handle ==, != (<>), >, <, <=, >= - - bitwise AND (&) not supported - -commit ea7c58fd9bf159ca95438c2e25cb64fb63b7c6f6 -Author: Richard Good -Date: Tue Feb 3 19:18:40 2015 +0200 - - modules/ims_charging: added sql script to create ims_charging tables + (cherry picked from commit 4910ddf9eebb8fa5106300b9e684ecb67fb2d225) -commit 3bc031def2caed8ffb0d2d251690cf4b7375ef77 +commit 9b9989a0c6fea5860313ccde90055bbaa69cdc6c Author: Daniel-Constantin Mierla -Date: Tue Feb 3 16:34:48 2015 +0100 +Date: Tue Mar 15 12:38:46 2016 +0100 - Makefile.groups: added geoip2 module to geoip package group - -commit cdba71eac05bbaffce282d0a0c1aaf3e74771312 -Author: Sergey Okhapkin -Date: Tue Feb 3 16:32:03 2015 +0100 - - geoip2: new module exporting geoip API to configuration file + topos: use _strnstr() from core instead of strnstr() - - uses the latest version of maxmind API/library - - has support for IPv6 - - can be used instead of geoip module - -commit 2b2e81b83182418788d2ca70715e032559dd96a1 -Author: Richard Good -Date: Tue Feb 3 17:10:02 2015 +0200 - - modules/cdp: fixed earlier commit set cdp session to 0 when free-ed - -commit 7229d3307091f81b84a4be7a3a8c81a027aff95c -Author: Jason Penton -Date: Tue Feb 3 16:48:57 2015 +0200 - - modules/cdp: add custom AVP to transport Call-ID in diameter requests - -commit 9af85280411b831317257fd23297880267f1ce03 -Author: Jason Penton -Date: Tue Feb 3 16:46:26 2015 +0200 + (cherry picked from commit f5d4446dae8db02e6d4136724f85baed65f7bf4a) - modules/ims_registrar_scscf: new function term_impu_has_contact - - Use this function to check if an IMPU has a valid contact - -commit 9e25ba70afb7dee4da55aadb9d7a1a39c61cbedf -Author: Jason Penton -Date: Tue Feb 3 16:42:05 2015 +0200 +commit 2dcf15e18f7aa4842091c14c360e2ee1694ed9dc +Author: Daniel-Constantin Mierla +Date: Tue Mar 15 12:37:37 2016 +0100 - modules/ims_usrloc_pcscf: add slot id to storage + core: _strnstr() and _strnistr() defined in core + + - alternative to strnstr() which is not in all OSes, pluse the + insensitive option + + (cherry picked from commit 7772e14fc298956f57429a67ea4524818b22a158) -commit aa4c31091118cb176a06c0bccb12af72f4884543 -Author: Jason Penton -Date: Tue Feb 3 16:29:05 2015 +0200 +commit 50df69df2b7a5307802f6dcaac9b90acfbe2b44d +Author: Daniel-Constantin Mierla +Date: Fri Mar 18 13:32:59 2016 +0100 - modules/dialog_ng: added support for active and early dialog stats + core: parse content type allows '_' char + + - reported by Fabio Margarido, GH #547 + + (cherry picked from commit b65927a8f6039810ffdb7b7f31ce2d36c9535fbd) -commit e7514fde047a8616cea49db76efdc6c98e92030f -Author: Jason Penton -Date: Tue Feb 3 16:16:33 2015 +0200 +commit 2271e6bdaf2916d1c50d367d09041b2d6142a09d +Author: Ovidiu Sas +Date: Mon Mar 14 17:07:46 2016 -0400 - modules/ims_charging: fixed up some locking problems - - could result in unexpected behaviour and even seg faults + modules/topos: fix warning: variable "ptsd" set but not used [-Wunused-but-set-variable] + + (cherry picked from commit f50c712f401f50b8ca36addbd8440f418a9b266f) -commit fef6e02c0911149ef8622ee018e5a3764bf16a28 -Author: Richard Good -Date: Tue Feb 3 16:02:09 2015 +0200 +commit 3ef987c3230bb76f0eb1dea35998866271c93f31 +Author: Ovidiu Sas +Date: Mon Mar 14 17:03:30 2016 -0400 - modules/cdp: set CDP session to 0 after free-ing + modules/topos: fix warning: comparison between pointer and integer [enabled by default] + + (cherry picked from commit b4d1206fd50bb61d1ad9ff4ed500157105b140b6) -commit 7bcf8732b2863e0ee572493e3a18bd6a2f6c4a48 -Author: Andrey Rybkin -Date: Tue Feb 3 09:24:22 2015 +0300 +commit 0977d5a392b4c9236fa1334141df640d10aa1cb9 +Author: Ovidiu Sas +Date: Mon Mar 14 16:59:41 2016 -0400 - dmq: checking already parsed msg + modules/topos: fix warning: label "ready" defined but not used [-Wunused-label] -commit a902ae16a85b556d1d4e0d5f60bc270e8452bce5 -Author: lucian balanceanu -Date: Mon Feb 2 14:02:53 2015 +0200 +commit 73313e6296cfc81c1dc8167845ee8fd3d0397a73 +Author: Emmanuel Schmidbauer +Date: Mon Mar 14 17:17:03 2016 +0100 - rtpengine: moved set_rtp_inst_pvar function call + permissions: fix memory leak + + - free ruri_pattern from trusted struct in empty_hash_table() - - moved set_rtp_inst_pvar function call so that it records the last - successful rtpengine destination versus the last attempted one. + (cherry picked from commit 93fd86c882fd82f4277a80322dd729c2dc0370a0) -commit 6423b65f8272ad216970b533432f8ebafafdb72c -Author: Vicente Hernando -Date: Mon Feb 2 12:07:24 2015 +0100 +commit 734531b733a1983a718594b568f956f676d3ace3 +Author: Daniel-Constantin Mierla +Date: Mon Mar 14 14:37:01 2016 +0100 - ndb_redis: README file update. + uac: reset append to rr string var to avoid double free in case of error + + - reported by Fred Posner, GH #543 + + (cherry picked from commit 6a362f032bdf5cf73dd3960e88bfb06dfb72bb85) -commit c87641607a85e7e3a2942f8bd90948cb781942d5 -Merge: 4729d16 8d87206 +commit 84d73b950f3ec13fe5f5345a4440d0909e30fff4 Author: Daniel-Constantin Mierla -Date: Mon Feb 2 11:26:46 2015 +0100 +Date: Mon Mar 14 11:39:55 2016 +0100 - Merge pull request #62 from marcantonio/redis_auth + tsilo: lock before linking var to the entry in slot + + - entry points to the address of first entry, which can be updated + before aquiring the lock - Add authentication option to ndb_redis + (cherry picked from commit 8ae2713477027a229ae4ee7045557151e467aff3) -commit 4729d163b378e1ec941ceff21e81e2595cc0756c -Author: Eloy Coto -Date: Mon Feb 2 03:51:26 2015 -0500 +commit b80163a38a2d5bacad0bbfe47810de052dfe7f7d +Author: Victor Seva +Date: Fri Mar 11 09:21:01 2016 +0100 - Statsd: fixes #34 Change log messages and fix not properly terminated messages + pkg/kamailio/deb: version set to 4.4.0-rc0 -commit bd73d7afabdab97c09464c3917506bbbaf89755c -Merge: 3ae78d8 9b0ce4d -Author: Andrey Rybkin -Date: Mon Feb 2 09:31:26 2015 +0300 +commit 8e07e229d3bbd245a5ce3f67d73faf128dcf4ac2 +Author: Victor Seva +Date: Fri Mar 11 09:18:59 2016 +0100 - Merge pull request #59 from kamailio/AndreyRybkin-dmq - - dmq: fix memory leak + pkg/kamailio/deb: version set to 4.4.0-pre3 -commit 8d87206c372e2cb5212c5c105c882f0698c26c43 -Author: Marc Soda -Date: Fri Jan 30 17:19:21 2015 -0500 +commit 80aae34215d6e2a62573ae6a76edba0d4ae62191 +Author: Daniel-Constantin Mierla +Date: Fri Mar 11 08:32:18 2016 +0100 - Add authentication option to ndb_redis. + Makefile.defs: version set to 4.4.0-rc0 + + - branch for release series 4.4.x created -commit 3ae78d88678a64fe59a925c8e3e257e046464c97 -Author: Charles Chance -Date: Fri Jan 30 16:27:29 2015 +0000 +commit a5c25822ba44c6102c871a7e8d32bf7f7746a805 +Author: Daniel-Constantin Mierla +Date: Fri Mar 11 08:24:29 2016 +0100 - Revert "dmq: do not parse From header again, since it was done already prior to cloning msg." - - This reverts commit 102504294f9edaaee9d4baea873d4ed9151b8fed. + Makefile.defs: version set to 4.4.0-pre3 -commit 4a316c1b00524311e422762521c65570a2f4bf0e -Merge: 9e48df9 1025042 -Author: Jason Penton -Date: Fri Jan 30 16:45:24 2015 +0200 +commit 0ab124af340cf01ceb46cb5d8f8acbf69dea3a95 +Merge: 9b4c0c2 313a5db +Author: Daniel-Constantin Mierla +Date: Fri Mar 11 01:26:40 2016 +0100 - Merge branch 'master' of github.com:kamailio/kamailio + Merge pull request #540 from linuxmaniac/vseva/mysql_warning - Conflicts: - modules/tm/t_suspend.c + db_mysql: change log level from WARN to INFO for ping checks -commit 9e48df9226b63aa8ba5232f6e02e8ba6038f1fe0 -Author: Jason Penton -Date: Fri Jan 30 14:53:18 2015 +0200 +commit 9b4c0c29319c008d6ae6bedb8b657150dc5ca64d +Author: Daniel-Constantin Mierla +Date: Fri Mar 11 01:18:46 2016 +0100 - modules/tm: no reason to reset KR on continuation of async requests - - maybe before continuing, a reply has been sent, request forwarded, etc... + topos: restore headers on receiving response -commit 102504294f9edaaee9d4baea873d4ed9151b8fed -Author: Charles Chance -Date: Fri Jan 30 14:08:01 2015 +0000 +commit 11fc3e2015e0d0247bb6c0a7dfd3157efba20d5b +Author: Daniel-Constantin Mierla +Date: Thu Mar 10 23:39:47 2016 +0100 - dmq: do not parse From header again, since it was done already prior to cloning msg. - - - introduces a memory leak if not manually freed - - but there is no need to parse it again anyway - - discovered by Andrey Rybkin + topos: load and pack db dialog data -commit 4ba9ee6bff2fc74188c058f71240f1e128717588 -Author: Jason Penton -Date: Fri Jan 30 14:53:18 2015 +0200 +commit a741f797a5631a11191054cdb5559e246cc2face +Author: Daniel-Constantin Mierla +Date: Thu Mar 10 23:27:05 2016 +0100 - modules/tm: no reason to reset KR on continuation of async requests - - maybe before continuing, a reply has been sent, request forwarded, etc... + topos: load and pack db branch data -commit 25d66de2e35f871686b0b819af3641371c6ef865 -Author: Carsten Bock -Date: Fri Jan 30 13:05:02 2015 +0200 +commit 9950e67d476e7310573ddc01c83aa1280e020fb0 +Author: Daniel-Constantin Mierla +Date: Thu Mar 10 21:46:03 2016 +0100 - Update README for ims_qos + kamctl: refresh of db creation scripts -commit 461aad8cae845b8875e961ed3068d9c762d973a8 -Author: Carsten Bock -Date: Fri Jan 30 13:02:19 2015 +0200 +commit 9f185fd22abcd4963a74ecb2c909ea5108573bda +Author: Daniel-Constantin Mierla +Date: Thu Mar 10 21:45:15 2016 +0100 - Add Bandwidth AVP to Rx-Requests as per 3GPP TS 29.213 + lib/srdb1: dbschema - keep branch side rr and uri for topos -commit 85d3488c3910d447f6900df166bc6b0c16a64e9c +commit becedd0b35f0edeb7e8dfaaeef18e37fc5f36593 Author: Daniel-Constantin Mierla -Date: Fri Jan 30 08:15:58 2015 +0100 +Date: Thu Mar 10 21:00:57 2016 +0100 - sl: re-attempt to bind to tm after all mods init - - - handle the situation when tm is initialized after the sl module - - re-binding is done on child callback with rank PROC_INIT + topos: clean expired records on timer -commit 1d3b89b10bfd825e4ca73bb95b0ae489843dd9f1 +commit ebd47e445ba03b6620408593a422652448f025e0 Author: Daniel-Constantin Mierla -Date: Fri Jan 30 07:54:52 2015 +0100 +Date: Thu Mar 10 20:24:50 2016 +0100 - db_mysql: restore group ending character in db url - - - ] was set to \0 to use it for mysql options, but it will break - matching the db url for connection pooling - - reported by Juha Heinanen + topos: keep branch of new new via in dedicated field -commit e59db798b84f1641f807d216c2ca460cfedb31e7 +commit 50f6aa51697387da24bd4cef02345383822066a9 Author: Daniel-Constantin Mierla -Date: Thu Jan 29 21:46:43 2015 +0100 +Date: Thu Mar 10 20:20:16 2016 +0100 - lib/srdb1: init columns array to 0 - - - allows proper cleanup if there is an error while filling the items + kamctl: regenerated db script files -commit 83caaabd4725b46d60577280ced436bb9638c80f -Author: lucian balanceanu -Date: Thu Jan 29 19:23:26 2015 +0200 +commit b250d9ca8f562a82bf3e26acfb47b56898d2a01b +Author: Daniel-Constantin Mierla +Date: Thu Mar 10 20:19:16 2016 +0100 - rtpengine: porting rtp_inst_pvar from rtpproxy - - - rtp_inst_pvar: pseudo variable to store the chosen RTP engine address + lib/srdb1: dbschema - split via branch in own column for topos -commit df2a45541c5e37907374c5e7595de1f30ea84f98 +commit e480a12aaa019676c479df3bc4f9a1ea70f7512c Author: Daniel-Constantin Mierla -Date: Thu Jan 29 10:45:52 2015 +0100 +Date: Thu Mar 10 19:15:06 2016 +0100 - sca: more error handling during initialization of the module - - - fix crash when the module doesn't initialize and calls destroy - function during shutdonw at startup - - reported by Olle E. Johansson, GH#57 + topos: link tags and contacts in msg -commit 8c3a12f6aca7c6492ee440da469834997ea89eee +commit 8502ebaf368580989ea0a1cf4246d3f19dde1733 Author: Daniel-Constantin Mierla -Date: Thu Jan 29 10:37:13 2015 +0100 +Date: Thu Mar 10 17:51:30 2016 +0100 - dialog: proper handling cseq increment when cseq header is before via - - - reported by Fernando Aquilino + topos: expire values for branches and dialogs can be set via params -commit 9b0ce4d0dd397e9708e3fde573804da61fd3d34e -Author: Andrey Rybkin -Date: Thu Jan 29 12:32:58 2015 +0300 +commit ca7827b2b4a55959fc366871b410131eedba75f6 +Author: Daniel-Constantin Mierla +Date: Thu Mar 10 17:48:14 2016 +0100 - dmq: fix memory leak + topos: cleanup expired dialog records -commit 010977f5febcf923a31d545bd631fbee11dd426c +commit 94863a7c42496d64157e6f89a8f3bbe24ffd2779 Author: Daniel-Constantin Mierla -Date: Wed Jan 28 22:09:21 2015 +0100 +Date: Thu Mar 10 17:46:19 2016 +0100 - sca: initialize sca variable to catch destroy on shutdown at startup - - - reported by GH#35 + topos: cleanup expired branch records -commit c28551cd245f5e8ab9fc5d5c29f657cc06ad81e2 +commit e895c000403139a628841eaab56127274012ca7a Author: Daniel-Constantin Mierla -Date: Wed Jan 28 22:02:02 2015 +0100 +Date: Thu Mar 10 17:32:43 2016 +0100 - userblacklist: init variables for safer destroy at startup - - - reported by GH#42 + topos: use datetime db type for record timestamp -commit 48a548df00b9efc9e6d467b05f7998d913d9b87a -Author: Olle E. Johansson -Date: Wed Jan 28 21:39:29 2015 +0100 +commit ed78ad87cdf5f9a0740388995f19638603d2c29b +Author: Daniel-Constantin Mierla +Date: Thu Mar 10 17:30:49 2016 +0100 - utils Remove SVN ID, remove history + topos: force use of db table always -commit dad18e39dcd1718735243032952051f76598df44 -Author: Olle E. Johansson -Date: Wed Jan 28 21:35:23 2015 +0100 +commit 4b9a3a7ae2a97c158a2adb3e0eecc6701ecd7781 +Author: Daniel-Constantin Mierla +Date: Thu Mar 10 17:24:52 2016 +0100 - cfg_db Remove SVN ID, history + topos: wrap for empty fields to db -commit f4e2938c80b86e9f146309bb40cf23a5f8f3f8d2 -Author: Olle E. Johansson -Date: Wed Jan 28 21:35:09 2015 +0100 +commit 9eaef8ad5b601bbc6e5e245431060355f39382f4 +Author: Daniel-Constantin Mierla +Date: Thu Mar 10 17:05:47 2016 +0100 - cfg_db README update + topos: persistent branch data storage -commit 8554f2b136d59cedc4b7d2d4bf4a268cc0f8690f -Merge: f734154 121842e -Author: Victor Seva -Date: Wed Jan 28 21:27:06 2015 +0100 +commit 5654079944fd4ac608b50e13436c508d4f261a47 +Author: Daniel-Constantin Mierla +Date: Thu Mar 10 16:53:35 2016 +0100 - Merge pull request #56 from linuxmaniac/fix_kamctl_build - - utils/kamctl: use $(basedir) as tmp dir on building instead of insecure /tmp + topos: proper storage of dlg data for persistence -commit f734154ff35fa95e8a70d9ee13f4f63a36794ea7 -Merge: cfef15e 5c9b3af -Author: lazedo -Date: Wed Jan 28 20:12:21 2015 +0000 +commit 313a5db2fdf73d8af3d8a5a1b02a656019c2102b +Author: Victor Seva +Date: Thu Mar 10 17:00:56 2016 +0100 - Merge pull request #55 from lazedo/presence_dialoginfo - - presence_dialoginfo : optionally send dummy dialog + db_mysql: change log level from WARN to INFO for ping checks -commit 121842ea718051befeb44e38c86c17a41fb48a17 +commit ea0550fac1f1cb2c9cd9779d3979b9f9f0e3cd27 Author: Victor Seva -Date: Wed Jan 28 21:04:12 2015 +0100 +Date: Thu Mar 10 12:39:45 2016 +0100 - utils/kamctl: use $(basedir) as tmp dir on building instead of insecure /tmp - - Reported by: Helmut Grohne See #48 + pkg/kamailio/deb: version set to 4.4.0-pre2 -commit 5c9b3afca092dfda33c96dbf5195b8f7bbc2d4cf -Author: lazedo -Date: Wed Jan 28 17:31:06 2015 +0000 +commit c23b48ca64f366ce48beadb3b7e20e38ad4b30ec +Author: Daniel-Constantin Mierla +Date: Thu Mar 10 12:30:42 2016 +0100 - presence_dialoginfo : optionally send dummy dialog + tls: enclose debug messages for tls locking in EXTRA_DEBUG defines + + - it can be too verbose for normal debugging -commit cfef15ef1ca52abf4d6df129a5768baa0aaf5a07 -Author: lazedo -Date: Wed Jan 28 18:26:37 2015 +0100 +commit 22b3311f39c7b98ef0c36d2edd7d224e4269e43f +Author: Camille Oudot +Date: Thu Mar 10 11:24:05 2016 +0100 - presence: do aux_body_processing() if exists after get_p_notify_body() + usrloc: improve TCP close on expire - - fix for send_notify_request() + this prevents the dramatic `F_TCPCONN connection marked as bad` message from + appearing in the logs when usrloc force-closes a TCP connection -commit 86a8e92b2b849a266b20eff09f9567001ab3a93c +commit 5ebed8ce9809ab0f13482d4777b9c9cc72f4758f Author: Daniel-Constantin Mierla -Date: Wed Jan 28 18:04:17 2015 +0100 +Date: Thu Mar 10 11:46:19 2016 +0100 - auth_radius: documented radius_avps_mode parameter + Makefile.defs: version set to 4.4.0-pre2 -commit fd881df42e6fc041639539c3c32240bbc30d8ae1 -Author: Daniel-Constantin Mierla -Date: Wed Jan 28 17:59:34 2015 +0100 +commit 92054daa6b1a70a33912c52e6e6ff3dcc4bd7a77 +Author: schoberw +Date: Wed Mar 9 11:04:30 2016 +0100 - auth_radius: renamed import_all_avp to radius_avps_mode + rr: append_fromtag on upstream in-dialog requests - - more suggestive that it is about radius avps, not the internal - kamailio avps + Record-Routing for in-dialog request are not needed by RFC 3162. But + there are many clients out there not sending initial route-set in + in-dialog requests. To provided them with the initial route-set together + with UAC modified requests the ;ftag parameter must be the to-tag on + upstream requests. + + append_fromtag parameter added the tag value from "from" header always, + even on upstream. This is fixed here. + + It is not done on record_route_preset(). This should not be called on + record routing anyway. -commit 5a0faf27b2bee82c4ee045046984fdca51b5662e -Merge: 2bb9422 93f74c2 +commit 924a861f1fc5eeade24b7ba6916afefb39a9cba5 +Merge: 00cde82 3320ed6 Author: Daniel-Constantin Mierla -Date: Wed Jan 28 17:56:00 2015 +0100 +Date: Wed Mar 9 11:02:05 2016 +0100 - Merge pull request #46 from borikinternet/borik-devel + Merge pull request #535 from wdoekes/wjd-typo-connectons - Improoved working with RADIUS AV pairs + websocket: Fix stats "connectons" typo's. -commit 2bb9422cf4d2dadd83bd698635fa7ab8e1e05923 -Author: Carsten Bock -Date: Wed Jan 28 17:24:00 2015 +0200 +commit 00cde82125a2271171fe4c25cba09f2147888206 +Author: jaybeepee +Date: Wed Mar 9 11:09:20 2016 +0200 - ims_qos: codec_data_avp: Make length dynamic, this should not be truncated according to RFC6733 + modules/ims_usrloc_scscf: fix synchronize argument count -commit 84634ac04ee8772db5044cdf41caae62fffb142b -Author: Jason Penton -Date: Wed Jan 28 14:45:54 2015 +0200 +commit 3320ed6df304e45a89d1cb2eba9b3c327008a0d5 +Author: Walter Doekes +Date: Wed Mar 9 08:58:53 2016 +0100 - modules/ims_charging: minor cleanup + websocket: Fix stats "connectons" typo's. + + The stats now list: + + ws_sip_max_concurrent_connections + ws_msrp_max_concurrent_connections + + Instead of: + + ws_sip_max_concurrent_connectons + ws_msrp_max_concurrent_connectons + + Note that the latter still exist as aliases to the corrected values for + a while. -commit 873c62b03f1485fc0fd9b4af740f8dc882748ddc -Author: Jason Penton -Date: Wed Jan 28 14:44:43 2015 +0200 +commit 5eceec21a2de8a95222cffc307ab0aeb15896b55 +Author: jaybeepee +Date: Wed Mar 9 07:59:29 2016 +0200 - modules/ims_charging: fixed shm memory leak + modules/cdp: fixed typo in len check -commit 63abc6f8036937ab6253260aa6e4ccaf04536922 -Author: Richard Good -Date: Wed Jan 28 12:48:52 2015 +0200 +commit f8a178fe9a21116320c7d30b5a9ced01c29ac3d3 +Author: jaybeepee +Date: Wed Mar 9 07:58:41 2016 +0200 - modules/ims_charging: Modified Ro_CCR method - removed unused params (IEC, SCUR, etc.) and added incoming and outgoing trunk id needed for interconnect charging + Revert "modules/cdp: fixed typo in len check" + + This reverts commit 5dfdfd84761d061615addd30b4c59af5ca32e907. -commit 72d2a19453b114a35d73e066eb450911521a5c13 -Author: Carsten Bock -Date: Tue Jan 27 18:06:09 2015 +0200 +commit 5dfdfd84761d061615addd30b4c59af5ca32e907 +Author: jaybeepee +Date: Tue Mar 8 13:09:17 2016 +0200 - ims_usrloc_scscf: Set i to 0 before iterating + modules/cdp: fixed typo in len check -commit 3999e927a1ee6f8b0cb97c34f84d113c1333279c -Author: Carsten Bock -Date: Tue Jan 27 18:05:56 2015 +0200 +commit e5b4cfdad888b72f53a95d1bdd9a8f5ba36588af +Author: jaybeepee +Date: Tue Mar 8 11:08:15 2016 +0200 - ims_registrar_scscf: Set i to 0 before iterating + modules/cdp: print diameter session-id for slow diameter responses (useful for debug) -commit 2a605383d5c524d9875256c7f95f64216b970331 -Author: Federico Cabiddu -Date: Tue Jan 27 16:43:45 2015 +0100 +commit 29dcaf3a788bbc472b0e3e89d799ca7da25bf209 +Author: jaybeepee +Date: Tue Mar 8 11:03:15 2016 +0200 - modules/dispatcher: parse default socket param before loading gateway lists + modules/ims_usrloc_scscf: improved mysql efficiency + - added transaction instead of autocomitting each statement + - changed query to more efficient join for many-to-many mapping deletion -commit 1cb90ab109b574a987d0a2bff915112243c51c30 -Author: Carsten Bock -Date: Tue Jan 27 15:42:54 2015 +0200 +commit 71f73672b9afcb53f5240e8fd49f726a4a105948 +Author: jaybeepee +Date: Tue Mar 8 11:00:01 2016 +0200 - ims_registrar_scscf: Fix previous commit in order to properly lookup tel: URI in ims_registrar_scscf + modules/ims_usrloc_scscf: multiprocess local timer support added -commit 4e7f8b5f437768cb2455c280de8f886dd13f51a7 -Author: Carsten Bock -Date: Tue Jan 27 15:05:35 2015 +0200 +commit 55bf58d81dc5033efa5d0239a85574ff1a58782a +Merge: 7fb3e3b 644b871 +Author: Daniel-Constantin Mierla +Date: Mon Mar 7 16:46:28 2016 +0100 - Do proper lookup on tel: URI's + Merge pull request #534 from athonet-open/fix_tel2sip + + siputils: tel2sip(): fix 'off by one' when allocating memory -commit 1b334f5e91e3c2f09a753833cc28b31f2f31bc7d -Author: Klaus Darilion -Date: Thu Jan 22 12:30:46 2015 +0000 +commit 644b87109321d6a6724cc82336289d17814173f2 +Author: Dragos Oancea +Date: Mon Mar 7 15:10:32 2016 +0100 - debugger: improve README + siputils: tel2sip(): fix 'off by one' when allocating memory -commit 513a6d8bf8d270b0a4fa9743daab5263c9688447 -Author: Klaus Darilion -Date: Thu Jan 22 09:24:52 2015 +0000 +commit 7fb3e3b3c0af457f1212e8d52bb9db5d127b397b +Merge: c5289e6 4fb7a60 +Author: Daniel-Constantin Mierla +Date: Fri Mar 4 09:01:19 2016 +0100 - kamctl: fix variable assignment + Merge pull request #527 from fredposner/master - There must not be a space before and after the = assignment operator. - -commit 7aeac62063b130ad956a76364b122b318fbe1e53 -Author: Olle E. Johansson -Date: Sun Jan 25 20:46:28 2015 +0100 + permissions: very minor spelling changes - sst remove history, remove SVN ID +commit 4fb7a60b0065b036121aeac7fb1b307bcf52d4d4 +Author: qxork +Date: Thu Mar 3 12:13:29 2016 -0500 -commit ddbff735938903e8c2405a63463601f3d7ca12af -Author: Olle E. Johansson -Date: Sun Jan 25 20:43:32 2015 +0100 - - db2_ops Remove svn id, change "ser" => "kamailio" + permissions: very minor spelling changes -commit d739c6273a4aca3dfe14218074f0a1ea88f19756 -Author: Olle E. Johansson -Date: Sat Jan 24 22:15:07 2015 +0100 +commit 4dcbb5d3b813291320b30289d2cd786e11f97924 +Author: qxork +Date: Thu Mar 3 11:51:02 2016 -0500 - jsonrpc-c Update Todo + permissions: very minor spelling changes -commit f04dec82e90ec7a3e6aea4ea8e9ed23b06b165c6 +commit c5289e6f076a9182b09d830e53fdb6ef426e0d83 Author: Daniel-Constantin Mierla -Date: Sun Jan 25 11:00:28 2015 +0100 +Date: Thu Mar 3 09:41:45 2016 +0100 - db_postgress: disable initialization of libssl if tls is loaded + presence: use unsigned int for expires limits min and max - - based on the note from docs to avoid double attempt to init the ssl - library - - http://www.postgresql.org/docs/9.4/static/libpq-ssl.html + - reported by GH #521 + - coherent indentation and spacing -commit f71243410d5e051def1a47cc73adb6caeeadd1cd -Author: Daniel-Constantin Mierla -Date: Sun Jan 25 10:59:07 2015 +0100 +commit bbec80253b887a275130796df52beb00c4526359 +Author: Victor Seva +Date: Thu Mar 3 09:35:33 2016 +0100 - tls: implemented tls hook for pre-mod init execution - - - do openssl init at this callback + pkg/kamailio/deb: fix typo at erlang short description -commit 4700831fa0f2dc52e296ce647711b03d1406497a +commit 937027467db080e12d89ab7739f114bf356a1791 +Merge: 479ac8e 6bb6973 Author: Daniel-Constantin Mierla -Date: Sun Jan 25 10:57:00 2015 +0100 +Date: Tue Mar 1 23:32:23 2016 +0100 - core: tls hooks can execute a callback before modules init function is executed + Merge pull request #525 from mslehto/uacdoc - - useful to prepare tls environment before a module might access it - - executed after modparam but before mod_init + modules/uac: document new uacreg table entries -commit e47018b0a65a5e26ea47d789f0bc6d471aa3a117 +commit 479ac8ed7e3c20254c2c3a449a9e23579689b0ab +Merge: 380ef86 93dcc5d Author: Daniel-Constantin Mierla -Date: Sat Jan 24 22:37:43 2015 +0100 +Date: Tue Mar 1 23:32:02 2016 +0100 - tls: updated the default tls session id string + Merge pull request #524 from aphistic/fix-siptrace-aliasing + + siptrace: Use the trace_local_ip setting in sip_trace() -commit 9596546c4eb5ae2e9b086cf3fe3e08337216d0f5 -Author: Olle E. Johansson -Date: Sat Jan 24 22:13:55 2015 +0100 +commit 6bb69733a156219d5368f8f950d512566810aa37 +Author: Mikko Lehto +Date: Tue Mar 1 22:35:08 2016 +0200 - jsonrpc-c Remove SVN ID + modules/uac: refresh content of README -commit b0679c91f22a9eb9b995175b1d1abfb836a5a3f6 -Author: Daniel-Constantin Mierla -Date: Sat Jan 24 18:33:45 2015 +0100 +commit 93dcc5dca539803ad7ae94dc86829d10d3d3412c +Author: Erik Davidson +Date: Tue Mar 1 14:36:02 2016 -0600 - dialog: use proper flags for script callback that clean dlg shortcuts + siptrace: Use the trace_local_ip setting in sip_trace() -commit 3b89c83bceb70da6fcbc9495dbcfec04e3f65ba4 -Author: Daniel-Constantin Mierla -Date: Sat Jan 24 11:21:04 2015 +0100 +commit 843b881d6ba6d15ae220c108ae85752e410dd40e +Author: Mikko Lehto +Date: Tue Mar 1 22:21:48 2016 +0200 - dialog: removed end of line in middle of log message + modules/uac: add flags and reg_delay to uacreg table documentation -commit fa5468c24283c8ff0a1b2254e927a128d03137fd -Author: Luis Azedo -Date: Fri Jan 23 23:52:57 2015 +0000 +commit 380ef86b5aea7cca5c2460cb2b248c7722a125a6 +Author: Daniel-Constantin Mierla +Date: Tue Mar 1 11:45:05 2016 +0100 - kazoo : fix memory allocation errors + core: coherent indentation and spacing -commit 836e693d7e0bafbb20b98e0fed470c7a03a1c120 +commit 81ec422227299b4cbd7aecbb58b862fc67208b30 Author: Daniel-Constantin Mierla -Date: Fri Jan 23 22:24:10 2015 +0100 +Date: Tue Mar 1 11:35:41 2016 +0100 - dmq_usrloc: use usrloc internal flag for replication + tsilo: don't execute tm callback for TMCB_DESTROY if server shutdowns - - flags field in location record is for internal usage and must not be - defined outside the module, because it can end up in conflicts in the - future - - removed the parameter that was used to set the flag - - added dmq_ul prefix for global vars to avoid shared objects conflicts - - removed unused extern declarations + - tsilo mod_destroy will clean up, otherwise may end up in deadlock at + shutdown, when a slot lock is already aquired and the callback will + try to aquire again -commit e7e5fd6b2ee2961c6aa13192068b3dc05b5ff5e1 +commit 87027c654d9381f79c305b18f33919b8c9a86b89 Author: Daniel-Constantin Mierla -Date: Fri Jan 23 22:23:34 2015 +0100 +Date: Tue Mar 1 11:32:59 2016 +0100 - usrloc: added internal flag to be used for replication - - - used by dmq_usrloc by now + core: option to check if server is in destroy modules phase -commit 723540b24b1e078eb953418365f8a99849de63ae -Author: Jason Penton -Date: Fri Jan 23 16:09:27 2015 +0200 +commit 392748691a7ca1ce11b48c8da4b52e26d34761ee +Author: Richard Good +Date: Tue Mar 1 10:17:40 2016 +0200 - modules/ims_usrloc_scscf: added missing db_mode check + modules/ims_usrloc_scscf: new mod param contact_delete_delay + contact_delete_delay: length of time to delay before deleting contact in state delay delete -commit 077b26385854feb701950d020e382c254b803e75 -Author: Daniel-Constantin Mierla -Date: Fri Jan 23 12:50:49 2015 +0100 +commit 56ab4065e6d2bcd9016d698548a6725a591eb736 +Author: Richard Good +Date: Tue Mar 1 10:17:17 2016 +0200 - path: received parameter enclosed in square brackets if ipv6 - - - received should be useless for ipv4, but still can be enforced from - config, so has to be well formatted because it is followed by a port - - reported by Sebastian Damm + modules/ims_qos: modified log line to be ERROR -commit 11f300f2c7c8ffe4a6b49b471ffcd116ee218985 -Author: Daniel-Constantin Mierla -Date: Fri Jan 23 12:28:42 2015 +0100 +commit 8f1831a0245c301a9d0e3c6cee64fd3f6f38162e +Author: Richard Good +Date: Tue Mar 1 10:16:57 2016 +0200 - jsonrpc-c: explicitely listed glibc as dependency + modules/ims_charging: added additional log line -commit 165a3fc2e4dfed09bd9f46e43270d49cf5f72a87 -Author: Daniel-Constantin Mierla -Date: Fri Jan 23 11:07:26 2015 +0100 +commit b4e3c04b601bef6841eb4616a17109296cd8aba1 +Merge: 4f9e0ff 8bc9d1b +Author: Juha Heinanen +Date: Tue Mar 1 09:50:18 2016 +0200 - permissions: init global pointer variables to null for safe shutdown at start - - - reported by Olle E. Johansson, GH#41 + Merge branch 'master' of https://github.com/kamailio/kamailio -commit c87a75c5fb7aa5d940093fbbca8d9557cc9a0239 +commit 8bc9d1b4f9e285dcacf748688ace164efa763600 +Merge: d6fb5dd 6af319e Author: Daniel-Constantin Mierla -Date: Fri Jan 23 10:55:15 2015 +0100 +Date: Tue Mar 1 08:49:31 2016 +0100 - pike: check that timer var is initialized before accessing the fields + Merge pull request #523 from sippy/master_rtpp_ip6_fix - - safe start with empty config, reported by Olle E. Johansson, GH#39 + Fix an issue with IPv6 in the rtpproxy module -commit 33570d9f575e3b0566ac5f0b9904940420be9ae2 +commit d6fb5dd11642b70b29d356a59620ee065e1538c3 +Merge: 4a0856b 8736b2d Author: Daniel-Constantin Mierla -Date: Fri Jan 23 10:47:45 2015 +0100 +Date: Tue Mar 1 08:47:23 2016 +0100 - jsonrpc-c: added note that it depends on Linux specific API + Merge pull request #519 from phil-lavin/tls-threshold-logging - - reported by Olle E. Johansson, GH#33 + tls: enhance the logging of ssl bug #1491 workaround -commit 6ba1d8ad7f1fb8139202f12a4269c6f4f1e000b7 -Author: Daniel-Constantin Mierla -Date: Fri Jan 23 09:51:07 2015 +0100 +commit 4f9e0ffc7c320666de1d139658c6b645561e217d +Author: Juha Heinanen +Date: Tue Mar 1 09:46:52 2016 +0200 - acc: rebuilt of readme + srdb1/schema: added connection_idx index to location table -commit 75db07b5d7794b0f67d5798917d1833a21382bb7 +commit 4a0856be3acd1c1a1eaaa058a39723a881fd6ed8 +Merge: 63987e2 47aa94c Author: Daniel-Constantin Mierla -Date: Fri Jan 23 09:50:17 2015 +0100 +Date: Tue Mar 1 08:46:37 2016 +0100 - acc: removed note in the docs about no-db support for cdrs + Merge pull request #520 from kamailio/tsearle-futex-try + + core/futex: fix bug in futex_try -commit 814c08f36f13ace21e52181da3039402f951b0a8 +commit 63987e266c0ee07d8ff184b9056ce30bac7db405 +Merge: c29c555 83d44c6 Author: Daniel-Constantin Mierla -Date: Thu Jan 22 22:35:36 2015 +0100 +Date: Tue Mar 1 08:45:16 2016 +0100 - nathelper: enclode IPv6 in square branckets for fix_nated_contact() + Merge pull request #522 from mslehto/sdpops - - even there is no nat in ipv6 + sdpops improvements and tests -commit a0fee0d8a0a23934f9832b50aa753d03adb694a3 -Author: Carsten Bock -Date: Thu Jan 22 14:16:33 2015 +0200 +commit 6af319ea9307feb840c9f318954c49c3eac8bbe1 +Author: Maksym Sobolyev +Date: Mon Feb 29 13:28:53 2016 -0800 - ims_registrar_pcscf: Only initialize child process, if subscribe to reg is enabled. + Fix IPv6 handling with the default setup. With the current code, + it's possible for it to pit IPv6 address, but set adress family + to the IP4. -commit 93f74c228bec1ad291d0ef5c8353747315556f7d -Author: Dmitriy N. Borisov -Date: Thu Jan 22 14:57:58 2015 +0300 +commit 83d44c6472567932e6eede1c0b820d0eb4c99fb6 +Author: Mikko Lehto +Date: Mon Feb 29 16:21:25 2016 +0200 - Comments style correction + test/unit: add unit test for sdpops script function sdp_remove_line_by_prefix() -commit 6b3d6842b0f5706a5b3612104bd0ceab073f1cbc -Author: Carsten Bock -Date: Thu Jan 22 13:51:17 2015 +0200 +commit 5db4cec2c9e8ab62c711738eae181afa69c1724d +Author: Mikko Lehto +Date: Mon Feb 29 15:35:41 2016 +0200 - ims_registrar_pcscf: Make sure, that the event list is initialized. + modules/sdpops: reimplement sdp_remove_line_by_prefix() to fix shortcomings + + - single line match was not removed + - multiline match with non-related lines between was not removed -commit 80fbeff64fe752a8998a774263fd00c9cddd65b5 -Author: Carsten Bock -Date: Thu Jan 22 12:54:54 2015 +0200 +commit c29c555ec5a328dff6ac2697dfbc6717d8562eeb +Author: jaybeepee +Date: Mon Feb 29 14:27:55 2016 +0200 - Add Pseude-Variable to get username of Contact, that was used during registration. + modules/ims_registrar_scscf: extra processes in S-CSCF for generating NOTIFYs -commit 4442bedb85e4baadceed610e394e63c03b011657 -Merge: 72c8f8c 2cdda10 -Author: Daniel-Constantin Mierla -Date: Wed Jan 21 22:31:10 2015 +0100 +commit 54c87a803d877f40d2915f304c5a67d8ff6a25e8 +Author: jaybeepee +Date: Mon Feb 29 14:26:36 2016 +0200 - Merge pull request #49 from mamikk/pvauth-checks-fix - - auth: use correct parameter for pv_auth_check checks + modules/ims_usrloc_scscf: extra debugging for contact deletion -commit 2cdda10aa232e545ba79ca71876f0160a68e324b -Author: Martin Mikkelsen -Date: Wed Jan 21 16:55:15 2015 +0100 +commit d7b6b127bf8c655e5506d8dfdce074defec23737 +Author: jaybeepee +Date: Mon Feb 29 14:25:21 2016 +0200 - auth: use correct parameter for pv_auth_check checks - - The pv_auth_check has a flags and a checks parameter but the flags - parameter is used for both. This means that if flags has the 1-bit set - it will enable both HA1-passwords and from/to URI checks and setting the - 1-bit in the checks parameter does not do anything. - - This fixes the parameters so that the checks parameter is used for the - to/from URI checks. + modules/ims_usrloc_scscf: delayed deletion of contacts on delete or expiry -commit 72c8f8c6f898be0bb1b0400d191d7ab55cc47c3c -Author: Richard Good -Date: Wed Jan 21 12:05:25 2015 +0200 +commit 80406a0f44b0d452ebb4b40a10261e671b8013c8 +Author: jaybeepee +Date: Mon Feb 29 14:21:25 2016 +0200 - modules/ims_registrar_scscf: in notify set contact expires to 0 if negative + modules/ims_usrloc_scscf: don't load empty scscf contacts from DB -commit 8cdbe797a659a431e7edc269c81ef40148413b30 -Author: Carsten Bock -Date: Tue Jan 20 18:59:21 2015 +0200 +commit 16c8d5e4648ff340e6043f4a38fd57c5c60a3058 +Author: jaybeepee +Date: Mon Feb 29 14:17:17 2016 +0200 - ims_registrar_scscf: Check length of the contents before trying copy the contents to the buffer (Bug-Fix) + ims_dialog: fix small refcount bug -commit 10ce2e5e1b6a2e158ce031487426230afb370682 -Author: Richard Good -Date: Tue Jan 20 10:59:25 2015 +0200 +commit c9ecbe97af96e20312f1f2daa0afe3b5121cb0c0 +Author: jaybeepee +Date: Mon Feb 29 14:13:03 2016 +0200 - modules/ims_registrar_scscf: new parameter notification_list_size_threshold. Once the - notification list exceeds this size a warning is logged. + modules/ims_dialog: add default reason headers for mi-terminated dlgs -commit 72e1189cbf81bc6ce07e9980784e42510e763c33 -Author: Richard Good -Date: Tue Jan 20 10:56:00 2015 +0200 +commit 176c98b0241433ef3e4cb22d55154bede1636791 +Author: jaybeepee +Date: Mon Feb 29 14:11:04 2016 +0200 - modules/ims_qos: new parameter cdp_event_list_size_threshold. Once the - queue exceeds this size a warning is logged. + modules/ims_dialog: check branch is set before dereferencing -commit 70f74204b59266f012e00d1568a9d492040a7201 -Author: Richard Good -Date: Tue Jan 20 10:50:23 2015 +0200 +commit 1e4a2316ec64f666ffa8fe865294fadcb06ebdac +Author: jaybeepee +Date: Mon Feb 29 14:09:14 2016 +0200 - modules/ims_registrar_pcscf: use separate process to manage reginfo subscribes and publishes + modules/ims_usrloc_pcscf, ims_usrloc_scscf, ims_qos: pass contact state into search requests + - more flexibility on state of contact to search for -commit 1de57a47c3a26b860785cf2efc2a558d1e65f911 -Author: Richard Good -Date: Tue Jan 20 10:46:56 2015 +0200 +commit ce86851ded64a094bd62cc205ce19f0b7bfa2f20 +Author: jaybeepee +Date: Mon Feb 29 14:08:00 2016 +0200 - modules/pua: new parameter db_table_lock_write - - New parameter db_table_lock_write: enable (=1) or disable (=0) the locks - for table during an transaction. + modules/ims_charging: add reason header for out-of-credit timeouts -commit bcdfd563d4469761be29588c53d82bc150913ece -Author: Carsten Bock -Date: Mon Jan 19 23:56:11 2015 +0200 +commit 86483813ac8ab78aba07496c63009b77f4dbe739 +Author: jaybeepee +Date: Mon Feb 29 14:06:33 2016 +0200 - ims_usrloc_scscf: Properly parse params when loading from database (caused crash) + modules/ims_charging: release dialog reference on Ro failure conditions -commit e415044acaf6fa15e20d0b90b34227fb0e167bea -Author: Dmitriy N. Borisov -Date: Mon Jan 19 02:19:37 2015 +0300 +commit 327a4f0a6ce978ef61f5bee3b6107b541e00f702 +Author: jaybeepee +Date: Mon Feb 29 14:05:55 2016 +0200 - Improoved working with RADIUS AV pairs - - - added modparam import_all_avp parameter (int, true if not null) - - reading all RADIUS AV-pairs to kamailio avp (not only SIP-AVP, if import_all_avp set to true) - - skiping name part of value (example: from RADIUS we recieve name - h323-x-header, value - - "h323-x-header=blah-blah-blah", in kamailio we have name - h323-x-header, value - "blah-blah-blah"), only for non SIP-AVP + modules/ims_charging: print error on failed CCR resultcode -commit cd1a59f223e2806ca4c16ab4a8dc1e0ff2b219d1 -Author: Alex Balashov -Date: Sun Jan 18 17:08:18 2015 -0500 +commit 7ac16452539875db390a5fbc6493fd11c9263880 +Author: jaybeepee +Date: Mon Feb 29 14:03:54 2016 +0200 - evapi: Listening socket will be bound with SO_REUSEADDR option so that rebinding does not have to wait for TIME_WAIT connections to clear. + modules/ims_charging: check msg for reason header and include in Ro CCR if present -commit 07ca8c0522e58c34c27cbb5806525cf43712f69e -Author: Olle E. Johansson -Date: Sun Jan 18 20:36:18 2015 +0100 +commit 8194032b0e1c954c2dd61e81528361b457344be6 +Author: jaybeepee +Date: Mon Feb 29 13:59:37 2016 +0200 - core parser - remove svn ID, remove history, change "ser" => "Kamailio" + modules/ims_usrloc_pcscf, ims_usrloc_scscf, ims_qos: pass contact state into search requests + - more flexibility on state of contact to search for -commit 1fff03a223fee4674e7e2c5317ccc13bee7c3cf7 -Author: Olle E. Johansson -Date: Sun Jan 18 20:17:38 2015 +0100 +commit 1a27121e139f88cf397d028a4092d570ceae2ec8 +Author: Carsten Bock +Date: Fri Feb 26 17:54:29 2016 +0100 - Cfg Remove SVN ID, history + siputils: Fixes & safety improvements for sip_p_charging_vector() -commit 35587899f0a6bf0b01d2ed9126f376c15b2e588f +commit b038f1d6641d44907e64a676a2aa3d99ea932119 Author: Olle E. Johansson -Date: Sun Jan 18 12:21:25 2015 +0100 +Date: Fri Feb 26 16:15:52 2016 +0100 - avpops Remove SVN ID, remove history + dnssec Find library in /usr/local too -commit 4a58e7a814e6fe68e8046cd3057f88da9c6c718b +commit 28f11e7072739a34b5fe3968c10ac8a7aebbcd82 Author: Olle E. Johansson -Date: Sun Jan 18 12:19:52 2015 +0100 +Date: Fri Feb 26 16:12:45 2016 +0100 - mi_rpc Remove SVN ID + dnssec Build with include files in /usr/local as well -commit 3aa7fd46acacb97a64d1a52cc9c7129d4df28432 -Author: Olle E. Johansson -Date: Sun Jan 18 12:18:28 2015 +0100 +commit 2b1e8db2838b7efc50b21ac66d6ef4494e96ddec +Author: lazedo +Date: Fri Feb 26 15:38:50 2016 +0000 - db_berkeley: Remove svn id, remove history, change "SIP-router" => "kamailio" + kazoo: log invalid json -commit 34fd472e9d7bd5821d6383958f7dd55648ac5daa -Author: grumvalski -Date: Sat Jan 3 08:37:02 2015 +0100 +commit 8740bf3d636f063cf4759d7ded231f1d86a94a6b +Author: Federico Cabiddu +Date: Thu Feb 25 16:07:29 2016 +0100 - modules/cdp: added src_addr parameter in peer definition + http_async_client: updated README -commit a07fbd562079c54c9c83c78c191a34d0398c2a83 -Author: Olle E. Johansson -Date: Sat Jan 17 22:42:10 2015 +0100 +commit 8f209d4d5c9c0632fc225d338f29d2d900ed752b +Author: Federico Cabiddu +Date: Thu Feb 25 16:00:36 2016 +0100 - msilo remove SVN id, remove history + http_async_client: documentation fixes -commit db03baa5b43f4eac5a6d136cd862e14520955762 -Author: Olle E. Johansson -Date: Sat Jan 17 22:37:57 2015 +0100 +commit e12bf2cd3b7b79b1e31030e555dfe379ed12fe33 +Author: Federico Cabiddu +Date: Thu Feb 25 15:46:08 2016 +0100 - regex Remove svn ID, history + http_async_client: some module's logs fixes -commit e91b89788b2c486dcc66cafd02618b008c129c8d -Author: Olle E. Johansson -Date: Sat Jan 17 22:29:29 2015 +0100 +commit 778e4a1e7ea2143089749bab317d87fcfdcd6629 +Author: Federico Cabiddu +Date: Thu Feb 25 15:42:09 2016 +0100 - ctl Remove svn id from sample configuration file + http_async_client: add "suspend" to $http_req keys -commit 89294e544c4efcb9cb9de8729aabe2fe4ad9a0b0 -Author: Olle E. Johansson -Date: Sat Jan 17 22:28:32 2015 +0100 +commit d11971629777b313790850cd393f7233dd3c31e1 +Author: lazedo +Date: Thu Feb 25 16:38:12 2016 +0000 - blst Remove svn id etc + kazoo: fix reconnect -commit e1f4afd456f87fd91d56daa2a166cfdcc38f8521 -Author: Olle E. Johansson -Date: Sat Jan 17 21:58:47 2015 +0100 +commit 47aa94c694e5471fa85bb15c372f9120876e4927 +Author: tsearle +Date: Thu Feb 25 09:56:09 2016 +0100 - mangler remove svn id, remove history + core/futex: fix bug in futex_try + + atomic_cmpxchg returns the previous value. If the previous value was 0 then it was previously unlocked and we now have acquired the lock. + + Thus, it should be c==0 that is considered as the case we enter the lock, not c!=0 + + As far as I can tell, lock_try (and lock_set_try) are currently no used anywhere in the code, so this fix shoudn't have any impact -commit f92ca97aaf90ea796b62f32224fab6bfda79015d -Author: Olle E. Johansson -Date: Sat Jan 17 21:53:43 2015 +0100 +commit 8736b2dc8dcd5fd8ee253134b19cb8ce0aa1c0b4 +Author: Phil Lavin +Date: Wed Feb 24 12:21:42 2016 +0000 - diversion remove svn id + tls: fix line breaks + + - fix line breaks in previous logging commit -commit ae0e79526a37643441ce2589f078850d9f595df8 -Author: Olle E. Johansson -Date: Sat Jan 17 20:58:57 2015 +0100 +commit 9dd2760fd337b39b72eb38189c093f5a156292f2 +Author: Phil Lavin +Date: Wed Feb 24 12:06:41 2016 +0000 - ctl Remove svn ID, remove history, add a tiny bit of doxygen + tls: enhance the logging of ssl bug #1491 workaround + + - log shm_available_safe() instead of shm_available() as this is what is + actually compared in the check + - also log the relevant threshold as it is not always obvious if the default + value is being used -commit 5bafc03222bf6fcc59dbcf8aec30def9cdb24581 -Author: Olle E. Johansson -Date: Sat Jan 17 18:43:42 2015 +0100 +commit 179b7a2bd7ad8a3aee0e4786f455868f7673a20b +Merge: 8ef8924 a4c5af2 +Author: Stefan Mititelu +Date: Tue Feb 23 13:46:59 2016 +0200 - sipcapture Add some missing \n in log messages + Merge pull request #505 from smititelu/master + + Fix node selection when rtpengine_delete(), for branching scenarios -commit cb8304f1f6be1eca3f9bd982265d5c3bed528189 -Merge: 618a148 c836390 -Author: Alexandr Dubovikov -Date: Sat Jan 17 20:48:05 2015 +0100 +commit a4c5af2df65a2711ea7f0fd97e7d9b8e65461a4b +Author: Stefan Mititelu +Date: Wed Feb 10 11:36:45 2016 +0200 - Merge pull request #44 from adubovikov/master + rtpengine: Delete all entries if viabranch.len==0 - added bool to print error once + - try to delete all (callid, viabranchX/Y..) hashtable entries when + rtpengine_delete() is called with viabranch.len==0 + - release lock before returning -commit c8363905755e5d120251eed95c5fa1be45e8f216 -Author: Alexandr Dubovikov -Date: Sat Jan 17 20:34:35 2015 +0100 +commit a7b1016ae64bd6e0977a621f12a82a6e19a64f81 +Author: Stefan Mititelu +Date: Tue Feb 9 14:20:56 2016 +0200 - added bool to print error once + rtpengine: LM_NOTICE to LM_DBG + + Change LM_NOTICE to LM_DBG when failed to find looked up node in hastable. + These logs appeared mostly for new calls, when inserting new entries in the + hashtable. This is normal behaviour. -commit 618a148c6b214bb285fd7cb5fb6620482f7e38d6 -Author: Olle E. Johansson -Date: Sat Jan 17 18:19:35 2015 +0100 +commit 4f4c44880ec22a5d7d1c9478f0299974c33a7501 +Author: Stefan Mititelu +Date: Tue Feb 9 14:13:31 2016 +0200 - matrix Add \n at the end of log messages where missing + rtpengine: Fix node selection for branching cases + + Update node selection when rtpengine_delete() is called to select existing + node, when the viabranch is NULL. Useful in branching scenarios. -commit 8d8cea81449ad0a39b5541e4c5bec01c1298ca3d -Author: Olle E. Johansson -Date: Sat Jan 17 15:04:14 2015 +0100 +commit 8ef89248cf8547371889734cf33bef827aacc73c +Author: Torrey Searle +Date: Tue Feb 23 08:57:16 2016 +0100 - srdb2 Remove SVN ID, change "ser" => "kamailio" + modules/sipt add charging indication -commit ce41c40055139b3eb5a44d940585457e48830724 -Author: Olle E. Johansson -Date: Sat Jan 17 14:43:00 2015 +0100 +commit 16f5fbf747c2725d70f2ab7aecfcdf1bd76b91c3 +Author: Victor Seva +Date: Tue Feb 23 08:54:47 2016 +0100 - domain Add \n at end of LM_ERR message, add LM_DBG for db_url + pkg/kamailio/deb: version set to 4.4.0-pre1 -commit ecb32d326615242fed43a6e2655627848842afd2 -Author: Daniel-Constantin Mierla -Date: Sat Jan 17 13:30:45 2015 +0100 +commit 131d8999c7efe43b50b4ede1a8426105ed96c399 +Author: Stefan Mititelu +Date: Fri Feb 19 13:11:44 2016 +0200 - tls: fixed installation path update for tls.cfg + rtpengine: fix queried_nodes_limit logic + + Right now, even if the selected node returns error, the same node is still + selected and still queried for maximum of queried_nodes_limit times. + + Don't retry to query the previous nodes, upon error returned (i.e. + Parallel session limit reached"). Instead, remember the queried nodes and try + to select between un-queried ones. Thus, rtpengine_offer() will select a proper, + available node which will be inserted in the hashtable and further used. -commit 6daf77d666ff0fcb1bd8df4bb3c63dc0fdac9656 -Author: Olle E. Johansson -Date: Sat Jan 17 12:33:45 2015 +0100 +commit b531e175895cbb0f629e5a47c523ee8b569746d8 +Author: Stefan Mititelu +Date: Fri Feb 19 09:29:44 2016 +0200 - mohqueue Remove SVN IDs, add some \n at end of error messages + rtpengine: fix hashtable insert logic - More cleanup of LM_DBG and LM_ERR needed, as well as code formatting + Add hastable entry only when rtpengine responded with non-error to received command. + This is useful when rtpengine machine responds with errors like + "Paralel session limit reached". In this case, one doesn't want to add the + entry, but to try another node. -commit e4922ec89dddc34690fc8ee884ae5785098b6ae0 -Author: Olle E. Johansson -Date: Sat Jan 17 11:30:31 2015 +0100 +commit e4bd3c1d97bb04bfb8f84619481bc7dfb0d8030f +Author: Daniel-Constantin Mierla +Date: Tue Feb 23 08:40:46 2016 +0100 - prefix_route - Fix doxygen + Makefile.defs: version set to 4.4.0-pre1 -commit 9e331eb7dc3e68de8d7bf3bd3a55c6ee0e99b9d8 -Author: Olle E. Johansson -Date: Sat Jan 17 11:15:32 2015 +0100 +commit b214541fc93669a6a9248eae34be17cb97520719 +Merge: fedde6e 1c0242f +Author: Daniel-Constantin Mierla +Date: Mon Feb 22 23:20:07 2016 +0100 - tmrec Add section IDs to XML documentation + Merge pull request #514 from phil-lavin/feature-trying-master + + pua_dialoginfo: support for sending "Trying" state for callee -commit af6f8bd043b8b3704c0e5ce1a3263bb38c42a0d1 -Author: Olle E. Johansson -Date: Sat Jan 17 11:14:53 2015 +0100 +commit fedde6e9b4916080399ff7a8a587815aab622c7e +Merge: de77b78 5e826dd +Author: Daniel-Constantin Mierla +Date: Mon Feb 22 23:17:47 2016 +0100 - tmrec Remove svn ID, fix doxygen + Merge pull request #517 from mslehto/openbsd + + OpenBSD fixes -commit 60dc57430ac3c81b50255b4a30f29b5882eafcf3 -Author: Olle E. Johansson -Date: Sat Jan 17 11:04:17 2015 +0100 +commit 5e826dd14f0f7035aaec534351d1634f65f2be36 +Author: Mikko Lehto +Date: Mon Feb 22 23:43:15 2016 +0200 - uid_gflags Remove svn id, history + Makefile.defs: remove outdated OpenBSD logic -commit 6429161f85cd34190a6d2b7dcda3775e0e2d5406 -Author: Olle E. Johansson -Date: Sat Jan 17 11:03:49 2015 +0100 +commit 996c1a58353d6c0ac5e30daf5d7e8e854bd45419 +Author: Mikko Lehto +Date: Mon Feb 22 13:13:24 2016 +0200 - uid_gflags Update README (SER => Kamailio) + Makefile.defs: add -DHAVE_SCHED_YIELD to OpenBSD options + + According to manual, sched_yield(2) was introduced in OpenBSD 4.2 -commit 03792bbbeb14ba8403ed73a97f177e55e9832d6a -Author: Olle E. Johansson -Date: Fri Jan 16 21:54:12 2015 +0100 +commit 46862c7b9a095fb8137e0ef358e0e97599bd444b +Author: Mikko Lehto +Date: Sat Feb 20 20:16:26 2016 +0200 - domain Remove history, svn ID's + tcp: fix tcp_options.o compilation + + Commit 6627098eb4adad706d20f6b73d1b7e75cc08a21f broke building on OpenBSD -commit 17999042f6cd531d54b4f387a6257cccf643cc5a -Author: Olle E. Johansson -Date: Fri Jan 16 21:48:18 2015 +0100 +commit de77b78a7d26a78a4a7a884c6f1ec2c18e664867 +Author: Torrey Searle +Date: Mon Feb 22 17:53:03 2016 +0100 - module makefiles - remove SVN id and replace "example" with module name + modules/sipt: add ability to check charging indicator -commit 7bb7d4ed78c6c7c101e31b24936b1d20f7325135 -Author: Olle E. Johansson -Date: Fri Jan 16 21:29:35 2015 +0100 +commit 1c0242fecb1a5ea9a3fde54b8ce331886e564d39 +Author: Phil Lavin +Date: Fri Feb 19 12:03:40 2016 +0000 - cfg_rpc Update README + presence: Fully implement table locking for updating the presentity table + + - Implement table locking for all routes through update_presentity in order + to avoid a number of different race conditions which resulted in + extraneous data being put into the presentity table. -commit 249269d26234a5fd24d755b8bb577f976b077bf1 -Author: Olle E. Johansson -Date: Fri Jan 16 17:51:51 2015 +0100 +commit 897e775a6353ab1e4738ad3b0c3d1c1e53980277 +Author: Phil Lavin +Date: Fri Feb 19 12:01:27 2016 +0000 - parser Updates to header files, remove history etc + pua_dialoginfo: support for sending "Trying" state for callee + + - Implement callee_trying parameter in pua_dialoginfo which causes + a "Trying" state to be sent for both the caller and callee when + a new dialog is created. -commit 6e8121f4b25e1c3f59f628a4591299f69f44635e -Author: Olle E. Johansson -Date: Fri Jan 16 17:41:47 2015 +0100 +commit 546944d6fb8acffec01a7ddae719d14bb88d8a20 +Merge: 3db2f28 4b5da2d +Author: Camille Oudot +Date: Fri Feb 19 10:17:45 2016 +0100 - core Header modifications in rand library - SVN IDs + Merge pull request #513 from kamailio/co/crypto_name_collision + + srutils: change names colliding with libcrypto -commit 45fa4dac02358eeda51e3a7b942a3abb07a2b850 -Author: Olle E. Johansson -Date: Fri Jan 16 17:40:18 2015 +0100 +commit 3db2f281af67381b7cf81eb8d8d24719dc66296b +Author: Daniel-Constantin Mierla +Date: Thu Feb 18 15:27:05 2016 +0100 - core: Header file change in doxygen (SIP-ROUTER => Kamailio) + kamailio.cfg: more coherent use of curly braces for blocks + + - use them always when execution actions in if-else blocks that are not + return-exit-drop + - single line blocks with return-exit-drop made single line with the if + statement -commit 6806e46ad9c8d9bbd437b79492bf4c98386bd626 -Author: Olle E. Johansson -Date: Fri Jan 16 17:38:46 2015 +0100 +commit 15c139831f7135f141f7a32c34ecf24e37bfc3fc +Merge: e856483 af0cc3c +Author: Daniel-Constantin Mierla +Date: Thu Feb 18 15:19:20 2016 +0100 - core: Modify doxygen, remove history, remove SVN IDs, change "ser" and "sip-router" to "KAMAILIO" + Merge pull request #503 from smititelu/SIPPROXY-195 + + Complete the list of checking routing blocks types with t_is_request_route() config function -commit 0076763ec428f94ff4dfb75c07f8d7c816e9c226 -Author: Richard Fuchs -Date: Thu Jan 15 12:59:05 2015 -0500 +commit 4b5da2d909ea3fcd531eecff2f3e02adad26fa27 +Author: Camille Oudot +Date: Thu Feb 18 11:09:24 2016 +0100 - rtpengine: remove Svn Id tags and history + srutils: change names colliding with libcrypto -commit 56164cfceb1e164ee01a3993bad3a2590f0a2108 -Author: Richard Fuchs -Date: Thu Jan 15 12:51:57 2015 -0500 +commit e85648385ae56ca3bac0d1b06400ececa28fd55a +Author: Daniel-Constantin Mierla +Date: Sat Feb 13 11:41:24 2016 +0100 - rtpengine: update README + mtree: coherent indentation -commit 66fe1f64dfff41ff048b9d8c6e471f86f569eebb -Author: Richard Fuchs -Date: Thu Jan 15 12:51:48 2015 -0500 +commit d5fe09b83a8a14d46b8d8354f354d7e47a1815ee +Author: Hugh Waite +Date: Tue Feb 16 17:45:18 2016 +0000 - rtpengine: update docs for force_send_interface + http_client: Updated copyright in README -commit 5ed51f55985b20f8e24752a03e7b5fd3c106bfe0 -Author: Lucian Balanceanu -Date: Thu Jan 15 12:50:36 2015 -0500 +commit 17e7d757b04b6da5b5d4d2eb076ac746fcc0ee05 +Author: Hugh Waite +Date: Tue Feb 16 17:23:50 2016 +0000 - rtpengine: new modparam force_send_interface - - Binds control sockets to the specified local interface. IPv4 only. - - Patch by Lucian Balanceanu + pv: Fix crash when xavp has no attributes + - Fixes the crash reported in #511 -commit d43e8965640bbc64e56ef33f27d4f3c3a85c73fa -Author: Daniel-Constantin Mierla -Date: Thu Jan 15 17:54:18 2015 +0100 +commit a176c7f1e5686d0aed5c95830d62eb964358841a +Author: Richard Good +Date: Tue Feb 16 15:51:03 2016 +0200 - presence: fix counter and type for removing presentity from cache - - - report and patch by Kristian F. Høgh + modules/ims_registrar_pcscf: Check if we subscribe to reg_info before processing notify - fix crash -commit 338b00c0f2d38694cffe3536e7eeed0e0d5372dd -Author: Daniel-Constantin Mierla -Date: Thu Jan 15 13:40:51 2015 +0100 +commit 4e75738d22b0ae444e64fbe6571f2b266139c738 +Author: Camille Oudot +Date: Tue Feb 16 10:43:57 2016 +0100 - sl: don't remove the lump added in the 'after' list of delete lump - - - they are destroyed together, making the operation useless + http_async_query: update README -commit 1fd0ca99eaa4b2c5cfcb8bd555a35088ddf49343 -Author: Daniel-Constantin Mierla -Date: Thu Jan 15 13:37:42 2015 +0100 +commit 1dd1b92363c78d24b036be7916d5c58e893d99bf +Author: Camille Oudot +Date: Tue Feb 16 10:43:38 2016 +0100 - core: remove_lump() clears its innner before/after lists - - - fixing leak issues that could be created by using sl_forward_reply() - in config file + http_async_query: fix function name in doc -commit c1b4d442501591bd18e8130474eeb5c16101e549 -Author: Daniel-Constantin Mierla -Date: Thu Jan 15 13:15:25 2015 +0100 +commit 8ff02413451f43b42cf565056c28264a43eed5a9 +Author: Camille Oudot +Date: Tue Feb 16 10:39:08 2016 +0100 + + http_async_client: $http_req returns $null when read + +commit 7c98ac5f939755e2eae859e670182b6446d80227 +Author: Camille Oudot +Date: Mon Feb 15 18:43:56 2016 +0100 + + http_async_client: update README + +commit b344ba0b527c0c0dd12063f6f8a37f13bddb317b +Author: Camille Oudot +Date: Mon Feb 15 18:43:00 2016 +0100 + + http_async_client: update doc with $http_req(key) - core: parse_ppi_pai - free header parameters for PAI and PPI +commit ca0cd715209eb5b5b3d14230771bfb35f1fdbf37 +Author: Camille Oudot +Date: Thu Feb 11 14:59:25 2016 +0100 + + http_async_client: new $http_req() PV - - they are not considere in the compacted p_id_body_t and not freed - - specs don't mention headers parameters for PAI and PPI, but could come - as UA extensions + the $http_req() PV allows to set custom request parameters for the next + asynchronous HTTP query -commit 5a71429596851d8096de1abe5542e57e8b8f6547 -Author: Daniel-Constantin Mierla -Date: Thu Jan 15 13:11:37 2015 +0100 +commit 43946417e3f0c2bbd07e5c4ec8ccd48b31c5ecf9 +Author: Giacomo Vacca +Date: Thu Feb 11 14:30:16 2016 +0100 - core: parse_add_spec() free params in case of parsing failure + http_async_client: minor indentation changes -commit 98878e113794726e2ec7bd7010a86860e6016c02 -Author: Andrey Rybkin -Date: Wed Jan 14 13:42:00 2015 +0300 +commit 012498f280279b66ab336f0a855c35af4fec9c14 +Author: Giacomo Vacca +Date: Thu Feb 11 14:24:11 2016 +0100 - dmq_usrloc: fixed update contacts + http_async_client: review doc with correct module name -commit 4763773eddf5e0e5ea4ae35ee6c2002e05f8bd9d -Author: Victor Seva -Date: Mon Jan 5 12:29:40 2015 +0100 +commit da26a524e8b318f69116494726d582fbc09bfd32 +Author: Giacomo Vacca +Date: Thu Feb 11 14:19:18 2016 +0100 - dialplan: skip check subexpressions on expressions with pvs + http_async_client: review tls-related param names and vars -commit f947b5269ea5b02159aef0c07ccbf419a3635b54 -Author: Victor Seva -Date: Wed Jan 14 11:26:22 2015 +0100 +commit ba86ae06a52c0535a3fb3d0eb30b8380300e185d +Author: Giacomo Vacca +Date: Thu Feb 11 13:45:34 2016 +0100 - nathelper: regenerate README file + http_async_client: refactor query string param setting -commit 1fd5fb1d51a9507b12d02d3ba32384d543940c7d -Author: Victor Seva -Date: Mon Jan 12 14:05:03 2015 +0100 +commit 250ff7e7e1b6d96ac3a70b90703594c1befc30c2 +Author: Giacomo Vacca +Date: Thu Feb 11 11:47:31 2016 +0100 - nathelper: add append_sdp_oldmediaip parameter + http_async_client: Fix minor avp doc typo (http_err) -commit c576c7120d2ec2226b30990868c462d285f9eacc -Merge: 68d9f42 c109755 -Author: Daniel-Constantin Mierla -Date: Wed Jan 14 10:40:22 2015 +0100 +commit 0841c4549f1776e779ebb9ebe1ded037edf0b0ce +Author: Olle E. Johansson +Date: Sat Feb 13 19:58:31 2016 +0100 - Merge pull request #26 from wdoekes/wjd-ws_frame_transmit-check-wsc + http_async_client Add doxygen templates - websocket: Check frame->wsc in ws_frame_transmit for NULL. + Please update with better descriptions -commit 68d9f4296f4128dece2fdd3db95c7e5bdce86507 -Author: Ovidiu Sas -Date: Tue Jan 13 12:47:03 2015 -0500 +commit f0d0075ce8ab15c04eecb3cfc0ce89408a481ce5 +Author: Olle E. Johansson +Date: Sat Feb 13 19:02:40 2016 +0100 - local_timer.c: logging: DBG -> LM_DBG + NEWS update with link to 4.4.x -commit 598df456ceb413dfc3aaab0d9cca03d30029fa4d -Author: Ovidiu Sas -Date: Tue Jan 13 12:44:01 2015 -0500 +commit 00226fa9cef56e3447068b891b2cb14260ff5423 +Author: Olle E. Johansson +Date: Sat Feb 13 19:01:46 2016 +0100 - route.c: logging: DBG -> LM_DBG + ISSUES add link to Github -commit ef3ac5cc2b138d05b25a9b38d18892d584921eef -Author: Ovidiu Sas -Date: Tue Jan 13 12:39:58 2015 -0500 +commit 097637b2be779f9bfc0a6fa18dca3c271e35d8b1 +Author: Olle E. Johansson +Date: Fri Feb 12 21:53:30 2016 +0100 - dns_cache.c: logging: DBG -> LM_DBG + INSTALL Remove flavours and ser/serctl -commit 2571b99cf3d45369c0e1bb7e5539a062f1066b37 -Author: Ovidiu Sas -Date: Tue Jan 13 12:33:55 2015 -0500 +commit 56623341c765c298cae8c3353d2ebacd81f00070 +Author: Olle E. Johansson +Date: Fri Feb 12 21:36:39 2016 +0100 - daemonize.c: logging: DBG -> LM_DBG + readme minor updates -commit b5d4fd9f2f14627fe5e8edf8da8616954b336488 -Author: Ovidiu Sas -Date: Tue Jan 13 12:32:55 2015 -0500 +commit d7e42ceef76e66b06d97159e71043fd552a29e8c +Author: jaybeepee +Date: Fri Feb 12 20:48:14 2016 +0200 - dst_blacklist.c: logging: DBG -> LM_DBG + modules/ims_registrar_scscf: fixed segfault on multiple impu when building notify + - also reported and fixed by Dragos Oancea -commit 80d01114abef2c1b158a416f46d77ce23bdfb184 -Author: Ovidiu Sas -Date: Tue Jan 13 12:31:43 2015 -0500 +commit 63b4561d8d764700e0e380448d366b7f31bd2a02 +Author: jaybeepee +Date: Fri Feb 12 20:40:54 2016 +0200 - msg_translator.c: logging: DBG -> LM_DBG + modules/ims_dialog: remove double unref on dialog -commit 86513b9ed72790f8353a0aa0f31e2d1626ac09c8 -Author: Ovidiu Sas -Date: Tue Jan 13 12:28:42 2015 -0500 +commit 6620a44738c68d035991df51cb915142a5d965a6 +Author: jaybeepee +Date: Fri Feb 12 20:28:49 2016 +0200 - raw_listener.c: logging: DBG -> LM_DBG + modules/ims_usrloc_scscf: added support for UE types required by registrar -commit 9f7dd69ae2178adb04585fa6d8773479140bbd98 -Author: Ovidiu Sas -Date: Tue Jan 13 12:06:51 2015 -0500 +commit 1f8c8ef2a68a380724b12d035b1d73705546dc8f +Author: jaybeepee +Date: Fri Feb 12 20:13:59 2016 +0200 - flags.c: logging: DBG -> LM_DBG + Revert "modules/ims_registrar_scscf: new function to pass extra argument to lookup (ue_type)" + + This reverts commit 574b8d6c2d0897ba69c5eec14775350508ad0778. -commit bccfb2e39106785e12ebbee6cdd901421a288046 -Author: Ovidiu Sas -Date: Tue Jan 13 12:05:27 2015 -0500 +commit 69011822286acd4f051c43d502972e4e5ff35195 +Author: jaybeepee +Date: Fri Feb 12 20:12:21 2016 +0200 - forward.c: logging: DBG -> LM_DBG + modules/ims_registrar_scscf: new function to pass extra argument to lookup (ue_type) + - useful if looking for a specific type of UE ie VoLTE vs SIP for example -commit 49cca9c3bdd1cc5213c05d08ddb1ea85fe3ff96e -Author: Daniel-Constantin Mierla -Date: Tue Jan 13 17:54:31 2015 +0100 +commit 574b8d6c2d0897ba69c5eec14775350508ad0778 +Author: jaybeepee +Date: Fri Feb 12 20:11:19 2016 +0200 - dispatcher: declare the inactive threshold variable - - - it was declared as extern only - - reported by Ovidiu Sas + modules/ims_registrar_scscf: new function to pass extra argument to lookup (ue_type) + - useful if looking for a specific type of UE ie VoLTE vs SIP for example -commit c1836c5c35f8e8fcc033d8d5a417ed700eeebe16 -Author: Ovidiu Sas -Date: Tue Jan 13 11:47:19 2015 -0500 +commit 0a8062dfa0f0b1cc13825b75fea688548409c9c3 +Author: jaybeepee +Date: Fri Feb 12 20:04:44 2016 +0200 - modparam.c: logging: DBG -> LM_DBG + modules/ims_dialog: release lock on error condition -commit c9dca9b43a79ab8cca22aa50fb501446dd7fd956 -Author: Ovidiu Sas -Date: Tue Jan 13 11:45:39 2015 -0500 +commit b4a4423695eab8087de4f3ed68e21145ac1fd5d5 +Author: jaybeepee +Date: Fri Feb 12 20:03:57 2016 +0200 - receive.c: logging: DBG -> LM_DBG + modules/ims_dialog: pass reason to terminate function -commit cd38f6233a17235c693dffe2f40833f5c56e5996 -Author: Ovidiu Sas -Date: Tue Jan 13 11:42:19 2015 -0500 +commit 51ba40fe5707bcadfa84ac99138537132ee7c0cb +Author: jaybeepee +Date: Fri Feb 12 20:03:00 2016 +0200 - md5utils.c: logging: DBG -> LM_DBG + modules/ims_dialog: release lock in error conditions -commit e66bd493ee1d3147901dcf75990bd65eebe5e98f -Author: Ovidiu Sas -Date: Tue Jan 13 11:41:18 2015 -0500 +commit 6b80de3f9d4a69979ee1a3f2e7f8bbd72191d915 +Author: jaybeepee +Date: Fri Feb 12 20:01:54 2016 +0200 - id.c: logging: DBG -> LM_DBG + modules/ims_dialog: changed log line from ERR to DBG -commit 002879f87cae0d1fd37fdb8fe24cf5e70d14baca -Author: Ovidiu Sas -Date: Tue Jan 13 11:39:42 2015 -0500 +commit f39c41fb02e8c1617910f9f42fdfceb9b0721967 +Author: jaybeepee +Date: Fri Feb 12 20:00:21 2016 +0200 - main.c: logging: DBG -> LM_DBG + modules/ims_dialog: fixed dialog stats -commit 37eaa968b6f4da93ae97fdb17b0442916ff510cb -Author: Ovidiu Sas -Date: Tue Jan 13 10:50:36 2015 -0500 +commit ff9dd83111fcaee8d9ef34d49cf9cd56ecdbacd9 +Author: jaybeepee +Date: Fri Feb 12 19:55:52 2016 +0200 - cfg_parser.c: logging: DBG -> LM_DBG + modules/ims_dialog: added extra info to log line - transaction ptr -commit 57b1c29da455029771361469b99d8c9b7957280c -Author: Ovidiu Sas -Date: Tue Jan 13 10:48:39 2015 -0500 +commit 57e5a8e33d5fd9fb51a4d88f0bf131ea1c34a4c7 +Author: jaybeepee +Date: Thu Feb 11 10:44:07 2016 +0200 - io_wait.c: logging: DBG -> LM_DBG + modules/cdp: update last used time when sending diameter message to peer -commit 6bd4757c431867713d5ee24d2fb3330cb8cd884a -Author: Ovidiu Sas -Date: Tue Jan 13 10:47:29 2015 -0500 +commit eecd7ecd9b0340fd330ceb167e0e8c82f557a049 +Author: jaybeepee +Date: Thu Feb 11 10:41:43 2016 +0200 - resolve.c: logging: DBG -> LM_DBG + modules/cdp: changed WARN log to DBG -commit fb3886969658f4039a4def7f73adbfdf47b8e862 -Author: Ovidiu Sas -Date: Tue Jan 13 10:41:58 2015 -0500 +commit f50c9c853e7809810099c970780c30b0765b0643 +Author: Daniel-Constantin Mierla +Date: Fri Feb 12 18:04:19 2016 +0100 - proxy.c: logging: DBG -> LM_DBG + seas: safety check for target buffer size before copying message in encode_msg() + + - avoid buffer overflow for large SIP messages + - reported by Stelios Tsampas -commit 508fe14d19514dbf977edd8284886821e12833dc -Author: Ovidiu Sas -Date: Tue Jan 13 10:38:49 2015 -0500 +commit f39d144e385f1fbf8759ba03e28e69aeb56d6e6a +Author: Daniel-Constantin Mierla +Date: Thu Feb 11 23:07:56 2016 +0100 - re.c: logging: DBG->LM_DBG + registrar: send 400 if the reg-id value is invalid + + - reported by GH #497 -commit eb5d180a3ccb098190a5bbb76376b7b007d0f6aa -Author: Ovidiu Sas -Date: Tue Jan 13 10:37:13 2015 -0500 +commit dcfd5012c0fe10c2697ceeaf5b09d24e1ae8719e +Author: Daniel-Constantin Mierla +Date: Thu Feb 11 22:15:39 2016 +0100 - route.c: logging: DBG->LM_DBG + tls: debug messages for mutex ops with lock function -commit 9301d87ef30f2869ce07feb00d6aaeb1f7b5213f -Author: Ovidiu Sas -Date: Tue Jan 13 10:33:55 2015 -0500 +commit fe7f4117536260d0613bc918110f1d0093ad50b9 +Author: jaybeepee +Date: Thu Feb 11 10:40:04 2016 +0200 - rvalue.c: logging: DBG->LM_DBG + modules/ims_registrar_pcscf: fix rank for forked process to get DB initialisation (pua) (reverted from commit 02059e32fde2008ed906fa8ff35d79762ac97412) -commit dd72ec8849f40c88f4fa193047bd8d227537b8bb -Author: Ovidiu Sas -Date: Tue Jan 13 10:26:55 2015 -0500 +commit 02059e32fde2008ed906fa8ff35d79762ac97412 +Author: jaybeepee +Date: Thu Feb 11 10:36:26 2016 +0200 - select.c: logging: DBG->LM_DBG, ERR -> LM_ERR + modules/ims_registrar_pcscf: fix rank for forked process to get DB initialisation (pua) -commit c6a1ba6d7686bba3f417cf309912be60d8e825d1 -Author: Ovidiu Sas -Date: Tue Jan 13 10:21:27 2015 -0500 +commit 4f162f84f9a4c0c0b843ba73d9f60cc204d012e5 +Author: jaybeepee +Date: Thu Feb 11 10:35:27 2016 +0200 - sr_module.c: logging: DBG -> LM_DBG + modules/ims_charging: clean from uri to remove parameters before using as PAI -commit c178803b956fd125753f0279f57048d74177886c -Author: Ovidiu Sas -Date: Tue Jan 13 10:18:20 2015 -0500 +commit 0328dda233469873b0e4632f9cd78a20a7dc06c9 +Author: jaybeepee +Date: Thu Feb 11 10:34:06 2016 +0200 - tcp_main.o: logging: DBG -> LM_DBG + modules/ims_charging: changed log line from ERR to DBG -commit e3816ac5c2e4e1496dd1ed0e4b9d2774b8c3e3b3 -Author: Ovidiu Sas -Date: Tue Jan 13 10:04:26 2015 -0500 +commit 45b0f6992f1a37107be1d3cfdbdb10b60ac6d1c5 +Author: Daniel-Constantin Mierla +Date: Tue Feb 9 13:26:15 2016 +0100 - select_core.o: logging: DBG->LM_DBG, ERR -> LM_ERR + examples: updated ims configs to use ims_dialog module -commit 393fc062c0e20622016aae27f34f2bf7c47e281f -Author: Ovidiu Sas -Date: Tue Jan 13 09:59:44 2015 -0500 +commit eb820d1b29f9d89c81950641ac1084eca2bbe02c +Author: Daniel-Constantin Mierla +Date: Tue Feb 9 13:23:22 2016 +0100 - action.c: logging: DBG -> LM_DBG + ims_charging: updated docs for dependency on ims_dialog -commit 0a9485352c1c16f1727f97a077c3a632682d9305 -Author: Ovidiu Sas -Date: Tue Jan 13 09:57:59 2015 -0500 +commit 4d7067b5f1516016c0abc88735839ade8150629c +Author: Daniel-Constantin Mierla +Date: Tue Feb 9 12:20:54 2016 +0100 - switch.c: logging: DBG -> LM_DBG + ims_dialog: updated the docs to reflect the module rename -commit ea3df285e8dc8f162e3824ad3247b8f9ee57e5dd -Author: Ovidiu Sas -Date: Tue Jan 13 09:54:09 2015 -0500 +commit 8a0048894790e6b88ef2d02e8bc77cd58ab25abb +Author: Daniel-Constantin Mierla +Date: Tue Feb 9 12:20:33 2016 +0100 - socket_info.c: logging: DBG -> LM_DBG + ims_qos: updates short part to ims_dialog module -commit 4a4da127d03fffb5df30421d31a7bb211a31a24d -Author: Ovidiu Sas -Date: Tue Jan 13 09:48:36 2015 -0500 +commit 98930c6deaf00a3512b1a24d936c2a0009cecb1a +Author: Daniel-Constantin Mierla +Date: Tue Feb 9 12:20:15 2016 +0100 - tcp_read.c: logging: DBG -> LM_DBG + ims_charging: updated short path to ims_dialog -commit 842b24af14983cb9cdebad99e526330ed9ae0696 -Author: Ovidiu Sas -Date: Tue Jan 13 09:40:27 2015 -0500 +commit c04328efbc9314064b6474f0d2321f8b733b2ae1 +Author: Daniel-Constantin Mierla +Date: Tue Feb 9 12:19:41 2016 +0100 - timer.c: logging: DBG -> LM_DBG + snmpstas: detect if ims_dialog module is loaded -commit 46f98db670d087ce1a5bfd061abf4b3dbc6ae603 -Author: Ovidiu Sas -Date: Tue Jan 13 09:38:39 2015 -0500 +commit edc18dfd0ddab363d9ca68dad3ef75aac901f06c +Author: Daniel-Constantin Mierla +Date: Tue Feb 9 11:59:04 2016 +0100 - timer.c: logging: DBG -> LM_DBG + ims_dialog: Makefile update after rename -commit e44f53c09be3869827d1fdf5cb75f7a3916d083b -Author: Ovidiu Sas -Date: Tue Jan 13 09:33:57 2015 -0500 +commit 753a2eff3c03ad0fd3765b47abbe16786a49dfe6 +Author: Daniel-Constantin Mierla +Date: Tue Feb 9 11:49:48 2016 +0100 - udp_server.c: logging: DBG -> LM_DBG + ims_dialog: updated names for doc files -commit 3abd770aa985e8cd74d1e976056445193fc55f36 -Author: Ovidiu Sas -Date: Tue Jan 13 09:30:40 2015 -0500 +commit 08638e87b9e4a846dc2c664494056a113f7a2b6f +Author: Daniel-Constantin Mierla +Date: Tue Feb 9 11:48:04 2016 +0100 - usr_avp.c: logging: DBG -> LM_DBG + ims_dialog: set the inner name after rename -commit 4ab89ca37c55f6631a37681d1937c47d6ac158d8 -Author: Richard Good -Date: Tue Jan 13 16:16:13 2015 +0200 +commit 8674077b6078f941ab1519bfd6f3ed6e3e34075d +Author: Daniel-Constantin Mierla +Date: Tue Feb 9 11:47:10 2016 +0100 - modules/ims_registrar_scscf: improved log line + ims_usrloc_scscf: include path updated for ims_dialog -commit 0e1b2bc99e04547b8a7482197412dc9b866eb320 -Author: Richard Good -Date: Tue Jan 13 15:58:38 2015 +0200 +commit b88f23d1e4d34049a68831333a55f9cff5834987 +Author: Daniel-Constantin Mierla +Date: Tue Feb 9 11:46:52 2016 +0100 - modules/ims_registrar_scscf: added logging of return code on NOTIFY response + ims_registrar_scscf: updates for renaming ims_dialog -commit ae491ab355f0b2441bc20060154107b9163597de +commit 2663956190789f63ccaf957edbf36c384ac6eece Author: Daniel-Constantin Mierla -Date: Tue Jan 13 12:39:10 2015 +0100 +Date: Tue Feb 9 11:46:20 2016 +0100 - exec: proper handling of empty headers for exec_bash_safety + ims_qos: updates for ims_dialog renaming -commit 55393719873b39c3fe66689539e35cf6c8969abe -Merge: 8a85d8f 160710a -Author: Victor Seva -Date: Mon Jan 12 22:21:33 2015 +0100 +commit 03079a3d9de774ef17c6987960d6cb7acb46cdc1 +Author: Daniel-Constantin Mierla +Date: Tue Feb 9 11:45:51 2016 +0100 - Merge pull request #28 from seudin/siputil_fix - - siputils: fix for e164_check() - Closes #28 + ims_icscf: updates for ims_dialog -commit 8a85d8fd251175ec784d165817c3e22c5350a275 -Author: Eloy Coto -Date: Mon Jan 12 15:14:52 2015 -0500 +commit 082af1793d287624a1985d8ffbc448f92cc855d9 +Author: Daniel-Constantin Mierla +Date: Tue Feb 9 11:45:20 2016 +0100 - Statsd: code cleanup refactoring + ims_charging: updates for ims_dialog -commit 160710af0ab85dbf211fa7d445d6d4be9b66db10 -Author: Seudin Kasumovic -Date: Mon Jan 12 16:24:04 2015 +0100 +commit 9dab0cfbc587892b991d8cdaa39a55e167b4334c +Author: Daniel-Constantin Mierla +Date: Tue Feb 9 11:43:42 2016 +0100 - siputils: fix for e164_check() - - - the condition for non-digit matching was always false + ims_auth: updates for ims_dialog -commit e7c27cbb89f1309ff917f04bc45072b089b2c496 -Author: Richard Fuchs -Date: Mon Jan 12 10:20:22 2015 -0500 +commit c6433d8d58d3f78d4cf806d66705bc8f59d07842 +Author: Daniel-Constantin Mierla +Date: Tue Feb 9 11:33:18 2016 +0100 - rtpengine: fix $rtpstat for double setid operation and new dictionary layout + Makefile.groups: renamed dialog_ng to ims_dialog -commit b881e2846dd2cde67758c59ba1d629f30fa8064a -Author: Andrey Rybkin -Date: Mon Jan 12 17:43:58 2015 +0300 +commit a5176c88d36f68a7342986f384d185b8f348bf93 +Author: Daniel-Constantin Mierla +Date: Tue Feb 9 11:32:32 2016 +0100 - dmq_usrloc: renamed from usrloc_dmq + ims_dialog: renamed the main file of the module to ims_dialog.c -commit 06557a25af96d3de05d0302f202e6c4cbd0b84e9 -Author: Olle E. Johansson -Date: Mon Jan 12 14:56:48 2015 +0100 +commit 5b32b1301ded6862b1a0db12324e821bad5e64c8 +Author: Daniel-Constantin Mierla +Date: Tue Feb 9 11:30:42 2016 +0100 - async: Clarify difference between modparam("async","workers",x) and async_workers in core config + dialog_ng: renamed to ims_dialog + + - reflecting better the target usage at this moment + - future considerations can results in merging both dialog modules in a + single one -commit a8ecf651aca0629fdb3c8576d020e2e968b1f23e -Author: Andrey Rybkin -Date: Mon Jan 12 16:46:13 2015 +0300 +commit 326adcfa3fa644e1b27b075d2305b2a3649b20c9 +Merge: 8eb9f92 8bf0325 +Author: Daniel-Constantin Mierla +Date: Tue Feb 9 10:45:46 2016 +0100 - Add GPLv2 license + Merge pull request #504 from kamailio/co/tcp_closed_event_enhancements + + tcp:closed event enhancements -commit e688d656427dd00d48f1e309c5d8ef991e432b67 -Author: Richard Good -Date: Mon Jan 12 15:08:08 2015 +0200 +commit 8eb9f9278c98a7bdb09d1c6d2748ab5bcd4519b1 +Author: Daniel-Constantin Mierla +Date: Tue Feb 9 08:36:24 2016 +0100 - modules/cdp: new mod param: workerq_length_threshold_percentage + etc/kamailio.cfg: small polishings - This is the threshold of the length of the worker queue as a percentage of - the maximum queue size - when exceeded a warning is written to the log - file. Nice to check if worker queue is growing. + - drop silently traffic from scanners + - removed fork=yes (it is default value) -commit c109755d347500d8dcfa92a75cb11c9cea2727c2 -Author: Walter Doekes -Date: Mon Jan 12 12:05:52 2015 +0100 +commit 8bf032566a810f7fa60dd96310be8d9a5095b032 +Author: Camille Oudot +Date: Mon Feb 8 20:03:21 2016 +0100 - websocket: Check frame->wsc in ws_frame_transmit for NULL. + tcpops: update README + +commit bc7dc166858d0def2c827ff7be037bfcaa9f0e7e +Author: Camille Oudot +Date: Mon Feb 8 19:59:19 2016 +0100 + + tcpops: add "disabled mode" to closed_event param - Add frame.wsc == NULL check in ws_frame_transmit similar to the checks - in ws_close and friends and ws_frame_receive to avoid crashing if the - tcp connection was been terminated prematurely. + this mode will bypass the event callback registration to improve + performances when the "tcp:closed" route feature is not needed -commit 85fcd786e20ed1f06dad1746029a7056b0476a98 -Author: Eloy Coto -Date: Mon Jan 12 07:26:19 2015 +0000 +commit af0cc3c6a961de85c98e68df72d3b26b35e89ffc +Author: Stefan Mititelu +Date: Mon Feb 8 11:03:39 2016 +0200 - Warning cleanup. + tmx: Update doku + + Update doku for t_is_request_route() config function. -commit 7886ddc516f5a4cef1d3730306a2a2ded06d4986 -Author: Daniel-Constantin Mierla -Date: Mon Jan 12 11:16:53 2015 +0100 +commit 98ae491145eab5457d672b1ae373aeec9dd3f1a7 +Author: Stefan Mititelu +Date: Mon Feb 8 10:55:00 2016 +0200 - ratelimit: _SC_NPROCESSORS_ONLN is available on FreeBSD + tmx: Add t_is_request_route() config function - - used for getting number of cpus - - reported on GH#24 + Add t_is_request_route() config function. -commit cf65a6ad41396bf5e67d23e12720c420688d7880 +commit adbbe8b62d6b4b95e5ecbab041b93bb3130f1932 Author: Daniel-Constantin Mierla -Date: Mon Jan 12 11:03:22 2015 +0100 +Date: Sun Feb 7 20:21:27 2016 +0100 - pipelimit: _SC_NPROCESSORS_ONLN is available on FreeBSD + auth_db: use username when querying for credentials via is_subscriber - - used for getting number of cpus - - reported on GH#24 + - for the case when credentials should not be stored, just discover if a + record exists for the user + - avoids buffer overflow by setting all credentials columns, while + trying to use only the first column + - reported by Anthony Messina, GH #500 -commit 49cbae4aab6c45a90080a40a7d4311e63d1311da -Author: Olle E. Johansson -Date: Sun Jan 11 22:21:57 2015 +0100 +commit 288840cb7b59d78332bfd9bf81a3fd146a679e5b +Author: Daniel-Constantin Mierla +Date: Sun Feb 7 19:59:55 2016 +0100 - tls change "ser.cfg" to "kamailio.cfg" in error message + presence_mwi: fixed indentation and trailing whitespaces -commit c8eeed253763d4407268494f89050b7681518091 +commit 619988ad6cf54d7e8154a9efb65ce2b9cb475e54 Author: Daniel-Constantin Mierla -Date: Sun Jan 11 16:51:36 2015 +0100 +Date: Sun Feb 7 19:55:25 2016 +0100 - core: removed unused code + presence_mwi: static declaration for inline function for eating spaces - - removes also some clang compile warnings + - based on a report by Anthony Messina, GH #502 + - get rid of undefined symbols for some compilers -commit bc2b423dc6d2ee59dfa511ae442c30f73f499750 -Author: Olle E. Johansson -Date: Sun Jan 11 15:02:57 2015 +0100 +commit 35fa264fe9a70627e9f17f75e0ce39ddbd3550ba +Author: Daniel-Constantin Mierla +Date: Sun Feb 7 19:54:47 2016 +0100 - timer Update header in source code + auth_db: removed trailing spaces for sane git diff -commit 910ab2f17ed4a1af3c358d4e2a7ef1d626992447 -Author: Olle E. Johansson -Date: Sun Jan 11 15:01:59 2015 +0100 +commit 2f405f14e0da76ad9e29f3b958ab85a91c6bbf31 +Author: Daniel-Constantin Mierla +Date: Sun Feb 7 10:25:00 2016 +0100 - timer Update documentation ("ser" => "Kamailio") + acc: regenerated the readme from latest docbook -commit 256d0776f0215af8dc56f717c6aab1375f0038a0 -Author: Olle E. Johansson -Date: Sun Jan 11 14:58:04 2015 +0100 +commit 169a835808b646fc6d32b2d6b8daa38ee7a6aa83 +Author: Daniel-Constantin Mierla +Date: Sun Feb 7 10:23:23 2016 +0100 - tmx Remove svn ID, fix doxygen + ims_registrar_scscf: added the readme -commit 5ddb3d46e381d6a60146ef1e04010d56d4d9e4a5 -Author: Olle E. Johansson -Date: Sun Jan 11 14:54:15 2015 +0100 +commit b4970c92cfed389d221782b091eb3984b7d6224f +Author: Juha Heinanen +Date: Sun Feb 7 08:28:51 2016 +0200 - pipelimit fix typo + modules/tmx: regenerated README -commit cd6f4f476936c033e7a63ccdc792b42682ed9f84 -Author: Olle E. Johansson -Date: Sun Jan 11 14:53:12 2015 +0100 +commit 8e20a3c5cf3036b203cda629d89659fb1c57c53b +Author: Daniel-Constantin Mierla +Date: Fri Feb 5 09:18:48 2016 +0100 - pipelimit Remove SVN ID and fix doxygen + corex: fix regression introduced with detection of ipv6 for send() + + - reported by Paul Arnold, GH #496 -commit 354ab05cd84033702c7a85236b4df9ee058012ea -Author: Olle E. Johansson -Date: Sun Jan 11 14:48:41 2015 +0100 +commit c0948493254429da9543a09afb50891b1ff9c58f +Author: Hugh Waite +Date: Thu Feb 4 17:17:24 2016 +0000 - ratelimit remove svn ID and history + http_client: documentation + - Complete devel guide for http_client C API functions + - Regenerate README -commit d97639266ff28184ea888656698fee4848e4c9f3 +commit 8667cbb1ed26c425ed474ea7ae0b867ee6c8b718 Author: Victor Seva -Date: Fri Jan 9 18:39:33 2015 +0100 +Date: Thu Feb 4 11:53:09 2016 +0100 - pkg/kamailio/deb: add new jansson module to kamailio-extra-modules + pkg/kamailio/deb: version set to 4.4.0-pre0 -commit 2f3ea2b7873983c97fb60fd6febcb3d36dc6192e -Author: Olle E. Johansson -Date: Sat Jan 10 17:34:29 2015 +0100 +commit 541c8d2c8d0c77f0c541417165a387ad2ed8def7 +Author: Hugh Waite +Date: Thu Feb 4 10:07:42 2016 +0000 - tls COnfiguration file update + http_client: Rename C API functions following module rename -commit 0cfc2f26556f87c90101853de77194c78ff68ec4 -Author: Olle E. Johansson -Date: Sat Jan 10 17:33:42 2015 +0100 +commit cd482b8680318efe995a2b375a5859c107b22f3c +Author: Hugh Waite +Date: Thu Feb 4 09:35:23 2016 +0000 - tls Remove history, change "SIP-router" to "Kamailio" + http_client: Fix build with older versions of libcurl + - Remove use of enums for curl TLS versions + - Increase logging to warning for invalid parameter values -commit 3fe4d11084336f4f3af03055b29a77ec593e6041 -Author: Olle E. Johansson -Date: Sat Jan 10 16:28:12 2015 +0100 +commit 7b838ee067ef309ae4c16b1b7f65902a1d16d072 +Author: Daniel-Constantin Mierla +Date: Thu Feb 4 10:56:30 2016 +0100 - pike Remove SVN ID's, remove history + Makefile.defs: version set to 4.4.0-pre0 -commit 54028ccb2082bbf33e510c0549afcdd862aa3920 -Author: Olle E. Johansson -Date: Sat Jan 10 16:24:32 2015 +0100 +commit 6297a0718f6f04d7b018d1046d78985826271a68 +Author: Juha Heinanen +Date: Thu Feb 4 04:43:40 2016 +0200 - h350 remove svn ID's and history + core: avoid compiler warning about variable cl being set but not used -commit 508b11011c85bb21e5bd4212a16fabb9136e22fa +commit 4108353148d4cdccae7f96c27e6fcbb53af5af8b Author: Daniel-Constantin Mierla -Date: Sat Jan 10 11:38:00 2015 +0100 +Date: Wed Feb 3 22:52:11 2016 +0100 - docbook/Makefile: use default system catalog implicitely - - - custom catalog can be forced with nocatalog=no + sipcapture: docs for topoh_unmask parameter -commit 42f63a7175e0e04fdb2b789a1e9b0d8dd8450600 +commit 99cc12f3fb0f114d406a2af0dcc1b48a41484134 Author: Daniel-Constantin Mierla -Date: Sat Jan 10 11:34:40 2015 +0100 +Date: Wed Feb 3 22:48:25 2016 +0100 - dispatcher: regenerated the readme file + sipcapture: new parameter topoh_unmask + + - if set to 1, call-id will be unmasked using topoh module api -commit aaf6c2bde1d5e3cd4443ed09c3d5767828a4bda4 +commit 91e5d1235423de4c36bebd251b77f94b11162b95 Author: Daniel-Constantin Mierla -Date: Sat Jan 10 11:33:50 2015 +0100 +Date: Wed Feb 3 22:40:52 2016 +0100 - dispatcher: refrashed description of dispatching algorithm 8 - - - priority based selection + sipcapture: removed trailing whitespaces -commit fb6f8e1138806a8dfebd7fcce0b0ba99e81afd3d +commit d1c6d080fda6b6768680b10780332122b0ff5ef7 Author: Daniel-Constantin Mierla -Date: Sat Jan 10 11:29:16 2015 +0100 +Date: Wed Feb 3 22:39:02 2016 +0100 - dispatcher: removed the svn id and history + sipcapture: coherent indentation -commit 736a8194a637b98bdabcae24bc9fa63c361486e5 -Author: Olle E. Johansson -Date: Sat Jan 10 09:47:18 2015 +0100 +commit 309e5fc8859f624b866e285fba004613ef3b92b1 +Author: Daniel-Constantin Mierla +Date: Wed Feb 3 22:35:29 2016 +0100 - doc Remove SVN ID's, remove history, change "SIP-router" and "ser" to "Kamailio" + topoh: exported inter-module api + + - contains function to unmask callid -commit bef223c9224af2b944ad80253aa78648c917041b -Author: Olle E. Johansson -Date: Sat Jan 10 09:21:45 2015 +0100 +commit 745e79d03095d3d716c17406f66b89a185adad3c +Author: Daniel-Constantin Mierla +Date: Wed Feb 3 22:03:29 2016 +0100 - Docs Remove SVN ID, minor updates + siputils: docs for sip_p_charging_vector() function -commit 910cbb415fe93def2a69809281b53c9c91e8e33e -Author: Olle E. Johansson -Date: Sat Jan 10 09:21:21 2015 +0100 +commit 2a9b4da18eac72f09e8b69cf447afeb978842ae1 +Author: Emmanuel BUU +Date: Wed Feb 3 21:56:30 2016 +0100 - README-MODULES Update module list + siputils: exported $pcv(name) var and sip_p_charing_vector() func + + - based on GH #215 + - $pcv(all) = whole field + - $pcv(value) = icid-value field (see RFC3455 section 5.6) + - $pcv(genaddr) = icid-generated-at field (see RFC3455 section 5.6) -commit 3035186160d4c9a1f12e12ba4fbbb5e10a54b2de -Author: Olle E. Johansson -Date: Sat Jan 10 08:57:18 2015 +0100 +commit ede4a836bd90b8da5a7b63f42ee238cb06933fe9 +Author: Emmanuel BUU +Date: Wed Feb 3 21:43:48 2016 +0100 - build system: Remove SVN ID and history + siputils: p-charging-vector header management + + - based on GH #215 -commit fe95e1ee9350cc64b6dd9739fffc4d8d19037db0 -Author: Charles Chance -Date: Fri Jan 9 20:48:19 2015 +0000 +commit be184b1b3759931e5f189796b48156249a500e42 +Author: Daniel-Constantin Mierla +Date: Wed Feb 3 21:23:50 2016 +0100 - registrar: regenerated README + kamctl: pi framework xml definition update -commit dd48dce8c526959207f295866b09404f0e5770bf -Author: Olle E. Johansson -Date: Fri Jan 9 21:44:36 2015 +0100 +commit b8b39e7d2f96cddd6ff2b7087c60f3f93fa90a1f +Merge: 2b9df7c 5ac088f +Author: Daniel-Constantin Mierla +Date: Wed Feb 3 21:18:36 2016 +0100 - dnssec Remove history + Merge pull request #489 from mslehto/valuesh + + modules/ims_icscf: removes values.h dependency -commit f1d4eb4bccfab6cb1e1785c5e56d4d997c8b2393 -Author: Olle E. Johansson -Date: Fri Jan 9 21:43:42 2015 +0100 +commit 2b9df7c32f30bbb1722b03907c152551c29fc10b +Merge: 686fdc5 651a9c5 +Author: Daniel-Constantin Mierla +Date: Wed Feb 3 21:16:10 2016 +0100 - enum Remove history, remove svn IDs + Merge pull request #486 from kamailio/lazedo/presence_improvements + + presence: improvements for 4.4 -commit 046b7c3c40106b662899cbbdc4c7fbf88432109a -Author: Olle E. Johansson -Date: Fri Jan 9 21:41:05 2015 +0100 +commit 5ac088f705468edffcef5cb669bbe28e4f3a905b +Author: Mikko Lehto +Date: Wed Feb 3 21:31:03 2016 +0200 - tsilo REmove SVN ID's, change "SIP-Router" to "Kamailio" + modules/ims_icscf: use INT_MAX instead of MAXINT -commit 14dcf2e6bffa174f12aface7290fc759b4488629 -Author: Olle E. Johansson -Date: Fri Jan 9 21:39:15 2015 +0100 +commit 686fdc59fc3bb5348ddd283b296b2f156c261fe3 +Author: Hugh Waite +Date: Wed Feb 3 18:47:39 2016 +0000 - xhttp_pi Remove history, update Doxygen + http_client: Clean up connection parameter definitions + - Add TLSversion enums to config file + - Add boolean types to config file + - Make connection parameter names consistent across default modparam/httpcon/configfile + - Update documentation and README -commit cc97adb901b0682bfe662482a4b0309d3d5e4635 -Author: Olle E. Johansson -Date: Fri Jan 9 21:34:13 2015 +0100 +commit 466cf3386b8ca653580ec6552b89f57adae984dd +Author: Victor Seva +Date: Wed Feb 3 18:30:09 2016 +0100 - exec Copying quote from README just to make a point. + pkg/kamailio/deb: update version to 4.4.0~dev9 -commit ffc671a1296cbe591549ed4ec0e4aea1095b25f8 -Author: Olle E. Johansson -Date: Fri Jan 9 21:32:15 2015 +0100 +commit 8943cd2e9b771faa03fe12fb658325a80a913631 +Author: Daniel-Constantin Mierla +Date: Wed Feb 3 17:38:47 2016 +0100 - exec Remove svn id, remove history, add doxygen + Makefile.defs: version set to 4.4.0-dev9 -commit 8f86d2f16af57dc26229f721c9cb86b7f68208cd +commit 51fb7519fe4674a13c0ee1989030e712b96947bc Author: Daniel-Constantin Mierla -Date: Fri Jan 9 20:36:51 2015 +0100 +Date: Wed Feb 3 17:33:33 2016 +0100 - jsonrpc-c: fixed typo in header guard + Makefile.groups: group for http_async module + + - depends on curl and event2 libs -commit 8da79464132cf84c92ac47a566bf2d3e34263374 -Author: Victor Seva -Date: Fri Jan 9 20:31:48 2015 +0100 +commit 1a16f11fca4637dfbf90e2b1f9a70ea6fd2668fd +Author: Daniel-Constantin Mierla +Date: Wed Feb 3 17:25:54 2016 +0100 - tracis-ci: disable unit tests - - Not stable enough yet. We need to improve this + topos: update sip headers for initial request forwarding -commit 887167f8e34286e0bb069ddcbdbb260331909eed -Merge: 3b01cfa 4ff2c48 -Author: Charles Chance -Date: Fri Jan 9 19:17:57 2015 +0000 +commit 277d3afe6a9e16dae0b1cba00f147333687a03e8 +Author: Daniel-Constantin Mierla +Date: Wed Feb 3 17:25:23 2016 +0100 - Merge pull request #23 from kamailio/cchance/registrar - - registrar: check for local path on lookup + kamctl: refreshed db creation scripts -commit 3b01cfa4f8bc86e0060799fc455141bc6274fdfd -Merge: d28fdbb 2fe8749 +commit 4a9c9d01c563ed3a6f0bdba033aed77161065477 Author: Daniel-Constantin Mierla -Date: Fri Jan 9 20:11:26 2015 +0100 +Date: Wed Feb 3 17:24:55 2016 +0100 - Merge pull request #13 from alezzandro/master - - dispatcher: fixing some misspelled words and adding support for custom number of successful probing requests + lib/srdb1: updated xml shemas for topos tables -commit 4ff2c48d66a3bce2c491b44d0f1b5e939e5508ff -Author: Charles Chance -Date: Fri Jan 9 17:22:59 2015 +0000 +commit ddbf18a5fb131d37920a1b83260c08944239c8d5 +Author: Daniel-Constantin Mierla +Date: Wed Feb 3 12:57:11 2016 +0100 - registrar: update documentation to include path_check_local parameter + core: typef'ed the lump structure -commit 635f23b12eff2431ca9a14bb39f4204dc2a7227b -Author: Charles Chance -Date: Fri Jan 9 17:16:07 2015 +0000 +commit a7aa7a7c5a863d4d1f4e31fc307bb57051e26627 +Author: Olle E. Johansson +Date: Wed Feb 3 17:03:53 2016 +0100 - registrar: add optional check for local path during lookup() - - - when performing a lookup the Path (if present) is evaluated - and if the first hop is local we skip it to avoid looping. - - useful if multiple servers are sharing a common database, - each saving contacts with their local address as the Path. + http_client Add configuration file example -commit d28fdbb810fff638a1e0acce2dc1e3e5377ead37 -Author: Charles Chance -Date: Fri Jan 9 17:08:46 2015 +0000 +commit 0a1b5df76fededb0b9e065cd607d974bf8f333b5 +Author: Olle E. Johansson +Date: Wed Feb 3 16:58:30 2016 +0100 - htable: regenerated readme + tls fix typo in README -commit 95a7d14716bdcc7c8fd27bcf8f2449e719a02eac -Author: Charles Chance -Date: Fri Jan 9 17:06:14 2015 +0000 +commit e3bb82b99a0e8174852c180d567101d7d97ce370 +Author: Olle E. Johansson +Date: Wed Feb 3 16:57:34 2016 +0100 - htable: update documentation to reiterate importance of loading DMQ module first if enable_dmq is set - - - previously only mentioned in module dependency section + http_client update README -commit c32f75cc1a02537474614f52cecfd5a19c56184d -Author: Daniel-Constantin Mierla -Date: Fri Jan 9 17:58:12 2015 +0100 +commit 604a5c23f0abd15423c8846a5dd4e9403f6b3cd6 +Author: Olle E. Johansson +Date: Wed Feb 3 16:57:06 2016 +0100 - Makefile.groups: added grou for jansson modules + http_client Document new "config_file" module param -commit 9b4bdad0f23f47d28d3cabe1771d8bbc7590f86f -Author: Daniel-Constantin Mierla -Date: Fri Jan 9 17:24:49 2015 +0100 +commit e2a2128c82404d9f6d067fb8ab5e2001b843394d +Author: Hugh Waite +Date: Wed Feb 3 15:15:22 2016 +0000 - janssonrpc-c: new jsonrpc client module using jansson library - - - alternative to jsonrpc-c module, refactored to use jansson and - libevent libraries - - rescued from branch mgw/json + http_client: Add ability to load connection definitions from config file + - All current modparam parameters supported + - Default values given as modparmas will be used if not specified in config + - TODO: Cannot load defaults from config file -commit 2e6af40ed023c5dac59e39c18e85244e9308945e -Author: Daniel-Constantin Mierla -Date: Fri Jan 9 17:17:23 2015 +0100 +commit 3ba6c4451a98bf365e18b964354bd08381dd4f8f +Merge: c6f7edd 50fca23 +Author: Federico Cabiddu +Date: Wed Feb 3 15:30:33 2016 +0100 - jansson: new module for json doc handling using jansson library + Merge pull request #480 from grumvalski/async_http_mod - - alternative to existing json module, but with support for json-path - expressions - - rescued from branch mgw/json + http_async_client: non-blocking async HTTP client module -commit 2fe8749ab7bd7622d46a57ab88f90e35bb7b0164 -Author: alezzandro -Date: Fri Jan 9 16:59:11 2015 +0100 +commit 50fca238aa618d0c9dbf5c2d3681afa6a4a3a769 +Author: Federico Cabiddu +Date: Mon Jan 18 15:38:26 2016 +0100 - dispatcher: Corrected comments indentation + http_async_client: non-blocking async HTTP client module -commit 92db7b10f075e2b4e28545fc6c05d2001c2f198c -Author: alezzandro -Date: Fri Jan 9 16:57:48 2015 +0100 +commit a5286513c56f2a6e94385cb75bff1fdca3110e93 +Author: Camille Oudot +Date: Tue Jan 5 16:53:40 2016 +0100 - dispatcher: Moved init_state var declaration at beginning of ds_update_state function + pv: export some PV functions -commit f6744a8e3c452be6405dd6948738ff6377def2a7 -Author: alezzandro -Date: Fri Jan 9 16:53:35 2015 +0100 +commit c6f7edd4f644388a4b35bca9d9d8f4880b6b4620 +Author: Olle E. Johansson +Date: Wed Feb 3 13:47:05 2016 +0100 - dispatcher: Fixed default values for options probing_threshold and inactive_probing_threshold, setting them from 3 to 1 + http_client Adding template for developer's guide -commit 9153b9fa73ba27a5975c593329d944b5912eeae7 -Author: alezzandro -Date: Fri Jan 9 16:45:37 2015 +0100 +commit ff90dbd17fd041bf85d0cb7c3590b0493e8dba15 +Author: Olle E. Johansson +Date: Wed Feb 3 13:10:59 2016 +0100 - dispatcher: Edited docs xml file and generated README file using make command as suggested by @miconda + http_client Update Todo -commit 8d7b9db5d3b290c9f180dac8610a61a7cee9d192 -Author: Charles Chance -Date: Fri Jan 9 14:20:07 2015 +0000 +commit 864f74a295413577b3768e6bb2215fcfef094f4f +Author: Hugh Waite +Date: Wed Feb 3 11:49:19 2016 +0000 - pua_dialoginfo: do not free dlginfo_cell too early - - - it is required later in the dialog callbacks - - it will be freed anyway during dialog destruction + http_client: Rename module in module interface -commit 4ca850ad6375c8be056378eeb7adc35a7fd03c62 +commit 8c303bf1e9688169a9e1a475f2e4a6c1790357e8 Author: Olle E. Johansson -Date: Fri Jan 9 08:46:48 2015 +0100 +Date: Wed Feb 3 12:04:16 2016 +0100 - auth Remove SVN ID, remove history, change name from "ser" to "Kamailio" + http_client Rename "curlcon" => "httpcon" -commit 385e248dde60d16cd2f8ef5d1acae8b1c9bbc02c +commit 0af10a28f8ad72af9e58c10fd9cd296c317e08ad Author: Olle E. Johansson -Date: Fri Jan 9 08:40:03 2015 +0100 +Date: Wed Feb 3 11:57:30 2016 +0100 - speeddial Remove svn ID and history from source files + http_client Change names of counters and RPC call -commit 8006c3a2637342c21837e5332d3eeb75bb9bf7de -Author: Daniel-Constantin Mierla -Date: Thu Jan 8 23:18:50 2015 +0100 +commit 9ffff61534477aeac9da88045134acb89974ab55 +Author: Olle E. Johansson +Date: Wed Feb 3 11:54:01 2016 +0100 - presence: slot and presentity uri printed in log message - - - useful for understanding while deleting subscription from memory fails - to find the item + http_client change function names -commit 4d52cc0556d2e9cf334aca89325589f1c86b4dc7 -Author: Daniel-Constantin Mierla -Date: Thu Jan 8 17:15:19 2015 +0100 +commit da2ceb14c00cd86e6c7bcd160dfece8538414761 +Author: Olle E. Johansson +Date: Wed Feb 3 11:53:40 2016 +0100 - dmq: more initialization of pointers at declaration of vars + http_client update docs, fix errors -commit b27c38b71c09e6763e8412b7e33aab77af3dfc76 +commit 6260bd810bd6f1f54bbf43c9cc88bb64f4bce83a Author: Daniel-Constantin Mierla -Date: Thu Jan 8 16:10:00 2015 +0100 +Date: Wed Feb 3 00:02:07 2016 +0100 - dmq: initialize peer_list to NULL by default - - - credits to Olle E. Jonansson for testing and reports + htable: docs for cols attribute of hash table definition -commit b29a45f0a23ef0f1a26598a45d3e6eddc9dbedb5 +commit fd1471d8154ad2ae9c067cfe9df7fe9161510ae2 Author: Daniel-Constantin Mierla -Date: Thu Jan 8 16:00:47 2015 +0100 +Date: Tue Feb 2 23:45:01 2016 +0100 - dmq: be sure dmq_init_callback_done is initialized before accessing it + htable: don't sync back to db when cols per htable is set -commit cc5f96f9c847d285085b0b9809ff0db76ea0a835 +commit 955455aad0d078ec65458c8ca9fae6d91f00d4b9 Author: Daniel-Constantin Mierla -Date: Thu Jan 8 14:19:58 2015 +0100 +Date: Tue Feb 2 23:35:55 2016 +0100 - dmq: safety check for peer_list when calling the callbacks + htable: allow specifying column names per hash table - - can result in crashing if it is not set - - reported by Olle E. Johansson + - at least two columns must be specified, first is the one corresponding + to key_name + - the values of following columns are concatenated with a comma delimiter + - columns can be specified with cols attribute in htable definition and + they must be enclosed in quotes in order to be a valid sip parameter + value and be separated by comma + + modparam("htable", "htable", + "a=>size=4;dbtable=a;cols='key_name,val1,val2,val3'") -commit af9fba85608014b6ad9f1bfea69a40146bc48c64 -Author: Carsten Bock -Date: Thu Jan 8 11:45:46 2015 +0100 +commit a348a74269ec54143aefabc3d12a4fd0fb85dc7a +Author: Daniel-Constantin Mierla +Date: Tue Feb 2 16:54:17 2016 +0100 - ims_registrar_pcscf: Turn unneccessary Warning into INFO + kamdbctl: include topos tables when creating standard database -commit a41eab6bedf670f9f34f069b82a85c3a49c5e1bd +commit 362648d79f94280f8db2b8651719fed511cf1a37 Author: Daniel-Constantin Mierla -Date: Wed Jan 7 22:01:27 2015 +0100 +Date: Tue Feb 2 16:48:42 2016 +0100 - dialog: proper handling of dlg_set_timeout() for not confirmed dialogs + Makefile.groups: added topos module in standard group -commit 96478d66b7d0f78fab7e1aea666b5310281f1f00 -Author: Jason Penton -Date: Wed Jan 7 22:59:55 2015 +0200 +commit 62fd20ff32a97ac2d89c8e5560ba7a97f508d87d +Author: Daniel-Constantin Mierla +Date: Tue Feb 2 16:47:53 2016 +0100 - modules/ims_usrloc_scscf: fixed initializer when searching for contact + Makefile.groups: curl module became http_client -commit 9328918897d44bec0f0a393af91483c2413a1446 +commit 68717c2af058d02601f270ab7430a6cbf00dda33 Author: Daniel-Constantin Mierla -Date: Wed Jan 7 18:04:58 2015 +0100 +Date: Tue Feb 2 16:42:32 2016 +0100 - core: memset 0 the struct in first line parsing; split type and flags + topos: new module - topology stripping - - initialize to 0 first line struct msg_start_t in parse_first_line() - - split field int type in short type and short flags to be able to store - more info about first line without changes in other places of existing code - - set in flags if the protocol in first line is sip or http - useful to - avoid string comparison whenever needed to get the two very used - protocols + - provides topology hiding by stripping the headers with SIP routing + details -commit b22c63a930a3c8d4055ddeea48bb29b7fb3b2eb1 +commit ee4c74d68180b89b30a48a845d1b026a7a67f0de Author: Daniel-Constantin Mierla -Date: Wed Jan 7 17:02:45 2015 +0100 +Date: Tue Feb 2 16:41:29 2016 +0100 - ratelimite: take in consideration number of cpus for load - - - on multi core systems, the sums of stats can go over 100%, resulting - in out of range for expected load_value to be 0.0 to 1.0 - - safety checks to avoid overflows + kamctl: added db creation scripts for topos module -commit d9e87383613d4d24efe3d1eb144ad6c9cc30b2b0 +commit 087b987ef267b0aa128c795d794606e613419e37 Author: Daniel-Constantin Mierla -Date: Wed Jan 7 16:57:36 2015 +0100 +Date: Tue Feb 2 16:40:40 2016 +0100 - pipelimit: take in consideration number of cpus for load - - - on multi core systems, the sums of stats can go over 100%, resulting - in out of range for expected load_value to be 0.0 to 1.0 - - safety checks to avoid overflows - - reported by Luca M. + lib/srdb1: sml definitions for db tables of topos module -commit c52e4e13ea57702aeed45a7a2059b97faf4d06f6 +commit 76835b62986d2bb05b34c870b362126290b15317 Author: Daniel-Constantin Mierla -Date: Wed Jan 7 13:15:10 2015 +0100 +Date: Tue Feb 2 16:39:49 2016 +0100 - seas: fixed inline functions warnings for clang + kamctl: updates to sql creation scripts for rtpegine -commit d7111b957c4fb230e88f18f1e15039254e9c01ab -Author: Jason Penton -Date: Wed Jan 7 13:35:16 2015 +0200 +commit 049a27385904189682fc9c461d3fd31f3afab17e +Author: Daniel-Constantin Mierla +Date: Tue Feb 2 16:37:52 2016 +0100 - modules/ims_usrloc_scscf: fixed pkg_mem leak - free db_result + core: parser - typedef'ed via header structures -commit 29fe7a813b17af898dbe0c4e978dd05766f41aec -Author: Daniel-Constantin Mierla -Date: Wed Jan 7 11:30:01 2015 +0100 +commit de3afab1631fc6c617b66d03ebf173bbfe10a144 +Author: Olle E. Johansson +Date: Tue Feb 2 15:24:21 2016 +0100 - jsonrpc-s: safety check for str value of jsonrpc and method fileds + http_client Update TODO - - reported by Alex Balashov + Add note about stuff that needs a per-process handling (referring to a discussion between + HW and OEJ this weekend at Fosdem) -commit f8d64b1946503a766c6d5414f940db8479c5674a -Author: Daniel-Constantin Mierla -Date: Wed Jan 7 00:34:20 2015 +0100 +commit 78712dfc770c39742336f34375b967a88c7313d9 +Author: Olle E. Johansson +Date: Tue Feb 2 15:02:50 2016 +0100 - async: removed svn $Id$ + http_client Rename include file -commit dfb34a6516e358023543f2a30664d30ed723e934 -Author: Daniel-Constantin Mierla -Date: Tue Jan 6 23:41:59 2015 +0100 +commit fea3b93d4d6ac2d7bdc918560d5ced0f0f652591 +Author: Olle E. Johansson +Date: Tue Feb 2 14:58:48 2016 +0100 - core: use Sia header name instead of Via for HTTP responses sent out + http_client Rename module file -commit 54c178a9072339233085372e60e611ba889f46b3 -Author: Daniel-Constantin Mierla -Date: Tue Jan 6 23:23:43 2015 +0100 +commit fb1ffeaf7bb1e309278459c77f586ac0d2f46cb1 +Author: Olle E. Johansson +Date: Tue Feb 2 14:57:13 2016 +0100 - core: tcp - handle http read on \n\n EOH and deal with HTTP Via header - - - handling \n\n for http makes same code as for sip, being easier to - test injecting a request from file - - HTTP Via is not compatible with SIP Via, resulting in errors - replace - its name with Hia to be ignored. FS#237 + http_client Update README files -commit 72a616f074f554dfb177ca8ec2b55f9ff11ad352 -Author: Daniel-Constantin Mierla -Date: Tue Jan 6 22:24:35 2015 +0100 +commit 4e7921a50e9bc375e9de29d2d6dc22fba5cea5b7 +Author: Olle E. Johansson +Date: Tue Feb 2 14:52:14 2016 +0100 - utils/protoshoot: fixed name and ticks - - - version to 0.4 + http_client Rename doc files -commit d8642e20ae37e7724b9b9c517054b5d41c3c52f8 -Author: Victor Seva -Date: Tue Jan 6 21:55:25 2015 +0100 +commit eb2f18e3a157512175cdb84b05455ab22db72655 +Author: Olle E. Johansson +Date: Tue Feb 2 14:49:32 2016 +0100 - test/travis: move travis scripts to tests/travis ( Closes #20 ) + curl Rename module to http_client -commit 575c2054a0621c73f2a1c70fbf0019618fa1ed10 -Author: Victor Seva -Date: Tue Jan 6 11:55:46 2015 +0100 +commit 319904b7fb674855d72461550c40f0c3adeab5cc +Merge: 1b6fe67 f604bc4 +Author: Federico Cabiddu +Date: Tue Feb 2 13:06:35 2016 +0100 - travis-ci: exec test/unit tests + Merge pull request #494 from grumvalski/cnxcc_log - - Disable tests that do not pass on travis-ci environment right now + cnxcc: change some log levels from INFO to DBG + +commit f604bc4baf7b3332e661dba1c935a259112a4e72 +Author: Federico Cabiddu +Date: Tue Feb 2 12:48:07 2016 +0100 + + cnxcc: change some log levels from INFO to DBG + +commit 1b6fe67edf5fd3fedb759f1cc837b1148bc341c2 +Merge: 3d88a55 2f02050 +Author: Hugh Waite +Date: Tue Feb 2 11:05:07 2016 +0000 + + Merge pull request #481 from kamailio/tmp/hpw_curl_improvements - Closes #19 + curl: Add various curl and TLS options to curl module + - client key/certificate + - cacert + - sslversion + - cipher suites + - verify_host and verify_peer -commit d9bf755921fb63bfeefa49efa87687740e5c82d0 -Author: Victor Seva -Date: Tue Jan 6 11:30:02 2015 +0100 +commit 2f0205093803cbd3761e6ae0384b548c19b4e3e4 +Author: Hugh Waite +Date: Tue Feb 2 10:15:22 2016 +0000 - travis-ci: create MySQL and PostgreSQL kamailio databases for testing + curl: Ensure all values of verify_host are valid + - verify_host=1 is deprecated, automatically use 2 -commit d1dc67417309400ea458a4d7672d97277b59e5fc -Author: Victor Seva -Date: Tue Jan 6 12:37:03 2015 +0100 +commit 3d88a5516e0fb9693846831bf89786153f475192 +Author: Daniel-Constantin Mierla +Date: Tue Feb 2 09:15:27 2016 +0100 - test/unit: Add TESTS vars to control wich tests to exec and exit with error if one fails + pua_dialoginfo: don't free dlginfo structure in dlg loaded callback + + - the structure will be destroyed in a later dlg callback, enabled by + dlg_api.register_dlgcb(), via free_dlginfo_cell() + - based and includes partial patch from GH #492, by Phil Lavin -commit a8ce39b6deff14ab4beeaa45afb8b346bc9598ba +commit fe4d03c1cb1b9371d3dcd839a96611d33a74d966 Author: Daniel-Constantin Mierla -Date: Tue Jan 6 16:33:43 2015 +0100 +Date: Tue Feb 2 08:57:45 2016 +0100 - xlog: documentation for xlogm() and methods_filter + mtree: refreshed the readme -commit ec19b1330f10a88b74fef475a476318fef709342 +commit ebdf05f589329948d43fb05bd53c372e5dfec631 Author: Daniel-Constantin Mierla -Date: Tue Jan 6 15:58:45 2015 +0100 +Date: Tue Feb 2 08:57:04 2016 +0100 - xlog: new log function xlogm(...) - logs with method filtering + mtree: more documentation for mtree defintion - - same as xlog(level, message), fitering on methods - - new parameter methods_filter - a bitmask with internal sip method ids - to be skipped from printing logs. Default -1 (skip all) - - parameter can be set at runtime via cfg reload framework - kamcmd cfg.set_now_int xlog methods_filter 15 - - alternative implementation of FS#81 + - details about cols attribute -commit 5ae20460f0f89448cbb1590c61f19153ae77da79 -Author: Olle E. Johansson -Date: Tue Jan 6 13:21:02 2015 +0100 +commit 27e3ecb60702749837f2dc59d694933b12e3a7bd +Author: Daniel-Constantin Mierla +Date: Tue Feb 2 00:04:57 2016 +0100 - Topo: Remove svn IDs, update name from "SIP-Router" to "Kamailio" + mtree: allow specifying column names per tree + + - at least two columns must be specified, first is the one corresponding + to tprefix + - if more than two, then the values of those columns are concatenated + with a comma delimiter + - columns can be specified with cols attribute in mtree definition and + they must be enclosed in quotes in order to be a valid sip parameter + value and be separated by comma + + modparam("mtree", "mtree", + "name=mt;dbtable=mtree;cols='tprefix,tvalue1,tvalue2'") -commit e7593d59aa7b100e5f0df4a78de83d49b4cd4fb8 -Author: Olle E. Johansson -Date: Tue Jan 6 13:18:49 2015 +0100 +commit 5bd26e21cb6c9b7711f18b031b6e0d05349aab7e +Author: Daniel-Constantin Mierla +Date: Tue Feb 2 00:01:31 2016 +0100 - xlog Fix doxygen, remove history + core: wtimer - disabled debug message -commit d42155ef165058ecd0689ff272c56c123776d65a -Author: Olle E. Johansson -Date: Tue Jan 6 13:14:57 2015 +0100 +commit 5de62614f6c26f4f3ec6965bb69ba97b3aa83dc8 +Author: Daniel-Constantin Mierla +Date: Mon Feb 1 19:01:07 2016 +0100 - nat_traversal Fix doxygen, remove svn ID etc + crypto: documentation for register_callid parameter -commit 84568255661a76b0350b2fb949cd4c87a0fd36d1 -Author: Olle E. Johansson -Date: Tue Jan 6 12:29:33 2015 +0100 +commit a28bc7c4c2dc02d7cf1d267ffa53f4d7f983fb5f +Author: Daniel-Constantin Mierla +Date: Mon Feb 1 18:53:34 2016 +0100 - Doxygen Change product name + tm: use core sip routing api callid generator if available + + - if no component set a custom callid id generator, then the internal + one is used, like so far -commit 66589d42e1a715842ce45a201d33d5a0f0604aee -Author: Jason Penton -Date: Tue Jan 6 12:46:40 2015 +0200 +commit 0085398d088f7c3651c09af12a0bbff997a16bcc +Author: Daniel-Constantin Mierla +Date: Mon Feb 1 18:50:01 2016 +0100 - modules/ims_registrar_scscf: added function lookup_path_to_contact - - useful for trying to find a loose-routed path to a speccific contact + crypto: option to register a callid generator callback + + - use libssl random and hashing for generating RFC 4122 version 4 UUID + with high quality entropy that can be used as callid for requests sent + by tm, through sip routing core api + - new mod param: register_callid - set to 1 in order to register callid + genrator callback to core (default is 0) -commit 1d5ae98cbdaf8707936efa91a1f23d954f2ea6d3 -Author: Olle E. Johansson -Date: Tue Jan 6 11:31:40 2015 +0100 +commit 0ee31b2d29c4822ef6302411fcbe89aaee619e3a +Author: Daniel-Constantin Mierla +Date: Mon Feb 1 18:48:55 2016 +0100 - uac Remove SVN IDs, history + core: sip routing api - custom callid generator callback + + - allow registration of callback functions for different callid + generators -commit c99129422330d10befd9a85fcaa3228f111b039b -Author: Olle E. Johansson -Date: Tue Jan 6 11:25:56 2015 +0100 +commit 651a9c51a638b1b36adf710b295ee62e12fe0183 +Author: lazedo +Date: Mon Jan 25 13:24:32 2016 +0000 - Textops Fix doxygen, remove history, remove SVN IDs + presence: update documentation -commit 964fc8cc433fc994d6e138831a9d3f5840830eb5 -Author: Olle E. Johansson -Date: Tue Jan 6 11:20:42 2015 +0100 +commit a3088218936d7048b467a44682dd028346fa928d +Author: lazedo +Date: Mon Jan 25 13:24:01 2016 +0000 - siputils Remove SVN ID, remove history + presence: 4.4 improvements + + adds presence:notify-reply event + implements $notify_reply for handling in presence:notify-reply event + adds flags, user_agent columns to active_watchers + extends $subs to other subscription properties -commit a031da9863015cbaaa8539883086a9472b4823b7 -Author: Olle E. Johansson -Date: Tue Jan 6 11:12:30 2015 +0100 +commit b1daeaca382d39a76ed5d45a052f18cffa09298c +Author: lazedo +Date: Mon Jan 25 13:19:20 2016 +0000 - group Remove SVN IDs, remove history + presence: add flags and user_agent to schema -commit c3291cfe011ded5ff7a4e0a4378aa7987c318301 -Author: Olle E. Johansson -Date: Tue Jan 6 11:06:47 2015 +0100 +commit 97cd5d3188b1d3a2ef8f7105d753eeb1ee02c20b +Author: lazedo +Date: Sun Jan 31 00:01:30 2016 +0000 - dialog remove history, fix doxygen, fix spelling errors, remove svn IDs + kazoo: add amqps connection support -commit 6cf4ba4ed83b5f9e8dd736efee86174602cdd14e -Author: Luis Azedo -Date: Tue Jan 6 01:00:02 2015 +0000 +commit 8357543007760d941fcb92c12297f0109397853e +Author: Camille Oudot +Date: Fri Jan 29 20:00:20 2016 +0100 - kazoo : missing operator + tcpops: per-connection control over tcp:closed + + for enhancement #461 -commit fd3520acd7ab75890a0f514dfb349d94c2ce2807 -Author: Luis Azedo -Date: Tue Jan 6 00:03:08 2015 +0000 +commit df875b53340c9e09b6ca0baaa2154000d0bbba47 +Author: Camille Oudot +Date: Fri Jan 29 18:18:19 2016 +0100 - kazoo : missing operator + tcp: define new flag to control tcpop's tcp:closed + + for enhancement #461 -commit f95d0f58715954d78cec483ffa69ab1009d3d0f7 -Author: Daniel-Constantin Mierla -Date: Mon Jan 5 23:37:04 2015 +0100 +commit 094613b85d21e430fe9350722a99794bb2ae59bf +Merge: 868bf24 6627098 +Author: Camille Oudot +Date: Fri Jan 29 16:23:33 2016 +0100 - pv: new pv - $vn(name) + Merge pull request #491 from mslehto/bsdtcpops - - similar to $var(name) and able to hold $null - - default value is $null - $vn(x) = 0; $vn(x) = "abc"; $vn(x) = $null; - - $vz(name) aliased to $var(name) + Make tcpops module usable on BSD -commit 04999c90b074bf1571036ab88bb0a384a58f97a2 -Author: Victor Seva -Date: Mon Jan 5 19:07:08 2015 +0100 +commit 868bf2474c9d22e659875a2ac49553c4908553b2 +Author: Camille Oudot +Date: Fri Jan 29 15:46:59 2016 +0100 - travis-ci: set proper email notification options + mem/tlsf: return a valid pointer for malloc(0) + + for consistency with FM and QM allocators -commit 5e701d6a0826611dc980db2f434bee49e0fdcf88 -Author: Daniel-Constantin Mierla -Date: Mon Jan 5 18:50:40 2015 +0100 +commit 6627098eb4adad706d20f6b73d1b7e75cc08a21f +Author: Mikko Lehto +Date: Fri Jan 29 14:55:34 2016 +0200 - core: cfg parser - resolve conflict between proto:host and event route name + tcp: include netinet/tcp.h to make certain macros available - - there was a conflict on same kind of id:id format - - event route name is expected now only after an event_route + Following are tested: TCP_KEEPINTVL, TCP_KEEPIDLE, TCP_KEEPCNT -commit 39ffe589035fce17145023204b1005702e02a66f -Author: Daniel-Constantin Mierla -Date: Mon Jan 5 15:58:50 2015 +0100 +commit 676a2d0a8aaa8daeaf07947d6b63905cb19d0656 +Merge: b727c99 06a9516 +Author: Eloy Coto +Date: Fri Jan 29 09:04:09 2016 +0000 - core: preprocessor subst rules are applied to pv names + Merge pull request #488 from mslehto/statsd6 - - all name is matched and substituted before pv is looked up - - reported in FS#139 + modules/statsd improvements -commit dc9928ec99901ec713d1a79b02a8554ed5f6618e -Author: Victor Seva -Date: Mon Jan 5 15:38:26 2015 +0100 +commit bb1f0472614186e933c2caa002c151cf64b60756 +Author: Mikko Lehto +Date: Wed Jan 27 19:45:12 2016 +0200 - travis-ci: build only supported branches. Send email notifications on failure only + modules/tcpops: update list of platforms -commit 767fb51adbaecf37a0812731d9bf63a86f2b3c0e -Author: Luis Azedo -Date: Mon Jan 5 13:24:39 2015 +0000 +commit 957e8a04f798b9c30964005bdaedd895bd62f46f +Author: Mikko Lehto +Date: Wed Jan 27 19:22:41 2016 +0200 - kazoo : fix transform + modules/tcpops: fix documentation typo -commit e3ccc85989f5b285850ba64573ad2402f9dc9efa -Author: Jason Penton -Date: Mon Jan 5 13:50:19 2015 +0200 +commit ab7bf76e8d7cce405d4a90b727cde6be67015c4a +Author: Mikko Lehto +Date: Wed Jan 27 19:26:46 2016 +0200 - modules/imsr_usrloc_scscf: small cleanup in lookup + tcp: use macros from netinet/tcp.h to detect TCP feature + + makes tcpops module usable on FreeBSD 10 -commit 78324dcc09d0a51fa02a960a40faa7fdadddce66 +commit b727c99b8e74feec6ad1af0d01b2f4e46200ef46 Author: Daniel-Constantin Mierla -Date: Mon Jan 5 00:09:40 2015 +0100 +Date: Wed Jan 27 15:48:10 2016 +0100 - topoh: added note about making call-id when dialog module is used + core: explictely present the main process in description + + - along with existing attendant description -commit cf74b25690481dc5793eaf8f8d4831f0b30be291 -Author: Daniel-Constantin Mierla -Date: Mon Jan 5 00:05:22 2015 +0100 +commit b6e2dce80a607b12276addea310c9696c3c39ce9 +Author: Stefan Mititelu +Date: Wed Jan 27 10:50:22 2016 +0200 - dialog: readme built form docbook + rtpengine: Init and dealloc hastable locks + + Right now only alloc and destroy is done. Also do init and dealloc. -commit fed48b73fe11efa680d7950e73667e9d94466307 +commit fe37c011810d563f8a7e7d1e6856d7199dd1f5d2 Author: Daniel-Constantin Mierla -Date: Mon Jan 5 00:05:06 2015 +0100 +Date: Wed Jan 27 10:14:05 2016 +0100 - dialog: documentation for parameter lreq_callee_headers + core: Makefile.defs - renamed var CPU to CPUTYPE + + - some operating systems (e.g., suse), sets the CPU in the environment + to the cpu architecture, while the makefile uses it for cpu type + provided to -mtune parameter of gcc -commit d8c92fd3dc83a525665cae2b6e4071a66c6c0784 -Author: Daniel-Constantin Mierla -Date: Sun Jan 4 23:57:13 2015 +0100 +commit 73872420188b2eb0a5adb51a03a3c17baec1a331 +Author: Carsten Bock +Date: Wed Jan 27 10:15:58 2016 +0100 - dialog: option to add custom headers for local requests to callee - - - new parameter: lreq_callee_headers - - make topoh to handle properly dialog local requests (e.g., bye): - lreq_callee_headers set to: 'TH: dlh\r\n' - - reported by Alex Balashov + ims_charging: Fixed setting of AVP -commit b60b337e04f41d4b5262cb068f1bef6f827dba27 -Author: Daniel-Constantin Mierla -Date: Sun Jan 4 23:55:18 2015 +0100 +commit 6711306d48be16fcf1dff860f72d0db14cac02fc +Author: Stefan Mititelu +Date: Wed Jan 27 10:21:06 2016 +0200 - tm: safety check for CRLF at end of custom headers for local requests + rtpengine: Fix coredump on kamailio shutdown - - if hdrs value is not ending in '\n', add '\r\n' + Fix release_lock leading to coredump, when kamailio shutdown. -commit 0219d5a9090366292671eedc5e25f6c8434989c8 -Author: Daniel-Constantin Mierla -Date: Sun Jan 4 23:54:23 2015 +0100 +commit 9acbdd31a6e797dcb9aed568726965a568ac4fb7 +Merge: 55350c0 9867534 +Author: lazedo +Date: Tue Jan 26 21:16:51 2016 +0000 - topoh: discover local request direction from th cookie + Merge pull request #490 from kamailio/lazedo/db_text_buffer - - l can be used to mark local requests for topoh handling + db_text: add buffer size for reading text files -commit 0739e26397e08604eb7fa08ec36369b665009182 -Author: Olle E. Johansson -Date: Sun Jan 4 11:18:56 2015 +0100 +commit 98675340e429b752bdb8a4d7f7d6c1c5f60227d5 +Author: lazedo +Date: Tue Jan 26 19:40:51 2016 +0000 - shm_regex Remove svn id, history + db_text: add buffer size for reading text files + + the static value of 4096 may not be enough when dealing with presence + tables that have xml content -commit a5acd43d0e422692e0fc5114e6857a3959a7a7b4 -Author: Olle E. Johansson -Date: Sun Jan 4 11:16:46 2015 +0100 +commit 55350c0b54cd2e884b8f97f8686dbcb98769a6f3 +Author: Carsten Bock +Date: Tue Jan 26 19:30:20 2016 +0100 - binrpc remove svn ID, remove history + ims_charging: Added missing definition -commit c9f26b592c2d78394b2b99f7becb73d4c8f21364 -Author: Olle E. Johansson -Date: Sun Jan 4 11:10:14 2015 +0100 +commit fb040b05811b2979130bdf842345c927cd6c1888 +Author: Carsten Bock +Date: Tue Jan 26 18:37:36 2016 +0100 - srdb1 Remove SVN id's and history + ims_charging: Added changes after previous commit -commit af408c882ed70028c7dbc84b7876be996a49235e -Author: Daniel-Constantin Mierla -Date: Sat Jan 3 23:28:57 2015 +0100 +commit 5c7ee4576ea353d8d2ffba66ea29c57cd2c26a7b +Merge: 9c3ce39 789dec7 +Author: Richard Fuchs +Date: Tue Jan 26 12:34:01 2016 -0500 - tls: use atomic ops for config ref counter + Merge pull request #429 from smititelu/KAMAILIO-29 - - closes FS#380 + Rtpengine table changes -commit 395c2993b4342db16be401498290aa8a4b26ec56 -Author: Victor Seva -Date: Sat Jan 3 23:24:11 2015 +0100 +commit 9c3ce397a1baa45a7ee0123ff4e32bcf412506de +Author: Carsten Bock +Date: Tue Jan 26 18:22:36 2016 +0100 - pkg/kamailio/deb: version set to 4.3.0~dev3 + ims_charging: Add ability, to retrieve the Diameter-Status-Code for the Charging-Session -commit 6ef90a7035b6be860c3c5ccf431ec19add1fa619 -Author: Daniel-Constantin Mierla -Date: Sat Jan 3 21:32:59 2015 +0100 +commit d9b5cdab809ac32b63589f270561cda17abaadb2 +Author: Hugh Waite +Date: Tue Jan 26 12:45:33 2016 +0000 - Makefile.defs: version set to 4.3.0-dev3 + curl: Use correct modparam type for string params -commit 2c6dae747a934215b2c20928c489a9ed1f1733cf +commit 0e8a67b83a3ccb1113107402d9dda11b9829eaaa Author: Daniel-Constantin Mierla -Date: Sat Jan 3 21:32:17 2015 +0100 +Date: Tue Jan 26 00:35:57 2016 +0100 - Makefile.groups: added usrloc_dmq to extra group + core: secondary timer implemented as classic wheel timer (wtimer) -commit e938d587c3d4f1569478a68937bbf9592fae4593 -Author: Daniel-Constantin Mierla -Date: Sat Jan 3 21:30:34 2015 +0100 +commit 888fd8e287a6acc9313963d4d9b9af69127c0490 +Author: Mikko Lehto +Date: Fri Jan 15 15:42:38 2016 +0200 - usrloc_dmq: added readme file + modules/ims_icscf: removes values.h dependency + + Did not compile on FreeBSD 10. -commit d6ea0efa099abe5825b98408d8059618cec3ea64 -Author: Daniel-Constantin Mierla -Date: Sat Jan 3 21:29:37 2015 +0100 +commit 06a9516af72c87b9aa6e709f72eb6472951f398b +Author: Mikko Lehto +Date: Tue Jan 26 00:38:20 2016 +0200 - usrloc_dmq: fixed docbook format + modules/statsd: fixes incorrect socket() return value check and log message -commit 2f1c30a5458fef192c80a2d88e85d40c31e47cb1 -Merge: 03dfde0 68ca030 +commit f0313ae9edcaa2db39d265377e2f80344ced6dd5 Author: Daniel-Constantin Mierla -Date: Sat Jan 3 21:14:24 2015 +0100 +Date: Mon Jan 25 23:37:49 2016 +0100 - Merge pull request #3 from AndreyRybkin/master - - usrloc_dmq: add module for usrloc sync via dmq + core: renamed cycles to loops to reflect rotation of the wheel timer -commit 03dfde0fd7b24ab943b3929922573dc27fd41fb8 -Author: Olle E. Johansson -Date: Sat Jan 3 17:48:16 2015 +0100 +commit 8ead5ae6f4cd0b64226a838fcc03c9beca219d98 +Author: Mikko Lehto +Date: Tue Jan 26 00:36:01 2016 +0200 - usrloc Remove SVN id, remove history + modules/statsd: combine sock structure and error tracking variable -commit f1b15228b7de594cf9fa7b1f2cebc3834adf9628 -Author: Olle E. Johansson -Date: Sat Jan 3 16:48:29 2015 +0100 +commit 20cd36c671972d9ebb180884b70e1fd91a92a1cc +Author: Mikko Lehto +Date: Mon Jan 25 23:19:06 2016 +0200 - tm Remove svn ID, remove history, rename "ser" to "kamailio" + modules/statsd: enables IPv6 by using result from getaddrinfo() -commit d7d19dddf55b299503138da12a3e878ca81f28d2 -Author: Olle E. Johansson -Date: Sat Jan 3 16:03:35 2015 +0100 +commit c2ffa5b95f768f14ea3b1e30eed621c97ca1a025 +Author: Mikko Lehto +Date: Tue Jan 26 00:20:01 2016 +0200 - Stun Remove svn IDs update doxygen remove history + modules/statsd: fixes documented module parameter type -commit c11064e9780851f3277e8986c9326f4be2793b93 -Author: Olle E. Johansson -Date: Sat Jan 3 16:01:35 2015 +0100 +commit d3e0674c97ad9df80dd995269674e09728558db2 +Author: Daniel-Constantin Mierla +Date: Sun Jan 24 22:03:42 2016 +0100 - DNSsec Add doxygen, remove history and svn IDs + pua: if from_tag is not set, use empty string for db val + + - sqlite connector doesn't like null pointer for not null costraint + - reported by GH #345 -commit 269d0e61810f3adc9e0bc462922e448b32f86e4f -Author: Olle E. Johansson -Date: Sat Jan 3 15:58:40 2015 +0100 +commit bffa9b32e536ff3c21dec7e9c949249a518b8a81 +Merge: f302cc5 53fb42a +Author: lazedo +Date: Mon Jan 25 13:26:02 2016 +0000 - counters SVN ID removed, doxygen updates + Merge pull request #485 from kamailio/lazedo/db_text + + db_text: implemented raw query for UPDATE/DELETE/REPLACE -commit 2b8900d1abe2a6e63930b6060a286a1764c9c015 -Author: Olle E. Johansson -Date: Sat Jan 3 15:57:21 2015 +0100 +commit 53fb42ad1ca108bfd579bf9846c73255cb33766c +Author: lazedo +Date: Mon Jan 25 10:46:05 2016 +0000 - statistics Update headers,remove svn id, add doxygen + db_text: implemented raw query for UPDATE/DELETE/REPLACE + + also fixes db_free_result for non select operations + also improves replace by exiting on first match -commit 9f97c5e577cc461955c9090351ba93467d151439 -Author: Olle E. Johansson -Date: Sat Jan 3 15:51:11 2015 +0100 +commit f302cc5b878a07b18ced0bc78db0cca14ca8d602 +Merge: 505fb2c 0688bed +Author: Alexandr Dubovikov +Date: Mon Jan 25 00:11:34 2016 +0100 - snmpstats Update header, remove SVN $id$ and fix some doxygen + Merge pull request #484 from adubovikov/master + + modules/sipcapture: fixed function documentation -commit 0292eff5387bec0e7425c1b355a09525a40ccc0f -Author: Olle E. Johansson -Date: Sat Jan 3 15:34:46 2015 +0100 +commit 0688bed1e6b972a7363b4ef37e786a522a31772b +Author: root +Date: Sun Jan 24 18:07:07 2016 -0500 - srutils Update headers, add doxygen, remove svn ID and history + modules/sipcapture: fixed function documentation -commit 468b91a28f0a739b29233ab5c95096622d4e53e7 -Author: Olle E. Johansson -Date: Sat Jan 3 15:28:44 2015 +0100 +commit 505fb2c3c0f1aab1ece91514ad01debb8897efa4 +Author: Daniel-Constantin Mierla +Date: Sun Jan 24 21:56:25 2016 +0100 - libkcore Update core headers, doxygen, remove history and svn id + ims_qos: strip square brackets from ipv6 address for inet_pton() + + - reported by GH #364 -commit b73a8d9a6ae02a48d42d06503a67f3d86b3f2a38 -Author: Olle E. Johansson -Date: Sat Jan 3 15:19:28 2015 +0100 +commit bfb1d0eca4ad610ccb3f60800355424f282f94a1 +Author: Daniel-Constantin Mierla +Date: Sun Jan 24 17:39:14 2016 +0100 - lib README - update to Kamailio + usrloc: documentation for db_timer_clean parameter -commit 78c75ab0937c6e97be86c2785416637032fa45c5 -Author: Olle E. Johansson -Date: Sat Jan 3 15:17:38 2015 +0100 +commit 93b5d2e5098938e49831125622ee6a5a8ba002c4 +Author: Daniel-Constantin Mierla +Date: Sun Jan 24 16:50:29 2016 +0100 - Doxygen change "SER" to "Kamailio" + usrloc: option to clean up database on write back/through modes + + - enabled by db_timer_clean parameter + - deletes expired records from database using secondary timer + - can be helpful if there was an error on db client after the db + operation was done on server, as reported by GH #30 -commit 88693a29e2f69b9f25188bd09a02d02bc6901182 -Author: Olle E. Johansson -Date: Sat Jan 3 15:15:58 2015 +0100 +commit 540030214d51d9e3db1e863a34ed2586bad031de +Author: Daniel-Constantin Mierla +Date: Sun Jan 24 13:30:19 2016 +0100 - core Update headers, change "SIP-router" to "Kamailio", update doxygen file headers + dispatcher: regenerated the readme file -commit 2266bb9cc206112afe7a07e22f43100e5f94f3ce -Author: Olle E. Johansson -Date: Sat Jan 3 15:03:24 2015 +0100 +commit 95aad5185c5622dea9b3edb3a2711b65ad146675 +Author: Daniel-Constantin Mierla +Date: Sun Jan 24 13:29:56 2016 +0100 - Core Update of doxygen, removal of history, changing "ser" to "kamailio" + dispatcher: documentation for rpc command dispatcher.ping_active -commit a31cfa79bf35fc65920db0584295c23699d51a47 +commit 44c5d1c02e87024e075c5417838d2d33bcba35c8 Author: Daniel-Constantin Mierla -Date: Sat Jan 3 11:51:09 2015 +0100 +Date: Sun Jan 24 13:23:07 2016 +0100 - presence: readme rebuilt + dispatcher: rpc command dispatcher.ping_active + + - manage global pinging state (send or not the keepalive to + destinations) + - kamcmd dispatcher.ping_active 0 - don't send keepalive requests + - kamcmd dispatcher.ping_active 1 - send keepalive requests + - default value is 1 -commit 25a99503c2fb1733f201552028be9c030e48efe3 +commit 1828dcc00581822989a98c3e63244146200725d8 Author: Daniel-Constantin Mierla -Date: Sat Jan 3 11:50:46 2015 +0100 +Date: Sun Jan 24 13:18:58 2016 +0100 - presence: added section for subs_remove_match parameter in docs + dispatcher: refreshed the readme -commit 85029d414384912879b45a34bdeb8f1372cc3780 +commit 536b0ab1c2f74a2b4832f40e6c1ad5c83733521e Author: Daniel-Constantin Mierla -Date: Sat Jan 3 11:44:38 2015 +0100 +Date: Sun Jan 24 12:52:41 2016 +0100 - presence: configurable matching criteria to remove subscriptions from memory - - - adjusted the commit 74d73953327ad7702922b27ba37c71e3283659c3, being - reported that subscriptions are not found (Jan Gaida) + dispatcher: documentation for ds_timer_mode parameter -commit 02ca141bb8a741ad516f8d60c84006c8ed09c14d -Author: Olle E. Johansson -Date: Sat Jan 3 11:55:48 2015 +0100 +commit 77a2fae782c5a4c8c5c25bd594ad68193e046a49 +Author: Daniel-Constantin Mierla +Date: Sun Jan 24 12:27:13 2016 +0100 - core : Update include files - delete IDs, update doxygen, delete history + dispatcher: ds_timer_mode - new param to specify the timer proc + + - if set to 0 (default), main timer is used + - if set to 1, secondary timer is used -commit 6a0f438258996ed5cad4028b59fe3a3f5cbf955d -Author: Olle E. Johansson -Date: Sat Jan 3 10:53:17 2015 +0100 +commit 8087e661d8619fa028e51caf4fd32a4aaabc35e1 +Author: Robert Boisvert +Date: Sat Jan 23 12:55:52 2016 -0500 - Core Removed history, svn $id$ and doxygen udpates on the .c files + mohqueue: fixed Via processing + + - starts with the first Via + - includes complete Via + - call_tag placed in the correct location at end of buffer + - call_bufpos renamed to more correct meaning of call_buflen -commit df92a532f82a25f0b1ea0cb18cb800562d7f7a97 -Author: Ovidiu Sas -Date: Fri Jan 2 22:03:22 2015 -0500 +commit 420fa65f239d0eb2dc64ae559440eed6efab3dd1 +Author: Daniel-Constantin Mierla +Date: Sat Jan 23 18:21:50 2016 +0100 - core: don't do initgroups() if started by same user as -u - - closing FS#473 + Makefile.groups: added statsc module to default group -commit ad94c568accb5efb02657c82740b6e39db88f018 -Author: Olle E. Johansson -Date: Fri Jan 2 22:56:21 2015 +0100 +commit b5e16b18d889c84ae69ec03b91b9cc635e80c3ee +Author: Daniel-Constantin Mierla +Date: Fri Jan 22 19:31:36 2016 +0100 - xhttp Minor typo fixes in README + statsc: removed unused variable -commit ecbc0f34bd36d9559d4b8d78d7ba864d2fc6874e -Author: Olle E. Johansson -Date: Fri Jan 2 22:42:57 2015 +0100 +commit 41c3e93afd9d365ba831705632925bb18fbdd9c2 +Author: Daniel-Constantin Mierla +Date: Fri Jan 22 19:25:22 2016 +0100 - userblacklist Minor typo fixes in README + statsc: updates to readme file -commit 497777e042166e441767101db05c85ad69c13722 +commit ce027b038a925fcdad8ec31c18c4432ffc7fca43 Author: Daniel-Constantin Mierla -Date: Fri Jan 2 13:41:44 2015 +0100 +Date: Fri Jan 22 18:58:12 2016 +0100 - presence: more verbose debug message when failing to delete item from memory - - - re-ordered comparison expression to check first lengths + statsc: documented statistics tracking -commit 5573fded91a0dc330003ba064e524407d92b2a8a +commit be96761756daa73e7af2b7a7a6fd53ec77a7dee0 Author: Daniel-Constantin Mierla -Date: Fri Jan 2 11:22:21 2015 +0100 +Date: Fri Jan 22 18:47:32 2016 +0100 - tls: refreshed the README + statsc: documentation of rpc statsc.report -commit 99311ce3fd37eebd4c9f37d25b043c4fae8dd621 +commit 9bd5d2da7f92f0a45962b5adfce56d02defdecbd Author: Daniel-Constantin Mierla -Date: Fri Jan 2 11:21:39 2015 +0100 +Date: Fri Jan 22 18:40:18 2016 +0100 - tls: more documentation about tls method values - - - added notes about tls minimum versions + stats: rpc command renamed to statsc.report -commit 711833b82d17a8875ffa68a3314554a59cefb0f5 +commit 59ff0a65ca840705429debc0477c1c2f0a732f35 Author: Daniel-Constantin Mierla -Date: Fri Jan 2 11:18:47 2015 +0100 +Date: Fri Jan 22 17:29:32 2016 +0100 + + statsc: allow adding new statistics to trac via config parameters + +commit 7d810278ddca5671235672c85eb4da3520b02d2e +Author: root +Date: Fri Jan 22 11:26:04 2016 -0600 - tls: options to set TLS versions lower limit + statsc: fix compiler warnings: [-Wformat=] and [-Wunused-but-set-variable] + +commit 5efaf2292cfdee4d53ac4b263e37834f7c02b96c +Merge: 8ff1270 825b4fa +Author: Stefan Mititelu +Date: Fri Jan 22 16:48:20 2016 +0200 + + Merge pull request #483 from smititelu/master - - example: if method is set to TLSv1.1+, then the connection must be - TLSv1.1 or newer - - closes FS#502 + dtrie: sanity checks -commit 241ac2813d30792c713dd6e585bae3c1d6e76f47 -Author: Daniel-Constantin Mierla -Date: Fri Jan 2 11:16:28 2015 +0100 +commit 789dec73bd5f906b47ad95ee4e55ba2db3d7d3e2 +Author: Stefan Mititelu +Date: Wed Jan 20 10:11:49 2016 +0200 - core: don't do setuid() if started by same user as -u + rtpengine: rebuild rtpp_socks before send command + + - update node selection only from displayed nodes + - update rtpp_set_list alocation from get_rtpp_set() to mod_init(); + thus all procs will have reference to the list of sets. + - add locks for rtpp_set_head and rtpp_set - - closing FS#473 + - make rtpp_no shm variable guarded by rtpp_no_lock + - add rtpp_socks_size pkg variable + - compare rtpp_socks_size with rtpp_no and rebuild rtpp_socks if they differ -commit bc7c864f7892f5f5c85e3e29da26d8963f064f80 -Author: Daniel-Constantin Mierla -Date: Mon Dec 29 22:57:22 2014 +0100 +commit 825b4fabb9bb4b2cf58dc1205423b8ce5d5e08cc +Author: Stefan Mititelu +Date: Fri Jan 22 14:11:25 2016 +0200 - pua_dialoginfo: README regenerated + dtrie: sanity checks + + Segfaults reported by Igor, on sr-Users mailing list. -commit 240bf9d122a9800ccfcac320776fb89a2c60d544 +commit 8ff1270bc0a9443e9ed20016bd40bb6c27495c39 Author: Daniel-Constantin Mierla -Date: Mon Dec 29 22:56:38 2014 +0100 +Date: Fri Jan 22 12:16:07 2016 +0100 - pua_dialoginfo: documentation for new parameters - - - pubruri_caller_dlg_var and pubruri_callee_dlg_var + crypto: documentation for salt parameter -commit 0b9561347ef62b6370d066622db5c0a08a76e0ec +commit ee42c43a2772f53d15fd721160e34e8e06297b39 Author: Daniel-Constantin Mierla -Date: Mon Dec 29 22:49:10 2014 +0100 +Date: Fri Jan 22 12:06:38 2016 +0100 - pua_dialoginfo: indentation and better fit in 80chars line + crypto: generate salt based on keyword for better key-based security -commit a8381456b91512e2a892be680167363d6179272b +commit 8dc55f2ac2e76100993af7e13e1ebc403c2b5046 Author: Daniel-Constantin Mierla -Date: Mon Dec 29 22:39:57 2014 +0100 +Date: Fri Jan 22 09:40:58 2016 +0100 - pua_dialoginfo: store pubruri for caller and callee in dlg vars + crypto: declare variable at top of function - - to be restored upon restart - - based on a patch by Kristian Høgh, FS#360 + - declaration inside for loop is invalid in -Date: Mon Dec 29 22:26:46 2014 +0100 +Date: Fri Jan 22 00:39:24 2016 +0100 - pua_dialoginfo: load dialogs for dialoginfo event upon restart + statsc: new modules - statistics collector - - based on a patch by Kristian Høgh, FS#360 + - record the values of various statistics for a period of time, based on + a timer interval and provide reports about them via rpc + - reports implemented so far: + - list: the recorded values + - diff: the diff between values (val[T] - val[T-1]) -commit 487d4160b99a1a5ea48751d2f7404cb08e1f4546 +commit d5e57d353b2c962902d786ef081ccf06d6a9854e Author: Daniel-Constantin Mierla -Date: Mon Dec 29 21:23:01 2014 +0100 +Date: Fri Jan 22 00:38:15 2016 +0100 - db_mysql: fixing include in Makefile for many paths - - - sed matching should break at whitespace, to fix the case when - mysql_config returns multiple include paths - - reported by FS#503 + core: docbook - defined kamcmd entity -commit 7739284d78f85c42621cd3dd76dad0149c9329e4 -Author: lazedo -Date: Fri Dec 26 18:46:41 2014 +0000 +commit 063d5cfcb5cb685cd669249235be99c7cfcf1359 +Author: Daniel-Constantin Mierla +Date: Thu Jan 21 23:48:22 2016 +0100 - kazoo : fork process with tcp option + ctl: support for u specifier -commit e2aff53392c875f98754e9eb7a25964d68cace79 -Author: Olle E. Johansson -Date: Thu Dec 25 22:06:18 2014 +0000 +commit 5ff788247f7baffa0cabce01255f6eba0702b5c5 +Merge: eb067dd 1d28d1f +Author: Hugh Waite +Date: Thu Jan 21 15:13:30 2016 +0000 - db_flatstore: minor README update + Merge remote branch 'origin/master' into tmp/hpw_curl_improvements -commit 68ca030d02f1db0006294c9b227dd4f4d319d39e -Author: Andrey Rybkin -Date: Wed Dec 24 16:16:35 2014 +0300 +commit eb067dd33603099eb1fc92438834c302e3a00195 +Author: Hugh Waite +Date: Thu Jan 21 14:51:04 2016 +0000 - Fix contacts sync + curl: Implement additional TLS parameters + - Add per-connection useragent param + - Add sslversion modparam + - Add per-connection sslversion param + - Add per-connection client cert/key/ciphers + - Ensure all strings are null-terminated for libcurl -commit 6f9e5bea2aa1dcbf1944e54f17c4e9fd9088201e -Author: Andrey Rybkin -Date: Wed Dec 24 12:30:33 2014 +0300 +commit 74f9e04cff504b130fba6713613791fba093d5b4 +Author: Daniel-Constantin Mierla +Date: Thu Jan 21 15:12:43 2016 +0100 - Set tcpconn_id to -1 for records added via dmq + crypto: implementation of aes decrypt function -commit 3b1b8843fc2e6096e63d5040e3fb037d98aa55b3 -Author: Andrey Rybkin -Date: Wed Dec 24 12:01:59 2014 +0300 +commit e6cf3c9bc0018f96acaa4928089273480a54582f +Author: Daniel-Constantin Mierla +Date: Thu Jan 21 14:44:44 2016 +0100 - Update Makefile + core: wheel timer advertised as secondary timer + + - safety checks when running wtimer functions -commit cac6ea3edf630e2cbd3db09f408a2d5cbd9532e3 -Author: alezzandro -Date: Wed Dec 24 00:56:23 2014 +0100 +commit a482c5de01a56e0822493d6c917ae0f418aeebfb +Author: Daniel-Constantin Mierla +Date: Thu Jan 21 14:36:45 2016 +0100 - dispatcher: Changes to the docs for the new feature counting successful requests + core: start wtimer -commit 2e567ce1baac21d6e063a6924a80aff06da803cf -Author: alezzandro -Date: Wed Dec 24 00:52:53 2014 +0100 +commit 2c09f405cf28a42d551714e800310ec08e50f24e +Author: Daniel-Constantin Mierla +Date: Thu Jan 21 14:17:37 2016 +0100 - dispatcher: Adding new feature for counting successful requests before placing destination from inactive to active state (code) + core: wheel timer implementation + + - to be shared by modules needing to execute timer tasks, don't want to + interfere with main core timers, but don't do lots of operations to + create own timer -commit 1dd98c58cfc7eca6cb7b6db703d010804051c75c -Author: alezzandro -Date: Wed Dec 24 00:28:58 2014 +0100 +commit 1d28d1fd5485895cd8d7895a3ab410814d57b6bb +Author: Olle E. Johansson +Date: Thu Jan 21 08:44:49 2016 +0100 - dispatcher: Fixing misspelled words in some docs + curl Small TODO update based on e-mail to sr-dev -commit f0d642820e363090ad4a79a8c198e9f898bbde07 -Author: alezzandro -Date: Wed Dec 24 00:27:40 2014 +0100 +commit b2973bb9860a541f9b1459ea4260fb5b0dec0327 +Merge: 2d61298 5a2c043 +Author: Stefan Mititelu +Date: Thu Jan 21 09:36:30 2016 +0200 - dispatcher: Fixing misspelled words in some code's variables + Merge pull request #478 from smititelu/master + + debugger: fix segfault when dbg_sip_msg() is called with no params -commit 40971d1ed829bc8e18a684cd4431649acd47999e +commit 2d612982966d87ed1cc6f56b10886fe89a1c10c4 Author: Daniel-Constantin Mierla -Date: Tue Dec 23 10:25:58 2014 +0100 +Date: Wed Jan 20 23:35:49 2016 +0100 - core: use corelog level for debug messages when sending out fails + Makefile.groups: added crypto module to tls group - - allow better control of what is printed, FS#68 + - dependency on libssl -commit c10c13b2582fd667d24e691219939e224cffaf30 +commit 760c1d55dfa53e09ab1d6b87e157ea61fba24c24 Author: Daniel-Constantin Mierla -Date: Tue Dec 23 10:24:32 2014 +0100 +Date: Wed Jan 20 23:32:58 2016 +0100 - tm: downgraded err to warn when sending out for a branch fails + crypto: new module offering various cryptographic functions - - can happen if tcp connection is not active and no connect is set, FS#68 + - AES encryption/decryption functions + - encrypted data is given as base64 string to be able to use it with + config and sip messages -commit 88173da2b684a3a3f86ee01ac5de401f492ff240 +commit edb11dd06b895e0b532c81ddc703420f7e5e81a1 Author: Daniel-Constantin Mierla -Date: Tue Dec 23 00:51:45 2014 +0100 +Date: Wed Jan 20 22:46:14 2016 +0100 - siptrace: use the method from cseq header for tm replies - - - the hook in transaction structure is invalid for cancel replies, - because the transaction structure is built for invite - - reported by Klaus Darilion, FS#489 + utils: bock indentations fixed -commit aff1dcd3dc63c0fe124fc138d553da0723c615a8 +commit 64764ff9ce7d117a95d7a0d1d1edf232965d8def +Author: Hugh Waite +Date: Wed Jan 20 17:36:04 2016 +0000 + + curl: Add curl verifyhost option + - Renamed verifyserver to verifypeer to match libcurl + - Added default verifyhost modparam + - Added per-connection verifyhost override + +commit 0ce66908ee9da74806e2fa506ef98b5f9043e47c Author: Daniel-Constantin Mierla -Date: Mon Dec 22 21:41:53 2014 +0100 +Date: Wed Jan 20 18:30:30 2016 +0100 - core: safety checks on proto variable for dsn resolving + topoh: proper detection of cancel reply for processing - - avoid crashes if functions used inadequately with a null pointer + - reported by Alex Balashov -commit 0bbcbe8328d558a9bf3cb151ab53be93b09c2669 +commit 8d2a7a9d9ce530112a52d7489185710914c8cc67 +Merge: 79fb4e9 648d95e Author: Daniel-Constantin Mierla -Date: Mon Dec 22 21:37:43 2014 +0100 +Date: Wed Jan 20 14:10:08 2016 +0100 - nat_traversal: use local variable for port and proto on keepalive resolve + Merge pull request #477 from mslehto/stdbool - - safe execution for those resolving functions expecting PROTO_NONE - - reported by Jason Penton, FS#491 + Use C99 boolean -commit 7a6b86576220b423c4dc5ccab7e7f22a50be27bd +commit 79fb4e9c6fb433a5df546944a00e275f37648f17 +Merge: 35e71ff 4de2390 Author: Daniel-Constantin Mierla -Date: Mon Dec 22 18:37:25 2014 +0100 +Date: Wed Jan 20 14:09:50 2016 +0100 - tm: don't clean local vars when trying to append a new branch to an active canceled transaction + Merge pull request #476 from mslehto/mongodoc - - they are not set, reported by Ovidiu Sas, FS#498 + modules/ndb_mongodb: fixes documentation typo -commit e5bf2128f10cf40a1f32ec6ba5bb84a649ce8fca -Merge: b80314b 3cdfb23 -Author: Victor Seva -Date: Fri Dec 19 12:58:14 2014 +0100 +commit 35e71ff8ae434e90baae00801985bdfebcb07d0d +Author: jaybeepee +Date: Wed Jan 20 12:07:56 2016 +0200 - Merge pull request #10 from kamailio/vseva/travis - - pkg/kamailio: Initial Travis CI configuration + modules/ims_qos: missing return statement -commit 3cdfb23b6e9d13fea3ee0994b450279c3cc6a488 -Author: Victor Seva -Date: Thu Dec 18 21:41:46 2014 +0100 +commit 8effb18ca9ce7b1da257fc804d7bef0ec79297f3 +Author: jaybeepee +Date: Wed Jan 20 10:50:04 2016 +0200 - pkg/kamailio: Initial Travis CI configuration + modules/ims_charging: removed unused code linking to ims_usrloc_scscf -commit b80314b94b39a8735dca366cd64d55a64304b9f0 -Author: Carsten Bock -Date: Thu Dec 18 11:35:28 2014 +0100 +commit e010736858bb04766b5871fc6ede0b1279d84132 +Author: jaybeepee +Date: Wed Jan 20 10:36:53 2016 +0200 - ims_icscf: Comply with RFC3261: If no contact-header is present, this is not an error, the UA is just fetching bindings. - See: http://tools.ietf.org/html/rfc3261#section-10.2.3 + modules/ims_charging: added ability to send vendor-specific charge information + - this allows for call dispositions to be stored and reported on in OCS + - by default this id disabled (modparam - vendor_specific_chargeinfo=0) -commit 77368a713da1c3f4d4d33019491bbb78f3dccb4d -Author: Olle E. Johansson -Date: Thu Dec 18 08:22:01 2014 +0100 +commit c084e0b389cb63134f2752053e30529f2605c39b +Author: jaybeepee +Date: Wed Jan 20 10:31:38 2016 +0200 - xlog Minor README updates + modules/ims_charging: fixed charging stats -commit 7bf4c6d72774b521b4e9bbc5375c4e952a224676 +commit 475a2444c36a8255c5c7ca068721566346919b4a Author: Daniel-Constantin Mierla -Date: Wed Dec 17 23:34:21 2014 +0100 +Date: Tue Jan 19 20:36:58 2016 +0100 - auth_db: more details for is_subscriber() + uac: refresh content of readme -commit d948ca564b4f669905485e040e295f54bd3f36a2 +commit f1cf7f99caca99c379f4785ebb449e7b1b5d30aa Author: Daniel-Constantin Mierla -Date: Wed Dec 17 23:30:29 2014 +0100 +Date: Tue Jan 19 20:36:43 2016 +0100 - auth_db: fixed is_subscriber() when load_credentials is not set - - - the flag parameter can be also explicit on skipping the credentials + uac: documentation of flags returned via rpc command -commit 42f5eefc595d65ab5953232335f6f686661526ca -Author: Olle E. Johansson -Date: Wed Dec 17 22:19:16 2014 +0100 +commit 368f9ccdfefb9f9261c1b32f271c1d5838cb8fff +Author: Daniel-Constantin Mierla +Date: Tue Jan 19 20:27:32 2016 +0100 - userblacklist Remove the db definition file (now part of _admin) from the master xml file + uac: notes about the flags of remote registration profiles -commit f8b7aa5d37f4d834620399b8c2fe295620bb5e66 -Author: Olle E. Johansson -Date: Wed Dec 17 22:17:59 2014 +0100 +commit 49d4144480c463a94a8b56ed222c32d6075813f6 +Author: Daniel-Constantin Mierla +Date: Tue Jan 19 20:24:28 2016 +0100 - userblacklist Reorganize README and add section ID's + uac: reset the $uac_req(...) fields when assigning $null - The database parameters was at the end of the README, which is not like any - other module. + - was done only when NULL was passed, not for values with PV_VAL_NULL -commit 2376591772d4fb20f64613331256ddf97e8b7b07 -Author: Olle E. Johansson -Date: Wed Dec 17 22:05:04 2014 +0100 +commit 35c4a245b7408d595d671d4661f91900078d02db +Author: jaybeepee +Date: Wed Jan 20 09:57:44 2016 +0200 - userblacklist Adding section IDs to documentation + modules/cdp: prevent possible deadlock when searching for sticky peers -commit cb79f35594c6a5059d9b76da96b9945f75f897f2 -Author: Olle E. Johansson -Date: Wed Dec 17 21:44:15 2014 +0100 +commit 2d7a803d4dbd947c4d015e3cca8ec354876effd1 +Author: Hugh Waite +Date: Tue Jan 19 18:45:49 2016 +0000 - mangler Update README with section IDs, minor changes + curl: Add client key/certificate to curl_connect + - Use the client key, certificate and cacert modparams when provided + - Use the verifyserver modparam (default enabled) + - Implement per-connection verifyserver parameter + - Add ciphersuites modparam to override libcurl defaults -commit ae87f7c1d2fc860482c1c92c88a9ba6963b6bc81 -Author: Olle E. Johansson -Date: Wed Dec 17 21:25:49 2014 +0100 +commit 311ac224b589328047fdddf7e4eb4165af501707 +Author: Daniel-Constantin Mierla +Date: Tue Jan 19 14:27:21 2016 +0100 - tm Update readme with section ID's, fix typos + tsilo: remove inline from free_ts_transaction() definition - Yes, it was a boring flight... - -commit b450a769cff3b5c8ea0962299f6b087da089cd59 -Author: Richard Good -Date: Wed Dec 17 10:58:00 2014 +0200 - - Updated P-CSCF example with additional Rx_AAR params - -commit 3dda6086cdf86fd2ad36764759c9f9254bfd5fa7 -Author: Richard Good -Date: Wed Dec 17 10:55:15 2014 +0200 - - modules/ims_qos: Rx_AAR new params that let you set sub-id and sub-id-type - This allows users to specify sub-id and sub-id-type when calling Rx_AAR - If passed as empty then default is used - This helps with some PCRFs + - the prototype is without, resulting in compile warning -commit 6619c0d21d6ba862d30f41e93f87e0b3ec06cd02 -Author: Richard Fuchs -Date: Tue Dec 16 09:10:10 2014 -0500 +commit a86fa8f9c9d2a9f63732b43b1087e6cc5cba18fb +Author: Lucian Balaceanu +Date: Tue Jan 19 11:09:59 2016 +0200 - db_postgres: add new module vars "timeout" and "tcp_keepalive" + carrierroute: fixed possible kamctl fifo segfault - The "timeout" option enables a query timeout as well as a connection - timeout, set to the specified number of seconds. - - The "tcp_keepalive" option enables the kernel's TCP keepalive packets - on the PGSQL socket and sets the keepalive timer to the specified number - of seconds. Only supported if the platform supports the TCP_KEEPIDLE - socket option. + - introduced checks to reject contiguous -{OPTION}{PARAMETER} in kamctl fifo commands + e.g.: kamctl fifo cr_activate_host "-dproxy -p 49 -h proxy1" is not allowed -commit 7b883f58e418e13e31e5d2b25fd6f142f6aa42c1 -Author: Olle E. Johansson -Date: Tue Dec 16 11:31:16 2014 +0100 +commit 391c8ac03fc91029104b0c125e4c6e6184f1783a +Author: jaybeepee +Date: Mon Jan 18 11:52:17 2016 +0200 - registrar Update documentation for max_contacts + modules/ims_auth: prevent crash if suspended transaction disappears waiting for a MAR -commit 53cfb31a4b13afb16e6cbfe82993990ee1bbb8ef -Author: Olle E. Johansson -Date: Tue Dec 16 10:08:45 2014 +0100 +commit feb8c87d48041f59d71699e6fb7da5e47b325532 +Author: Daniel-Constantin Mierla +Date: Mon Jan 18 10:35:42 2016 +0100 - srdb1 Change error message. - - This error message is shown both if module is not loaded at all and if module actually doesn't - support the function. + uac: coherent indentation for uac reg code -commit d035d0fe5e6f8298c7973432216ee0ba16840124 +commit 7466ec937e50d274ec032d37f7de26eee1418625 Author: Daniel-Constantin Mierla -Date: Mon Dec 15 23:11:15 2014 +0100 +Date: Mon Jan 18 10:03:28 2016 +0100 - dispatcher: better phrasing of comment in the code + uac: support for initial delay of registration + + - delay initial registration with at least reg_delay value from uacreg + table -commit f8d3d4ae33f56460c147a5ab77f5de059e59e6c1 -Author: Olle E. Johansson -Date: Mon Dec 15 19:36:58 2014 +0100 +commit 5b9c5b7dfac1aa7eb98e7986fd3345e3f411783a +Author: Daniel-Constantin Mierla +Date: Mon Jan 18 09:15:37 2016 +0100 - README minor change + uac: update flags for disabled state when refreshing record from db -commit a2b52c52e8a2503c53825b82fb66d7af11b9bc4e +commit b711cb98b4111c4f1d7fe73ed005fd54e2634696 Author: Daniel-Constantin Mierla -Date: Mon Dec 15 12:37:42 2014 +0100 +Date: Mon Jan 18 09:08:20 2016 +0100 - dispatcher: proper filling of weights array when summ is less than 100 + uac: load flags column from database - - more comments on building the array for weight based distribution + - related to GH #369 -commit ecd5c5846483e9069df875a181b58de7f8035604 +commit 8fb9f17154ab17c41091b9d71b13b3089b79338a Author: Daniel-Constantin Mierla -Date: Sun Dec 14 22:21:14 2014 +0100 +Date: Mon Jan 18 09:07:40 2016 +0100 - dispatcher: take in consideration the value of maxload attribute + kamctl: updated db definition scripts for uacreg table -commit c882b3a70b5afe7cab9d9cc1e2e528af9e735b9d +commit c0166c037a9db4d0cc90e335541ea7b24add4768 Author: Daniel-Constantin Mierla -Date: Sun Dec 14 14:21:43 2014 +0100 +Date: Mon Jan 18 09:05:39 2016 +0100 - dispatcher: regenerated README file + lib/srdb1: uacreg table has two new columns - flags, reg_delay + + - store the flags for runtime behavior + - delay intial registration (allow to spread registrations over an + interval of time, not to flood the registrar at the same time) -commit 610a93ea038f9eb10ac611263891813b734fc7a0 +commit ee20f55a16e5015dd6e3ac76c318131240de6688 Author: Daniel-Constantin Mierla -Date: Sun Dec 14 14:21:06 2014 +0100 +Date: Mon Jan 18 08:41:42 2016 +0100 - dispatcher: dedicated section for attributes in docs + uac: reg - auth proxy address can be updated upon account refresh + +commit 5a2c0437693cd2ee08290892d15c8b64a8003784 +Author: Stefan Mititelu +Date: Fri Jan 15 14:10:48 2016 +0200 + + debugger: Update doku - - file format has it own section too + Document why debugger module should be loaded first in the module sequence. -commit cbce3372cd48246d62504d6949402e008b96d41c -Author: Juha Heinanen -Date: Sat Dec 13 03:51:43 2014 +0200 +commit 7b67ab4623f63cbf823be47a35135ba052278c9e +Author: Stefan Mititelu +Date: Fri Jan 15 10:55:49 2016 +0200 - modules/registrar: added 'q' xavp_cfg name + debugger: Restrict dbg_sip_msg() to REQUEST/ONSEND + + Allow dbg_sip_msg only from REQUEST/ONSEND route in a similar way as for + msg_apply_changes(). -commit bef88a0daac0d66b007d1ebb4155e521021fc17c -Author: Olle E. Johansson -Date: Fri Dec 12 23:38:37 2014 +0100 +commit 21a7ce6fe07c2e645519603eaff908dfd96be3cc +Author: Stefan Mititelu +Date: Fri Jan 15 12:28:02 2016 +0200 - dispatcher Add a function to check if a given set exist is memory + debugger: debugger_mod.c indentation + + Tab-like indentations for debugger_mod.c file. -commit 935f11ab8daf40ce48359c7a0f0b3759720ac5bd -Author: Olle E. Johansson -Date: Fri Dec 12 22:05:16 2014 +0100 +commit 8e8a71cc0b589bb881f56bbef370a1d19863d038 +Author: Stefan Mititelu +Date: Fri Jan 15 12:04:54 2016 +0200 - db_text Add support for empty strings as a replacement for NULL strings + debugger: Fix dbg_sip_msg() segfault - Some modules, like dialplan, doesn't accept NULL strings from databases. - db_text had no way to define a string as empty - all empty strings was NULL. - Adding a new option to change this behaviour. With "emptystring" set to 1 - db_text will not set an empty string to NULL any more. + Fix dbg_sip_msg() segfault when the function is called with no parameters. + Change the dbg_sip_msg() output format. -commit 79a23a4fc154ad1ff174c3a8c2a14c3c5f85f402 -Author: Daniel-Constantin Mierla -Date: Thu Dec 11 23:37:24 2014 +0100 +commit 2370c6dccec38be8576bd4234ecbbc5883972058 +Author: Carsten Bock +Date: Fri Jan 15 11:04:15 2016 +0100 - core: set log prefix only for sip messages + ims_charging: Added missing field in Ro-Session (introduced in previous commit) -commit d773cc1105e3c5c25ea06717854b5c084fd9d1b9 -Author: Jason Penton -Date: Thu Dec 11 22:11:14 2014 +0200 +commit 648d95e126a13986684db94136dc47d69a7cc27c +Author: Mikko Lehto +Date: Fri Jan 15 02:48:39 2016 +0200 - modules/ims_registrar_scscf: removed path vector being set on lookups, not necessary + modules/nat_traversal: use C99 boolean -commit d0c862c76fda42b467d1543bf98eca5678a81db3 -Author: Jason Penton -Date: Thu Dec 11 22:01:52 2014 +0200 +commit 5d2d7237ac0d64689b3ff4d6be256ff4bd74cef7 +Author: Mikko Lehto +Date: Fri Jan 15 02:48:11 2016 +0200 - modules/ims_usrloc_scscf: if no contacts left for IMPU change state from REGISTERED to UNREGISTERED + modules/statsd: use C99 boolean -commit 66b6f7e4520ade2a9cce91d8b229f08c94b83a1a -Author: Daniel-Constantin Mierla -Date: Thu Dec 11 10:47:09 2014 +0100 +commit 4de2390a4071530e808eddd86ee8926ec51524eb +Author: Mikko Lehto +Date: Fri Jan 15 01:28:12 2016 +0200 - siputils: is_tel_number() constraints on lenght and first digit after + - - - minimum one char and if first is +, then it must have another one, - which should not be 0 + modules/ndb_mongodb: fixes documentation typo -commit d33829e61642950ecfd41cf6ffa08c8ca2cd5ae0 -Author: Juha Heinanen -Date: Thu Dec 11 04:20:51 2014 +0200 +commit 6f46f87acf7b3772a2bc8902e6e73e0bdc293851 +Author: jaybeepee +Date: Thu Jan 14 11:22:07 2016 +0200 - modules/siputils: added is_numeric function + modules/ims_charging: add adjustments for rounding errors that creep in during interim charges + - this is a result of Ro interface only supporting second-based resolution in diam. msgs. to OCS -commit 398321567c6fd12b98b5a152a4f072043d81d1d9 +commit 256d5f754ddfa7c47086f18a6d15fb08ae6bff87 +Merge: dce9cea caeda23 Author: Daniel-Constantin Mierla -Date: Thu Dec 11 00:34:32 2014 +0100 +Date: Thu Jan 14 09:29:06 2016 +0100 - statsd: added content to overview sections + Merge pull request #475 from ianlin/master - - taken from announcement email + registrar: reg_xavp_cfg should not be reset when sock_flag is not set -commit 56c417b5ae29f0dd0387d59a6e9d8d203deb8855 -Author: Alex Balashov -Date: Wed Dec 10 17:42:06 2014 -0500 +commit caeda232d6e2d29a5da202c9db244b407c94ede2 +Author: Ian Yu-Hsun Lin +Date: Thu Jan 14 16:02:25 2016 +0800 - utils: http_query() now handles large replies properly. + registrar: reg_xavp_cfg should not be reset when sock_flag is not set - The callback function passed to CURL (CURLOPT_WRITEFUNCTION) malloc'd one buffer on the presumption that it would be called once. This is not necessarily true for large replies, so the callback was modified to realloc() the buffer upward as needed until all data chunks were retrieved. + - since there are functions like `registered()` would use it + - reported by Jayesh Nambiar (@jayesh1017) in the comment of GH#470 -commit e094286e7821b3470a9d191b6c1812833a017ab9 -Author: Daniel-Constantin Mierla -Date: Wed Dec 10 16:22:14 2014 +0100 +commit dce9cea1744c458afae1088935f4c2549689c454 +Author: jaybeepee +Date: Wed Jan 13 11:12:37 2016 +0200 - siputils: documented is_tel_number() function + modules/ims_registrar_scscf: prevent possible deadlock when generating reginfo NOTIFY requests + - moved the actual processing of the implicit impu set to create the XML to a separate processing + - seperate process will therefore pick up events, build the XML and send the NOTIFY/s + - TODO: make framework capable of multiple workers to process events -commit fbcfa198a2c89868fa021f6a63774425e480b27b -Author: Daniel-Constantin Mierla -Date: Wed Dec 10 16:14:16 2014 +0100 +commit a15affa4d5f35cf2bfdd793b50010318f34f3f08 +Author: jaybeepee +Date: Wed Jan 13 11:05:15 2016 +0200 - siputils: fix for e164_check() - - - the condition for non-digit matching was always false + modules/ims_usrloc_scscf,modules/ims_registrar_scscf: impus as string from subscription can be created in pkg or shm depending on argument passed -commit 42f431bc4ceefa32e044750ef60cf600f11fda25 +commit 072c88653e280004f86b4c41cfc4d92f3b21af1d Author: Daniel-Constantin Mierla -Date: Wed Dec 10 16:12:11 2014 +0100 +Date: Tue Jan 12 14:09:54 2016 +0100 - siputils: new function is_tel_number(val) + core: earlier execution of SREV_NET_DATA_RECV event - - returns true if the parameter is a telephone number (optional leading - + followed by digits) - - the parameter can contain variables + - allow capturing the traffic before topoh decodes it -commit dcdb73d792719e38844eef60f821365b587893d7 +commit 142fb5a289a6ff4b0cc631293f7acbb65414e889 Author: Daniel-Constantin Mierla -Date: Wed Dec 10 10:54:56 2014 +0100 - - dialog: reset local variables shortcuts after reply and failure processing - - - avoid using wrong values to find dialogs with processing of next messages - - reported by Julia Boudniatsky - -commit 56c880120c07443eceb732117f0f1aa3558dcfe5 -Author: Hugh Waite -Date: Tue Dec 9 19:05:31 2014 +0000 +Date: Mon Jan 11 22:31:20 2016 +0100 - registrar: Fix memory leak around path and outbound header parsing - - - Fix leak or parsed URI and URI parameter during a call to save() + siptrace: readme regenerated -commit 595909e8acc0e6d178e346bef6a08ca98ae7351c -Author: Eloy Coto -Date: Tue Dec 9 17:23:46 2014 +0000 +commit 2d2c0bec3170b3ef6c10dc9a3b9e990b8d50e0bc +Author: Daniel-Constantin Mierla +Date: Mon Jan 11 22:30:09 2016 +0100 - Add statsd module. - - Changes that I did before merge from my github project: - - Remove Readme.md and doc/statsd.txt - - Add README in the module. - - Change sprintf to snprintf - - Doc: Add valid ids into the sections. + siptrace: documented trace_mode parameter -commit a49feca3cba8d5f281ce48ceebea2e416d3508b9 -Author: Ovidiu Sas -Date: Tue Dec 9 11:10:59 2014 -0500 +commit 57e7b28bd811971f16154cee08acc2d2024dee76 +Author: Daniel-Constantin Mierla +Date: Mon Jan 11 22:23:48 2016 +0100 - dialplan: remove unused variables + siptrace: use SREV_NET_DATA_RECV event for incoming traffic with trace_mode=1 -commit 9a8bc0242200508f325b723d7c210b1e0dd6bf77 +commit 4fc969760d8eec6355ce661ccd3c5fd9ad2a36f0 Author: Daniel-Constantin Mierla -Date: Tue Dec 9 10:41:36 2014 +0100 +Date: Mon Jan 11 22:23:26 2016 +0100 - tmx: consistency to return $null when a $T_branch(id) value is not available + core: execute SREV_NET_DATA_RECV event -commit 755cdf054f19ba54bfa8298a492d20f0acf42359 +commit 34afdb987d55d984da49b5896649cea1fc3d075b Author: Daniel-Constantin Mierla -Date: Tue Dec 9 10:39:05 2014 +0100 +Date: Mon Jan 11 22:21:37 2016 +0100 - tmx: added missing break for $T_branch(id) variable + core: new event SREV_NET_DATA_RECV - - reported by Juha Heinanen + - to be executed if a sip message has been received -commit 4684743d130b0e4904eb5da21a171534b039d51b -Author: Olle E. Johansson -Date: Mon Dec 8 13:22:38 2014 +0100 - - pv Update error in docs. - -commit c7b7aadac363bc10bb3c09935dc2132d6b59b90e -Author: Olle E. Johansson -Date: Mon Dec 8 13:11:02 2014 +0100 +commit b57a2d7815ad374ba799af4b02c3bccd7942d539 +Author: Daniel-Constantin Mierla +Date: Mon Jan 11 22:20:43 2016 +0100 - db_text Add debug output for NULL value. + core: relocated sr_net_info_t struct for availability -commit 9b6292dd20b344a94823e78e1b3f87a4fff584d8 -Author: Olle E. Johansson -Date: Mon Dec 8 11:04:02 2014 +0100 +commit 581912f5ed117bb56087668aa7ac60a7b667d525 +Author: Carsten Bock +Date: Mon Jan 11 15:14:37 2016 +0100 - kamctl dbtext template - several fields can be NULL (they are not required for processing) + ims_charging: Properly check final_unit_action-flag for initial requests + + If final_unit_action flag is set in initial ccr response, kamailio need to send terminate request after the granted time instead of sending an CCR-UPDATE request. + + Patch by DileepNunna + + Closes Github #467 (Kamailio sending update ccr request instead of terminate request for initial ccr response having final_unit_action flag) -commit d17f162ee565b80ecd46b6f8f916a683748bf08b +commit 1771f7e489b060290b38fc0a428058ca7e2b5f42 Author: Daniel-Constantin Mierla -Date: Mon Dec 8 09:11:32 2014 +0100 +Date: Mon Jan 11 12:41:48 2016 +0100 - auth_db: added sections ids for functions + siptrace: new parameter trace_mode - - better reference for web indexing + - if set to 1, is using the SREV_NET_DATA_SEND event for sending HEP + packets to sipcapture server for packets sent to the network -commit 0cf6fdc78d2171dba8d31370b84da99d8c94fb29 +commit 53529269d88adf140985192cd4ba6e8174fcc231 Author: Daniel-Constantin Mierla -Date: Sun Dec 7 20:26:37 2014 +0100 +Date: Mon Jan 11 12:40:59 2016 +0100 - acc: fixed computation of extra accounting fields - - - introduced in previous commit - - reported by and credits for troubleshooting to Anthony Messina + core: execute event SREV_NET_DATA_SEND if data was sent to network -commit 4eebd5d5cbf6c3f8c6b350c6d7e62f4f2a3e7610 +commit 1f00d722aaefbd2515ae69ffdcf541143862d9fd Author: Daniel-Constantin Mierla -Date: Sun Dec 7 19:44:38 2014 +0100 +Date: Mon Jan 11 12:39:59 2016 +0100 - auth_db: added ids to parameters + core: new event SREV_NET_DATA_SEND - - better reference for web indexing + - to be executed if message was sent to the network -commit b0832752202bf62e5912c5a2a015a078ac1b5563 -Author: Olle E. Johansson -Date: Sun Dec 7 19:22:56 2014 +0100 +commit 8b3847085e793596528d4675acce467a2e7629b7 +Author: Daniel-Constantin Mierla +Date: Mon Jan 11 11:37:29 2016 +0100 - xlog Add minor note in docs about dependency on other modules + tls: regenerated the readme file -commit 1f3821d49311525921d8be4a48426e95f053c696 -Author: Olle E. Johansson -Date: Sun Dec 7 19:08:45 2014 +0100 +commit 59ce55977e91c399b86177060421d32dbbd7be06 +Author: Daniel-Constantin Mierla +Date: Mon Jan 11 11:37:07 2016 +0100 - tmx Add missing pseudovariables + tls: more details about tls.cfg reload -commit 101eccc8719d31016948834198ee6508b794865d -Author: Olle E. Johansson -Date: Sun Dec 7 19:02:19 2014 +0100 +commit 3022206747eaabc17ec711d955987a02b82e87e9 +Merge: 46d3a3e c46a5f2 +Author: Daniel-Constantin Mierla +Date: Fri Jan 8 15:02:26 2016 +0100 - dialplan updating author/copyright + Merge pull request #470 from ianlin/master + + registrar: do make use of reg_xavp_cfg -commit 11f3eb6788c1f4db5848b1c05e424aa81512d8d1 -Author: Olle E. Johansson -Date: Sun Dec 7 18:58:43 2014 +0100 +commit 46d3a3ef2314f3177d64beab466401104d3ff887 +Author: lazedo +Date: Fri Jan 8 02:52:04 2016 +0000 + + db_text: fix bug in raw query where clause + + wrong type was allocated - dialplan Add dialplan.dump RPC command +commit 53263a2ddad9bb118763516bcd7995652c4fb070 +Author: Hugh Waite +Date: Thu Jan 7 12:17:03 2016 +0000 -commit 7d6c87d4ba129dd2e7d28e183dbbf43b2df12557 -Author: Daniel-Constantin Mierla -Date: Sun Dec 7 12:23:07 2014 +0100 + tm: Reset socket variable while forking + - Reset sock_str variable so values from previous forks are not stored in contact_flows AVP - tmx: added its for mi functions in doc +commit c46a5f2792b8553ade871d98cfe892c5a48a3ff6 +Author: Ian Yu-Hsun Lin +Date: Thu Jan 7 19:10:51 2016 +0800 + + registrar: do make use of reg_xavp_cfg - - better indexing for web + - prevent from resetting sock_flag to -1 when reg_xavp_cfg is set -commit 5937c668d790262d88d220029e3c9e9b017a7901 -Author: Olle E. Johansson -Date: Sun Dec 7 11:41:24 2014 +0100 +commit 0d0c8d570b58c2a622a615b1c312acca4994d720 +Merge: 06a6ee1 a372f86 +Author: Stefan Mititelu +Date: Thu Jan 7 11:37:37 2016 +0200 - db_text Add newline at end of debug/info/error output + Merge pull request #469 from smititelu/master + + fix issue #463 -commit 8370ef43f0fbd2ee447ab65c5b5172677a47f644 -Author: Olle E. Johansson -Date: Sun Dec 7 09:19:00 2014 +0100 +commit a372f861f04b04f08d68f28a95f12a13776be891 +Author: Stefan Mititelu +Date: Thu Jan 7 10:32:37 2016 +0200 - evapi Add link to external library. + debugger: doku dbg.get_mod_* + + Overlooked due to copy/paste. -commit 6daafdb5b6c9fc72698d43f81656bd511cacce69 -Author: Daniel-Constantin Mierla -Date: Sat Dec 6 09:47:52 2014 +0100 +commit 3668618369a8a1db8cb3410c0a7f50ce74150cd2 +Author: Stefan Mititelu +Date: Thu Jan 7 09:58:42 2016 +0200 - Makefile.defs: version set to 4.3.0-dev2 + debugger: fix issue #463 + + Don't shm_malloc() while the lock is taken. -commit bf59479da6d49f087da6ff0b2eab9ced8830ef4c -Author: Daniel-Constantin Mierla -Date: Sat Dec 6 09:21:53 2014 +0100 +commit 06a6ee170bdbc45ef7462aec0631fd332a82c6c6 +Merge: ddb9171 fa0517f +Author: Stefan Mititelu +Date: Wed Jan 6 16:13:35 2016 +0200 + + Merge pull request #462 from smititelu/KAMAILIO-33 + + debugger: add fifos to set/get level/facility + +commit fa0517f83a09625d14ec0dd3f349a1033f274f86 +Author: Stefan Mititelu +Date: Wed Jan 6 14:06:07 2016 +0200 - ims_usrloc_scscf: fixed typo in str printing + debugger: update doku for rpc commands + + Update doku for rpc commands. -commit dc6d9ba4c4f581e37c2bcbb7f1a3b4defe847e13 +commit ddb9171c96ef54ceeeb984cb0d9dc6695d206cc6 Author: Daniel-Constantin Mierla -Date: Sat Dec 6 01:03:14 2014 +0100 +Date: Wed Jan 6 11:47:33 2016 +0100 - tmx: added section ids for functions + siptrace: coherent indentation -commit 8855e3e7fcece4ca2ab33e1f9c54b15831152400 +commit 40c8a62ce85cc14ecf4e30b17d322f9a4177ed8e Author: Daniel-Constantin Mierla -Date: Fri Dec 5 22:40:25 2014 +0100 +Date: Wed Jan 6 11:45:33 2016 +0100 - exec: use proper header field iterator to print env variables + siptrace: updated the log messages - - issue introduced with the patch for shellshock - - reported by and credits for troubleshooting to Kristian Kielhofner + - debug level and function name are added automatically by LM_*() macros -commit 8c3d167b63096d3b465c53aca92ee18c5255188c +commit 284c11ed16bdc5afcc9abf49c9f5c1749ce831e0 Author: Daniel-Constantin Mierla -Date: Fri Dec 5 18:17:39 2014 +0100 +Date: Wed Jan 6 10:05:35 2016 +0100 - core: keep the password only if the user part is set - - - a report by Timo Klecker + siptrace: don't execute core event for net data out for HEP packets -commit 3afb2ea88fea4765a73e37f24b40dff8c8487122 +commit 526fb4cdc2246284ecbd7de9ed65678da2dbe357 Author: Daniel-Constantin Mierla -Date: Fri Dec 5 16:39:32 2014 +0100 +Date: Wed Jan 6 10:03:00 2016 +0100 - acc: free extra attributes for db, radius and diameter + core: added msg_send_buffer() function to allow skipping execution of core events - - after the commit to allocate memory for extra attributes, only log - accounting was freeing the memory - - reported by Luca M. + - useful for non-sip messages sent out to skip execution of + SREV_NET_DATA_OUT, like HEP packets for sipcapture + - msg_send() is now a defined alias for msg_send_buffer() -commit f97be98d05664e9fef02942103d27e35eb3e1d3c -Author: Jason Penton -Date: Fri Dec 5 10:17:03 2014 +0200 +commit 144b3c54e4fc23e95e5601e38165defa7c377ba8 +Author: Stefan Mititelu +Date: Tue Jan 5 14:37:34 2016 +0200 - modules/ims_usrloc_scscf: fixed possible crash if out of pkg_mem + debugger: rpc module level/facility getters + + Add kamcmd rpc module level/facility getters. -commit fd5013eef0324479df28e78672ca9c050decf4b5 -Author: Juha Heinanen -Date: Thu Dec 4 08:12:20 2014 +0200 +commit 66943de4344c30fefa361f24213f01f8ef58d2c3 +Author: Stefan Mititelu +Date: Tue Jan 5 14:02:43 2016 +0200 - modules/cfgutils: added some RPC commands + debugger: rpc module level/facility setters + + Rename kamcmd rpc module level/facility setters. -commit a6d1a6ef65dc6e7a356ada2c71d95e04ff13f2b9 -Author: Olle E. Johansson -Date: Wed Dec 3 22:07:15 2014 +0100 +commit 33e082dd314a333c62bfbc176a392702cfd9f4cd +Author: Stefan Mititelu +Date: Tue Jan 5 11:42:47 2016 +0200 - dialplan Update documentation + debugger: destroy debugger shm hashtable + + Add a dbg_destroy_mod_levels() functions to be called on mod_destroy(), + thus avoiding shm leaks. -commit 9e1a1afd460183b3e00778ac7730ddfe6cf00a4d -Author: Richard Good -Date: Wed Dec 3 16:25:39 2014 +0200 +commit 70b3dc76a1eac47dc70d5624f27c7f39717ecb7e +Author: Stefan Mititelu +Date: Mon Jan 4 11:17:20 2016 +0200 - modules/ims_usrloc_pcscf: improved handling of wildcard userpart when matching contact - When wildcard matching contact we now check that host part matches contact host part or alias param + debugger: update doku for fifo commands + + Update doku for fifo commands. -commit c512ed9f19b903cb028769bc6c802280d2b0ddfd -Author: Richard Good -Date: Wed Dec 3 15:43:51 2014 +0200 +commit 2bd153ce083c81c78b58019cf7acae12646e14e3 +Author: Stefan Mititelu +Date: Tue Dec 29 17:33:55 2015 +0200 - modules/ims_registrar_scscf: improved log line + debugger: fifo module level/facility getters + + Add kamctl fifo module level/facility getters. -commit 28ff58cfffc4d2b7bc0d2d3d2365891ecb25fcb6 -Author: Juha Heinanen -Date: Wed Dec 3 09:13:49 2014 +0200 +commit f8a6d4e370bfe95d4968a1c29d275a91cdda12ce +Author: Stefan Mititelu +Date: Tue Jan 5 13:24:08 2016 +0200 - modules/pua: do not override send_publish return value at error - (cherry picked from commit 0ac4c8e579214a75b102f2f1c6877dffb2db8597) + core: add facility2str() function + + Add support to get the facility number given the facility string. -commit bc0a4370950ee6ad3723976af7bb13c6ff1f5202 -Author: Olle E. Johansson -Date: Tue Dec 2 21:52:27 2014 +0100 +commit 36629c11ff9fb3999f3ebf298a9e87bb2abc4885 +Author: Stefan Mititelu +Date: Tue Dec 29 13:07:42 2015 +0200 - db_text Add missing line feed at end of debug message + debugger: fifo module level/facility setters + + Add kamctl fifo module level/facility setters. -commit b82d6abb237153ec941067694b3190523b416766 -Author: Olle E. Johansson -Date: Tue Dec 2 12:02:14 2014 +0100 +commit bef6dd6bb52921a703db295ff7736ea5a8ad212e +Author: Daniel-Constantin Mierla +Date: Mon Jan 4 23:10:01 2016 +0100 - rpc docs: Updating to kamailio, adding entities + tcpops: include header for faked message to get rid of compile warnings + + - warnings resulted after the commit for event_route[tcp:closed] -commit 1d3da092556674abb2d83fa148db71bb21e330ab -Author: Olle E. Johansson -Date: Mon Dec 1 14:30:09 2014 +0100 +commit 5856d9848345a429c0a7bd91a6d9eccf45d067d3 +Author: Armen Babikyan +Date: Mon Jan 4 23:06:52 2016 +0100 - Renaming doc files + tcpops: framework to execute event_route[tcp:closed] -commit 91123f6c510e3fc127adaa1b4ffa1adba4a1a287 -Author: Carsten Bock -Date: Tue Dec 2 21:22:56 2014 +0100 +commit 1980c79d4fb2111c8c245045035f4ecb5d17fd7f +Author: Armen Babikyan +Date: Mon Jan 4 23:05:30 2016 +0100 - ims_qos: Updated example-config and documentation for the Rx-Interface + core: trigger event_route execution for unexpectedly-closed and client-closed tcp connections -commit 87c5ae365d3ea216476d9ff901e072eec7b7eb3e -Author: Daniel-Constantin Mierla -Date: Tue Dec 2 09:35:33 2014 +0100 +commit fa6465f92adf372c3307211a05688a2482d89353 +Author: Armen Babikyan +Date: Mon Jan 4 23:04:37 2016 +0100 - tmx: $T_branch(uri) - return uri of the branch when processing a reply in tm onreply_route - - - for other route blocks it returns null, the uri is available as $ru if the - route block handles a request + core: added event callback field for tcp closed connection -commit 6c14b13f118dc20daec39bdde40c030c14e2d9c3 +commit 6fe2b87e1a6dff2a4351d83e91bd0de809530241 Author: Daniel-Constantin Mierla -Date: Mon Dec 1 11:53:23 2014 +0100 +Date: Mon Jan 4 22:56:55 2016 +0100 - tmx: proper indentation to match the module style + core: fixed debug message warning -commit c6c4230fb0c4ca18f5c681c7195d3e1531255f3a +commit d5b22f5b3a880076b725e18c6e521b75c55aa249 +Merge: 96d0b4e bf56222 Author: Daniel-Constantin Mierla -Date: Mon Dec 1 11:50:15 2014 +0100 +Date: Mon Jan 4 22:54:07 2016 +0100 - nat_traversal: use dedicated function for testing via address against source ip + Merge pull request #447 from celan69/getifaddrs + + core: rewrite add_interfaces() with getifaddrs() based implementation -commit 0b10377df11977d7ddd7e6bf30fe060d1fe200aa +commit 96d0b4ecff3cd680861bbc2ac02151a77cb05cae Author: Daniel-Constantin Mierla -Date: Mon Dec 1 11:48:39 2014 +0100 +Date: Mon Jan 4 19:19:35 2016 +0100 - nathelper: use dedicated function for testing via address against source ip - - - reported by Igor Potjevlesch - - previous used functions was checking the presence of rport and - received parameters, ending in a wrong result for nat testing + presence_xml: safety checks for pkg alloc and buffer size -commit 194743bf0de92ae09fdc817e57863f6bdb159539 +commit 26fddd6d6eb604113a2ea9288c48d78a53dbed55 +Merge: d0372a1 bb2c9ea Author: Daniel-Constantin Mierla -Date: Mon Dec 1 11:47:19 2014 +0100 +Date: Mon Jan 4 19:07:43 2016 +0100 - core: dedicated function to check Via address with source ip + Merge pull request #460 from kamailio/lazedo/presence_xml_fix_dummy - - received_via_test() as alternative to received_test() which looks also - for rport and received parameters, confusing nat detection tests - -commit bb8e3355d0c7bafff9087b289cd271df8b638051 -Author: Richard Good -Date: Sun Nov 30 09:33:59 2014 +0200 - - modules/ims_registrar_scscf: removed incorrect domain unlock - -commit 5569491ae90a7c74689ecd7e923c88f93690112a -Author: Jason Penton -Date: Fri Nov 28 10:14:51 2014 +0200 - - modules/cdp: Add fix for order of AVP related auth sessions, like Rx. - - Session-Id restored as first header for request + presence_xml: fix pres_agg_nbody_empty -commit 022ae9be87b11838345a3d22b1170b280aef8aa7 -Author: Ovidiu Sas -Date: Thu Nov 27 16:45:06 2014 -0500 +commit bb2c9ea0b70a428dd115da5fa2c0e6482d9db7dc +Author: lazedo +Date: Mon Jan 4 16:12:46 2016 +0000 - tmx: fix warning: may be used uninitialized in this function + presence_xml: fix pres_agg_nbody_empty + + we were sending the presence element without the entity attribute. + it seems some UAs dislike this -commit 76ad065338e6970c09c5ed8bc0f84fd2bfdf0ac2 -Author: Ovidiu Sas -Date: Thu Nov 27 16:16:26 2014 -0500 +commit bf56222b89b7f47a00e63fe4386f254e648e448f +Merge: 8ddc618 d0372a1 +Author: Christian Kuehnke +Date: Mon Jan 4 16:29:33 2016 +0100 - tm: fix warning: may be used uninitialized in this function + Merge remote-tracking branch 'upstream/master' into getifaddrs -commit 9a46223c077c8d058cdc633563b0d9f14af332ae -Author: Daniel-Constantin Mierla -Date: Wed Nov 26 16:39:07 2014 +0100 +commit d0372a132767cf08dd8786692fe56922bbceece2 +Merge: 59c1823 97a921c +Author: lazedo +Date: Mon Jan 4 10:18:08 2016 +0000 - registrar: don't free r-uri branch attributes in lookup_branches() + Merge pull request #459 from kamailio/lazedo/db_text_replace - - just clear the values in sip_msg_t structure so the pointers can be - reused and avoid double free - - reported by Anthony Messina + db_text: add support for replace -commit b407273dbf0edbf34a0113f3984a7e780cf67d72 -Author: Richard Good -Date: Wed Nov 26 10:39:10 2014 +0200 +commit 59c1823b71871c4e35550414b7169ee28f50d53a +Merge: c7e411e ad168dd +Author: lazedo +Date: Mon Jan 4 10:17:57 2016 +0000 - modules/ims_registrar_scscf: added log line + Merge pull request #458 from kamailio/lazedo/presence_logs + + presence: additional info in logs -commit ed301d16f30195d9352245f782269f2b3ddf40cf -Author: Daniel-Constantin Mierla -Date: Tue Nov 25 16:07:31 2014 +0100 +commit ad168dd580d21e1896c21a41b91b7eee5e5e7f8b +Author: lazedo +Date: Mon Jan 4 05:17:09 2016 +0000 - kamctl: supress all output of which command searching for g/readlink + presence: additional info in logs - - based on patch and report by Morten Tryfoss, FS#492 + adds callid to NOTIFY log + adds log when multiple records are found in process_dialogs -commit 767c2bc60f7f5a601118329df2c16b2646dbb58f -Author: Daniel-Constantin Mierla -Date: Tue Nov 25 12:20:36 2014 +0100 +commit 97a921ca63bd5482a690fe8ba399b05fd0134129 +Author: lazedo +Date: Mon Jan 4 05:12:42 2016 +0000 - usrloc: fixed issue updating last_modified + db_text: add support for replace - - introduced in previos commit + implements replace with update/insert + + tries to update, inserts if not found -commit 69ef30a2fcf0c3b5f50747a3e7cf2a9c02d358c3 -Author: Richard Good -Date: Tue Nov 25 11:59:56 2014 +0200 +commit 8ddc618ddf6197fdb47d769559f2ea9ff820b413 +Merge: 875950d c7e411e +Author: Christian Kuehnke +Date: Thu Dec 31 00:50:14 2015 +0100 - modules/ims_registrar_scscf: Added missing release_ucontact when processing notifies + Merge remote-tracking branch 'upstream/master' into getifaddrs -commit 51d7fc62aad21d9bde8ef6f70c1baf40ce9217de -Author: Richard Good -Date: Tue Nov 25 11:58:24 2014 +0200 +commit c7e411edb3c68260d43f86ee6977d468c074836b +Author: Daniel-Constantin Mierla +Date: Wed Dec 30 21:18:23 2015 +0100 - modules/ims_usrloc_scscf: writing to db fix for update_impu - When writing to db for update_impu some incorrect fields were used, - now we write the fields directly from the impu_record + tm: reinit ref counter if attempting to free while still in wait timer -commit 16fd690d1857dfb16681d918f11ed0863cd3845c -Author: Morten Tryfoss -Date: Tue Nov 25 10:18:04 2014 +0100 +commit 94da0d648805b958d266b789015f66cef8628ae4 +Author: Daniel-Constantin Mierla +Date: Wed Dec 30 17:41:18 2015 +0100 - fixes for centos rpm specs + tsilo: check if tsilo hash table is still set when executing tm callback - - updates for rtpengine and the new modules + - freeing the transaction structure by tm at shutdown can execute this + callback, resulting in core dump (at shutdonw) if tsilo destroyed its + hash table already -commit e8a795a6a413ae453f619e3deaf36c26b85b0077 -Author: Victor Seva -Date: Mon Nov 24 14:48:16 2014 +0100 +commit ee7568cb7da1be0c3c3d4ba2cd5bada4b4895bee +Merge: d83a56b f703eff +Author: Daniel-Constantin Mierla +Date: Wed Dec 30 10:43:26 2015 +0100 - usrloc: fix db_update_addr and db_delete_ucontact_addr + Merge pull request #457 from phil-lavin/feature-dont-append-realm-to-username-master - use query WHERE columns depending on matching_mode option - -commit d0b1d97151c778745df2afbd5f1fcd6b15f8171e -Author: Richard Good -Date: Fri Nov 21 11:46:47 2014 +0200 - - modules/ims_registrar_scscf: Send full notify for all SUBSCRIBE, not just first one - -commit 877a018cc13714f4b3935a1f7009bd9d17f22366 -Author: Jason Penton -Date: Fri Nov 21 09:43:19 2014 +0200 - - modules/ims_isc: S-CSCF should add itself to beginning of path header, not the end. fixed. - -commit a538cf860139e2f72c2ab8f444908965125a9ec4 -Author: Richard Good -Date: Thu Nov 20 13:31:55 2014 +0200 + auth_radius: support for not appending realm to the username passed to RADIUS - ims_registrar_scscf: Added params to partial notifies - previously only done in full +commit f703effa2e2d6c6f426374d07d57636ecf248fd2 +Author: Phil Lavin +Date: Wed Dec 30 09:00:45 2015 +0000 -commit 96b29f927f8a8dc9a187ec17a9d6aa7547d3142c -Author: Jason Penton -Date: Wed Nov 19 16:13:25 2014 +0200 - - modules/ims_usrloc_scscf: fixed bug with contact counter per IMPU + auth_radius: support for not appending realm to the username passed to RADIUS + + - Implement append_realm_to_username parameter in auth_radius which allows + the unmolested digest username to be passed to RADIUS in the User-Name + attribute. This is required for some RADIUS implementations. -commit 43d023232ba73d74830e4b2678ed437820abb11a -Author: Olle E. Johansson -Date: Wed Nov 19 13:15:36 2014 +0000 +commit d83a56bcdfeb8ffc75166a62e11ceb4c057c3ce5 +Author: Daniel-Constantin Mierla +Date: Wed Dec 30 00:29:49 2015 +0100 - dbtext database definition: several fields in subscriber can be null - (cherry picked from commit 32791c6329bc54ad0b542c2459489a83433eae3c) + tm: don't free tm cell still linked in wait timer + + - wait timer should do the free + - friendlier handling of situation when modules binding to tm do + inconsistent unref operations -commit ea6a8ec6a9c5dd0888f9260f5189c186430bc484 -Author: Jason Penton -Date: Wed Nov 19 12:56:34 2014 +0200 +commit f0b5fa7415d81cfc6df1e4dd51cd508898df5419 +Author: Daniel-Constantin Mierla +Date: Tue Dec 29 23:48:39 2015 +0100 - modules/ims_isc: send path header in 3rd-party registration + tsilo: init and safety check for t value before unref -commit c04f9554df58b1323a46f6e40337fa34b34f1cc9 -Author: Juha Heinanen -Date: Tue Nov 18 04:32:35 2014 +0200 +commit 27495c7c34bf963e403c0f711daf9b76076d2ec3 +Author: Daniel-Constantin Mierla +Date: Tue Dec 29 23:39:18 2015 +0100 - nathelper: improved add_contact_alias() description - - thanks to Dan Christian Bogos for pointing out the deficiency + tm: silent mode when freeing transactions at shutdown + + - they are still linked in tm hash table as it should be, so no warn + message for that case -commit e5d9611884187952f7e05f3ee191320c5123c463 -Author: Andrey Rybkin -Date: Fri Nov 14 10:06:19 2014 +0300 +commit 1bd8d47148f375462d895ab5bac77eacc965f9c5 +Author: Daniel-Constantin Mierla +Date: Mon Dec 28 23:25:01 2015 +0100 - Add module for usrloc sync via dmq + permissions: regeneration of readme file -commit 80a7d7bb647a73098798fdc4f1c8acf40563ac7a -Author: Charles Chance -Date: Thu Nov 13 21:43:22 2014 +0000 +commit dcb116290209a6b42020a925bc657005c8e3048b +Author: Daniel-Constantin Mierla +Date: Mon Dec 28 23:24:38 2015 +0100 - dmq: Add find_dmq_node_uri function to API - based on patch submitted by Andrey Rybkin. + permissions: documentation for max_subnets parameter -commit c2dcf4dbd884b13423159a7d94a3cb9f4e1a3e87 -Author: Alex Hermann -Date: Thu Nov 13 19:54:26 2014 +0000 +commit 46b10dfe1941ab70676a10d5f61d749fd74dfa3c +Author: Daniel-Constantin Mierla +Date: Mon Dec 28 23:19:14 2015 +0100 - dmq: Let the handler know about the sending node + permissions: max_subnets - new parameter - Try to find a node based on the from uri of the incoming request and hand - it to the request handler. + - specify the max size for address subnets array + - default value: 512 + - if there are more subnet records in address tables than the value of + max_subnets, increase it -commit b1aadf4cf9ea8fa91465fadc24ad268398a74880 -Author: Alex Hermann -Date: Thu Nov 13 19:45:32 2014 +0000 +commit 82d7e06b09f02a2e6dab9f171586f9cd6f636f5b +Author: Daniel-Constantin Mierla +Date: Mon Dec 28 23:11:59 2015 +0100 - dmq: Add init_callback() to API + permissions: max size of subnet array set to 512 - The init_callback is called after DMQ has synced with the notification_peer. - This callback can thus be used to send/broadcast messages as early as - possible. + - was 128, which can be insufficient for large interconnect -commit 69dc8ec9fce8628cdf9bf39f7a25136544ae9a29 -Author: Alex Hermann -Date: Tue Aug 26 16:37:08 2014 +0200 +commit adcad3445b33d917ef13e4419310b5b11d472fe1 +Author: lazedo +Date: Mon Dec 28 04:10:39 2015 +0000 - dmq: Don't delete the original notification_peer on timeout + presence_dialoginfo : fix memory leak - (cherry picked from commit e73aa4032873b3fca88bb809d6d4ce4f28c0f237) + + missing xmlFreeDoc from commit b6b7de8832e4ab22ef2c00ebb2c1e1b6ced9ff35 -commit 7b5f79f9f384bfe3c16c399184281ebe63bb7785 -Author: Charles Chance -Date: Thu Nov 13 18:30:34 2014 +0000 +commit 875950d6265417bb59f98a41e4ff89296c01b595 +Merge: 38d9cfa b51f782 +Author: Christian Kuehnke +Date: Fri Dec 25 15:39:01 2015 +0100 - dmq: force to send replicated messages from configured server address - as reported on list by Victor Kustov + Merge remote-tracking branch 'upstream/master' into getifaddrs -commit 72106469e7135024877a08d316091c48aace67d2 -Author: Federico Cabiddu -Date: Thu Nov 13 14:48:25 2014 +0100 +commit b51f7822b3e48a18611bed1aaaac5674757f8e33 +Author: Daniel-Constantin Mierla +Date: Wed Dec 23 18:11:15 2015 +0100 - modules/tsilo: added missing ts_rpc* files + matrix: updates for application name -commit c0f58d77fc6cff80cf6a4fc62cd9e8acb9e5ba79 -Author: Federico Cabiddu -Date: Thu Nov 13 14:41:07 2014 +0100 +commit a72e8451aef9391229000cb4e13020f0ff722d92 +Author: Daniel-Constantin Mierla +Date: Wed Dec 23 18:10:27 2015 +0100 - modules/tsilo: removed MI commands - (revert commit a255911902788bf74a7f4279fce4758b2f2a4613) + matrix: added section ids for params and functions in docs -commit b85c5b5d6e78d17a962911c53989e9e8281cd4cf -Author: Olle E. Johansson -Date: Thu Nov 13 12:16:25 2014 +0100 +commit fd8f7dd442b7b197450c7bc338260f44b7dcc34d +Merge: fed70c4 a9ec529 +Author: Federico Cabiddu +Date: Tue Dec 22 15:47:09 2015 +0100 - app_python Avoid collission in name space - rename init_modules to ap_init_modules + Merge pull request #453 from grumvalski/cnxcc_include + + cnxcc: define inline functions in cnxcc.h -commit 46d2aaa4030f83a6d3e14793939dbd0185ec4619 -Author: Richard Good -Date: Thu Nov 13 09:56:18 2014 +0200 +commit 38d9cfa1fe97c89833b852e83783e8c6ea197575 +Merge: 424ac4d fed70c4 +Author: Christian Kuehnke +Date: Tue Dec 22 15:24:51 2015 +0100 - modules/ims_usrloc_scscf: update mysql create script with new params column + Merge remote-tracking branch 'upstream/master' into getifaddrs -commit 2b7ceeaef966b6b1b77d676441573e455ee1e804 -Author: Richard Good -Date: Thu Nov 13 09:54:36 2014 +0200 +commit a9ec529ecee015e79dc60cb8ba8a6686cdf73a7b +Author: grumvalski +Date: Tue Dec 22 13:48:19 2015 +0100 - modules/ims_registrar_scscf: include contact param info in NOTIFY - Params are now stored in usrloc - if they exist they should - be included in notifications to subscribers + cnxcc: define inline functions in cnxcc.h -commit 035d2cb706b5ca2bf0a95e473fb0016ab04858f9 -Author: Richard Good -Date: Thu Nov 13 09:53:12 2014 +0200 +commit fed70c48a907dd3579ff6a7b288e1469cc9ece34 +Merge: b6a4fa2 b7acbe4 +Author: lazedo +Date: Tue Dec 22 11:04:01 2015 +0000 - modules/ims_registrar_scscf ims_usrloc_s: store contact params on registration - ims_registrar_scscf: pass params if they exist when saving contact - ims_usrloc_scscf: store params in usrloc and persist to db + Merge pull request #451 from kamailio/lazedo-patch-2 + + db_text : column type comparison -commit 626f37f3221223f82348652cbbaa61ec2f81df13 -Author: Richard Good -Date: Thu Nov 13 09:51:29 2014 +0200 +commit b6a4fa2921d531a3dce1277c671942a8c62f3270 +Author: Daniel-Constantin Mierla +Date: Tue Dec 22 09:06:01 2015 +0100 - modules/ims_usrloc_scscf: update expires of subscriber on update subscriber + smsops: changed duplicated section id -commit e3c7ff83da1a72ef53e45e6263b6b9ce72312063 -Author: Jason Penton -Date: Wed Nov 12 16:34:57 2014 +0200 +commit 5937b04a98204fc70ce6db2eab08c038a3497c2a +Author: Daniel-Constantin Mierla +Date: Mon Dec 21 14:48:25 2015 +0100 - modules/ims_usrloc_pcscf: Fixed bug deleting memory within loop on timer checking expired contacts + dmq_usrloc: lock before adding contact + + - reported by GH #440 -commit aae775859f54f84734ba2cfc2945c02c52b95e1f -Author: fcabiddu -Date: Sun Nov 2 09:22:04 2014 +0100 +commit 981bcc737649796a7cc37e2de564bd1b337675da +Author: Daniel-Constantin Mierla +Date: Fri Dec 18 21:50:52 2015 +0100 - modules/dispatcher: added per gateway and global send socket configuration + dispatcher: readme regenerated with updated config example -commit dcfc166dadfd32a706fc141e0b777817dc99efbd -Author: Federico Cabiddu -Date: Wed Nov 12 11:58:16 2014 +0100 +commit 2809c1eee5d74840ad1974eab09950f2aba3ad31 +Author: Daniel-Constantin Mierla +Date: Fri Dec 18 21:50:02 2015 +0100 - modules/tsilo: added RPC commands + dispatcher: set sock_avp parameter in example -commit a255911902788bf74a7f4279fce4758b2f2a4613 -Author: Federico Cabiddu -Date: Wed Nov 12 11:52:29 2014 +0100 +commit b7acbe4d676cc68f790f12f29186dfab31301074 +Author: lazedo +Date: Fri Dec 18 14:40:18 2015 +0000 - modules/tsilo: added MI commands + db_text : column type comparison + + compare DB1_STR, DB1_STRING, DB1_BLOB as equal -commit daf2b6ef1355cf6344f0b062ea7203bb652601bc -Merge: b2d4efa 92fa1ac -Author: Jason Penton -Date: Tue Nov 11 15:16:29 2014 +0200 +commit 47172912dfb0c22a4d10055505d11b7187d1af35 +Author: Victor Seva +Date: Fri Dec 18 11:44:09 2015 +0100 - Merge branch 'master' of ssh://git.sip-router.org/sip-router + pkg/kamailio/deb: update version to 4.4.0~dev8 -commit b2d4efa0e261fe125c317f129f1836e2dabfc208 -Author: Jason Penton -Date: Tue Nov 11 15:15:32 2014 +0200 +commit a2e3c04ac1faef9acc5af9481af3e0f2f82f6a72 +Merge: 2b96041 41975bd +Author: Victor Seva +Date: Fri Dec 18 10:12:33 2015 +0100 - modules/ims_usrloc_scscf: Fixed pkg_memory - not freeing DB_RES + Merge pull request #450 from giavac/master + + cfgt: second pass at documentation update -commit 92fa1ac28b4991cd83338d1f99e898dfe1d8742f -Author: Alex Hermann -Date: Mon Nov 10 12:24:11 2014 +0100 +commit 41975bd9d757a395c6b6e330a8ad243aefde4c4e +Author: Giacomo Vacca +Date: Fri Dec 18 08:25:12 2015 +0000 - perl: Sync log levels with kamailio core + cfgt: recompiled README -commit 5d1621d9adf199f6f1810e55290feccd2918527e -Author: Luis Azedo -Date: Mon Nov 10 15:26:11 2014 +0000 +commit a8cbef5bf5c36e76b3ba1d43e71210c5b0519b24 +Author: Giacomo Vacca +Date: Fri Dec 18 08:24:58 2015 +0000 - Revert "kazoo : remove dependencies" + cfgt: documentation update - This reverts commit 13c1852f4421763d24babd20bc849dc3e2b64aab. + - Add loadmodule example to highlight ordering requirement -commit 08248bae17024246442046376a4350007a100025 +commit 2b96041540d7b9bf050dbacb78b71085bbc7c03f Author: Daniel-Constantin Mierla -Date: Mon Nov 10 15:42:39 2014 +0100 +Date: Thu Dec 17 23:29:32 2015 +0100 - tm: handle BRANCH_FAILURE_ROUTE in t_check_trans() test + Makefile.defs: version set to 4.4.0-dev8 -commit 13c1852f4421763d24babd20bc849dc3e2b64aab +commit b6b7de8832e4ab22ef2c00ebb2c1e1b6ced9ff35 Author: Luis Azedo -Date: Mon Nov 10 13:25:30 2014 +0000 +Date: Thu Dec 17 21:02:43 2015 +0000 - kazoo : remove dependencies + presence_dialoginfo : aux_body should return xmldoc instead of char -commit 44269cd654a6ab0557ca242f25ec41158e7dcbaf -Author: Daniel-Constantin Mierla -Date: Sat Nov 8 11:10:11 2014 +0100 +commit 412f155ede8587c1d439503cd7d0e783bc3c0d6b +Author: lazedo +Date: Thu Dec 17 18:54:45 2015 +0000 - htable: elaborated docs about sht_lock() and sht_unlock() + presence_dialog : fix compilation -commit 4f07daab9cb95e13c7c89a9a566d4a8c88b9145e -Author: Daniel-Constantin Mierla -Date: Sat Nov 8 10:57:00 2014 +0100 +commit 6dd065629604a32081d5e7b63bbbd292f56aaf23 +Merge: 236c55d 1682896 +Author: lazedo +Date: Thu Dec 17 17:49:37 2015 +0000 - htable: make locking to access a slot re-entrant for a process + Merge pull request #448 from kamailio/lazedo/fix_blf - - proper functionality for sht_lock()/sht_unlock() + presence : fix notify version when subs_mode <> 3 -commit c7ff8a88e773e8d25958f86d178f05ee10fd0410 -Author: Daniel-Constantin Mierla -Date: Thu Nov 6 18:43:50 2014 +0100 +commit 08a8a8eee5d66c017defbbe749ce28cfd2984d92 +Author: Giacomo Vacca +Date: Thu Dec 17 17:03:58 2015 +0000 - htable: use mode everywhere to control the locks for add operation + cfgt: recompiled README -commit def8d2600422a442b971c204df98594b0dfdaacd -Author: Daniel-Constantin Mierla -Date: Wed Nov 5 14:29:34 2014 +0100 +commit 806e0fa1f970062bee25d95e33058363735c3bba +Author: Giacomo Vacca +Date: Thu Dec 17 17:03:18 2015 +0000 - json: unreference the json object in json_get_field() + cfgt: extended documentation - - the parsed json object has to be freed - - reported by dongwflj@163.com + - Add a Usage part with .cfg example -commit cf9303b8063e77426e0506bed09577fe7a584fb1 -Author: Daniel-Constantin Mierla -Date: Wed Nov 5 14:04:33 2014 +0100 +commit 31933ccc40f9af36caa9f0a45e0a57aebe0b91d4 +Author: Giacomo Vacca +Date: Thu Dec 17 16:43:53 2015 +0000 - mqueue: elaborated the docs for mq_size() to reflect return codes + cfgt: fixed a few typos in documentation -commit bde57b53386e792651b5ac86ea32d16ab721a07c -Author: Daniel-Constantin Mierla -Date: Wed Nov 5 13:59:53 2014 +0100 +commit 236c55d21f20c59353f963256907fe4ca35d2c19 +Merge: 6458380 c131323 +Author: Victor Seva +Date: Thu Dec 17 10:49:57 2015 +0100 - mqueue: fix mq_size() not to return 0 + Merge pull request #449 from giavac/master - - return 0 for a config function is considered 'exit' by interpreter - - if size of the queue is 0, the function return -1 - - for other error cases, the return code was decremented by 1 + cfgt: doc improvements -commit a7d6e6c9ddc249fad40d673b33dd7180cf32cb89 -Author: Victor Seva -Date: Mon Nov 3 16:36:44 2014 +0100 +commit c131323e77b4cf39b0121aa6e59c0b67174b8679 +Author: Giacomo Vacca +Date: Thu Dec 17 09:38:43 2015 +0000 - pkg/kamailio/deb: add cnxcc and kazoo modules + cfgt: update README + + - Provide an example of Call-ID to identify a scenario -commit e070257321853d799a6325ac5e94f69b4ccb85e7 -Author: Daniel-Constantin Mierla -Date: Tue Nov 4 16:32:13 2014 +0100 +commit e1c9e07fc129569143063f38fec34f5a01151e26 +Author: Giacomo Vacca +Date: Thu Dec 17 09:38:32 2015 +0000 - pua_reginfo: avoid sending notify when processing location record action triggered by itself + cfgt: improved documentation + + - Provide an example of Call-ID to identify a scenario -commit c3fd94ff6867f6d27e7e8e6d763978ed8195dd8b -Author: Juha Heinanen -Date: Tue Nov 4 17:02:04 2014 +0200 +commit 1682896e2971508e454448d2a89ba5ab10811a84 +Author: Luis Azedo +Date: Wed Dec 16 20:50:41 2015 +0000 - modules/pua_mi: added publish_with_ob_proxy module param - - and optional outbound proxy parameter to pua_publish mi command + presence : fix notify version when subs_node <> 3 + + when submode <> 3 the notify version is always the same (first watcher) for all watchers -commit e673771368c25a70c5b289435694df6e9880f969 -Author: Alex Hermann -Date: Tue Nov 4 14:24:46 2014 +0100 +commit 424ac4dba745dd728e225895f9fb40e287ec365f +Author: Christian Kuehnke +Date: Wed Dec 16 18:47:36 2015 +0100 - Revert "dialog: Don't destroy dialogs in timer while they're still being referenced" + core: rewrite add_interfaces() with getifaddrs() based implementation - This reverts commit 3eef4c8be5cc2b6ccba993a62f8c8039d1adf7da. + To make IPV6 work with Solaris, add_interfaces() had to be modified. + I decided to reimplement it with a getifaddrs() based implementation, + which is available from Solaris 11 upwards, and also on FreeBSD and + Linux. By default, the latter continues to use the netlink based + variant. + +commit 64583809c677384e2fcd54a5ba7f921b3ea59c51 +Author: smititelu +Date: Wed Dec 16 13:28:18 2015 +0200 + + debugger: Fix coredump when kamailio stopped - Reintroduces possible segfault in cleanup routine. + Upon kamailio stop, 'dbg_cfg' pointed to invalid memory zone(not NULL). + Reset the pointer to NULL upon module_destroy() and do the NULL checks. + + Reported by foucse in issue #446. -commit 61ab723bb46f46f9013587e26ee07f39e5388ff8 +commit b8e3aff1079e4a617aa273553a20d664d0c368c2 Author: Daniel-Constantin Mierla -Date: Tue Nov 4 10:20:46 2014 +0100 +Date: Wed Dec 16 08:20:55 2015 +0100 - benchmark: sync'ed log level values in documentation + cfgt: fix compile warning for len field comparison -commit 952227ef749da464c7990fa7f056764daf4bda0d -Author: Daniel-Constantin Mierla -Date: Mon Nov 3 18:41:01 2014 +0100 +commit 09e823deb39940d1601a26504d4431ca74d70453 +Author: Victor Seva +Date: Tue Dec 15 14:37:57 2015 +0100 - uac: use transaction to propagate uac_auth() flag - - - needed by dialog to increase the cseq - - local request is no longer accessible at forwarding callback + Makefile.groups: add cfgt module to mod_list_basic -commit fce92c5eba817cbb1303ab4174e8cc7d98ed524d -Author: Jason Penton -Date: Mon Nov 3 16:18:19 2014 +0200 +commit 393385a0972de3fc618276711c1fe90fd289c95d +Merge: e0f7a0c ef5ba34 +Author: Victor Seva +Date: Tue Dec 15 14:24:56 2015 +0100 - modules/ims_qos, modules/ims_usrloc_pcscf, modules/ims_registrar_pcscf: improvement over nat handling in p-cscf contact storage: - - useful for locating contacts where SIP requerst has no contact (MESSAGE, OPTIONS) and need to find contact based on UE src IP. + Merge pull request #443 from linuxmaniac/vseva/cfgt + + modules/cfgt: debugger config test support -commit 0cafc4197dc96b45c1ac712907b5c119f2ecab60 +commit e0f7a0c678b37c44312369dd90ffdc531782bb99 Author: Daniel-Constantin Mierla -Date: Mon Nov 3 14:50:57 2014 +0100 +Date: Tue Dec 15 12:26:02 2015 +0100 - Makefile.groups: group for cnxcc module + websocket: fixed Makefile after previous commit - - it depends now on redis and event library + - whitespace required after ifneq -commit 79695ed2628db60199647baf653ce5f9b9005fe9 -Author: Alex Hermann -Date: Thu Oct 23 17:49:44 2014 +0200 +commit ef5ba34baa4f5a54ab634dc7e06e0de1daf45dd2 +Author: Victor Seva +Date: Tue Dec 15 11:42:58 2015 +0100 - dialog: fix crash when trying to RPC export a "remote" profile + debugger: refresh README -commit a65a212c1e7587182f113a94f3d0d8b46c97baa0 -Author: Alex Hermann -Date: Thu Oct 23 17:46:26 2014 +0200 +commit 1b5766548dd637615b2284c5363d5bdf123a8573 +Author: Victor Seva +Date: Tue Dec 15 11:22:10 2015 +0100 - dialog: break loop when profile entry doesn't exist + debugger: add cfgt support -commit 10a655b5545f5170f339a9f18d702f4e85dd5778 -Author: Alex Hermann -Date: Thu Oct 23 17:46:00 2014 +0200 +commit 9ee0bd917f1e6a2b1fc9f116ea22584388a5e0d8 +Author: Victor Seva +Date: Tue Dec 15 10:24:13 2015 +0100 - dialog: release lock when profile has been found + modules/cfgt: add initial documentation -commit 63bbaabba4eaf14c427896bd1e0467466616f3f0 -Author: Alex Hermann -Date: Fri Oct 24 15:13:10 2014 +0200 +commit b8309bd5fef4647c13cbabae768c47fdb7c8bc59 +Author: Olle E. Johansson +Date: Tue Dec 15 11:25:41 2015 +0100 - dmq: Don't try to use a (worker)queue before it is initialized - - It seems SIP traffic is handled before all children are initialized... + curl Update TODO.txt after Hugh's contribution -commit 3eef4c8be5cc2b6ccba993a62f8c8039d1adf7da -Author: Alex Hermann -Date: Thu Oct 23 15:09:05 2014 +0200 +commit fc64249b6e4b8c6a2c2b2dc4175114dfb701c767 +Author: Victor Seva +Date: Wed Jun 24 22:19:24 2015 +0200 - dialog: Don't destroy dialogs in timer while they're still being referenced + modules/cfgt: trace config and save to file -commit 293caa403bba6741d15254a42d106392fc657888 -Author: Alex Hermann -Date: Thu Oct 30 17:15:38 2014 +0100 +commit a3c212f2489e4ba01c7592f68cd35fdb8e16ce71 +Author: Olle E. Johansson +Date: Tue Dec 15 11:13:21 2015 +0100 - perl: check for and handle memory allocation failures + Fixing typo, adding copyright header -commit 3aec75e97b579cc67340c0fb81b276321b4ab73a -Author: Alex Hermann -Date: Thu Oct 30 17:12:28 2014 +0100 +commit f87327e6d89c280fed31ed7961c117063dadc605 +Merge: d24863d 9fd99ef +Author: Olle E. Johansson +Date: Tue Dec 15 10:54:52 2015 +0100 - core: Don't log errors when dns find no more records + Merge pull request #435 from kamailio/tmp/hpw_curl_improvements - If the proxy is listeneing on both ipv4 and ipv6, DNS attempts are done for - both A and AAAA records. If the last of these lookup fails with no records - found, don't log an error if the first lookup did already return records. + Fixes and improvements to curl module -commit 2d7f748ef690846365e4dd5bc5a91df21e39321c -Author: Alex Hermann -Date: Tue Oct 16 14:57:42 2012 +0200 +commit d24863d071417effe5df863736ef037ec8e0b414 +Author: Daniel-Constantin Mierla +Date: Mon Dec 14 16:40:03 2015 +0100 - dispatcher: Ignore IPv6 addresses if IPv6 lookups are disabled. + presence: init variable to prevent invalid cleanup on error getting presence document + + - reported by GH#441 -commit e1f96b11379abd60fd53c49a376f6cf3cb1fc69d -Author: Alex Hermann -Date: Tue Oct 14 15:58:41 2014 +0200 +commit 6e9f017dd3509296b83f12d3467309c583a248b1 +Author: Stefan Mititelu +Date: Mon Dec 14 17:32:02 2015 +0200 - tm: backup xavps before running callbacks + tmx: Consistent naming of counters - regular avps were being backupped, just not xavps. + Simplify the names of the tmx counters to "rpl_*". -commit e2596876b830783de88934d45c9c5563ba2c3577 -Author: Alex Hermann -Date: Fri Oct 10 11:06:43 2014 +0200 +commit 09be0ae191404409322bb5d8ab9df0a03c1a4845 +Merge: 4d89a50 572fa1b +Author: Stefan Mititelu +Date: Mon Dec 14 17:00:46 2015 +0200 - core: fork_*_utimer()'s interval is in microseconds + Merge pull request #442 from smititelu/KAMAILIO-30 - Sync comments with code and function names + Better counting of received_replies counter -commit 8adcf8f0e3ba2fa969583f6630dbd9e3aaecfcac -Author: Alex Hermann -Date: Thu Oct 9 17:54:20 2014 +0200 +commit 4d89a50544324fdac0f08497dc142c171bfcd97d +Author: Daniel-Constantin Mierla +Date: Mon Dec 14 15:15:52 2015 +0100 - core: time_t is unsigned, handle integer underflow correctly + tm: avoiding conditional directives that split up parts of statements - When the processing of the timer code takes longer than the interval, don't - sleep for 4Gs. + - patch by Romero Malaquias, FS#434 -commit 3d24997fd1ba34bd4e426656b1533530718008a0 -Author: Alex Hermann -Date: Thu Oct 2 16:33:26 2014 +0200 +commit aa50c18b724a25f772a1fefdec3b9d260b7c6dbf +Merge: 665eef8 305381b +Author: Daniel-Constantin Mierla +Date: Mon Dec 14 15:11:09 2015 +0100 - tm: remove dead code + Merge pull request #436 from snen/htable_stats_fixing + + htable: fixing htable.stats for max slot value -commit 54f19e018a1a569b532555311505d4962de49bd7 -Author: Alex Hermann -Date: Thu Oct 2 16:46:23 2014 +0200 +commit 665eef8b4bf9dbe984b8655206585a467253322f +Merge: c73b9cd 432c1e3 +Author: Daniel-Constantin Mierla +Date: Mon Dec 14 15:09:23 2015 +0100 - tm: log an error message as error, not debug + Merge pull request #439 from andrey-utkin/websocket_libcrypto_linkage + + modules/websocket: ensure linkage to libcrypto -commit 98618105265d494b89a7c24f2f2854de7ecb0ead -Author: Alex Hermann -Date: Tue Oct 14 11:40:46 2014 +0200 +commit 572fa1b4497571ec68453c97b3080740364d3335 +Author: Stefan Mititelu +Date: Mon Dec 14 15:02:53 2015 +0200 - dmq: prevent unnecessary deep copies of string when building reply body + tmx: Update doku + + Update doku related to the counters changes. -commit 5f05db99979e6c74d8303437d6c422478a1fbc7c -Author: Alex Hermann -Date: Tue Oct 14 11:39:12 2014 +0200 +commit aeb3e18527b565f22bd05f6c6989b2ae86968b71 +Author: Stefan Mititelu +Date: Fri Nov 27 18:18:14 2015 +0200 - dmq: unlock in failure path in build_notification_body() + tmx: refactor counters + + Focus on: + - received_replies + - received_replies_absorbed (in cfX cases) + + - relayed_locally + - relayed_received + - relayed_total -commit e98c601c43edbfbf7b389e04e9fb16839577ef5a -Author: Alex Hermann -Date: Tue Oct 14 11:38:36 2014 +0200 +commit 432c1e3b0f7ff6a9fa11e6d8ed8b897dc3f9246f +Author: Andrey Utkin +Date: Sat Dec 12 22:37:15 2015 +0200 - dmq: handle failure to build callback parameter + modules/websocket: ensure linkage to libcrypto + + Fixes linkage for Ubuntu Wily (15.10). + The issue manifests itself as "undefined symbol: SHA1" error at module loading. -commit c6d2480efd95336ae34a2fb732dd4cb62ac89cbb -Author: Alex Hermann -Date: Mon Oct 20 22:35:59 2014 +0200 +commit b79d23436bbfceb0debb8ff829b5ff8d2e49c46d +Author: Stefan Mititelu +Date: Fri Dec 11 17:21:16 2015 +0200 - dmq: check if dmq socket exists + rtpengine: Don't add invalid URL node, in db mode + + Don't continue parsing the node url if errors were spotted, in db mode. -commit 65c9174d4e53cbad02b84504168ab000aa5ecfe0 -Author: Alex Hermann -Date: Thu Sep 25 13:21:36 2014 +0200 +commit 98877b5b393e4f7d0ec4127f6964f2b2ad24ab64 +Author: Stefan Mititelu +Date: Fri Dec 11 13:33:55 2015 +0200 - dmq: more efficient find_dmq_node_uri + rtpengine: Add code indentation - No need to build a complete dmq_node, only host and port are needed. - Can be done on the stack. + Add proper tab-like code indentation. -commit d29103045ec2de4c22d606fae6c3b424ae1020f7 -Author: Alex Hermann -Date: Thu Sep 25 12:11:03 2014 +0200 +commit 5ce6df2d3aee023f0e2d4f9cad14d6e560557ae2 +Author: Stefan Mititelu +Date: Thu Dec 10 16:59:30 2015 +0200 - dmq: Lower the minimum ping interval to 5 sec + rtpengine: Add hiding of deleted table nodes + + 'kamctl fifo nh_show_rtpp all' reflects the rtpengine table state. + + When node is deleted from the table the node itself isn't freed but disabled + permanent and hidden for display. This is mainly because one might want the + current session to finish for the deleted table nodes (see allow_op modparam). - There is no real reason to have a minimum, let alone a minimum of 60 secs. + Hiding the nodes and not freeing them will spare time deciding if there are + any sessions left for the deleted rtpengine. -commit 902a77af1501f78fcc1205a37a5307e1d300f301 -Author: Alex Hermann -Date: Fri Aug 22 15:56:22 2014 +0200 +commit 65750d3422f97568623036a027ddebcbe636198d +Author: Stefan Mititelu +Date: Fri Dec 4 09:22:41 2015 +0200 - mi_datagram: Send error response on out-of-memory + rtpengine: Update kamailio-db-devel db scripts + + Add rtpengine 'utils/kamctl/$dbschema' scripts. -commit a4eacbb469909978b7a9eff8767dcbdd5110ee99 -Author: Alex Hermann -Date: Fri Aug 22 15:16:00 2014 +0200 +commit 174c7ab05e803e9c0288ada8bc4578bf7e6ea567 +Author: Stefan Mititelu +Date: Wed Nov 25 14:22:24 2015 +0200 - core: Document the right type for 'str*' in the RPC interface + rtpengine: Update kamailio-db-devel .xml + + Add rtpengine .xml table documentation. Update version files. -commit 42f506c08073c5f8ca84f1f12ea9e6c820f162d8 -Author: Alex Hermann -Date: Tue Aug 19 12:36:23 2014 +0200 +commit fd90308dd76d16452805edad713026c4a9f3bcea +Author: Stefan Mititelu +Date: Thu Dec 3 11:01:41 2015 +0200 - core: sip_msg_shm_clone: clone parsed maxforwards value in shm + rtpengine: Check node address when adding to set - maxfwd module modified the msg buf directly instead of adding a lump. In - addition it is filling the parsed value of the header field. - - Clone this field into shm so later code can at least determine if the msg - has been mangled so it can retreive the original value of the header. + The node address has to start with 'udp:', 'udp6:' or 'unix:' and to end with a + valid port number. Else, the node is ignored and is not added to the set. -commit aa4fabe05dd3b6dc841325fe279596293d327a92 -Author: Alex Hermann -Date: Mon Oct 20 15:38:51 2014 +0200 +commit 410151eb6c7d992f9b7a7fd21e7a7f5ee1a44e67 +Author: Stefan Mititelu +Date: Wed Dec 2 12:35:09 2015 +0200 - kcore: print_rr_body: return number of printed Record-Route bodies + rtpengine: Add db 'weight' column - Act like the documentation, return the number of printed RR bodies, not the - total number of RR bodies. + Add weight column with weight_col modparam. + Updated doku. -commit ee9b78709516b935e087b0efcb620c13aad1a740 -Author: Alex Hermann -Date: Mon Oct 20 15:38:11 2014 +0200 +commit 0def328282cb8551823554978d7e32afa7ca4110 +Author: Stefan Mititelu +Date: Tue Nov 24 17:35:19 2015 +0200 - tm: Fix setting flags for record-route headers - - The flags where set in add_uac() by counting the number of record-route - headers added by prepare_new_uac(). The latter function backups and - restores the list of lumps, so add_uac() only sees the original list, - which is not what has happened on the branch being handled. + rtpengine: Check set uniqueness for rtpp node - Moving setting the flags into prepare_new_uac() fixes this. + If node already found in set, update details like weight, recheck_ticks, + disabled status. Else, create new node for the specific set. + This is especially useful when reloading the nodes from database via + 'kamctl fifo nh_rtpp_reload'; just to update the nodes,no shm_free and realloc + needed. Also applicable for the config file nodes. - This fixed the dialog module, which has to remove the correct number - of RR headers from the callee's routeset (which it does based on the - tm flags). + This per set uniqueness of the nodes is plausible given the possibility to + set the weight of the rtpp nodes. -commit 132d35e0079f79294b5b22115f710d541e0e9c5c -Author: Alex Hermann -Date: Mon Dec 30 12:07:38 2013 +0100 +commit d884698c9184cc649a2846b8070b78900cc7a215 +Author: Stefan Mititelu +Date: Tue Nov 24 14:50:01 2015 +0200 - pv: Don't log warnings when a string flag id is used + rtpengine: Add kamctl nh_reload_rtpp - check_flag is logging a warning when the numeric id is also used via a string - alias. Don't call this function if the flag id is a string. + Fifo command to allow reload from database node table. + Updates the state of the nodes or creates new ones; does not delete + the old nodes, not present anymore in the database. + Updated doku. -commit 10a8a26cdb5007a3971f96bbcd69b7a835532d89 -Author: Carlos Ruiz Diaz -Date: Fri Oct 31 17:26:44 2014 -0600 +commit 3e25dce1918e007a5db3752143c427a512a08dd2 +Author: Stefan Mititelu +Date: Tue Nov 17 16:45:00 2015 +0200 - cnxcc: added missing files and updated example + rtpengine: Add setid_default modparam + + Add option to change the default set id. + If setid_avp is configured, the active set used is the avp value. + If setid_avp is not configured, the active set used is setid_default value. -commit c587ce0b17a0765934eeb55bba8605aea9c5ce8f -Author: Carlos Ruiz Diaz -Date: Fri Oct 31 17:20:09 2014 -0600 +commit 20e4a5d5d415e12e3dca5dd3dab5f36c49058b42 +Author: Stefan Mititelu +Date: Tue Nov 17 14:28:35 2015 +0200 - cnxcc: added Redis support for distributed cnxcc nodes + rtpengine: Update doku for rtpengine database - - works for all monitoring functions + The module is able to load nodes specified in a database. + Update doku for this. -commit c76ee9facb771d2eae792214e6d4cef39c94a9eb -Author: Daniel-Constantin Mierla -Date: Fri Oct 31 12:35:56 2014 +0100 +commit 55734eb2ea6dfcda679570f08b3bf331a4f44f76 +Author: Stefan Mititelu +Date: Tue Nov 17 13:37:19 2015 +0200 - dialog: increase local cseq after REFER generated by dlg_bridge + rtpengine: Add setid_col modparam - - otherwise the next BYE can be rejected + Allow setid column name. Updated doku. -commit b6d3dc61a78e549c9a75ddfa2fbb86aa2a1682c5 -Author: Daniel-Constantin Mierla -Date: Fri Oct 31 12:33:38 2014 +0100 +commit 5192377be91a09b48476944b05c3ec182758e88c +Author: Stefan Mititelu +Date: Tue Nov 17 12:39:22 2015 +0200 - tm: update headers shortcuts if buffer rebuilt after event_route[tm:local-requests] + rtpengine: Add db 'disabled' column - - affecting transactions for local generated requests - - bulding local ACK uses the shortcuts and they ended up being broken - - reported by Kristian F. Høgh + Able to load rtp nodes state from database. + Add "disabled" column with disabled_col modparam: + - if disabled != 0, disable the node permanent + (similar to disabling it manually using kamctl fifo command) + - if disabled == 0, keep the current behaviour + (set ticks to 0, ping and disable temporary in case the node is not responding) -commit e4f18cb322d54035fb6825df3a2f712ed03a71db -Author: Daniel-Constantin Mierla -Date: Fri Oct 31 11:09:53 2014 +0100 +commit c73b9cd8b5f8074c43fd2a30f7b7e6df97208a3d +Merge: fd79adb 95cd106 +Author: Richard Fuchs +Date: Thu Dec 10 06:54:47 2015 -0500 - main.c: fix compile warning + Merge branch 'master' of https://github.com/smititelu/kamailio -commit a2252afe90e0acd779e64c47eacc174b4bbdc41c -Author: Daniel-Constantin Mierla -Date: Fri Oct 31 00:31:11 2014 +0100 +commit 95cd1062a937568322665bacd019d21fc20d57c0 +Author: Stefan Mititelu +Date: Thu Dec 10 11:38:10 2015 +0200 - tm: do all the clean local msg structure in one place + rtpengine: _destroy() sanity + memory free - - uri/dst-uri were clened before the entire local sip message, not being - visible while rebuilding the content + _destroy() sanity checking, with memory free, when possible: + - alloc the locks first. + - free the locks last. + - consider content already hadled for a NULL lock (or NULL lock vector). + - make _free_row_lock() static. -commit 280f947eac5c66bfa6151c75983ffa9e533dd709 +commit fd79adb4975fc0799fe8488d1dd1a771041a0939 Author: Daniel-Constantin Mierla -Date: Thu Oct 30 22:29:01 2014 +0100 +Date: Thu Dec 10 09:33:32 2015 +0100 - pipelimit: update the limit of pipe for pl_check(pipeid, alg, limit) + dispatcher: proper handling of socket parameter when is not last in attrs - - affects the dynamic pipes that could have been created by same - function on a previous execution, allowing to be on-the-fly updated - - reported by Alex Balashov + - parsing socket function expects a null terminated string -commit 58ad681ab68a14e8fe2b0f6ebc6cf03bdabeea80 +commit 12160de3c2052c4696b8c073b9fa5919f6da7060 Author: Daniel-Constantin Mierla -Date: Thu Oct 30 20:47:42 2014 +0100 +Date: Wed Dec 9 23:27:09 2015 +0100 - rr: dont set msg flag FL_RR_ADDED for record_route() in branch_route + core: skip zero char and whitespaces before parsing first line in parse_msg() - - the operation is specific only for the branch + - reported by Vasiliy Ganchev -commit ea6d3205d06b8d9f67429ca43ea97a4dcd6a9f1f -Author: Richard Good -Date: Thu Oct 30 17:23:23 2014 +0200 - - modules/cdp: Changed state machine for process unsuccessful answer when pending - When in state PENDING and receive ANS_UNSUCCESS correct behaviour is to cleanup and move to IDLE - -commit 6eb29ad5164400e1e66ac7eb106220b012b46115 -Author: Richard Good -Date: Thu Oct 30 15:47:25 2014 +0200 +commit 01060e983d3de5bf798c7f9725dcd85e23c6c3d5 +Merge: 3b6d7a2 5816e68 +Author: Hugh Waite +Date: Wed Dec 9 14:20:07 2015 +0000 - modules/ims_registrar_scscf: new mod_param subscription_expires_range - If set this parameter randomises the subscription expiry - Works exactly the same as usrloc expires_range param + Merge branch 'master' of github.com:kamailio/kamailio -commit a10a7c0cd1a009df36f38f6295e3a3c923db1ab3 -Author: Richard Good -Date: Thu Oct 30 15:46:48 2014 +0200 +commit 3b6d7a28ea0b053f27cb169ac31259e20ef4ece0 +Author: Hugh Waite +Date: Wed Dec 9 14:15:47 2015 +0000 - modules/ims_usrloc_scscf: optimised db backend for storing subscriptions + utils: Fix crash in http_query + - Fixes incorrect fixup logic for http_query_post_hdr + - Bug reported by jayesh1017 -commit a8d50919bd614b704f3a4e08ff90d844b2c29829 -Author: Daniel-Constantin Mierla -Date: Thu Oct 30 11:41:41 2014 +0100 +commit 305381bb6b40dc4859f0862411a0c1a261b476c2 +Author: Dmitri Savolainen +Date: Wed Dec 9 15:44:03 2015 +0300 - tm: safety catch inside t_check_trans() when already in a tm routing block + htable: fixing htable.stats for max slot value - - transaction is known and some of these routing blocks are inside tm - lock, which can result in deadlock if not tested - - reported by Andrew Pogrebennyk, FS#482 + add missed 'd' parameter to rpc->struct_add format string -commit 367840503010d1be0da23e79525f2f88eb09ebcf -Author: Daniel-Constantin Mierla -Date: Thu Oct 30 10:23:51 2014 +0100 +commit 5ad022a4f5e959b875e9f590eca4e7e1866836bb +Author: Stefan Mititelu +Date: Wed Dec 9 11:41:55 2015 +0200 - sqlops: use row index for storing result of sql_pvquery() + rtpengine: Move the size inside the hash table - - reported by Savolainen Dmitri, FS#487 + - struct rtpengine_hash_table now contains the table size. + - rename the entry_list to row_entry_list -commit f5d9b59ee5aabb1da934ae2ce8101250041c05d1 -Author: Daniel-Constantin Mierla -Date: Thu Oct 30 10:10:15 2014 +0100 +commit c4f2b557682b3e7172b70550913711cccf68df56 +Author: Stefan Mititelu +Date: Wed Dec 9 11:00:15 2015 +0200 - htable: safety check for key type and value + rtpengine: Add per rows totals statistics - - reported by FS#486 + For consistency with the per row locks, statistics should be also per row. -commit 91de8b30d3bc5795589549cddaafbf5e7c1fe7df -Author: Jason Penton -Date: Thu Oct 30 09:19:06 2014 +0200 +commit 9fd99efc683f2ccb4e5b7e88ae891d808e2efdcd +Author: Hugh Waite +Date: Wed Dec 9 09:59:46 2015 +0000 - modules/tm: fixed typo + Fixes and improvements to curl module + - Fix invalid check of uri and postdata parameters + - Fix fixup functions + - Refactor curl function to remove dependance on pv/fixup structures + - Export curl_connect through C API + - Fix buffer overflow in curl write function -commit 5e9d4e1f600d0138e2788a11bef4eea419fa9815 -Author: Jason Penton -Date: Thu Oct 30 09:18:28 2014 +0200 +commit 5816e6852306c943f9b39cf8d8243201bbbdc132 +Author: Daniel-Constantin Mierla +Date: Tue Dec 8 22:56:53 2015 +0100 - modules/tm: fixed typo + kamctl: updated version of the scripts -commit 083f7c8e5dabbb6d870be0f2f3299a62df7be0f8 -Author: Andrew Miller -Date: Wed Oct 29 18:02:08 2014 +0000 +commit a22b59fc802c1c1ee2a13ed772c515398f41e0a7 +Author: Stefan Mititelu +Date: Tue Dec 8 15:29:09 2015 +0200 - sdpops: New function sdp_with_active_media + rtpengine: Add per rows hash table locks - - Return true of the SDP has 'media=type ...' line and the media is active. - - Active media means the port is non-zero and the direction is not "inactive" + This will further increase rtpengine's hash table access. -commit 61a1eee4fe2b7e3a7c6a8f82c86ac52957439053 -Author: Hugh Waite -Date: Wed Oct 29 16:18:28 2014 +0000 +commit 250c7125613fc0fc26b72f68a7d0bd63a4a1b430 +Author: Daniel-Constantin Mierla +Date: Mon Dec 7 22:23:41 2015 +0100 - registrar: Prevent incorrect application of path when forwarding a register + db_mysql: if autoreconnect is set, then attemt 3 times if mysql ping fails - - Reset the internal path pointer after a save() to prevent it being added - as a Route: header, e.g. when running t_replicate() + - it should help stalled/broken mysql tls connections to recover -commit 9cfe110265a6db792e6df047a9dcde4296134fc1 -Author: Hugh Waite -Date: Wed Oct 29 15:33:07 2014 +0000 +commit 5a537506141027ca3d3ef87f49913ab628c30690 +Author: Stefan Mititelu +Date: Mon Dec 7 13:30:02 2015 +0200 - app_lua: Export additional tm functions + rtpengine: Allow op for all deactivated machines - - sr.tm.t_load_contacts - - sr.tm.t_next_contatcs - - sr.tm.t_on_branch_failure + If allow_op modparam enabled, send commands to the disabled machines for the + existing call. So far this was done only for manually deactivated machines. + This is useful because there might be cases of proxy timeout, cases when you + may want to still allow the operations for the existing calls. -commit c86151089e1eed97d264050f1a09501f5eafb0de -Author: Hugh Waite -Date: Wed Oct 29 15:28:37 2014 +0000 +commit b56fae6d00f92628055301c4ac50a2929b49d3b4 +Merge: a67bb24 f9d16e3 +Author: Juha Heinanen +Date: Sat Dec 5 00:23:42 2015 +0200 - tm: Export additional functions from tm modules - - - t_load_contacts and t_next_contacts in tm - - t_on_branch_failure in tmx + Merge branch 'master' of https://github.com/kamailio/kamailio -commit 69cd679496c482aabd17f2c7fbde7a5282864308 -Author: Hugh Waite -Date: Mon Oct 20 15:02:59 2014 +0100 +commit a67bb24f24960e726523810da197cc7c816864f5 +Author: Juha Heinanen +Date: Sat Dec 5 00:21:59 2015 +0200 - sdpops/documentation: Add id's to function sections + modules/lcr: changed location of ruri_user_avp delete -commit 0a019df8f2922a940a41742ce0e4560bb6523d6c -Author: Hugh Waite -Date: Wed Oct 8 21:11:55 2014 +0100 +commit f9d16e38dbf6b263fc29dceca66007357a9e6f37 +Author: Daniel-Constantin Mierla +Date: Fri Dec 4 23:02:53 2015 +0100 + + utils/misc/vim: added recent core parameter to vim syntax highlighting + +commit 784f73b880a8fa776f355dc23c2dbe600da24365 +Author: Daniel-Constantin Mierla +Date: Fri Dec 4 21:59:11 2015 +0100 - core/parser: Fix extract_sendrecv_mode to always return mode if valid + kamctl: db sql files updated after xsl changes - - All four sendrecv directions return 0 - - is_on_hold flag set for inactive and sendonly + - insert statement for version is after creation of the table -commit 9ba58f876a36b4e8fc9fb368f65af754acc0dae1 -Author: Jason Penton -Date: Wed Oct 29 17:06:30 2014 +0200 +commit e03b12a80d6ce2f846f757004dff87d5e770c3b6 +Author: Daniel-Constantin Mierla +Date: Fri Dec 4 21:57:44 2015 +0100 - modules/ims_usrloc_scscf: fixed poor pointer management in linked list looping + core: stylesheet for generating db schema updated for version insert + + - version is inserted after the table was succesfully created + - avoid version record without table -commit 7d273d96a24527e029349f747203f1bbcf65c7b1 -Author: Jason Penton -Date: Wed Oct 29 17:05:17 2014 +0200 +commit 700617c6b3707fba16001f82fab6ca0370b23acf +Author: Daniel-Constantin Mierla +Date: Fri Dec 4 17:30:06 2015 +0100 - modules/ims_usrloc_scscf: add callback when contact is deleted/removed + outbound: adjusted log message for trying to import the api + + - when module is not loaded, a messages with 'failed' was printed, + which could trigger an alert even for info level -commit bf51da956727e235456f49c2ef9d1d7ce6880b37 -Merge: 9cfe0e3 ab75190 -Author: Richard Good -Date: Wed Oct 29 13:17:25 2014 +0200 +commit d8991897275b5681bbe79cd4552b516ffa57894c +Author: Juha Heinanen +Date: Fri Dec 4 13:21:47 2015 +0200 - Merge branch 'master' of ssh://git.sip-router.org/sip-router + modules/lcr: delete possible earlier ruri_user_avp value + when calling next_gws() first time after reload_gws() + - Credits to Yasin Caner -commit 9cfe0e32f8bcf2a0e480972b7ae91d3a52f473ce -Author: Richard Good -Date: Wed Oct 29 13:16:23 2014 +0200 +commit 6390e8b35da0f8ad92430e40627d2c52e0b3ca52 +Author: Stefan Mititelu +Date: Fri Dec 4 13:08:11 2015 +0200 - modules/ims_registrar_scscf: new parameter user_data_always - if set S-CSCF always requests user data from HSS + rtpengine: Don't shm_str_dup() a NULL str->s + + Don't dup a NULL str->s to avoid warning message. + This happened usually when viabranch is not used(default being NULL). -commit ab7519006b6a53792d66b6903a4b0694083179b6 +commit 299d2f7764527fbc5b6de1833976f43c58b1ff2d Author: Daniel-Constantin Mierla -Date: Wed Oct 29 12:07:57 2014 +0100 +Date: Thu Dec 3 13:24:40 2015 +0100 - dialog: fixed adding contact header to REFER generated by dlg_bridge + core: proper test of return code for add_interfaces() in case of IPv6 - - reported by Paul Smith + - report with patch by Christian Kühnke -commit e59c0919d6cd28e7dbacb4de2d4b616f3f8b054d -Author: Richard Good -Date: Wed Oct 29 11:07:00 2014 +0200 +commit f025df7a0ac292bd22304683dd976863311b53cd +Author: Daniel-Constantin Mierla +Date: Thu Dec 3 12:31:39 2015 +0100 - modules/ims_registrar_scscf: Changed SIP notify process from PROC_SIPINIT to PROC_MIN + app_python: readme regenerated -commit c78d1ce9d3b01a03133d09a8f762b5dfd221eded -Author: Richard Good -Date: Wed Oct 29 11:05:35 2014 +0200 +commit e2853a8ac22bc26d47153731f65479f03a756c52 +Author: Daniel-Constantin Mierla +Date: Thu Dec 3 12:31:01 2015 +0100 - modules/ims_qos: Changed Rx event process from PROC_SIPINIT to PROC_MIN + app_python: basic documentation for params and functions + + - based on quick look at the code -commit de369d4b466078c4c5aada0fc55d9689b2d13047 -Author: Jason Penton -Date: Tue Oct 28 17:26:43 2014 +0200 +commit 6ae155ee8ebc0d52fd63f208e57808c1d228f7e0 +Author: Daniel-Constantin Mierla +Date: Thu Dec 3 12:29:49 2015 +0100 - modules/dialog_ng: prevent seg fault if socket struct is null + app_python: use NAME compile flag for default path to the script + + - reflects better the application name -commit 0e59fd0c1d569ac216268da5f17b35a7a8183d17 -Author: Jason Penton -Date: Tue Oct 28 17:08:44 2014 +0200 +commit 2702629194351069827564243e1cff7e4b0513d9 +Author: Daniel-Constantin Mierla +Date: Thu Dec 3 09:20:24 2015 +0100 - modules/ims_usrloc_scsc, modules/ims_registrar_scscf: overhaul of contact storage, more efficient and clean - NB API's have changed but fortunately no impact to any other modules. + uac: increase the buffer for within dialog rr param + + - following the previous commit -commit 583c705374c9e1da7817bf204b3da225c784e54a -Author: Elena-Ramona Modroiu -Date: Tue Oct 28 11:41:47 2014 +0100 +commit 3bcdf3aec099fd88ec43fd11af3254cf4431e070 +Merge: 3272ff6 18644f9 +Author: Daniel-Constantin Mierla +Date: Thu Dec 3 09:16:08 2015 +0100 - htable: set str shortcut to iterator name + Merge pull request #425 from khoegh/master - - intended for optimization of iterator search by name + Add RR parameter on sequential requests -commit b3635962175dae2ba4d2df3e056248d08f0f6ad1 -Author: Juha Heinanen -Date: Sun Oct 26 19:11:28 2014 +0200 +commit 3272ff6a427ce5bb60d767ed61c8cadd13759de1 +Author: Daniel-Constantin Mierla +Date: Wed Dec 2 23:10:57 2015 +0100 + + dispatcher: extended log message when hash size parameter is not set + +commit 3a345d8f3b0612c9bee4b29396f17a36472f215f +Author: jaybeepee +Date: Wed Dec 2 15:17:05 2015 +0200 + + modules/ims_charging: unref dlg after ref-counting lookup + +commit 18644f93e100a2e4ec545ad5e42aa84d90283f75 +Author: Kristian Høgh +Date: Tue Dec 1 16:44:22 2015 +0100 + + modules/dialog: Error in last commit. goto invalid destination + +commit f6a5a28532ff410d03d10e86d43d38a785d0fab2 +Author: Kristian Høgh +Date: Tue Dec 1 15:24:16 2015 +0100 + + modules/uac: Add RR parameter on sequential requests when using uac_replace_from/to + +commit de4ad807334c2b74cafec733a0029e3e2ef4996c +Author: Kristian Høgh +Date: Tue Dec 1 15:22:54 2015 +0100 + + modules/dialog: Add RR parameter on sequential requests + +commit cc94a3751dd536053846d7a569e8062d8cfbea7f +Author: jaybeepee +Date: Mon Nov 30 21:09:04 2015 +0200 + + modules/ims_charging: correct analysis of return value for t_suspend + +commit 64491668d61b14c213e3fc0a0b55cfcf6c036e39 +Author: jaybeepee +Date: Mon Nov 30 21:07:37 2015 +0200 + + modules/ims_qos: correct analysis of return value for t_suspend + +commit 58e5709a491dbe90c4fc97e484438090dfea1616 +Author: jaybeepee +Date: Mon Nov 30 21:06:39 2015 +0200 + + modules/ims_usrloc_pcscf: correct analysis of return value for t_suspend + +commit 44c5a4b744f5b6e248103df267405796b1b49834 +Author: jaybeepee +Date: Mon Nov 30 21:05:42 2015 +0200 + + modules/ims_qos: correct analysis of return value for t_suspend + +commit 02b97a728cee7c3184314cbf37e2d9c4f7bcf9c2 +Author: jaybeepee +Date: Mon Nov 30 21:05:03 2015 +0200 + + modules/ims_icscf: correct analysis of return value for t_suspend + +commit acc79d89660433c5f8827efb16f224709571f342 +Author: jaybeepee +Date: Mon Nov 30 20:59:26 2015 +0200 + + modules/ims_auth: correct analysis of return value for t_suspend + +commit e112a2ea4bbc8c53e813442e606fb6fb79b1d3b8 +Author: Carsten Bock +Date: Mon Nov 30 13:22:07 2015 +0100 - modules/tmx: downgraded info message to debug message - - INFO: tmx [t_var.c:738]: pv_get_t_branch(): branch flags is [32768] + ims_charging: Added the possibility to omit the rating-group (also for STOP-Requests) -commit 8608da35d224c70d2bd8cfc728f3d07e1ea7a3ce +commit 8855f0fbe28b94e5298176310d7cbf587bd264da +Author: Carsten Bock +Date: Mon Nov 30 13:14:05 2015 +0100 + + ims_charging: Added the possibility to omit the rating-group + +commit d3e45d3204a9966f9beb5135082e3870c528c1ba Author: Daniel-Constantin Mierla -Date: Sun Oct 26 16:32:13 2014 +0100 +Date: Mon Nov 30 09:17:06 2015 +0100 - textops: include sdp_helpr_funcs.h to get rid of compile warning - - - needed for use of get_mixed_part_delimiter() - - reported by Juha Heinanen + utils/kamctl: updated sql scripts for table version -commit b0d089b685abc51b68b25e90c6021b888cabf051 -Author: Juha Heinanen -Date: Sat Oct 25 18:46:25 2014 +0300 +commit 4d1f897243b713d0121b1e85d2d42c597d7aca13 +Merge: 3fe7fd2 3895cd2 +Author: Stefan Mititelu +Date: Sun Nov 29 00:08:44 2015 +0200 - modules/pua: added outbound_proxy to struct publ_info + Merge pull request #423 from smititelu/textops/geolocation + + textops: Fix get_body_part() end of body headers -commit 22d125e3b73688b227a951dce1ce12b4c798229a -Author: lucian balanceanu -Date: Fri Oct 24 17:29:35 2014 +0300 +commit 3895cd2e08c26594a3cff866caea2b431eb71d1e +Author: Stefan Mititelu +Date: Sat Nov 28 12:51:29 2015 +0200 - cr: fix some cr kamctl fifo problems + textops: Fix get_body_part() end of body headers - - initialize builtin structures with appropiate values + Remember the end of body headers and use it for get_body_part(). -commit 2a57414fd952f36f88b1ab2dc038934a8ddf6d64 -Author: lucian balanceanu -Date: Fri Oct 24 17:12:34 2014 +0300 +commit 3fe7fd27605ed9f506a95d11d4c88b78f22eadd1 +Author: Daniel-Constantin Mierla +Date: Fri Nov 27 14:35:51 2015 +0100 - cr: decreased logging severity of some messages + pv: fix for $expires() variables - - moved some informative messages from ERR to INFO, DBG + - invalid while iterator was used, resulting in crash + - reported by Jayesh Nambiar -commit e71c7f014f1217cb4431f2644e8c4c32cc6544f2 -Author: Victor Seva -Date: Fri Oct 24 11:48:53 2014 +0200 +commit 8e0a3ac61b8f094568c515e3aef46cd8d85454b9 +Merge: a584f40 21f29a8 +Author: Stefan Mititelu +Date: Fri Nov 27 13:43:45 2015 +0200 - textops: fix append_body_part + Merge pull request #420 from smititelu/KAMAILIO-30 - append was adding double '--' to the delimiter + tmx: Fix relayed_replies counter -commit 676ea94a18b6783b6c83f39a6580522d087ac1b5 -Author: Richard Good -Date: Thu Oct 23 16:21:39 2014 +0200 +commit a584f40b67a2f068ec445abe9d7cf910f8d5ee2e +Author: Daniel-Constantin Mierla +Date: Fri Nov 27 12:14:52 2015 +0100 - modules/ims_registrar_scscf: register space for notification process + dispatcher: added more explanatory note about accepted replies codes to keepalives + + - based on GH#402, with contribution from Alessio Casco and Olle E. + Johansson -commit 98779e19b3a08a3972ba1af0af48d220359a76e0 -Author: Richard Good -Date: Thu Oct 23 15:49:57 2014 +0200 +commit 21f29a8a9cce5fba7defd89368794d1631adb702 +Author: Stefan Mititelu +Date: Thu Nov 26 12:24:10 2015 +0200 - modules/ims_usrloc_scscf: updated sql creation script + tmx: Fix relayed_replies counter + + In the current implementation, for simple call timeout scenarios, + we get 2 x local_replies(100 + 408) and have only 1 x completed + 6xx/5xx/4xx/3xx/2xx(408). The relayed_replies were computed by substracting + completed - local_replies(1 - 2), resulting in the max ulong. + + Fix the above by counting the relayed_total(which include also the 1xx) + and substracting the relayed_local. -commit 46f3342428cd52fb01756c696e4e0f44199109da +commit 2bd85c6b5020929296860074ca9a5dbc0cbde69c Author: Daniel-Constantin Mierla -Date: Thu Oct 23 00:54:59 2014 +0200 +Date: Fri Nov 27 00:03:26 2015 +0100 - async: fixed typo in docs and adjusted example + db_mysql: updated include paths for libmysqlclient + + - direct use of mysql_config, the old substitution done in module + Makefile can break the includes of libmysqlclient files + - reported by Ian Yu-Hsun Lin, GH#419 -commit da844d7cc76e4db3b4bb2d9e5ba62cdfb394b110 +commit 98c71597e980f532b745079305661a8800708915 Author: Daniel-Constantin Mierla -Date: Wed Oct 22 19:14:03 2014 +0200 +Date: Thu Nov 26 23:30:51 2015 +0100 - uac: proper set of enabled/disabled flag for reg reocrds via rpc + core - test: reorganized the old files in test folder - - patch by Savolainen Dmitri, FS#483 + - moved to subfolders in test/misc + - keep content of the test folder cleaner for travis and unit tests -commit f63865041136aec65e2f7824967a702b23191364 +commit 8ff195355c1ac69fcee87b31784e1249a8435aab Author: Daniel-Constantin Mierla -Date: Wed Oct 22 19:08:25 2014 +0200 +Date: Thu Nov 26 10:28:15 2015 +0100 - uac: release lock when listing records via rpc - - - patch by Savolainen Dmitri, FS#484 + Makefile.defs: version set to 4.4.0-dev7 -commit 148c03b35ae3489910a02ba530441862b805be65 +commit 92573a292efc6583e57ab7ee13c569b02203e69a Author: Daniel-Constantin Mierla -Date: Wed Oct 22 19:01:32 2014 +0200 +Date: Thu Nov 26 10:21:37 2015 +0100 - uac: set hash ids for record refresh command - - - reported by Savolainen Dmitri, FS#485 + test/travis: reorganizing the content with more sections -commit 3869b9d6eac5af5120bc275201d6c04e7596d929 -Author: Victor Seva -Date: Mon Oct 20 13:07:41 2014 +0200 +commit 6985a2953b0577ad8dff449c2e849f6ff15da01c +Author: Daniel-Constantin Mierla +Date: Wed Nov 25 14:10:32 2015 +0100 - pkg/kamailio/deb: Add kazoo module to kamailio-extra-modules + cnxcc: more safety checks for call structure -commit 46b5342758dc3be1c84adaf2353dfe0fc60ab6b6 -Merge: 602c4a7 5fe0d14 +commit aef56c53f014a29ae4d7e1a7142b2dd9e9232c31 Author: lazedo -Date: Tue Oct 21 18:35:54 2014 +0100 +Date: Wed Nov 25 12:51:22 2015 +0000 - Merge branch 'master' of ssh://lazedo@git.sip-router.org/kamailio + kazoo : check amqp version -commit 602c4a7cdb7b772c61f8191ab8ac271d38493041 -Author: Luis Azedo -Date: Tue Oct 21 18:35:03 2014 +0100 +commit ce5591e8f7568f98b39d9b96a2c8debe81837a07 +Author: Daniel-Constantin Mierla +Date: Wed Nov 25 13:19:13 2015 +0100 - kazoo : compatibility issues with json-c & rabbitmq recent versions + cnxcc: safety check before freeing call structure + + - reported by GH#417 -commit 5fe0d14745303c61d3fafe9decbb735d5424a442 -Author: Daniel-Constantin Mierla -Date: Tue Oct 21 16:32:26 2014 +0200 +commit daa2509a58438505a6faa57e1a8befcc667a3b28 +Author: Camille Oudot +Date: Wed Nov 25 11:44:55 2015 +0100 - tls: note that SSLv3 should not be used if high security is needed + usrloc: fix mem leak when closing expired TCP - - the note was already for SSLv2 + CONN_EOF handler already decreases the reference counter for us -commit a85e18b152f841e35d790f74164ce7d8deb22a57 -Author: Daniel-Constantin Mierla -Date: Fri Oct 17 11:06:41 2014 +0200 +commit 81be39ba472bb3c1a8569c7158c6415aac512be7 +Merge: 43e1c7b 09e6d50 +Author: Victor Seva +Date: Tue Nov 24 14:56:22 2015 +0100 - tm: transaction uses number of branches specified by max_branches global parameter + Merge pull request #413 from linuxmaniac/vseva/travis_docker - - the number of UACs per transaction is based on max_branches global - parameter + test/travis: support different debian distributions -commit e008edb9772c08bb0a34dd719516f2a9b7b46115 -Author: Daniel-Constantin Mierla -Date: Fri Oct 17 11:04:23 2014 +0200 +commit 09e6d5042606bf033d47a11907349ae328e20e95 +Author: Victor Seva +Date: Tue Nov 24 13:52:30 2015 +0100 - core: new parameter - max_branches + test/travis: support different debian distributions - - the maximum number of uac branches can be set via config - - default value is 12 (old static value for MAX_BRNACHES) - - the upper limit is 31, it has to be at least 1 - - example: - max_branches=16 + - add some documentation + - add link to travis doc at /README.md + - add travis build status at /README.md + - use ${DIST}/rules to control the build + this simplifies the supported modules list by ${DIST} + it is already defined there. K.I.S.S + - install is done at debian/kamailio dir -commit 24e76b1932fa8c4e1136ad82cb582a97c50244c4 +commit 43e1c7bf9674225b40de76a465407eab6404bce0 Author: Daniel-Constantin Mierla -Date: Fri Oct 17 09:42:13 2014 +0200 +Date: Tue Nov 24 11:19:46 2015 +0100 - pipelimit: enhanced docs for pl_check() function - - - documented the algorithm and limit parameters + textops: refreshing readme from xml documentation + +commit 90b40b0222ec9564a16f4afe91677659fe15250e +Author: Daniel-Constantin Mierla +Date: Tue Nov 24 11:19:19 2015 +0100 + + textops: documentation for get_body_part() and get_body_part_raw() -commit b76afe7c0699b936bec3d7bb1c3a740bf08fdb1c +commit 76bbabb406679341656ef9011e6f71d806ef1ab3 Author: Daniel-Constantin Mierla -Date: Fri Oct 17 09:40:33 2014 +0200 +Date: Mon Nov 23 21:27:20 2015 +0100 - pipelimit: fix dynamic pipe limit check + textops: new functions to get part of a multipart body - - proper add and check at the same time + - get_body_part() - return only the body part content + - get_body_part_raw() - get body part with headers and boundary -commit 9b11c8362a0b07cb3fc8779582a92cdc56c07752 -Author: Carsten Bock -Date: Thu Oct 16 20:58:28 2014 +0200 +commit 29aaeb503dfba82414b0d75e967840b9f5ef91b3 +Author: lazedo +Date: Tue Nov 24 05:17:18 2015 +0000 - modules/pv: Add 7Bit Encoding/Decoding (e.g. for 3GPP-SMS) + kazoo : check amqp version + + checks amqp version for amqp_exchange_declare -commit 54e7ad1e07af0ce0b25c921ad9766e93b66e6d68 -Author: Carsten Bock -Date: Thu Oct 16 20:56:44 2014 +0200 +commit 9e4f732e891e2141cbc11a233917279fe86bfcdc +Merge: bbe761d bffce9c +Author: Victor Seva +Date: Tue Nov 24 04:10:26 2015 +0100 - Examples/Serving-CSCF: Add XSD for release 8 + Merge pull request #412 from linuxmaniac/vseva/travis_docker + + test/travis: migrate to docker environment -commit 495bf0f0bf5260fb7f99a9acf9201fd6b2fa4ec1 -Author: Carsten Bock -Date: Thu Oct 16 20:55:57 2014 +0200 +commit bffce9cb3882fabbfe7cf7f7948982cd3af91cb3 +Author: Victor Seva +Date: Tue Nov 24 00:42:47 2015 +0100 - b/f: Examples/Proxy-CSCF: Need to set_contact_alias() also for UPDATE + test/travis: migrate to docker environment + + - using https://hub.docker.com/r/linuxmaniac/pkg-kamailio-docker + - update list of supported modules + - dynamic clang version + - show CC version -commit 3e1addb00edb996b79b10126f7732e826d2ff5c4 -Author: Jason Penton -Date: Thu Oct 16 15:08:02 2014 +0200 +commit bbe761df038b2ce7170a01789a93665d44dd7d48 +Author: Victor Seva +Date: Mon Nov 23 22:45:45 2015 +0100 - modules/ims_usrloc_scscf: better debug and error logging + test/travis: build_travis.sh force error on any command -commit 22aef82dbc60f67dd606e568308114118de729a0 +commit e89c77f641311415b13b00dc9d469c0424362d53 Author: Daniel-Constantin Mierla -Date: Thu Oct 16 09:55:58 2014 +0200 +Date: Mon Nov 23 18:17:48 2015 +0100 - pkg/rpm: updated values for memory size in specs + db_mysql: explicitely set the reconenct flag via mysql cloent api + + - old mode setting connection fied directly still in place, but now + should be safer if that changes -commit a8e3b9187ba14177add9b3550761b95fd7098911 +commit 6a62cc666352fbca7f1cc5a239464b42a7afc2cb Author: Daniel-Constantin Mierla -Date: Thu Oct 16 09:55:10 2014 +0200 +Date: Mon Nov 23 18:00:58 2015 +0100 - pkg/deb: updated default values for memory in init.d scripts + db_mysql: extended the list of error code when to try to resend query -commit f1178c4d0e12f7d7e05bd6551ec3a841f1f23055 +commit a1556c0708af959a3816e732a7bd692c5fa5f4dc Author: Daniel-Constantin Mierla -Date: Thu Oct 16 01:06:09 2014 +0200 +Date: Mon Nov 23 17:11:51 2015 +0100 - textops: fix not initialized variable for muti-part body + db_mysql: print error number when failing to do mysql query -commit ab9d9a242ec60b820496794953610a84b303d2f3 +commit aab6547f39d723de6a01680cbd79b9365be8092f Author: Daniel-Constantin Mierla -Date: Thu Oct 16 01:03:54 2014 +0200 +Date: Mon Nov 23 16:43:43 2015 +0100 - dialog: proper de-serialization of expires value for a profile + dialog: safety bump of cseq for bye if prack was involved in call setup + + - reported by GH#409 -commit 853bb22836c888b19edc9db00edb1df0c0be0554 -Author: Daniel-Constantin Mierla -Date: Thu Oct 16 00:58:27 2014 +0200 +commit 82fc14da184549780d39903e91745baf338b75ae +Author: Stefan Mititelu +Date: Mon Nov 23 13:13:37 2015 +0200 - htable: initialize the value for iterator list index + Revert "Revert "p_usrloc: str->s string NULL check before str_dup"" + + This reverts commit 90d5a98bb52a810e02f225e72faa1ab526b96bbb. -commit 19e8a5618f86833995d17200267910e44471141d -Author: Daniel-Constantin Mierla -Date: Thu Oct 16 00:57:29 2014 +0200 +commit 99218397a285c72a1857ffff90d12afca1e15542 +Author: Victor Seva +Date: Mon Nov 23 12:04:41 2015 +0100 - websocket: safety guard when computing the list of connections + Revert "rtpengine: hash table to keep the selected nodes" - - avoid going further if connection is null -- unlikely to happen as len - of the list is computed before + This reverts commit fef0593a49fd6c6a08a7a1f3220e3b7f0cc030fe. -commit c3f57334976cd1b9741ea9336554c9ecfc3e014e -Author: Daniel-Constantin Mierla -Date: Thu Oct 16 00:08:27 2014 +0200 +commit 147a26d9583c09c27dbe0b0ee06efe6e6cc8620d +Author: Victor Seva +Date: Mon Nov 23 12:04:40 2015 +0100 - kamailio.cfg: overwrite log level name for cfgtrace + Revert "rtpengine: Update doku for node enable/disable" - - avoid mixing its messages with typical logs printed from code + This reverts commit fefe1e63a175ce475a44ae11bb89929e5c5f67d3. -commit 101af78891607fae2e63d5976c8e13b90334c03f -Author: Daniel-Constantin Mierla -Date: Thu Oct 16 00:03:22 2014 +0200 +commit 997bc78278a8d544e917caaf8672305e56cb7713 +Author: Victor Seva +Date: Mon Nov 23 12:04:39 2015 +0100 - corex: fix name in the example for send_data() function + Revert "rtpengine: Add hash_table_size modparam" + + This reverts commit a37257d48702c494c080f7f7c86a2dc18957b242. -commit 377c69ca8d8f512205eade11337a4fed1107a27b -Author: Richard Good -Date: Wed Oct 15 16:49:50 2014 +0200 +commit 4b213dd5b6f6c24c7ad331571d43a89018ce2e40 +Author: Victor Seva +Date: Mon Nov 23 12:04:39 2015 +0100 - modules/ims_registrar_scscf: Additional file needed for new notify process - New file sem.h used by the process that handles notifies + Revert "rtpengine: kamctl fifo nh_show_hash_total" + + This reverts commit e3a379790e3370f549ab7d44e8d603e8a9040ecc. -commit 01cf2d86173135af5120c94437f377415a6e7679 -Author: Richard Good -Date: Wed Oct 15 16:48:42 2014 +0200 +commit 75021d6475ac924252d5ac99a88d9876f50cbb29 +Author: Victor Seva +Date: Mon Nov 23 12:04:38 2015 +0100 - modules/ims_registrar_scscf: Created a new process to send notifies + Revert "rtpengine: Add rtpengine_allow_op modparam" + + This reverts commit 69c156f9c2d2c40faf61e2ebde9f98b933b87baf. -commit 483baa261534845e195d426499aea3d2c4db44fd -Author: Richard Good -Date: Wed Oct 15 16:48:10 2014 +0200 +commit f52bace883bc0802d130ac65ac466da90275ba97 +Author: Victor Seva +Date: Mon Nov 23 12:04:37 2015 +0100 - modules/ims_usrloc_scscf: Added database support for subscriptions + Revert "rtpengine: Fix comments for hastable" + + This reverts commit 44c19111fef40bd2f18ec7ecf8726d967c8a953a. -commit e287f717cacb9656780ee26e79bc8d17ef8f2c13 -Author: Richard Good -Date: Wed Oct 15 16:47:10 2014 +0200 +commit b2c5686ec199ab87e501fb5be86ac068866338a2 +Author: Victor Seva +Date: Mon Nov 23 12:04:36 2015 +0100 - lib:ims_getters: removed unused variable causing compile warning + Revert "rtpengine: Fix deletion for branching scenarios" + + This reverts commit 028540c12ea47fc5fc0b7f787885c43d7962ea25. -commit 9253db2075d53548ee8e2b99f41cb1747a9ad12e -Author: Daniel-Constantin Mierla -Date: Wed Oct 15 11:53:56 2014 +0200 +commit 90d5a98bb52a810e02f225e72faa1ab526b96bbb +Author: Victor Seva +Date: Mon Nov 23 12:04:31 2015 +0100 - evapi: fixed typo in the Makefile pkg-config search + Revert "p_usrloc: str->s string NULL check before str_dup" + + This reverts commit d1c6dc67b222e05be1ff90be9b38846f63866839. -commit bd4233e1441b903e9893779962b681dbfc493a3b -Author: Daniel-Constantin Mierla -Date: Tue Oct 14 16:13:43 2014 +0200 +commit d1c6dc67b222e05be1ff90be9b38846f63866839 +Author: Stefan Mititelu +Date: Mon Nov 23 12:35:03 2015 +0200 - ndb_mongodb: fixed c&p typo for section id + p_usrloc: str->s string NULL check before str_dup + + Don't shm_str_dup() NULL str->s strings. + Add checks to avoid shm_str_dup() warning. -commit fa16440977eaa32ba7f1fd82d6c35daa40e27dd2 -Author: Daniel-Constantin Mierla -Date: Tue Oct 14 14:46:30 2014 +0200 +commit ce33e4c19764bc9c2ec41e564199a2d13d74a85e +Author: jaybeepee +Date: Mon Nov 23 12:48:01 2015 +0200 - doc/rpc_list: regenerated rpc commands lists + modules/ims_usrloc_pcscf: allow contacts with no received params (populated from notify) -commit c2180873931408e7ff35e826f82505a7a99167e6 -Author: Olle E. Johansson -Date: Tue Oct 14 09:25:12 2014 +0200 +commit 028540c12ea47fc5fc0b7f787885c43d7962ea25 +Author: Stefan Mititelu +Date: Mon Nov 16 10:49:36 2015 +0200 - test/unit: Add Sipsak URL in README + rtpengine: Fix deletion for branching scenarios + + - hash table entry contains callid, viabranch + - hash table lookup based on callid, viabranch (useful for branching scenarios); + keep doing the hash table remove right away + - remove op param when select_rtpp_node(); not needed -commit 4d898e9391ff4990eb5ce2319c9a5ca7d66d98b4 -Author: Daniel-Constantin Mierla -Date: Mon Oct 13 23:50:21 2014 +0200 +commit 44c19111fef40bd2f18ec7ecf8726d967c8a953a +Author: Stefan Mititelu +Date: Thu Nov 12 09:55:17 2015 +0200 - test/unit: updates to units 27, 28, 29, 31 ane 33 + rtpengine: Fix comments for hastable - - parametrizied 11.cfg + - shm NULL checks and free already alloc'ed shm + - default entry tout to 3600 sec + - return node only, not the whole entry + - zero shm hashtable parts + - lookup and select new node if lookup fails; this is done for all commands + and assures fallback behaviour + - change void to struct specific + - make set_rtp_inst_pvar() static -> used only in rtpengine.c + - fix typos rtpproxy vs rtpengine -commit dad6e668c3839bafb20fcee31fdd35a1ce7ceac7 -Author: Daniel-Constantin Mierla -Date: Mon Oct 13 22:49:38 2014 +0200 +commit 69c156f9c2d2c40faf61e2ebde9f98b933b87baf +Author: Stefan Mititelu +Date: Tue Nov 10 16:04:30 2015 +0200 - test/unit: sipsak listed as dependency in readme + rtpengine: Add rtpengine_allow_op modparam + + When the param is enabled, allow current sessions to finish and deny new + sessions for manually deactivated rtpengine nodes via kamctl i.e. + "disabled(permanent)" nodes. + This is useful when deactivating the nodes for maintenance. + Default value is 0, so the current behaviour is maintained + (e.g. don't send commands to any deactivated proxy). + Updated doku. -commit 66b93da82ed075c0a4d9d6b1e5f93932432a1aee -Author: Daniel-Constantin Mierla -Date: Mon Oct 13 22:47:28 2014 +0200 +commit e3a379790e3370f549ab7d44e8d603e8a9040ecc +Author: Stefan Mititelu +Date: Mon Nov 9 18:04:33 2015 +0200 - test/unit: updated unit 25.sh + rtpengine: kamctl fifo nh_show_hash_total + + Print the total number of hash entries in the hash table, at the given moment. + Updated doku. -commit 6f476de8d0e658c148328ace7f0f27f0574fb52e -Author: Daniel-Constantin Mierla -Date: Mon Oct 13 22:35:07 2014 +0200 +commit a37257d48702c494c080f7f7c86a2dc18957b242 +Author: Stefan Mititelu +Date: Mon Nov 9 12:54:47 2015 +0200 - test/unit: updates to unit 22 + rtpengine: Add hash_table_size modparam + + Allow configurable table size. + Updated doku. -commit 53f12ab00ae9ea2075ad207a1cc53dc52c242e3a -Author: Juha Heinanen -Date: Mon Oct 13 19:00:08 2014 +0300 +commit fefe1e63a175ce475a44ae11bb89929e5c5f67d3 +Author: Stefan Mititelu +Date: Fri Nov 6 17:12:23 2015 +0200 - modules/pua: reduced log level of cleaning message + rtpengine: Update doku for node enable/disable + + This is my understanding of the current shared memory node list implementation. + Correct me if I'm wrong. -commit 5f5af61277344322b1f95e46aab6a30f2f74f83b -Author: Victor Seva -Date: Mon Oct 13 14:34:38 2014 +0200 +commit fef0593a49fd6c6a08a7a1f3220e3b7f0cc030fe +Author: Stefan Mititelu +Date: Thu Nov 5 16:32:02 2015 +0200 - pkg/kamailio/deb: update version to 4.3.0~dev1 + rtpengine: hash table to keep the selected nodes + + Shared memory hash table with global hashtable lock. + Add state maintaining the selected rtp node, for a given callid. + Hashtable entry expiration time configurable using hash_entry_tout modparam. + The actual deletion happens on the fly while insert/remove/lookup are called. + Updated doku. -commit fd900517375d73d88f5c1d28c0dd5522b5524d2a +commit 490fa49f72022b334340a58a92d63b5b6f661c87 Author: Daniel-Constantin Mierla -Date: Mon Oct 13 13:46:19 2014 +0200 +Date: Mon Nov 23 09:54:36 2015 +0100 - Makefile.defs: version set to 4.3.0-dev1 + pv: $snd(sproto) returns sending protocol as string -commit d3ce0717198cc0147c84c3526eb34468f847aad2 +commit 5a142f7cc2899090b007654529f08b1b2f4e70b1 Author: Daniel-Constantin Mierla -Date: Mon Oct 13 13:23:17 2014 +0200 +Date: Sun Nov 22 10:02:36 2015 +0100 - core: default size for shared memory is 64MB + core: relocate dbg message before killing children at shut down - - decent size at least for 64b architecture where pointer overhead is - bigger + - can race with per module log level, debugger module can be destroyed -commit 469c150b1dd935e3342f40d94e47c70e77fac2c0 +commit 31fa9c50bd6193851c53c1d66b8d517da5f67a15 Author: Daniel-Constantin Mierla -Date: Mon Oct 13 13:18:37 2014 +0200 +Date: Fri Nov 20 12:32:55 2015 +0100 - tm: updated readme with default value for failure_reply_mode - - - fixed broken ending section tag in functions file + dmq_usrloc: documentation for batch_size and batch_usleep params -commit 8118c85bc53494c5a1d6e0a9fd655778f8ca8b61 +commit 167668b4e31d7e613f00baf548671c4361189d79 Author: Daniel-Constantin Mierla -Date: Mon Oct 13 13:14:49 2014 +0200 +Date: Fri Nov 20 12:31:04 2015 +0100 - tm: default value for failure_reply_mode set to 3 + dmq_usrloc: support for throttling sync of all usrloc records - - discard previous replies if a new serial forking step is done + - batch_size and batch_usleep parameters can control how many records + can be sent out at once, after that sleep for batch_usleep + microseconds before sending the next batch -commit b1a8a624146056e38c725b70273174324dd134a4 +commit 5f3f499bc8f7ea0227b62494f73fbd734a820fa1 Author: Daniel-Constantin Mierla -Date: Mon Oct 13 13:10:33 2014 +0200 +Date: Fri Nov 20 12:17:06 2015 +0100 - core: pv print default buffer size set to 8kB + dmq_usrloc: use system malloc for fetching all contacts + + - this is a very rare operation, thus not making sense to allocate a lot + of pkg for it (the memory is freed immediately) -commit eccc58969ca38b9eecd22a0d1ecccf440d9e8ec4 +commit 99a6015165d161c4b99c72d81497e3496b387768 Author: Daniel-Constantin Mierla -Date: Mon Oct 13 13:07:17 2014 +0200 +Date: Fri Nov 20 12:03:46 2015 +0100 - core: default tcp read buffer size set to 16kB + dmq_usrloc: documentation for sync parameter -commit aaca5cc26960e52361bdfcc4e498908c39805207 +commit 5efe3229da3c98ed2bd531c6c9eb712bdbd9ea67 Author: Daniel-Constantin Mierla -Date: Mon Oct 13 12:32:08 2014 +0200 +Date: Fri Nov 20 11:59:36 2015 +0100 - pua_mi: removed empty sections from docs + dmq_usrloc: new param sync - control sync'ing all contacts at startup - - updated title for mi commands sections to match indexing expected - value (reported by Juha Heinanen) + - default 1 - require sync'ing of all contacts at startup + - set to 0 to disable -commit 45eae146d49a8e9bc55fe553815fa6739b8cebe6 -Author: Daniel-Constantin Mierla -Date: Mon Oct 13 12:30:11 2014 +0200 +commit 4d122e15f4599010000f6e5d2e60e9bc13b2281a +Author: Federico Cabiddu +Date: Fri Nov 20 11:13:40 2015 +0100 - dispatcher: normalized section name for rpc commands in docs - - - easier for indexing + tm: set next hop as dst_uri for appended branches -commit d1541b8299581cdfaf84169e307f47116def5cbf -Author: Daniel-Constantin Mierla -Date: Mon Oct 13 11:57:48 2014 +0200 +commit b056aed3db849d54ad5b7cd04e016bbd969a57c6 +Author: jaybeepee +Date: Thu Nov 19 17:32:17 2015 +0200 - db_cluster: safey check to be sure the command is implemented by db connector + modules/ims_qos: do not free auth session on failure to send STR + +commit 9949f42c9dedcb300ca6c99e53a3b171a6500c21 +Author: Stefan Mititelu +Date: Thu Nov 19 16:01:06 2015 +0200 + + core: ut.h - - reported by Miguel Reis, FS#476 + Typo SHM_MEM_ERROR vs PKG_MEM_ERROR -commit a4432c327044e720d4a2ac388f7aa0692f36e873 +commit ac31eb11cc4b194b2d7e9dddff63fd074f456005 Author: Daniel-Constantin Mierla -Date: Mon Oct 13 11:34:40 2014 +0200 +Date: Thu Nov 19 14:58:50 2015 +0100 - uac: init avp_value lenght to be safe when avp is not found for restoring From/To URI + etc/kamailio.cfg: use flag 'r' for rtpproxy if ip in sdp is not private - - reported by Klaus Darilion, FS#479 + - skip learning mode, advertised media ip is routable -commit ba1967df93fa9bcd39070c325f72081b5adf7748 -Author: Daniel-Constantin Mierla -Date: Mon Oct 13 00:06:18 2014 +0200 +commit af449f2509138c024b866c88063efce843bf6d86 +Merge: ea0b4e5 24999a5 +Author: Stefan Mititelu +Date: Thu Nov 19 15:51:59 2015 +0200 - kamdbctl: search for greadlink first + Merge pull request #401 from smititelu/ut_sanity_checks - - bsd version of readlink is different than gnu version + core: NULL checks for ut.h -commit b209f27df95ffb27ea8fef00a402f2a27b8871a7 +commit ea0b4e50f62f8a461b737882c383f17767851d3d Author: Daniel-Constantin Mierla -Date: Mon Oct 13 00:05:24 2014 +0200 +Date: Thu Nov 19 13:58:33 2015 +0100 - kamctl: search for greadlink first + tm: use svpe fixup for t replicate uri param - - bsd version of readlink is different than gnu version + - the function expects it for getting the value -commit f24c03d667429d9622720a85660892d5ec3244e6 -Author: Daniel-Constantin Mierla -Date: Sun Oct 12 23:49:55 2014 +0200 +commit b37aa66fd1cf3fe99aae50adb89d4cfecf6d90d1 +Author: Daniel Rus Morales +Date: Thu Nov 19 13:44:08 2015 +0100 + + db_postgress: fix compilation, NTOHLL and NTOHLL provided by OSX 10.10 + +commit 35094f0ec0bb2bde70b5e3a723ae11a6b97772f0 +Author: Daniel Rus Morales +Date: Thu Nov 19 13:43:43 2015 +0100 - dialplan: documentation for match_dynamic parameter + .gitignore: ignore emacs desktop file + +commit 24999a5dbf7d986942479c0670158748c263a3cd +Author: Stefan Mititelu +Date: Wed Nov 18 12:21:19 2015 +0200 + + core: NULL checks for ut.h + + Add some NULL checks for shm/pkg dup functions and few others. -commit dd7a49ee775ff5b29bb73c5313c3bfd8a64b26a0 +commit b89534385ef881719c85534ab7a32a500be2aa9c Author: Daniel-Constantin Mierla -Date: Sun Oct 12 23:39:18 2014 +0200 +Date: Thu Nov 19 13:30:07 2015 +0100 - dialplan: option to allow variables in match and substitution expressions + rtpproxy: fix mismatching internal value for column setid - - based on requirement from FS#429 - - new parameter: match_dynamic to enable this feature - - if enabled, at load time, the values are searched for variables and if - any found, then evaluation and pcre compilation is done at runtime - - it can work with rules that don't include variables at the same time, - these being pre-compiled at load time + - on a report by Jan Hazenberg -commit 860ebc3e971ed562c441054f7c09def1a505ea34 +commit d2416957e4caec8a64abec82029ea18c52a7bc2d Author: Daniel-Constantin Mierla -Date: Sun Oct 12 23:23:03 2014 +0200 +Date: Thu Nov 19 00:01:27 2015 +0100 - kamctl: support of fnmatch operator for dialplan + kamctl: require db or ctl engine made specific for dispatcher subcommands + +commit a5b5091ad937bbb5336b86ebb5ca2de7556b8e67 +Merge: 1a05910 dd7854e +Author: Camille Oudot +Date: Thu Nov 19 12:26:22 2015 +0100 + + Merge pull request #403 from kamailio/child_stop_fail_status - - do not reload rules in memory after each change in database to allow - batch updates. Reload command has to be done explicitely - - parameters of addrule after match expression are optional + core: exit with failure code if a child dies + +commit dd7854ea6f7efa6899bf59bb0d5069f0daf1def9 +Author: Camille Oudot +Date: Thu Nov 19 11:16:11 2015 +0100 + + core: exit with failure code if a child dies -commit 37c6e7ec80a16b93751d535de3b7784c1270d8b8 +commit 1a05910912fbf9baaf821cc30fac7485c1e67622 Author: Daniel-Constantin Mierla -Date: Sun Oct 12 18:58:02 2014 +0200 +Date: Wed Nov 18 14:42:51 2015 +0100 - dialplan: extended debug message to be more useful + usrloc: log details of contact when inserting in db failes -commit d216b7507624b8a7da9564f893d651f6257b7bd6 -Author: Olle E. Johansson -Date: Sun Oct 12 21:50:04 2014 +0200 +commit 44fdac69eb864125b4d02af0c650ce735dcf7aa8 +Author: Lucian Balaceanu +Date: Wed Nov 18 13:45:34 2015 +0200 - siptrace Documentation updates, add section ID's + carrierroute: fix failureroute db_load_description + + - safeguarding shm_str_dup call in add_failure_route_rule function -commit 3cefc3b3e3c77fc92cb1d8cc131be7d6d067a9ae -Author: Olle E. Johansson -Date: Sun Oct 12 20:58:56 2014 +0200 +commit 16bc7b726a21108458f354aea840cdbf5d89d6d8 +Author: Daniel-Constantin Mierla +Date: Tue Nov 17 22:51:01 2015 +0100 - htable Documentation updates, fixing typos + dmq: removed params field from dmq_node_t + + - used only for setting a flag + - duplicating a node caused issues with param field not being + duplicated, resulting in potential many free of same pointer, reported + by Sebastian Damm -commit 73e5bc5896cc30d63cd92919ebf3da2e3c72ee26 -Author: Olle E. Johansson -Date: Sun Oct 12 20:38:27 2014 +0200 +commit 4da5d898da9a0a8f2780dcdf864354098268a7e9 +Author: Daniel-Constantin Mierla +Date: Tue Nov 17 09:14:07 2015 +0100 - uri_db Documentation update, section IDs added + lib/srdb1: url parser extracts the db name before the url parameters + + - some database urls can have parameters after db name, like: + driver://username:password@dbhost:port/dbname?params + - reported by Kelvin Chua for db_mongodb -commit 576ade3a42557d0c499a01ab9f37e1f0f085580e -Author: Olle E. Johansson -Date: Sun Oct 12 20:19:05 2014 +0200 +commit 6a738a9123affb08a870e8fac839bf04994faa5b +Author: Lucian Balaceanu +Date: Mon Nov 16 18:59:05 2015 +0200 - CA example README update + carrierroute: addind db_load_description parameter + + - toggle on/off loading in memory the description column in the + carrierroute/carrierfailureroute database tables. This reduces the + shared memory used by the module -commit 292b21608bd830dee1f0affcdcdaa11548274abd -Author: Olle E. Johansson -Date: Sun Oct 12 20:14:38 2014 +0200 +commit 73c29912aa69f1acd43ba156191bead4a1289bb1 +Author: Daniel-Constantin Mierla +Date: Mon Nov 16 16:38:57 2015 +0100 - configuration update - version + tmx: added $T(ruid) + + - return current branch ruid attribute + - same as $T_reply_ruid, but works also for branch route -commit e9b7e9121be27f6c2ad92643912afabc64019385 -Author: Olle E. Johansson -Date: Sun Oct 12 20:13:43 2014 +0200 +commit 5f936a387fae32f4a4f7c11a9cbd5666b31ef9e7 +Author: Stefan Mititelu +Date: Mon Nov 16 10:49:36 2015 +0200 - etc/kamailio.cfg - update version + rtpengine: Fix deletion for branching scenarios + + - hash table entry contains callid, viabranch + - hash table lookup based on callid, viabranch (useful for branching scenarios); + keep doing the hash table remove right away + - remove op param when select_rtpp_node(); not needed -commit 18939df87a249a3a5bf17f7c00c6498b0ad75ceb -Author: Olle E. Johansson -Date: Sun Oct 12 20:09:52 2014 +0200 +commit 9464932676adc8129796f1c981d96859bbb6123b +Author: Daniel-Constantin Mierla +Date: Mon Nov 16 12:32:41 2015 +0100 - test/unit - update README with dependency on sipp + tls: field for server_id in default init of tls_domain_t structures -commit 4d0eae5c0decebfec024bf04dd6f724437627956 -Author: Olle E. Johansson -Date: Sun Oct 12 20:04:01 2014 +0200 +commit 7ad4dadcab841d191d5edc028a74cea7fe411450 +Author: Stefan Mititelu +Date: Thu Nov 12 09:55:17 2015 +0200 - README minor typo fix + rtpengine: Fix comments for hastable + + - shm NULL checks and free already alloc'ed shm + - default entry tout to 3600 sec + - return node only, not the whole entry + - zero shm hashtable parts + - lookup and select new node if lookup fails; this is done for all commands + and assures fallback behaviour + - change void to struct specific + - make set_rtp_inst_pvar() static -> used only in rtpengine.c + - fix typos rtpproxy vs rtpengine -commit 6822ff45e931ad3e93b22ebf7d1beb350bf27e70 -Author: Juha Heinanen -Date: Sun Oct 12 13:41:41 2014 +0300 +commit 5e9f144ca214f43b2fd01917fb4983716c8916f8 +Author: Daniel-Constantin Mierla +Date: Mon Nov 16 11:43:53 2015 +0100 - modules/pua: db_mode=2 send_publish fixes + core: print runtime dir in log message - - plus small debug message edits + - do logging to syslog, along with stderror for runtime dir related + errors -commit 214b161e644c2d7468d9ac3ea13ad0be5196d143 -Author: Lucian Balaceanu -Date: Sun Oct 12 10:28:29 2014 +0200 +commit ba647bb171e1e15024342a56fb7d42eadd0347fd +Merge: 3b7c619 a4cdd61 +Author: Carlos Ruiz Díaz +Date: Sun Nov 15 08:48:35 2015 -0600 - core: execute onsend_route for replies before sending out + Merge pull request #398 from grumvalski/cnxcc_deadlock_fix - - control execution of onsend_route block for replies via parameter - onsend_route_reply + cnxcc: make cnxcc locks re-entrant -commit 3e01905143ace159b18e11a31edf39018d754bba +commit a4cdd61afad027c9bb431ceda4e71941274610ce +Author: Federico Cabiddu +Date: Wed Nov 11 13:08:52 2015 +0100 + + cnxcc: make cnxcc locks re-entrant + +commit 3b7c61980c3dc34d16a0e6ae5376fd81b0a2ce5e Author: Daniel-Constantin Mierla -Date: Fri Oct 10 21:16:51 2014 +0200 +Date: Fri Nov 13 09:20:42 2015 +0100 - tm: handle r-uri alias parameter for local generated requests within a dialog + htable: readme file was regenerated -commit 866ddc109bfd7c681e13ce529d271e8a2a33a972 +commit 3a723206adaa99cf22aee8fead569d9a96e21a7b Author: Daniel-Constantin Mierla -Date: Fri Oct 10 12:19:29 2014 +0200 +Date: Fri Nov 13 09:19:46 2015 +0100 - core: safety check for server_header lenght - - - don't add the header in local generated replies if the value is empty + htable: updated the documentation for timer_procs parameter -commit cea9b91dacdb23b22fc1a7dd8454994eab9efa6e +commit 30b85032e23b69cb0e355ba796545daa23dc705a Author: Daniel-Constantin Mierla -Date: Fri Oct 10 12:11:52 2014 +0200 +Date: Fri Nov 13 09:18:18 2015 +0100 - tm: safety check for user_agent_header value - - - don't add the header in local generated requests if the value is empty + htable: removed inexistent timer_mode parameter from docs -commit 7f50e172c26259ebf023d414fb97b295958de370 -Author: Jason Penton -Date: Fri Oct 10 10:44:49 2014 +0200 +commit d8b78bfaab25f9a73a67d813cfa930a6eb754bfa +Author: Daniel-Constantin Mierla +Date: Fri Nov 13 09:16:35 2015 +0100 - modules/tm: new function t_is_retr_async_reply to check if a reply being processed is part of a transaction currently suspended + htable: ability to create more than one timer process -commit bb30c83e4ed3594852c6251558b4c441bb5b6e19 -Author: Jason Penton -Date: Thu Oct 9 17:02:57 2014 +0200 +commit 8940cf950cb763ba5145a35d80ffc71f64f450ca +Author: Juha Heinanen +Date: Fri Nov 13 08:50:01 2015 +0200 - modules/db_mysql: added parameter to change affected rows value for UPDATE queries - - enabled will return the number of matched/foudn rows as opposed to the number of updated rows + modules/sdpops: added sloppy option to sdp_content function -commit 0161257895fe421a0c9ee413a8b89d038007ba0d -Author: Richard Good -Date: Thu Oct 9 15:08:22 2014 +0200 +commit 4baf576076735018f1fe9812e6d7c64333ee62bf +Author: Daniel-Constantin Mierla +Date: Thu Nov 12 14:38:07 2015 +0100 - modules/ims_usrloc_pcscf: added new parameter to contact match using only URI host and port + tls: option to match TLS client config profile based on server_id + + - server_id can be any string that uniquely identifies a client config + profile, overriding the attempt to match on ip:port (+sni). This makes + it easier to select the desired config profile, because the port is + hard to guess for stream connections + - prameter xavp_cfg has to be enabled and inner xavp 'server_id' has to + be set before relaying the sip message (before opening the client + connection) -commit 885a468af97b4de25256d3c193a61890f616c128 -Author: Richard Good -Date: Thu Oct 9 14:22:23 2014 +0200 +commit 138b776e5f5d37d9a78857d1506ffe09a5f4d704 +Author: Daniel-Constantin Mierla +Date: Thu Nov 12 14:37:55 2015 +0100 - modules/ims_charging: updated ims_charging documentation for new trunk parameter + tls: refreshed the content of readme -commit 46e5cc861cec11c7d9ddfbbec7a0c986c95fc5e2 -Author: Jason Penton -Date: Thu Oct 9 14:18:29 2014 +0200 +commit e3e0e52ca4a06f72f5139623116d1c8bc119b1e3 +Author: Daniel-Constantin Mierla +Date: Thu Nov 12 14:21:19 2015 +0100 - modules/ims_charging: added support for trunk ID in Ro CCR + tls: document matching on server_id for oubound connections -commit f5b463f39024414f1ca9cc25b6ae620721b3ce08 -Author: Jason Penton -Date: Thu Oct 9 14:10:00 2014 +0200 +commit 0f55ff0351382eeb88df956e190459b73bc6ef4d +Merge: d493d3f fc90242 +Author: Alexandr Dubovikov +Date: Thu Nov 12 14:00:56 2015 +0100 - modules/ims_charging: Added SRDB link to Makefile for DB Support + Merge pull request #397 from UserAd/master + + sipcapture: add async support -commit efcd3421c4733a51ded1fb74ff35c7425d426596 -Author: Jason Penton -Date: Thu Oct 9 14:01:35 2014 +0200 +commit fc90242ddd046a3cfd545a50cf636454de173d6f +Author: Konstantin Tumalevich +Date: Thu Nov 12 16:58:48 2015 +0500 - modules/ims_charging: added realtime DB support for Ro sessions + sipcapture: add async support + + - Add support for storing in asynchronous mode if supported + by database backend -commit 35fe10d9a88d3c3f9a42d1ec891f7f62a2fc26a9 -Author: Richard Good -Date: Thu Oct 9 11:59:59 2014 +0200 +commit d493d3fa4f052bb3958599b395f7a4d2fe0a9d91 +Merge: 3a19b12 5733835 +Author: Daniel-Constantin Mierla +Date: Thu Nov 12 12:10:59 2015 +0100 - modules/ims_qos: Rx_reg use received IP for framed_ip_address AVP - Previous reg_reg used contact IP for framed_ip_address AVP but NAT breaks this - Using received IP instead works for NAT and non-NAT scenarios + Merge pull request #395 from mslehto/ims_clang_errors + + patches to fix some clang errors and warnings -commit 2e821613a2fac7b3a6b7ec28a314b462f18f5bc2 -Author: Richard Good -Date: Thu Oct 9 11:57:56 2014 +0200 +commit 57338351a3575f2ba0c38071179daf02bcba2b7f +Author: Mikko Lehto +Date: Wed Nov 11 23:03:40 2015 +0200 - modules/ims_qos: Added feature to Rx_reg check if session has been opened before acting on termination - When Rx signalling session is terminated only remove user from user loc if rx signalling session was successfully opened + modules/ims_usrloc_scscf: to avoid clang warning, include atomic_t declaration -commit 333ff6fad046da64996084cc7644d16e40cc60d0 -Author: Richard Good -Date: Thu Oct 9 11:55:57 2014 +0200 +commit b0c609e68bdaf300c681b7f4f3a5a857988c1de1 +Author: Mikko Lehto +Date: Wed Nov 11 22:54:14 2015 +0200 - modules/cdp,cdpavp: added support for Incoming and Outgoing Trunk-Group AVPs + modules/ims_registrar_scscf: adds missing jump to error1 label -commit d2b06ddb70ee8edfd0456fb0697167560d608f44 -Author: Richard Good -Date: Thu Oct 9 11:52:15 2014 +0200 +commit 5e6cec1d01e676d78c4a21e48de3e0908e39de8f +Author: Mikko Lehto +Date: Wed Nov 11 22:46:30 2015 +0200 - modules/ims_registrar_scscf: fixed asserted identity comparison to path to not include "sip:" + modules/ims_charging: fixes always true comparison of unsigned int -commit 15f27e65c9bd4ac50c91672d1b355d9e75f8972f -Author: Richard Good -Date: Thu Oct 9 11:48:04 2014 +0200 +commit 485351dcfb1e5432f3a4e4e4af857f0d27ae8c74 +Author: Mikko Lehto +Date: Wed Nov 11 22:45:30 2015 +0200 - modules/ims_icscf: Added new module param use_preferred_scscf_uri - This allows ICSCF to have a preferred S-CSCF is HSS returns a list - Usually ICSCF uses SCSCFs in the order in which HSS provides them - This gives another level of priority control to SCSCF selection at the ICSCF + modules/ims_charging: fixes prototype declatation for destroy_ro_session() -commit 0f95e15d423cbc2a2f1a1405fb7017c65a2249f2 -Author: Victor Seva -Date: Thu Oct 9 09:52:18 2014 +0200 +commit 3a19b122572ed70b8d5f6da59dd506c2f98b0e31 +Author: jaybeepee +Date: Wed Nov 11 13:41:32 2015 +0200 - pkg/kamailio/deb: update version to 4.3.0~dev0 + modules/ims_charging: add direction for Ro session in debug print -commit 1828c8ab644243878fc6db9ff0f2592e656dc09a -Author: Hugh Waite -Date: Wed Oct 8 19:01:20 2014 +0100 +commit b2ff2745b97051625509de0f328e5b1a8f584387 +Author: Daniel-Constantin Mierla +Date: Wed Nov 11 08:59:10 2015 +0100 + + Makefile.defs: gcc 5.2 option -mfp32 is required by -march=r3000 for mips arch + + - reported by Victor Seva, GH#394 + +commit d75bb85c4a03dedb33004fe04c447182fdf37f5c +Author: Stefan Mititelu +Date: Tue Nov 10 16:04:30 2015 +0200 - core: xavp: Fix xavp_insert to prevent corrupted linked lists + rtpengine: Add rtpengine_allow_op modparam - - Inserting data at a given index will pad the xavp with XTYPE_NULL entries - - Inserting data will replace a NULL entry if present + When the param is enabled, allow current sessions to finish and deny new + sessions for manually deactivated rtpengine nodes via kamctl i.e. + "disabled(permanent)" nodes. + This is useful when deactivating the nodes for maintenance. + Default value is 0, so the current behaviour is maintained + (e.g. don't send commands to any deactivated proxy). + Updated doku. -commit 55be67db091cd42793c33411c488b1bd4a064275 +commit 70699ae8b9159c18bdd73c3092ccb19691edf0fd Author: Daniel-Constantin Mierla -Date: Wed Oct 8 23:48:41 2014 +0200 +Date: Tue Nov 10 09:30:30 2015 +0100 - Makefile.defs: version set to 4.3.0-dev0 + core: dns cache - test for null pointers before debug checks after removing from list - - developent for future major release 4.3.0 is open in master branch + - next/prev are set to null after remove from list by commit + 0fbcca38574139f1cd8ba7506ee5e204be5f2da7 + +commit d73d56b41028341c46a331dfb74f5805248aae56 +Author: jaybeepee +Date: Tue Nov 10 10:35:47 2015 +0200 + + modules/ims_charging: removed unused impu_data parcel (memory leak) + +commit 2aa7683dfebedc4ef9c3fdd50fb7abd2a2d718db +Author: Daniel-Constantin Mierla +Date: Mon Nov 9 21:05:30 2015 +0100 + nathelper: added examples in docs for few functions -===================== 2014-10-16 Version 4.2.0 Released ===================== +commit 74fdbe2248ec79d70440bda255c2f21f801aa0f8 +Author: Stefan Mititelu +Date: Mon Nov 9 18:04:33 2015 +0200 + + rtpengine: kamctl fifo nh_show_hash_total + + Print the total number of hash entries in the hash table, at the given moment. + Updated doku. + +commit 7375d0b8f136c09d5f4597338aae2d50214a3293 +Author: Stefan Mititelu +Date: Mon Nov 9 12:54:47 2015 +0200 + + rtpengine: Add hash_table_size modparam + + Allow configurable table size. + Updated doku. + +commit 21ea68e6260f614b89c0b282e14d6ca089c1f2e9 +Author: Victor Seva +Date: Mon Nov 9 11:41:44 2015 +0100 + + pkg/kamailio/deb: [systemd] remove lintian warning + + https://lintian.debian.org/tags/systemd-service-file-refers-to-obsolete-target.html + +commit 2718efddb8e87a269af012d8661d57887e7c4d86 +Author: Daniel-Constantin Mierla +Date: Mon Nov 9 09:36:12 2015 +0100 + + Makefile.defs: removed option -minline-all-stringops for compiler on mips + + - not supported, reported by Victor Seva, FS#392 + +commit b1c6c2af7e96c0bcbdee4ff46f6faf19fdc75d9f +Author: Daniel-Constantin Mierla +Date: Mon Nov 9 09:21:29 2015 +0100 + + tls: check for support of SSLv3 method + + - some versions of libssl removed support for SSLv3 + - reported by Victore Seva, FS#391 + +commit 9e07c7e1b6cf55398c7595d5265c4944e10c7862 +Author: jaybeepee +Date: Sun Nov 8 18:14:51 2015 +0200 + + modules/ims_qos: remove CDP auth session on failure to suspend + +commit e1eb2cdfc01036ed86d6b3f61c8c03571435630f +Author: Olle E. Johansson +Date: Sun Nov 8 15:20:52 2015 +0100 + + curl Manage data size better + +commit 8a45ac1e1b609497100427cd0a2e37d9037ae184 +Author: jaybeepee +Date: Sun Nov 8 12:59:17 2015 +0200 + + modules/ims_icscf: changed 403 to 500 for HSS error responses + +commit 4b4dc8919b79a1785eefbe1e404746129f371606 +Author: jaybeepee +Date: Fri Nov 6 19:20:59 2015 +0200 + + modules/ims_auth: allow different qop setting for INVITE + +commit 02d8a62260fa1d1e98db4a9b5f4cdac8cab1ea4b +Author: Stefan Mititelu +Date: Fri Nov 6 17:12:23 2015 +0200 + + rtpengine: Update doku for node enable/disable + + This is my understanding of the current shared memory node list implementation. + Correct me if I'm wrong. + +commit 2625ab3ccdafd8d474018516e6aa36ce48989db3 +Author: Stefan Mititelu +Date: Thu Nov 5 16:32:02 2015 +0200 + + rtpengine: hash table to keep the selected nodes + + Shared memory hash table with global hashtable lock. + Add state maintaining the selected rtp node, for a given callid. + Hashtable entry expiration time configurable using hash_entry_tout modparam. + The actual deletion happens on the fly while insert/remove/lookup are called. + Updated doku. + +commit a66e220cb25afceb8a74b62a04f11070b22a91af +Merge: 111fec8 4396236 +Author: Daniel-Constantin Mierla +Date: Thu Nov 5 10:31:22 2015 +0100 + + Merge pull request #389 from gled-rs/feature/bigger_log_prefix_buffer_size + + set the log_prefix buffer size to 1024b + +commit 111fec80aa3f5f2067ed4c60f25ba844b6e559a9 +Author: Victor Seva +Date: Thu Nov 5 09:18:11 2015 +0100 + + pkg/kamailio/deb: update version to 4.4.0~dev6 + +commit a6c795a40944fd4df50bedd4511bf0fcaa2986bd +Author: Daniel-Constantin Mierla +Date: Thu Nov 5 09:02:19 2015 +0100 + + Makefile.defs: version set to 4.4.0-dev6 + +commit bbf3f2a970020116da8c4c50069713e31a268943 +Author: Daniel-Constantin Mierla +Date: Thu Nov 5 08:58:44 2015 +0100 + + tm: print file name and line in free_cell() warning log message + +commit 2fad76064992af047244e30c6152bf0f05a0785f +Author: Daniel-Constantin Mierla +Date: Thu Nov 5 08:53:01 2015 +0100 + + tm: unlink cell and its timer in free function if structure still linked in clist + +commit 0fbcca38574139f1cd8ba7506ee5e204be5f2da7 +Author: Daniel-Constantin Mierla +Date: Thu Nov 5 08:51:25 2015 +0100 + + core: clist - restet prev/next when removing from clist slot + +commit 439623667d6ea5cf9dec30033df94965213e8494 +Author: Tristan Mahé +Date: Wed Nov 4 10:33:03 2015 -0800 + + set the log_prefix buffer size to 1024b + +commit 2874fdd852c3e82933c665d473f01108e4d04040 +Author: Victor Seva +Date: Wed Nov 4 19:21:26 2015 +0100 + + pkg/kamailio/deb: fix systemd warning for PIDFILE + + --- + systemd[1]: [/etc/systemd/system/kamailio.service:15] Not an absolute path, ignoring: ${PIDFILE} + --- + + Environment variables are only evaluated for ExecXXX [0] + + Remove ExecStopPost, when Type=forking systemd already knows what to do + + [0] http://lists.freedesktop.org/archives/systemd-devel/2013-April/010598.html + +commit a58d2c9d0e1cf739ac3c2a620ef19077b175344a +Author: Federico Cabiddu +Date: Wed Nov 4 15:48:01 2015 +0100 + + tsilo: updated README + +commit eef0fefaa247d0a09cf1613cd8bf5c36099c197f +Author: Federico Cabiddu +Date: Wed Nov 4 15:47:43 2015 +0100 + + tsilo: added documentation for the new use_domain parameter + +commit 5ad2d87cae69e73c7081ac8fa383fec5336ef820 +Author: Federico Cabiddu +Date: Wed Nov 4 15:47:16 2015 +0100 + + tsilo: added use_domain parameter + +commit 27f19950f107a943c3bf9db1fddb1e4912136181 +Author: Daniel-Constantin Mierla +Date: Wed Nov 4 15:43:12 2015 +0100 + + nathelper: consider IPv6 brackets when checking size for keepalive request + +commit 3146ec3f89133af2c9b0f0f9a6b2e0e3f133b77e +Author: Carsten Bock +Date: Wed Nov 4 14:16:34 2015 +0100 + + ims_registrar_scscf: Fix loop in lookup request, could result in infinite loop + +commit 420a11873291cca93c8b43b5766f8661d46538c5 +Author: Daniel-Constantin Mierla +Date: Wed Nov 4 10:08:02 2015 +0100 + + core: print src and dst addresses in tcp error log messages + +commit 112406d8fa05b5d739bdf06565b77e3974200652 +Author: Victor Seva +Date: Tue Nov 3 20:36:26 2015 +0100 + + pkg/kamailio/deb: add systemd support + + Fix #294 + +commit e9acce2d1bf295e1b6707fc1c16f53fc160978cb +Author: Daniel-Constantin Mierla +Date: Tue Nov 3 23:06:14 2015 +0100 + + pua_usrloc: removed local variables aliasing functions from pua api + + - use directly the pua bind structure, which was global already + +commit b8458c65917c1b1fe9b94bae795dcdb75ecf4f07 +Author: Carsten Bock +Date: Tue Nov 3 17:34:18 2015 +0100 + + ims_registrar_scscf: Safety check the length of the destination string + +commit ad552d4e45a8311d50444d76e9862d40421e1715 +Author: Daniel-Constantin Mierla +Date: Tue Nov 3 16:17:55 2015 +0100 + + pua: test call-id value before inserting in db + + - reported by GH#345 + +commit 876787d977c46ffcb1288f5eb66e91145cba1061 +Author: Stefan Mititelu +Date: Tue Nov 3 15:58:02 2015 +0200 + + dialog: Sanity checks + + Add NULL checks for the parse_dlg_rr_param(). + Segfault when 'did' parameter was empty in the Route header (e.g. 'did='). + +commit d956f397c8cea4774e5941bdad8f76ecc44acdd5 +Author: Stefan Mititelu +Date: Tue Nov 3 13:08:47 2015 +0200 + + uac: Sanity checks + + Sanity checks for decode_uri(). Add NULL and len > 0 checks. + Segfault when vsf parameter was empty in the Route: header (e.g 'vsf='). + +commit c54d6ab6506bc2334c5a1f5a6cbd28633f4f4697 +Author: Olle E. Johansson +Date: Tue Nov 3 09:39:01 2015 +0100 + + curl Update documentation with a note about URL encoding + +commit 1faef129e1902052c94adfd91d06f785714e4899 +Author: Olle E. Johansson +Date: Mon Nov 2 21:17:35 2015 +0100 + + curl Add maxdatasize to the curlcon modparam + +commit 807160c199820f3e5df2c1d3f3abe92be3a7c042 +Author: jaybeepee +Date: Mon Nov 2 18:55:09 2015 +0200 + + lib/ims: fixed possible crash when trying to get IMPI without realm + +commit 53cd7df83c4065fd7a34cd3ce15b6e215ce39278 +Author: Stefan Mititelu +Date: Mon Nov 2 17:30:30 2015 +0200 + + kex: removed unused callbacks + + Removed the two SREV_MODULE_PKG_STATS and SREV_MODULE_SHM_STATS callbacks + that were never used. + +commit e3a8e5772445d28a0fc6db2e432d750dbb8062da +Author: Daniel-Constantin Mierla +Date: Mon Nov 2 16:19:44 2015 +0100 + + core: parser - remove inline for parse_param() + + - it gets recent compiler warnings when is an extern object + - reported by Victor Seva, GH#286 + +commit 2682403453fcae782fe31a7cc5f20f526ca38414 +Merge: 2bd19e2 ff492b4 +Author: lazedo +Date: Mon Nov 2 14:26:04 2015 +0000 + + Merge pull request #387 from kamailio/lazedo/presence_xml_force_dummy + + presence_xml: add optional param force_dummy_presence + +commit 2bd19e232ece9bf0a090ba34d505d9ed6c9753a5 +Author: Daniel-Constantin Mierla +Date: Mon Nov 2 15:23:31 2015 +0100 + + kamdbctl: divert stderr when searching for greadlink + +commit ff492b443c7ae51d6cd246d3e3cea787d6769c61 +Author: lazedo +Date: Wed Oct 28 17:30:54 2015 +0000 + + presence_xml: add optional param force_dummy_presence + + - added module parameter to send empty presence notify body + when there isn't any record in presentity + +commit 613831103387ea1f095c92c37783667f6561032f +Merge: ec88a0e f1bb44c +Author: Alexandr Dubovikov +Date: Mon Nov 2 14:10:48 2015 +0100 + + Merge pull request #388 from giavac/master + + Allow sipcapture callid_aleg_header to accept a list of headers + +commit ec88a0e5a2115e7063048d519ecbce8aacd9846e +Author: Daniel-Constantin Mierla +Date: Mon Nov 2 13:49:04 2015 +0100 + + mem: tlsf_malloc extended for per module memory stats + +commit 08e62438a3c824f2023164dba602313e83dc2fac +Author: Stefan Mititelu +Date: Mon Nov 2 13:48:54 2015 +0100 + + mem: q_malloc extended for per module memory stats + +commit ea189de0e7a82be2fb2708ceeadf64b89516bc83 +Author: Stefan Mititelu +Date: Mon Nov 2 13:48:28 2015 +0100 + + mem: f_malloc extended for per module memory stats + +commit 1755c1b7d60327b43ec5fa4ee4d3d309c23dc223 +Author: Stefan Mititelu +Date: Mon Nov 2 13:47:26 2015 +0100 + + core: mem - shm common defines to pass the module name + +commit a60f743848e0fed1f994835eefaa24f6e59c302c +Author: Stefan Mititelu +Date: Mon Nov 2 13:45:25 2015 +0100 + + core: mem - references use now 'core' for operations done from code in core + + - previously it was '' + - makes it more coherent, given the case of module names + +commit bee6a696148adcd6ceb2f7a2ca7758156ed3ffba +Author: Stefan Mititelu +Date: Mon Nov 2 13:44:05 2015 +0100 + + core: mem/shm - api to get per module use/free stats + +commit 0e9a0c237ffe5d335b39270d681ce49be18b903f +Author: Stefan Mititelu +Date: Mon Nov 2 13:43:05 2015 +0100 + + core: mem/pkg - api to get per module use/free stats + +commit 3a0888f392c8e0e056c6b03cbd0013bfaba9e8aa +Author: Stefan Mititelu +Date: Mon Nov 2 13:41:04 2015 +0100 + + core: mem - api extended to track module name in debugging mode + + - memory operations will keep reference to module + +commit 2e7b5dd2701f7baf0c31a56ae268c94a2da6ae14 +Author: Stefan Mititelu +Date: Mon Nov 2 13:38:40 2015 +0100 + + core: added events for per module pkg/shm summary + + - used by kex for per module memory stats + +commit b1d96ffc24e92887cc3bf0dcc66ead94e357f081 +Author: Stefan Mititelu +Date: Mon Nov 2 13:34:44 2015 +0100 + + kex: per module memory statistics when in debugging mode + + - return details about memory used by each module via rpc commands + +commit 19756eecb2048320182667cc440cfa7d275304c9 +Author: Daniel-Constantin Mierla +Date: Mon Nov 2 13:30:32 2015 +0100 + + ctl: increased default buffers size for rpc responses + + - binrpc_max_body_size = 32 + - binrpc_struct_max_body_size = 8 + +commit f12e03e1c171a723097eb14f1074d705ed1404e4 +Author: Olle E. Johansson +Date: Mon Nov 2 11:44:49 2015 +0100 + + curl Enforce max data size when downloading data. Stop re-allocating memory for data we do not bother with. + +commit edf6fb9dc68acacf109bb421679289726dd8901d +Author: Olle E. Johansson +Date: Mon Nov 2 11:16:52 2015 +0100 + + curl Removing some unused variables + +commit 38a3d0ca6c09c851835eaf0875a4cee7fa947e61 +Author: Olle E. Johansson +Date: Sun Nov 1 20:25:17 2015 +0100 + + Curl: Make base URI pvar + +commit 2b3ad40ae086382b1cdefa8ce15da6aa8a8e7f77 +Author: Olle E. Johansson +Date: Wed Oct 21 20:38:17 2015 +0200 + + curl remove some debug output + +commit f1bb44cc13c4972bc77e75b8a74e525885ee7ed4 +Author: Giacomo Vacca +Date: Thu Oct 29 17:48:16 2015 +0100 + + Update sipcapture README with callid_aleg_header description + +commit e28d745d3cec241dc316178a554712000e100db9 +Author: Giacomo Vacca +Date: Thu Oct 29 17:38:51 2015 +0100 + + Update sipcapture README xml with callid_aleg_header description + +commit 70ecc623b1ae032a986f37547a7a81f332aedfcb +Author: Giacomo Vacca +Date: Thu Oct 29 17:35:27 2015 +0100 + + Accept a list of headers for callid_aleg_header + +commit 81d358623fb18e0a14a25eed6fde81a8a419aee9 +Merge: 7c9a879 7fc2c92 +Author: lazedo +Date: Wed Oct 28 17:28:55 2015 +0000 + + Merge pull request #386 from kamailio/lazedo/patch-1 + + kazoo: change presence idle to available + +commit 7fc2c92e2fd8a9122440c073ba446940496ca480 +Author: lazedo +Date: Wed Oct 28 16:54:54 2015 +0000 + + kazoo: change presence idle to available + +commit 7c9a87948d9db5be511e94877c1eb3cdc411622c +Author: Alex Dowad +Date: Wed Oct 28 14:18:59 2015 +0100 + + mem/q_malloc: more details in the logs from qm_debug_frag() + + - print file and line from where the memory operation was triggered + - makes it easier to troubleshoot and find the location in the code + +commit 8886c7a0ebd7b08b366f20973729bf86bc67e2e4 +Merge: b71143a e7feaa0 +Author: Daniel-Constantin Mierla +Date: Wed Oct 28 09:53:42 2015 +0100 + + Merge pull request #383 from zxcpoiu/master + + tls: fixed typo param ssl_freelist_max_len mismatch with doc + +commit e7feaa06723a3ea8e14ae7e808fd3f240b0dbb90 +Author: zxcpoiu +Date: Wed Oct 28 16:50:10 2015 +0800 + + tls: fixed typo param ssl_freelist_max_len mismatch with doc + +commit b71143a6b16975e695a814fe5c7e865f579e9dd3 +Author: jaybeepee +Date: Wed Oct 28 10:41:58 2015 +0200 + + modules/ims_registrar_pcscf: remove erroneous return + +commit 7ddd6f75a2642f3f4ab045d0d07b9c8a766de4a3 +Author: jaybeepee +Date: Wed Oct 28 10:39:36 2015 +0200 + + modules/ims_registrar_pcscf: removed erroneous return + +commit fd4cfbb9ed976032aa7e0b69c9bbe55efe7c0676 +Author: jaybeepee +Date: Wed Oct 28 10:37:43 2015 +0200 + + modules/ims_auth: get credentials for IMPI from FROM header for proxyauth + +commit cc9c6554e91e3fda3a7e08c8caf0ddc93e3fef53 +Author: jaybeepee +Date: Wed Oct 28 10:35:36 2015 +0200 + + lib/ims: fn to get IMPI from FROM header instead of TO + +commit 9189ed6168a617a5dbea2199c615f3ca7925dca4 +Author: jaybeepee +Date: Wed Oct 28 10:31:40 2015 +0200 + + modules/ims_usrloc_scscf: changed logging from ERR to DBG + +commit 83a28f16a3c3592d4a9a14ec2cae88743e29b862 +Author: Victor Seva +Date: Tue Oct 27 23:38:31 2015 +0100 + + pkg/kamailio/deb: add virtual-mysql-client as an alternative of mysql-client at kamailio-mysql-modules package + + missing files + + fixes #376 + +commit ceaf687eddf64165f14032b10c3ee3dcec7a95dd +Author: Victor Seva +Date: Tue Oct 27 23:26:34 2015 +0100 + + pkg/kamailio/deb: add virtual-mysql-client as an alternative of mysql-client at kamailio-mysql-modules package + + fixes #376 + +commit fc0e6275fa61f72c1fed0f69393f609cc682888c +Author: Daniel-Constantin Mierla +Date: Tue Oct 27 11:26:23 2015 +0100 + + tm: added braces around initializer of cancel reason map + + - reported by Yacin Caner + +commit eeb3c160ecddd65aa76997ed98e9b1be8e08ab20 +Author: Daniel-Constantin Mierla +Date: Mon Oct 26 21:47:46 2015 +0100 + + dmq_usrloc: access usrloc result record after handling return code + + - reported in GH#373 + +commit 139997826c8c3205504a0c799d7aa98b979e1185 +Merge: d6f313e 4505878 +Author: Daniel-Constantin Mierla +Date: Mon Oct 26 21:38:52 2015 +0100 + + Merge pull request #378 from ycaner06/patch-7 + + acc_radius : added radius time mode + +commit d6f313e61b3318924e6653c8ca1184b2016f701d +Author: Daniel-Constantin Mierla +Date: Mon Oct 26 21:31:59 2015 +0100 + + core: fixed passed buffer size in suip2a() for ipv6 + + - buffer size set to IP6_MAX_STR_SIZE, it was too short and returned + value was empty addres "[]" + - the function is used only by siptrace + - patch from github pull request #381 + +commit 4505878d8be26e2e5497cbba581a2a912a824912 +Author: Yasin CANER +Date: Mon Oct 26 16:16:12 2015 +0200 + + acc_radius : added doc for rad_time_mode + + added information about new mod paramaeter rad_time_mode + +commit 7d2e763b2859ef614040c7b28c3aceb132eb95d3 +Author: Yasin CANER +Date: Mon Oct 26 15:49:24 2015 +0200 + + acc_radius : fixed representation + + fixed exponential representation in converting + +commit 850b7459ec3fc04cf7e2e54038fcf4f12dcf797d +Author: Carsten Bock +Date: Fri Oct 23 19:48:49 2015 +0200 + + ims_usrloc_scscf: Remove first Entry, if maxcontacts reached and maxcontact_behaviour is 2 (delete oldest) + +commit 9cd4aef84d8e7a079486ff73285a9bd6a15e8db3 +Author: Daniel-Constantin Mierla +Date: Fri Oct 23 18:56:45 2015 +0200 + + db_postgres: safety check to see if hasing is over non-null pointer + + - inside implementation of replace command + +commit 13cde2bb1deda9cc67925ca01910e41150c4435e +Author: Daniel-Constantin Mierla +Date: Fri Oct 23 17:49:31 2015 +0200 + + dmq_usrloc: proper handle of not found urecord by uuid + + - return code is negative and in this case is not locking the slot + +commit 922e5818b02b6d5e1f082e861f97bc8868f5ae57 +Author: Daniel-Constantin Mierla +Date: Fri Oct 23 14:15:54 2015 +0200 + + usrloc: fixed number of columns when loading urecord in db mode 3 + + - reported by GH#373 + +commit f8397fe8b70cbaee573d713929e1486807bcbd84 +Author: Daniel-Constantin Mierla +Date: Wed Oct 21 12:49:18 2015 +0200 + + Makefile.groups: added log_custom to list of extra modules + +commit 750248ca22f0b8f03373cae2a56d56c3e0ae6d81 +Author: Yasin CANER +Date: Fri Oct 23 11:12:43 2015 +0300 + + acc_radius : added radius time mode + + + added radius time mode for new event-timestamp . Format is seconds.microseconds + +commit 56cd7a0d38c8bbee6cc3e981b7a2b78b6d47257d +Author: Daniel-Constantin Mierla +Date: Thu Oct 22 23:08:44 2015 +0200 + + db_postgres: don't free pg query structure in store result function + + - it is done when freeing the result + +commit 9251a6f386c27017c71e3cd468b20df16a65329d +Author: Olle E. Johansson +Date: Wed Oct 21 14:46:04 2015 +0200 + + curl Update TODO and add a note for improvement in the way we handle reading from the server. + + We may want to just drop data instead of allocating memory for it. It is not a good situation + to swallow anything. + +commit 87af55318541bfe5705eb35f4d5693bedd6f2243 +Author: Olle E. Johansson +Date: Wed Oct 21 14:34:34 2015 +0200 + + curl Another stab at setting the maxdatasize + +commit ad93a2064861d8a8c56cf28d1c42b8250b0b9f05 +Author: Olle E. Johansson +Date: Wed Oct 21 10:38:57 2015 +0200 + + curl Actually send POST data + +commit 3133918bcd903c4ae173df40f78fe6d07ef05ae8 +Author: Daniel-Constantin Mierla +Date: Wed Oct 21 10:16:02 2015 +0200 + + log_systemd: added support to replace core syslog with logging to systemd + +commit dbdaf6d1f965c54f6b197abf5b38c600c8400e5e +Author: Daniel-Constantin Mierla +Date: Wed Oct 21 09:50:12 2015 +0200 + + log_custom: module that can replace logging to syslog with logging to a remote address via UDP + + - reference of how to implement a custom logging mechanism + +commit 027495fb6ac7c8f50ff9945c209bc9f7ac98d991 +Author: Daniel-Constantin Mierla +Date: Wed Oct 21 09:49:38 2015 +0200 + + corex: detect ipv6 for send*() functions + +commit 88b06d1f6a1d8101504f4d644a406cbe6675dd73 +Author: Daniel-Constantin Mierla +Date: Wed Oct 21 09:47:56 2015 +0200 + + core: added parameters log_engine_type and log_engine_data + + - can be used to specify what logging engine to be used and its + initialization data + - see readme of log_custom module for a same of usage + +commit d20cc8bea38b6070a865ba04286f487034ba53b2 +Author: Daniel-Constantin Mierla +Date: Wed Oct 21 09:44:25 2015 +0200 + + core: added framework to allow replacing logging to syslog + + - this enables a module to replace all logging to syslog with another + logging mechanism + - it is not enabled when log_stderror=yes or the system is detected as + __SUNPRO_C + +commit b6ddd2e1348c45a662c9ee0cbc76ae0c3d2d407e +Author: Olle E. Johansson +Date: Wed Oct 21 07:25:11 2015 +0200 + + curl Add example of using pvars + +commit c100654e5cbd1dfefef6101389c41bf62b8a1394 +Author: Olle E. Johansson +Date: Wed Oct 21 07:24:13 2015 +0200 + + curl Add documentation for new parameter "maxdatasize" + +commit 1703dda2b3d7c54d8ead2b1152ac87f36f6384fa +Author: Olle E. Johansson +Date: Tue Oct 20 21:54:47 2015 +0200 + + curl Add parameter for max download size + +commit e8bb6312c500232cad9e1fa6413c5911fd2ece0d +Author: Olle E. Johansson +Date: Tue Oct 20 21:47:58 2015 +0200 + + curl Preparing for a max size of data transfer. Download full file for curl_connect, not for http_query + +commit a3265965625fa4f2a2c9825e0ed03c834f35fffc +Author: Olle E. Johansson +Date: Tue Oct 20 21:06:12 2015 +0200 + + curl Update documentation + +commit 84d75d43c17b4773bb15a80c1a1f33a47424d858 +Author: Olle E. Johansson +Date: Tue Oct 20 20:52:10 2015 +0200 + + evapi fix some minor typos in debug/error messages + +commit b6d83953571c17001e96859606a18c91c6ee5c9a +Author: Olle E. Johansson +Date: Tue Oct 20 20:47:35 2015 +0200 + + curl Fix connection ID handling, content-type for post data and more + +commit 92c7656a37549de0eed3621ec243022400f6c6c4 +Author: Daniel-Constantin Mierla +Date: Tue Oct 20 19:44:47 2015 +0200 + + tls: init tls hooks to {0}, avoiding fields enumeration + + - if a new field is added, then should be no longer needed to update + initialization + +commit 7db9bfea7d03b50ba94ccc58cffa6d8d049e9515 +Author: Daniel-Constantin Mierla +Date: Tue Oct 20 11:54:11 2015 +0200 + + Makefile.groups: added systemd group + + - it includes the log_systemd module + +commit 14989708b551081380a96c25ece225e3db4d99a1 +Author: Daniel-Constantin Mierla +Date: Tue Oct 20 11:51:29 2015 +0200 + + log_systemd: module to provide logging to systemd journal from config file + +commit 974abf6ac02785af5781b67e135e25a2b1f47949 +Author: Daniel-Constantin Mierla +Date: Mon Oct 19 16:41:32 2015 +0200 + + dialog: setting dlg_flag parameter is no longer mandatory + + - dlg_manage() can be used to start tracking the dialog + - using flags can still be used, the parameter has to be set as well as + the appropriate transaction flag + +commit cc8ff059d362e0c805de2067d73f64cbd12acdb8 +Author: Olle E. Johansson +Date: Mon Oct 19 09:11:20 2015 +0200 + + nat_traversal Add comment about lacking IPv6 support + +commit da70040e8f782e90ab8378f54f210e8752b085bc +Author: Richard Good +Date: Thu Oct 15 18:10:22 2015 +0200 + + modules/ims_qos: new mod param terminate_dialog_on_rx_failure + + terminate_dialog_on_rx_failure this parameter determines if a dialog is torn down if a media Rx session is terminated + +commit fc817db722f42ad231e542d88bd4ddb1cada46cd +Merge: e9b019e 99dcba1 +Author: Daniel-Constantin Mierla +Date: Mon Oct 12 14:31:00 2015 +0200 + + Merge pull request #357 from ycaner06/patch-4 + + misc_radius doc : more information freeradius-client + +commit e9b019e9f9e0c290ece5e025ac960ef88b741cf3 +Author: Daniel-Constantin Mierla +Date: Sun Oct 11 20:13:47 2015 +0200 + + corex: documentation for corex.pkg_summary rpc command + +commit 0457280e66aa03f7c5e0ff2fc595cb7b3e6ef012 +Author: Daniel-Constantin Mierla +Date: Sun Oct 11 20:07:36 2015 +0200 + + corex: added corex.pkg_summary command + + - dump pkg usage summary to syslog for a specific pid or process index + + kamcmd corex.pkg_summary pid 12345 + kamcmd corex.pkg_summary idx 1 + + - the dump is done first time that process is doing a runtime operation + (e.g., receiving a sip packet) + +commit f9f19374e79d792700bc38fdf2981d6c50b534f3 +Author: Olle E. Johansson +Date: Sun Oct 11 20:52:43 2015 +0200 + + tls minor updates to documentation + +commit 02dc876cc6d8e78bfc26c4c2318814aec22c4498 +Author: Daniel-Constantin Mierla +Date: Sun Oct 11 19:37:54 2015 +0200 + + core: mem_summary taken in consideration for runtime pkg dump callback + +commit a0f82365012a7980c77b076d2e48f8a38cb63742 +Author: Olle E. Johansson +Date: Sun Oct 11 19:26:46 2015 +0200 + + auth Minor update to docs, spelling errors + +commit b4120c53a1ba2ae2bad8b9c04963b4becc0a9700 +Author: Daniel-Constantin Mierla +Date: Sun Oct 11 14:35:46 2015 +0200 + + uac: uac.reg_dump returns an array rpc result + +commit 321a6140cdc7d6fd3f18f911af9825bb62575ace +Author: Daniel-Constantin Mierla +Date: Sun Oct 11 03:38:24 2015 +0200 + + textops: fix leak when subst_hf() with flag f is used + + - substituion list was not freed + +commit 6173ef7ba8a9d8eb566f1a192e5915ef74cfc159 +Merge: 493ef6c 6a498f7 +Author: lazedo +Date: Thu Oct 8 09:54:32 2015 -0700 + + Merge pull request #365 from kamailio/lazedo-patch-1 + + presence: use advertised ip for local contact + +commit 493ef6c11b769f1bdf42092005dc6c1c713d38ea +Author: Daniel-Constantin Mierla +Date: Thu Oct 8 18:44:48 2015 +0200 + + core: cfg lex - clean history and update application name + +commit 81feae1940c299455804ddb211252766d50114d8 +Author: jaybeepee +Date: Thu Oct 8 09:50:23 2015 +0200 + + modules/dialog_ng: set init ts for dialog_in + +commit 6a498f713a2522e18bed96dc4d1f361008a95502 +Author: lazedo +Date: Wed Oct 7 11:39:37 2015 -0700 + + presence: use advertised ip for local contact + +commit 3de200b3c965586b3dd9370eca073f10c556e3b3 +Merge: 7185a8a 6845d19 +Author: Federico Cabiddu +Date: Wed Oct 7 16:20:43 2015 +0200 + + Merge pull request #346 from grumvalski/t_append_branches_fix + + tm: fake msg and environment to append new branches + +commit 7185a8a708001a6e2d2150e2541880c04c2374b4 +Author: jaybeepee +Date: Wed Oct 7 15:48:53 2015 +0200 + + modules/ims_charging: set the last_event timestamp if there was failure to get credit + +commit e9eea6bc7adcf21ce6217597e749deb6111a115b +Author: Olle E. Johansson +Date: Wed Oct 7 15:33:39 2015 +0200 + + nathelper Remove SVN IDs + +commit 274f1034bfb9ea0d52ef291d2f95021ca86f3081 +Author: Olle E. Johansson +Date: Wed Oct 7 13:44:03 2015 +0200 + + nathelper Via header for SIP ping over IPv6 needs square brackets + +commit b3d38eac7a24bff88a1ec555aa5a50ea5c3f0232 +Author: Daniel-Constantin Mierla +Date: Wed Oct 7 12:11:23 2015 +0200 + + core: new feature to execute event_route[core:worker-one-init] + + - the event_route[core:worker-one-init] is executed if defined in + kamailio.cfg after the first udp sip worker process executed the + child_init() for all modules, before starting to process sip traffic + - note that due to forking, other sip workers can get faster to + listening for sip traffic + +commit 0ef0791e5e5ff01622ce8e9575ecc8f40fa4d726 +Author: Daniel-Constantin Mierla +Date: Wed Oct 7 06:28:00 2015 +0200 + + core: faked message api moved to core + +commit 3c086a85b99d59dabc48f77893d4c68199af0577 +Author: Federico Cabiddu +Date: Wed Oct 7 09:29:39 2015 +0200 + + tsilo: unref the transaction after appending new branches + +commit e1a404920b7f912cbf7a0b480129a705849bca79 +Author: Daniel-Constantin Mierla +Date: Wed Oct 7 05:42:04 2015 +0200 + + htable: documenting timer_procs module parameter + +commit ab7b3e69e000a2c970ecc35520197c8bc7c88a62 +Author: Daniel-Constantin Mierla +Date: Wed Oct 7 05:40:58 2015 +0200 + + htable: new parameter to specify if the module should start own timer + + - timer is used for scanning expired items + +commit 743fee551c833bd31f1bfdf1a4b422886243f8b6 +Author: Daniel-Constantin Mierla +Date: Tue Oct 6 17:53:15 2015 +0200 + + tm: support to add text in Reason header for local generated CANCEL + +commit caf477104c90049bf0c5e163d7eff89111448776 +Author: Daniel-Constantin Mierla +Date: Tue Oct 6 00:28:19 2015 +0200 + + acc: reset errno for converting numbers for cdr generation + + - reported by Mayama Takeshi, GH#359 + +commit 3ad2e31dbd8fe37ad0d330655561b943eb0accdb +Merge: 623a51d 2db0d8d +Author: Daniel-Constantin Mierla +Date: Mon Oct 5 19:18:21 2015 +0200 + + Merge pull request #356 from ycaner06/patch-3 + + acc_radius doc: information about freeradius-client + +commit 623a51da5d7e2c5dae848137267260ce1ddf9d95 +Merge: dbda20a 16c2fcb +Author: Daniel-Constantin Mierla +Date: Mon Oct 5 19:07:41 2015 +0200 + + Merge pull request #355 from kamailio/vseva/acc_prepare_always + + acc: add acc_prepare_always parameter + +commit dbda20a52984e4e62064feccbc70e2dd775ab6b7 +Merge: 50903b6 232916e +Author: Daniel-Constantin Mierla +Date: Mon Oct 5 19:07:05 2015 +0200 + + Merge pull request #358 from ycaner06/patch-5 + + auth_radius doc: about freeradius-client + +commit 232916e317512af18b7f78c5e71544b698b3dd82 +Author: Yasin +Date: Mon Oct 5 18:25:52 2015 +0300 + + auth_radius doc: about freeradius-client + + added information about how to active freeradius-client library + +commit 99dcba19d8c85709fedd842a482cae033d781efd +Author: Yasin +Date: Mon Oct 5 17:59:23 2015 +0300 + + misc_radius doc : more information freeradius-client + + added information about how to active freeradius-client library + +commit 2db0d8da92aed22ebddc4df79e6f472a0284298a +Author: Yasin +Date: Mon Oct 5 17:54:03 2015 +0300 + + acc_radius doc: information about freeradius-client + + Added some information for freeradius-client to acc documents. radiusclient-ng website isn't avaible so is removed. + +commit 50903b62046fe26b5b865a3c0e9beea8c5a14d1d +Author: Olle E. Johansson +Date: Mon Oct 5 16:10:50 2015 +0200 + + docs Add reference to the jansson library + +commit 16c2fcb34d315963c153e9a5f2961563567d19f0 +Author: Victor Seva +Date: Mon Oct 5 13:42:43 2015 +0200 + + acc: add acc_prepare_always parameter + + This will force the preparation of the request no matter + if the acc_prepare_flag is set at the moment of the transaction + creation + +commit 85d43251000ff7d56382db21cdd6db61d71f1bd3 +Merge: be18e64 043f348 +Author: Daniel-Constantin Mierla +Date: Mon Oct 5 07:46:59 2015 +0200 + + Merge pull request #353 from ycaner06/patch-2 + + misc_radis : more logging + +commit be18e641c409d9a23dae7fd1c5bae2e0ad057ed7 +Author: Daniel-Constantin Mierla +Date: Mon Oct 5 07:41:45 2015 +0200 + + textopsx: update the readme for keep_hf() + +commit 7456a25e214658bbbfb420d8401366b34c6a285c +Author: Daniel-Constantin Mierla +Date: Mon Oct 5 07:41:12 2015 +0200 + + textopsx: if no param is given to keep_hf(re), then keep only mandatory headers + +commit 22e1dcd860fb1dee2aaade2c63efde7e5f3de257 +Author: Olle E. Johansson +Date: Sun Oct 4 13:19:32 2015 +0200 + + tcpops Add simple function with true/false response for connection state checking - tcp_conid_alive + +commit 4e758808f76236a1830787038eef6654baf925a4 +Author: Olle E. Johansson +Date: Sun Oct 4 13:13:23 2015 +0200 + + htable Change error messages from "$ht" to "$sht" + +commit 4da31d56f4b1e18fc4232c5174637c858c75e9db +Author: Daniel-Constantin Mierla +Date: Sun Oct 4 06:28:39 2015 +0200 + + nathelper: use advertised address if send socket has one + + - reported by emanuel Buu, GH#352 + +commit bff0a08b9ecf4c0c84f2003fdf9abc476950b542 +Merge: 7dc4ead 3118538 +Author: Daniel-Constantin Mierla +Date: Fri Oct 2 18:15:24 2015 +0200 + + Merge pull request #351 from ycaner06/patch-1 + + acc_radius : more logging for acc_radius module + +commit 7dc4ead50af6de77f035f32fb5eafa79a29f741c +Merge: 1cb0686 5ee6747 +Author: Richard Fuchs +Date: Fri Oct 2 09:19:58 2015 -0400 + + Merge pull request #283 from kamailio/coudot/rtpengine_read_sdp_pv + + rtpengine: new read_sdp_pv parameter + +commit 1cb0686778a1d9788c9df1a02b38309bba76f903 +Author: Victor Seva +Date: Fri Oct 2 14:16:39 2015 +0200 + + pkg/kamailio/deb: update version to 4.4.0~dev5 + +commit 47853d6f2f27cb25363c1932f6881bbd1ae09c69 +Author: Daniel-Constantin Mierla +Date: Fri Oct 2 14:09:57 2015 +0200 + + Makefile.defs: version set to 4.4.0-dev5 + +commit 2d9c7f9658fe78979df69c81f56b36366b80a262 +Author: Daniel-Constantin Mierla +Date: Fri Oct 2 14:01:34 2015 +0200 + + dialog: fix race due to deep copy of dlg hash table slot when saving to db + +commit 043f3480b04e4d67ff36eb1b9c22f33c25e771dd +Author: Yasin +Date: Fri Oct 2 14:14:19 2015 +0300 + + misc_radis : more logging + + it helps to understand misc radius errors. i checked "REJECT_RC" never defined. + +commit 5f5ac84b9fac40bf75afd1baafc587410e9e3128 +Merge: 2471d1d 02fa3bf +Author: Olle E. Johansson +Date: Fri Oct 2 13:34:40 2015 +0300 + + Merge branch 'master' of https://github.com/kamailio/kamailio + + Sorry... + + * 'master' of https://github.com/kamailio/kamailio: + dialog: avoid useless re-entrant locking when linking the new dialog + +commit 2471d1db579089f9e46feabe59830c53ac862e72 +Author: Olle E. Johansson +Date: Fri Oct 2 13:33:46 2015 +0300 + + jansson Add explaination of error handling. + + The pvar remains unchanged if the key/path is not found. Any previous + value remains, and it's not reset to a default value or NULL. + +commit 02fa3bf1b62cb10a33a8b216cfe7baa9e1b84054 +Author: Daniel-Constantin Mierla +Date: Fri Oct 2 10:57:50 2015 +0200 + + dialog: avoid useless re-entrant locking when linking the new dialog + +commit 31185385cf017f2d00a3d2a6c69ce5776304eb9a +Author: Yasin +Date: Fri Oct 2 11:09:36 2015 +0300 + + Update acc_radius_mod.c + +commit 486031d1023ec453083da218df1a23945f64868f +Author: Yasin +Date: Fri Oct 2 09:52:55 2015 +0300 + + acc_radius : more logging for radius + + added more log about radius result. it makes better to understand problem. i checked freeradiusclient.h and radiusclient-ng.h to have all defined variables. + +commit 369f79b8a1f24dacb52634fc13530fd42c921898 +Author: Olle E. Johansson +Date: Fri Oct 2 08:23:26 2015 +0300 + + curl Fix documentation, remove local character + +commit 889a82f8b61620c224cc9eca4bd5b41369aa6fae +Author: Daniel-Constantin Mierla +Date: Thu Oct 1 21:59:12 2015 +0200 + + tcpops: release tcp connection id in w_tcp_conid_state() + + - tcpconn_get() increases reference number, tcpconn_put() is required, + otherwise the associated structure won't be destroyed after close + - debug message for unexpected connection state reworked + +commit df3a27240aa6f7a2531f4c5d62bf23846079ecc1 +Author: Daniel-Constantin Mierla +Date: Thu Oct 1 21:53:47 2015 +0200 + + tcpops: fixed prototype declaration for w_tcp_conid_state() + +commit 09c5e6069aaeed472d1d4e4088d14551d90f90a9 +Author: Olle E. Johansson +Date: Thu Oct 1 22:05:53 2015 +0300 + + tcpops Add tcp_conid_state function to check connection state + +commit 6620fe7b0963ffe0e2c0d4ab7a38e85d1dfd121d +Author: Daniel-Constantin Mierla +Date: Thu Oct 1 16:51:59 2015 +0200 + + dialog: don't update dlg vars in db if in deleted state + + - dlg record and vars are scheduled for deletion + +commit 098849c72a8b651a5757eac3eb3dee6772766d76 +Author: Daniel-Constantin Mierla +Date: Thu Oct 1 16:34:59 2015 +0200 + + dialog: updated old comment to reflect current behaviour + +commit 04bd28fffdfed05dda9a8fff41b220a3bb008a17 +Author: Daniel-Constantin Mierla +Date: Thu Oct 1 16:31:07 2015 +0200 + + dialog: release remote profile lock on remove operation + +commit b198b390106924df2279d94f28305c25c86b435e +Author: Daniel-Constantin Mierla +Date: Thu Oct 1 16:08:13 2015 +0200 + + dialog: completed previous commit for spiral handling + +commit 9d807d1d8af24c0163d3bb2ae876a87a8b637494 +Author: Daniel-Constantin Mierla +Date: Thu Oct 1 15:49:26 2015 +0200 + + dialog: keep slot locked when searching for duplicate dialog + + - when attempting to create a new dialog, the function searching to see + if it is already one with same attributes keeps the slot locked so is + no race in between the return of function and building the new dlg + structure + - if the dlg is found, release the lock after figuring out it is a + spiral or not + +commit f9a6b7893ad421cb142e03c9c2797773061c8933 +Author: Daniel-Constantin Mierla +Date: Thu Oct 1 09:48:26 2015 +0200 + + acc_radius: fixed identation, removed history + +commit ed024ed2489803b41f333695dc0475fd77ac6f60 +Merge: 738b113 f84689a +Author: Daniel-Constantin Mierla +Date: Thu Oct 1 09:46:54 2015 +0200 + + Merge pull request #349 from ycaner06/master + + acc_radius : fixes extra attribues memory leak + +commit f84689aa9f56693abe95f537f8a0217a068b1f01 +Author: Yasin +Date: Thu Oct 1 10:28:54 2015 +0300 + + acc_radius : fixes extra attribues memory leak + + if we dont free getting memory from extrarstr , can give out of memory. this commit fixes this problem. + +commit 738b113b4be346b7caef600249202d361b556a41 +Author: Daniel-Constantin Mierla +Date: Thu Oct 1 09:26:14 2015 +0200 + + tmx: tm reply code pv to use status code directly in onreply routes + + - no need to lookup transaction + +commit 11791d2b749df9673e9c8fe09ae9e923fb6e735b +Author: Daniel-Constantin Mierla +Date: Thu Oct 1 09:12:16 2015 +0200 + + tmx: proper response of branch ruid pv for tm onreply route + +commit 36a704e8b54b65e8414fd2a02d973e74a9256e1d +Author: Daniel-Constantin Mierla +Date: Thu Oct 1 09:11:11 2015 +0200 + + core: pv - helper function to return empty string + +commit b25f7a4a87ac3518216366c81d9a7939ce24e1c7 +Merge: 02fde16 03b955e +Author: Daniel-Constantin Mierla +Date: Wed Sep 30 08:46:33 2015 +0200 + + Merge pull request #348 from neuhaus/rpc_label_fix + + core: Fix label for RPC command ("proto" -> "port") + +commit 02fde16b151fc66653290cf1cc2073f3bb2cb96a +Author: Daniel-Constantin Mierla +Date: Wed Sep 30 00:23:16 2015 +0200 + + evapi: reset possition in received buffer if all data was processed + + - if there was some residual data from previous read, once reading again + ends up in processing all netstring frames, then reset position in + order to start from beginning with next packet + - credits to Jayesh Nambiar assisting with troubleshooting + +commit 03b955ef8cc2ffcc08d0b361c0f1d6ce057c68b8 +Author: Sven Neuhaus +Date: Tue Sep 29 15:26:45 2015 +0200 + + core: Fix label for RPC command ("proto" -> "port") + +commit f3992928df6bcd2e23e0a14551f5b29500152bf9 +Author: Daniel-Constantin Mierla +Date: Tue Sep 29 08:50:59 2015 +0200 + + core: -x and -X command line parameter added to help message + +commit b151e9d6071b1affe814f4edf2e87b132f0accb8 +Author: Daniel-Constantin Mierla +Date: Mon Sep 28 23:02:27 2015 +0200 + + core: create runtime dir if doesn't exist + + - test and create runtime dir (default /var/run/kamailio) + - do chown of runtime dir if user/group parameters are set for kamailio + +commit 859ee540c593c25a2a96893795ac1ec6e22b9c22 +Author: Carsten Bock +Date: Mon Sep 28 18:07:42 2015 +0200 + + ims_usr_pcscf: Updated DB-Schema + +commit 6845d190f46de820fa4586b30eb2fba0aae1eb01 +Author: Federico Cabiddu +Date: Mon Sep 28 09:09:59 2015 +0200 + + tm: fake msg and environment to append new branches + +commit ab0e23c32b154ea38730f8be550b072a0ec10186 +Author: Carsten Bock +Date: Sun Sep 27 21:10:15 2015 +0200 + + ims_usrloc_pscscf: Set contact-port to 5060, if no port present + +commit eb81caaa6a05ac1b0f2234c37b0ad9de13d9610b +Author: Carsten Bock +Date: Sun Sep 27 19:25:35 2015 +0200 + + ims_usrloc_pcscf: Add some debug output for asserting identities + +commit e0bcdcddcb30f6221a92bd08221f2b50831c8b6b +Author: Daniel-Constantin Mierla +Date: Sun Sep 27 08:54:42 2015 +0200 + + usrloc: rpc responses use array for contact records + +commit e174617a2a8be3d47eab44f113ef8026f7046003 +Author: Olle E. Johansson +Date: Sun Sep 27 08:40:57 2015 +0200 + + Makefile Add curl module + +commit 0a7e24398a564d1703f4484834b823e988cf64db +Author: Daniel-Constantin Mierla +Date: Sat Sep 26 22:19:17 2015 +0200 + + jsonrpc-s: input buffer for fifo transport increased to 8k + +commit eaa76b2907cbc24f9f0f46321af5db47a6e9bc7c +Author: Hugh Waite +Date: Sat Sep 26 01:15:31 2015 +0100 + + pv: Add $utime and $utimef pv's to retrieve time in UTC + + - $utime is the UTC equivalent to $time for localtime + - $utimef is the UTC equivalent to $timef for localtime + +commit 87674722ea28bbcff6d14ba30a1e4c12537f4526 +Author: jaybeepee +Date: Mon Sep 28 14:20:52 2015 +0200 + + modules/ims_registrar_scscf: ignore port from RURI when looking up S-CSCF IMPU + +commit 8cced16d7055939a885b6dc6bdb8a346748a0fcd +Author: Daniel-Constantin Mierla +Date: Fri Sep 25 23:38:56 2015 +0200 + + core: mem - reworked f_malloc free chunks management + + - credits to Juha Heinanen for heling with testing + +commit 551a562eb799c903cda09599ff5d47366abf42c9 +Author: Daniel-Constantin Mierla +Date: Thu Sep 24 21:47:41 2015 +0200 + + topoh: print the message buffer if parsing headers failed + +commit 1f220bde59b5e494a5837199d7da37e8455b9615 +Author: Daniel-Constantin Mierla +Date: Thu Sep 24 16:34:13 2015 +0200 + + tsilo: exported w_ts_append_to2() for ts_append_to() with uri param + +commit bd179897f8e38913bde17a9e5c27106506f04f26 +Merge: 7a4899b 38a79cd +Author: Hugh Waite +Date: Thu Sep 24 14:43:20 2015 +0100 + + Merge pull request #344 from kamailio/hpw/websocket_fragmentation + + websocket: Add support for SIP message fragmentation + + Thanks! + For some features, I like to check with other devs that I'm not in conflict with the existing style or causing any unintended consequences! + +commit 7a4899bbdf7f5b600811e3d4d99ddba0fd3cc776 +Merge: 8cac414 bd08a9b +Author: Victor Seva +Date: Thu Sep 24 13:38:34 2015 +0200 + + Merge pull request #329 from kamailio/vseva/registrar_xavp_rcd + + registrar: add contact and received info to xavp_rcd + +commit 8cac4148811a72385cdcbabf08be53390571cba2 +Merge: b2ef89b bce9cf9 +Author: Daniel-Constantin Mierla +Date: Thu Sep 24 08:52:22 2015 +0200 + + Merge pull request #343 from doublec/janssonrpc_double_free + + janssonrpc-c: Fix double free if retry timer add fails + +commit b2ef89bc55ae9b7bc816178e3c601289f6de3216 +Merge: 6491411 a53b2fb +Author: Daniel-Constantin Mierla +Date: Thu Sep 24 08:51:26 2015 +0200 + + Merge pull request #342 from doublec/janssonrpc_read_after_free + + janssonrpc-c: Fix use after free + +commit a53b2fb68d555b07be479e41895937ae1c6318f6 +Author: Chris Double +Date: Thu Sep 24 11:02:56 2015 +1200 + + janssonrpc-c: Fix use after free + + - Fix use after free due to pointer aliasing of 'arg' and 'a' + in server_backoff_cb. + - Fix use after free in force_disconnect + - Fix use after free in free_server_list + +commit bce9cf97646153af6abcf9f43cbb72f2c734e490 +Author: Chris Double +Date: Thu Sep 24 10:35:34 2015 +1200 + + janssonrpc-c: Fix double free if retry timer add fails + + - Fix double free if schedule_retry fails when adding + request retry timer. timeout_cb called fail_request + which frees req after schedule_retry had already + done so. + +commit 38a79cdc42b952ac0291d249241ca6499fc269aa +Author: Hugh Waite +Date: Wed Sep 23 21:59:09 2015 +0100 + + websocket: Add support for SIP message fragmentation + + - websocket connections are created with a BUF_SIZE (64K) buffer used for concatenating frames + - continuation frames (fragments) are supported for the SIP sub-protocol + +commit 649141185f231435bbe03fd13fe5a0e65b9fed04 +Author: Daniel-Constantin Mierla +Date: Wed Sep 23 22:53:01 2015 +0200 + + tm: reset next/prev fields when unlinking transaction from hash table + +commit 92ff485409611ad345b14b784afb1be25fa188b9 +Author: Daniel-Constantin Mierla +Date: Wed Sep 23 17:46:50 2015 +0200 + + tm: warn troubleshooting message for deleted transaction turned in dbg + +commit 5147f202520730f2521bd0081c2e7610fa3553b4 +Author: grumvalski +Date: Wed Sep 23 16:23:45 2015 +0200 + + tsilo: update README + +commit 98cce9c07bb4437b607ba6aa687411edbd7e29eb +Author: grumvalski +Date: Wed Sep 23 16:23:17 2015 +0200 + + tsilo: removed usrloc dependency from documentation + +commit ede95bf3b008fa8f2b50e3d6fbc6ea5b2940e721 +Author: grumvalski +Date: Wed Sep 23 16:20:56 2015 +0200 + + tsilo: removed use_domain and usrloc bindings + +commit 0049a20fe0bf1b755bfb61853e72b341099dc63d +Merge: 2316b90 48de750 +Author: Daniel-Constantin Mierla +Date: Wed Sep 23 14:44:00 2015 +0200 + + Merge pull request #340 from doublec/sqlops_memory_leak + + sqlops: Fix memory leak in error condition + +commit 2316b90fc22ab8b020d26b9c928f6e6e0fd0a885 +Merge: e9c2022 460e0a6 +Author: Daniel-Constantin Mierla +Date: Wed Sep 23 14:43:06 2015 +0200 + + Merge pull request #339 from doublec/sqlops_bad_free + + sqlops: Don't pkg_free memory that wasn't pkg_malloc'd + +commit e9c2022b57be87403bb2aa703f74b5d218456aeb +Merge: 0678f51 1c16447 +Author: Daniel-Constantin Mierla +Date: Wed Sep 23 14:41:56 2015 +0200 + + Merge pull request #338 from doublec/htable_overrun + + htable: Fix buffer overrun in htable_rpc_list + +commit 0678f51d227377edee3cf3ecad7b410638bff0df +Merge: c379188 5aa2ed2 +Author: Daniel-Constantin Mierla +Date: Wed Sep 23 14:41:07 2015 +0200 + + Merge pull request #337 from doublec/textops_null_dereference + + textops: prevent null dereference on tr_txt_eval_re error + +commit c379188e0f2b7377afae41ee618444c69a8d39e3 +Merge: b846c21 03f6a49 +Author: Federico Cabiddu +Date: Wed Sep 23 14:22:32 2015 +0200 + + Merge pull request #336 from doublec/tsilo_null_ptr_dereference + + tsilo: Call LM_DBG with correct transaction information + +commit b846c216f5244049463c49ccefaaadb1c2bcfb10 +Merge: 1d9b099 e304f9d +Author: Federico Cabiddu +Date: Wed Sep 23 14:08:10 2015 +0200 + + Merge pull request #335 from doublec/tsilo_pointer_comparison + + tsilo: Fix pointer comparison in ts_set_tm_callbacks + +commit 1d9b099e3b11dc8f49737f7986b5fea0dc087ccc +Author: Daniel-Constantin Mierla +Date: Wed Sep 23 13:56:20 2015 +0200 + + mem: f_malloc - don't use references to pointers of nxt_free field + +commit 48de750550dd12016e957d60e0ae57e59944558d +Author: Chris Double +Date: Wed Sep 23 22:21:41 2015 +1200 + + sqlops: Fix memory leak in error condition + + - Fix pv_parse_dbr_name to free spv if the key is + unknown. + - Fix typo in error log in pv_parse_dbr_name. + +commit 03f6a49146980338d7e31aec60da551f8b6e7595 +Author: Chris Double +Date: Wed Sep 23 21:26:39 2015 +1200 + + tsilo: Call LM_DBG with correct transaction information + + - Use cb_ptr in ts_onreply LM_DBG call as the ptr variable + is NULL at that call point and cb_ptr contains the + transaction information being looked for. + +commit 92c376dbeb6ee515a80537c91014972ada4a5f34 +Author: Daniel-Constantin Mierla +Date: Wed Sep 23 13:03:15 2015 +0200 + + tm: t_suspend() skip suspending if a final response was sent out for transaction already + +commit 9451625ff8cc7e02abc2c6cf95572bff9c086d20 +Author: Daniel-Constantin Mierla +Date: Wed Sep 23 12:59:52 2015 +0200 + + tsilo: ts_append_to() check if transation is active before adding new branches + +commit ef44e5b8b4292f4c4ff3a77e46bbb33e5e0f077f +Author: Daniel-Constantin Mierla +Date: Wed Sep 23 12:43:41 2015 +0200 + + tm: more debug info when freeing a transaction + + - attempt to catch a double free + +commit ca61f783097a0a947fc3ce1da100b14b3acada6b +Author: Daniel-Constantin Mierla +Date: Wed Sep 23 12:34:01 2015 +0200 + + mem: proper size printed in log message for init of shm + +commit 460e0a6077d69cf74ceb4b095195b683fb49269c +Author: Chris Double +Date: Wed Sep 23 22:17:21 2015 +1200 + + sqlops: Don't pkg_free memory that wasn't pkg_malloc'd + + - Don't pkg_free the gparam_t parameter of sql_parse_index. + When called within pv_parse_dbr_name that parameter is + an internal field in the sql_pv_t structure and wasn't + allocated with pkg_malloc. + +commit 1c164473c6fd78318236254827a4cadbe8271463 +Author: Chris Double +Date: Wed Sep 23 22:03:47 2015 +1200 + + htable: Fix buffer overrun in htable_rpc_list + + - Fix for using wrong len variable in htable_rpc_list if + ht->dbtable.len is greater than 127, causing an out of + bounds write. + +commit f6270fcc1911cc76a5182461b18e5ba11cddd20c +Merge: cffe675 7cc1d11 +Author: Daniel-Constantin Mierla +Date: Wed Sep 23 11:29:21 2015 +0200 + + Merge pull request #334 from zxcpoiu/master + + tmx: safety check for bad callid header in t_precheck_tran() + +commit 7cc1d1113e8e461656d55595f1a268d345d2676b +Author: zxcpoiu +Date: Wed Sep 23 17:23:40 2015 +0800 + + tmx: safety check for bad callid header in t_precheck_tran() + - reported by GH#331 + +commit e304f9d8d4cc16a3b6cca1cdd10dff6d0a18d955 +Author: Chris Double +Date: Wed Sep 23 21:20:27 2015 +1200 + + tsilo: Fix pointer comparison in ts_set_tm_callbacks + + - Fix cloned ts_transaction pointer comparison to check for + NULL rather than less than zero. The latter doesn't make + sense for an allocated pointer. + +commit 5aa2ed265f80664f57073213b17c83b1dac42ab4 +Author: Chris Double +Date: Wed Sep 23 20:48:56 2015 +1200 + + textops: prevent null dereference on tr_txt_eval_re error + + - Check for NULL pointer before calling subst_expr_free + to prevent NULL pointer dereference when there is an + unknown subtype error. + +commit cffe67566f206a6c4e76d76a36e0e1783d056369 +Author: Daniel-Constantin Mierla +Date: Wed Sep 23 01:15:46 2015 +0200 + + tsilo: removed check of use_domain for uri parameter in ts_store() + + - ts_append() is using full sip uri and will not match if ts_store() + with use_domain=0 will store only username + +commit de415fd7116498bcbab5badad677a74d1313ab6b +Author: Daniel-Constantin Mierla +Date: Tue Sep 22 23:45:34 2015 +0200 + + tsilo: define the stats in .c file and extern in .h file + + - the .h can be included in many .c files, resulting in multiple + declarations of the stats + +commit 82f74a57229e46e9b9302a6b4caebed6860c47ed +Author: Daniel-Constantin Mierla +Date: Tue Sep 22 23:05:27 2015 +0200 + + domain: proper memset of the hash tables used by domain at init time + + - discovered on a report by Juha Heinanen + +commit f3eb697a23f3e97b4eca1a1010a050dcafd35729 +Author: Daniel-Constantin Mierla +Date: Tue Sep 22 16:28:49 2015 +0200 + + tsilo: fixed some wrong white spacing identation + +commit 94358dc13371863e1546fd78662b40b24b0ba981 +Author: Daniel-Constantin Mierla +Date: Tue Sep 22 16:26:57 2015 +0200 + + tsilo: update the readme + +commit 9c78d7da369dbce0b28d5ea54a55601b790fc9ca +Author: Daniel-Constantin Mierla +Date: Tue Sep 22 16:25:59 2015 +0200 + + tsilo: documented optional uri parameter for ts_append_to() + +commit ffbef4181f6632401715a250af26cce4696c3c46 +Author: Daniel-Constantin Mierla +Date: Tue Sep 22 16:23:01 2015 +0200 + + tsilo: pass uri parameter to registrar lookup_to_dset() + + - ts_append_to() can take uri 4th parameter + +commit 6bdddb99d7bca42897b2c0f96a87c49b97efd8ac +Author: Federico Cabiddu +Date: Tue Sep 22 15:53:28 2015 +0200 + + tsilo: don't force destination protocol on branches added by t_append_branches + +commit d36734d658cd0bcfc8357c7e85ca32da0612aaee +Author: Daniel-Constantin Mierla +Date: Tue Sep 22 15:22:32 2015 +0200 + + core: tcp - reset connection write flag if io_watch_chg() for pollout fails + + - it can loop otherwise in trying to see if write can be done + +commit ec45e952e453ae8f6b5a6598622f50d57e4470ef +Author: Daniel-Constantin Mierla +Date: Tue Sep 22 12:50:09 2015 +0200 + + domain: renamed local db_url variable to d_db_url + + - it is exported as extern and can conflict with other variables with + same name + +commit 66b9c4dc56e14cac8ffcb0f87d29be4858dafbd3 +Author: Daniel-Constantin Mierla +Date: Mon Sep 21 21:10:47 2015 +0200 + + mem: f_malloc - safety init of nxt_free fields in first and last fragments + +commit 692c24ac7d6524cb2388534ee004d636c8b0c277 +Author: Daniel-Constantin Mierla +Date: Mon Sep 21 18:20:24 2015 +0200 + + tsilo: print return error code by lookup_to_dset() in ts_append() + + - helps figuring out why it failed + +commit b58a55da1a43f1b2d3b1f0b831fcb639c57a66b9 +Author: Daniel-Constantin Mierla +Date: Mon Sep 21 17:01:18 2015 +0200 + + mem: f_malloc - proper inserting of last free large fragment + + - reported by Juha Heinanen + +commit 093337bc7f3d8d3ce31ad3770252503628bc3599 +Author: Daniel-Constantin Mierla +Date: Mon Sep 21 13:04:56 2015 +0200 + + evapi: debug messages for invalid len and execution of event route + +commit 2c736877dc215592f3f8889ffd47e90ab68066af +Author: Federico Cabiddu +Date: Mon Sep 21 12:43:39 2015 +0200 + + app_perl: renamed the exported structure "_app_perl_exports" to avoid naming conflicts + + - reported by GH#333 + +commit 61d531b25b1bee8d34ec7b5bed15660fd2ce3e5d +Author: jaybeepee +Date: Mon Sep 21 12:36:04 2015 +0200 + + modules/ims_auth: fixed correct fixup for ims_proxy_challenge and removed old unused fixup + +commit d011d6235573100a96cba6e228808826460a6cfb +Author: Carsten Bock +Date: Mon Sep 21 11:11:08 2015 +0200 + + ims_auth: Fix compilation error after previous commit + +commit 7b8ad7a41cc3d327748b12bfba80e9ad9110cb4a +Author: Carsten Bock +Date: Mon Sep 21 10:29:47 2015 +0200 + + ims_auth: Improved reply, if HSS returned Error + +commit 6c7d38ee0fcbd482ff0527178481345fc93a7fc8 +Author: Daniel-Constantin Mierla +Date: Mon Sep 21 00:16:27 2015 +0200 + + core: name of structure exported by a module can be prefixed with module name + + - some modules use the flag for global exporting, which can lead to + naming conflicts + - related to GH#333 + +commit 6177e766035f6bad2d5ee512ccde9a805d026760 +Author: Daniel-Constantin Mierla +Date: Sun Sep 20 23:16:35 2015 +0200 + + cnxcc: build fake msg for event route before terminating the dialog + + - dialog structure can be deleted in between + - reported by GH#324 + +commit f6400aa19736e3f6acf00f3c79f5ddaaf2acbcee +Author: Daniel-Constantin Mierla +Date: Sun Sep 20 22:33:57 2015 +0200 + + mem: f_malloc - properly set empty slot in free hash + + - reported by Juha Heninanen + +commit 3e84157b4bbce9c6bcb8c4563910811a7eb8f019 +Author: Daniel-Constantin Mierla +Date: Sun Sep 20 18:48:18 2015 +0200 + + tmx: safety check for bad cseq header in t_precheck_tran() + + - reported by GH#331 + +commit 58b4ea9ca31305a4450807add2c21e7ecb01614b +Author: Olle E. Johansson +Date: Sat Sep 19 12:48:42 2015 +0100 + + sctp Documentation - change "sercmd" to "kamcmd" + +commit 0c9ea3ccb7fac1180f26741422857807d24fcea1 +Author: Olle E. Johansson +Date: Sat Sep 19 12:47:36 2015 +0100 + + tm Change "sercmd" to "kamcmd" + +commit 52d88ef0f0b0b361419edede208acd459af9fb1a +Author: Olle E. Johansson +Date: Sat Sep 19 12:46:06 2015 +0100 + + mi_rpc Change "sercmd" to "kamcmd" in docs + +commit c1a1a1bb054ee79af6ca44d262c8f73c725a2d90 +Author: Olle E. Johansson +Date: Sat Sep 19 12:43:02 2015 +0100 + + srdb1 Check if the module is loaded, so the error message makes sense in case of missing module + + If a module use a default database and it's not loaded, currently + Kamailio complains that the module doesn't implement an API function + instead of actually telling the Kamailian that the module is not loaded. + This patch modifies that behaviour. + +commit 6cbc77a8048fa4c6e4c987b9bfaacad137db1255 +Author: Olle E. Johansson +Date: Sat Sep 19 11:40:34 2015 +0100 + + curl Add information about return value of curl_connect + +commit dd19f2f6fea6c9095baaaee3eda9f4aaf86127dc +Author: Olle E. Johansson +Date: Sat Sep 19 11:34:39 2015 +0100 + + curl Adding docs on the curl_connect function + + These docs needs to be extended, but it is a starting point + +commit 123fa9af495ee7b79e97fa4a9c54fd0618d6a9c0 +Author: Olle E. Johansson +Date: Sat Sep 19 10:50:58 2015 +0100 + + curl Add documentation for RPC command curl.listcon + +commit 9adec4ca8bf2f204aa8db4ae60429bb994bc6be9 +Author: Olle E. Johansson +Date: Sat Sep 19 10:29:52 2015 +0100 + + Adding the curl module with status "Development" + + Anyone that wants to help is welcome to help. I've listed a few + todo's in the TODO.txt file. We will have to decide which of these + that we need for release and which that can be done in the future. + +commit 103b915cffd63b4abab1a3e57b51644eef20e81d +Author: Olle E. Johansson +Date: Mon Apr 20 21:11:42 2015 +0200 + + async: Fix some error messages + +commit a8adf3bdb74dd3819bb23e2876eee704663f3cef +Author: Daniel-Constantin Mierla +Date: Sat Sep 19 00:16:22 2015 +0200 + + evapi: more debug messages when processing received data + +commit 1b6bb6596c779086894a2fca04597073503a6abb +Author: Daniel-Constantin Mierla +Date: Fri Sep 18 23:05:33 2015 +0200 + + tsilo: documented new parameter for t_store() + +commit 19e608f803b7198543091bf41c468153567741d3 +Author: Daniel-Constantin Mierla +Date: Fri Sep 18 22:59:44 2015 +0200 + + tsilot: t_store(...) accepts uri as parameter + + - uri can be explicitely given as parameter instead of taking it from + r-uri + - can help avoiding: backup r-uri, set it to another uri and then restore + r-uri from backup + +commit 641b7b2371b26a9d51b9b5cb0c3918c11ebf6461 +Author: Carsten Bock +Date: Fri Sep 18 17:25:03 2015 +0200 + + utils: Don't leak memory of pkg_realloc returns NULL + +commit f81d8cc2ab67f04208fc570fad8137ae48113d63 +Author: Camille Oudot +Date: Fri Sep 18 15:16:13 2015 +0200 + + mem: convert TLSF memory manager to new memory API + + - run kamailio with `-X tlsf` to manage pkg memory with TLSF + - run kamailio with `-x tlsf` to manage shm memory with TLSF + +commit 1e5bad019c450a003e812ee051d84134aad6c5f0 +Author: Daniel-Constantin Mierla +Date: Fri Sep 18 13:36:03 2015 +0200 + + tsilo: use current r-uri for ts_store() + + - msg->first_line.u.request.uri is always the incoming r-uri (never + updated inside the msg structure) + - if $ru was updated, msg->new_uri is set with the new value + - if incoming r-uri is wanted back after $ru was updated, revert_uri() + can be used + - if only incoming r-uri is allowed, then the function doesn't work when + dialing an alias or a short number + +commit 0cde7b7efc82802506bec7c1be5f050a19137999 +Merge: 7aa9f30 6b07f1b +Author: ng-voice GmbH +Date: Fri Sep 18 12:29:16 2015 +0200 + + Merge pull request #330 from athonet-open/fix_cdp_applications_store + + Fix crash on applications memory reservation + +commit 7aa9f30da3cc4143e6118bbb90e626a212b01b77 +Author: Carsten Bock +Date: Fri Sep 18 12:24:59 2015 +0200 + + ims_auth: Add option to set destination host for MAR requests + +commit 6b07f1b0d07068836093560ddbdf67b102e5c6c6 +Author: Federico Favaro +Date: Fri Sep 18 10:32:52 2015 +0200 + + cdp: Fix crash on applications memory reservation + + Fix a crash on applications shared memory allocation + when Diameter CEA contains Auth_Applications or Acct_Applications + AVPs not "embedded" into Vendor_Specific grouped AVP + Before only the memory for applications found on Vendor_Specific + AVP was reserved, but if Acct_Applications or Auth_Applications + not Vendor Specific is found, you need to reserve memory for + the number of Acct_Applications or Auth_Applications AVPs found + multiplied by the number of Supported Vendor ID AVPs found. + +commit 0038fa4de8a6399652d5b6efff3190dcb43fa577 +Author: Federico Cabiddu +Date: Tue Sep 15 09:41:35 2015 +0200 + + tsilo: regenerated README + +commit 4c32cfd717bca062d383f5bf19e899606e4a79ec +Author: Federico Cabiddu +Date: Tue Sep 15 09:19:58 2015 +0200 + + tsilo: updated module's documentation + +commit c89ae44d3838153284c16006c3689866b87c391a +Author: Federico Cabiddu +Date: Tue Sep 15 09:15:25 2015 +0200 + + tsilo: added module's satistics + +commit 9581d7c03b21b0f7a360e504126499bef1e37300 +Author: Federico Cabiddu +Date: Mon Sep 14 12:27:52 2015 +0000 + + tm: make t_append_branches return the number of added branches + +commit 4eb7656726d1b1b408a12d55b3d7d297b78ee68d +Author: Daniel-Constantin Mierla +Date: Fri Sep 18 10:08:14 2015 +0200 + + evapi: implemented receive buffering per connected client + + - incomplete data may be received on tcp, needing to wait to get more + (only for netstring format) + +commit bd08a9b316835a6b5d3a739617803a550e861dd4 +Author: Victor Seva +Date: Fri Sep 18 09:51:24 2015 +0200 + + registrar: refresh README + +commit be4f1a65d1e84795b1540e0ae720a765a6005561 +Author: Victor Seva +Date: Thu Sep 17 18:07:43 2015 +0200 + + registrar: add contact and recieved values to xavp_rcd + + set xavp_rcd at registered() too + +commit dd0fd7011b750e34c595936b6c95759ccb77f786 +Author: Daniel-Constantin Mierla +Date: Fri Sep 18 09:31:58 2015 +0200 + + htable: more checks of updateexpire when item is updated + +commit bda43b9c889f52a1d9d851e224e11bb4b090889c +Merge: 1e18e4f 8ceba7e +Author: Daniel-Constantin Mierla +Date: Fri Sep 18 09:20:19 2015 +0200 + + Merge pull request #328 from mslehto/master + + modules/path: fixes typo in outbound RFC number + +commit 8ceba7e73b29c5cbc0c8ac050237570e762ce698 +Author: Mikko Lehto +Date: Fri Sep 18 01:00:47 2015 +0300 + + modules/path: fixes typo in outbound RFC number + +commit 1e18e4f9ce3020684d18152d6a35083bd3278261 +Author: Daniel-Constantin Mierla +Date: Thu Sep 17 19:04:49 2015 +0200 + + utils: readme updated for http_response_mode + +commit 05c7dfb9d71c8ada339bf68842823e09bf75e89e +Author: Daniel-Constantin Mierla +Date: Thu Sep 17 19:04:36 2015 +0200 + + utils: documentation for http_response_mode + +commit 7e866d62c52239574c52b5cb7797bfe907925e06 +Author: Daniel-Constantin Mierla +Date: Thu Sep 17 19:00:47 2015 +0200 + + utils: new parameter http_response_mode to control what response part is returned + + - if http_response_mode=0, only the first line is returned (like so far) + - if http_response_mode=1, all the response is returned + - default 0 + +commit bc74d54ac2f5611303b592b9aae687d40c8999ef +Author: Daniel-Constantin Mierla +Date: Thu Sep 17 18:53:55 2015 +0200 + + utils: regenerated the readme file + +commit cac4d70a1b685f4859016d01c6de3f0f3bd9b50a +Author: Daniel-Constantin Mierla +Date: Thu Sep 17 18:53:41 2015 +0200 + + utils: documentation for http_response_trim + +commit de925d64cb9348d693e2e77d6cb3db0d87e38734 +Author: Daniel-Constantin Mierla +Date: Thu Sep 17 18:48:26 2015 +0200 + + utils: option to tream leading and trailing whitespaces + + - new parameter http_response_trim to control it; default is 0 - don't + trimi (backward compatible); set to 1 for enabling trimming + - based on the request of PR GH#321 + +commit ef568ca288ec66f1d950b3d243c06bbe023323fe +Merge: b4afd13 5aedfdf +Author: ng-voice GmbH +Date: Thu Sep 17 19:41:42 2015 +0200 + + Merge pull request #326 from grumvalski/maa_missing_avps + + ims_auth: fixed crash when receiving a MAA without SIP-Number-Auth-Items + +commit b4afd1375c3958f1847d56efe38872b3a9d055e0 +Author: Hugh Waite +Date: Thu Sep 17 15:50:48 2015 +0100 + + parser: Fix parser error when Retry-After is last header + + - Prevent off-by-one error when CRLF is followed by CRLF + +commit f83a695d70cfd4aea09383e8e235d4184dc1521e +Author: Carsten Bock +Date: Thu Sep 17 16:28:59 2015 +0200 + + Revert "db_postgres: Fix heap use after free error in db_postgres module" (after some discussions) + + This reverts commit 74c84c7cd52347fcd1c90e75dca239b5f758169b. + +commit ee3d24d256356bf1da5e6af28aa1274402cf1da1 +Author: Carsten Bock +Date: Thu Sep 17 14:08:28 2015 +0200 + + ims_registrar_pcscf: Re-Added the pcscf_unregister-function, aligned with latest changes + +commit 33c5449563becd2357b648ec469ef247a6ae2f5d +Author: Daniel-Constantin Mierla +Date: Thu Sep 17 12:50:55 2015 +0200 + + tm: warn in case of transaction is not suspended by a continue is attempted + +commit 2682d85657d1caf96961a6153cd82c506fde7d0d +Author: Daniel-Constantin Mierla +Date: Thu Sep 17 12:48:36 2015 +0200 + + tmx: err to work if resuming suspended transaction fails + + - it can be a non-suspended transaction id or after expiration + +commit ffc485212457499fdfa7c9ebb8dc1b04a4058bfb +Author: jaybeepee +Date: Thu Sep 17 11:28:09 2015 +0200 + + modules/ims_usrloc_pcscf: fixed free of service_routes from pcontact in P-CSCF + +commit 33f159121193b3ed09e2ec7aa7b55aa543aeb852 +Author: Daniel-Constantin Mierla +Date: Wed Sep 16 23:54:02 2015 +0200 + + core: cast operator (int) converts hex strings as well + + - in addition to dec string + +commit b831f7bd9c91cf4d75ec299d250cd463ab96e7c9 +Author: Victor Seva +Date: Wed Sep 16 18:32:34 2015 +0200 + + test/travis: build with MEMDBG=0 and MEMDBG=1 + +commit e0a76892f8c89cb3ceb224246e7c635778ec0719 +Author: jaybeepee +Date: Wed Sep 16 11:31:46 2015 +0200 + + modules/ims_registrar_pcscf: set received host, proto and port when searching for pcontact + +commit d46d008e0936a01229872df71ac26afb43122f4b +Author: Daniel-Constantin Mierla +Date: Wed Sep 16 11:21:08 2015 +0200 + + auth_db: more log messages when username checks failed + +commit 5cd019ae1491adc79e8768503787ab59cb5fef65 +Author: jaybeepee +Date: Wed Sep 16 11:14:02 2015 +0200 + + ims_usrloc_pcscf: do not updated received info should be write once info + - also fixes memory corruption after pcontact structure optimised + to use placement + +commit 667e181a4cc5bf88daac59f9d0e8127bc5313644 +Author: Daniel-Constantin Mierla +Date: Wed Sep 16 00:52:15 2015 +0200 + + mem: f_malloc summary function for mememory degging off mode + +commit de12775edca2d4a2116ee277f3145c2f439a9af3 +Author: Daniel-Constantin Mierla +Date: Wed Sep 16 00:51:29 2015 +0200 + + mem: proper field name for shm malloc unsafe define when memory debugging is off + + - reported by Juha Heinanen + +commit 5d50171a4443eeafa5734afec58bbf41c07fece7 +Author: Daniel-Constantin Mierla +Date: Tue Sep 15 19:05:12 2015 +0200 + + ipops: fixed wrong location of double quites in example in docs + + - reported by GH#327 + +commit 80aa92a96a8b67e89c4555deba0cd4437d45fec6 +Author: Daniel-Constantin Mierla +Date: Tue Sep 15 14:41:47 2015 +0200 + + mem: updated prototype for qm_sums when q_malloc is compiled with debug mode off + + - reported by Juha Heinanen + +commit d19719dd3cbaa577a7a66360843ae6679445f123 +Author: Daniel-Constantin Mierla +Date: Tue Sep 15 13:20:02 2015 +0200 + + htable.dump: add the type of the value to the result + +commit 5f301c9e9b3d4b67a11aeaab45c21fd8d8929695 +Author: Daniel-Constantin Mierla +Date: Tue Sep 15 13:09:36 2015 +0200 + + textopsx: include : in the value to be parsed as header name inside fixup_hname_param() + + - reported by Björn Bylander + +commit 3913cc881030cccc9518733e18363402f2dfb18e +Author: Daniel-Constantin Mierla +Date: Tue Sep 15 13:08:53 2015 +0200 + + parse: more log messages in case of errors in parse_hname2_short() + +commit 5aedfdf30088901fa0692d2f04c45883e87612ce +Author: Federico Cabiddu +Date: Tue Sep 15 10:51:44 2015 +0200 + + ims_auth: fixed crash when receiving a MAA without SIP-Number-Auth-Items or SIP-Auth-Data-Item + +commit 19b3d02c0fc4188b175d0d86e27f3c092900b10c +Author: Daniel-Constantin Mierla +Date: Mon Sep 14 22:28:57 2015 +0200 + + Makefile: install-initd-centos target creates run dir + +commit 1aa95fbc87c6ec118d7675b5c9c0e01a61de091b +Author: Carsten Bock +Date: Mon Sep 14 21:46:28 2015 +0200 + + Add Rx-Specific-Action AVPs to work with some PCRFs + +commit 4c2c7d229a6387bf4fb9bdfdc9c5c87cce0d47ba +Author: root +Date: Mon Sep 14 17:07:12 2015 +0200 + + modules/cdp: removed references to old shm management + +commit 171553ebcac2f00a015191f36f2f228c0d3e483b +Author: Daniel-Constantin Mierla +Date: Mon Sep 14 12:53:54 2015 +0200 + + tm: reset async suspended flag when continuing via failure_route + + - suspended transaction can be resumed automatically on timeout, without + t_continue(), ending up in failure_route + +commit 52c4965bbb4cde5d7bddcf697aa504e7c2202ac1 +Author: Daniel-Constantin Mierla +Date: Mon Sep 14 12:45:28 2015 +0200 + + tm: test if transaction was suspended before resuming inside t_continue() + +commit 6a9c892fd0a7a526ec6ced4b40479875477d96db +Author: Daniel-Constantin Mierla +Date: Mon Sep 14 12:05:27 2015 +0200 + + dialog: mark slot as lock if dialog found in state deleted for spiral detection + +commit abb732e2cde4b7a94f48a47db7cfd42bc7bb6d6b +Author: Daniel-Constantin Mierla +Date: Mon Sep 14 10:19:45 2015 +0200 + + Makefile.defs: version set to 4.4.0-dev4 + +commit a7812ed9e076105fcd483ae74c5a087caa4bf629 +Author: Daniel-Constantin Mierla +Date: Mon Sep 14 10:17:36 2015 +0200 + + mem: reintroduced the option to use system malloc if PKG_MALLOC is not defined + +commit 93c11cab7a56377de4db80cd559a0a59b5a23528 +Author: Daniel-Constantin Mierla +Date: Mon Sep 14 09:37:03 2015 +0200 + + Makefile.defs: build commands updated to support many memory managers + + - following defines can be set: + - F_MALLOC - compile f_malloc (enabled) + - Q_MALLOC - compile q_malloc (enabled) + - DBG_SR_MEMORY - enable debugging mode for all memory mangers + - all memory managers must be in same debugging mode + - MEMDBG=1 turns now DBG_SR_MEMORY on + - MEMMNG is no longer used, many memory managers can be enabled at the + same time + +commit 4c2ef7f3eac3c7d18c8d8fc248b5372886c4c12a +Author: Daniel-Constantin Mierla +Date: Mon Sep 14 09:33:17 2015 +0200 + + core: new command line options for memory managers selections + + - -x name: select the memory manager for shm + - -X name: select the memory manager for pkg + - -f -x is provided but -X is not provided, then pkg uses same memory + manager as shm + - name can be: + - fm - fast malloc (f_malloc) + - qm - quick malloc (q_malloc) + - default memory manager is fm + - other changes: adjustments to init pkg and shm using new memory + management api + +commit 549c24f0b11d84dfa7c9cc829ced2298dd871bd2 +Author: Daniel-Constantin Mierla +Date: Mon Sep 14 09:32:38 2015 +0200 + + core: defines printed in version string adjusted for new memory manager + +commit 5ba10ca7715e91508d747203bec048d0ddc0f902 +Author: Daniel-Constantin Mierla +Date: Mon Sep 14 09:32:05 2015 +0200 + + mem: prototypes of exporting memory managers implemented in core + +commit e91bcf01099fe97ecd09b49d7a441793ba67b5df +Author: Daniel-Constantin Mierla +Date: Mon Sep 14 09:31:09 2015 +0200 + + core: define to keep default shm memory pool size + +commit 0987dc72474aea838592341e661b86cadad5a57b +Author: Daniel-Constantin Mierla +Date: Mon Sep 14 09:29:50 2015 +0200 + + core: share memory initialization updated for new memory management api + +commit faa50860320aa1cca5e9886ca58745eee7227c25 +Author: Daniel-Constantin Mierla +Date: Mon Sep 14 09:25:23 2015 +0200 + + mem: q_malloc updated to implement new pkg/shm management api + +commit 467a12b72d5c107f89291042b578d708837e7a79 +Author: Daniel-Constantin Mierla +Date: Mon Sep 14 09:24:50 2015 +0200 + + mem: f_malloc updated to implement new pkg/shm management api + +commit bf3e80bdf7110630c5343f2fb2a44a7689343875 +Author: Daniel-Constantin Mierla +Date: Mon Sep 14 09:24:00 2015 +0200 + + mem: old shm management disabled + +commit 50df0feecc34e9f0ec025482406688e1d4e19252 +Author: Daniel-Constantin Mierla +Date: Mon Sep 14 09:23:22 2015 +0200 + + mem: old pkg management disabled + +commit 7d0a97490d345c8c01c14a95a52c2926ea28c466 +Author: Daniel-Constantin Mierla +Date: Mon Sep 14 09:20:38 2015 +0200 + + mem: core api for shm management + +commit 28bf5c457ffcbe95ce5528d492f4ebc5b10ab68f +Author: Daniel-Constantin Mierla +Date: Mon Sep 14 09:20:05 2015 +0200 + + mem: core api for pkg management + +commit 876c20cf55b23507dd390d177d5a7138d04815e4 +Author: Daniel-Constantin Mierla +Date: Mon Sep 14 09:18:59 2015 +0200 + + mem: added api structures for pkg and shm management + + - a framework to allow specifying the memory manager at startup + +commit 88a7b00cf964993151a76051dd0fded46c3bf61e +Author: jaybeepee +Date: Mon Sep 14 09:04:03 2015 +0200 + + modules/ims: dialog, usrloc, qos and charging modules for IMS + - dialog_ng - some fixes related to ref counting and state machine + - usrlocs - fixes/improvements to internal storage for both P-CSCF and S-CSCF usrloc storage + - registrars - fixes/improvements to the registrars for S-CSCF, P-CSCF + - ims_charging - align to updated api for dialog_ng + - ims_qos - align to updated api for dialog_ng + +commit 16bcb9d257622a68eed44d6eea5e342f35dbde83 +Author: Daniel-Constantin Mierla +Date: Fri Sep 11 16:39:36 2015 +0200 + + mem: removed unused variables + + - two old vars not needed anymore after previous commit + +commit 2d0455d9f2266ad67867e03aa652863e37d5a8d2 +Author: Daniel-Constantin Mierla +Date: Fri Sep 11 16:32:32 2015 +0200 + + mem/f_malloc: simplified free frags management + + - avoid address referencing to previous free fragments, it can get + invalidated on joins + - straight doubly linked list also speeds join/defrag + +commit aec9850491a8e8fa919396ae0e0f1d99d30c607c +Author: jaybeepee +Date: Fri Sep 11 13:38:37 2015 +0200 + + modules/tm: precent possible seg fault if branch reply is null + +commit 8913435fe629e5972fe264e619e493659fc5e010 +Author: jaybeepee +Date: Fri Sep 11 12:14:12 2015 +0200 + + modules/cdp: remove unused variable + +commit 00e8c10a5f96b7e8fbf8193885d1dc8450df3e45 +Author: jaybeepee +Date: Fri Sep 11 12:11:58 2015 +0200 + + modules/cdp: fix lifetime and session timeout logic + +commit 1093fc3b84e42197701dc50198902ff18b6f9a2e +Author: jaybeepee +Date: Fri Sep 11 12:10:56 2015 +0200 + + modules/cdp: changed load balancing timer from second resolution to millisecond resolution + +commit f9aa4a219bc0e5a44b167772d6e3b86d99a59932 +Author: jaybeepee +Date: Fri Sep 11 12:01:10 2015 +0200 + + modules/cdp: changed load balancing timer from second resolution to millisecond resolution + +commit d613b328b9f99f7cf739c082deede5d4d48b00de +Author: jaybeepee +Date: Fri Sep 11 12:00:30 2015 +0200 + + modules/cdp: changed load balancing timer from second resolution to millisecond resolution (reverted from commit 64054ac9506d45171ee8f607fc9bff5763c144dc) + +commit 64054ac9506d45171ee8f607fc9bff5763c144dc +Author: jaybeepee +Date: Fri Sep 11 11:51:37 2015 +0200 + + modules/cdp: changed load balancing timer from second resolution to millisecond resolution + +commit 956be0edcd816134650c5efccb7965fccb4d5916 +Author: jaybeepee +Date: Fri Sep 11 11:44:31 2015 +0200 + + modules/cdp: fixed race condition between CCR update and CCR terminate - lean priority towards T + +commit 6e2f4d7d249f155ce43cfd6c58a8707deac175e0 +Author: Stefan Mititelu +Date: Thu Sep 10 13:06:30 2015 +0300 + + rtpengine: fix segfault when bad mi params + + Default root pointer to NULL in order to avoid segfaults due to bad mi params + (e.g string instead of int). The segfaults happened because in the above cases, + free_mi_tree(root) tries to free a random, invalid address. + +commit b99e9e96592a5d708ff565343f3c810b2d264577 +Author: Daniel-Constantin Mierla +Date: Thu Sep 10 12:22:48 2015 +0200 + + rls: proper detection of initial subscribe to send notify with full state + + - use to-tag conditions, previously was sending only based on db mode + - reported by GH#276 + +commit c4fd9188263414d825815cfbd745ce5b1351e62e +Author: Daniel-Constantin Mierla +Date: Thu Sep 10 11:48:54 2015 +0200 + + evapi: increased the static buffer size used for reading evapi responses + + - 32k instead of 4k + +commit 3137d2ab8ec539c2059e59e0849ef7bdd7aa509b +Author: Daniel-Constantin Mierla +Date: Thu Sep 10 11:47:45 2015 +0200 + + cnxcc: fixed include guard + + - reported by GH#323 + +commit cecdd0817052046e634152d6e512165451b5f6d4 +Author: Daniel-Constantin Mierla +Date: Thu Sep 10 09:24:01 2015 +0200 + + dialog: safety check not to store dialog vars and data when state initial + + - acc callbacks for cdrs can trigger setting dialog vars in initial + state, which then try to save in db, however, initial state might not + have all required fields for a proper db reload, storing being + desinged to be done when all mandatory fields are set + +commit 7f9194c416e171c2b723430eb98a55a52b7b5e38 +Author: Daniel-Constantin Mierla +Date: Thu Sep 10 00:21:14 2015 +0200 + + dialog: lock the slot if old dialog found in state deleted + + - no longer a spiral condition and new dialog will be created + +commit c19556fb355ff370cff5c381be11f1f2d47fa380 +Author: Victor Seva +Date: Thu Sep 10 09:28:39 2015 +0200 + + pkg/kamailio/deb: update version to 4.4.0~dev3 + +commit 85ae655411462955e32ffebccd2b51a5915cc678 +Merge: 5a442b2 a48d6a1 +Author: Victor Seva +Date: Thu Sep 10 09:04:31 2015 +0200 + + Merge pull request #320 from kamailio/vseva/mod_fix_pvar_3 + + core: add fixup_pvar_pvar_pvar() + +commit 5a442b219075c18a7e3a5b0942f34d05d8baba60 +Author: Federico Cabiddu +Date: Wed Sep 9 12:35:42 2015 +0200 + + tm: reset 'found' variable at the beginning of each cycle over the branches + +commit a48d6a1ed8950ba96d5e85769bba59bfbe469cfa +Author: Victor Seva +Date: Wed Sep 9 10:30:27 2015 +0200 + + core: add fixup_pvar_pvar_pvar() + +commit d9ae9badb270891f3b6dd2b64ba88c808c8c70f4 +Author: Daniel-Constantin Mierla +Date: Wed Sep 9 09:19:52 2015 +0200 + + kamctl: added mongodb schema files + + - custom json format specifying structure of collections/tables + - version-create.mongo - a script with mongo commands to fill the + version collection/table + +commit 922c4c0dd1bc65c9fda6ccad467080132109e815 +Author: Daniel-Constantin Mierla +Date: Wed Sep 9 09:19:13 2015 +0200 + + srdb1/schema: proper path in Makefile to generate mongo script for version table content + +commit 3f8ba179ada8dcfd8ecb4ed1d321c0dc525d55ab +Author: Daniel-Constantin Mierla +Date: Wed Sep 9 09:10:35 2015 +0200 + + stylesheets/dbschema: xsl file for generating mongodb tables schema + + - the result is an json file that can be used to understand fields in a + mongodb collection (equivalent to sql table) + +commit 7b0de5ca923b4427b669282edffde054c58b682a +Author: Daniel-Constantin Mierla +Date: Wed Sep 9 09:09:47 2015 +0200 + + srdb1/schema: make target to generate schema for mongodb + +commit f4b364b99162670db3eff38bcc67503c86658a22 +Author: Daniel-Constantin Mierla +Date: Wed Sep 9 09:08:58 2015 +0200 + + srdb1/schema: added version attribute to version table schema + + - to be coherent with the other tables schema + +commit 31c9b0c16c3e2b14aa48d7ecdbe62ea6b9d1c6cc +Author: Carsten Bock +Date: Tue Sep 8 20:49:53 2015 +0200 + + ims_usrloc_scscf: Implement overwrite oldest behaviour + +commit de8ba3900d6fef42e99ca9568044c7aefa44a5ea +Author: Daniel-Constantin Mierla +Date: Tue Sep 8 17:28:40 2015 +0200 + + parser: fix start of search for long header names + + - in parse_hname2_short(), used only for mod fixups, in the case header + name given as function param was greater than 250 chars + +commit be35e46818e98892b2981593b5b63017a2ab7743 +Author: Daniel-Constantin Mierla +Date: Tue Sep 8 16:22:16 2015 +0200 + + Makefile.defs: version set to 4.4.0-dev3 + +commit 6cd8cdc80e5037b90f7e636c360c88eed1dcdcec +Author: Daniel-Constantin Mierla +Date: Tue Sep 8 15:02:45 2015 +0200 + + auth: fixed improper whitespacing + + (cherry picked from commit 20231f4936b5f79bcb2e3f64985953888391e570) + +commit 0785e413d58daa7926fb90c53c9455489cd38842 +Merge: 4b2d6dd cb3c461 +Author: richardgood +Date: Mon Sep 7 17:05:26 2015 +0200 + + Merge pull request #314 from athonet-open/rework_aar_code + + Return CSCF_RETURN_FALSE if AAR is not generated + +commit 4b2d6dd7ce1a61c964f7d996c2db4428010dd478 +Author: Daniel-Constantin Mierla +Date: Mon Sep 7 16:35:10 2015 +0200 + + tm: enable drop in onsend_route for tm replies + + - skip sending out the reply by resetting the send_socket + +commit 2690a8c314d23406649dceaadce7032690500a6e +Author: Lucian Balaceanu +Date: Mon Sep 7 16:31:11 2015 +0200 + + tm: execute the onsend_route for responses forwarded by tm module + + - not executed for local generated sip responses + +commit 061baf5175f757d581385ad4ed05983ba69b5b92 +Merge: b7c588d e650581 +Author: Victor Seva +Date: Mon Sep 7 16:20:55 2015 +0200 + + Merge pull request #316 from kamailio/vseva/pv_xavp_to_var + + pv: pv_xavp_to_var() + +commit b7c588dff06030a82f305b210573be5bbc961cec +Author: Daniel-Constantin Mierla +Date: Mon Sep 7 15:56:45 2015 +0200 + + tm: store last received response code before running onreply_route + + - otherwise an innapropriate cancel can happen if the current branch got + before an 1xx response, and the script writer enforces another reply + code with t_reply() + - reported by Thomas Sevestre, GH#315 + +commit e6505819e51ffe601b4a144db3f7922234c92f2f +Author: Victor Seva +Date: Mon Sep 7 15:50:08 2015 +0200 + + pv: regenerate README + +commit dad1f24bee3f33c9902e487853be6f13b274aa93 +Author: Victor Seva +Date: Mon Sep 7 15:02:42 2015 +0200 + + pv: pv_xavp_to_var() + +commit 919357cc87b4403de2f6cdeeaa75e9f3f98e1307 +Author: Daniel-Constantin Mierla +Date: Mon Sep 7 14:58:34 2015 +0200 + + corex: readme updated with file_read() and file_write() + +commit 9ea2d8de54f461844dee580f6288bafb3144032e +Author: Daniel-Constantin Mierla +Date: Mon Sep 7 14:57:07 2015 +0200 + + corex: documented file_read() and file_write() + +commit 670fab03c6715a21800d19a9ed66f719fdedcc12 +Author: Daniel-Constantin Mierla +Date: Mon Sep 7 14:56:38 2015 +0200 + + corex: readme regenerated + +commit 5d477b9de910157df2ae591c91c74c73a9095b71 +Author: Daniel-Constantin Mierla +Date: Mon Sep 7 14:56:11 2015 +0200 + + corex: removed unnecessary lines from xml doc + +commit e62ecdfe5d755eb1c982f0ad0747e6664e0d5cc3 +Author: Daniel-Constantin Mierla +Date: Mon Sep 7 14:48:07 2015 +0200 + + cores: added file_read() and file_write() functions + + - file_read(fpath, var) - read content of a text file into a variable + - file_write(fpat, content) - write content of parameter to a text file + +commit 2de2b27d1fba15b0ca6e5472f43dfc869ccb41ee +Author: Federico Cabiddu +Date: Fri Sep 4 15:48:56 2015 +0200 + + tm: removed history from t_append_branches.c + +commit 380712accd89ba1f520314f5caf3cded6d8253ea +Author: Federico Cabiddu +Date: Fri Sep 4 15:45:58 2015 +0200 + + tm: iterate over the destination set starting from 0 + +commit 27bed654dcc4e9dd543a7f2f92e2174478bf7f26 +Author: Federico Cabiddu +Date: Fri Sep 4 15:12:29 2015 +0200 + + tm: check all the outgoing branches when appending a new branch + +commit 55be13dfdb0db49358b6cd43b4916c0fb5fabc2e +Author: Daniel-Constantin Mierla +Date: Fri Sep 4 14:39:27 2015 +0200 + + core: new parameter async_usleep + + - add option to do usleep() before processing async tasks + - could help saving cpu usage on vms with immediate interruptions + triggered to recvfrom() + +commit 2962852bf706692bdbc9b51419dbdc2012f34e1b +Author: Daniel-Constantin Mierla +Date: Fri Sep 4 11:38:02 2015 +0200 + + dialog: more debug when storing vars in database + +commit 014a62f7546675ffc198d1c169f6bd12b3bdd87d +Author: Daniel-Constantin Mierla +Date: Fri Sep 4 10:47:15 2015 +0200 + + corex: log messages for memory status/summary rpc commands + +commit a10d8b133edef697ec3bd40e5babd76dc881b2cb +Author: Daniel-Constantin Mierla +Date: Thu Sep 3 17:34:10 2015 +0200 + + usrloc: mi commands with aor caseness + + - reported in GH#264 + +commit cb3c461a48c65d61fc563c0dc2b87fd57647dae8 +Author: Federico Favaro +Date: Thu Sep 3 12:01:07 2015 +0200 + + Return CSCF_RETURN_FALSE if AAR is not generated + + Differentiate the cases where AAR is not sent because + of an error and the cases where AAR is not sent because + it is logically wrong to sent them at that point of the Transaction + +commit c078256b927ae4b30ba9e5ae9595e5b2084dcdb6 +Merge: 2aa013d 063e32a +Author: Daniel-Constantin Mierla +Date: Thu Sep 3 11:32:10 2015 +0200 + + Merge pull request #313 from vance-od/patch-1 + + auth: fixed issue when during registration nonce expired, after backwards time shift + +commit 063e32a8fe81b2cfbaac0386e6b51446586e619a +Author: vance-od +Date: Thu Sep 3 11:43:37 2015 +0300 + + Update nonce.c + + auth: fixed issue when during registration nonce expired, after backwards time shift + +commit 2aa013d5fb992be98fc1ec90abdf0d67625ab724 +Author: Daniel-Constantin Mierla +Date: Wed Sep 2 13:31:08 2015 +0200 + + textopsx: use safer function to parse header name in short buffer + +commit b62492e2e25984528e4cda7f96d7afee1425ceb3 +Author: Daniel-Constantin Mierla +Date: Wed Sep 2 13:30:58 2015 +0200 + + textops: use safer function to parse header name in short buffer + +commit a9dc0f738f448676b8a92818d442ca7142147f9b +Author: Daniel-Constantin Mierla +Date: Wed Sep 2 13:30:46 2015 +0200 + + pv: use safer function to parse header name in short buffer + +commit baf90dba5c12158386e501e73daa266321d9de38 +Author: Daniel-Constantin Mierla +Date: Wed Sep 2 13:29:43 2015 +0200 + + core: select framework - use safer function to parse header name in short buffer + +commit ac27d053ce0d9d9295f3ca8052a320e0c0b01699 +Author: Daniel-Constantin Mierla +Date: Wed Sep 2 13:29:09 2015 +0200 + + parser: fixed the name for the new parse_hname2_short() function + +commit 964ed0a5083413eb0a70bd8a952d5a91ee9e9883 +Author: Chris Double +Date: Wed Sep 2 13:15:37 2015 +0200 + + parser: fix overflow access when parsing Reason header stored in short buffer + + - it can happen for fixup functions from textops module having header + name as a parameter, with critical impact when using system malloc, + the internal pkg malloc does a roundup of the allocated space + - the issue is caused by the word (4 bytes) read step performed by + parse_hname2() - second 4-byte read in buffer "Reason:" exceeds the + size by 1 + - added a safe read macro that reads 1, 2 or 3 bytes if the size of the + buffer is not big enough for a 4 bytes read + +commit cbc5034b26189371c2ffb80424414aa8b1b8dea5 +Author: Daniel-Constantin Mierla +Date: Wed Sep 2 13:07:45 2015 +0200 + + parser: safer function to parse header name stored in short buffer + +commit aad248fc39279f84879929772e9306fc01473860 +Author: Daniel-Constantin Mierla +Date: Wed Sep 2 09:17:24 2015 +0200 + + tmx: err level replaced with info when getting t reply code pv + +commit 199202f453b4a5f01783a4c2ba5c5ed2e10b0739 +Merge: 9b40550 6ce6803 +Author: Federico Cabiddu +Date: Tue Sep 1 16:28:29 2015 +0200 + + Merge pull request #311 from doublec/tsilo_transaction_fix + + Change remove_ts_transaction so it updates head pointer of list + +commit 6ce6803d57dabe287d7d6fa859e93c1df402d821 +Author: Chris Double +Date: Tue Sep 1 00:17:40 2015 +1200 + + tsilo: Fix transaction removal to update list head + + - When transaction being removed is the head of the list, + correctly update the head to point to the next transaction. + +commit 9b40550c23c4f532d48e86777f3ffeff0f311e3c +Merge: 8bde185 01a92d9 +Author: Daniel-Constantin Mierla +Date: Tue Sep 1 14:41:44 2015 +0200 + + Merge pull request #312 from neuhaus/patch-1 + + README.md: Minor fixes + +commit 01a92d9f62c080ad16ed55f87d559c96d2d1612e +Author: Sven Neuhaus +Date: Tue Sep 1 14:32:44 2015 +0200 + + README.md: Minor fixes + +commit 8bde18570e9687ab0470e83c0137246ce0feb223 +Author: Daniel-Constantin Mierla +Date: Tue Sep 1 14:18:20 2015 +0200 + + drouting: rebuilt text readme + +commit 711144a1fa3e1dfa540cc7ccd0ce1c14faeba42f +Author: Daniel-Constantin Mierla +Date: Tue Sep 1 14:18:02 2015 +0200 + + drouting: notes about the format of duration attribute + +commit 4ae2f50adacc93e919f4a1ae02b29c532d8a86cc +Author: Daniel-Constantin Mierla +Date: Tue Sep 1 14:13:14 2015 +0200 + + README.md: added notes about licensing + +commit b40bfc9881b6972dcfa032677582c58eb46f3a33 +Author: Daniel-Constantin Mierla +Date: Tue Sep 1 11:50:45 2015 +0200 + + README.md: adjustments to make mailing list addresses visible + +commit 7b01a7a4a6f3d4c35e344d775dbec819601e73b3 +Author: Daniel-Constantin Mierla +Date: Tue Sep 1 11:43:09 2015 +0200 + + README.md: details useful to be displayed on github main page for the project + +commit bf6aba3f30ff2ac99e266af12dd7557a4049d052 +Merge: a3bedbe 06f684e +Author: Victor Seva +Date: Tue Sep 1 10:02:10 2015 +0200 + + Merge pull request #309 from kamailio/vseva/scriptvar2xavp + + pv: create command to copy script vars to xavp + +commit 06f684eb3c099e0a7e47c1fbb86335a43d409b57 +Author: Victor Seva +Date: Mon Aug 31 11:19:12 2015 +0200 + + pv: refresh README + +commit 0c25a564ae178e46747bc31e9a289a1602a537e3 +Author: Victor Seva +Date: Sat Aug 29 09:07:27 2015 +0200 + + pv: pv_var_to_xavp + +commit a3bedbea21e353231524a405d227b8878fd11d9b +Author: Daniel-Constantin Mierla +Date: Tue Sep 1 09:18:17 2015 +0200 + + tmrec: updated the content of the readme file + +commit 81006ee1246b8f700ce9ce20814d4522780d7ceb +Author: Daniel-Constantin Mierla +Date: Tue Sep 1 09:17:39 2015 +0200 + + tmrec: more details about duration format for time recurrences + +commit 7e40171e15eda9c8325e3e2771500917d12e20ad +Merge: ec2a72d aef62d8 +Author: Daniel-Constantin Mierla +Date: Tue Sep 1 09:06:41 2015 +0200 + + Merge pull request #307 from mawis/typo_fix + + Small typo fix in config. + +commit aef62d8277be4699b9e79ef49542865a44857999 +Author: Matthias Wimmer +Date: Sat Aug 29 01:03:34 2015 +0200 + + Small typo fix in config. + +commit ec2a72d75dc0a2c9c3d88361094fdda7a7477935 +Author: Daniel-Constantin Mierla +Date: Fri Aug 28 12:31:24 2015 +0200 + + geoip: set null termination to the field used for query + +commit 74c84c7cd52347fcd1c90e75dca239b5f758169b +Author: Carsten Bock +Date: Fri Aug 28 12:08:10 2015 +0200 + + db_postgres: Fix heap use after free error in db_postgres module + + The result structure for a query holds a pointer returned by + PQfname. When sql_do_query executes the query it gets this + database result structure returned but the PQfname pointer + has already been free'd by a call to db_postgres_free_query + from within db_postgres_store_result. + + sql_do_query then tries to copy the free'd string into another + result structure resulting in a heap use after free. + + The fix here copies the PQfname result. + + Fix by Chris Double + +commit 2ebcb840b189d9a992923cdd32d80764987a5923 +Author: Carsten Bock +Date: Fri Aug 28 10:56:37 2015 +0200 + + utils: Fix buffer overflow; do not NULL-terminate HTTP result + + Fix buffer overflow in the `write_function` that takes the resulting + data from libcurl. The function was trying to NULL terminate the + string, but this could result in overwriting the buffer by one byte + when size*nmemb == 1. + This also caused some memory corruptions, reported on sr-dev. + + Reported by: Travis Cross + +commit eb4644dbe52e705273f1f5e15777006fd0ee5356 +Author: Daniel-Constantin Mierla +Date: Fri Aug 28 11:18:38 2015 +0200 + + usrloc: regenerated the readme + +commit ac2882e1e6e7da4c151a6aa9fe8ee4c0bf9cd543 +Author: Daniel-Constantin Mierla +Date: Fri Aug 28 11:18:24 2015 +0200 + + rr: regenerated the readme + +commit d71d746d3f9c84f2aa4e822404a1c3fe5c7da122 +Author: Daniel-Constantin Mierla +Date: Fri Aug 28 11:18:10 2015 +0200 + + auth: regenerated the readme + +commit c7f94fd94500270828fcc4cb3011c60c67a8936b +Author: Charles Chance +Date: Fri Aug 28 07:58:13 2015 +0100 + + dmq_usrloc: check existence of usrloc domain before continuing. + +commit 2c199d4f8a92a3ad9665dd3ea3079799b26c32d5 +Author: Elena-Ramona Modroiu +Date: Thu Aug 27 19:02:23 2015 +0200 + + xlog: regenerated the readme + +commit 4eb52469c0f99262737cea445b66b239a32fd629 +Author: Elena-Ramona Modroiu +Date: Thu Aug 27 19:01:07 2015 +0200 + + xlog: documented new functions + + - xinfo(), xnotice(), xwarn(), xerr(), xbug(), xcrit(), xalert() + +commit 15153d5f528efa1238e6c8c6b1a5f91018ba06ef +Author: Elena-Ramona Modroiu +Date: Thu Aug 27 18:59:23 2015 +0200 + + xlog: convenience functions for various log levels + + - xinfo(), xnotice(), xwarn(), xerr(), xbug(), xcrit(), xalert() + +commit ec0ba37b9f2b6c60303227ea0527d69896f2930e +Author: Daniel-Constantin Mierla +Date: Thu Aug 27 15:58:48 2015 +0200 + + jsonrpc-c: proper error handling for pipe cmd callback + + - credits to Hugh Waite for spotting missing return + - free vars if already set when error handling is done + +commit a620bfec37cdcdc5c5debcdfb5219b09464065fe +Author: Daniel-Constantin Mierla +Date: Thu Aug 27 15:38:03 2015 +0200 + + mem: safety prev free checks for f_malloc extract operation + + - following a report by Alex Balashov + +commit cba555e2ea8309e510bd830747caf8beb3c370fc +Merge: ad72150 e737942 +Author: Daniel-Constantin Mierla +Date: Thu Aug 27 13:39:11 2015 +0200 + + Merge pull request #306 from zxcpoiu/master + + usrloc: really do the ignore location record if it's a non-local socket + +commit e737942fbabc1f5d6d50a51c667cc0533cfe5777 +Author: zxcpoiu +Date: Thu Aug 27 16:34:42 2015 +0800 + + usrloc: new param to skip non-local location record + + - If set, kamailio will skip record if socket value doesn't in + listening socket list when loading record from database. + +commit 53210656befae010a9f7e7735536c4c7b3b1e37b +Author: zxcpoiu +Date: Thu Aug 27 15:29:12 2015 +0800 + + usrloc: fixed typo in skipping record LM_ERR msg + + - doing "skip" action instead "sip" action + +commit ad72150a09adeaff53c617bf3d729aa94ae463c7 +Author: Daniel-Constantin Mierla +Date: Thu Aug 27 09:24:31 2015 +0200 + + dialog: set the db null flag properly for contact fields + +commit c885d2eed5d1a54192a9d74093abceb20eb0855f +Author: Daniel-Constantin Mierla +Date: Thu Aug 27 08:57:52 2015 +0200 + + dialog: handle malloc result for separated contact value + +commit 8d8e1b957d9461d80b15b8e52464322a4e2b5fb1 +Merge: 6b73ca8 1bb4536 +Author: Alexandr Dubovikov +Date: Wed Aug 26 21:57:21 2015 +0200 + + Merge pull request #305 from mslehto/sipcapture-domain + + modules/sipcapture: adds insertion of request, From, and To URI domain part + +commit 1bb4536846ee05e525c4e0fb348c5e6a6d9a47dc +Author: Mikko Lehto +Date: Wed Aug 26 22:20:25 2015 +0300 + + modules/sipcapture: stores request URI domain part + +commit 6b73ca89832e034239d6f17d41b825cfdc52424d +Author: Daniel-Constantin Mierla +Date: Wed Aug 26 19:07:11 2015 +0200 + + kamcmd: do binrpc read in non-strict mode + + - reported by Dmitri Savolainen, GH#145 + +commit 9c105b13436c9eb3e61568e6f08050423da3e569 +Author: Daniel-Constantin Mierla +Date: Wed Aug 26 19:06:43 2015 +0200 + + lib/binrpc: updated code for the new prototype of binrpc read function + +commit 39ab16e4f0d24d70b7d1414df48af023b2018cf6 +Author: Daniel-Constantin Mierla +Date: Wed Aug 26 19:03:55 2015 +0200 + + ctl: internal mode to allow non-strict reading binrpc packets + + - allow handling structs with simple values inside, some rpc responses + are not strictly build as per xmlrpc/jsonrpc specs + +commit 3f4c63802194cb83ffb8124e5ae38f85ee315c28 +Author: Daniel-Constantin Mierla +Date: Wed Aug 26 15:16:13 2015 +0200 + + kamcmd: lower max size for socket name + + - was set to 108 which is common for linux, but mac os x has it 104 + - set to 100 now + +commit 8db5eb2b53320d84ded36c531a00f6dfbec27a75 +Author: Daniel-Constantin Mierla +Date: Wed Aug 26 15:09:17 2015 +0200 + + kamcmd: updated default server name references + +commit e319a22f80d425f39611857fddc1e948e76ebe87 +Author: Daniel-Constantin Mierla +Date: Wed Aug 26 13:55:54 2015 +0200 + + usrloc: take in consideration aor case sensitive value for rpc commands + + - reported by GH#264 + +commit acf0432cafdaa4b464f1069996e46d54ab0c22e4 +Author: Daniel-Constantin Mierla +Date: Wed Aug 26 13:55:33 2015 +0200 + + registrar: propagate value of case_sensitive for aor to core + +commit 06e36989b2c5332b3ca377ec8098d8f2d953a5b6 +Author: Daniel-Constantin Mierla +Date: Wed Aug 26 13:47:13 2015 +0200 + + core: keep info about aor being considered case sensitive or not + +commit 821d1d9f300a2d73d18a6dd95b8ad44a7d8794e8 +Author: Victor Seva +Date: Wed Aug 26 10:56:32 2015 +0200 + + core: partial revert from 546e624a859 wrong clear or routename + +commit 8b4d3f3df3204a86bf75b771d36ab63674c63e15 +Author: Daniel-Constantin Mierla +Date: Wed Aug 26 12:10:30 2015 +0200 + + dialog: regenerated the readme file + +commit 94f7683a055f4bae20fb67ba89bfa59b6ba8ae4c +Merge: 546e624 9eb6ab9 +Author: Daniel-Constantin Mierla +Date: Wed Aug 26 12:09:39 2015 +0200 + + Merge pull request #304 from jaybinks/JB-db_skip_load3 + + dialog: implement db_skip_load to skip loading dialogs on startup + +commit 546e624a859686ca03e47cff1c62252aa4f60bab +Author: Victor Seva +Date: Tue Aug 25 15:43:29 2015 +0200 + + core: fix routename for event_route + +commit 9eb6ab94611b816add72c2d4af3bb0609cf2b112 +Author: Jay Binks +Date: Wed Aug 26 11:38:36 2015 +1000 + + dialog: implement db_skip_load to skip loading dialogs on startup + +commit 374bfb1c467d6bf2a4cc143d22868c37143783bd +Author: Daniel-Constantin Mierla +Date: Tue Aug 25 16:12:51 2015 +0200 + + mi_datagram: free async handler when command completed + + - reported by Torge Szczepanek, GH#298 + +commit 79459d3f87731309641794a2b881ee1cacc5e1f2 +Author: Daniel-Constantin Mierla +Date: Tue Aug 25 15:53:02 2015 +0200 + + jsonrpc-c: free pipe cmd for notifications + + - fixes leak reported by GH#296 + +commit de07fe4e78e2b7df59fbdffd74ca655bd77570ba +Author: Daniel-Constantin Mierla +Date: Tue Aug 25 15:37:34 2015 +0200 + + dialog: refresh value for contact uri for each re-invite + +commit 3820f41ab7ba33c39cd9f67e179bf203aa60ddeb +Author: Daniel-Constantin Mierla +Date: Tue Aug 25 15:13:16 2015 +0200 + + dialog: split out storage of contact from common memory block + + - kept now in its own malloc'ed chunk + +commit 0d9e4adb328dabaf2a34d926bc80e022bee65079 +Author: Daniel-Constantin Mierla +Date: Tue Aug 25 14:28:17 2015 +0200 + + dialog: dlg var value stored as zero terminated string + + - easier to use in std lib operations + +commit cbc0c720e1c239296ff3842d701f75663bead6d9 +Author: Daniel-Constantin Mierla +Date: Tue Aug 25 13:35:30 2015 +0200 + + dialog: set dlg var table as static and rename to avoid name conflicts + +commit 284fcb685b1691b25ea73a170467d862b1b67929 +Author: Daniel-Constantin Mierla +Date: Tue Aug 25 08:59:44 2015 +0200 + + dispatcher: reformated code to fit in 80char lines for keepalives function + +commit c56209fa2d487385def4b98bfb662d90236ac5f8 +Merge: 31d984c 44e3691 +Author: Daniel-Constantin Mierla +Date: Tue Aug 25 08:57:43 2015 +0200 + + Merge pull request #297 from evolvetsi/master + + dispatcher: add new probing_mode=3 to always probe flagged gateways + +commit 31d984c6a1b59da455387cb10bfd68dd8d8bbcc8 +Merge: 7e7ffea 5002f66 +Author: Daniel-Constantin Mierla +Date: Tue Aug 25 08:49:13 2015 +0200 + + Merge pull request #300 from grumvalski/ontimeout_bye_dlg_ctx + + modules/dialog: make dialog context available in event route tm:local… + +commit 5002f66a98b6104702c8c862e7335ff189e7b7d8 +Author: Federico Cabiddu +Date: Tue Aug 25 07:26:19 2015 +0200 + + modules/dialog: make dialog context available in event route tm:local-request + +commit 44e3691bc706bf9c232af7eb3fb36b166e5dd0c7 +Author: root +Date: Mon Aug 24 16:37:20 2015 -0400 + + dispatcher: updated dispatcher_admin.xml to document new probing_mode + + - as per @miconda, I moved my documentation for probing_mode=3 to + the dispatcher_admin.xml file and regenerated the README. + +commit 7e7ffea767db9b2afd9dec6eea20389e21da1b50 +Merge: 7b35791 4dc718a +Author: Daniel-Constantin Mierla +Date: Mon Aug 24 22:31:35 2015 +0200 + + Merge pull request #299 from mslehto/warn-p_usrloc + + modules/p_usrloc: fixes get_all_ucontacts() function signature + +commit 4dc718a0f20169ed76b9f7618e3e9994c9313102 +Author: Mikko Lehto +Date: Mon Aug 24 22:26:30 2015 +0300 + + modules/p_usrloc: fixes get_all_ucontacts() function signature + + usrloc.c:61:26: warning: incompatible pointer types assigning to + 'get_all_ucontacts_t' (aka 'int (*)(void *, int, unsigned int, unsigned int, unsigned int, int)') from + 'int (void *, int, unsigned int, unsigned int, unsigned int)' + [-Wincompatible-pointer-types] + +commit 65a442a2ab5fce1a469bc7ac5ec7f9880f4dae7e +Author: root +Date: Mon Aug 24 14:29:23 2015 -0400 + + dispatcher: add new probing_mode=3 to always probe flagged gateways + + - added DS_PROBE_ONLYFLAGGED probing_mode option. If set, + any gateways with a state of PROBING will be continually + probed and the PROBING flag will never be cleared. This + allows probing specific gateways continually, keeping + their up/down status current. + +commit 7b35791472620bee9f489b80f3528ce00ffbd688 +Author: Charles Chance +Date: Mon Aug 24 18:41:12 2015 +0100 + + dmq_usrloc: fix indentation + +commit 9c943031f29889c21b25b49b5dd267f4b2460bae +Author: Charles Chance +Date: Mon Aug 24 18:17:23 2015 +0100 + + dmq_usrloc: check existence of usrloc domain before continuing. + + - avoids crash caused by passing null pointer to get_urecord_by_ruid(). + - eventually need to implement multi-domain replication but usrloc API needs enhancing first. + +commit 0f479b5366fae4c5ad0c78e4c91661b7a421d5e8 +Author: Daniel-Constantin Mierla +Date: Mon Aug 24 09:28:29 2015 +0200 + + sanity: adjusted log messages for check_proxy_require() + +commit 4404f75cf194e8fd727c2ffaeeea41d2193decf6 +Author: Daniel-Constantin Mierla +Date: Sat Aug 22 13:47:47 2015 +0200 + + evapi: do cfg framework update on i/o events + +commit a16c6108e1f6d1a3f6b6c962bbaaedf37e57a8d2 +Author: Daniel-Constantin Mierla +Date: Sat Aug 22 09:44:12 2015 +0200 + + db_postgres: memset vars to 0 to avoid using invalid values inside db_postgres_new_connection() + + - reported by mading087, GH#292 + +commit 86e3ed032fc738a596bab8f2ff314a280bf18545 +Merge: 9902ca1 5b97d81 +Author: Daniel-Constantin Mierla +Date: Sat Aug 22 09:38:40 2015 +0200 + + Merge pull request #289 from kamailio/vseva/session_timers + + stt: add refresher param following RFC 4028 + +commit 9902ca145178498ff47092f0ecdd3bca6650c97c +Author: Daniel-Constantin Mierla +Date: Sat Aug 22 09:28:29 2015 +0200 + + sanity: commented priting require header on error level + +commit d802b57011ea7c90d8fcb80a3927fb54546b37d7 +Author: Mikko Lehto +Date: Thu Aug 20 13:08:04 2015 +0300 + + modules/sipcapture: stores From and To domain part + +commit cfff19e6d16309b8421cb0d6dfac88d99bd4f4ba +Author: Mikko Lehto +Date: Thu Aug 20 12:55:43 2015 +0300 + + modules/sipcapture: indentation and whitespace fixes + +commit a6609f5fb3a66c89936dc0f929dbe23dad59b503 +Author: Carsten Bock +Date: Thu Aug 20 10:48:55 2015 +0200 + + usrloc: New matching mode: CALLID_ONLY + +commit eb9da34377130db968913fcda139070d47053d88 +Author: Hugh Waite +Date: Wed Aug 12 17:51:25 2015 +0100 + + app_lua: Export more sdpops functions to LUA + - sdp_with_active_media + - sdp_with_transport + - sdp_with_codecs_by_id + - sdp_with_codecs_by_name + - sdp_with_ice + - sdp_keep_codecs_by_id + - sdp_keep_codecs_by_name + - sdp_remove_media + - sdp_remove_transport + - sdp_remove_line_by_prefix + - sdp_remove_codecs_by_id + - sdp_remove_codecs_by_name + +commit 5b97d81756b3e5b5ddbea4e6337d4e6bbadea024 +Author: Victor Seva +Date: Wed Aug 12 18:50:11 2015 +0200 + + stt: add refresher param following RFC 4028 + + Fixes: #288 + Patch by: https://github.com/nbougues + +commit 56b17076be90db99058bec51ad73a5e84d6616ad +Author: Hugh Waite +Date: Thu Jun 11 13:27:31 2015 +0100 + + sdpops: Export more sdpops functions + + - sdp_with_active_media + - sdp_with_transport + - sdp_with_codecs_by_id + - sdp_with_codecs_by_name + - sdp_with_ice + - sdp_keep_codecs_by_id + - sdp_keep_codecs_by_name + - sdp_remove_media + - sdp_remove_transport + - sdp_remove_line_by_prefix + - sdp_remove_codecs_by_id + - sdp_remove_codecs_by_name + +commit 0868ed0ef12e65c7790beeccf139b5fdc245efdb +Author: Camille Oudot +Date: Wed Aug 12 17:33:00 2015 +0200 + + auth: modify doc to reflect current implementation + +commit 82f13f5d020ebd0ce4ff4c692a4e6d6567f5f5b7 +Merge: 6d5da24 92ba30d +Author: Daniel-Constantin Mierla +Date: Wed Aug 12 11:17:53 2015 +0200 + + Merge pull request #284 from jnewmano/master + + janssonrpc-c: allow null json error property in rpc response + +commit 6d5da24172622cbac989df4da15f8c3c38cb3f8c +Author: Victor Seva +Date: Wed Aug 12 11:11:26 2015 +0200 + + tls: generate README + +commit 3163c43b7bc2e1ca29d2b7e0772091a425ed7777 +Merge: 559b848 6490d95 +Author: Victor Seva +Date: Wed Aug 12 11:08:15 2015 +0200 + + Merge pull request #282 from kamailio/vseva/tls_no_install_certs + + tls: install-cfg: do not generate tls-cert by default + +commit 559b8488beb2bd3e231c4d0e54061ab69daf95d6 +Merge: 36a2b6d 1935977 +Author: Victor Seva +Date: Wed Aug 12 11:05:41 2015 +0200 + + Merge pull request #285 from kamailio/vseva/kamcmd_version_nodate + + kamcmd: support VERSION_NODATE and VERSION_DATE for reproducible builds + +commit 6490d95a7b07e449705373de74825dc7792d451e +Author: Victor Seva +Date: Tue Aug 11 09:44:49 2015 +0200 + + tls: install-cfg: do not generate tls-cert by default + +commit 19359772acf1cbd9dedb244c1fe327ec47b7dc9c +Author: Victor Seva +Date: Wed Aug 12 08:16:52 2015 +0200 + + kamcmd: support VERSION_NODATE and VERSION_DATE for reproducible builds + + support added e03d1279f49709e0d320478fa1ff7c27161c30ed + + Related: #60 + +commit 92ba30d66e9e6bb686410f362f2b6e8d669ed295 +Author: Jason Newman +Date: Tue Aug 11 14:30:31 2015 -0600 + + janssonrpc-c: allow null json error property in rpc response + + If the JSON RPC response contains an error property, check to see if it is a json_null or not before flagging the response as an error. + +commit 36a2b6d4a22eff146f912a3b8b567cc10a77cc2f +Author: Camille Oudot +Date: Tue Aug 11 18:16:04 2015 +0200 + + rtpengine: add example in doc for write_sdp_pv + +commit 5ee6747368751c9d428314c92791314c02e601a5 +Author: Camille Oudot +Date: Tue Aug 11 15:45:23 2015 +0200 + + rtpengine: new read_sdp_pv parameter + + this parameter allows to specify a script var or AVP for rtpengine to + get the SDP from, instead of the SIP message body. + +commit 60ffee9cf54ff362026497036935746c9dbe62e5 +Author: Stefan Mititelu +Date: Tue Aug 11 15:31:02 2015 +0300 + + dtrie: Set child to NULL when run out of SHM + + The stop condition in dtrie_delete is node==NULL. Suppose the case when there + is no SHM memory left when trying to dtrie_insert(). The memory gets freed + by shm_free() but the pointer still points to it. This leads to segfault when + dtrie_delete tries to access that memory zone, in the given case. GDB says: + "Cannot access memory at address 0x1130000001d" + +commit 8695be4cb188397cd7bba2ad348e6f29a0158aa6 +Author: Camille Oudot +Date: Tue Aug 11 13:25:52 2015 +0200 + + mem: fix compilation warning in TLSF + +commit 7683e1a903765c64cbc3b5d6c200120114c96c72 +Merge: 02f4d74 3cefc76 +Author: Victor Seva +Date: Tue Aug 11 08:16:04 2015 +0200 + + Merge pull request #281 from jnewmano/master + + janssonrpc-c: correct jansson_get parameter order in examples + +commit 3cefc76ade4046962962f112beafe939d5ff2ed0 +Author: Jason Newman +Date: Mon Aug 10 17:20:26 2015 -0600 + + janssonrpc-c: correct jansson_get parameter order in examples + + parameter order should be jansson_get(key/path, src, dst) and not jansson_get(src, key/path, dst) + +commit 02f4d74c0c853300fabc434e054cb28324ace876 +Author: Camille Oudot +Date: Mon Aug 10 19:46:44 2015 +0200 + + mem: add TLSF malloc() and free() memory debug log + +commit 8b7061a81c84955ec0bae77998f5cf79b1112f49 +Author: Camille Oudot +Date: Mon Aug 10 15:07:10 2015 +0200 + + core: add TLSF in version flags string + +commit d55ffbe48973eac57a445ce4720393178a5dd65d +Author: Camille Oudot +Date: Mon Aug 10 14:29:51 2015 +0200 + + mem: TLSF, fix real used memory count + +commit 852703fa28782520658925aa831669274b347da6 +Author: Camille Oudot +Date: Fri Aug 7 19:21:26 2015 +0200 + + mem: display the 2 levels matrix in TLSF status + + Displays a matrix of non-empty free blocks lists rather than the list of + all used blocks. tlsf_status() displays a letter reflecting the order of + magnitude of the free blocks list length in each bucket + +commit 38ee440e24528c20040580407e05428d06ec6098 +Author: Camille Oudot +Date: Mon Aug 10 15:30:26 2015 +0200 + + rtpengine: regenerate README + +commit e8927be015b4034d252479ba6fede4b749a43eed +Author: Camille Oudot +Date: Mon Aug 10 15:24:27 2015 +0200 + + rtpengine: fix typo in documentation + +commit edc25d7373f9560d09a35640ab19741f19b97040 +Author: Charles Chance +Date: Sat Aug 8 18:00:21 2015 +0100 + + dmq_usrloc: implement deleted contact replication + +commit e5ec5a443aaec732390bae6247fe561ea312b709 +Merge: b48bbd3 99ce64f +Author: Victor Seva +Date: Fri Aug 7 11:27:42 2015 +0200 + + Merge pull request #279 from kamailio/vseva/registrar_max_contacts_instance + + registrar: ci_pack, get instance and ref_id when using msg + +commit b48bbd377a9dd9c8d18e4f6642f785659848ff2c +Merge: 6b15a51 49420ba +Author: Daniel-Constantin Mierla +Date: Fri Aug 7 10:39:04 2015 +0200 + + Merge pull request #277 from fredposner/master + + etc: simple typo fixes in kamailio.cfg + +commit 6b15a51b016c232fab6665fc03ed01dad09ac8b5 +Author: Daniel-Constantin Mierla +Date: Fri Aug 7 10:36:50 2015 +0200 + + drouting: fixed typo in reload cmd response + + - reported by GH#275 + +commit 99ce64fc555cc0b6b0189d812c6156cb05fb2e1b +Author: Victor Seva +Date: Thu Aug 6 20:36:22 2015 +0200 + + registrar: get instance and ref_id when using msg + + needed for check max_contacts properly if sip.instance exists + as contact parameter + + See: #278 + +commit 49420bac12faf27ce4b7ae6a869741f41e6a6553 +Author: qxork +Date: Thu Aug 6 13:29:23 2015 -0400 + + etc: simple typo fixes in kamailio.cfg + + - fixed small typos within comments of default kamailio config + +commit 64daeb365d45249d9562a416bd79326ea5d86328 +Author: Victor Seva +Date: Thu Aug 6 14:58:52 2015 +0200 + + Revert "pua_reginfo: use ul.get_urecord_by_ruid instead of ul.get_urecord" + + This reverts commit 9a6d8d2bffe13b442ed5e880fb0dd2c6572c29e2. + +commit 374edbfe3b05eb74acc871c3d72474c08e8d5e34 +Author: Carsten Bock +Date: Tue Aug 4 20:51:23 2015 +0200 + + utils: Additional headers need to be added as chunk, not as a string + +commit b0a776b31220fc5e8599288b14ddb9ffccb24c0f +Author: Daniel-Constantin Mierla +Date: Fri Jul 31 18:39:41 2015 +0200 + + registrar: updated the docs for registered(...) function + +commit c3755580f8e2763e33be03b0370630d04af3a019 +Author: Daniel-Constantin Mierla +Date: Fri Jul 31 18:35:55 2015 +0200 + + registrar: allow registered() in any route + + - if used for a sip reply and URI is not provided, then To URI is used + +commit 48f89ed0390a80cc760da5a7ed41dd9c5c5ffc4d +Author: Daniel-Constantin Mierla +Date: Thu Jul 30 20:54:56 2015 +0200 + + pua: fix typo in matching presence.winfo + + - patch by foucse, GH #270 + +commit b217efe5409dbbc2d76245a00a9febf1c0799c6e +Merge: 955463d 6f18e01 +Author: Daniel-Constantin Mierla +Date: Fri Jul 31 17:38:49 2015 +0200 + + Merge pull request #271 from kamailio/vseva/jsonrpc_fixes + + jsonrpc-c: support load module even if no server is online and max reconnect attempts + +commit 955463d6634202111594fd7867928ef64ac31010 +Merge: 483b39d c446840 +Author: Daniel-Constantin Mierla +Date: Fri Jul 31 17:37:05 2015 +0200 + + Merge pull request #272 from kamailio/lazedo-htable-patch-1 + + htable : fix $shtrecord(value) returned value + +commit 483b39db975c0abd4e9a70f3a3f20514bc2768a3 +Author: Carsten Bock +Date: Fri Jul 31 15:50:26 2015 +0200 + + utils: Add/Update doc for the new header-parameter + +commit 4f064becff5880e77b85e970673efa4fdd8948e2 +Author: Carsten Bock +Date: Fri Jul 31 15:43:17 2015 +0200 + + utils: Add optional parameter for additional headers + +commit c446840e0004f8cb9208c2a6f68774c4c788e5a8 +Author: lazedo +Date: Fri Jul 31 14:06:29 2015 +0100 + + htable : fix $shtrecord(value) returned value + + $shtrecord(value) does not return correct value when it is an integer + +commit 6f18e01b96929aeeb23454534e5c1da0efc3a09b +Author: Victor Seva +Date: Fri Jul 31 10:05:50 2015 +0200 + + jsonrpc-c: add max_conn_attempt parameter to control max number of reconnections + + Related: #269 + +commit 9dccaff661f4d4a1dfcb9b062235ce4ce904b991 +Author: Victor Seva +Date: Thu Jul 30 16:45:25 2015 +0200 + + jsonrpc-c: don't fail if no connection to any of the servers when module is loaded + + Related: #269 + +commit f2314469cba09e087f7e8092ba74790b62db36b3 +Merge: f64c438 0588a7b +Author: Daniel-Constantin Mierla +Date: Thu Jul 30 20:51:50 2015 +0200 + + Merge pull request #268 from kamailio/vseva/jsonrpc_fixes + + jsonrpc-c: fix crash at reconnect_cb if server was never connected + +commit f64c4389eaec74ea49f521c010e17831e76c49fa +Author: Carsten Bock +Date: Thu Jul 30 17:07:18 2015 +0200 + + ims_registrar_scscf: Vendor-ID of Call-ID AVP should be 0 or 3GPP, never 50 + +commit 0588a7bc5f57c012b6c8d188860251f402af9be7 +Author: Victor Seva +Date: Thu Jul 30 16:01:25 2015 +0200 + + jsonrpc-c: fix crash at reconnect_cb if server was never connected + +commit 459a323e2712c29ebd455be325f14cd63b1a3605 +Author: Daniel-Constantin Mierla +Date: Thu Jul 30 12:41:08 2015 +0200 + + rr: reformatted code to fit 80 chars line + + - wrapped conditions to avoid misinterpretation on loosely compilers + +commit 6c7af50d9ab97d236befd489347d0aba617ccf0d +Author: Daniel-Constantin Mierla +Date: Thu Jul 30 12:37:45 2015 +0200 + + core: tcp - remove log message introduced by rr commit + + - it doesn't show relevant information + +commit 9fd57a96510898dfaa5b73d8bc9b884fd8960622 +Merge: 3a6b221 6532c8b +Author: Daniel-Constantin Mierla +Date: Thu Jul 30 12:36:14 2015 +0200 + + Merge pull request #257 from krieger-od/master + + rr: add enable double rr always option + +commit 3a6b221a4ccb910607a0a893efb9e759f8d17012 +Merge: 6ebdf01 4fc2e10 +Author: Daniel-Constantin Mierla +Date: Thu Jul 30 12:35:10 2015 +0200 + + Merge pull request #238 from athonet-open/fix_cdp_routing_rx_interface + + cdp: Fix cdp routing for Rx interface + +commit 6ebdf01f26b1889edd3a3e7fb1cc56b0a32ec3dd +Author: Daniel-Constantin Mierla +Date: Wed Jul 29 22:38:17 2015 +0200 + + maxfwd: added section ids to docbook + +commit eba5c3b8c30ef1409e3cc183538e9da3f9600288 +Author: Daniel-Constantin Mierla +Date: Wed Jul 29 12:17:39 2015 +0200 + + modules: regenerated the readme from docbook for several modules + +commit c007a06228d3ccc39d17b93b5c7d173e8a68b5f1 +Author: Daniel-Constantin Mierla +Date: Tue Jul 28 10:24:10 2015 +0200 + + tm: regenerated readme + +commit e5f472ca5d8d2e16adb8b5a5a316521a618c8d9f +Author: Daniel-Constantin Mierla +Date: Tue Jul 28 10:23:28 2015 +0200 + + tm: added note in docs for t_set_no_e2e_cancel_reason() + + - it has to be used when processing the INVITE + +commit 6fcd35ba5bb71df680b89c2bafceccde0439b6f1 +Author: Daniel-Constantin Mierla +Date: Tue Jul 28 10:02:03 2015 +0200 + + permissions: check if hash tables exist for address config functions + + - reported by Olle E. Johansson, GH#248 + +commit 56e41533cae52cf5f782064ed23393d2d18aff08 +Author: Daniel-Constantin Mierla +Date: Tue Jul 28 09:47:48 2015 +0200 + + permissions: safety check if hash tables exist for rpc dump commands + + - reported by Olle E. Johansson, GH#248 + +commit 0c42a848258d475f57ea25458bc75e55dcee948d +Author: Daniel-Constantin Mierla +Date: Mon Jul 27 18:57:53 2015 +0200 + + rr: fix detecting next strict router + + - a regression after adding support for sip-outbound + - more verbose debug messages + - reported by Antonio Real, GH #267 + +commit 6656d4459f0c7d4c1b7cb5d2b214201c5a587c5c +Author: Daniel-Constantin Mierla +Date: Mon Jul 27 18:24:09 2015 +0200 + + acc: note about setting acc flag for ACKs that should be recorded + +commit 646d229b0ba471d327a03f710c3347a545698297 +Author: Carsten Bock +Date: Mon Jul 27 15:39:22 2015 +0200 + + ims_registrar_pcscf: Generated README + typo in Docbook + +commit b859f8ca2082022e04d50a90d25fe8de17522b08 +Author: Carsten Bock +Date: Mon Jul 27 15:34:29 2015 +0200 + + ims_registrar_pcscf: Added functionality to unREGISTER a contact, eg. based on a failed network ping + +commit fb5d38b12efb456edd9e2d5a31fe7b31d3bb9e90 +Author: Carsten Bock +Date: Mon Jul 27 13:54:51 2015 +0200 + + ims_registrar_pcscf: Initial Documentation on module + +commit cfa6831f9a81988dc1844ba3e4e6048c12841606 +Author: Daniel-Constantin Mierla +Date: Mon Jul 27 15:04:30 2015 +0200 + + uac: reset ongoing registration state if retry interval is exceeded + + - cover the case of remote registration process stuck in ongoing state + for long time + - reported by Andy J Robinson, GH #255 + +commit 54fea03a078f8258d124a83443617c54bdbc2574 +Author: Daniel-Constantin Mierla +Date: Mon Jul 27 15:03:21 2015 +0200 + + tm: more verbose debug message when local transaction is completed + +commit 58acd28f620c4a4e6b9abb1b9a2dfa2d8556708c +Author: Daniel-Constantin Mierla +Date: Mon Jul 27 13:42:33 2015 +0200 + + acc: use proper ack message struct for external engine accounting of ACK + + - reported by Yasin Caner - GH #266 + +commit 747c3284c6eb31fab3b143c4217c84aa29fb9ca5 +Author: Daniel-Constantin Mierla +Date: Mon Jul 27 12:07:38 2015 +0200 + + Makefile.defs: separate RUNBASEDIR from BASEDIR + + - not sharing same purpose, a common value can still be forced via + DESTDIR + +commit 7038d12dbb9c8db1b46c0874bfd8fce72d6e72ed +Author: Daniel-Constantin Mierla +Date: Mon Jul 27 12:01:03 2015 +0200 + + kamcmd: use NAME to build help message + +commit fc53c424f4ab7454bfd1e644291906392fc495fa +Author: Daniel-Constantin Mierla +Date: Mon Jul 27 10:23:39 2015 +0200 + + dispatcher: free parsed params at reload time + +commit 93b297e16134b0e74cf83e3604da01355a52e700 +Author: Daniel-Constantin Mierla +Date: Fri Jul 24 12:43:26 2015 +0200 + + siptrace: check if To header is parsed and available + + - it is accessed and can lead to crash if not prepared + - reported by GH #263 + +commit 740cfa0ebed20ba7b5ae2cab1b25aa2f6cd83899 +Author: Daniel-Constantin Mierla +Date: Fri Jul 24 12:30:58 2015 +0200 + + siptrace: safety check if db connection is set + + - reported in GH #262 + +commit 96ac163139976e8a9dea0e7252c66294054281b4 +Author: Federico Cabiddu +Date: Thu Jul 23 15:25:44 2015 +0200 + + modules/tm: cycle through all the uac while checking for already existing branches + +commit 6532c8b45f403e973e2d66543132553166b180ab +Author: Andrey Utkin +Date: Mon Jul 20 14:46:36 2015 +0000 + + rr: add enable_double_rr_always option + +commit f680081af551cad2069f7ba742b6ba73d39e46dd +Author: Daniel-Constantin Mierla +Date: Tue Jul 21 14:20:37 2015 +0200 + + cfgutils: updated readme file + +commit dc486a9464de5d12d00af28675e51e843492e36a +Author: Daniel-Constantin Mierla +Date: Tue Jul 21 14:20:15 2015 +0200 + + cfgutils: updated docs for sleep() and usleep() + +commit 8e2c2cbf673cd18c0bd90888a75d50903d1c9984 +Author: Daniel-Constantin Mierla +Date: Tue Jul 21 14:11:37 2015 +0200 + + cfgutils: sleep() and usleep() accept vars as parameter + +commit d83fee0a31f292af731269cbd361db39be0a4b9b +Author: Daniel-Constantin Mierla +Date: Sat Jul 18 09:52:28 2015 +0200 + + lib/srdb1: dummy string for null values pointed to static buffer + + - allow editing in upper layers, avoiding innaproriate access to a constant + +commit 85fc1db80d246effdef55d6244914e1cb73a76ab +Author: Richard Good +Date: Tue Jul 21 10:52:25 2015 +0200 + + modules/ims_charging: allow ro session id to be used from cfg file as avp + +commit ed894111f6f15170f87336bfa73ec4e8fce1c7d1 +Author: Victor Seva +Date: Mon Jul 20 20:36:28 2015 +0200 + + core: fix mips compilation + + Patch from + http://anonscm.debian.org/cgit/pkg-voip/kamailio.git/tree/debian/patches/fix-mips.patch + by Dejan Latinovic + +commit e066edee83e468f8257b6268eae8fc532141b717 +Merge: 4250235 8f1fbd7 +Author: Victor Seva +Date: Mon Jul 20 20:11:22 2015 +0200 + + Merge pull request #258 from kamailio/vseva/kex_fix_date + + kex: support VERSION_NODATE and VERSION_DATE for reproducible builds + +commit 8f1fbd7b17440b1b7d87cbee5793ae9b1adebf90 +Author: Victor Seva +Date: Mon Jul 20 19:38:32 2015 +0200 + + kex: support VERSION_NODATE and VERSION_DATE for reproducible builds + + support added e03d1279f49709e0d320478fa1ff7c27161c30ed + + Related: #60 + +commit 4250235e77c6384be20235b1cf01cc20abaa922d +Merge: de840ed 577ddf6 +Author: Victor Seva +Date: Mon Jul 20 09:44:56 2015 +0200 + + Merge pull request #254 from linuxmaniac/vseva/dnssec + + dnssec: link openssl + +commit 577ddf62f46d3e06d9ae235fef9cde177020a9d4 +Author: Victor Seva +Date: Sat Jul 18 14:37:30 2015 +0200 + + dnssec: link openssl + + Fixes: #253 + +commit de840ed3f6d41fe63bc0e27465241824edf6f377 +Author: Victor Seva +Date: Sat Jul 18 11:53:27 2015 +0200 + + pkg/kamailio/deb: add sid support + +commit 8cf4696b66fe9475a125b520c8dcb7f96e264ecd +Author: jaybeepee +Date: Fri Jul 17 12:27:48 2015 +0200 + + modules/cdp: update auth session timeout when it is = lifetime as well... + - only really makes a difference if grace time = 0 + +commit f2958e5861a96e40f0aca05d5d5bd7fa14c2089e +Author: Daniel-Constantin Mierla +Date: Fri Jul 17 08:59:29 2015 +0200 + + permissions: safety check for trusted hash table + + - avoid crash if a db reload is issued in db-only mode + - reported Emmanuel Schmidbauer, GH #228 + +commit 6dd7f13c8a7b928cf7aa8baaaf30114912284362 +Merge: 7b02509 b0f465b +Author: Daniel-Constantin Mierla +Date: Fri Jul 17 08:35:52 2015 +0200 + + Merge pull request #252 from fredposner/patch-6 + + Update pipelimit_admin.xml + +commit 7b02509b4ea793d93828fbf7ab4843e88de855f5 +Merge: e16372d 59a35ca +Author: Daniel-Constantin Mierla +Date: Fri Jul 17 08:35:28 2015 +0200 + + Merge pull request #251 from fredposner/patch-5 + + Update README + +commit b0f465bc6e402ba77923216affc2020ad25e97c0 +Author: Fred Posner +Date: Thu Jul 16 15:17:52 2015 -0400 + + Update pipelimit_admin.xml + + - added information about algorithms + - corrected rl typos + - corrected example (wrong algorithm) + - added note about algorithms being case sensitive + - added example using pipelimit for specific method (INVITE) + +commit 59a35caa53c50fac0e35a51a58239227d4f5cae8 +Author: Fred Posner +Date: Thu Jul 16 15:01:15 2015 -0400 + + Update README + + - added information about algorithms + - corrected rl typos + - corrected example (wrong algorithm) + - added note about algorithms being case sensitive + - added example using pipelimit for specific method (INVITE) + +commit e16372dc978c15fa0c30e25c9ba8cf7de284e60d +Merge: d796409 9ccc3f5 +Author: Daniel-Constantin Mierla +Date: Thu Jul 16 16:58:13 2015 +0200 + + Merge pull request #246 from krieger-od/master + + dialog: run event_route[dialog:end] in case of dialog termination by … + +commit d796409e653031fdfecee554500b06a43b981296 +Author: Daniel-Constantin Mierla +Date: Thu Jul 16 14:18:51 2015 +0200 + + etc/kamailio-oob.cfg: remove modules_k from mpath + +commit 6b5959bc4aa760930ac176b8761af2004260705a +Author: Daniel-Constantin Mierla +Date: Thu Jul 16 12:21:34 2015 +0200 + + core: pv api - use buffers for empty and null values + + - safer if any transformation wants to temporary update the value for + some operations + +commit fe7b9786f5e09735eea25e4f8e70ba694f8c0475 +Author: jaybeepee +Date: Thu Jul 16 09:36:18 2015 +0200 + + modules/tm: unset async suspended transaction flag post-continue + +commit 9ccc3f510ce2d97dbe1efb690ef1d4e8f18885d5 +Author: Andrey Utkin +Date: Wed Jul 15 08:28:35 2015 +0000 + + dialog: run event_route[dialog:end] in case of dialog termination by interface commands + +commit 8f3caea21172893abb3f6be8856058f41f2bb17f +Merge: bc01d8d 7d31d78 +Author: ng-voice GmbH +Date: Wed Jul 15 21:36:04 2015 +0200 + + Merge pull request #247 from kamailio/vseva/pua_reginfo + + pua_reginfo: fix NOTIFY xml + +commit 7d31d78e3ac861cddfcb70c9940242ec7f3f0dbc +Author: Victor Seva +Date: Wed Jul 15 16:00:03 2015 +0200 + + pua_reginfo: use ruid to fix comparation of contact + + (ptr == c) is always false. Using ruid instead. + +commit 63bd356cc3c7aa64d64361283f630f88b8db88af +Author: Victor Seva +Date: Thu May 28 18:26:08 2015 +0200 + + pua_reginfo: use ul.get_urecord_by_ruid instead of ul.get_urecord + +commit bc01d8d6c6abfc7912a27df3ac23bffd818758e9 +Author: Charles Chance +Date: Wed Jul 15 09:48:57 2015 +0100 + + dmq_usrloc: use new version of serialized structure returned by usrloc (now includes received address) + +commit 67dfb62cf15ab60401243c3632a587b64ed5d376 +Author: jaybeepee +Date: Wed Jul 15 09:15:40 2015 +0200 + + modules/ims_usrloc_scscf: only remove impurecord if there are no active subscriptions + +commit b40790134c01c6a0afa839f7896219ccff6e0818 +Merge: 99f7d67 8dcc663 +Author: Victor Seva +Date: Wed Jul 15 08:55:40 2015 +0200 + + Merge pull request #245 from pwarnold/master + + Makefile.groups was not updated when usrloc_dmq was renamed to dmq_usrloc + +commit 8dcc663d050ec314e35ed2c4bcaae592f8e39350 +Author: Paul Arnold +Date: Wed Jul 15 12:10:13 2015 +1000 + + Makefile.groups: rename usrloc_dmq to dmq_usrloc + +commit 99f7d67b20c011e78c277a44ea8cd4d6a820806f +Author: Charles Chance +Date: Tue Jul 14 22:59:10 2015 +0100 + + dmq_usrloc: don't destroy json doc before we're done with it. + +commit adf1bca4a820e9cb5fcc94a1953b0fcdbd8a20da +Author: Daniel-Constantin Mierla +Date: Tue Jul 14 17:40:05 2015 +0200 + + pv: catch early setting $rU with empty string + + - avoids backing up and restoring last char, which can create + inappropriate access when using static empty string value + +commit 7cf6368591b630ddf19b32e1218fdbc10490442c +Author: Victor Seva +Date: Tue Jul 14 17:12:34 2015 +0200 + + pkg/kamailio/deb: chown HOMEDIR when created + Fixes: 231 + +commit 811976add9a3119e020e9b2fed36bb9b793f1f28 +Author: Victor Seva +Date: Tue Jul 14 16:23:49 2015 +0200 + + pkg/kamailio/deb: update version to 4.4.0~dev2 + +commit 96bb212d439daf843bd1c48b71dbfd43cde24d7c +Author: Daniel-Constantin Mierla +Date: Tue Jul 14 16:17:34 2015 +0200 + + Makefile.defs: version set to 4.4.0-dev2 + +commit 35e5da141569b8ace7c0a8fd743d02de6c0df525 +Author: Daniel-Constantin Mierla +Date: Tue Jul 14 16:15:43 2015 +0200 + + Makefile.defs: detect gcc version 5.0+ + + - reported by Anthony Messina, GH #230 + +commit 91dd5f7c4ed09116795561eea267b35a098020b2 +Author: Carsten Bock +Date: Tue Jul 14 16:05:47 2015 +0200 + + ims_charging: Do not send trunk-ids or charging group, if those values are not set + +commit 58d0daaffab281ca40458fd7612f0dd31bc95274 +Author: Carsten Bock +Date: Tue Jul 14 16:03:56 2015 +0200 + + dialog_ng: Minor fixes for termianting calls + +commit 8e5f0b05c8e2df21853e234a5facbcef1fb167c9 +Author: Daniel-Constantin Mierla +Date: Tue Jul 14 15:36:38 2015 +0200 + + pv: regenerated the readme file + +commit aa5156037e0884e7aa3981421a15327fffd62f99 +Author: Daniel-Constantin Mierla +Date: Tue Jul 14 15:36:19 2015 +0200 + + pv: documented pv_xavp_print() function + +commit b120b47c39034d4bc384ff733ce62b845f2b4062 +Author: Daniel-Constantin Mierla +Date: Tue Jul 14 15:19:55 2015 +0200 + + avpops: remove unecessary test for deleting avps by name rules + + - causes crash, following the change to use cached pv structures + - reported by Alexandr Dubovikov, GH #239 + +commit 4efb386ebf47fc89446f57f2faf6f5cddfb7bff7 +Author: Daniel-Constantin Mierla +Date: Tue Jul 14 14:54:31 2015 +0200 + + core: proper cloning of xavp list with no-data type + + - function used for cloning xavps stored in location record + - reported by Luca Mularoni + +commit a9d10bbae1ffbd6be0f5a83ffacfa57a03174a2e +Author: Daniel-Constantin Mierla +Date: Tue Jul 14 14:06:07 2015 +0200 + + Makefile.defs: test if SCTP is set to enable core USE_SCTP + +commit 20d03834b3b34f7c50d5bab167a2492a417078b6 +Author: Carsten Bock +Date: Mon Jul 13 16:53:02 2015 +0200 + + core: Add tsilo to Makefile.groups + +commit 7ed447b680e718dc472d0e01005b842e5c7f8908 +Merge: 34efdc9 21b6419 +Author: Daniel-Constantin Mierla +Date: Mon Jul 13 11:47:11 2015 +0200 + + Merge pull request #233 from lazedo/lazedo/pv_digest + + pv : add auth digest pseudo variables + +commit 34efdc9c4fa9711f9a17b5a46f72efcf979b16a2 +Author: Carsten Bock +Date: Mon Jul 13 11:44:53 2015 +0200 + + ims_charging: Only send CCR_STOP, if we've had a positive reply for CCR_START + +commit 73ee98ed83708d71d4887a01647af1af0e11b1e8 +Merge: 158ffa1 53cb864 +Author: Alexandr Dubovikov +Date: Fri Jul 10 17:50:15 2015 +0200 + + Merge pull request #242 from adubovikov/master + + fixed correlation_id + +commit 53cb86495a71fe040864167aea1319c5fe04f884 +Author: Alexandr Dubovikov +Date: Fri Jul 10 17:00:49 2015 +0200 + + fixed correlation_id + +commit 158ffa1da017f5ae58f6becd3289db0e290a5e67 +Author: Carsten Bock +Date: Fri Jul 10 16:16:45 2015 +0200 + + cdp: b/f: Exit loop, if there is no avp->next (bug introduced in bac9707) + +commit 728e52f366998abe8d338de9f9533cd8076d53bb +Author: jaybeepee +Date: Fri Jul 10 11:23:43 2015 +0200 + + modules/ims_usrloc_scscf, ims_registrar_scscf: distinguish between implicit/explicit contact removal + +commit 519a31c2a78030f5d0b2770927b6cb3db054b55c +Author: Victor Seva +Date: Thu Jul 9 22:45:44 2015 +0200 + + pkg/kamailio/deb: add stretch support + +commit 0b54fb31be17a3e03200545bd3ad5896437ec771 +Author: Luis Azedo +Date: Thu Jul 9 20:54:06 2015 +0100 + + kazoo : fix null pointer usage + + also some code cleanup + +commit 2f506ba05c2d076b3d796714bd73cda8719f97af +Merge: 733fd5d 917bd96 +Author: Victor Seva +Date: Thu Jul 9 21:23:49 2015 +0200 + + Merge pull request #241 from fredposner/patch-4 + + core: update release notes in NEWS + +commit 917bd965e230c9c60906e1c2d3c9ed3df7b00e7f +Author: Fred Posner +Date: Thu Jul 9 12:53:33 2015 -0400 + + core: update release notes in NEWS + + - Earlier versions for 3.1 and earlier remain. Newer versions are linked to the Kamailio website. + +commit 4fc2e109391ffef98059b517f8fbdc2523c0651f +Author: Federico Favaro +Date: Wed Jul 8 15:41:21 2015 +0200 + + Fix cdp routing for Rx interface + + Avoid to force vendor_id to zero + if Auth_Application_Id or Acct_Application_Id AVPs + +commit 733fd5daf74963b152a2964f9eea1a6fff91858a +Author: Victor Seva +Date: Tue Jul 7 13:04:00 2015 +0200 + + dmq_usrloc: update get_all_ucontacts API request + + Fixes: #236 + +commit f429e753dfa750a604bfb0acb5068b47d0fbe142 +Author: Daniel-Constantin Mierla +Date: Tue Jul 7 11:14:31 2015 +0200 + + core: fix matching network addresses with bitmask non divisible to 8 + + - reported by Kyle Kurz for permissions module + +commit 9874185397b1363f77b653cd654e574024d8f13d +Author: jaybeepee +Date: Tue Jul 7 09:57:14 2015 +0200 + + modules/ims_usrloc_scscf: added coutners for reporting hashtable usage + - collision slot count for impus, contacts and subscriptions + +commit 21b64194f268e258fff4c66af4435d112df6708d +Author: Luis Azedo +Date: Mon Jul 6 15:50:20 2015 +0100 + + pv : add auth digest pseudo variables + + adn - auth nonce + adc - auth cnonce + adr - auth response + ado - auth opaque + +commit 9866f62c462075db1d0ac4fb20a35fe13c7d2c4d +Merge: e5b7d9f 140d0c6 +Author: Daniel-Constantin Mierla +Date: Mon Jul 6 14:26:22 2015 +0200 + + Merge pull request #232 from kelchy/master + + jansson: prevent from shuffling key order in json + +commit 140d0c6fc89d3c72bbd45627ca627e19e45b4e53 +Author: kelchy +Date: Mon Jul 6 19:21:41 2015 +0800 + + prevent jansson from shuffling key order in json + +commit e5b7d9f0319f24b712c441fa9461c83ae479e504 +Author: jaybeepee +Date: Mon Jul 6 11:11:45 2015 +0200 + + Revert "modules/cdp: CER/CEA retry if send/receive FD disappeared" + + This reverts commit 867a29d80aebaddaa0e1c960b9e1d459b7a9fb4d. + +commit 657fb58a9274f7fc163533b8eb476c59390cff85 +Merge: aa02102 11bcc80 +Author: Victor Seva +Date: Mon Jul 6 09:10:15 2015 +0200 + + Merge pull request #224 from kamailio/vseva/routename_fix + + core: clean previous routename + +commit aa02102cecce271371e54994c1b653e122d68d2b +Merge: 115e1eb 894796f +Author: Victor Seva +Date: Mon Jul 6 09:03:11 2015 +0200 + + Merge pull request #229 from kamailio/vseva/usrloc_server_id + + usrloc|nathelper: add filtering by server_id support + +commit 115e1eb10566ffafe0f37aed92df8413f660ea6c +Author: Fred Posner +Date: Mon Jul 6 08:53:16 2015 +0200 + + INSTALL: updated bug tracker URL + + - fixed flavour typo + +commit ef55950a9465a7aed4e0a791e1685a112cece63f +Author: Carsten Bock +Date: Sat Jul 4 21:52:32 2015 +0200 + + ims_usrloc_scscf: Fix return-code in case of memory allocation errors + some debug output + +commit d37f534564f9f1e39ba5133bbac8098416192b6b +Author: Carsten Bock +Date: Sat Jul 4 19:19:02 2015 +0200 + + ims_usrloc_scscf: Fix ref-counting from previous commit... + +commit 47e990e2ab562ccdd95dca1376c35a71b640af76 +Author: Carsten Bock +Date: Sat Jul 4 18:16:06 2015 +0200 + + ims_charging: Add Multiple-Services Indicator + +commit 961f6bad29a8079ad26a3851ee453c1c236e9ebf +Author: Carsten Bock +Date: Sat Jul 4 18:14:02 2015 +0200 + + ims_usrloc_scscf: Do not re-use Subscription, if it's for a different IMPU + +commit 894796f6f1fa2d2778ace5c56f58d204ea06efc2 +Author: Victor Seva +Date: Thu Apr 2 16:27:23 2015 +0200 + + nathelper: support filter contacts by server_id + +commit aedd970a97fef3e00c9e490e458f6f9af19df4d2 +Author: Victor Seva +Date: Sat Jul 4 09:43:41 2015 +0200 + + usrloc: add module option to support preload using server_id as filter + +commit 039231a3b61c00fe36e868417144daa9f04936ba +Author: Victor Seva +Date: Sat Jul 4 08:08:08 2015 +0200 + + usrloc: support filter by server_id at get_all_ucontacts + +commit fa33cd0b2e651a49545b48ff36be815448a4b2a1 +Author: jaybeepee +Date: Fri Jul 3 15:34:06 2015 +0200 + + modules/ims_usrloc_scscf,ims_registrar_scscf,ims_qos: improvements, optimisations, cleanup + - the module needed some cleanup as well as a possible deadlock situation which is now fixed + +commit 68bb6b35098f5555ca35ddb21527660e46b7336a +Author: Juha Heinanen +Date: Fri Jul 3 11:27:12 2015 +0300 + + modules/rls: normalize RLS entry URIs + + - RLS entry URI is xs:AnyURI, which may be an absolute or relative URI. + In relative URI, URI scheme is missing. + +commit e34cc9e49867644b2280265a546f6d901720986c +Author: Stefan Mititelu +Date: Thu Jul 2 15:59:27 2015 +0300 + + pdb: decrease the WARN log message level to NOTICE + + Decrease the log level for the pdb WARN messages to NOTICE. + +commit bac9707163082e7e0ca60c2c02eb1102df8d227b +Author: Carsten Bock +Date: Thu Jul 2 12:20:42 2015 +0200 + + cdp: Evaluate the supported_vendor_id-AVP during CER/CEA + +commit 64ccb0f92781a82d183444d6c69def3df49898cc +Author: Luis Azedo +Date: Wed Jul 1 21:38:01 2015 +0100 + + kazoo : first approach to multiple consumers + +commit 542a8f8e6d6f8242ec1dea51ea9aa4a37403dcc8 +Author: Luis Azedo +Date: Wed Jul 1 16:29:17 2015 +0100 + + kazoo : fix memory leak + +commit 67db972a129a8f34ea7406618593df4eaf846a1b +Author: Luis Azedo +Date: Wed Jul 1 15:59:57 2015 +0100 + + kazoo : fix, send timeout callback to consumer process + +commit 5b4d2a6984910e51bccb44b28c1146a889a920c8 +Author: Luis Azedo +Date: Wed Jul 1 12:35:14 2015 +0100 + + kazoo : fix consumer channel identification + +commit 6aa380df64a80c8c606436002893655e0781559d +Author: Luis Azedo +Date: Wed Jul 1 12:15:10 2015 +0100 + + kazoo : add async query feature + + suspend the transaction on send and continue on return or timeout + +commit 62c4a48f6f8568613de54eeddccb0814692e41be +Author: Carsten Bock +Date: Tue Jun 30 12:00:14 2015 +0200 + + Debian-Packaging: $NAME is now dependent of the script-name (easier for multi-instance setups e.g. IMS/VoLTE), more use of the $NAME for other directories. + +commit 682eb47b1b2bc3683e3059b492196c49ca11dd62 +Author: Carsten Bock +Date: Tue Jun 30 11:52:15 2015 +0200 + + ims_qos: Make Release-Reason from QoS configurable, add option to add Extra-Header, in case QoS fails during a session. + +commit 5de00fa47bd3e9f0a05324463325dcaf891174a5 +Author: Juha Heinanen +Date: Mon Jun 29 17:29:35 2015 +0300 + + modules/rtpengine: unset "don't fragment" ip header flag + +commit 11bcc8066ce856cabfc95949b65712d891976194 +Author: Victor Seva +Date: Mon Jun 29 10:23:12 2015 +0200 + + core: clean previous routename in order to get the correct default_routename + + fix c44685cbcefb8f6ecfa6f11369699906db832c39 + +commit 1481e44c41e592cfdfec7ad1ce4194973f272eb7 +Author: Luis Azedo +Date: Sat Jun 27 13:15:10 2015 +0100 + + kazoo : change log level on correlated message handling + +commit 1f124fa5db0b3e1e787cd7b1f454d7a694d34a80 +Author: Luis Azedo +Date: Fri Jun 26 19:35:55 2015 +0100 + + kazoo : changes in targeted exchanges + +commit afbcbfb43b5ddbafa745fc12f7d2365d6e715d89 +Merge: 37e205c f39736b +Author: Daniel-Constantin Mierla +Date: Thu Jun 25 22:20:00 2015 +0200 + + Merge pull request #220 from mslehto/htable + + modules/htable: improves error message when loading from database + +commit f39736b276878f0de1e0471311119f12f1878801 +Author: Mikko Lehto +Date: Thu Jun 25 20:00:54 2015 +0300 + + modules/htable: improves error message when loading from database + +commit 37e205c512ef3788780c9966f0e7f9e7f76d9c7a +Merge: 261a346 bd2feea +Author: Daniel-Constantin Mierla +Date: Thu Jun 25 18:57:32 2015 +0200 + + Merge pull request #219 from snen/dispatcher_weight_relative + + dispatcher: relative weight distribution + +commit bd2feeae898dd9a40bc2209200e3426d85430500 +Author: Savolainen Dmitri +Date: Thu Jun 25 19:35:04 2015 +0300 + + dispatcher: doc description for relative weight distribution added + +commit 261a3464f0a65dcf0de5458eff50aa4b9f64964c +Merge: 8217e81 d5339cf +Author: Daniel-Constantin Mierla +Date: Thu Jun 25 11:58:20 2015 +0200 + + Merge pull request #222 from mslehto/tautological-compare + + modules/[rls|presence_xml]: fixes warning [-Wtautological-compare] + +commit d5339cf397b83b79cd1594e37df69990374ec467 +Author: Mikko Lehto +Date: Wed Jun 24 23:59:49 2015 +0300 + + modules/[rls|presence_xml]: fixes warning [-Wtautological-compare] + + warning: comparison of unsigned expression < 0 is always false + +commit 8217e812d5ba0dcd975c24aa1ead066e80742315 +Author: Daniel-Constantin Mierla +Date: Tue Jun 23 23:22:13 2015 +0200 + + rtjson: regenerated readme + +commit 5db8bec2fdfba911f7053e615cf156d76af5fa46 +Author: Daniel-Constantin Mierla +Date: Tue Jun 23 23:21:35 2015 +0200 + + rtjson: more documentation about json routing document format + +commit 324d64e9ed301dab2204bda5e7cd143516edf64d +Author: lazedo +Date: Tue Jun 23 16:23:42 2015 +0100 + + kazoo : more federation tweaks + + when using federation, only use federation exchanges for zones != primary + +commit 59389b288fd50369226681b309c0895de03d7b77 +Author: Daniel-Constantin Mierla +Date: Tue Jun 23 16:45:17 2015 +0200 + + rtjson: safety check for branch index stored interanlly in xavp + +commit 57b75141542cdaa471dab00cfb4f7d8812d41824 +Author: Daniel-Constantin Mierla +Date: Tue Jun 23 16:44:11 2015 +0200 + + evapi: don't print the message after relaying to evapi dispatcher + + - the dispatcher process can consume it and frees the pointers + +commit 8025761dc0c75fd50e3ee24be96d420df79659d5 +Author: Daniel-Constantin Mierla +Date: Tue Jun 23 16:09:40 2015 +0200 + + rtjson: proper access to items in routes array + + - more debug messages to show the internal operations + +commit 368cc963ae63be2cfcde972473ae764538d8d4aa +Author: Daniel-Constantin Mierla +Date: Tue Jun 23 14:08:01 2015 +0200 + + evapi: refreshed the readme file + +commit 96225847ddfc2f879d63adbc0117748c9cf76f02 +Author: Daniel-Constantin Mierla +Date: Tue Jun 23 14:07:37 2015 +0200 + + evapi: more documentation for exported functions + +commit abd02c40d7f3379f8b72d73e89ab630167b5e514 +Author: Savolainen Dmitri +Date: Tue Jun 23 15:00:20 2015 +0300 + + dispatcher: use last active destination for relative weight distribution array finishing instead of last in destination set + +commit 42f0a1ffe551442058f53c9446495d5e62dc5abc +Author: Daniel-Constantin Mierla +Date: Tue Jun 23 13:15:29 2015 +0200 + + uac: fixed typos in log message + +commit 239c54843897ec143c03693e44c994ee9cdde684 +Author: Daniel-Constantin Mierla +Date: Tue Jun 23 13:12:08 2015 +0200 + + rtjson: error log level set to notice for importing uac api + + - printed at module init, it is not preventing to start the server + +commit cccd1a4b20c750246b491ff41090c5749561948d +Author: Daniel-Constantin Mierla +Date: Tue Jun 23 11:45:22 2015 +0200 + + evapi: evapi_close() doesn't use any parameter + +commit f87a631146c50a3c6e0ef843c5f85120957cb101 +Author: Luis Azedo +Date: Tue Jun 23 09:47:14 2015 +0100 + + kazoo : federation tweaks + +commit 1dbd53a0c6d0b9c82c46f67602ac9e9eebd3cf90 +Author: Luis Azedo +Date: Tue Jun 23 04:57:07 2015 +0100 + + kazoo : allow multiple simultaneous servers + +commit 1d6c1d74ab028ca0d75c6cd9f6466a255b93d2d2 +Author: Savolainen Dmitri +Date: Sat Jun 20 22:02:28 2015 +0300 + + dispatcher: relative weight distribution added + + - it is possible to assign "rweight" (relative weight) param to each host in destination group. + rweight is in the integer range from 1 to 100. + Active host usage probability is rweight/(sum of all active host rweights in destination group). + So INACTIVE/DISABLED destinations are removed from probability calculation. + +commit dead28aa11df089e1110a531297d67a4dd583972 +Author: Victor Seva +Date: Sat Jun 20 13:37:04 2015 +0200 + + modules/debugger: move json related from debugger_api.c to debugger_json.c|h + +commit 5d157208d6b145959b78fef76e6cc025c28e73cd +Author: Victor Seva +Date: Sat Jun 20 09:00:44 2015 +0200 + + modules/db_text: clean gcc warning + + dbt_raw_util.c: In function 'dbt_build_where': + dbt_raw_util.c:172:6: warning: unused variable 'n' [-Wunused-variable] + int n, l; + +commit 49befc1814690020c87403ab01c9c477cd0aa86c +Merge: 5900736 90e0bec +Author: Daniel-Constantin Mierla +Date: Fri Jun 19 15:29:19 2015 +0200 + + Merge pull request #217 from eschmidbauer/master + + added doc for proirites inside permission's module + +commit 90e0bec635abaed2bed38bd9b98e16d9895618f4 +Author: Emmanuel Schmidbauer +Date: Fri Jun 19 09:25:46 2015 -0400 + + permissions: added doc for priorities + +commit 5900736cea1da98952f23b0f92aa51bc928b5b46 +Author: Carsten Bock +Date: Fri Jun 19 13:32:10 2015 +0200 + + pv: Add pv-operator, to remove all non-numeric parts of a string + +commit dc2d3c3f609c81e21928390110952f4070ea9c62 +Author: Daniel-Constantin Mierla +Date: Fri Jun 19 12:06:30 2015 +0200 + + Makefile: kamailio user home dir set to /var/run/kamailio for install-initd-centos + + - affects the useradd command + - it was pointing to lib dir + +commit 0870ab88262bb61124899ad98d06a72a6cdc7129 +Author: Daniel-Constantin Mierla +Date: Fri Jun 19 11:56:56 2015 +0200 + + sdpops: don't return 0 if no match for sdp_get_line_startswith() + + - that causes exit of config execution + - reported by Sebastian Damm + +commit e6f3a512c599678fca08daca561bcad4c05add23 +Author: Daniel-Constantin Mierla +Date: Fri Jun 19 10:41:08 2015 +0200 + + domain: allow 'type' field in domain_attrs to be a DB1_BIGINT + + - in addition to allowing DB1_INT + - makes it work with MySQL views on 64bit systems + - based on a patch by divereigh, GH#182 + +commit e0e6994fcaa52bb1819bc8aea5d6edc6f9bf8e22 +Merge: 2a42a17 363027e +Author: Daniel-Constantin Mierla +Date: Fri Jun 19 10:35:23 2015 +0200 + + Merge pull request #175 from smititelu/master + + debugger module: add per module facility logging + add a debug SIP message config function + +commit 2a42a17d4ff434da065a988be1c8b9cdaa1938ed +Merge: d0d753a fa4169d +Author: Daniel-Constantin Mierla +Date: Fri Jun 19 10:04:48 2015 +0200 + + Merge pull request #216 from kamailio/db_text_raw_query + + db_text : support 'order by' in raw query + +commit d0d753a6d7cf8a6991e4d8ddeb74951fcb6c4f62 +Author: Luis Azedo +Date: Thu Jun 18 23:10:53 2015 +0100 + + kazoo : support alternative federated exchanges + +commit fa4169dbcaec92b8093bef149fdebb08be44b8f7 +Author: Luis Azedo +Date: Thu Jun 18 16:06:58 2015 +0100 + + db_text : support 'order by' in raw query + +commit b9a5eb253a53eacb7e27d4b659d7207363609d3f +Merge: f995edf 89633c4 +Author: Daniel-Constantin Mierla +Date: Thu Jun 18 15:12:12 2015 +0200 + + Merge pull request #213 from mslehto/fbsd-makefile + + Makefile.defs: fixes indentation + +commit 89633c4c85a6a44df3bbe4a80cf5ca595b59c196 +Author: Mikko Lehto +Date: Thu Jun 18 15:22:56 2015 +0300 + + Makefile.defs: fixes indentation + +commit f995edfb7fc9305dc72a6b04575e6112cd873473 +Author: Stefan Mititelu +Date: Thu Jun 4 11:34:19 2015 +0300 + + pdb: new protocol between pdb_server and kama pdb module + + Modified the communication protocol between the pdb clent <-> server such + that the server will give more feedback on scenarios like "pdb_id not found" or + "request number contains letters". New msg types or reply codes can be easily + added. Curent version of the protocol is 1 (0x01). + Also backwards compatibility is maintained when the first received byte is + different than the known versions (now, just 0x01). + Updated the http link for the get_carrier_germany script. Created a new perl + script to get german carrier id. + Updated doku (utils/pdbt/docs/network_protocol.txt). + + added the perls script + +commit 96e5a6aa5d3c00d0020315f5455b6c98c73d4a19 +Author: Richard Good +Date: Thu Jun 18 08:56:20 2015 +0200 + + modules/ims_qos: improve reliability of active media sessions stat + +commit 6b76de9f7d991ed3fdc5f2f28dde7bcb1962108b +Author: Daniel-Constantin Mierla +Date: Wed Jun 17 16:24:53 2015 +0200 + + kamctl: regenerated database creation scripts + +commit 2e370f2868f01f6a3fd0bc98159ee2e2d5fea25e +Author: Emmanuel Schmidbauer +Date: Wed Jun 17 16:24:08 2015 +0200 + + lib/srdb1: updated schema for trusted table of permissions module + +commit 4f635fadff53ef54d152d9690e080eb07a5786b0 +Author: Emmanuel Schmidbauer +Date: Wed Jun 17 16:18:18 2015 +0200 + + permissions: match trusted rules considering priority and regexp over r-uri + + - two new columns to set priority of the rule as well as regular + expression matching over r-uri + +commit 81243627ce07cd32804a6a1e15e0dc407f56f887 +Author: Emmanuel Schmidbauer +Date: Wed Jun 17 16:18:00 2015 +0200 + + permissions: README regenerated + +commit 15091551cdfddc6f85db4dec8b47b4f5401399d2 +Author: Emmanuel Schmidbauer +Date: Wed Jun 17 16:17:07 2015 +0200 + + permissions: updated docs with parameters for new columns of trusted table + + - used for setting priority and regexp matching over r-uri + +commit 8a9d7df57e0ac83bb8fb6f97c71b01ec96184ba0 +Author: Daniel-Constantin Mierla +Date: Wed Jun 17 16:12:44 2015 +0200 + + utils: fixed indentation + +commit 43e7f3425ed5d2ad2bcd9b9c52442174ef243729 +Author: Luis Azedo +Date: Tue Jun 16 20:14:40 2015 +0100 + + kazoo : do not override common properties in payload if they exist + + also adds app_name parameter to be sent in "App-Name" field, defaults to NAME at compilation time (kamailio) + +commit 6dba3a2d2785cba6b29bcb3d11b318687a12b632 +Author: Daniel-Constantin Mierla +Date: Tue Jun 16 15:45:07 2015 +0200 + + dialog: removed unused variable + +commit e4ce2a0837937effdfcccc26e8118028208a6c11 +Merge: 81fb65a ceffd95 +Author: Patric Marschall +Date: Tue Jun 16 15:38:01 2015 +0200 + + Merge branch 'master' of https://github.com/kamailio/kamailio + +commit 81fb65a7c89add3fc643f975044819800b7a9dcb +Author: Patric Marschall +Date: Tue Jun 16 15:34:28 2015 +0200 + + p_usrloc: updated documentation + + Updated documentation in p_usrloc module for parameters db_ops_ruid and db_update_as_insert. + +commit ceffd956e3b7a8070ffb6cf6c1a05b0f86f34ac8 +Author: Lucian Balaceanu +Date: Tue Jun 16 16:23:33 2015 +0300 + + rtpengine: interpret session limit message + + - upon receiving a "Parallel session limit reached"message from rtpengine + Kamailio's rtpengine module should try the next media relay available (or + none if none is available) without marking the media relay as unavailable; + +commit 9c3ea838b31039ac067e17d519df67b64b0dada1 +Author: Daniel-Constantin Mierla +Date: Tue Jun 16 15:06:43 2015 +0200 + + dialog: re-entrant mutex for dialogs hash table slots + + - changed from a lock set usage to per slot lock field + +commit bbcac5b04262194b427ce6f7bfafed3cfd5095b1 +Author: Juha Heinanen +Date: Tue Jun 16 11:37:45 2015 +0300 + + modules/lcr: added priority_ordering module parameter + + - allows ordering of matched gateways only by priority and weight + +commit e1f2a45fbe1fd6c44c41e05061504c0d11530431 +Merge: 20d2c6f a309fe4 +Author: Stefan Mititelu +Date: Mon Jun 15 14:38:31 2015 +0300 + + Merge pull request #206 from smititelu/kamailio-17 + + rtpengine: changes for mi_fifo_commands + +commit 20d2c6f6384fbc74956d3fb9070a31f387ebf612 +Author: Patric Marschall +Date: Mon Jun 15 13:00:45 2015 +0200 + + p_usrloc: added path and +instance support + + - Added functionality for path headers and +instance contact header fields in REGISTER requests for the p_usrloc module. + +commit 52c4316db2f4e99fdd4bfeafabe914ce3f47783c +Merge: bc9308e 073f25f +Author: Daniel-Constantin Mierla +Date: Mon Jun 15 11:35:13 2015 +0200 + + Merge pull request #194 from snen/extend_drouting_with_3_symbols + + Add symbols "#*+" to drouting tree + +commit bc9308eb928b67c485e53917b63ff0215677f13e +Merge: 4cca695 d4f7cf1 +Author: Daniel-Constantin Mierla +Date: Mon Jun 15 11:30:19 2015 +0200 + + Merge pull request #205 from kamailio/db_text_patch + + db_text : memory allocation/release issues in raw query + +commit 4cca695318690c9878c0562238196cc6c432c005 +Merge: a2ed394 dc8b174 +Author: Daniel-Constantin Mierla +Date: Mon Jun 15 11:17:29 2015 +0200 + + Merge pull request #207 from AlessioCasco/patch-1 + + Small accent circumflex correction. + +commit dc8b17416cc339d2117ed30c491a59691eaceeef +Author: Alessio Casco +Date: Sat Jun 13 13:20:47 2015 +0100 + + Small accent circumflex correction. + +commit a309fe46990df18cc37873d9e88d112bdbc2939f +Author: Stefan Mititelu +Date: Tue Jun 9 17:02:55 2015 +0300 + + rtpengine: changes for mi_fifo_commands + + Added a new fifo command, namely nh_ping_rtpp, which pings the given proxy or + all proxies, and if a proxy does not respond, disable it temporarily. + If the proxy responds, it does nothing. + Changed the existing fifos to execute for a specific proxy or for all proxies + depending on the first given parameter. + Changed nh_enable_rtpp to try to ping before enabling and enable + it only if ping success. Changed some formatting for nh_show_rtpp to + print 'N/A' when disabled permanent and to display the correct recheck_ticks. + Updated doku accordingly. + +commit 073f25f8d9181fe1d64e6a418bfee5889e4280ac +Author: Savolainen Dmitri +Date: Thu Jun 11 20:14:58 2015 +0300 + + function for node index calculation added + +commit d4f7cf1d933d74a55dfee0eafcf646a6165b12d6 +Author: Luis Azedo +Date: Thu Jun 11 17:17:08 2015 +0100 + + db_text : memory allocation / release in raw query + +commit 4dbff66fff81f929118f18338f0a57fac674d4f9 +Author: Luis Azedo +Date: Thu Jun 11 17:16:09 2015 +0100 + + db_text : only mark changed if there was a real change + +commit a2ed394522c5ad5dfe9822352d41c38692418098 +Merge: 7a871ed b3e0fe1 +Author: lazedo +Date: Thu Jun 11 17:09:47 2015 +0100 + + Merge pull request #204 from kamailio/kazoo_patch + + kazoo : missing fixes + +commit b3e0fe158b50753e43a3a47e8a06b902fe9b353c +Author: Luis Azedo +Date: Thu Jun 11 17:08:45 2015 +0100 + + kazoo : missing fixes + +commit 7a871ed6660ab9f826f1ccc73fdf8d5acd364076 +Merge: 43ef2b3 91537fc +Author: Daniel-Constantin Mierla +Date: Thu Jun 11 14:23:00 2015 +0200 + + Merge pull request #203 from tuxd00d/patch-1 + + English grammer tweaks + +commit 91537fc76d8a619295b827acef2e0dd5bcd2a5b1 +Author: tuxd00d +Date: Thu Jun 11 05:18:01 2015 -0700 + + English grammer tweaks + +commit 43ef2b33dfe1f494a9caba10e4c9440df55fe743 +Author: Carsten Bock +Date: Thu Jun 11 11:43:31 2015 +0100 + + smsops: More documentation, more coming soon + +commit 59450e0708ac3792ec1a959050e728ac26f96fe4 +Author: Carsten Bock +Date: Thu Jun 11 11:42:52 2015 +0100 + + smsops: Added an example configuration for an Interworking SMSc-AS + +commit 55a7bf18d0663a9503320143958d0d9e2e845b26 +Author: Hugh Waite +Date: Thu Jun 11 10:17:32 2015 +0100 + + dispatcher: Fix typo in error message + +commit 410a76a31296a5b8a0165185135baf33b1a758b5 +Author: Daniel-Constantin Mierla +Date: Thu Jun 11 10:49:32 2015 +0200 + + uac: readme regenerated + +commit db829aabf30c5b4fdfee5ebd842959b63a598b26 +Author: Daniel-Constantin Mierla +Date: Thu Jun 11 10:49:10 2015 +0200 + + uac: updated notes about uac_auth() + +commit 9529a6bc089da5536ccb141f7efa4a75e8074b75 +Merge: c9adb0f 192cf78 +Author: Hugh Waite +Date: Thu Jun 11 09:35:45 2015 +0100 + + Merge pull request #178 from kamailio/hpw/contact-attributes + + Implement load and restore of contact attributes + +commit c9adb0fa4a3943999b3350d03c60d4d8c884584b +Author: Daniel-Constantin Mierla +Date: Thu Jun 11 10:10:50 2015 +0200 + + core: fixed typo of year in README + + - reported by Anthony Messina + +commit e7510dc082d84a87558208f47d14d27c86885809 +Author: Daniel-Constantin Mierla +Date: Thu Jun 11 10:06:19 2015 +0200 + + async: initialize module timer processes based on workers parameter + +commit 4f5f8b9438120a04201b93bce8bd7886d654dbc0 +Author: Daniel-Constantin Mierla +Date: Wed Jun 10 18:38:59 2015 +0200 + + Makefile.defs: version set to 4.4.0-dev1 + +commit 4deaf33c1d3d217f63702cb3782d632ee6a8cb08 +Merge: 2a6f585 9d87603 +Author: Daniel-Constantin Mierla +Date: Wed Jun 10 18:26:59 2015 +0200 + + Merge pull request #197 from rdboisvert/master + + mohqueue v0.11 + +commit 2a6f5858e8f0659fc36164a598878070cc4c98e7 +Author: Daniel-Constantin Mierla +Date: Wed Jun 10 15:06:23 2015 +0200 + + ChangeLog: updated content to reflect the state of latest major release v4.3.0 + +commit 92b155e570490771e2b62e1c6185bbfacf770971 +Author: Daniel-Constantin Mierla +Date: Wed Jun 10 14:48:00 2015 +0200 + + core: several updates to the README + +commit 363027e7fc5020ba80f0b183fc87921f3d3b641b +Author: Stefan Mititelu +Date: Wed Jun 10 15:10:00 2015 +0300 + + debugger: add a new dbg_sip_msg() config function + + Added a config function which prints how the sip message would look like + if it were to be sent out at that point in config. Displays how the message + looks after apllying all the lumps; but it is just printing, not actual + lump application. Updated doku. + +commit 57e05de6dbb2de117be32b785944dabdbff4e49e +Author: Stefan Mititelu +Date: Mon May 25 12:41:09 2015 +0300 + + debugger: updated documentation for the new facility parameters. + + Updated documentation for the new debugger facility params. + +commit e5250430035b6e620dd1ac86d2fb9ebcbc717d84 +Author: Stefan Mititelu +Date: Mon May 25 12:34:25 2015 +0300 + + debugger: add support for static and dynamic, module specific, logging facility + + Added two new debugger params which will support setting per module logging facility. + This is useful when one might want to change logging for a certain module to a different file. + mod_facility_mode (0/1) is used for enabling this. mod_facility (str) is used for + setting the facility. + +commit d7c0ae494a5f1a5a8c808a4c45c9bfbbbda7388c +Author: Daniel-Constantin Mierla +Date: Wed Jun 10 14:25:37 2015 +0200 + + db_text: include header file for atoi() to avoid clang warnings + +commit e9e02982019921713fa6022b076bd4ceae899c6d +Merge: 1dfde28 9465064 +Author: lazedo +Date: Wed Jun 10 12:33:10 2015 +0100 + + Merge pull request #200 from kamailio/kazoo_json + + kazoo : add json keys function and escape character + +commit 9465064d3913bcd061aaa280adb4366d9a4c5a52 +Author: Luis Azedo +Date: Wed Jun 10 12:12:34 2015 +0100 + + kazoo : add json keys function and escape character + + json in the form of + + { "Nodes" : { + "mynode@my.tld.com" : { ... }, + "myothernode@my.tld.com" : { ...} + } + } + + doesn't have an easy to fetch the keys (it works already if it is an array) + kazoo_json_keys retrieves the keys to an avp + + when querying inner fields in the form xx.yy.zzz + if one of xx / yy / zzz contains a dot (.) we cannot determine the field correctly. + use "json_escape_char" param value to encode the value before querying json and kazoo_json will decode using the same character + +commit 1dfde28a60b5a6c11d6e95eefbf760200c86384c +Author: Daniel-Constantin Mierla +Date: Wed Jun 10 13:10:23 2015 +0200 + + siputils: proper indentation for analysing code blocks + +commit d5dd30ead60633392dc33f90af300a4655d91b56 +Merge: 9bb54e1 a0b0258 +Author: Daniel-Constantin Mierla +Date: Wed Jun 10 13:09:37 2015 +0200 + + Merge pull request #199 from kamailio/lazedo-patch-1 + + db_text : missing conversion in raw query + +commit a0b02584b76fced6d98f76ec02ae60d75bbccfa2 +Author: lazedo +Date: Wed Jun 10 11:52:20 2015 +0100 + + db_text : missing conversion in raw query + +commit 9bb54e1f656ba35861577b7defe765b4b71ca89e +Author: Daniel-Constantin Mierla +Date: Wed Jun 10 11:54:34 2015 +0200 + + smsops: generated and imported the README in the repository + +commit a0b2e58ce34647f2d33d77fb51f50a67541b9224 +Merge: 9030b7d 90d7019 +Author: Alexandr Dubovikov +Date: Tue Jun 9 23:34:12 2015 +0200 + + Merge pull request #198 from adubovikov/master + + modules/sipcapture: fixed empty table parameter. Update sipcapture.c + +commit 90d7019ecd4e5474a47d9df8c54549e30b484438 +Author: Alexandr Dubovikov +Date: Tue Jun 9 23:31:30 2015 +0200 + + Update sipcapture.c + +commit 9030b7db4352857c313b0268d5c3eeed766bb851 +Merge: 6518ba1 6589321 +Author: Daniel-Constantin Mierla +Date: Tue Jun 9 13:48:21 2015 +0200 + + Merge pull request #196 from mslehto/patch-4 + + modules/nat_traversal: avoid clang warnings with cast to (enum _hdr_types_t) + +commit 658932119824a0576ce708ed0d09fd43c95addfc +Author: Mikko Lehto +Date: Tue Jun 9 13:33:58 2015 +0300 + + modules/nat_traversal: avoid clang warnings with cast to (enum _hdr_types_t) + + nat_traversal.c:1477:54: warning: implicit conversion from 'hdr_flags_t' (aka 'unsigned long long') to 'enum _hdr_types_t' changes value from 18446744073709551615 to -1 [-Wconstant-conversion] + nat_traversal.c:1487:49: warning: implicit conversion from 'hdr_flags_t' (aka 'unsigned long long') to 'enum _hdr_types_t' changes value from 18446744073709551615 to -1 [-Wconstant-conversion] + +commit 6518ba16971b420a15421424cb3b2df364e94d04 +Merge: 3f13dc2 e1dcdf5 +Author: Daniel-Constantin Mierla +Date: Tue Jun 9 11:53:58 2015 +0200 + + Merge pull request #193 from kamailio/vseva/acc_mili + + lib/srdb1: use 6 digits for db_double2str + +commit 3f13dc2fedfa4008556c0fa3950e56886374e796 +Merge: a221ec3 f6fc513 +Author: Daniel-Constantin Mierla +Date: Tue Jun 9 11:52:01 2015 +0200 + + Merge pull request #195 from mslehto/clang-warning + + modules/call_control: change type to fix clang compiler warning + +commit f6fc513ad968c40d1c990024c4985fa285ba93b6 +Author: Mikko Lehto +Date: Tue Jun 9 12:24:48 2015 +0300 + + modules/call_control: change type to fix clang compiler warning + + call_control.c:503:19: warning: implicit conversion from 'hdr_flags_t' (aka 'unsigned long long') to 'int' changes value from 18446744073709551615 to -1 [-Wconstant-conversion] + +commit a221ec34074c25838f470070cb6c7e604a33fc98 +Author: Daniel-Constantin Mierla +Date: Mon Jun 8 07:34:47 2015 +0200 + + tm: extended docs for t_reply() + +commit 29aa683f7c3d507a88b83ecd84d9023c5e162ab1 +Author: Daniel-Constantin Mierla +Date: Mon Jun 8 07:34:22 2015 +0200 + + sl: extended docs for sl_send_reply() + +commit bdc05473eaf1dd5edc6b8aadb810a511413e0286 +Author: Savolainen Dmitri +Date: Mon Jun 8 20:30:53 2015 +0300 + + Add symbols "#*+" to drouting tree + +commit e1dcdf5a48cae9802c51c1d516d6fbc862855dcb +Author: Victor Seva +Date: Mon Jun 8 15:45:28 2015 +0200 + + lib/srdb1: use 6 digits for db_double2str + + acc module was getting values rounded by this + +commit e42c4401a73f3707db4d0146a6cdf3adcd45699f +Author: Carsten Bock +Date: Mon Jun 8 13:47:55 2015 +0200 + + ims_charging: In case of Tel-URIs, use type END_USER_E164 and STRIP tel: (Bugfix) + +commit 867a29d80aebaddaa0e1c960b9e1d459b7a9fb4d +Author: jaybeepee +Date: Mon Jun 8 11:43:50 2015 +0200 + + modules/cdp: CER/CEA retry if send/receive FD disappeared + - typically useful in edge cases where disk is full and/or FDs are deleted + +commit 1112649ba73606644ff427041ab5de4d5b6e88a5 +Author: jaybeepee +Date: Mon Jun 8 11:37:48 2015 +0200 + + modules/cdp: added class of auth session to know more info about auth session + - for example: ims_qos can now report Rx session for Reg or for media + - useful for reporting CDP session and which class they belong to + +commit 9d87603ca0f8a7d1df62cb776fe8dc7558f2f3bf +Author: Robert Boisvert +Date: Fri Jun 5 18:56:21 2015 -0400 + + * support Route in REFER/BYE + * added stop_stream () + * updated copyright + * added trailing linefeed to LM_* () messages + * add create call strings into buffer + * drop calls that to respond to REFER + * changed Referred-By to mohqueue + * added TRYING status + * only INVITE can come in w/o to tag + * use TM for first reply on INVITE + * changed the way messages are entered into the queue + * 180 Ringing not sent if not required + +commit f8f40045e1370002076f568a1e73e0b4b67e9d66 +Author: Daniel-Constantin Mierla +Date: Fri Jun 5 11:42:06 2015 +0200 + + core: resolve negative index for dset before checking if it is last branch + + - faster dropping of last branch + +commit 6461b799ce64315b72b8e2f4f7e4617603330833 +Author: Daniel-Constantin Mierla +Date: Fri Jun 5 11:41:21 2015 +0200 + + pv: convert negative index to positive position for $branch(...) + + - better access to branch structures + +commit d7a05349537a80c177c3c169776aa57e058314f3 +Merge: b0b3e0f 18038c2 +Author: Daniel-Constantin Mierla +Date: Wed Jun 3 14:53:14 2015 +0200 + + Merge pull request #189 from mslehto/patch-4 + + modules/call_control: fixes clang compile warning + +commit b0b3e0f7607534ac79c0134472797ced51fdb5b9 +Merge: c36b93f 8334ecf +Author: Daniel-Constantin Mierla +Date: Wed Jun 3 14:52:52 2015 +0200 + + Merge pull request #188 from mslehto/patch-3 + + modules/tls: improve logging + +commit c36b93f61a7fe76321aab8e62e1bbeee5122c5ed +Author: Daniel-Constantin Mierla +Date: Wed Jun 3 14:49:01 2015 +0200 + + mtree: readme regenerated + +commit 74fadc549929d3dc873ce3b8b1db20559562ab54 +Author: Daniel-Constantin Mierla +Date: Wed Jun 3 14:48:38 2015 +0200 + + mtree: more details about what module does and max prefix size + +commit 18038c2ea3b22cad9099719ecc999266b90e8786 +Author: Mikko Lehto +Date: Wed Jun 3 15:44:52 2015 +0300 + + modules/call_control: fixes clang compile warning + + - warning: expression which evaluates to zero treated as a null pointer constant of type 'void *' [-Wnon-literal-null-conversion] + +commit 47086a4ee0a6ee6a766d7591e91e5663acf31562 +Author: Daniel-Constantin Mierla +Date: Wed Jun 3 14:38:24 2015 +0200 + + mtree: internal prefix max size set to 64 + + - allow for larger prefix values to be used (e.g., case of uuid, ipv6) + - db corresponding field still set to varchar(32) + +commit 8334ecf7f9b26dbc9669ecba8469d073652c63a9 +Author: Mikko Lehto +Date: Wed Jun 3 15:08:55 2015 +0300 + + modules/tls: improve logging on SSL_get_certificate() / SSL_get_peer_certificate() error + +commit adca1a55a22ac048692bc625b12ef7a924f7f0e2 +Merge: 6d9abe1 21dab1e +Author: Daniel-Constantin Mierla +Date: Wed Jun 3 12:06:30 2015 +0200 + + Merge pull request #187 from mslehto/patch-3 + + modules/tm: fix typo in documentation + +commit 21dab1e68b022a48b64c2178da522c03ea2924df +Author: Mikko Lehto +Date: Wed Jun 3 13:01:34 2015 +0300 + + modules/tm: fix typo in documentation + +commit 6d9abe14cf63e8c4683a8753ad6ae417f6f21ff0 +Author: Victor Seva +Date: Wed Jun 3 09:56:06 2015 +0200 + + seas: fix gcc warnings: + + statistics.h:76:20: warning: ‘destroy_seas_stats_table’ declared ‘static’ but never defined [-Wunused-function] + statistics.h:82:19: warning: ‘print_stats_info’ declared ‘static’ but never defined [-Wunused-function] + +commit 498e225bb52323f92040b8f11223059c06d0dacd +Merge: 7a33987 ca8e654 +Author: Daniel-Constantin Mierla +Date: Wed Jun 3 11:48:28 2015 +0200 + + Merge pull request #186 from norox/master + + enum: fix buffer overflow and increase maximum number length + +commit ca8e6540cd2cd31b63b192a5a3da282eb09b6c94 +Author: Stefan Andersson +Date: Wed Jun 3 10:54:25 2015 +0200 + + * Fix for buffer overflow in enum_pv_query_3 for char string[17] where the boundary checks for it in is_e164 uses MAX_NUM_LEN. + * Increased the size of MAX_NUM_LEN to 33 to support the maximum number length of 32, which is what we support here on our ISUP links. + + Bug: The buffer overflow bug can be triggered by calling enum_pv_query with a number that is to long eg. +1234567890123456789 + +commit 7a33987ab4e74266cd0ccecbe14f7196f97a0f05 +Author: Victor Seva +Date: Fri May 22 11:00:15 2015 +0200 + + tls: fix gcc warnings: + + tls_domain.c:507:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] + tls_domain.c:537:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] + tls_domain.c:544:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] + tls_domain.c:576:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] + tls_domain.c:1096:5: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] + tls_domain.c:1104:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] + tls_domain.c:1111:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] + tls_server.c:222:3: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] + tls_server.c:565:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] + tls_server.c:843:5: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] + tls_server.c:877:5: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] + tls_server.c:1231:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] + tls_server.c:1265:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] + +commit 36d26bdd9bb92c0be5d5134855536981cb1d9264 +Author: Carsten Bock +Date: Tue Jun 2 20:20:17 2015 +0200 + + registrar: ptr->sock may not be available, as we received the info on a different channel (e.g. reginfo) (bugfix) + +commit df45ba7a94d1c30f6be4b59acc11677d7257139d +Author: Carsten Bock +Date: Tue Jun 2 20:18:50 2015 +0200 + + pua_reginfo: Add support for custom params as contact parameters (e.g. ) + +commit 6fc4065f56d2d7929494f0e6f3dfcdb80ef0a4ec +Author: Daniel-Constantin Mierla +Date: Tue Jun 2 11:51:35 2015 +0200 + + kex: fix some pkg.stats value for PROC_NOCHLDINIT rank + + - initialization of stats cannot be executed in child_init() for such + case, do it with first rpc request + +commit 422c77fecfaed995f08cc11264a63ee0ff61efba +Author: Daniel-Constantin Mierla +Date: Tue Jun 2 11:12:19 2015 +0200 + + uac: re-enable TM callback when needing to do authentication for uac_req_send() + + - regretion introduced by ebb1594a0 + +commit 0fcbe4eb0fb5037f52e7d8338cff4f88b03a7969 +Author: Camille Oudot +Date: Tue Jun 2 10:24:49 2015 +0200 + + mem: TLSF remove unused function + + this removes one compiler warning from the issue #185 + +commit ebb1594a0d95548673697f1e9553a10c93fc460e +Author: Carsten Bock +Date: Mon Jun 1 17:15:59 2015 +0200 + + uac: Execute event-route [uac:reply], if evroute is set (Bugfix) + +commit 37afdd156d5d49b29f44d26339e7d839f1bb381d +Merge: 32029b1 c1863d7 +Author: Alexandr Dubovikov +Date: Mon Jun 1 11:50:03 2015 +0200 + + Merge pull request #183 from adubovikov/master + + modules/sipcapture: added homer5 functionality + +commit c1863d7dc5d7504a8096e9a31dfc200f5e14dd03 +Author: Alexandr Dubovikov +Date: Mon Jun 1 11:43:21 2015 +0200 + + added homer5 functionality to sipcapture module + +commit 32029b1c6b8ce38f92d930a1e92b24b880f634c0 +Author: Hugh Waite +Date: Fri May 29 15:05:09 2015 +0100 + + app_lua: Remove subversion Id tokens + +commit 192cf785eead68980194e63b06e34bf8f5f861f3 +Author: Hugh Waite +Date: Fri May 29 14:40:53 2015 +0100 + + tm: Ensure all contact attributes are initialised to NULL when serial forking + +commit b41d67670423e9ad0243ccaf78c578363a6f9371 +Author: Hugh Waite +Date: Fri May 29 14:15:49 2015 +0100 + + app_lua: Export registrar.lookup_to_dset to app_lua interface + +commit 09e1a72b9737caeabf59ef170e0db79162ce2a5d +Author: Hugh Waite +Date: Fri May 29 14:12:54 2015 +0100 + + registrar: Export lookup_to_dset with uri to config + +commit 9df922d0e246d5a360333826d8af42ab8ea1f136 +Author: Victor Seva +Date: Fri May 29 12:52:25 2015 +0200 + + snmpstats: fix spelling error + +commit 343a360ad8eb6d4821235aac92f260ca7fd1e803 +Author: Victor Seva +Date: Fri May 29 12:52:07 2015 +0200 + + dmq_usrloc: fix spelling error + +commit fb214f1b75760bbd4b85759ea207971e5cf85c13 +Author: Victor Seva +Date: Fri May 29 12:51:44 2015 +0200 + + janssonrpc-c: fix spelling error + +commit 3843f7381003715e11bd5ab02db3b3ba44c5b6d5 +Author: Victor Seva +Date: Fri May 29 12:51:30 2015 +0200 + + carrierroute: fix spelling error + +commit a2de9d6f3af59951c06d0a12e205e1d5814213a6 +Author: Victor Seva +Date: Fri May 29 12:47:03 2015 +0200 + + uac: fix spelling error + +commit 4d2930c922a89cdb7a59334c2f9e7209793991cf +Author: Victor Seva +Date: Fri May 29 12:46:42 2015 +0200 + + pipelimit: fix spelling error + +commit c0d208466fdc6533d2b5b73a7e2d048ec131456b +Author: Victor Seva +Date: Fri May 29 12:46:24 2015 +0200 + + osp: fix spelling error + +commit 9c70d698b76b42bb57ce3132496f1224779b3a6b +Author: Victor Seva +Date: Fri May 29 12:46:05 2015 +0200 + + msrp: fix spelling error + +commit 447b7f10a7e6259cd560ec1d12d1f63f41458ccb +Author: Victor Seva +Date: Fri May 29 12:45:47 2015 +0200 + + htable: fix spelling error + +commit b365407230bab53fcea633ef8fbd0b92e93f1337 +Author: Victor Seva +Date: Fri May 29 12:45:18 2015 +0200 + + dispatcher: fix spelling error + +commit 65ce2c6e23d200a232ab64cefd26ae29c7471bdd +Author: Victor Seva +Date: Fri May 29 12:44:59 2015 +0200 + + debugger: fix spelling error + +commit fd40efe3c199d3bdb4195011acbb41b8201e517a +Author: Victor Seva +Date: Fri May 29 12:44:00 2015 +0200 + + db_postgres: fix spelling error + +commit 63127b261668e0efdea5b0ddb5f16a03dd9f02bc +Author: Seudin Kasumovic +Date: Thu May 28 18:12:02 2015 +0200 + + erlang: fix build on squeeze and precise + + Check if defined decode of unicode atoms type. + +commit 89382ad9ced840c0e4822cc0c5af6397aa6e1468 +Author: jaybeepee +Date: Thu May 28 17:49:30 2015 +0200 + + modules/ims_registrar_scscf: on save send back contact params in 200OK + - this is required to tell VoLTE phones what capabilities have been accepted by IMS + - TODO: nice to have a black/whitelist + +commit b1d227435e368d37ff0f354a43045ada5d8010a7 +Author: jaybeepee +Date: Thu May 28 17:47:05 2015 +0200 + + modules/ims_registrar_scscf: changed order of locking to be consistently ordered + +commit 55d8344d4fd0e7b7671c871d82768a0798ba3a52 +Author: Carsten Bock +Date: Thu May 28 17:36:58 2015 +0200 + + ims_registrar_scscf: Align ims_registrar_scscf with latest ims_usrloc_scscf + +commit ca2d6314df6163b301a97e8829cb18926bf51e38 +Author: Carsten Bock +Date: Tue May 26 22:22:49 2015 +0200 + + smsops: New module for handling 3GPP SMS over IP + +commit 4e6d2ae0171669a351148f5d199d68d2c3c7c2eb +Author: Richard Fuchs +Date: Thu May 28 10:24:21 2015 -0400 + + rtpengine: regenerate README + +commit 054b501e5571e129adc5c642b3b5d3d4261347e5 +Author: Richard Fuchs +Date: Thu May 28 10:21:16 2015 -0400 + + rtpengine: update docs + +commit ca62f577232aa60c5679224965cde377b61b71ee +Author: Richard Fuchs +Date: Thu May 28 09:54:23 2015 -0400 + + rtpengine: parse delete-delay option as integer, not string + +commit 768054a621005392a1bf7851bab7da731886702e +Author: jaybeepee +Date: Thu May 28 15:48:15 2015 +0200 + + modules/ims_usrloc_scscf: clean up plus some small improvements + - changed from stats to counters + - IMS subscription now referenced and stored in a list (less memory/easier mngmt) + - cleanup around locking and reference counting + +commit a129cc1a5aee03d6a6e846f29763c40122d78c00 +Author: jaybeepee +Date: Thu May 28 15:45:45 2015 +0200 + + Revert "modules/ims_usrloc_scscf: clean up plus some small improvements" + + This reverts commit 21d6237ac620b552656bd5510064cc91823a26a0. + +commit 21d6237ac620b552656bd5510064cc91823a26a0 +Author: jaybeepee +Date: Thu May 28 15:16:43 2015 +0200 + + modules/ims_usrloc_scscf: clean up plus some small improvements + - changed from stats to counters + - IMS subscription now referenced and stored in a list (less memory/easier mngmt) + - cleanup around locking and reference counting + +commit 4033b77bf99b1521df8add14c6abea3c85d225d1 +Author: Hugh Waite +Date: Wed May 27 14:36:56 2015 +0100 + + tm: Load and restore contact attributes when serial forking + + - Add xavp_contact parameter for name of xavp holding attributes from usrloc + - t_load_contacts: Load per branch attributes into contact XAVP + - t_next_contacts/t_next_contact_flow: Restore branch attributes + +commit b4488aa7d743b7f14bc0232beaa69f3591aa1b66 +Author: Hugh Waite +Date: Wed May 27 14:33:06 2015 +0100 + + usrloc: Update documentation concerning xavp_contact parameter + + - Note that tm xavp_contact parameter must match + +commit c1b486d199349efc931975dc90924962e8b2b353 +Author: Hugh Waite +Date: Tue May 26 16:30:23 2015 +0100 + + core: Fix typo in xavp header file + + - Corrected avpx_free to xavp_free + +commit 12098415cda75ed10d4d7c75602630b90ef6afd1 +Author: Hugh Waite +Date: Fri May 22 09:28:52 2015 +0100 + + registrar: Fix insertion of ulattrs xavp into position 0 + + - If the first entry is an XTYPE_NULL entry it is replaced, not pushed down the stack + +commit 3d1e8daefaf51f961f28600c6bd3e597598e9d40 +Author: Victor Seva +Date: Tue May 26 22:48:09 2015 +0200 + + pkg/kamailio/deb: add janssonrpc-c in extra description + +commit da3e31a20b95c86a17c8eb43a1a016b055fb8c9b +Author: Victor Seva +Date: Tue May 26 22:36:37 2015 +0200 + + pkg/kamailio/deb: add erlang package module + +commit 5e59fb4f7e156eb78f821fb170b0d02c77fa1ea9 +Author: Victor Seva +Date: Tue May 26 22:59:43 2015 +0200 + + Makefile.groups: add statsd and rtjson to extra group + +commit 597a5d908b82b3333e05fdbd7c9b7b13261ed039 +Author: Carsten Bock +Date: Tue May 26 22:14:48 2015 +0200 + + ims_usrloc_scscf: More details in Logfile + +commit 402ecbc4724a1d818a3be0ebb9bf523f6865985d +Author: Carsten Bock +Date: Fri May 22 10:45:51 2015 +0200 + + ims_*_scscf: Encapsulated Locking on IMS-Subscriptions, easier to track locking bugs, little cleanup. + +commit b35b800ecc649cc7b5093139897e443eafc3d295 +Author: Victor Seva +Date: Tue May 26 10:20:42 2015 +0200 + + pkg/kamailio/deb: update version to 4.4.0~dev0 + +commit e27802533cee77e71ee2a345af19ddf330266544 +Author: Daniel-Constantin Mierla +Date: Mon May 25 23:54:23 2015 +0200 + + Makefile.defs: version set to 4.4.0-dev0 + + - master branch is open for new features to be part of future major + release, planned to use version number 4.4 + + +===================== 2015-06-10 Version 4.3.0 Released ===================== diff --git a/INSTALL b/INSTALL index 1a56f046fe0..c19f2779669 100644 --- a/INSTALL +++ b/INSTALL @@ -10,14 +10,14 @@ Welcome! This is an amazingly flexible, robust and secure SIP server built on years of experience in several Open Source projects. It's a merge of the SIP Express Router (SER) and the Kamailio (OpenSER) products produced - by a joint development team. + by a joint development team. This memo gives you hints on how to set up the Kamailio quickly. - + You can find a similar tutorial and many more on project's web site: - http://www.kamailio.org/w/documentation/ - http://www.kamailio.org/wiki/ - + Table of Contents ================= @@ -72,7 +72,7 @@ Requirements: - GNU install, BSD install or Solaris install if you want "make install", "make bin", "make sunpkg" to work - libmysqlclient & libz (zlib) if you want MySQL support (the db_mysql module) -- libxml2 if you want to compile the cpl-c (CPL support) or pa (presence) +- libxml2 if you want to compile the cpl-c (CPL support) or pa (presence) modules - libradiusclient-ng (> 5.0) if you need RADIUS support (the auth_radius, group_radius, uri_radius and avp_radius modules) @@ -89,7 +89,7 @@ Requirements: for the management interface (MI) - libperl - libs and devel headers - if you want the perl connector to support perl scripting from your config file (perl module) -- libsnmp9 - libs and devel headers - if you want SNMP client functionality +- libsnmp9 - libs and devel headers - if you want SNMP client functionality (SNMP AgentX subagent) for Kamailio - libldap libs and devel headers v2.1 or greater - if you want LDAP support - libpcre libs and devel headers - if you want to compile the lcr and dialplan @@ -105,7 +105,7 @@ Requirements: OS Notes: FreeBSD/OpenBSD/NetBSD: make sure gmake, bison or yacc & flex are installed. - + FreeBSD 5.4: ------------ If you want to compile all the modules, you will need the following packages: @@ -115,10 +115,10 @@ OS Notes: libpq - expat-1.95.8 (/usr/ports/textproc/expat2) for libexpat - libxml2-2.6.18 (/usr/ports/textproc/libxml2) for libxml2 - - radiusclient-0.4.7 (/usr/ports/net/radiusclient) for libradiusclient-ng + - radiusclient-0.4.7 (/usr/ports/net/radiusclient) for libradiusclient-ng NOTE: you'll need to add radiusclient_ng=4 to the gmake command line if you use the 0.4.* version. - + Compile example (all the modules and SIP server core in a tar.gz): gmake bin radiusclient_ng=4 include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius postgres pa" @@ -127,10 +127,10 @@ OS Notes: - mysql-client-4.0.23 (/usr/ports/databases/mysql) for libmysqlclient - expat-1.95.6 (/usr/ports/textproc/expat) for libexpat - libxml-2.6.16p0 (/usr/ports/textproc/libxml) for libxml2 - - radiusclient-ng-0.5.1 from + - radiusclient-ng-0.5.1 from http://download.berlios.de/radiusclient-ng/radiusclient-ng-0.5.1.tar.gz - (you need to download and install it, since there is no "official" - openbsd port for it) for libradiusclient-ng + (you need to download and install it, since there is no "official" + openbsd port for it) for libradiusclient-ng Compile example (all the modules and SIP server core in a tar.gz): gmake bin include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius pa" @@ -141,7 +141,7 @@ OS Notes: - expat-1.95.8nb2 (/usr/pkgsrc/textproc/expat) for libexpat - libxml2-2.6.19 (/usr/pkgsrc/textproc/libxml2) for libxml2 - radiusclient-ng-0.5.1 (see OpenBSD) - + Compile example (all the modules and SIP server in a tar.gz): gmake bin include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius pa" @@ -152,7 +152,7 @@ OS Notes: install, just make sure it's in the PATH (it's usually in /usr/sbin) and add INSTALL=install either to the environment or to the make command line (e.g.: gmake INSTALL=install all). - + Compile example (all the modules and SIP server in a tar.gz): gmake bin INSTALL=install include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius postgres pa" @@ -175,11 +175,11 @@ OS Notes: -------------------------------------- make sure make, bison, flex, minires and minires-devel (needed for the resolver functions) are installed. - + Only building Kamailio's core and some static modules is supported for now. Stuff known not to work: - IPv6 (cygwin doesn't support it yet) - - TCP (the tcp code heavily depends on file descriptor passing + - TCP (the tcp code heavily depends on file descriptor passing between processes, which is not yet supported by cygwin) - dynamic modules (non statically linked -- not supported because backlinking doesn't work in windows by design) @@ -228,8 +228,8 @@ Build Commands make Compile modules except some explicitly excepted (see below) - make modules - all modules in the modules/ directory - make modules-all or make every-module - all the modules + make modules - all modules in the modules/ directory + make modules-all or make every-module - all the modules * Compile all: make all @@ -288,7 +288,7 @@ are grouped based on Debian packaging rules. For example: Ex. to make a standard installation with MySQL, use: make group_include="standard mysql" all - In addition to group_include (or instead), you can use + In addition to group_include (or instead), you can use include_modules="modA modB" to specify exactly the modules you want to include, ex. make include_modules="mymodule" modules @@ -318,18 +318,18 @@ are grouped based on Debian packaging rules. For example: make mode=debug PROFILE=-pg all - compile only the print module make modules=modules/print modules - - compile by default only the print module, in debuging mode and with + - compile by default only the print module, in debuging mode and with profiling: make cfg modules=modules/print mode=debug PROFILE=-pg make all - change & save the modules list without rebuilding the whole config - (so that already compiled modules won't be re-compiled by + (so that already compiled modules won't be re-compiled by make all/make modules): make modules-cfg include_modules="mysql postgress" - change only the compile/build options, without changing the modules list: make cfg-defs CPU=ultrasparc PROFILE=-pg - - compile by default all the usual modules + mysql and postgres, optimized - for pentium-m and for space (saves both the build options and the module + - compile by default all the usual modules + mysql and postgres, optimized + for pentium-m and for space (saves both the build options and the module list) make cfg include_modules="mysql postgres" CPU=pentium-m CC_EXTRA_OPTS=-Os make all @@ -362,16 +362,16 @@ Make Local Build Config: * make cfg or make config - force config and module list regeneration - Example: + Example: make cfg include_modules=mysql mode=debug All future make invocations will include the mysql module and will build in debug mode - Note: If config.mak doesn't exist (e.g. initial checkout or after a make + Note: If config.mak doesn't exist (e.g. initial checkout or after a make proper) or if Makefile.defs was changed, the config will be re-generated automatically by the first make command. For example: make cfg include_modules=db_mysql; make all - is equivalent to + is equivalent to rm config.mak modules.lst; make include_modules=db_mysql. * make cfg-defs (force config regeneration, but don't touch the module list) @@ -392,7 +392,7 @@ Clean: * make clean - clean the base and modules too * make proper - clean also the dependencies and the config, but not the module list * make distclean - the same as proper - * make maintainer-clean - clean everything, including make's config, saved + * make maintainer-clean - clean everything, including make's config, saved module list, auto generated files, tags, *.dbg a.s.o * make clean-all - clean all the modules in modules/* * make proper-all - like make proper but for all the modules in modules/* @@ -418,7 +418,7 @@ Compile: optional: make cfg * make or gmake on non-Linux systems - * make modules + * make modules or make modules exclude_modules="CVS print" etc. Other Make Targets: @@ -464,9 +464,9 @@ Install: to use this parameter in previous make commands, i.e. make, make modules, or make all. If you fail to do this then Kamailio will look for the default configuration file in a wrong directory, because the directory of the - default configuration file is hardcoded into Kamailio during compile time. - When you use a different prefix parameter when installing then the - directory hard coded in Kamailio and the directory in which the file will be + default configuration file is hardcoded into Kamailio during compile time. + When you use a different prefix parameter when installing then the + directory hard coded in Kamailio and the directory in which the file will be installed by make install will not match. (You can specify exact location of the configuration file using -f parameter of Kamailio). @@ -498,7 +498,7 @@ A) Getting Help check the documentation at the Kamailio web site http://www.kamailio.org to learn how to configure Kamailio for your site. - If the documentation does not resolve your problem you may try contacting + If the documentation does not resolve your problem you may try contacting our user forum by E-mail at sr-users@lists.sip-router.org -- that is the mailing list of the Kamailio community. To participate in the mailing list, please subscribe at the following web address: @@ -506,16 +506,16 @@ A) Getting Help http://lists.sip-router.org/cgi-bin/mailman/listinfo B) Disclaimers - - Note well the default "quick-start" configuration is very simple in order - to be easily installable. It provides minimum features. Particularly, + + Note well the default "quick-start" configuration is very simple in order + to be easily installable. It provides minimum features. Particularly, authentication is by default disabled, which means anyone can register using - any name with the server. (This is on purpose to avoid installation + any name with the server. (This is on purpose to avoid installation dependencies on a database, which is needed for storing user credentials.) C) Quick Start - The following step-by step guide gives you instructions how to install the + The following step-by step guide gives you instructions how to install the SQL-free distribution of Kamailio. If you need persistence and authentication, then you have to install additional database support -- proceed to section D) after you are finished with C). @@ -550,7 +550,7 @@ C) Quick Start gunzip .gz ; pkgadd -d *BSD: pkg_add package_name - + 3) Start the server RPM + gentoo: @@ -566,10 +566,10 @@ C) Quick Start pkg/kamailio/deb/debian/kamailio.init, a.s.o.) You can start Kamailio directly with /usr/local/sbin/kamailio. - + 4) Optionally, watch server's health using the kamctl utility - - to do so, first set the environment variable SIP_DOMAIN to your domain + - to do so, first set the environment variable SIP_DOMAIN to your domain name, e.g., in Bourne shell, call export SIP_DOMAIN="myserver.foobar.com" - if you are using other than 'localhost' mysql server for maintaining @@ -583,7 +583,7 @@ C) Quick Start 5) Connect SIP phones - Register with the server using your favorite SIP User Agent (phone). + Register with the server using your favorite SIP User Agent (phone). In most cases, you need to set the following options: @@ -596,10 +596,10 @@ C) Quick Start D) Kamailio With Persistent Data Storage ------------------------------------------ - The default configuration is very simple and features many simplifications. - In particular, it does not authenticate users and loses User Location database - on reboot. To provide persistence, keep user credentials and remember users' - locations across reboots, Kamailio can be configured to use a database, like MySQL. + The default configuration is very simple and features many simplifications. + In particular, it does not authenticate users and loses User Location database + on reboot. To provide persistence, keep user credentials and remember users' + locations across reboots, Kamailio can be configured to use a database, like MySQL. Before you proceed, you need to make sure MySQL is installed on your box. Your MySQL server must be configured to deal with a large number of @@ -609,10 +609,10 @@ D) Kamailio With Persistent Data Storage set-variable = max_connections=500 1) Download the package containin mysql support for Kamailio from the links - you find on: + you find on: http://www.kamailio.org/wiki/ - (rpm and deb provided, most of the binary tar.gz distributions and the + (rpm and deb provided, most of the binary tar.gz distributions and the solaris package include it; if it is not present you'll have to rebuild from the source). For gentoo please include 'mysql' to your USE variable in /etc/make.conf @@ -627,9 +627,9 @@ D) Kamailio With Persistent Data Storage (if do not want to put 'mysql' into your USE variable you can type: USE="mysql" emerge kamailio) - 3) create MySQL tables for Kamailio + 3) create MySQL tables for Kamailio - if you have a previously installed Kamailio on your system, use - /usr/local/sbin/kamdbctl reinstall + /usr/local/sbin/kamdbctl reinstall to convert your Kamailio database into new structures - otherwise, if this is your very first installation, use /usr/local/sbin/kamdbctl create @@ -645,16 +645,16 @@ D) Kamailio With Persistent Data Storage - modparam("auth", "calculate_ha1", yes) - modparam("auth_db", "password_column", "password") - if (!www_authorize("sip-router.org", "subscriber")) { - www_challenge("sip-router.org", "0"); + www_challenge("sip-router.org", "0"); break; } - 5) be sure to replace realm, the first parameter in www_* actions, - with name of your server; some broken UAC implementations don't + 5) be sure to replace realm, the first parameter in www_* actions, + with name of your server; some broken UAC implementations don't authenticate otherwise; the authentication command in your configuration script should look then like this: if (!www_authorize("myserver.foobar.com", "subscriber")) { - www_challenge("myserver.foobar.com", "0"); + www_challenge("myserver.foobar.com", "0"); break; } @@ -662,25 +662,25 @@ D) Kamailio With Persistent Data Storage /etc/init.d/kamailio restart - 7) you can now start managing the server using the kamctl utility; - you need to first set the environment variable SIP_DOMAIN to your + 7) you can now start managing the server using the kamctl utility; + you need to first set the environment variable SIP_DOMAIN to your local SIP realm, e.g., export SIP_DOMAIN="myserver.foobar.com" a) watch the server status using 'kamctl moni' b) try to login with your SIP client as user 'admin' with password 'heslo' - c) try adding new users using + c) try adding new users using 'kamctl add ' 4. Troubleshooting ------------------ -Q: SIP requests are replied by Kamailio with "483 Too Many Hops" or +Q: SIP requests are replied by Kamailio with "483 Too Many Hops" or "513 Message Too Large" -A: In both cases, the reason is probably an error in request routing script - which caused an infinite loop. You can easily verify whether this happens +A: In both cases, the reason is probably an error in request routing script + which caused an infinite loop. You can easily verify whether this happens by watching SIP traffic on loopback interface. A typical reason for misrouting is a failure to match local domain correctly. If a server fails to recognize a request for itself, it will try to forward it to diff --git a/Makefile.defs b/Makefile.defs index efd91d67a17..c6388005504 100644 --- a/Makefile.defs +++ b/Makefile.defs @@ -27,7 +27,7 @@ endif # verbose else ifeq (,$(main_makefile)) -# hack to automatically use config.mak in all the modules, without +# hack to automatically use config.mak in all the modules, without # changing the current module makefiles (which all include Makefile.defs): # if not called from the main makefile (module, lib or ut): # include config.mak, but if not present or incomplete (makefile_defs!=1) @@ -89,6 +89,11 @@ endif WITHAS ?= 1 # enable core hooks for SCTP SCTP ?= 1 +# enable raw sockets +RAW_SOCKS ?= yes +ifeq ($(RAW_SOCKS),1) + RAW_SOCKS = yes +endif # what to install INSTALL_FLAVOUR=$(FLAVOUR) @@ -96,8 +101,8 @@ INSTALL_FLAVOUR=$(FLAVOUR) # version number VERSION = 4 PATCHLEVEL = 4 -SUBLEVEL = 0 -EXTRAVERSION = -pre3 +SUBLEVEL = 4 +EXTRAVERSION = # memory manager switcher # 0 - f_malloc (fast malloc) @@ -113,7 +118,7 @@ SER_VER = $(shell expr $(VERSION) \* 1000000 + $(PATCHLEVEL) \* 1000 + \ $(SUBLEVEL) ) RELEASE:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) OS := $(shell uname -s | sed -e s/SunOS/solaris/ -e s/CYGWIN.*/cygwin/ \ - | tr "[A-Z]" "[a-z]") + | tr "[A-Z]" "[a-z]" | tr "/" "_") ifeq ($(OS),solaris) GETARCH=isainfo -n @@ -150,7 +155,7 @@ OSREL_N:= $(shell echo $(OSREL) | sed -e 's/^[^0-9]*//' \ # TLS support -CORE_TLS ?= +CORE_TLS ?= # by default compile with tls hooks support (so that no ser recompile is # needed before the tls module can be used) TLS_HOOKS=1 @@ -177,7 +182,7 @@ INSTALL ?= install TAR ?= tar endif -INSTALL_TOUCH = touch # used to create the file first (good to +INSTALL_TOUCH = touch # used to create the file first (good to # make solaris install work) INSTALL_CFG = $(INSTALL) -m 644 INSTALL_BIN = $(INSTALL) -m 755 @@ -221,8 +226,8 @@ ifneq (,$(findstring gcc, $(CC_LONGVER))) # CC_VER:=$(word 1,$(CC)) $(shell $(CC) - --version|head -n 1|cut -d" " -f 3\ # |sed -e 's/^.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/'\ # -e 's/^[^0-9].*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/') - # sed with POSIX.1 regex doesn't support |, + or ? - # (darwin, solaris ...) => this complicated expression + # sed with POSIX.1 regex doesn't support |, + or ? + # (darwin, solaris ...) => this complicated expression MKDEP=$(CC) -MM -MG #transform gcc version into 2.9x or 3.0 CC_SHORTVER:=$(shell echo "$(CC_VER)" | cut -d" " -f 2| \ @@ -239,8 +244,10 @@ ifneq (,$(findstring gcc, $(CC_LONGVER))) -e 's/4\.[5-9]\..*/4.5+/' \ -e 's/4\.[5-9]$$/4.5+/' \ -e 's/5\.[0-9]\..*/5.0+/' \ - -e 's/5\.[0-9]$$/5.0+/') -ifeq (,$(strip $(filter-out 3.0 3.4 4.x 4.2+ 4.5+ 5.0+,$(CC_SHORTVER)))) + -e 's/5\.[0-9]$$/5.0+/' \ + -e 's/6\.[0-9]\..*/6.0+/' \ + -e 's/6\.[0-9]$$/6.0+/') +ifeq (,$(strip $(filter-out 3.0 3.4 4.x 4.2+ 4.5+ 5.0+ 6.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 @@ -251,7 +258,8 @@ ifneq (, $(findstring Sun, $(CC_LONGVER))) CC_SHORTVER:=$(shell echo "$(CC_LONGVER)"|head -n 1| \ sed -e 's/.*\([0-9]\.[0-9]\).*/\1/g' ) CC_VER=$(CC) $(CC_SHORTVER) - MKDEP=$(CC) -xM1 + MKDEP=$(CC) -xM1 + CC_MKDEP_OPTS=-xMMD endif ifneq (, $(findstring Intel(R) C++ Compiler, $(CC_LONGVER))) @@ -261,7 +269,7 @@ ifneq (, $(findstring Intel(R) C++ Compiler, $(CC_LONGVER))) sed -e 's/.*Version \([0-9]\.[0-9]\.[0-9]*\).*/\1/g' ) CC_SHORTVER:=$(shell echo "$(CC_FULLVER)" | cut -d. -f1,2 ) CC_VER=$(CC) $(CC_FULLVER) - MKDEP=$(CC) -MM + MKDEP=$(CC) -MM endif ifneq (, $(findstring clang, $(CC_LONGVER))) @@ -271,7 +279,7 @@ ifneq (, $(findstring clang, $(CC_LONGVER))) CC_SHORTVER:=$(shell echo "$(CC_FULLVER)" | cut -d. -f1,2 ) CC_VER=$(CC) $(CC_FULLVER) CC_OPT=-O3 - MKDEP=$(CC) -MM + MKDEP=$(CC) -MM endif ifeq (,$(CC_NAME)) @@ -279,7 +287,7 @@ ifeq (,$(CC_NAME)) CC_NAME=$(CC) CC_SHORTVER=unknown CC_VER=unknown - MKDEP=gcc -MM + MKDEP=gcc -MM $(warning Unknown compiler $(CC)\; supported compilers: \ gcc, sun cc, intel icc ) endif @@ -392,6 +400,13 @@ ifeq ($(OS), linux) LOCALBASE ?= /usr/local endif +ifeq ($(OS), gnu_kfreebsd) + doc_dir = share/doc/$(MAIN_NAME)/ + man_dir = share/man/ + data_dir = share/$(MAIN_NAME)/ + LOCALBASE ?= /usr/local +endif + ifeq ($(OS), freebsd) doc_dir = share/doc/$(MAIN_NAME)/ man_dir = man/ @@ -511,8 +526,8 @@ data_target = $(prefix)/$(data_dir) # an implemetation of the "two levels segregated fit" malloc algorithm # -DDL_MALLOC # a malloc implementation based on Doug Lea's dl_malloc -# -DSF_MALLOC -# an experimental multi-CPU, pool based, multi-process safe version of +# -DSF_MALLOC +# an experimental multi-CPU, pool based, multi-process safe version of # F_MALLOC. Should give better performance on machines with lots of CPUs # after some tunning. # -DLL_MALLOC @@ -528,7 +543,7 @@ data_target = $(prefix)/$(data_dir) # -DUSE_SYSV_SEM # uses sys v sems for locking (slower & limited number) # -DUSE_PTHREAD_MUTEX -# uses pthread mutexes, faster than sys v or posix sems, but do not +# uses pthread mutexes, faster than sys v or posix sems, but do not # work on all systems inter-processes (e.g. linux) # -DUSE_POSIX_SEM # uses posix semaphores for locking (faster than sys v) @@ -540,7 +555,7 @@ data_target = $(prefix)/$(data_dir) # try busy waiting for a while and if the lock is still held go to # force reschedule (FAST_LOCK) # -DADAPTIVE_WAIT_LOOPS=number -# number of loops we busy wait, after "number" loops have elapsed we +# number of loops we busy wait, after "number" loops have elapsed we # force a reschedule (FAST_LOCK) # -DNOSMP # don't use smp compliant locking (faster but won't work on SMP machines) @@ -554,26 +569,26 @@ data_target = $(prefix)/$(data_dir) # -DDISABLE_NAGLE # disable the tcp Nagle algorithm (lower delay) # -DUSE_TLS -# compiles in tls support, requires -DUSE_TCP. Note: this is only +# compiles in tls support, requires -DUSE_TCP. Note: this is only # generic support (parsing a.s.o.), it does not include the actual # "tls engine". If you really want tls you need also either # -DCORE_TLS and a tls/ subdir with the tls code or -DTLS_HOOKS and # the tls module loaded. # -DCORE_TLS -# compiles tls in-core support. Requires -DUSE_TLS, conflicts +# compiles tls in-core support. Requires -DUSE_TLS, conflicts # -DTLS_HOOKS. Please use make CORE_TLS=1 instead (it will set all the # needed defines automatically and extra libraries needed for linking). # -DTLS_HOOKS # compile tls module support (support for having the "tls engine" in a # module). Requires -DUSE_TLS, conflicts -DCORE_TLS. # Please use make TLS_HOOKS=1 (or TLS_HOOKS=0 to for disabling) instead -# of setting -DTLS_HOOKS (it will set all the needed defines +# of setting -DTLS_HOOKS (it will set all the needed defines # automatically) # -DHAVE_RESOLV_RES # support for changing some of the resolver parameters present # (_res structure in ) # -DUSE_COMP -# compiles in comp=[sergz|sigcomp] support (parsing uri & via, +# compiles in comp=[sergz|sigcomp] support (parsing uri & via, # adding it to via, lumps a.s.o). WARNING: right now this option # is useless since the compression code doesn't exist yet. # -DHONOR_MADDR @@ -596,7 +611,7 @@ data_target = $(prefix)/$(data_dir) # if enabled profiling will be enabled for child processes # Don't forget to set PROFILE (see below) # -DNO_SIG_DEBUG -# turns off debugging messages in signal handlers (which might be +# turns off debugging messages in signal handlers (which might be # unsafe) # -DUSE_NAPTR # turns on naptr support (but must be also enabled from the config) @@ -660,10 +675,11 @@ C_DEFS= $(extra_defs) \ # you may also want to set -DPROFILING # WARNING: do not add mode=debug or mode=release anymore in the Makefile, -# use make mode=debug all instead. Anyway no by default ser is compiled w/ +# use make mode=debug all instead. Anyway no by default ser is compiled w/ # debugging symbols in all cases (-g). --andrei # memory managers and related debug mode +C_DEFS+= -DMEM_JOIN_FREE # enable f_malloc C_DEFS+= -DF_MALLOC # enable q_malloc @@ -729,7 +745,7 @@ ifeq ($(CC_NAME), gcc) else echo "as" ; \ fi\ fi) - + LDTYPE:=$(shell if $(LDPATH) -V 1>/dev/null 2>/dev/null; then \ if $(LDPATH) -V 2>&1|grep GNU >/dev/null; \ then echo gnu; \ @@ -818,7 +834,7 @@ ifeq ($(ARCH), alpha) endif ifeq ($(use_fast_lock), yes) - C_DEFS+= -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 + C_DEFS+= -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 found_lock_method=yes endif @@ -829,13 +845,13 @@ C_INCLUDES= ifeq ($(mode), release) #if i386 ifeq ($(ARCH), i386) - # if gcc -ifeq ($(CC_NAME), gcc) + # if gcc +ifeq ($(CC_NAME), gcc) C_DEFS+=-DCC_GCC_LIKE_ASM #common stuff CFLAGS=-g $(CC_OPT) -funroll-loops -Wcast-align $(PROFILE) - #if gcc 5.0+, 4.5+ or 4.2+ -ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER)))) + #if gcc 6.0+, 5.0+, 4.5+ or 4.2+ +ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+,$(CC_SHORTVER)))) $(call set_if_empty,CPUTYPE,athlon64) CFLAGS+=-m32 -minline-all-stringops \ -falign-loops \ @@ -850,7 +866,7 @@ $(call set_if_empty,CPUTYPE,athlon64) CFLAGS+=-m32 -minline-all-stringops \ -falign-loops \ -ftree-vectorize \ - -mtune=$(CPUTYPE) + -mtune=$(CPUTYPE) LDFLAGS+=-m32 else #if gcc 3.4+ @@ -858,7 +874,7 @@ ifeq ($(CC_SHORTVER), 3.4) $(call set_if_empty,CPUTYPE,athlon) CFLAGS+=-m32 -minline-all-stringops \ -falign-loops \ - -mtune=$(CPUTYPE) + -mtune=$(CPUTYPE) LDFLAGS+=-m32 else #if gcc 3.0+ @@ -872,7 +888,7 @@ else ifeq ($(CC_SHORTVER), 2.9x) #older gcc version (2.9[1-5]) $(warning Old gcc detected ($(CC_SHORTVER)), use gcc >= 3.1 \ for better results) - + CFLAGS+=-m486 \ -malign-loops=4 else @@ -884,7 +900,7 @@ endif # CC_SHORTVER, 2.9x endif # CC_SHORTVER, 3.0 endif # CC_SHORTVER, 3.4 endif # CC_SHORTVER, 4.x -endif # CC_SHORTVER, 5.0+, 4.5+ or 4.2+ +endif # CC_SHORTVER, 6.0+, 5.0+, 4.5+ or 4.2+ else # CC_NAME, gcc ifeq ($(CC_NAME), clang) @@ -896,7 +912,7 @@ else # CC_NAME, clang ifeq ($(CC_NAME), icc) C_DEFS+=-DCC_GCC_LIKE_ASM CFLAGS=-g -O3 -ipo -ipo_obj -unroll $(PROFILE) \ - -tpp6 -xK #-openmp #optimize for PIII + -tpp6 -xK #-openmp #optimize for PIII # -prefetch doesn't seem to work #( ty to inline acroos files, unroll loops,prefetch, # optimize for PIII, use PIII instructions & vect., @@ -911,14 +927,14 @@ endif #ARCH, i386 #x86_64 ifeq ($(ARCH), x86_64) - # if gcc + # if gcc ifeq ($(CC_NAME), gcc) C_DEFS+=-DCC_GCC_LIKE_ASM #common stuff CFLAGS=-g $(CC_OPT) -funroll-loops -Wcast-align $(PROFILE) #if gcc 4.5+ # don't add '-mtune=$(CPUTYPE)' - gcc failure -ifeq ($(CC_SHORTVER),$(filter $(CC_SHORTVER),4.5+ 5.0+)) +ifeq ($(CC_SHORTVER),$(filter $(CC_SHORTVER),4.5+ 5.0+ 6.0+)) $(call set_if_empty,CPUTYPE,opteron) CFLAGS+=-m64 -minline-all-stringops \ -falign-loops \ @@ -942,21 +958,21 @@ $(call set_if_empty,CPUTYPE,opteron) CFLAGS+=-m64 -minline-all-stringops \ -falign-loops \ -ftree-vectorize \ - -mtune=$(CPUTYPE) + -mtune=$(CPUTYPE) LDFLAGS+=-m64 else #if gcc 3.4 ifeq ($(CC_SHORTVER), 3.4) $(call set_if_empty,CPUTYPE,athlon64) CFLAGS+=-m64 -minline-all-stringops \ - -falign-loops + -falign-loops LDFLAGS+=-m64 else #if gcc 3.0 ifeq ($(CC_SHORTVER), 3.0) $(call set_if_empty,CPUTYPE,athlon64) CFLAGS+=-minline-all-stringops \ - -falign-loops + -falign-loops #-mcpu=$(CPUTYPE) \ # not working on all x86_64 gccs #-mcpu=athlon #-m64 on x86_64/x86 works starting with gcc 3.2 @@ -964,7 +980,7 @@ else ifeq ($(CC_SHORTVER), 2.9x) #older gcc version (2.9[1-5]) $(warning Old gcc detected ($(CC_SHORTVER)), use gcc >= 3.1 \ for better results) - + CFLAGS+=-m486 \ -malign-loops=4 else @@ -977,20 +993,20 @@ endif # CC_SHORTVER, 3.0 endif # CC_SHORTVER, 3.4 endif # CC_SHORTVER, 4.x endif # CC_SHORTVER, 4.2+ -endif # CC_SHORTVER, 5.0+, 4.5+ +endif # CC_SHORTVER, 6.0+, 5.0+, 4.5+ else # CC_NAME, gcc ifeq ($(CC_NAME), clang) $(call set_if_empty,CPUTYPE,opteron) C_DEFS+=-DCC_GCC_LIKE_ASM CFLAGS+=-g -m64 \ - $(CC_OPT) + $(CC_OPT) LDFLAGS+=-m64 else # CC_NAME, clang ifeq ($(CC_NAME), icc) C_DEFS+=-DCC_GCC_LIKE_ASM CFLAGS=-g -O3 -ipo -ipo_obj -unroll $(PROFILE) \ - -tpp6 -xK #-openmp #optimize for PIII + -tpp6 -xK #-openmp #optimize for PIII # -prefetch doesn't seem to work #( ty to inline acroos files, unroll loops,prefetch, # optimize for PIII, use PIII instructions & vect., @@ -1011,9 +1027,9 @@ ifeq ($(CC_NAME), gcc) #common stuff CFLAGS=-g $(CC_OPT) -funroll-loops $(PROFILE) \ #-Wcast-align \ - #-Wmissing-prototypes - #if gcc 5.0+, 4.5+ or 4.2+ -ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER)))) + #-Wmissing-prototypes + #if gcc 6.0+, 5.0+, 4.5+ or 4.2+ +ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+,$(CC_SHORTVER)))) $(call set_if_empty,CPUTYPE,ultrasparc) #use 32bit for now CFLAGS+=-m64 -mcpu=ultrasparc \ @@ -1059,33 +1075,36 @@ $(warning Old gcc detected ($(CC_SHORTVER)), use gcc >= 3.1 \ ifneq ($(OS), netbsd) # on netbsd/sparc64, gcc 2.95.3 does not compile # ser with -mv8 - CFLAGS+= -mv9 + CFLAGS+= -mv9 # -m64/-m32 on sparc works starting with gcc 3.0 endif ifeq ($(ASTYPE), solaris) CFLAGS+= -Wa,-xarch=v8plus -endif +endif else #CC_SHORTVER, 2.9x #really old version $(warning You are using an old and unsupported gcc \ version ($(CC_SHORTVER)), compile at your own risk!) - - CFLAGS+= -mv9 + + CFLAGS+= -mv9 ifeq ($(ASTYPE), solaris) CFLAGS+= -Wa,-xarch=v8plus -endif - +endif + endif #CC_SHORTVER, 2.9x endif #CC_SHORTVER, 3.0 endif #CC_SHORTVER, 3.4 endif #CC_SHORTVER, 4.x -endif #CC_SHORTVER, 5.0+, 4.5+ or 4.2+ - +endif #CC_SHORTVER, 6.0+, 5.0+, 4.5+ or 4.2+ + else #CC_NAME, gcc ifeq ($(CC_NAME), suncc) + C_DEFS+=-DCC_GCC_LIKE_ASM C_DEFS+=-DSPARC64_MODE - CFLAGS+= -m64 -g -xO5 -fast -native -xarch=v9 -xCC \ + CFLAGS+= -m64 -g -xO3 -xtarget=native -xmemalign=8i \ + -fma=fused -fns=yes \ -xc99 # C99 support + LDFLAGS+=-m64 # -Dinline="" # add this if cc < 5.3 (define inline as null) else #other compilers @@ -1102,9 +1121,9 @@ ifeq ($(CC_NAME), gcc) #common stuff CFLAGS=-g $(CC_OPT) -funroll-loops $(PROFILE) \ #-Wcast-align \ - #-Wmissing-prototypes + #-Wmissing-prototypes #if gcc 5.0+, 4.5+ or 4.2+ -ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER)))) +ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+,$(CC_SHORTVER)))) $(call set_if_empty,CPUTYPE,v8) #use 32bit for now CFLAGS+= -mtune=$(CPUTYPE) \ @@ -1140,16 +1159,18 @@ else #CC_SHORTVER, 2.9x #really old version $(warning You are using an old and unsupported gcc \ version ($(CC_SHORTVER)), compile at your own risk!) - + endif #CC_SHORTVER, 2.9x endif #CC_SHORTVER, 3.0 endif #CC_SHORTVER, 3.4 endif #CC_SHORTVER, 4.x -endif #CC_SHORTVER, 5.0+, 4.5+ or 4.2+ - +endif #CC_SHORTVER, 6.0+, 5.0+, 4.5+ or 4.2+ + else #CC_NAME, gcc ifeq ($(CC_NAME), suncc) - CFLAGS+= -g -xO5 -fast -native -xCC \ + C_DEFS+=-DCC_GCC_LIKE_ASM + CFLAGS+= -g -xO3 -xtarget=native -xmemalign=4i \ + -fma=fused -fns=yes \ -xc99 # C99 support # -Dinline="" # add this if cc < 5.3 (define inline as null) else @@ -1161,20 +1182,20 @@ endif #ARCH, sparc #if ipaq/netwinder ifeq ($(ARCH), arm) - # if gcc + # if gcc ifeq ($(CC_NAME), gcc) C_DEFS+=-DCC_GCC_LIKE_ASM #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+,$(CC_SHORTVER)))) +ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+,$(CC_SHORTVER)))) CFLAGS+= -ftree-vectorize -fno-strict-overflow - # not supported on arm: -minline-all-stringops + # not supported on arm: -minline-all-stringops else #if gcc 4.x+ ifeq ($(CC_SHORTVER), 4.x) CFLAGS+= -ftree-vectorize - # not supported on arm: -minline-all-stringops + # not supported on arm: -minline-all-stringops else #if gcc 3.4+ ifeq ($(CC_SHORTVER), 3.4) @@ -1182,41 +1203,41 @@ ifeq ($(CC_SHORTVER), 3.4) else #if gcc 3.0 ifeq ($(CC_SHORTVER), 3.0) - CFLAGS+= + CFLAGS+= #-mcpu=athlon else ifeq ($(CC_SHORTVER), 2.9x) #older gcc version (2.9[1-5]) $(warning Old gcc detected ($(CC_SHORTVER)), use gcc 3.0.x \ for better results) - + CFLAGS+= else #really old version $(warning You are using an old and unsupported gcc \ version ($(CC_SHORTVER)), compile at your own risk!) - + endif # CC_SHORTVER, 2.9x endif # CC_SHORTVER, 3.0 endif # CC_SHORTVER, 3.4 endif # CC_SHORTVER, 4.x -endif # CC_SHORTVER, 5.0+, 4.5+ or 4.2+ - +endif # CC_SHORTVER, 6.0+, 5.0+, 4.5+ or 4.2+ + else # CC_NAME, gcc #other compilers $(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) endif #CC_NAME, gcc -endif #ARCH, arm +endif #ARCH, arm - #if armv6 cpu + #if armv6 cpu ifeq ($(ARCH), arm6) - # if gcc + # if gcc ifeq ($(CC_NAME), gcc) C_DEFS+=-DCC_GCC_LIKE_ASM #common stuff CFLAGS=-march=armv6 $(CC_OPT) -funroll-loops -fsigned-char \ $(PROFILE) - #if gcc 5.0+, 4.5+ or 4.2+ -ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER)))) + #if gcc 6.0+, 5.0+, 4.5+ or 4.2+ +ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+,$(CC_SHORTVER)))) CFLAGS+= -ftree-vectorize -fno-strict-overflow else #if gcc 4.x+ @@ -1229,25 +1250,25 @@ ifeq ($(CC_SHORTVER), 3.4) else #if gcc 3.0 ifeq ($(CC_SHORTVER), 3.0) - CFLAGS+= + CFLAGS+= #-mcpu=athlon else ifeq ($(CC_SHORTVER), 2.9x) #older gcc version (2.9[1-5]) $(warning Old gcc detected ($(CC_SHORTVER)), use gcc 3.0.x \ for better results) - + CFLAGS+= else #really old version $(warning You are using an old and unsupported gcc \ version ($(CC_SHORTVER)), compile at your own risk!) - + endif # CC_SHORTVER, 2.9x endif # CC_SHORTVER, 3.0 endif # CC_SHORTVER, 3.4 endif # CC_SHORTVER, 4.x -endif # CC_SHORTVER, 5.0+, 4.5+ or 4.2+ - +endif # CC_SHORTVER, 6.0+, 5.0+, 4.5+ or 4.2+ + else # CC_NAME, gcc #other compilers $(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) @@ -1256,13 +1277,13 @@ endif #ARCH, arm6 #if mips (R3000) ifeq ($(ARCH), mips) - # if gcc + # if gcc ifeq ($(CC_NAME), gcc) C_DEFS+=-DCC_GCC_LIKE_ASM #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+,$(CC_SHORTVER)))) + #if gcc 6.0, 5.0+, 4.5+ or 4.2+ +ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+,$(CC_SHORTVER)))) CFLAGS+=-mfp32 -march=r3000 \ -ftree-vectorize -fno-strict-overflow # not supported on mips: -minline-all-stringops @@ -1284,19 +1305,19 @@ else ifeq ($(CC_SHORTVER), 2.9x) #older gcc version (2.9[1-5]) $(warning Old gcc detected ($(CC_SHORTVER)), use gcc 3.0.x \ for better results) - + CFLAGS+=-march=r3000 else #really old version $(warning You are using an old and unsupported gcc \ version ($(CC_SHORTVER)), compile at your own risk!) - + endif # CC_SHORTVER, 2.9x endif # CC_SHORTVER, 3.0 endif # CC_SHORTVER, 3.4 endif # CC_SHORTVER, 4.x -endif # CC_SHORTVER, 5.0+, 4.5+ or 4.2+ - +endif # CC_SHORTVER, 6.0+, 5.0+, 4.5+ or 4.2+ + else # CC_NAME, gcc #other compilers $(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) @@ -1305,13 +1326,13 @@ endif #ARCH, mips #if >=mips2 (R4000, R5000, R6000 ....) ifeq ($(ARCH), mips2) - # if gcc + # if gcc ifeq ($(CC_NAME), gcc) C_DEFS+=-DCC_GCC_LIKE_ASM #common stuff CFLAGS= -mips2 $(CC_OPT) -funroll-loops $(PROFILE) - #if gcc 5.0+, 4.5+ or 4.2+ -ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER)))) + #if gcc 6.0+, 5.0+, 4.5+ or 4.2+ +ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+,$(CC_SHORTVER)))) CFLAGS+=-ftree-vectorize -fno-strict-overflow # not supported on mips: -minline-all-stringops else @@ -1336,13 +1357,13 @@ else #really old version $(warning You are using an old and unsupported gcc \ version ($(CC_SHORTVER)), compile at your own risk!) - + endif # CC_SHORTVER, 2.9x endif # CC_SHORTVER, 3.0 endif # CC_SHORTVER, 3.4 endif # CC_SHORTVER, 4.x -endif # CC_SHORTVER, 5.0+, 4.5+ or 4.2+ - +endif # CC_SHORTVER, 6.0+, 5.0+, 4.5+ or 4.2+ + else # CC_NAME, gcc #other compilers $(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) @@ -1351,13 +1372,13 @@ endif #ARCH, mips2 #if >=mips64 ifeq ($(ARCH), mips64) - # if gcc + # if gcc ifeq ($(CC_NAME), gcc) C_DEFS+=-DCC_GCC_LIKE_ASM #common stuff CFLAGS= -mips64 $(CC_OPT) -funroll-loops $(PROFILE) - #if gcc 5.0+, 4.5+ or 4.2+ -ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER)))) + #if gcc 6.0+, 5.0+, 4.5+ or 4.2+ +ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+,$(CC_SHORTVER)))) CFLAGS+=-ftree-vectorize -fno-strict-overflow # not supported on mips: -minline-all-stringops @@ -1383,13 +1404,13 @@ else #really old version $(warning You are using an old and unsupported gcc \ version ($(CC_SHORTVER)), compile at your own risk!) - + endif # CC_SHORTVER, 2.9x endif # CC_SHORTVER, 3.0 endif # CC_SHORTVER, 3.4 endif # CC_SHORTVER, 4.x -endif # CC_SHORTVER, 5.0+, 4.5+ or 4.2+ - +endif # CC_SHORTVER, 6.0+, 5.0+, 4.5+ or 4.2+ + else # CC_NAME, gcc #other compilers $(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) @@ -1398,19 +1419,19 @@ endif #ARCH, mips64 #if alpha ifeq ($(ARCH), alpha) - # if gcc + # if gcc ifeq ($(CC_NAME), gcc) C_DEFS+=-DCC_GCC_LIKE_ASM #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+,$(CC_SHORTVER)))) +ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+,$(CC_SHORTVER)))) CFLAGS+= -fno-strict-overflow # not supported: -minline-all-stringops else #if gcc 4.0+ ifeq ($(CC_SHORTVER), 4.x) - CFLAGS+= + CFLAGS+= # not supported: -minline-all-stringops else #if gcc 3.4+ @@ -1429,28 +1450,28 @@ else #really old version $(warning You are using an old and unsupported gcc \ version ($(CC_SHORTVER)), compile at your own risk!) - + endif # CC_SHORTVER, 2.9x endif # CC_SHORTVER, 3.0 endif # CC_SHORTVER, 3.4 endif # CC_SHORTVER, 4.x -endif # CC_SHORTVER, 5.0+, 4.5+ or 4.2+ - +endif # CC_SHORTVER, 6.0+, 5.0+, 4.5+ or 4.2+ + else # CC_NAME, gcc #other compilers $(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) endif #CC_NAME, gcc -endif #ARCH, alpha +endif #ARCH, alpha #if ppc ifeq ($(ARCH), ppc) - # if gcc + # if gcc ifeq ($(CC_NAME), gcc) C_DEFS+=-DCC_GCC_LIKE_ASM #common stuff CFLAGS= - #if gcc 5.0+, 4.5+ or 4.2+ -ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER)))) + #if gcc 6.0+, 5.0+, 4.5+ or 4.2+ +ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+,$(CC_SHORTVER)))) $(call set_if_empty,CPUTYPE,powerpc) ifeq ($(NOALTIVEC),) CFLAGS += $(CC_OPT) -funroll-loops -fsigned-char $(PROFILE) @@ -1486,28 +1507,28 @@ else #really old version $(warning You are using an old and unsupported gcc \ version ($(CC_SHORTVER)), compile at your own risk!) - + endif # CC_SHORTVER, 2.9x endif # CC_SHORTVER, 3.0 endif # CC_SHORTVER, 3.4 endif # CC_SHORTVER, 4.x -endif # CC_SHORTVER, 5.0+, 4.5+ or 4.2+ - +endif # CC_SHORTVER, 6.0+, 5.0+, 4.5+ or 4.2+ + else # CC_NAME, gcc #other compilers $(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) endif #CC_NAME, gcc -endif #ARCH, ppc +endif #ARCH, ppc #if ppc64 ifeq ($(ARCH), ppc64) - # if gcc + # if gcc ifeq ($(CC_NAME), gcc) C_DEFS+=-DCC_GCC_LIKE_ASM #common stuff CFLAGS= $(CC_OPT) -funroll-loops -fsigned-char $(PROFILE) - #if gcc 5.0+, 4.5+ or 4.2+ -ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER)))) + #if gcc 6.0+, 5.0+, 4.5+ or 4.2+ +ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+ 6.0+,$(CC_SHORTVER)))) $(call set_if_empty,CPUTYPE,powerpc64) CFLAGS+=-ftree-vectorize \ -fno-strict-overflow \ @@ -1535,18 +1556,18 @@ else #really old version $(warning You are using an old and unsupported gcc \ version ($(CC_SHORTVER)), compile at your own risk!) - + endif # CC_SHORTVER, 2.9x endif # CC_SHORTVER, 3.0 endif # CC_SHORTVER, 3.4 endif # CC_SHORTVER, 4.x -endif # CC_SHORTVER, 5.0+, 4.5+ or 4.2+ - +endif # CC_SHORTVER, 6.0+, 5.0+, 4.5+ or 4.2+ + else # CC_NAME, gcc #other compilers $(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) endif #CC_NAME, gcc -endif #ARCH, ppc +endif #ARCH, ppc CFLAGS+= $(CC_EXTRA_OPTS) @@ -1560,9 +1581,9 @@ ifeq ($(LDTYPE), solaris) LIB_LDFLAGS:=-G $(LDFLAGS) LIB_SONAME=-Wl,-h, LD_RPATH=-Wl,-R, -else +else #gcc and maybe others, => gnu ld - LDFLAGS+=-Wl,-O2 -Wl,-E $(PROFILE) + LDFLAGS+=-Wl,-O2 -Wl,-E $(PROFILE) MOD_LDFLAGS:=-shared $(LDFLAGS) LIB_LDFLAGS:=-shared $(LDFLAGS) LIB_SONAME=-Wl,-soname, @@ -1571,7 +1592,7 @@ endif endif ifeq ($(CC_NAME), icc) #gcc and maybe others - LDFLAGS+=-Wl,-O2 -Wl,-E $(PROFILE) + LDFLAGS+=-Wl,-O2 -Wl,-E $(PROFILE) MOD_LDFLAGS:=-shared $(LDFLAGS) LIB_LDFLAGS:=-shared $(LDFLAGS) LIB_SONAME=-Wl,-soname, @@ -1579,11 +1600,11 @@ ifeq ($(CC_NAME), icc) endif ifeq ($(CC_NAME), suncc) # -dy? - LDFLAGS+=-xO5 $(PROFILE) + LDFLAGS+=-xO3 $(PROFILE) MOD_LDFLAGS:=-G $(LDFLAGS) LIB_LDFLAGS:=-G $(LDFLAGS) - LIB_SONAME="-h " - LD_RPATH=-"-R " + LIB_SONAME=-Wl,-h, + LD_RPATH=-Wl,-R, endif # we need -fPIC -DPIC only for shared objects, we don't need them for # the executable file, because it's always loaded at a fixed address @@ -1591,10 +1612,10 @@ endif ifeq ($(CC_NAME), clang) LDFLAGS+=-Wl,-O2 -Wl,-E $(PROFILE) - MOD_LDFLAGS:=-shared $(LDFLAGS) - LIB_LDFLAGS:=-shared $(LDFLAGS) - LIB_SONAME=-Wl,-soname, - LD_RPATH=-Wl,-rpath, + MOD_LDFLAGS:=-shared $(LDFLAGS) + LIB_LDFLAGS:=-shared $(LDFLAGS) + LIB_SONAME=-Wl,-soname, + LD_RPATH=-Wl,-rpath, endif LDFLAGS+= $(LD_EXTRA_OPTS) @@ -1640,8 +1661,8 @@ ifeq ($(CC_NAME), suncc) LDFLAGS+=-g $(PROFILE) MOD_LDFLAGS:=-G $(LDFLAGS) LIB_LDFLAGS:=-G $(LDFLAGS) - LIB_SONAME="-h " - LD_RPATH=-"-R " + LIB_SONAME=-Wl,-h, + LD_RPATH=-Wl,-R, endif endif #mode=release @@ -1670,9 +1691,8 @@ MOD_CFLAGS=-Kpic $(CFLAGS) LIB_CFLAGS=-Kpic $(CFLAGS) endif ifeq ($(CC_NAME), suncc) -# FIMXE: use -KPIC instead -xcode ? -MOD_CFLAGS=-xcode=pic32 $(CFLAGS) -LIB_CFLAGS=-xcode=pic32 $(CFLAGS) +MOD_CFLAGS=-xcode=pic32 $(CFLAGS) +LIB_CFLAGS=-xcode=pic32 $(CFLAGS) endif ifeq ($(CC_NAME), clang) MOD_CFLAGS=-fPIC -DPIC $(CFLAGS) @@ -1702,7 +1722,10 @@ ifeq ($(OS), linux) use_futex= yes C_DEFS+=-DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD \ -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H \ - -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DUSE_RAW_SOCKS + -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER + ifneq ($(RAW_SOCKS), yes) + C_DEFS+= -DUSE_RAW_SOCKS + endif ifneq ($(found_lock_method), yes) #C_DEFS+= -DUSE_POSIX_SEM C_DEFS+=-DUSE_PTHREAD_MUTEX @@ -1717,8 +1740,8 @@ ifeq ($(OS), linux) LIBS+=-lpthread endif endif - # check for >= 2.5.44 + # check for >= 2.5.44 ifeq ($(shell [ $(OSREL_N) -ge 2005044 ] && echo has_epoll), has_epoll) ifeq ($(NO_EPOLL),) C_DEFS+=-DHAVE_EPOLL @@ -1744,6 +1767,41 @@ ifeq ($(OS), linux) endif endif +ifeq ($(OS), gnu_kfreebsd) +# by default use futexes if available + use_futex= yes + C_DEFS+=-DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD \ + -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H \ + -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER + ifneq ($(RAW_SOCKS), yes) + C_DEFS+= -DUSE_RAW_SOCKS + endif + ifneq ($(found_lock_method), yes) + #C_DEFS+= -DUSE_POSIX_SEM + C_DEFS+=-DUSE_PTHREAD_MUTEX + LIBS+= -lpthread + #C_DEFS+= -DUSE_SYSV_SEM # try posix sems + found_lock_method=yes + else + ifneq (,$(findstring -DUSE_POSIX_SEM, $(C_DEFS))) + LIBS+=-lpthread + endif + ifneq (,$(findstring -DUSE_PTHREAD_MUTEX, $(C_DEFS))) + LIBS+=-lpthread + endif + endif + + # check for ver >= 4.1 + ifeq ($(shell [ $(OSREL_N) -gt 4001 ] && echo has_kqueue), has_kqueue) + ifeq ($(NO_KQUEUE),) + C_DEFS+=-DHAVE_KQUEUE + endif + endif + ifeq ($(NO_SELECT),) + C_DEFS+=-DHAVE_SELECT + endif +endif + ifeq ($(OS), solaris) C_DEFS+= -DHAVE_GETIPNODEBYNAME -DHAVE_SYS_SOCKIO_H -DHAVE_SCHED_YIELD \ -DHAVE_ALLOCA_H -DUSE_SIGACTION @@ -1781,11 +1839,11 @@ ifeq ($(OS), solaris) YACC=yacc ifeq ($(CC_NAME), suncc) - LIBS= -lfast -ldl -lresolv + LIBS= -ldl -lresolv endif OLD_SOLARIS= $(shell echo "$(OSREL)" | \ sed -e 's/^5\.[0-6][^0-9]*$$/yes/' ) - LIBS+= -L$(LOCALBASE)/lib -lxnet -lsocket -lnsl + LIBS+= -L$(LOCALBASE)/lib -lxnet -lsocket -lnsl ifeq ($(OLD_SOLARIS), yes) LIBS+=-lposix4 else @@ -1798,7 +1856,10 @@ ifeq ($(OS), freebsd) C_DEFS+=-DHAVE_SOCKADDR_SA_LEN -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN \ -DHAVE_SCHED_YIELD -DHAVE_MSGHDR_MSG_CONTROL \ -DHAVE_CONNECT_ECONNRESET_BUG -DHAVE_TIMEGM \ - -DHAVE_NETINET_IN_SYSTM -DUSE_RAW_SOCKS + -DHAVE_NETINET_IN_SYSTM + ifneq ($(RAW_SOCKS), yes) + C_DEFS+= -DUSE_RAW_SOCKS + endif ifneq ($(found_lock_method), yes) C_DEFS+= -DUSE_PTHREAD_MUTEX # try pthread sems found_lock_method=yes @@ -1864,7 +1925,7 @@ ifeq ($(OS), openbsd) # unfortunately pthread is needed for sigwait LIBS= -lpthread endif # if opensd - + ifeq ($(OS), netbsd) C_DEFS+=-DHAVE_SOCKADDR_SA_LEN -DHAVE_GETHOSTBYNAME2 \ -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_CONNECT_ECONNRESET_BUG -DHAVE_TIMEGM @@ -1885,7 +1946,7 @@ ifeq ($(OS), netbsd) C_DEFS+=-DHAVE_SELECT endif YACC=yacc - LIBS= + LIBS= endif # OS X support, same as freebsd @@ -1912,7 +1973,7 @@ ifeq ($(OS), darwin) C_DEFS+=-DHAVE_SELECT endif LDFLAGS= # darwin doesn't like -O2 or -E - # the modules uses symbols from ser => either + # the modules uses symbols from ser => either # -flat_namespace -undefined_suppress or -bundle_loader ../../$(MAIN_NAME) MOD_LDFLAGS:= -bundle -flat_namespace -undefined suppress # for libs using symbols from ser (e.g srdb2, kcore a.s.o) we @@ -1976,7 +2037,7 @@ endif # ifeq ($(makefile_defs), 1) # if incomplete or missing config.mak, or already exported vars, don't # try to export/re-export -ifeq ($(makefile_defs),1) +ifeq ($(makefile_defs),1) ifneq ($(exported_vars),1) diff --git a/Makefile.radius b/Makefile.radius index ddbc4af33b1..ac20070ea60 100644 --- a/Makefile.radius +++ b/Makefile.radius @@ -28,7 +28,13 @@ DEFS+= -DUSE_FREERADIUS RADIUSCLIENT_LIB=freeradius-client else +ifeq ($(RADCLI),1) +# - radcli library +DEFS+= -DUSE_RADCLI +RADIUSCLIENT_LIB=radcli + +else # - radiusclient-ng v5 or v4 library ifneq ($(radiusclient_ng), 4) @@ -41,6 +47,7 @@ else DEFS+=-DRADIUSCLIENT_NG_4 RADIUSCLIENT_LIB=radiusclient +endif endif endif diff --git a/Makefile.rules b/Makefile.rules index 1d0407df4fc..2cdffa16ee0 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -270,11 +270,13 @@ clean_doxygen: .PHONY: TAGS -TAGS: - $(MKTAGS) --exclude="obsolete/*" -R . +.PHONY: tags +TAGS tags: + $(MKTAGS) --exclude="obsolete/*" --exclude="test/*" -R . .PHONY: TAGS-ALL -TAGS-ALL: +.PHONY: tags-all +TAGS-ALL tags-all: $(MKTAGS) -R . diff --git a/README b/README index bce8726560e..b23d85f3e48 100644 --- a/README +++ b/README @@ -19,14 +19,14 @@ I. About Kamailio ================= Kamailio is an industrial-strength, free server for realtime communication, -based on the Session Initiation Protocol (SIP RFC3261). +based on the Session Initiation Protocol (SIP RFC3261). It is engineered to power Realtime Communications such as IP telephony and presence infrastructures up to large scale. With embedded support for WebSockets/WebRTC, HTTP, XSRP and XMLrpc as well as Json-rpc it's a modern server, up to date with current standards on IPv4/IPv6 and TLS security. -Kamailio keeps track of users, sets up multimedia sessions, relays instant +Kamailio keeps track of users, sets up multimedia sessions, relays instant messages and creates space for new plug-in applications. Its proven interoperability guarantees seamless integration with components from other vendors, eliminating the risk of a single-vendor trap. Kamailio has @@ -58,7 +58,7 @@ II. Feature List Please visit http://www.kamailio.org/ for the most up-to-date feature list. Note that as features easily are added as modules, changes can occur quickly. -Most of Kamailio's features are implemented as plug-in modules. See +Most of Kamailio's features are implemented as plug-in modules. See our web site for a current list. III. Getting started @@ -73,7 +73,7 @@ The INSTALL document provides more details and guidelines that will help with the installation. Kamailio is composed of a core and additional modules. For each module -there is a README with documentation on how to configure and use the +there is a README with documentation on how to configure and use the module. These are available in each modules source code directory as well as on the kamailio.org web site. @@ -86,7 +86,7 @@ IV. About kamailio.org The Kamailio project has roots in a line of projects starting with SIP Express Router, then OpenSER and now Kamailio. A merge project was started during the fall of 2008 by developers from the OpenSER project, recently renamed to -Kamailio.org and SIP Express Router (SER) from iptel.org. +Kamailio.org and SIP Express Router (SER) from iptel.org. Kamailio is the result of a merge of the code base and years of experience from both developer teams. During the development of the release 4.0, autumn-winter @@ -98,15 +98,16 @@ See http://www.kamailio.org/ for the story of SER, OpenSER and Kamailio. V. Obtaining Help ================= -We offer best-effort free support for Kamailio. "best-effort" means -that we try to solve your problems via email as soon as we can, -subject to available manpower. +We offer best-effort free support for Kamailio. "best-effort" means +that we try to solve your problems via email as soon as we can, +subject to available manpower. -To receive feedback to your inquiries, we recommend you to subscribe -to the sr-users mailing list and post your queries there. This mailing -list is set up for mutual help by the community of Kamailio users and developers. -To participate in the mailing list, subscribe at the following web address: - http://lists.sip-router.org/mailman/listinfo/sr-users +To receive feedback to your inquiries, we recommend you to subscribe +to the sr-users mailing list and post your queries there. This mailing +list is set up for mutual help by the community of Kamailio users and developers. +To participate in the mailing list, subscribe at the following web address: + + http://lists.sip-router.org/mailman/listinfo/sr-users The IRC channel #kamailio on freenode.net is a place where to meet and discuss with other members of Kamailio community. @@ -130,8 +131,9 @@ project on Github: VII. More Information ===================== -Most up-to-date information is always available at our website, - http://www.kamailio.org/ +Most up-to-date information is always available at our website: + + http://www.kamailio.org/ Particularly, it includes: - administrator's guide diff --git a/README.md b/README.md index ac1f5998000..ffba21e1cdc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# Kamailio - The Open Source SIP Server [![Build Status](https://travis-ci.org/kamailio/kamailio.svg?branch=master)](https://travis-ci.org/kamailio/kamailio) +# Kamailio - The Open Source SIP Server + +[![Build Status](https://travis-ci.org/kamailio/kamailio.svg?branch=master)](https://travis-ci.org/kamailio/kamailio) Project Website: diff --git a/action.c b/action.c index bef3ec60c76..6386aaca1b6 100644 --- a/action.c +++ b/action.c @@ -229,7 +229,7 @@ char *get_cfg_crt_name(void) #define MODF_CALL(f_type, h, msg, src, ...) \ do { \ cmd=(src)[0].u.data; \ - ret=((f_type)cmd->function)((msg), __VAR_ARGS__); \ + ret=((f_type)cmd->function)((msg), __VA_ARGS__); \ MODF_HANDLE_RETCODE(h, ret); \ } while (0) #else /* ! __SUNPRO_C (gcc, icc a.s.o) */ @@ -263,7 +263,7 @@ char *get_cfg_crt_name(void) do { \ cmd=(src)[0].u.data; \ MODF_RVE_PARAM_CONVERT(h, msg, cmd, src, dst); \ - ret=((f_type)cmd->function)((msg), __VAR_ARGS__); \ + ret=((f_type)cmd->function)((msg), __VA_ARGS__); \ MODF_HANDLE_RETCODE(h, ret); \ /* free strings allocated by us or fixups */ \ MODF_RVE_PARAM_FREE(cmd, src, dst); \ diff --git a/atomic/atomic_sparc64.h b/atomic/atomic_sparc64.h index 01ce64b7d24..19a4897feaa 100644 --- a/atomic/atomic_sparc64.h +++ b/atomic/atomic_sparc64.h @@ -46,6 +46,9 @@ #define HAVE_ASM_INLINE_MEMBAR +#ifdef __SUNPRO_C +#pragma error_messages (off,E_ASM_UNUSED_PARAM) +#endif /* try to guess if in SPARC64_MODE */ #if ! defined SPARC64_MODE && \ diff --git a/cfg.lex b/cfg.lex index 5aeadf0da4a..e31b5a66817 100644 --- a/cfg.lex +++ b/cfg.lex @@ -352,6 +352,7 @@ MEMDBG "memdbg"|"mem_dbg" MEMSUM "mem_summary" MEMSAFETY "mem_safety" MEMJOIN "mem_join" +MEMSTATUSMODE "mem_status_mode" CORELOG "corelog"|"core_log" SIP_WARNING sip_warning SERVER_SIGNATURE server_signature @@ -495,7 +496,7 @@ COLON ":" STAR \* DOT \. CR \n -EVENT_RT_NAME [a-zA-Z][0-9a-zA-Z-]*(":"[a-zA-Z][0-9a-zA-Z-]*)+ +EVENT_RT_NAME [a-zA-Z][0-9a-zA-Z-]*(":"[a-zA-Z][0-9a-zA-Z_-]*)+ COM_LINE "#"|"//" @@ -765,6 +766,7 @@ IMPORTFILE "import_file" {MEMSUM} { count(); yylval.strval=yytext; return MEMSUM; } {MEMSAFETY} { count(); yylval.strval=yytext; return MEMSAFETY; } {MEMJOIN} { count(); yylval.strval=yytext; return MEMJOIN; } +{MEMSTATUSMODE} { count(); yylval.strval=yytext; return MEMSTATUSMODE; } {CORELOG} { count(); yylval.strval=yytext; return CORELOG; } {SIP_WARNING} { count(); yylval.strval=yytext; return SIP_WARNING; } {USER} { count(); yylval.strval=yytext; return USER; } @@ -1183,9 +1185,9 @@ IMPORTFILE "import_file" {COM_LINE}!{SER_CFG}{CR} { count(); sr_cfg_compat=SR_COMPAT_SER;} -{COM_LINE}!{KAMAILIO_CFG}{CR} { count(); +{COM_LINE}!{KAMAILIO_CFG}{CR} { count(); sr_cfg_compat=SR_COMPAT_KAMAILIO;} -{COM_LINE}!{MAXCOMPAT_CFG}{CR} { count(); +{COM_LINE}!{MAXCOMPAT_CFG}{CR} { count(); sr_cfg_compat=SR_COMPAT_MAX;} {PREP_START}{DEFINE}{EAT_ABLE}+ { count(); pp_define_set_type(0); @@ -1194,6 +1196,12 @@ IMPORTFILE "import_file" state = DEFINE_S; BEGIN(DEFINE_ID); } {PREP_START}{REDEF}{EAT_ABLE}+ { count(); pp_define_set_type(2); state = DEFINE_S; BEGIN(DEFINE_ID); } +{ID}{MINUS} { count(); + LOG(L_CRIT, + "error at %s line %d: '-' not allowed\n", + (finame)?finame:"cfg", line); + exit(-1); + } {ID} { count(); if (pp_define(yyleng, yytext)) return 1; state = DEFINE_EOL_S; BEGIN(DEFINE_EOL); } @@ -1221,6 +1229,12 @@ IMPORTFILE "import_file" {PREP_START}{IFNDEF}{EAT_ABLE}+ { count(); if (pp_ifdef_type(0)) return 1; state = IFDEF_S; BEGIN(IFDEF_ID); } +{ID}{MINUS} { count(); + LOG(L_CRIT, + "error at %s line %d: '-' not allowed\n", + (finame)?finame:"cfg", line); + exit(-1); + } {ID} { count(); pp_ifdef_var(yyleng, yytext); state = IFDEF_EOL_S; BEGIN(IFDEF_EOL); } diff --git a/cfg.y b/cfg.y index aa9b0ca4f99..05f0de5e6ce 100644 --- a/cfg.y +++ b/cfg.y @@ -380,6 +380,7 @@ extern char *default_routename; %token MEMSUM %token MEMSAFETY %token MEMJOIN +%token MEMSTATUSMODE %token CORELOG %token SIP_WARNING %token SERVER_SIGNATURE @@ -901,6 +902,8 @@ assign_stm: | MEMSAFETY EQUAL error { yyerror("int value expected"); } | MEMJOIN EQUAL intno { default_core_cfg.mem_join=$3; } | MEMJOIN EQUAL error { yyerror("int value expected"); } + | MEMSTATUSMODE EQUAL intno { default_core_cfg.mem_status_mode=$3; } + | MEMSTATUSMODE EQUAL error { yyerror("int value expected"); } | CORELOG EQUAL intno { default_core_cfg.corelog=$3; } | CORELOG EQUAL error { yyerror("int value expected"); } | SIP_WARNING EQUAL NUMBER { sip_warning=$3; } diff --git a/cfg/cfg_struct.h b/cfg/cfg_struct.h index 452bb90923d..6436eed6776 100644 --- a/cfg/cfg_struct.h +++ b/cfg/cfg_struct.h @@ -129,6 +129,7 @@ typedef struct _cfg_block { atomic_t refcnt; /*!< reference counter, the block is automatically deleted when it reaches 0 */ + int _pad; /*!< force 8 byte alignment */ unsigned char vars[1]; /*!< blob that contains the values */ } cfg_block_t; diff --git a/cfg_core.c b/cfg_core.c index 98a9c012fc3..73be13c248f 100644 --- a/cfg_core.c +++ b/cfg_core.c @@ -115,6 +115,7 @@ struct cfg_group_core default_core_cfg = { 4 pkg_sums, 8 shm_sums, 16 short_status */ 0, /*!< mem_safety - 0 disabled */ 0, /*!< mem_join - 0 disabled */ + 0, /*!< mem_status_mode - 0 only free fragments, 1 all fragements */ L_ERR, /*!< corelog */ L_ERR, /*!< latency log */ 0, /*!< latency limit db */ @@ -312,6 +313,8 @@ cfg_def_t core_cfg_def[] = { "safety level for memory operations"}, {"mem_join", CFG_VAR_INT|CFG_ATOMIC, 0, 0, 0, 0, "join free memory fragments"}, + {"mem_status_mode", CFG_VAR_INT|CFG_ATOMIC, 0, 0, 0, 0, + "print status for free or all memory fragments"}, {"corelog", CFG_VAR_INT|CFG_ATOMIC, 0, 0, 0, 0, "log level for non-critical core error messages"}, {"latency_log", CFG_VAR_INT|CFG_ATOMIC, 0, 0, 0, 0, diff --git a/cfg_core.h b/cfg_core.h index f7db8d06861..e10ba7b94d9 100644 --- a/cfg_core.h +++ b/cfg_core.h @@ -103,6 +103,7 @@ struct cfg_group_core { int mem_summary; /*!< display memory status/summary info on exit */ int mem_safety; /*!< memory safety control option */ int mem_join; /*!< memory free fragments join option */ + int mem_status_mode; /*!< memory status printed for free/all fragments */ int corelog; /*!< log level for non-critcal core error messages */ int latency_log; /*!< log level for latency limits messages */ int latency_limit_db; /*!< alert limit of running db commands */ diff --git a/config.h b/config.h index 40830999263..66ba0df584b 100644 --- a/config.h +++ b/config.h @@ -90,13 +90,16 @@ #define SERVER_HDR_LEN (sizeof(SERVER_HDR)-1) #define MAX_WARNING_LEN 256 - + #define MY_BRANCH ";branch=" #define MY_BRANCH_LEN (sizeof(MY_BRANCH) - 1) #define MAX_PORT_LEN 7 /* ':' + max 5 letters + \0 */ + #define CRLF "\r\n" #define CRLF_LEN (sizeof(CRLF) - 1) +#define CRLFCRLF "\r\n\r\n" +#define CRLFCRLF_LEN (sizeof(CRLFCRLF) - 1) #define RECEIVED ";received=" #define RECEIVED_LEN (sizeof(RECEIVED) - 1) diff --git a/data_lump.c b/data_lump.c index daab9aa1668..949b03ffaf9 100644 --- a/data_lump.c +++ b/data_lump.c @@ -734,3 +734,123 @@ int remove_lump(sip_msg_t *msg, struct lump *l) } return 0; } + +/** + * + */ +int sr_hdr_add(sip_msg_t *msg, str *sname, str *sbody) +{ + struct lump* anchor; + str h; + + parse_headers(msg, HDR_EOH_F, 0); + if(msg->last_header == 0) { + LM_ERR("failed to parse headers\n"); + return -1; + } + h.len = sname->len + 2 + sbody->len + CRLF_LEN; + h.s = (char*)pkg_malloc(h.len+1); + if(h.s == 0) { + LM_ERR("no more pkg\n"); + return -1; + } + anchor = anchor_lump(msg, msg->last_header->name.s + msg->last_header->len + - msg->buf, 0, 0); + if(anchor == 0) + { + LM_ERR("cannot get the anchor\n"); + pkg_free(h.s); + return -1; + } + memcpy(h.s, sname->s, sname->len); + memcpy(h.s+sname->len, ": ", 2); + memcpy(h.s+sname->len+2, sbody->s, sbody->len); + memcpy(h.s+sname->len+2+sbody->len, CRLF, CRLF_LEN); + h.s[h.len] = '\0'; + if (insert_new_lump_after(anchor, h.s, h.len, 0) == 0) + { + LM_ERR("cannot insert lump\n"); + pkg_free(h.s); + return -1; + } + LM_DBG("added new header (%d) [%s]\n", h.len, h.s); + return 0; +} + +/** + * + */ +int sr_hdr_add_zz(sip_msg_t *msg, char *hname, char *hbody) +{ + str sname; + str sbody; + + sname.s = hname; + sname.len = strlen(sname.s); + sbody.s = hbody; + sbody.len = strlen(sbody.s); + + return sr_hdr_add(msg, &sname, &sbody); +} + +/** + * + */ +int sr_hdr_add_zs(sip_msg_t *msg, char *hname, str *sbody) +{ + str sname; + + sname.s = hname; + sname.len = strlen(sname.s); + + return sr_hdr_add(msg, &sname, sbody); +} + +/** + * + */ +hdr_field_t *sr_hdr_get_z(sip_msg_t *msg, char *hname) +{ + hdr_field_t *hf; + str sname; + + sname.s = hname; + sname.len = strlen(sname.s); + + for (hf=msg->headers; hf; hf=hf->next) { + if (hf->name.len==sname.len + && strncasecmp(hf->name.s, sname.s, + sname.len)==0) { + return hf; + + } + } + return NULL; +} + +/** + * + */ +int sr_hdr_del_z(sip_msg_t *msg, char *hname) +{ + hdr_field_t *hf; + struct lump* l; + str sname; + + sname.s = hname; + sname.len = strlen(sname.s); + + for (hf=msg->headers; hf; hf=hf->next) { + if (hf->name.len==sname.len + && strncasecmp(hf->name.s, sname.s, + sname.len)==0) { + l=del_lump(msg, hf->name.s-msg->buf, hf->len, 0); + if (l==0) { + LM_ERR("unable to delete cookie header\n"); + return -1; + } + return 0; + } + } + return 0; +} diff --git a/data_lump.h b/data_lump.h index 72d664b7a37..ff129c02a55 100644 --- a/data_lump.h +++ b/data_lump.h @@ -86,4 +86,11 @@ void del_nonshm_lump( struct lump** lump_list ); /*! \brief remove the lump from the internal lists */ int remove_lump(sip_msg_t *msg, struct lump *l); + +int sr_hdr_add(sip_msg_t *msg, str *sname, str *sbody); +int sr_hdr_add_zz(sip_msg_t *msg, char *hname, char *hbody); +int sr_hdr_add_zs(sip_msg_t *msg, char *hname, str *sbody); +int sr_hdr_del_z(sip_msg_t *msg, char *hname); +hdr_field_t *sr_hdr_get_z(sip_msg_t *msg, char *hname); + #endif diff --git a/data_lump_rpl.c b/data_lump_rpl.c index 6ce77f8ef1e..6b8ba8d3032 100644 --- a/data_lump_rpl.c +++ b/data_lump_rpl.c @@ -102,9 +102,12 @@ void free_lump_rpl(struct lump_rpl* lump) { if (lump) { if (!((lump->flags)&LUMP_RPL_NOFREE) && ((lump->flags)&LUMP_RPL_NODUP) - && lump->text.s) + && lump->text.s) { pkg_free(lump->text.s); + lump->text.s = 0; + } pkg_free(lump); + lump = 0; } } diff --git a/docbook/entities.xml b/docbook/entities.xml index bf1b95249d8..fd88da4b3ac 100644 --- a/docbook/entities.xml +++ b/docbook/entities.xml @@ -16,7 +16,7 @@ - + diff --git a/dprint.h b/dprint.h index 5f03445fef8..bc114885b53 100644 --- a/dprint.h +++ b/dprint.h @@ -184,11 +184,11 @@ void log_prefix_init(void); #ifdef NO_LOG # ifdef __SUNPRO_C -# define LOG__(facility, level, lname, prefix, fmt, ...) -# define LOG_(facility, level, prefix, fmt, ...) +# define LOG__(facility, level, lname, prefix, ...) +# define LOG_(facility, level, prefix, ...) # define LOG(level, fmt, ...) -# define LOG_FC(facility, level, fmt, ...) -# define LOG_LN(level, lname, fmt, ...) +# define LOG_FC(facility, level, ...) +# define LOG_LN(level, lname, ...) # else # define LOG__(facility, level, lname, prefix, fmt, args...) # define LOG_(facility, level, prefix, fmt, args...) @@ -212,78 +212,78 @@ void log_prefix_init(void); # ifdef __SUNPRO_C # define LOG__(facility, level, lname, prefix, fmt, ...) \ do { \ - if (unlikely(get_debug_level(LOG_MNAME, LOG_MNAME_LEN) >= (level) && \ - DPRINT_NON_CRIT)) { \ + if (get_debug_level(LOG_MNAME, LOG_MNAME_LEN) >= (level) && \ + DPRINT_NON_CRIT) { \ + int __llevel; \ + __llevel = ((level)L_DBG)?L_DBG:level); \ DPRINT_CRIT_ENTER; \ - if (likely(((level) >= L_ALERT) && ((level) <= L_DBG))){ \ - if (unlikely(log_stderr)) { \ - if (unlikely(log_color)) dprint_color(level); \ - fprintf(stderr, "%2d(%d) %s: %s" fmt, \ - process_no, my_pid(), \ - (lname)?(lname):LOG_LEVEL2NAME(level), (prefix), \ - __VA_ARGS__); \ - if (unlikely(log_color)) dprint_color_reset(); \ + if (unlikely(log_stderr)) { \ + if (unlikely(log_color)) dprint_color(__llevel); \ + if(unlikely(log_prefix_val)) { \ + fprintf(stderr, "%.*s%2d(%d) %s: %s" fmt, \ + log_prefix_val->len, log_prefix_val->s, \ + process_no, my_pid(), \ + (lname)?(lname):LOG_LEVEL2NAME(__llevel), \ + (prefix) , __VA_ARGS__);\ } else { \ - syslog(LOG2SYSLOG_LEVEL(level) | \ - (((facility) != DEFAULT_FACILITY) ? \ - (facility) : \ - get_debug_facility(LOG_MNAME, LOG_MNAME_LEN)), \ - "%s: %s" fmt, \ - (lname)?(lname):LOG_LEVEL2NAME(level),\ - (prefix), __VA_ARGS__); \ + fprintf(stderr, "%2d(%d) %s: %s" fmt, \ + process_no, my_pid(), \ + (lname)?(lname):LOG_LEVEL2NAME(__llevel), \ + (prefix) , __VA_ARGS__);\ } \ + if (unlikely(log_color)) dprint_color_reset(); \ } else { \ - if (log_stderr) { \ - if (unlikely(log_color)) dprint_color(level); \ - fprintf(stderr, "%2d(%d) %s" fmt, \ - process_no, my_pid(), \ - (prefix), __VA_ARGS__); \ - if (unlikely(log_color)) dprint_color_reset(); \ + if(unlikely(log_prefix_val)) { \ + _km_log_func(LOG2SYSLOG_LEVEL(__llevel) |\ + (((facility) != DEFAULT_FACILITY) ? \ + (facility) : \ + get_debug_facility(LOG_MNAME, LOG_MNAME_LEN)), \ + "%.*s%s: %s" fmt,\ + log_prefix_val->len, log_prefix_val->s, \ + (lname)?(lname):LOG_LEVEL2NAME(__llevel),\ + (prefix) , __VA_ARGS__); \ } else { \ - if ((level)af); return 0; } - return 0; } diff --git a/lib/binrpc/binrpc_api.c b/lib/binrpc/binrpc_api.c index e67c58924a0..30cc003a979 100644 --- a/lib/binrpc/binrpc_api.c +++ b/lib/binrpc/binrpc_api.c @@ -13,11 +13,11 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ - + /** * send commands using binrpc * @@ -53,7 +53,7 @@ #define binrpc_free internal_free #ifndef UNIX_PATH_MAX -#define UNIX_PATH_MAX 108 +#define UNIX_PATH_MAX 104 #endif #ifndef INT2STR_MAX_LEN @@ -67,7 +67,7 @@ static void (*internal_free)(void* ptr) = free; static char binrpc_last_errs[1024] = ""; static int verbose = 0; -char *binrpc_get_last_errs() +char *binrpc_get_last_errs() { return binrpc_last_errs; } @@ -213,28 +213,29 @@ static int connect_tcpudp_socket(char* address, int port, int type) struct sockaddr_in addr; struct hostent* he; int sock; - + sock=-1; /* resolve destination */ he=gethostbyname(address); if (he==0){ - snprintf(binrpc_last_errs, sizeof(binrpc_last_errs)-1, + snprintf(binrpc_last_errs, sizeof(binrpc_last_errs)-1, "connect_tcpudp_socket: could not resolve %s", address); goto error; } /* open socket*/ + memset(&addr, 0, sizeof(struct sockaddr_in)); addr.sin_family=he->h_addrtype; addr.sin_port=htons(port); memcpy(&addr.sin_addr.s_addr, he->h_addr_list[0], he->h_length); - + sock = socket(he->h_addrtype, type, 0); if (sock==-1){ - snprintf(binrpc_last_errs, sizeof(binrpc_last_errs)-1, + snprintf(binrpc_last_errs, sizeof(binrpc_last_errs)-1, "connect_tcpudp_socket: socket: %s", strerror(errno)); goto error; } if (connect(sock, (struct sockaddr*) &addr, sizeof(struct sockaddr))!=0){ - snprintf(binrpc_last_errs, sizeof(binrpc_last_errs)-1, + snprintf(binrpc_last_errs, sizeof(binrpc_last_errs)-1, "connect_tcpudp_socket: connect: %s", strerror(errno)); goto error; } @@ -246,7 +247,7 @@ static int connect_tcpudp_socket(char* address, int port, int type) /* on exit cleanup */ static void cleanup(struct sockaddr_un* mysun) -{ +{ if (mysun->sun_path[0] != '\0') { if (unlink(mysun->sun_path) < 0) { fprintf(stderr, "ERROR: failed to delete %s: %s\n", @@ -259,7 +260,7 @@ int binrpc_open_connection(struct binrpc_handle* handle, char* name, int port, i char* reply_socket, char* sock_dir) { struct sockaddr_un mysun; - + binrpc_last_errs[0] = '\0'; binrpc_last_errs[sizeof(binrpc_last_errs)-1] = '\0'; /* snprintf safe terminator */ diff --git a/lib/kcore/radius.h b/lib/kcore/radius.h index 58896af8f14..a7a03e4f80f 100644 --- a/lib/kcore/radius.h +++ b/lib/kcore/radius.h @@ -32,9 +32,14 @@ #define _RADIUS_CORE_H #ifndef USE_FREERADIUS - #include - #define DEFAULT_RADIUSCLIENT_CONF \ - "/usr/local/etc/radiusclient-ng/radiusclient.conf" + #ifdef USE_RADCLI + #include + #define DEFAULT_RADIUSCLIENT_CONF "" + #else + #include + #define DEFAULT_RADIUSCLIENT_CONF \ + "/usr/local/etc/radiusclient-ng/radiusclient.conf" + #endif #else #include #define DEFAULT_RADIUSCLIENT_CONF "" diff --git a/lib/srdb1/db_ut.c b/lib/srdb1/db_ut.c index 091c2e9a8b1..e5048b7f9b8 100644 --- a/lib/srdb1/db_ut.c +++ b/lib/srdb1/db_ut.c @@ -14,8 +14,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -41,8 +41,9 @@ #ifndef __OS_solaris #define _XOPEN_SOURCE 600 /* glibc2 on linux, bsd */ #define _BSD_SOURCE 1 /* needed on linux to "fix" the effect - of the above define on - features.h/unistd.h syscall() */ + * of the above define on + * features.h/unistd.h syscall() */ + #define _DEFAULT_SOURCE 1 /* _BSD_SOURCE is deprecated */ #else #define _XOPEN_SOURCE_EXTENDED 1 /* solaris */ #endif @@ -52,8 +53,8 @@ #ifndef __OS_solaris #undef _XOPEN_SOURCE #undef _XOPEN_SOURCE_EXTENDED -#else - #undef _XOPEN_SOURCE_EXTENDED 1 /* solaris */ +#else /* solaris */ + #undef _XOPEN_SOURCE_EXTENDED #endif #include @@ -74,13 +75,13 @@ inline int db_str2int(const char* _s, int* _v) char* p = NULL; if (!_s || !_v) { - LM_ERR("Invalid parameter value\n"); - return -1; + LM_ERR("Invalid parameter value\n"); + return -1; } tmp = strtoul(_s, &p, 10); - if ((tmp == ULONG_MAX && errno == ERANGE) || - (tmp < INT_MIN) || (tmp > UINT_MAX)) { + if ((tmp == ULONG_MAX && errno == ERANGE) || + (tmp < INT_MIN) || (tmp > UINT_MAX)) { LM_ERR("Value out of range\n"); return -1; } @@ -100,8 +101,8 @@ inline int db_str2longlong(const char* _s, long long * _v) char* p = NULL; if (!_s || !_v) { - LM_ERR("Invalid parameter value\n"); - return -1; + LM_ERR("Invalid parameter value\n"); + return -1; } tmp = strtoll(_s, &p, 10); @@ -204,7 +205,7 @@ inline int db_double2str(double _v, char* _s, int* _l) } -/* +/* * Convert a string to time_t */ inline int db_str2time(const char* _s, time_t* _v) @@ -217,7 +218,7 @@ inline int db_str2time(const char* _s, time_t* _v) } /* Convert database time representation to time_t structure - It is necessary to zero tm structure first */ + * It is necessary to zero tm structure first */ memset(&time, '\0', sizeof(struct tm)); if (strptime(_s, "%Y-%m-%d %H:%M:%S", &time) == NULL) { LM_ERR("Error during time conversion\n"); @@ -228,7 +229,7 @@ inline int db_str2time(const char* _s, time_t* _v) * so let mktime to guess it. This eliminates the bug when * contacts reloaded from the database have different time * of expiration by one hour when daylight saving is used - */ + */ time.tm_isdst = -1; *_v = mktime(&time); @@ -236,7 +237,10 @@ inline int db_str2time(const char* _s, time_t* _v) } -inline int db_time2str(time_t _v, char* _s, int* _l) +/** + * + */ +inline int db_time2str_ex(time_t _v, char* _s, int* _l, int _qmode) { struct tm* t; int l; @@ -246,7 +250,7 @@ inline int db_time2str(time_t _v, char* _s, int* _l) return -1; } - *_s++ = '\''; + if(_qmode) *_s++ = '\''; /* Convert time_t structure to format accepted by the database */ t = localtime(&_v); @@ -261,11 +265,20 @@ inline int db_time2str(time_t _v, char* _s, int* _l) } *_l = l; - *(_s + l) = '\''; - *_l = l + 2; + if(_qmode) { + *(_s + l) = '\''; + *_l = l + 2; + } return 0; } +/** + * + */ +inline int db_time2str(time_t _v, char* _s, int* _l) +{ + return db_time2str_ex(_v, _s, _l, 1); +} /* * Print list of columns separated by comma @@ -345,7 +358,7 @@ int db_print_where(const db1_con_t* _c, char* _b, const int _l, const db_key_t* if (_o && strncmp(_o[i], OP_BITWISE_AND, 1) == 0) { char tmp_buf[16]; int tmp_len = 15; - memset(tmp_buf, '0', 16); + memset(tmp_buf, 0, 16); if ((*val2str)(_c, &(_v[i]), tmp_buf, &tmp_len) < 0) { LM_ERR("Error while converting value to string\n"); return -1; @@ -382,7 +395,7 @@ int db_print_where(const db1_con_t* _c, char* _b, const int _l, const db_key_t* } return len; - error: +error: LM_ERR("Error in snprintf\n"); return -1; } @@ -422,7 +435,7 @@ int db_print_set(const db1_con_t* _c, char* _b, const int _l, const db_key_t* _k } return len; - error: +error: LM_ERR("Error in snprintf\n"); return -1; } @@ -484,7 +497,7 @@ int db_val2pv_spec(struct sip_msg* msg, db_val_t *dbval, pv_spec_t *pvs) break; default: LM_NOTICE("unknown field type: %d, setting value to null\n", - dbval->type); + dbval->type); pv.flags = PV_VAL_NULL; } } diff --git a/lib/srdb1/db_ut.h b/lib/srdb1/db_ut.h index 009a190dcb9..fbec35b5cc2 100644 --- a/lib/srdb1/db_ut.h +++ b/lib/srdb1/db_ut.h @@ -14,8 +14,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -113,6 +113,7 @@ int db_double2str(double _v, char* _s, int* _l); */ int db_time2str(time_t _v, char* _s, int* _l); +int db_time2str_ex(time_t _v, char* _s, int* _l, int _qmode); /** * Converts a char into a time_t value. @@ -189,7 +190,7 @@ int db_print_set(const db1_con_t* _c, char* _b, const int _l, /** * Convert db_val_t to pv_spec_t - * + * * \param msg sip msg structure * \param dbval database value * \param pvs pv_spec where to put the database value diff --git a/lib/srdb1/schema/location.xml b/lib/srdb1/schema/location.xml index 07c8d5895f4..c22fcaf9b05 100644 --- a/lib/srdb1/schema/location.xml +++ b/lib/srdb1/schema/location.xml @@ -232,7 +232,6 @@ connection_idx - diff --git a/lib/srdb1/schema/topos_d.xml b/lib/srdb1/schema/topos_d.xml index 5d0de32692d..1f7fd35be2d 100644 --- a/lib/srdb1/schema/topos_d.xml +++ b/lib/srdb1/schema/topos_d.xml @@ -34,6 +34,22 @@ Date and time when this record was written. + + s_method + string + 64 + + Method from SIP message + + + + s_cseq + string + 64 + + CSeq from SIP message + + a_callid string @@ -96,7 +112,7 @@ a_tag string - &user_len; + &callid_len; From tag. @@ -104,7 +120,7 @@ b_tag string - &user_len; + &callid_len; From tag. @@ -112,17 +128,24 @@ a_rr largetext - + Record route - A side b_rr largetext - + Record route - B side + + s_rr + largetext + + Record route - S side + + iflags unsigned int @@ -156,20 +179,36 @@ The R-URI - - a_srcip + + a_srcaddr string - &ip_add_len; + &uri_len; + + Source address - A side + + + + b_srcaddr + string + &uri_len; - Source IP address + Source address - B side - - b_srcip + + a_socket string - &ip_add_len; + &uri_len; + + Socket address - A side + + + + b_socket + string + &uri_len; - Destination IP address + Socket address - B side diff --git a/lib/srdb1/schema/topos_t.xml b/lib/srdb1/schema/topos_t.xml index 787bb3e6708..e3978f09f95 100644 --- a/lib/srdb1/schema/topos_t.xml +++ b/lib/srdb1/schema/topos_t.xml @@ -34,6 +34,22 @@ Date and time when this record was written. + + s_method + string + 64 + + Method from SIP message + + + + s_cseq + string + 64 + + CSeq from SIP message + + a_callid string @@ -72,7 +88,7 @@ x_via largetext - + Via stack - A or B side @@ -88,8 +104,22 @@ x_rr largetext - - RR stack - A or B side + + RR stack - incoming A or B side + + + + y_rr + largetext + + RR stack - the other A or B side + + + + s_rr + largetext + + RR stack - the S side @@ -100,14 +130,94 @@ The R-URI + + a_contact + string + &uri_len; + + Contact address - A side + + + + b_contact + string + &uri_len; + + Contact address - B side + + + + as_contact + string + &uri_len; + + Contact address - server A side + + + + bs_contact + string + &uri_len; + + Contact address - server B side + + x_tag string - &user_len; + &callid_len; From tag - A or B side. + + a_tag + string + &callid_len; + + From tag - A side. + + + + b_tag + string + &callid_len; + + From tag - B side. + + + + a_srcaddr + string + &uri_len; + + Source address - A side + + + + b_srcaddr + string + &uri_len; + + Source address - B side + + + + a_socket + string + &uri_len; + + Socket address - A side + + + + b_socket + string + &uri_len; + + Socket address - B side + + rectime_idx diff --git a/lib/srutils/sha256.c b/lib/srutils/sha256.c index 90efd157f48..2b405511af9 100644 --- a/lib/srutils/sha256.c +++ b/lib/srutils/sha256.c @@ -610,7 +610,7 @@ void sr_SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { *context->buffer = 0x80; } /* Set the bit count: */ - *(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; + MEMCPY_BCOPY(&(context->buffer[SHA256_SHORT_BLOCK_LENGTH]), &(context->bitcount), sizeof(sha2_word64)); /* Final transform: */ SHA256_Transform(context, (sha2_word32*)context->buffer); @@ -927,8 +927,8 @@ void SHA512_Last(SHA512_CTX* context) { *context->buffer = 0x80; } /* Store the length of input data (in bits): */ - *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1]; - *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0]; + MEMCPY_BCOPY(&(context->buffer[SHA512_SHORT_BLOCK_LENGTH+0]), &(context->bitcount[1]), sizeof(sha2_word64)); + MEMCPY_BCOPY(&(context->buffer[SHA512_SHORT_BLOCK_LENGTH+8]), &(context->bitcount[0]), sizeof(sha2_word64)); /* Final transform: */ SHA512_Transform(context, (sha2_word64*)context->buffer); diff --git a/lib/srutils/srjson.c b/lib/srutils/srjson.c index b8c19453390..9c1bc8f60bf 100644 --- a/lib/srutils/srjson.c +++ b/lib/srutils/srjson.c @@ -193,7 +193,6 @@ static const char *parse_number(srjson_doc_t *doc, srjson_t *item, const char *n * 10^+/- exponent */ item->valuedouble = n; - item->valueint = (int) n; item->type = srjson_Number; return num; } @@ -203,12 +202,13 @@ static char *print_number(srjson_doc_t *doc, srjson_t *item) { char *str; double d = item->valuedouble; - if (fabs(((double) item->valueint) - d) <= DBL_EPSILON && d <= INT_MAX && d >= INT_MIN) { + int i = (int)d; + if (fabs(((double) i) - d) <= DBL_EPSILON && d <= INT_MAX && d >= INT_MIN) { str = (char *) doc->malloc_fn(21); /* 2^64+1 can be * represented in 21 * chars. */ if (str) - sprintf(str, "%d", item->valueint); + sprintf(str, "%d", i); } else { str = (char *) doc->malloc_fn(64); /* This is a nice * tradeoff. */ @@ -444,15 +444,17 @@ static const char *parse_value(srjson_doc_t *doc, srjson_t *item, const char *va return 0; /* Fail on null. */ if (!strncmp(value, "null", 4)) { item->type = srjson_NULL; + item->valuedouble = 0; return value + 4; } if (!strncmp(value, "false", 5)) { item->type = srjson_False; + item->valuedouble = 0; return value + 5; } if (!strncmp(value, "true", 4)) { item->type = srjson_True; - item->valueint = 1; + item->valuedouble = 1; return value + 4; } if (*value == '\"') { @@ -956,7 +958,6 @@ srjson_t *srjson_CreateNumber(srjson_doc_t *doc, double num) { if (item) { item->type = srjson_Number; item->valuedouble = num; - item->valueint = (int) num; } return item; } diff --git a/lib/srutils/srjson.h b/lib/srutils/srjson.h index 02d65d7b437..c46f1210265 100644 --- a/lib/srutils/srjson.h +++ b/lib/srutils/srjson.h @@ -47,6 +47,13 @@ extern "C" #define srjson_IsReference 256 +/* helper macros */ + +#define SRJSON_GET_INT(sj) ((int)((sj)->valuedouble)) +#define SRJSON_GET_UINT(sj) ((unsigned int)((sj)->valuedouble)) +#define SRJSON_GET_LONG(sj) ((long)((sj)->valuedouble)) +#define SRJSON_GET_ULONG(sj) ((unsigned long)((sj)->valuedouble)) + /* The srjson node structure: */ typedef struct srjson { struct srjson *parent; @@ -64,8 +71,6 @@ typedef struct srjson { int type; /* The type of the item, as above. */ char *valuestring; /* The item's string, if * type==srjson_String */ - int valueint; /* The item's number, if - * type==srjson_Number */ double valuedouble; /* The item's number, if * type==srjson_Number */ char *string; /* The item's name string, if this diff --git a/lib/trie/dtrie.c b/lib/trie/dtrie.c index f0b26554930..28e7e7af198 100644 --- a/lib/trie/dtrie.c +++ b/lib/trie/dtrie.c @@ -15,8 +15,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -245,7 +245,7 @@ void **dtrie_longest_match(struct dtrie_node_t *root, const char *number, digit = number[i]; if (digit>127) return ret; } - + if (node->child[digit] == NULL) return ret; node = node->child[digit]; i++; @@ -262,7 +262,7 @@ void **dtrie_longest_match(struct dtrie_node_t *root, const char *number, void **dtrie_contains(struct dtrie_node_t *root, const char *number, const unsigned int numberlen, const unsigned int branches) { - int nmatch; + int nmatch = 0; void **ret; ret = dtrie_longest_match(root, number, numberlen, &nmatch, branches); diff --git a/main.c b/main.c index 51a52a71c41..8b2e8e8af93 100644 --- a/main.c +++ b/main.c @@ -19,7 +19,7 @@ * */ -/** Kamailio core :: main file (init, daemonize, startup) +/** Kamailio core :: main file (init, daemonize, startup) * @file main.c * @ingroup core * Module: core @@ -133,6 +133,7 @@ #include "async_task.h" #include "dset.h" #include "timer_proc.h" +#include "srapi.h" #ifdef DEBUG_DMALLOC #include @@ -509,10 +510,10 @@ char *sr_memmng_pkg = NULL; char *sr_memmng_shm = NULL; /* call it before exiting; if show_status==1, mem status is displayed */ -void cleanup(show_status) +void cleanup(int show_status) { int memlog; - + /*clean-up*/ #ifndef SHM_SAFE_MALLOC if (_shm_lock) @@ -831,7 +832,20 @@ void sig_usr(int signo) _exit(0); break; case SIGUSR1: - /* statistics, do nothing, printed only from the main proc */ +#ifdef PKG_MALLOC + cfg_update_no_cbs(); + memlog=cfg_get(core, core_cfg, memlog); + if (memlog <= cfg_get(core, core_cfg, debug)){ + if (cfg_get(core, core_cfg, mem_summary) & 1) { + LOG(memlog, "Memory status (pkg):\n"); + pkg_status(); + } + if (cfg_get(core, core_cfg, mem_summary) & 2) { + LOG(memlog, "Memory still-in-use summary (pkg):\n"); + pkg_sums(); + } + } +#endif break; /* ignored*/ case SIGUSR2: @@ -1836,6 +1850,7 @@ int main(int argc, char** argv) debug_flag=0; dont_fork_cnt=0; + sr_cfgenv_init(); daemon_status_init(); dprint_init_colors(); diff --git a/mem/f_malloc.c b/mem/f_malloc.c index 59f809eced5..764e79d5ad0 100644 --- a/mem/f_malloc.c +++ b/mem/f_malloc.c @@ -262,19 +262,19 @@ static inline void fm_insert_free(struct fm_block* qm, struct fm_frag* frag) * \param size fragement size */ static inline -#ifdef DBG_F_MALLOC +#ifdef DBG_F_MALLOC void fm_split_frag(struct fm_block* qm, struct fm_frag* frag, - unsigned long size, + size_t size, const char* file, const char* func, unsigned int line, const char* mname) #else void fm_split_frag(struct fm_block* qm, struct fm_frag* frag, - unsigned long size) + size_t size) #endif { - unsigned long rest; + size_t rest; struct fm_frag* n; - + rest=frag->size-size; #ifdef MEM_FRAG_AVOIDANCE if ((rest> (FRAG_OVERHEAD+F_MALLOC_OPTIMIZE))|| @@ -316,14 +316,15 @@ struct fm_block* fm_malloc_init(char* address, unsigned long size, int type) char* end; struct fm_block* qm; unsigned long init_overhead; - + /* make address and size multiple of 8*/ start=(char*)ROUNDUP((unsigned long) address); DBG("fm_malloc_init: F_OPTIMIZE=%lu, /ROUNDTO=%lu\n", F_MALLOC_OPTIMIZE, F_MALLOC_OPTIMIZE/ROUNDTO); DBG("fm_malloc_init: F_HASH_SIZE=%lu, fm_block size=%lu\n", - F_HASH_SIZE, (long)sizeof(struct fm_block)); - DBG("fm_malloc_init(%p, %lu), start=%p\n", address, size, start); + F_HASH_SIZE, (unsigned long)sizeof(struct fm_block)); + DBG("fm_malloc_init(%p, %lu), start=%p\n", address, (unsigned long)size, + start); if (sizefunc=func; frag->mname=mname; frag->line=line; - MDBG("fm_malloc(%p, %lu) returns address %p \n", qm, size, + MDBG("fm_malloc(%p, %lu) returns address %p \n", qm, (unsigned long)size, (char*)frag+sizeof(struct fm_frag)); #endif frag->check=ST_CHECK_PATTERN; @@ -625,25 +638,25 @@ void fm_free(void* qmp, void* p) * \return reallocated memory block */ #ifdef DBG_F_MALLOC -void* fm_realloc(void* qmp, void* p, unsigned long size, +void* fm_realloc(void* qmp, void* p, size_t size, const char* file, const char* func, unsigned int line, const char *mname) #else -void* fm_realloc(void* qmp, void* p, unsigned long size) +void* fm_realloc(void* qmp, void* p, size_t size) #endif { struct fm_block* qm; struct fm_frag *f; - unsigned long diff; - unsigned long orig_size; + size_t diff; + size_t orig_size; struct fm_frag *n; void *ptr; qm = (struct fm_block*)qmp; #ifdef DBG_F_MALLOC - MDBG("fm_realloc(%p, %p, %lu) called from %s: %s(%d)\n", qm, p, size, - file, func, line); + MDBG("fm_realloc(%p, %p, %lu) called from %s: %s(%d)\n", qm, p, + (unsigned long)size, file, func, line); if ((p)&&(p>(void*)qm->last_frag || p<(void*)qm->first_frag)){ LOG(L_CRIT, "BUG: fm_free: bad pointer %p (out of memory block!) - " "aborting\n", p); @@ -675,7 +688,8 @@ void* fm_realloc(void* qmp, void* p, unsigned long size) if (f->size > size){ /* shrink */ #ifdef DBG_F_MALLOC - MDBG("fm_realloc: shrinking from %lu to %lu\n", f->size, size); + MDBG("fm_realloc: shrinking from %lu to %lu\n", f->size, + (unsigned long)size); fm_split_frag(qm, f, size, file, "frag. from fm_realloc", line, mname); #else fm_split_frag(qm, f, size); @@ -683,7 +697,8 @@ void* fm_realloc(void* qmp, void* p, unsigned long size) }else if (f->sizesize, size); + MDBG("fm_realloc: growing from %lu to %lu\n", f->size, + (unsigned long)size); #endif diff=size-f->size; n=FRAG_NEXT(f); @@ -715,6 +730,14 @@ void* fm_realloc(void* qmp, void* p, unsigned long size) if (ptr){ /* copy, need by libssl */ memcpy(ptr, p, orig_size); + } else { +#ifdef DBG_F_MALLOC + LOG(L_ERR, "fm_realloc(%p, %lu) called from %s: %s(%d), module: %s; fm_malloc() failed!\n", + qm, (unsigned long)size, file, func, line, mname); +#else + LOG(L_ERR, "fm_realloc(%p, %lu); fm_malloc() failed!\n", + qm, (unsigned long)size); +#endif } #ifdef DBG_F_MALLOC fm_free(qm, p, file, func, line, mname); @@ -727,7 +750,7 @@ void* fm_realloc(void* qmp, void* p, unsigned long size) /* do nothing */ #ifdef DBG_F_MALLOC MDBG("fm_realloc: doing nothing, same size: %lu - %lu\n", - f->size, size); + f->size, (unsigned long)size); #endif } #ifdef DBG_F_MALLOC @@ -1067,8 +1090,8 @@ int fm_malloc_init_pkg_manager(void) ma.xavailable = fm_available; ma.xsums = fm_sums; ma.xdestroy = fm_malloc_destroy_pkg_manager; - ma.xstats = fm_mod_get_stats; - ma.xfstats = fm_mod_free_stats; + ma.xmodstats = fm_mod_get_stats; + ma.xfmodstats = fm_mod_free_stats; return pkg_init_api(&ma); } @@ -1080,7 +1103,7 @@ static struct fm_block *_fm_shm_block = 0; /*SHM wrappers to sync the access to memory block*/ #ifdef DBG_F_MALLOC -void* fm_shm_malloc(void* qmp, unsigned long size, +void* fm_shm_malloc(void* qmp, size_t size, const char* file, const char* func, unsigned int line, const char* mname) { void *r; @@ -1089,7 +1112,7 @@ void* fm_shm_malloc(void* qmp, unsigned long size, shm_unlock(); return r; } -void* fm_shm_realloc(void* qmp, void* p, unsigned long size, +void* fm_shm_realloc(void* qmp, void* p, size_t size, const char* file, const char* func, unsigned int line, const char* mname) { void *r; @@ -1098,7 +1121,7 @@ void* fm_shm_realloc(void* qmp, void* p, unsigned long size, shm_unlock(); return r; } -void* fm_shm_resize(void* qmp, void* p, unsigned long size, +void* fm_shm_resize(void* qmp, void* p, size_t size, const char* file, const char* func, unsigned int line, const char* mname) { void *r; @@ -1116,7 +1139,7 @@ void fm_shm_free(void* qmp, void* p, const char* file, const char* func, shm_unlock(); } #else -void* fm_shm_malloc(void* qmp, unsigned long size) +void* fm_shm_malloc(void* qmp, size_t size) { void *r; shm_lock(); @@ -1124,7 +1147,7 @@ void* fm_shm_malloc(void* qmp, unsigned long size) shm_unlock(); return r; } -void* fm_shm_realloc(void* qmp, void* p, unsigned long size) +void* fm_shm_realloc(void* qmp, void* p, size_t size) { void *r; shm_lock(); @@ -1132,7 +1155,7 @@ void* fm_shm_realloc(void* qmp, void* p, unsigned long size) shm_unlock(); return r; } -void* fm_shm_resize(void* qmp, void* p, unsigned long size) +void* fm_shm_resize(void* qmp, void* p, size_t size) { void *r; shm_lock(); @@ -1218,8 +1241,8 @@ int fm_malloc_init_shm_manager(void) ma.xavailable = fm_shm_available; ma.xsums = fm_shm_sums; ma.xdestroy = fm_malloc_destroy_shm_manager; - ma.xstats = fm_mod_get_stats; - ma.xfstats = fm_mod_free_stats; + ma.xmodstats = fm_mod_get_stats; + ma.xfmodstats = fm_mod_free_stats; if(shm_init_api(&ma)<0) { LM_ERR("cannot initialize the core shm api\n"); diff --git a/mem/f_malloc.h b/mem/f_malloc.h index cf6f56b277f..cfd47194121 100644 --- a/mem/f_malloc.h +++ b/mem/f_malloc.h @@ -134,11 +134,11 @@ struct fm_block* fm_malloc_init(char* address, unsigned long size, int type); * \return address of allocated memory */ #ifdef DBG_F_MALLOC -void* fm_malloc(void* qmp, unsigned long size, +void* fm_malloc(void* qmp, size_t size, const char* file, const char* func, unsigned int line, const char* mname); #else -void* fm_malloc(void* qmp, unsigned long size); +void* fm_malloc(void* qmp, size_t size); #endif @@ -167,10 +167,10 @@ void fm_free(void* qmp, void* p); * \return reallocated memory block */ #ifdef DBG_F_MALLOC -void* fm_realloc(void* qmp, void* p, unsigned long size, +void* fm_realloc(void* qmp, void* p, size_t size, const char* file, const char* func, unsigned int line, const char *mname); #else -void* fm_realloc(void* qmp, void* p, unsigned long size); +void* fm_realloc(void* qmp, void* p, size_t size); #endif diff --git a/mem/memapi.h b/mem/memapi.h index 9f918f3ae73..2e1b7fe645b 100644 --- a/mem/memapi.h +++ b/mem/memapi.h @@ -20,27 +20,29 @@ #ifndef _sr_mem_api_ #define _sr_mem_api_ +#include + #include "src_loc.h" #include "meminfo.h" #include "memdbg.h" #ifdef DBG_SR_MEMORY -typedef void* (*sr_malloc_f)(void* mbp, unsigned long size, +typedef void* (*sr_malloc_f)(void* mbp, size_t size, const char* file, const char* func, unsigned int line, const char* mname); typedef void (*sr_free_f)(void* mbp, void* p, const char* file, const char* func, unsigned int line, const char* mname); -typedef void* (*sr_realloc_f)(void* mbp, void* p, unsigned long size, +typedef void* (*sr_realloc_f)(void* mbp, void* p, size_t size, const char* file, const char* func, unsigned int line, const char* mname); -typedef void* (*sr_resize_f)(void* mbp, void* p, unsigned long size, +typedef void* (*sr_resize_f)(void* mbp, void* p, size_t size, const char* file, const char* func, unsigned int line, const char* mname); #else /*DBG_SR_MEMORY*/ -typedef void* (*sr_malloc_f)(void* mbp, unsigned long size); +typedef void* (*sr_malloc_f)(void* mbp, size_t size); typedef void (*sr_free_f)(void* mbp, void* p); -typedef void* (*sr_realloc_f)(void* mbp, void* p, unsigned long size); -typedef void* (*sr_resize_f)(void* mbp, void* p, unsigned long size); +typedef void* (*sr_realloc_f)(void* mbp, void* p, size_t size); +typedef void* (*sr_resize_f)(void* mbp, void* p, size_t size); #endif /*DBG_SR_MEMORY*/ @@ -79,9 +81,9 @@ typedef struct sr_pkg_api { /*memory destroy manager*/ sr_mem_destroy_f xdestroy; /*memory stats per module*/ - sr_mem_mod_get_stats_f xstats; + sr_mem_mod_get_stats_f xmodstats; /*memory stats free per module*/ - sr_mem_mod_free_stats_f xfstats; + sr_mem_mod_free_stats_f xfmodstats; } sr_pkg_api_t; /*shared memory api*/ @@ -115,9 +117,9 @@ typedef struct sr_shm_api { /*memory destroy manager*/ sr_mem_destroy_f xdestroy; /*memory stats per module*/ - sr_mem_mod_get_stats_f xstats; + sr_mem_mod_get_stats_f xmodstats; /*memory stats free per module*/ - sr_mem_mod_free_stats_f xfstats; + sr_mem_mod_free_stats_f xfmodstats; } sr_shm_api_t; #endif diff --git a/mem/pkg.c b/mem/pkg.c index a4f0906efbc..53166ac9326 100644 --- a/mem/pkg.c +++ b/mem/pkg.c @@ -46,8 +46,8 @@ int pkg_init_api(sr_pkg_api_t *ap) _pkg_root.xavailable = ap->xavailable; _pkg_root.xsums = ap->xsums; _pkg_root.xdestroy = ap->xdestroy; - _pkg_root.xstats = ap->xstats; - _pkg_root.xfstats = ap->xfstats; + _pkg_root.xmodstats = ap->xmodstats; + _pkg_root.xfmodstats = ap->xfmodstats; return 0; } diff --git a/mem/pkg.h b/mem/pkg.h index 82e430a0110..c107117412f 100644 --- a/mem/pkg.h +++ b/mem/pkg.h @@ -20,12 +20,17 @@ #ifndef _sr_pkg_h_ #define _sr_pkg_h_ -#ifdef PKG_MALLOC - #include "memapi.h" extern sr_pkg_api_t _pkg_root; +int pkg_init_api(sr_pkg_api_t *ap); +int pkg_init_manager(char *name); +void pkg_destroy_manager(void); +void pkg_print_manager(void); + +#ifdef PKG_MALLOC + #ifdef DBG_SR_MEMORY # define pkg_malloc(s) _pkg_root.xmalloc(_pkg_root.mem_block, (s), _SRC_LOC_, \ _SRC_FUNCTION_, _SRC_LINE_, _SRC_MODULE_) @@ -43,13 +48,8 @@ extern sr_pkg_api_t _pkg_root; # define pkg_info(mi) _pkg_root.xinfo(_pkg_root.mem_block, mi) # define pkg_available() _pkg_root.xavailable(_pkg_root.mem_block) # define pkg_sums() _pkg_root.xsums(_pkg_root.mem_block) -# define pkg_mod_get_stats(x) _pkg_root.xstats(_pkg_root.mem_block, x) -# define pkg_mod_free_stats(x) _pkg_root.xfstats(x) - -int pkg_init_api(sr_pkg_api_t *ap); -int pkg_init_manager(char *name); -void pkg_destroy_manager(void); -void pkg_print_manager(void); +# define pkg_mod_get_stats(x) _pkg_root.xmodstats(_pkg_root.mem_block, x) +# define pkg_mod_free_stats(x) _pkg_root.xfmodstats(x) #else /*PKG_MALLOC*/ /* use system allocator */ @@ -74,6 +74,8 @@ void pkg_print_manager(void); # define pkg_info(mi) do{ memset((mi),0, sizeof(*(mi))); } while(0) # define pkg_available() 0 # define pkg_sums() do{}while(0) +# define pkg_mod_get_stats(x) do{}while(0) +# define pkg_mod_free_stats(x) do{}while(0) #endif /*PKG_MALLOC*/ #endif diff --git a/mem/q_malloc.c b/mem/q_malloc.c index 982682880f8..0c24ef24098 100644 --- a/mem/q_malloc.c +++ b/mem/q_malloc.c @@ -42,16 +42,16 @@ /*useful macros*/ #define FRAG_END(f) \ ((struct qm_frag_end*)((char*)(f)+sizeof(struct qm_frag)+ \ - (f)->size)) + (f)->size)) #define FRAG_NEXT(f) \ ((struct qm_frag*)((char*)(f)+sizeof(struct qm_frag)+(f)->size+ \ - sizeof(struct qm_frag_end))) - + sizeof(struct qm_frag_end))) + #define FRAG_PREV(f) \ ( (struct qm_frag*) ( ((char*)(f)-sizeof(struct qm_frag_end))- \ ((struct qm_frag_end*)((char*)(f)-sizeof(struct qm_frag_end)))->size- \ - sizeof(struct qm_frag) ) ) + sizeof(struct qm_frag) ) ) #define PREV_FRAG_END(f) \ ((struct qm_frag_end*)((char*)(f)-sizeof(struct qm_frag_end))) @@ -85,7 +85,7 @@ #define FRAG_WAS_USED(f) (1) /* other frag related defines: - * MEM_COALESCE_FRAGS + * MEM_COALESCE_FRAGS * MEM_FRAG_AVOIDANCE */ @@ -96,7 +96,7 @@ inline static unsigned long big_hash_idx(unsigned long s) { int idx; - /* s is rounded => s = k*2^n (ROUNDTO=2^n) + /* s is rounded => s = k*2^n (ROUNDTO=2^n) * index= i such that 2^i > s >= 2^(i-1) * * => index = number of the first non null bit in s*/ @@ -113,7 +113,7 @@ inline static unsigned long big_hash_idx(unsigned long s) static void qm_debug_frag(struct qm_block* qm, struct qm_frag* f, - const char* file, unsigned int line) + const char* file, unsigned int line) { if (f->check!=ST_CHECK_PATTERN){ LOG(L_CRIT, "BUG: qm_*: fragm. %p (address %p) " @@ -129,7 +129,7 @@ static void qm_debug_frag(struct qm_block* qm, struct qm_frag* f, LOG(L_CRIT, "BUG: qm_*: fragm. %p (address %p) " "end overwritten (%lx, %lx)! Memory allocator was called " "from %s:%u. Fragment marked by %s:%lu.\n", - f, (char*)f+sizeof(struct qm_frag), + f, (char*)f+sizeof(struct qm_frag), FRAG_END(f)->check1, FRAG_END(f)->check2, file, line, f->file, f->line); qm_status(qm); @@ -156,7 +156,7 @@ static inline void qm_insert_free(struct qm_block* qm, struct qm_frag* frag) struct qm_frag* f; struct qm_frag* prev; int hash; - + hash=GET_HASH(frag->size); for(f=qm->free_hash[hash].head.u.nxt_free; f!=&(qm->free_hash[hash].head); f=f->u.nxt_free){ @@ -182,26 +182,30 @@ struct qm_block* qm_malloc_init(char* address, unsigned long size, int type) struct qm_block* qm; unsigned long init_overhead; int h; - + /* make address and size multiple of 8*/ start=(char*)ROUNDUP((unsigned long) address); DBG("qm_malloc_init: QM_OPTIMIZE=%lu, /ROUNDTO=%lu\n", QM_MALLOC_OPTIMIZE, QM_MALLOC_OPTIMIZE/ROUNDTO); DBG("qm_malloc_init: QM_HASH_SIZE=%lu, qm_block size=%lu\n", - QM_HASH_SIZE, (long)sizeof(struct qm_block)); - DBG("qm_malloc_init(%p, %lu), start=%p\n", address, size, start); + QM_HASH_SIZE, (unsigned long)sizeof(struct qm_block)); + DBG("qm_malloc_init(%p, %lu), start=%p\n", address, + (unsigned long)size, start); if (sizemax_real_used=qm->real_used; qm->type=type; size-=init_overhead; - + qm->first_frag=(struct qm_frag*)(start+ROUNDUP(sizeof(struct qm_block))); qm->last_frag_end=(struct qm_frag_end*)(end-sizeof(struct qm_frag_end)); /* init initial fragment*/ qm->first_frag->size=size; qm->last_frag_end->size=size; - + #ifdef DBG_QM_MALLOC qm->first_frag->check=ST_CHECK_PATTERN; qm->last_frag_end->check1=END_CHECK_PATTERN1; @@ -231,16 +235,16 @@ struct qm_block* qm_malloc_init(char* address, unsigned long size, int type) qm->free_hash[h].head.size=0; qm->free_hash[h].tail.size=0; } - + /* link initial fragment into the free list*/ - + qm_insert_free(qm, qm->first_frag); - + /*qm->first_frag->u.nxt_free=&(qm->free_lst); - qm->last_frag_end->prev_free=&(qm->free_lst); - */ - - + * qm->last_frag_end->prev_free=&(qm->free_lst); + */ + + return qm; } @@ -250,24 +254,23 @@ static inline void qm_detach_free(struct qm_block* qm, struct qm_frag* frag) { struct qm_frag *prev; struct qm_frag *next; - + prev=FRAG_END(frag)->prev_free; next=frag->u.nxt_free; prev->u.nxt_free=next; FRAG_END(next)->prev_free=prev; - } #ifdef DBG_QM_MALLOC -static inline struct qm_frag* qm_find_free(struct qm_block* qm, - unsigned long size, +static inline struct qm_frag* qm_find_free(struct qm_block* qm, + size_t size, int *h, unsigned int *count) #else -static inline struct qm_frag* qm_find_free(struct qm_block* qm, - unsigned long size, +static inline struct qm_frag* qm_find_free(struct qm_block* qm, + size_t size, int* h) #endif { @@ -275,7 +278,7 @@ static inline struct qm_frag* qm_find_free(struct qm_block* qm, struct qm_frag* f; for (hash=GET_HASH(size); hashfree_hash[hash].head.u.nxt_free; + for (f=qm->free_hash[hash].head.u.nxt_free; f!=&(qm->free_hash[hash].head); f=f->u.nxt_free){ #ifdef DBG_QM_MALLOC *count+=1; /* *count++ generates a warning with gcc 2.9* -Wall */ @@ -285,6 +288,8 @@ static inline struct qm_frag* qm_find_free(struct qm_block* qm, /*try in a bigger bucket*/ } /* not found */ + LOG(L_ERR, "qm_find_free(%p, %lu); Free fragment not found!\n", + qm, (unsigned long)size); return 0; } @@ -293,16 +298,16 @@ static inline struct qm_frag* qm_find_free(struct qm_block* qm, * new_size < size & rounded-up already!*/ static inline #ifdef DBG_QM_MALLOC -int split_frag(struct qm_block* qm, struct qm_frag* f, unsigned long new_size, +int split_frag(struct qm_block* qm, struct qm_frag* f, size_t new_size, const char* file, const char* func, unsigned int line, const char *mname) #else -int split_frag(struct qm_block* qm, struct qm_frag* f, unsigned long new_size) +int split_frag(struct qm_block* qm, struct qm_frag* f, size_t new_size) #endif { - unsigned long rest; + size_t rest; struct qm_frag* n; struct qm_frag_end* end; - + rest=f->size-new_size; #ifdef MEM_FRAG_AVOIDANCE if ((rest> (FRAG_OVERHEAD+QM_MALLOC_OPTIMIZE))|| @@ -341,11 +346,11 @@ int split_frag(struct qm_block* qm, struct qm_frag* f, unsigned long new_size) #ifdef DBG_QM_MALLOC -void* qm_malloc(void* qmp, unsigned long size, +void* qm_malloc(void* qmp, size_t size, const char* file, const char* func, unsigned int line, const char *mname) #else -void* qm_malloc(void* qmp, unsigned long size) +void* qm_malloc(void* qmp, size_t size) #endif { struct qm_block* qm; @@ -356,11 +361,11 @@ void* qm_malloc(void* qmp, unsigned long size) #endif qm = (struct qm_block*)qmp; - + #ifdef DBG_QM_MALLOC list_cntr = 0; - MDBG("qm_malloc(%p, %lu) called from %s: %s(%d)\n", qm, size, file, func, - line); + MDBG("qm_malloc(%p, %lu) called from %s: %s(%d)\n", + qm, (unsigned long)size, file, func, line); #endif /*malloc(0) should return a valid pointer according to specs*/ if(unlikely(size==0)) size=4; @@ -404,7 +409,8 @@ void* qm_malloc(void* qmp, unsigned long size) FRAG_END(f)->check2=END_CHECK_PATTERN2;*/ MDBG("qm_malloc(%p, %lu) returns address %p frag. %p (size=%lu) on %d" " -th hit\n", - qm, size, (char*)f+sizeof(struct qm_frag), f, f->size, list_cntr ); + qm, (unsigned long)size, (char*)f+sizeof(struct qm_frag), f, + f->size, list_cntr); #endif #ifdef MALLOC_STATS if(qm->type==MEM_TYPE_PKG) { @@ -413,6 +419,15 @@ void* qm_malloc(void* qmp, unsigned long size) #endif return (char*)f+sizeof(struct qm_frag); } + +#ifdef DBG_QM_MALLOC + LOG(L_ERR, "qm_malloc(%p, %lu) called from %s: %s(%d), module: %s; Free fragment not found!\n", + qm, (unsigned long)size, file, func, line, mname); +#else + LOG(L_ERR, "qm_malloc(%p, %lu); Free fragment not found!\n", + qm, (unsigned long)size); +#endif + return 0; } @@ -427,7 +442,7 @@ void qm_free(void* qmp, void* p) { struct qm_block* qm; struct qm_frag* f; - unsigned long size; + size_t size; #ifdef MEM_JOIN_FREE struct qm_frag* next; struct qm_frag* prev; @@ -487,8 +502,8 @@ void qm_free(void* qmp, void* p) if(unlikely(cfg_get(core, core_cfg, mem_join)!=0)) { next=prev=0; /* mark this fragment as used (might fall into the middle of joined frags) - to give us an extra chance of detecting a double free call (if the joined - fragment has not yet been reused) */ + * to give us an extra chance of detecting a double free call (if the joined + * fragment has not yet been reused) */ f->u.nxt_free=(void*)0x1L; /* bogus value, just to mark it as free */ /* join packets if possible*/ next=FRAG_NEXT(f); @@ -503,7 +518,7 @@ void qm_free(void* qmp, void* p) qm->free_hash[GET_HASH(next->size)].no--; /* FIXME slow */ qm->ffrags--; } - + if (f > qm->first_frag){ prev=FRAG_PREV(f); /* (struct qm_frag*)((char*)f - (struct qm_frag_end*)((char*)f- @@ -542,24 +557,25 @@ void qm_free(void* qmp, void* p) #ifdef DBG_QM_MALLOC -void* qm_realloc(void* qmp, void* p, unsigned long size, +void* qm_realloc(void* qmp, void* p, size_t size, const char* file, const char* func, unsigned int line, const char *mname) #else -void* qm_realloc(void* qmp, void* p, unsigned long size) +void* qm_realloc(void* qmp, void* p, size_t size) #endif { struct qm_block* qm; struct qm_frag* f; - unsigned long diff; - unsigned long orig_size; + size_t diff; + size_t orig_size; struct qm_frag* n; void* ptr; qm = (struct qm_block*)qmp; #ifdef DBG_QM_MALLOC - MDBG("qm_realloc(%p, %p, %lu) called from %s: %s(%d)\n", qm, p, size, + MDBG("qm_realloc(%p, %p, %lu) called from %s: %s(%d)\n", + qm, p, (unsigned long)size, file, func, line); if ((p)&&(p>(void*)qm->last_frag_end || p<(void*)qm->first_frag)){ LOG(L_CRIT, "BUG: qm_free: bad pointer %p (out of memory block!) - " @@ -567,7 +583,7 @@ void* qm_realloc(void* qmp, void* p, unsigned long size) abort(); } #endif - + if (size==0) { if (p) #ifdef DBG_QM_MALLOC @@ -600,7 +616,8 @@ void* qm_realloc(void* qmp, void* p, unsigned long size) orig_size=f->size; /* shrink */ #ifdef DBG_QM_MALLOC - MDBG("qm_realloc: shrinking from %lu to %lu\n", f->size, size); + MDBG("qm_realloc: shrinking from %lu to %lu\n", + f->size, (unsigned long)size); if(split_frag(qm, f, size, file, "fragm. from qm_realloc", line, mname)!=0){ MDBG("qm_realloc : shrinked successful\n"); #else @@ -608,21 +625,22 @@ void* qm_realloc(void* qmp, void* p, unsigned long size) #endif /* update used sizes: freed the splited frag */ /* split frag already adds FRAG_OVERHEAD for the newly created - free frag, so here we only need orig_size-f->size for real used + * free frag, so here we only need orig_size-f->size for real used */ qm->real_used-=(orig_size-f->size); qm->used-=(orig_size-f->size); } - + }else if (f->size < size){ /* grow */ #ifdef DBG_QM_MALLOC - MDBG("qm_realloc: growing from %lu to %lu\n", f->size, size); + MDBG("qm_realloc: growing from %lu to %lu\n", + f->size, (unsigned long)size); #endif orig_size=f->size; diff=size-f->size; n=FRAG_NEXT(f); - if (((char*)n < (char*)qm->last_frag_end) && + if (((char*)n < (char*)qm->last_frag_end) && (n->u.is_free)&&((n->size+FRAG_OVERHEAD)>=diff)){ /* join */ qm_detach_free(qm, n); @@ -653,6 +671,14 @@ void* qm_realloc(void* qmp, void* p, unsigned long size) if (ptr){ /* copy, need by libssl */ memcpy(ptr, p, orig_size); + } else { +#ifdef DBG_QM_MALLOC + LOG(L_ERR, "qm_realloc(%p, %lu) called from %s: %s(%d), module: %s; qm_malloc() failed!\n", + qm, (unsigned long)size, file, func, line, mname); +#else + LOG(L_ERR, "qm_realloc(%p, %lu); qm_malloc() failed!\n", + qm, (unsigned long)size); +#endif } #ifdef DBG_QM_MALLOC qm_free(qm, p, file, func, line, mname); @@ -665,7 +691,7 @@ void* qm_realloc(void* qmp, void* p, unsigned long size) /* do nothing */ #ifdef DBG_QM_MALLOC MDBG("qm_realloc: doing nothing, same size: %lu - %lu\n", - f->size, size); + f->size, (unsigned long)size); #endif } #ifdef DBG_QM_MALLOC @@ -685,7 +711,7 @@ void qm_check(struct qm_block* qm) struct qm_frag* f; long fcount = 0; int memlog; - + memlog=cfg_get(core, core_cfg, memlog); LOG(memlog, "DEBUG: qm_check()\n"); f = qm->first_frag; @@ -724,7 +750,7 @@ void qm_check(struct qm_block* qm) (FRAG_END(f)->check2 != END_CHECK_PATTERN2)) { LOG(L_CRIT, "BUG: qm_*: fragm. %p (address %p)" " end overwritten(%lx, %lx)!\n", - f, (char*)f + sizeof(struct qm_frag), + f, (char*)f + sizeof(struct qm_frag), FRAG_END(f)->check1, FRAG_END(f)->check2); qm_status(qm); abort(); @@ -760,18 +786,18 @@ void qm_status(void* qmp) qm->used, qm->real_used, qm->size-qm->real_used); LOG_(DEFAULT_FACILITY, memlog, "qm_status: ", "max used (+overhead)= %lu\n", qm->max_real_used); - + if (mem_summary & 16) return; LOG_(DEFAULT_FACILITY, memlog, "qm_status: ", "dumping all alloc'ed. fragments:\n"); for (f=qm->first_frag, i=0;(char*)f<(char*)qm->last_frag_end;f=FRAG_NEXT(f) ,i++){ - if (! f->u.is_free){ + if ((! f->u.is_free) || (cfg_get(core, core_cfg, mem_status_mode)!=0)){ LOG_(DEFAULT_FACILITY, memlog, "qm_status: ", " %3d. %c address=%p frag=%p size=%lu used=%d\n", i, - (f->u.is_free)?'a':'N', + (f->u.is_free)?'A':'N', (char*)f+sizeof(struct qm_frag), f, f->size, FRAG_WAS_USED(f)); #ifdef DBG_QM_MALLOC LOG_(DEFAULT_FACILITY, memlog, "qm_status: ", @@ -780,6 +806,18 @@ void qm_status(void* qmp) LOG_(DEFAULT_FACILITY, memlog, "qm_status: ", " start check=%lx, end check= %lx, %lx\n", f->check, FRAG_END(f)->check1, FRAG_END(f)->check2); + if (f->check!=ST_CHECK_PATTERN){ + LOG_(DEFAULT_FACILITY, memlog, "qm_status: ", + " * beginning overwritten(%lx)!\n", + f->check); + } + if ((FRAG_END(f)->check1 != END_CHECK_PATTERN1) + || (FRAG_END(f)->check2 != END_CHECK_PATTERN2)) { + LOG_(DEFAULT_FACILITY, memlog, "qm_status: ", + " * end overwritten(%lx, %lx)!\n", + FRAG_END(f)->check1, FRAG_END(f)->check2); + } + #endif } } @@ -787,7 +825,7 @@ void qm_status(void* qmp) "dumping free list stats :\n"); for(h=0,i=0;hfree_hash[h].head.u.nxt_free,j=0; + for (f=qm->free_hash[h].head.u.nxt_free,j=0; f!=&(qm->free_hash[h].head); f=f->u.nxt_free, i++, j++){ if (!FRAG_WAS_USED(f)){ unused++; @@ -795,7 +833,7 @@ void qm_status(void* qmp) LOG_(DEFAULT_FACILITY, memlog, "qm_status: ", "unused fragm.: hash = %3d, fragment %p," " address %p size %lu, created from %s: %s(%lu)\n", - h, f, (char*)f+sizeof(struct qm_frag), f->size, + h, f, (char*)f+sizeof(struct qm_frag), f->size, f->file, f->func, f->line); #endif } @@ -861,7 +899,7 @@ static mem_counter* get_mem_counter(mem_counter **root, struct qm_frag* f) for(x=*root;x;x=x->next) if (x->file == f->file && x->func == f->func && x->line == f->line) return x; -make_new: +make_new: x = malloc(sizeof(mem_counter)); x->file = f->file; x->func = f->func; @@ -883,16 +921,16 @@ void qm_sums(void* qmp) int i; mem_counter *root, *x; int memlog; - + qm = (struct qm_block*)qmp; root=0; if (!qm) return; - + memlog=cfg_get(core, core_cfg, memlog); LOG_(DEFAULT_FACILITY, memlog, "qm_sums: ", "summarizing all alloc'ed. fragments:\n"); - + for (f=qm->first_frag, i=0;(char*)f<(char*)qm->last_frag_end; f=FRAG_NEXT(f),i++){ if (! f->u.is_free){ @@ -919,8 +957,8 @@ void qm_sums(void* qmp) void qm_mod_get_stats(void *qmp, void **qm_rootp) { if (!qm_rootp) { - return ; - } + return; + } LM_DBG("get qm memory statistics\n"); @@ -948,8 +986,8 @@ void qm_mod_get_stats(void *qmp, void **qm_rootp) void qm_mod_free_stats(void *qm_rootp) { if (!qm_rootp) { - return ; - } + return; + } LM_DBG("free qm memory statistics\n"); @@ -1032,8 +1070,8 @@ int qm_malloc_init_pkg_manager(void) ma.xavailable = qm_available; ma.xsums = qm_sums; ma.xdestroy = qm_malloc_destroy_pkg_manager; - ma.xstats = qm_mod_get_stats; - ma.xfstats = qm_mod_free_stats; + ma.xmodstats = qm_mod_get_stats; + ma.xfmodstats = qm_mod_free_stats; return pkg_init_api(&ma); } @@ -1045,7 +1083,7 @@ static struct qm_block *_qm_shm_block = 0; /*SHM wrappers to sync the access to memory block*/ #ifdef DBG_QM_MALLOC -void* qm_shm_malloc(void* qmp, unsigned long size, +void* qm_shm_malloc(void* qmp, size_t size, const char* file, const char* func, unsigned int line, const char* mname) { void *r; @@ -1054,7 +1092,7 @@ void* qm_shm_malloc(void* qmp, unsigned long size, shm_unlock(); return r; } -void* qm_shm_realloc(void* qmp, void* p, unsigned long size, +void* qm_shm_realloc(void* qmp, void* p, size_t size, const char* file, const char* func, unsigned int line, const char* mname) { void *r; @@ -1063,7 +1101,7 @@ void* qm_shm_realloc(void* qmp, void* p, unsigned long size, shm_unlock(); return r; } -void* qm_shm_resize(void* qmp, void* p, unsigned long size, +void* qm_shm_resize(void* qmp, void* p, size_t size, const char* file, const char* func, unsigned int line, const char* mname) { void *r; @@ -1081,7 +1119,7 @@ void qm_shm_free(void* qmp, void* p, const char* file, const char* func, shm_unlock(); } #else -void* qm_shm_malloc(void* qmp, unsigned long size) +void* qm_shm_malloc(void* qmp, size_t size) { void *r; shm_lock(); @@ -1089,7 +1127,7 @@ void* qm_shm_malloc(void* qmp, unsigned long size) shm_unlock(); return r; } -void* qm_shm_realloc(void* qmp, void* p, unsigned long size) +void* qm_shm_realloc(void* qmp, void* p, size_t size) { void *r; shm_lock(); @@ -1097,7 +1135,7 @@ void* qm_shm_realloc(void* qmp, void* p, unsigned long size) shm_unlock(); return r; } -void* qm_shm_resize(void* qmp, void* p, unsigned long size) +void* qm_shm_resize(void* qmp, void* p, size_t size) { void *r; shm_lock(); @@ -1183,8 +1221,8 @@ int qm_malloc_init_shm_manager(void) ma.xavailable = qm_shm_available; ma.xsums = qm_shm_sums; ma.xdestroy = qm_malloc_destroy_shm_manager; - ma.xstats = qm_mod_get_stats; - ma.xfstats = qm_mod_free_stats; + ma.xmodstats = qm_mod_get_stats; + ma.xfmodstats = qm_mod_free_stats; if(shm_init_api(&ma)<0) { LM_ERR("cannot initialize the core shm api\n"); diff --git a/mem/q_malloc.h b/mem/q_malloc.h index 10a768e0f2f..5d43900c42c 100644 --- a/mem/q_malloc.h +++ b/mem/q_malloc.h @@ -128,10 +128,10 @@ struct qm_block{ struct qm_block* qm_malloc_init(char* address, unsigned long size, int type); #ifdef DBG_QM_MALLOC -void* qm_malloc(void*, unsigned long size, const char* file, +void* qm_malloc(void*, size_t size, const char* file, const char* func, unsigned int line, const char* mname); #else -void* qm_malloc(void*, unsigned long size); +void* qm_malloc(void*, size_t size); #endif #ifdef DBG_QM_MALLOC @@ -141,10 +141,10 @@ void qm_free(void*, void* p, const char* file, const char* func, void qm_free(void*, void* p); #endif #ifdef DBG_QM_MALLOC -void* qm_realloc(void*, void* p, unsigned long size, +void* qm_realloc(void*, void* p, size_t size, const char* file, const char* func, unsigned int line, const char *mname); #else -void* qm_realloc(void*, void* p, unsigned long size); +void* qm_realloc(void*, void* p, size_t size); #endif void qm_check(struct qm_block*); diff --git a/mem/shm.c b/mem/shm.c index 94a99150e91..e4f4ad6f173 100644 --- a/mem/shm.c +++ b/mem/shm.c @@ -221,8 +221,8 @@ int shm_init_api(sr_shm_api_t *ap) _shm_root.xavailable = ap->xavailable; _shm_root.xsums = ap->xsums; _shm_root.xdestroy = ap->xdestroy; - _shm_root.xstats = ap->xstats; - _shm_root.xfstats = ap->xfstats; + _shm_root.xmodstats = ap->xmodstats; + _shm_root.xfmodstats = ap->xfmodstats; return 0; } diff --git a/mem/shm.h b/mem/shm.h index cbf4c3a77be..1fdd596bee7 100644 --- a/mem/shm.h +++ b/mem/shm.h @@ -73,8 +73,8 @@ extern sr_shm_api_t _shm_root; # define shm_info(mi) _shm_root.xinfo(_shm_root.mem_block, mi) # define shm_available() _shm_root.xavailable(_shm_root.mem_block) # define shm_sums() _shm_root.xsums(_shm_root.mem_block) -# define shm_mod_get_stats(x) _shm_root.xstats(_shm_root.mem_block, x) -# define shm_mod_free_stats(x) _shm_root.xfstats(x) +# define shm_mod_get_stats(x) _shm_root.xmodstats(_shm_root.mem_block, x) +# define shm_mod_free_stats(x) _shm_root.xfmodstats(x) void* shm_core_get_pool(void); diff --git a/mem/tlsf_malloc.c b/mem/tlsf_malloc.c index 534b2e2a095..2570ae68bda 100644 --- a/mem/tlsf_malloc.c +++ b/mem/tlsf_malloc.c @@ -1138,10 +1138,10 @@ void tlsf_meminfo(tlsf_t pool, struct mem_info *info) info->total_size = control->total_size; } -size_t tlsf_available(tlsf_t pool) +unsigned long tlsf_available(tlsf_t pool) { control_t* control = tlsf_cast(control_t*, pool); - return control->total_size - control->real_used; + return (unsigned long)(control->total_size - control->real_used); } void tlsf_status(tlsf_t pool) @@ -1358,8 +1358,8 @@ int tlsf_malloc_init_pkg_manager(void) ma.xavailable = tlsf_available; ma.xsums = tlsf_sums; ma.xdestroy = tlsf_malloc_destroy_pkg_manager; - ma.xstats = tlsf_mod_get_stats; - ma.xfstats = tlsf_mod_free_stats; + ma.xmodstats = tlsf_mod_get_stats; + ma.xfmodstats = tlsf_mod_free_stats; return pkg_init_api(&ma); } @@ -1370,7 +1370,7 @@ static tlsf_t _tlsf_shm_block = 0; /*SHM wrappers to sync the access to memory block*/ #ifdef DBG_TLSF_MALLOC -void* tlsf_shm_malloc(void* tlsfmp, unsigned long size, +void* tlsf_shm_malloc(void* tlsfmp, size_t size, const char* file, const char* func, unsigned int line, const char* mname) { void *r; @@ -1379,7 +1379,7 @@ void* tlsf_shm_malloc(void* tlsfmp, unsigned long size, shm_unlock(); return r; } -void* tlsf_shm_realloc(void* tlsfmp, void* p, unsigned long size, +void* tlsf_shm_realloc(void* tlsfmp, void* p, size_t size, const char* file, const char* func, unsigned int line, const char* mname) { void *r; @@ -1388,7 +1388,7 @@ void* tlsf_shm_realloc(void* tlsfmp, void* p, unsigned long size, shm_unlock(); return r; } -void* tlsf_shm_resize(void* tlsfmp, void* p, unsigned long size, +void* tlsf_shm_resize(void* tlsfmp, void* p, size_t size, const char* file, const char* func, unsigned int line, const char* mname) { void *r; @@ -1406,7 +1406,7 @@ void tlsf_shm_free(void* tlsfmp, void* p, const char* file, const char* func, shm_unlock(); } #else -void* tlsf_shm_malloc(void* tlsfmp, unsigned long size) +void* tlsf_shm_malloc(void* tlsfmp, size_t size) { void *r; shm_lock(); @@ -1414,7 +1414,7 @@ void* tlsf_shm_malloc(void* tlsfmp, unsigned long size) shm_unlock(); return r; } -void* tlsf_shm_realloc(void* tlsfmp, void* p, unsigned long size) +void* tlsf_shm_realloc(void* tlsfmp, void* p, size_t size) { void *r; shm_lock(); @@ -1422,7 +1422,7 @@ void* tlsf_shm_realloc(void* tlsfmp, void* p, unsigned long size) shm_unlock(); return r; } -void* tlsf_shm_resize(void* tlsfmp, void* p, unsigned long size) +void* tlsf_shm_resize(void* tlsfmp, void* p, size_t size) { void *r; shm_lock(); @@ -1508,8 +1508,8 @@ int tlsf_malloc_init_shm_manager(void) ma.xavailable = tlsf_shm_available; ma.xsums = tlsf_shm_sums; ma.xdestroy = tlsf_malloc_destroy_shm_manager; - ma.xstats = tlsf_mod_get_stats; - ma.xfstats = tlsf_mod_free_stats; + ma.xmodstats = tlsf_mod_get_stats; + ma.xfmodstats = tlsf_mod_free_stats; if(shm_init_api(&ma)<0) { LM_ERR("cannot initialize the core shm api\n"); diff --git a/mem/tlsf_malloc.h b/mem/tlsf_malloc.h index 97e962a5990..b92ae6fc20c 100644 --- a/mem/tlsf_malloc.h +++ b/mem/tlsf_malloc.h @@ -79,7 +79,7 @@ int tlsf_check_pool(pool_t pool); void tlsf_meminfo(tlsf_t pool, struct mem_info *info); void tlsf_status(tlsf_t pool); void tlsf_sums(tlsf_t pool); -size_t tlsf_available(tlsf_t pool); +unsigned long tlsf_available(tlsf_t pool); void tlsf_mod_get_stats(tlsf_t pool, void **root); void tlsf_mod_free_stats(void *root); diff --git a/mem/tlsf_malloc_bits.h b/mem/tlsf_malloc_bits.h index 3be2579d77e..29c783d4a44 100644 --- a/mem/tlsf_malloc_bits.h +++ b/mem/tlsf_malloc_bits.h @@ -37,6 +37,8 @@ /* ** gcc 3.4 and above have builtin support, specialized for architecture. ** Some compilers masquerade as gcc; patchlevel test filters them out. +** +** Note: clang is compatible with GCC builtins and will also define those macros */ #if defined (__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) \ && defined (__GNUC_PATCHLEVEL__) @@ -52,78 +54,13 @@ tlsf_decl int tlsf_fls(unsigned int word) return bit - 1; } -#elif defined (_MSC_VER) && (_MSC_VER >= 1400) && (defined (_M_IX86) || defined (_M_X64)) -/* Microsoft Visual C++ support on x86/X64 architectures. */ - -#include - -#pragma intrinsic(_BitScanReverse) -#pragma intrinsic(_BitScanForward) - -tlsf_decl int tlsf_fls(unsigned int word) -{ - unsigned long index; - return _BitScanReverse(&index, word) ? index : -1; -} - -tlsf_decl int tlsf_ffs(unsigned int word) -{ - unsigned long index; - return _BitScanForward(&index, word) ? index : -1; -} - -#elif defined (_MSC_VER) && defined (_M_PPC) -/* Microsoft Visual C++ support on PowerPC architectures. */ - -#include - -tlsf_decl int tlsf_fls(unsigned int word) -{ - const int bit = 32 - _CountLeadingZeros(word); - return bit - 1; -} - -tlsf_decl int tlsf_ffs(unsigned int word) -{ - const unsigned int reverse = word & (~word + 1); - const int bit = 32 - _CountLeadingZeros(reverse); - return bit - 1; -} - -#elif defined (__ARMCC_VERSION) -/* RealView Compilation Tools for ARM */ - -tlsf_decl int tlsf_ffs(unsigned int word) -{ - const unsigned int reverse = word & (~word + 1); - const int bit = 32 - __clz(reverse); - return bit - 1; -} - -tlsf_decl int tlsf_fls(unsigned int word) -{ - const int bit = word ? 32 - __clz(word) : 0; - return bit - 1; -} - -#elif defined (__ghs__) -/* Green Hills support for PowerPC */ - -#include - -tlsf_decl int tlsf_ffs(unsigned int word) -{ - const unsigned int reverse = word & (~word + 1); - const int bit = 32 - __CLZ32(reverse); - return bit - 1; -} - -tlsf_decl int tlsf_fls(unsigned int word) +#if defined (TLSF_64BIT) +tlsf_decl int tlsf_fls_sizet(size_t size) { - const int bit = word ? 32 - __CLZ32(word) : 0; + const int bit = size ? 64 - __builtin_clzl(size) : 0; return bit - 1; } - +#endif #else /* Fall back to generic implementation. */ @@ -152,9 +89,6 @@ tlsf_decl int tlsf_fls(unsigned int word) return tlsf_fls_generic(word) - 1; } -#endif - -/* Possibly 64-bit version of tlsf_fls. */ #if defined (TLSF_64BIT) tlsf_decl int tlsf_fls_sizet(size_t size) { @@ -171,7 +105,12 @@ tlsf_decl int tlsf_fls_sizet(size_t size) } return bits; } -#else +#endif /* defined (TLSF_64BIT) */ + +#endif /* GNUC */ + + +#if !defined (TLSF_64BIT) #define tlsf_fls_sizet tlsf_fls #endif diff --git a/modparam.c b/modparam.c index 087f11e87d9..851a5ce6923 100644 --- a/modparam.c +++ b/modparam.c @@ -59,15 +59,17 @@ int set_mod_param_regex(char* regex, char* name, modparam_t type, void* val) } len = strlen(regex); - reg = pkg_malloc(len + 2 + 1); + reg = pkg_malloc(len + 4 + 1); if (reg == 0) { LM_ERR("No memory left\n"); return -1; } reg[0] = '^'; - memcpy(reg + 1, regex, len); - reg[len + 1] = '$'; - reg[len + 2] = '\0'; + reg[1] = '('; + memcpy(reg + 2, regex, len); + reg[len + 2] = ')'; + reg[len + 3] = '$'; + reg[len + 4] = '\0'; if (regcomp(&preg, reg, REG_EXTENDED | REG_NOSUB | REG_ICASE)) { LM_ERR("Error while compiling regular expression\n"); diff --git a/modules/acc/README b/modules/acc/README index 002df8c267c..4b6c0666ae2 100644 --- a/modules/acc/README +++ b/modules/acc/README @@ -22,16 +22,18 @@ Bogdan-Andrei Iancu Voice Sistem SRL +Edited by + Sven Knoblich 1&1 Internet AG - Copyright 2002, 2003 FhG FOKUS + Copyright © 2002, 2003 FhG FOKUS - Copyright 2004, 2006 Voice Sistem SRL + Copyright © 2004, 2006 Voice Sistem SRL - Copyright 2011 1&1 Internet AG + Copyright © 2011 1&1 Internet AG Revision History Revision $Revision$ $Date$ __________________________________________________________________ @@ -321,7 +323,7 @@ Chapter 1. Admin Guide To account a transaction and to choose which set of backends to be used, the script writer just has to set some flags (see the module - parameters section for flag definitions Section 6, "Parameters"). If + parameters section for flag definitions Section 6, “Parameters”). If the accounting flag for a specific backend is set, the acc module will then report on completed transaction. A typical usage of the module takes no acc-specific script command -- the functionality binds @@ -333,7 +335,7 @@ Chapter 1. Admin Guide The accounting module will log by default a fixed set of attributes for the transaction - if you customize your accounting by adding more information to be logged, please see the next chapter about extra - accounting - Section 2, "Extra accounting". + accounting - Section 2, “Extra accounting”. The fixed minimal accounting information is: * Request Method name @@ -360,7 +362,7 @@ Chapter 1. Admin Guide gateway). However, CDR-base logging has the option to log existing information from expired dialogs (the dlg_vars in cdr_extra) Please see cdr_expired_dlg_enable parameter - Section 6.40, - "cdr_expired_dlg_enable (integer)". + “cdr_expired_dlg_enable (integer)”. The SQL backend support is compiled in the module. For RADIUS and DIAMETER you need to enable it by recompiling the module with properly @@ -572,21 +574,21 @@ Note message is never transmitted. You can toggle on/off the generation of CDR-based logging in such cases with only the dlg_vars showing by using the cdr_expired_dlg_enable parameter - Section 6.40, - "cdr_expired_dlg_enable (integer)". Default behavior is not logging. + “cdr_expired_dlg_enable (integer)”. Default behavior is not logging. 4.2. CDR Extra - This section is similar to the "LOG accounting" part of Section 2, - "Extra accounting". + This section is similar to the “LOG accounting” part of Section 2, + “Extra accounting”. 4.2.1. Definitions and syntax Selection of extra information is done similar to the transaction extra - Section 2.2, "Definitions and syntax". + Section 2.2, “Definitions and syntax”. * cdr_extra = cdr_extra_definition (';'cdr_extra_definition)* * cdr_extra_definition = cdr_log_name '=' pseudo_variable - See also Section 6.43, "cdr_extra (string)". + See also Section 6.43, “cdr_extra (string)”. The full list of supported pseudo-variables in Sip-Router is available at: http://sip-router.org/wiki/cookbooks/pseudo-variables/devel @@ -595,7 +597,7 @@ Note 4.3.1. Overview - As mentioned in Section 3, "Multi Call-Legs accounting", a leg + As mentioned in Section 3, “Multi Call-Legs accounting”, a leg represents a parallel or forwarded call. In contrast to the normal accounting the cdr logging uses dialogs instead of transaction to log data. This may reduce the amount of information but it also make it @@ -606,7 +608,7 @@ Note 4.3.2. Configuration When you route messages multiple times through your proxy (e.g. to - handle "call-forwardings") you have to use detect_spirals from the + handle “call-forwardings”) you have to use detect_spirals from the dialog modules. Otherwise the proxy can't identify and reuse existing dialogs. @@ -659,9 +661,9 @@ $dlg_var(callee) = $avp(callee); #callee='C' listed modules must be loaded before this module): * tm -- Transaction Manager * a database module -- If SQL support is used. - * rr -- Record Route, if "detect_direction" module parameter is + * rr -- Record Route, if “detect_direction” module parameter is enabled. - * dialog -- Dialog, if "cdr_enable" module parameter is enabled. + * dialog -- Dialog, if “cdr_enable” module parameter is enabled. 5.2. External Libraries or Applications @@ -841,7 +843,7 @@ modparam("acc", "acc_prepare_always", 1) 6.9. multi_leg_info (string) Defines the AVP set to be used in per-call-leg accounting. See - Section 3, "Multi Call-Legs accounting" for a detailed description of + Section 3, “Multi Call-Legs accounting” for a detailed description of the Multi Call-Legs accounting. If empty, the multi-leg accounting support will be disabled. @@ -912,7 +914,7 @@ modparam("acc", "log_facility", "LOG_DAEMON") 6.14. log_extra (string) - Extra values to be logged. See section Section 2, "Extra accounting" + Extra values to be logged. See section Section 2, “Extra accounting” for more details. Default value is NULL. @@ -933,7 +935,7 @@ modparam("acc", "log_extra", "ua=$hdr(User-Agent);uuid=$avp(i:123)") If the parameter is set to empty string, the RADIUS accounting support will be disabled (even if compiled). - Default value is "NULL". + Default value is “NULL”. Example 1.15. radius_config example ... @@ -978,7 +980,7 @@ modparam("acc", "service_type", 16) 6.19. radius_extra (string) Extra values to be logged via RADIUS - RADIUS specific. See section - Section 2, "Extra accounting" for more details. + Section 2, “Extra accounting” for more details. Default value is NULL. @@ -1016,7 +1018,7 @@ modparam("acc", "db_missed_flag", 3) Table name of accounting successfull calls -- database specific. It can contain config variables that will be evaluated at runtime. - Default value is "acc" + Default value is “acc” Example 1.22. db_table_acc example ... @@ -1029,7 +1031,7 @@ modparam("acc", "db_table_acc", "acc_$time(year)_$time(mon)") Table name for accounting missed calls -- database specific. It can contain config variables that will be evaluated at runtime. - Default value is "missed_calls" + Default value is “missed_calls” Example 1.23. db_table_missed_calls example ... @@ -1041,7 +1043,7 @@ modparam("acc", "db_table_missed_calls", "myMC_table") SQL address -- database specific. If is set to NULL or emty string, the SQL support is disabled. - Default value is "NULL" (SQL disabled). + Default value is “NULL” (SQL disabled). Example 1.24. db_url example ... @@ -1053,7 +1055,7 @@ modparam("acc", "db_url", "mysql://user:password@localhost/kamailio") Column name in accounting table to store the request's method name as string. - Default value is "method". + Default value is “method”. Example 1.25. acc_method_column example ... @@ -1064,7 +1066,7 @@ modparam("acc", "acc_method_column", "method") Column name in accounting table to store the From header TAG parameter. - Default value is "from_tag". + Default value is “from_tag”. Example 1.26. acc_from_tag_column example ... @@ -1075,7 +1077,7 @@ modparam("acc", "acc_from_tag_column", "from_tag") Column name in accounting table to store the To header TAG parameter. - Default value is "to_tag". + Default value is “to_tag”. Example 1.27. acc_to_tag_column example ... @@ -1086,7 +1088,7 @@ modparam("acc", "acc_to_tag_column", "to_tag") Column name in accounting table to store the request's Callid value. - Default value is "callid". + Default value is “callid”. Example 1.28. acc_callid_column example ... @@ -1098,7 +1100,7 @@ modparam("acc", "acc_callid_column", "callid") Column name in accounting table to store the final reply's numric code value in string format. - Default value is "sip_code". + Default value is “sip_code”. Example 1.29. acc_sip_code_column example ... @@ -1110,7 +1112,7 @@ modparam("acc", "acc_sip_code_column", "sip_code") Column name in accounting table to store the final reply's reason phrase value. - Default value is "sip_reason". + Default value is “sip_reason”. Example 1.30. acc_sip_reason_column example ... @@ -1122,7 +1124,7 @@ modparam("acc", "acc_sip_reason_column", "sip_reason") Column name in accounting table to store the time stamp of the transaction completion in date-time format. - Default value is "time". + Default value is “time”. Example 1.31. acc_time_column example ... @@ -1132,7 +1134,7 @@ modparam("acc", "acc_time_column", "time") 6.32. db_extra (string) Extra values to be logged into database - DB specific. See section - Section 2, "Extra accounting" for more details. + Section 2, “Extra accounting” for more details. Default value is NULL. @@ -1189,7 +1191,7 @@ modparam("acc", "diameter_missed_flag", 3) Hostname of the machine where the DIAMETER Client is running -- DIAMETER specific. - Default value is "localhost". + Default value is “localhost”. Example 1.36. diameter_client_host example ... @@ -1211,7 +1213,7 @@ modparam("acc", "diameter_client_port", 3000) 6.38. diameter_extra (string) Extra values to be logged via DIAMETER - DIAMETER specific. See section - Section 2, "Extra accounting" for more details. + Section 2, “Extra accounting” for more details. Default value is NULL. @@ -1270,7 +1272,7 @@ modparam("acc", "cdr_facility", "LOG_DAEMON") 6.43. cdr_extra (string) Set of pseudo-variables defining custom CDR fields. See Section 4.2, - "CDR Extra" for more details. + “CDR Extra” for more details. Default value is NULL. @@ -1446,7 +1448,7 @@ modparam("acc", "cdr_on_failed", 0) 7.3. acc_rad_request(comment) 7.4. acc_diam_request(comment) -7.1. acc_log_request(comment) +7.1. acc_log_request(comment) acc_request reports on a request, for example, it can be used to report on missed calls to off-line users who are replied 404 - Not Found. To @@ -1467,10 +1469,10 @@ $avp(reason) = "Not found"; acc_log_request("$var(code) Error: $avp(reason)"); ... -7.2. acc_db_request(comment, table) +7.2. acc_db_request(comment, table) Like acc_log_request, acc_db_request reports on a request. The report - is sent to database at "db_url", in the table referred to in the second + is sent to database at “db_url”, in the table referred to in the second action parameter. Meaning of the parameters is as follows: @@ -1488,10 +1490,10 @@ acc_db_request("Some comment", "acc_$time(year)_$time(mon)"); acc_db_request("$var(code) Error: $avp(reason)", "SomeTable"); ... -7.3. acc_rad_request(comment) +7.3. acc_rad_request(comment) Like acc_log_request, acc_rad_request reports on a request. It reports - to radius server as configured in "radius_config". + to radius server as configured in “radius_config”. Meaning of the parameters is as follows: * comment - Comment to be appended. The string can contain any number @@ -1505,7 +1507,7 @@ acc_rad_request("Some comment"); acc_rad_request("$var(code) Error: $avp(reason)"); ... -7.4. acc_diam_request(comment) +7.4. acc_diam_request(comment) Like acc_log_request, acc_diam_request reports on a request. It reports to the configured Diameter server. @@ -1533,55 +1535,55 @@ Chapter 2. Frequently Asked Questions 2.1. - What happend with old log_fmt parameter + What happend with old log_fmt parameter - The parameter became obsolete with the restructure of the data logged - by ACC module (refer to the Overview chapter). For similar behaviour - you can use the extra accouting (see the coresponding chapter). + The parameter became obsolete with the restructure of the data logged + by ACC module (refer to the Overview chapter). For similar behaviour + you can use the extra accouting (see the coresponding chapter). 2.2. - What happend with old multi_leg_enabled parameter + What happend with old multi_leg_enabled parameter - The parameter becaome obsolete by the addition of the new - multi_leg_info parameter. The multi-leg accouting is automatically - enabled when multi_leg_info is defined. + The parameter becaome obsolete by the addition of the new + multi_leg_info parameter. The multi-leg accouting is automatically + enabled when multi_leg_info is defined. 2.3. - What happend with old src_leg_avp_id and dst_leg_avp_id parameters + What happend with old src_leg_avp_id and dst_leg_avp_id parameters - The parameter was replaced by the more generic new parameter - multi_leg_info. This allows logging (per-leg) of more information than - just dst and src. + The parameter was replaced by the more generic new parameter + multi_leg_info. This allows logging (per-leg) of more information than + just dst and src. 2.4. - Where can I find more about Kamailio? + Where can I find more about Kamailio? - Take a look at http://www.kamailio.org/. + Take a look at http://www.kamailio.org/. 2.5. - Where can I post a question about this module? + Where can I post a question about this module? - First at all check if your question was already answered on one of our - mailing lists: - * User Mailing List - - http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users - * Developer Mailing List - - http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev + First at all check if your question was already answered on one of our + mailing lists: + * User Mailing List - + http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users + * Developer Mailing List - + http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev - E-mails regarding any stable Kamailio release should be sent to - and e-mails regarding development - versions should be sent to . + E-mails regarding any stable Kamailio release should be sent to + and e-mails regarding development + versions should be sent to . - If you want to keep the mail private, send it to - . + If you want to keep the mail private, send it to + . 2.6. - How can I report a bug? + How can I report a bug? - Please follow the guidelines provided at: - http://sip-router.org/tracker. + Please follow the guidelines provided at: + https://github.com/kamailio/kamailio/issues. diff --git a/modules/acc/acc.c b/modules/acc/acc.c index 7bf7dd7d36c..8d0d01c9c95 100644 --- a/modules/acc/acc.c +++ b/modules/acc/acc.c @@ -232,6 +232,7 @@ int acc_log_request( struct sip_msg *rq) int o; int i; struct tm *t; + double dtime; /* get default values */ m = core2strar( rq, val_arr, int_arr, type_arr); @@ -290,12 +291,11 @@ int acc_log_request( struct sip_msg *rq) acc_time_exten.s, (unsigned int)acc_env.tv.tv_usec, log_msg); } else if(acc_time_mode==2) { + dtime = (double)acc_env.tv.tv_usec; + dtime = (dtime / 1000000) + (double)acc_env.tv.tv_sec; LM_GEN2(log_facility, log_level, "%.*stimestamp=%lu;%s=%.3f%s", acc_env.text.len, acc_env.text.s,(unsigned long)acc_env.ts, - acc_time_attr.s, - (((double)(acc_env.tv.tv_sec * 1000) - + (acc_env.tv.tv_usec / 1000)) / 1000), - log_msg); + acc_time_attr.s, dtime, log_msg); } else if(acc_time_mode==3 || acc_time_mode==4) { if(acc_time_mode==3) { t = localtime(&acc_env.ts); @@ -443,6 +443,7 @@ int acc_db_request( struct sip_msg *rq) int i; int o; struct tm *t; + double dtime; /* formated database columns */ m = core2strar( rq, val_arr, int_arr, type_arr ); @@ -458,8 +459,9 @@ int acc_db_request( struct sip_msg *rq) VAL_INT(db_vals+(m++)) = (int)acc_env.tv.tv_usec; i++; } else if(acc_time_mode==2) { - VAL_DOUBLE(db_vals+(m++)) = ((double)(acc_env.tv.tv_sec * 1000) - + (acc_env.tv.tv_usec / 1000)) / 1000; + dtime = (double)acc_env.tv.tv_usec; + dtime = (dtime / 1000000) + (double)acc_env.tv.tv_sec; + VAL_DOUBLE(db_vals+(m++)) = dtime; i++; } else if(acc_time_mode==3 || acc_time_mode==4) { if(acc_time_mode==3) { diff --git a/modules/acc_radius/README b/modules/acc_radius/README index 31cb5abc828..6ff33180dec 100644 --- a/modules/acc_radius/README +++ b/modules/acc_radius/README @@ -36,6 +36,7 @@ Daniel-Constantin Mierla 3.3. radius_missed_flag (integer) 3.4. service_type (integer) 3.5. radius_extra (string) + 3.6. rad_time_mode(integer) 4. Functions @@ -48,7 +49,8 @@ Daniel-Constantin Mierla 1.3. radius_missed_flag example 1.4. service_type example 1.5. radius_extra example - 1.6. acc_rad_request usage + 1.6. rad_time_mode example + 1.7. acc_rad_request usage Chapter 1. Admin Guide @@ -67,6 +69,7 @@ Chapter 1. Admin Guide 3.3. radius_missed_flag (integer) 3.4. service_type (integer) 3.5. radius_extra (string) + 3.6. rad_time_mode(integer) 4. Functions @@ -97,8 +100,13 @@ Chapter 1. Admin Guide The following libraries or applications must be installed before running Kamailio with this module loaded: - * radiusclient-ng 0.5.0 or higher. See - http://developer.berlios.de/projects/radiusclient-ng/. + * radiusclient-ng 0.5.0 or higher, freeradius-client + https://github.com/FreeRADIUS/freeradius-client/ or radcli + http://radcli.github.io/radcli/. + * freeradius-client library can be used after setting FREERADIUS + variable in source code with 'export FREERADIUS=1' before compile. + * radcli library can be used after setting RADCLI variable in source + code with 'export RADCLI=1' before compile. 3. Parameters @@ -107,6 +115,7 @@ Chapter 1. Admin Guide 3.3. radius_missed_flag (integer) 3.4. service_type (integer) 3.5. radius_extra (string) + 3.6. rad_time_mode(integer) 3.1. radius_config (string) @@ -172,6 +181,25 @@ modparam("acc_radius", "service_type", 16) modparam("acc_radius", "radius_extra", "via=$hdr(Via[*]); email=$avp(s:email)") ... +3.6. rad_time_mode(integer) + + Radius Event-Timestamp for accounting. + + Values can be: + * 0 - (default), format is only unix timestamp for Event-Timestamp + (For example: 1445590624) + * 1 - format is unix timestamp with microseconds in Addition, it + needs to change Event-Timestamp attribute type in dictionary to + string both radius server and client (For example: + 1445590624.377372) + + Default value is 0 (Unix timestamp). + + Example 1.6. rad_time_mode example +... +modparam("acc_radius", "rad_time_mode", 1) +... + 4. Functions 4.1. acc_rad_request(comment) @@ -187,7 +215,7 @@ modparam("acc_radius", "radius_extra", "via=$hdr(Via[*]); email=$avp(s:email)") This function can be used from REQUEST_ROUTE, FAILURE_ROUTE. - Example 1.6. acc_rad_request usage + Example 1.7. acc_rad_request usage ... acc_rad_request("Some comment"); ... diff --git a/modules/acc_radius/acc_radius_mod.c b/modules/acc_radius/acc_radius_mod.c index 382033990d0..e7cc62f5597 100644 --- a/modules/acc_radius/acc_radius_mod.c +++ b/modules/acc_radius/acc_radius_mod.c @@ -1,5 +1,5 @@ /* - * Accounting module + * Radius Accounting module * * Copyright (C) 2001-2003 FhG Fokus * diff --git a/modules/acc_radius/acc_radius_mod.h b/modules/acc_radius/acc_radius_mod.h index 16e48d516b5..b050b5b37c0 100644 --- a/modules/acc_radius/acc_radius_mod.h +++ b/modules/acc_radius/acc_radius_mod.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * RADIUS Accounting module * * Copyright (C) 2001-2003 FhG Fokus @@ -21,8 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * History: - * --------- */ /*! \file diff --git a/modules/acc_radius/doc/acc_radius_admin.xml b/modules/acc_radius/doc/acc_radius_admin.xml index f4394579152..21860b3d09f 100644 --- a/modules/acc_radius/doc/acc_radius_admin.xml +++ b/modules/acc_radius/doc/acc_radius_admin.xml @@ -11,20 +11,20 @@ - + &adminguide; - +
Overview - ACC_RADIUS module is used to account transaction information to + ACC_RADIUS module is used to account transaction information to RADIUS server. It binds to ACC module API and uses the same accounting mechanisms as for other backends. Therefore you need this module just to send accounting data to a RADIUS server - for more documentation regarding accounting, see the ACC - readme. + readme.
@@ -33,7 +33,7 @@
&kamailio; Modules - The module depends on the following modules (in the other words + The module depends on the following modules (in the other words the listed modules must be loaded before this module): @@ -45,39 +45,48 @@
External Libraries or Applications - The following libraries or applications must be installed + The following libraries or applications must be installed before running &kamailio; with this module loaded: - radiusclient-ng 0.5.0 or freeradius-client - or higher. - See radiusclient-ng 0.5.0 or higher, + freeradius-client - https://github.com/FreeRADIUS/freeradius-client/. + https://github.com/FreeRADIUS/freeradius-client/ or + radcli + http://radcli.github.io/radcli/. - freeradius-client library can be used after - setting FREERADIUS variable in source code with + freeradius-client library can be used after + setting FREERADIUS variable in source code with 'export FREERADIUS=1' before compile. + + + radcli library can be used after + setting RADCLI variable in source code with + 'export RADCLI=1' before compile. + +
Parameters -
+
<varname>radius_config</varname> (string) - This parameter is radius specific. Path to - radius client configuration file, set the referred config file - correctly and specify there address of server, shared secret + This parameter is radius specific. Path to + radius client configuration file, set the referred config file + correctly and specify there address of server, shared secret (should equal that in /usr/local/etc/raddb/clients for - freeRadius servers) and dictionary, see etc for an example of + freeRadius servers) and dictionary, see etc for an example of config file and dictionary. @@ -96,10 +105,10 @@ modparam("acc_radius", "radius_config", "/etc/radiusclient/radiusclient.conf")
-
+
<varname>radius_flag</varname> (integer) - Request flag which needs to be set to account a + Request flag which needs to be set to account a transaction -- RADIUS specific. @@ -114,10 +123,10 @@ modparam("acc_radius", "radius_flag", 2)
-
+
<varname>radius_missed_flag</varname> (integer) - Request flag which needs to be set to account missed + Request flag which needs to be set to account missed calls -- RADIUS specific. @@ -132,7 +141,7 @@ modparam("acc_radius", "radius_missed_flag", 3)
-
+
<varname>service_type</varname> (integer) Radius service type used for accounting. @@ -149,7 +158,7 @@ modparam("acc_radius", "service_type", 16)
-
+
<varname>radius_extra</varname> (string) Extra values to be logged via RADIUS - RADIUS specific. @@ -166,10 +175,10 @@ modparam("acc_radius", "radius_extra", "via=$hdr(Via[*]); email=$avp(s:email)")
-
+
<varname>rad_time_mode</varname>(integer) - Radius Event-Timestamp for accounting. + Radius Event-Timestamp for accounting. Values can be: @@ -185,8 +194,8 @@ modparam("acc_radius", "radius_extra", "via=$hdr(Via[*]); email=$avp(s:email)") both radius server and client (For example: 1445590624.377372) - - + + Default value is 0 (Unix timestamp). @@ -203,14 +212,14 @@ modparam("acc_radius", "rad_time_mode", 1)
Functions -
+
<function moreinfo="none">acc_rad_request(comment)</function> - Like acc_log_request of acc module, - acc_rad_request reports on - a SIP request event. It reports to radius server as configured in + Like acc_log_request of acc module, + acc_rad_request reports on + a SIP request event. It reports to radius server as configured in radius_config. diff --git a/modules/alias_db/README b/modules/alias_db/README index 43fb9042055..21e64da5eed 100644 --- a/modules/alias_db/README +++ b/modules/alias_db/README @@ -14,9 +14,9 @@ Daniel-Constantin Mierla - Copyright 2005 Voice Sistem SRL + Copyright © 2005 Voice Sistem SRL - Copyright 2008 asipto.com + Copyright © 2008 asipto.com __________________________________________________________________ Table of Contents @@ -126,7 +126,7 @@ Chapter 1. Admin Guide Database URL. - Default value is "mysql://openserro:openserro@localhost/openser". + Default value is “mysql://kamailioro:kamailioro@localhost/kamailio”. Example 1.1. Set db_url parameter ... @@ -137,7 +137,7 @@ modparam("alias_db", "db_url", "dbdriver://username:password@dbhost/dbname") Name of the column storing username. - Default value is "username". + Default value is “username”. Example 1.2. Set user_column parameter ... @@ -148,7 +148,7 @@ modparam("alias_db", "user_column", "susername") Name of the column storing user's domain. - Default value is "domain". + Default value is “domain”. Example 1.3. Set domain_column parameter ... @@ -159,7 +159,7 @@ modparam("alias_db", "domain_column", "sdomain") Name of the column storing alias username. - Default value is "alias_username". + Default value is “alias_username”. Example 1.4. Set alias_user_column parameter ... @@ -170,7 +170,7 @@ modparam("alias_db", "alias_user_column", "auser") Name of the column storing alias domain. - Default value is "alias_domain". + Default value is “alias_domain”. Example 1.5. Set alias_domain_column parameter ... @@ -183,7 +183,7 @@ modparam("alias_db", "alias_domain_column", "adomain") for alias. If set to 0, the domain from R-URI is not used, if set to 1 the domain from R-URI is used. - Default value is "0". + Default value is “0”. Example 1.6. Set use_domain parameter ... @@ -195,7 +195,7 @@ modparam("alias_db", "use_domain", 1) Specifies the prefix to be stripped from the domain in R-URI before doing the search. - Default value is "NULL". + Default value is “NULL”. Example 1.7. Set domain_prefix parameter ... @@ -207,7 +207,7 @@ modparam("alias_db", "domain_prefix", "sip.") If the alias resolves to many SIP IDs, the first is replacing the R-URI, the rest are added as branches. - Default value is "0" (0 - don't add branches; 1 - add branches). + Default value is “0” (0 - don't add branches; 1 - add branches). Example 1.8. Set append_branches parameter ... @@ -218,7 +218,7 @@ modparam("alias_db", "append_branches", 1) 4.1. alias_db_lookup(table_name) -4.1. alias_db_lookup(table_name) +4.1. alias_db_lookup(table_name) The function takes the R-URI and search to see whether it is an alias or not. If it is an alias for a local user, the R-URI is replaced with diff --git a/modules/app_java/Makefile b/modules/app_java/Makefile index f3a40aef72e..c925b41feeb 100644 --- a/modules/app_java/Makefile +++ b/modules/app_java/Makefile @@ -1,6 +1,8 @@ -# +# # WARNING: do not run this directly, it should be run by the master Makefile +# to generate readme file on a system without java, use DOCBUILD=yes in make command + include ../../Makefile.defs auto_gen= NAME=app_java.so @@ -24,7 +26,9 @@ LIBS += $(shell pkg-config libgcj --libs) -L$(JAVA_HOME)/lib -ljvm # At this point I don't see any universal method as explicit setting this variable at the compile phase. # -- ez ifeq ($(shell [ -d "${JAVA_HOME}" -a -f "$(JAVA_HOME)/include/jni.h" -a -f "$(JAVA_HOME)/lib/libjvm.so" ] && echo 1 || echo 0),0) - $(error Can't locate Java Development Kit. You have to specify environment JAVA_HOME to build app_java) +ifneq ($(DOCBUILD),yes) +$(error Cannot locate Java Development Kit. You have to specify environment JAVA_HOME to build app_java) +endif endif ifeq ($(OS), freebsd) diff --git a/modules/app_java/README b/modules/app_java/README index f2aff398f5c..540fc06016a 100644 --- a/modules/app_java/README +++ b/modules/app_java/README @@ -6,7 +6,7 @@ Edited by Konstantin Mosesov - Copyright 2013, 2014 Konstantin Mosesov + Copyright © 2013, 2014 Konstantin Mosesov __________________________________________________________________ Table of Contents @@ -174,7 +174,7 @@ Chapter 1. Admin Guide The class name should have the same compiled file name. If the value is "Kamailio", then the compiled file should be named as "Kamailio.class". - Default value is "Kamailio". + Default value is “Kamailio”. Example 1.1. Set class_name parameter ... @@ -185,7 +185,7 @@ modparam("app_java", "class_name", "Kamailio") TBD. - Default value is "child_init". + Default value is “child_init”. Example 1.2. Set child_init_method parameter ... @@ -196,7 +196,7 @@ modparam("app_java", "child_init_method", "my_mod_init") Java options for Java Virtual Machine. For more info read java docs - Default value is "-Djava.compiler=NONE". + Default value is “-Djava.compiler=NONE”. Example 1.3. Set java_options parameter ... @@ -230,10 +230,10 @@ modparam("app_java", "java_options", "-Xdebug -verbose:gc,class,jni 4.4. force_cmd_exec (int) This parameter forces execution a kamailio comnmand with java native - method "KamExec". # Note: this is an untested yet feature, may cause + method “KamExec”. # Note: this is an untested yet feature, may cause (but may not) a memory leaks if used from embedded languages. - Default value is "0 (off)". + Default value is “0 (off)”. Example 1.7. Set force_cmd_exec parameter ... @@ -255,9 +255,9 @@ modparam("app_java", "force_cmd_exec", 1) 5.5. java_s_staticmethod_exec(method, method_signature, [param1[, param2[, ...]]]) -5.1. Common requirements +5.1. Common requirements - Each function has a required parameter "method_signature". For more + Each function has a required parameter “method_signature”. For more info see Determine the signature of a method. Signature represents the variable type. The mapping between the Java type and C type is Type Chararacter diff --git a/modules/app_java/java_msgobj.c b/modules/app_java/java_msgobj.c index 0a43786feaa..fc32849684f 100644 --- a/modules/app_java/java_msgobj.c +++ b/modules/app_java/java_msgobj.c @@ -230,7 +230,7 @@ jobject *fill_sipmsg_object(JNIEnv *env, struct sip_msg *msg) LM_ERR("%s: Can't find symbol org.siprouter.SipMsg.add_to_branch_s\n", APP_NAME); return NULL; } - jStrParam = (*env)->NewStringUTF(env, (msg->add_to_branch_len <= 0 || msg->add_to_branch_s == NULL) ? "" : strdup(msg->add_to_branch_s)); + jStrParam = (*env)->NewStringUTF(env, (msg->add_to_branch_len <= 0) ? "" : strdup(msg->add_to_branch_s)); (*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam); if ((*env)->ExceptionCheck(env)) { diff --git a/modules/app_lua/README b/modules/app_lua/README index 57687783971..d08c394bda7 100644 --- a/modules/app_lua/README +++ b/modules/app_lua/README @@ -10,7 +10,7 @@ Daniel-Constantin Mierla - Copyright 2010 Daniel-Constantin Mierla (asipto.com) + Copyright © 2010 Daniel-Constantin Mierla (asipto.com) __________________________________________________________________ Table of Contents @@ -130,7 +130,7 @@ Chapter 1. Admin Guide use lua_run(function, params) to execute a function from the script at runtime. - Default value is "null". + Default value is “null”. Example 1.1. Set load parameter ... @@ -174,7 +174,7 @@ modparam("app_lua", "load", "/usr/local/etc/kamailio/lua/myscript.lua") Note that 'sr', 'sr.hdr' and 'sr.pv' modules are always registered to Lua. - Default value is "null". + Default value is “null”. Example 1.2. Set register parameter ... @@ -186,7 +186,7 @@ modparam("app_lua", "register", "sl") If reload is 1 enables the ability to reload the scripts using the RPC app_lua.reload command. - Default value is "0 (off)". + Default value is “0 (off)”. Example 1.3. Set reload parameter ... @@ -200,7 +200,7 @@ modparam("app_lua", "reload", 1) 4.3. lua_run(function, params) 4.4. lua_runstring(script) -4.1. lua_dofile(path) +4.1. lua_dofile(path) Execute the Lua script stored in 'path'. The parameter can be a string with pseudo-variables evaluated at runtime. @@ -210,7 +210,7 @@ modparam("app_lua", "reload", 1) lua_dofile("/usr/local/etc/kamailio/lua/myscript.lua"); ... -4.2. lua_dostring(script) +4.2. lua_dostring(script) Execute the Lua script stored in parameter. The parameter can be a string with pseudo-variables. @@ -223,7 +223,7 @@ if(!lua_dostring("sr.log([[err]], [[----------- Hello World from $fU\n]])")) } ... -4.3. lua_run(function, params) +4.3. lua_run(function, params) Execute the Lua function 'func' giving params as parameters. There can be up to 3 string parameters. The function must exist in the script @@ -240,7 +240,7 @@ if(!lua_run("sr_append_fu_to_reply")) lua_run("lua_funcx", "$rU", "2"); ... -4.4. lua_runstring(script) +4.4. lua_runstring(script) Execute the Lua script stored in parameter. The parameter can be a string with pseudo-variables. The script is executed in Lua context @@ -259,7 +259,7 @@ if(!lua_runstring("sr.log([[err]], [[----------- Hello World from $fU\n]])")) 5.1. app_lua.list 5.2. app_lua.reload -5.1. app_lua.list +5.1. app_lua.list Lists the id and path for every script loaded by the load parameter. @@ -270,7 +270,7 @@ if(!lua_runstring("sr.log([[err]], [[----------- Hello World from $fU\n]])")) Example: kamcmd app_lua.lists -5.2. app_lua.reload +5.2. app_lua.reload Marks the need to reload the selected script. The actual reload is done by every working process when the next call to lua_run function is diff --git a/modules/app_lua/app_lua_sr.c b/modules/app_lua/app_lua_sr.c index 39fce4ac553..eb7e7d011f7 100644 --- a/modules/app_lua/app_lua_sr.c +++ b/modules/app_lua/app_lua_sr.c @@ -742,6 +742,12 @@ static int lua_sr_hdr_append (lua_State *L) memcpy(hdr, txt, len); anchor = anchor_lump(env_L->msg, hf->name.s + hf->len - env_L->msg->buf, 0, 0); + if(anchor==NULL) + { + LM_ERR("unable to get the anchor\n"); + pkg_free(hdr); + return 0; + } if(insert_new_lump_before(anchor, hdr, len, 0) == 0) { LM_ERR("can't insert lump\n"); diff --git a/modules/app_mono/README b/modules/app_mono/README index a2ca72c5f5b..52100a42a81 100644 --- a/modules/app_mono/README +++ b/modules/app_mono/README @@ -16,7 +16,7 @@ Alex Balashov - Copyright 2012 Daniel-Constantin Mierla (asipto.com) + Copyright © 2012 Daniel-Constantin Mierla (asipto.com) __________________________________________________________________ Table of Contents @@ -113,7 +113,7 @@ Chapter 1. Admin Guide Set the path to the Mono assembly to be loaded at startup. You can use mono_run(param) to execute the assembly at runtime. - Default value is "null". + Default value is “null”. Example 1.1. Set load parameter ... @@ -125,7 +125,7 @@ modparam("app_mono", "load", "/usr/local/etc/kamailio/mono/myscript.exe") 4.1. mono_exec(path [, param]) 4.2. mono_run([param]) -4.1. mono_exec(path [, param]) +4.1. mono_exec(path [, param]) Execute the managed code assembly stored in 'path'. The path can be a string with pseudo-variables evaluated at runtime. A second parameter @@ -140,7 +140,7 @@ modparam("app_mono", "load", "/usr/local/etc/kamailio/mono/myscript.exe") mono_exec("/usr/local/etc/kamailio/mono/myscript.exe"); ... -4.2. mono_run([param]) +4.2. mono_run([param]) Execute the assembly specified by 'load' module parameter. The assembly is loaded at startup, so changes to it will be effective only after diff --git a/modules/app_perl/README b/modules/app_perl/README index b8c75629e0c..7861bd85dff 100644 --- a/modules/app_perl/README +++ b/modules/app_perl/README @@ -8,7 +8,7 @@ Edited by Bastian Friedrich - Copyright 2007 Collax GmbH + Copyright © 2007 Collax GmbH __________________________________________________________________ Table of Contents @@ -330,7 +330,7 @@ if (perl_exec("ldap_alias")) { * IPC::Shareable perl module from CPAN Although SuSE delivers a lot of perl modules, others may have to be - fetched from CPAN. Consider using the program "cpan2rpm" - which, in + fetched from CPAN. Consider using the program “cpan2rpm” - which, in turn, is available on CPAN. It creates RPM files from CPAN. 5. Parameters @@ -343,7 +343,7 @@ if (perl_exec("ldap_alias")) { 5.1. filename (string) This is the file name of your script. This may be set once only, but it - may include an arbitary number of functions and "use" as many Perl + may include an arbitary number of functions and “use” as many Perl module as necessary. Must not be empty! @@ -357,9 +357,9 @@ modparam("app_perl", "filename", "/home/test/kamailio/myperl.pl") The path to the Perl modules included (Kamailio.pm et.al). It is not absolutely crucial to set this path, as you may install the Modules in - Perl's standard path, or update the "%INC" variable from within your + Perl's standard path, or update the “%INC” variable from within your script. Using this module parameter is the standard behavior, though. - Multiple paths may be specified by separating them with a ":" + Multiple paths may be specified by separating them with a “:” character. The maximum is 10 paths. Example 1.2. Set modpath parameter @@ -404,7 +404,7 @@ modparam("app_perl", "perl_destroy_func", "my_perl_destroy") 6.1. perl_exec_simple(func, [param]) 6.2. perl_exec(func, [param]) -6.1. perl_exec_simple(func, [param]) +6.1. perl_exec_simple(func, [param]) Calls a perl function without passing it the current SIP message. May be used for very simple simple requests that do not have to fiddle with @@ -424,7 +424,7 @@ if (method=="INVITE") { }; ... -6.2. perl_exec(func, [param]) +6.2. perl_exec(func, [param]) Calls a perl function with passing it the current SIP message. The SIP message is reflected by a Perl module that gives you access to the @@ -448,7 +448,7 @@ if (perl_exec("ldapalias")) { 7.1. app_perl.set_reset_cycles 7.2. app_perl.get_reset_cycles -7.1. app_perl.set_reset_cycles +7.1. app_perl.set_reset_cycles Set the value of the reset_cycle. The command has one integer parameter. @@ -458,7 +458,7 @@ if (perl_exec("ldapalias")) { kamcmd app_perl.set_reset_cycles 20000 ... -7.2. app_perl.get_reset_cycles +7.2. app_perl.get_reset_cycles Return the value of the reset_cycle. @@ -678,7 +678,7 @@ Kamailio::log(L_INFO, "foobar"); my $ruri = $m->getRURI(); - getRURI returns a string. See "getParsedRURI()" below how to receive a + getRURI returns a string. See “getParsedRURI()” below how to receive a parsed structure. This function is valid in request messages only. @@ -1521,11 +1521,11 @@ Chapter 3. Perl samples 1.1.9. phonenumbers.pl 1.1.10. pseudovars.pl - There are a number of example scripts in the "samples/". They are + There are a number of example scripts in the “samples/”. They are documented well. Read them, it will explain a lot to you :) If you want to use any of these scripts directly in your - implementation, you can use Perl's "require" mechanism to import them + implementation, you can use Perl's “require” mechanism to import them (just remember that you need to use quotes when require'ing .pl files). 1.1. Script descriptions @@ -1562,7 +1562,7 @@ Chapter 3. Perl samples functions from within perl, and the different types of functions you can offer for Kamailio access. - "exportedfuncs" simply demonstrates that you can use the moduleFunction + “exportedfuncs” simply demonstrates that you can use the moduleFunction method to call functions offered by other modules. The results are equivalent to calling these functions from your config file. In the demonstrated case, telephone calls with a destination number beginning @@ -1572,13 +1572,13 @@ Chapter 3. Perl samples Please note that the moduleFunction method is not fully available in Kamailio 1.2. See the method's documentation for details. - "paramfunc" shows that you can pass arbitrary strings to perl + “paramfunc” shows that you can pass arbitrary strings to perl functions. Do with them whatever you want :) - "autotest" demonstrates that unknown functions in Kamailio::Message + “autotest” demonstrates that unknown functions in Kamailio::Message objects are automatically transformed into calls to module functions. - The "diefunc"s show that dying perl scripts - by "manual" dying, or + The “diefunc”s show that dying perl scripts - by "manual" dying, or because of script errors - are handled by the Kamailio package. The error message is logged through Kamailio's logging mechanism. Please note that this only works correctly if you do NOT overwrite the default @@ -1590,22 +1590,22 @@ Chapter 3. Perl samples processing SIP messages. This sample script demonstrates access to header names and values within two sample functions. - "headernames" extracts all header names and logs their names. + “headernames” extracts all header names and logs their names. - "someheaders" logs the contents of the two headers, "To" and - "WWW-Contact". As you can see, headers that occur more than once are + “someheaders” logs the contents of the two headers, “To” and + “WWW-Contact”. As you can see, headers that occur more than once are retrieved as an array, which may be accessed by Perl's array accessing methods. 1.1.6. logging.pl For debugging purposes, you probably want to write messages to the - syslog. The "logdemo" shows three ways to access the Kamailio log + syslog. The “logdemo” shows three ways to access the Kamailio log function: it is available through the Kamailio class as well as through the Kamailio::Message class. Remember that you can use exported functions from other modules. You - may thus as well use the "xlog" module and it's xlog function. + may thus as well use the “xlog” module and it's xlog function. The L_INFO, L_DBG, L_ERR, L_CRIT... constants are available through the Kamailio::Constants package. @@ -1634,7 +1634,7 @@ Chapter 3. Perl samples 1.1.10. pseudovars.pl - This script demonstrates the Perl module's "pseudoVar" method. It may + This script demonstrates the Perl module's “pseudoVar” method. It may be used to retrieve the values of current pseudo variables. You might notice that there is no particular function for setting @@ -1650,48 +1650,48 @@ Chapter 4. Frequently Asked Questions 4.1. - Are there known bugs in the Perl module? - - The Perl module does have a few shortcomings that may be regarded as - bugs. - * Missing module functions. Not all functions of other modules are - available for Perl access. The reason for this is a design property - of Kamailio. Making available more functions is work in progress. - * Perl and threads. Perl itself is, when compiled with the correct - parameters, thread safe; unfortunately, not all Perl modules are. - The DBI modules, especially (but not restricted to) DBI::ODBC are - known NOT to be thread safe. - Using DBI::ODBC -- and possibly other non-thread-safe Perl - extensions -- may result in erroneous behavior of Kamailio, - including (but not restricted to) server crashes and wrong routing. + Are there known bugs in the Perl module? + + The Perl module does have a few shortcomings that may be regarded as + bugs. + * Missing module functions. Not all functions of other modules are + available for Perl access. The reason for this is a design property + of Kamailio. Making available more functions is work in progress. + * Perl and threads. Perl itself is, when compiled with the correct + parameters, thread safe; unfortunately, not all Perl modules are. + The DBI modules, especially (but not restricted to) DBI::ODBC are + known NOT to be thread safe. + Using DBI::ODBC -- and possibly other non-thread-safe Perl + extensions -- may result in erroneous behavior of Kamailio, + including (but not restricted to) server crashes and wrong routing. 4.2. - Where can I find more about Kamailio? + Where can I find more about Kamailio? - Take a look at http://www.kamailio.org/. + Take a look at http://www.kamailio.org/. 4.3. - Where can I post a question about this module? + Where can I post a question about this module? - First at all check if your question was already answered on one of our - mailing lists: - * User Mailing List - - http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users - * Developer Mailing List - - http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev + First at all check if your question was already answered on one of our + mailing lists: + * User Mailing List - + http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users + * Developer Mailing List - + http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev - E-mails regarding any stable Kamailio release should be sent to - and e-mails regarding development - versions should be sent to . + E-mails regarding any stable Kamailio release should be sent to + and e-mails regarding development + versions should be sent to . - If you want to keep the mail private, send it to - . + If you want to keep the mail private, send it to + . 4.4. - How can I report a bug? + How can I report a bug? - Please follow the guidelines provided at: - http://sip-router.org/tracker. + Please follow the guidelines provided at: + https://github.com/kamailio/kamailio/issues. diff --git a/modules/app_perl/lib/perl/Kamailio/LDAPUtils/LDAPConnection.pm b/modules/app_perl/lib/perl/Kamailio/LDAPUtils/LDAPConnection.pm index f97a22da1aa..3b6509aa4cc 100644 --- a/modules/app_perl/lib/perl/Kamailio/LDAPUtils/LDAPConnection.pm +++ b/modules/app_perl/lib/perl/Kamailio/LDAPUtils/LDAPConnection.pm @@ -52,7 +52,6 @@ package Kamailio::LDAPUtils::LDAPConnection; use Kamailio::LDAPUtils::LDAPConf; use Net::LDAP; use Authen::SASL; -use UNIVERSAL qw( isa ); my $ldap_singleton = undef; @@ -185,7 +184,7 @@ sub search { my $ldap = undef; - if( isa($conf ,"Kamailio::LDAPUtils::LDAPConnection") ) { + if( $conf->isa("Kamailio::LDAPUtils::LDAPConnection") ) { $ldap = $conf; } else { if( ! $ldap_singleton ) { diff --git a/modules/app_perl/lib/perl/Kamailio/VDB.pm b/modules/app_perl/lib/perl/Kamailio/VDB.pm index 8c6bdb30ab1..0fff716fc08 100644 --- a/modules/app_perl/lib/perl/Kamailio/VDB.pm +++ b/modules/app_perl/lib/perl/Kamailio/VDB.pm @@ -45,7 +45,6 @@ use Kamailio::VDB::Result; use Kamailio::VDB::Value; use Kamailio::VDB::VTab; -use UNIVERSAL qw ( can ); our @ISA = qw ( Kamailio::Utils::Debug ); @@ -87,12 +86,12 @@ sub use_table { Kamailio::log(L_DBG, "perlvdb:VDB: Setting VTab: v is $v (pkg is $pkg, func/method is $3)\n"); - if (can($pkg, $3)) { + if ($pkg->can($3)) { $self->{vtabs}->{$v} = new Kamailio::VDB::VTab( func => $pkg . "::" . $3); - } elsif (can($v, "init")) { + } elsif ($v->can("init")) { $v->init(); $self->{vtabs}->{$v} = new Kamailio::VDB::VTab( obj => $v ); - } elsif (can($v, "new")) { + } elsif ($v->can("new")) { my $obj = $v->new(); $self->{vtabs}->{$v} = new Kamailio::VDB::VTab( obj => $obj ); } else { diff --git a/modules/app_python/README b/modules/app_python/README index 243f9cc9d0a..cf5821b4860 100644 --- a/modules/app_python/README +++ b/modules/app_python/README @@ -6,7 +6,7 @@ Edited by Maxim Sobolev - Copyright 2010 Maxim Sobolev + Copyright © 2010 Maxim Sobolev __________________________________________________________________ Table of Contents @@ -92,7 +92,7 @@ Chapter 1. Admin Guide The path to the fiel with Python code to be executed from configuration file. - Default value is "/usr/local/etc/kamailio/handler.py". + Default value is “/usr/local/etc/kamailio/handler.py”. Example 1.1. Set script_name parameter ... @@ -104,7 +104,7 @@ modparam("app_python", "script_name", "/usr/local/etc/kamailio/myscript.py") The Python function to be executed by this module when it is initialied by Kamailio. - Default value is "mod_init". + Default value is “mod_init”. Example 1.2. Set mod_init_function parameter ... @@ -116,7 +116,7 @@ modparam("app_python", "mod_init_function", "my_mod_init") The Python function to be executed by this module when a new worker process (child) is initialied by Kamailio. - Default value is "child_init". + Default value is “child_init”. Example 1.3. Set child_init_method parameter ... @@ -127,7 +127,7 @@ modparam("app_python", "child_init_method", "my_child_init") 4.1. python_exec(method [, args]) -4.1. python_exec(method [, args]) +4.1. python_exec(method [, args]) Execute the Python function with the name given by the parameter 'method'. Optionally can be provided a second string with parameters to diff --git a/modules/app_python/mod_Core.c b/modules/app_python/mod_Core.c index cbd0f63dc24..c226d54e097 100644 --- a/modules/app_python/mod_Core.c +++ b/modules/app_python/mod_Core.c @@ -42,27 +42,27 @@ #include "mod_Core.h" PyMethodDef CoreMethods[] = { - {NULL, NULL, 0, NULL} + {NULL, NULL, 0, NULL} }; void init_mod_Core(void) { - core_module = Py_InitModule("Router.Core", CoreMethods); - PyDict_SetItemString(main_module_dict, "Core", core_module); + core_module = Py_InitModule("Router.Core", CoreMethods); + PyDict_SetItemString(main_module_dict, "Core", core_module); - Py_INCREF(core_module); + Py_INCREF(core_module); #ifdef WITH_EXTRA_DEBUG - LM_ERR("Module 'Router.Core' has been initialized\n"); + LM_ERR("Module 'Router.Core' has been initialized\n"); #endif } void destroy_mod_Core(void) { - Py_XDECREF(core_module); + Py_XDECREF(core_module); #ifdef WITH_EXTRA_DEBUG - LM_ERR("Module 'Router.Core' has been destroyed\n"); + LM_ERR("Module 'Router.Core' has been destroyed\n"); #endif } diff --git a/modules/app_python/mod_Logger.c b/modules/app_python/mod_Logger.c index 0d942165f39..23cb37358db 100644 --- a/modules/app_python/mod_Logger.c +++ b/modules/app_python/mod_Logger.c @@ -46,16 +46,16 @@ */ static PyObject *logger_LM_GEN1(PyObject *self, PyObject *args) { - int log_level; - char *msg; + int log_level; + char *msg; - if (!PyArg_ParseTuple(args, "is:LM_GEN1", &log_level, &msg)) - return NULL; + if (!PyArg_ParseTuple(args, "is:LM_GEN1", &log_level, &msg)) + return NULL; - LM_GEN1(log_level, "%s", msg); + LM_GEN1(log_level, "%s", msg); - Py_INCREF(Py_None); - return Py_None; + Py_INCREF(Py_None); + return Py_None; } /* @@ -63,17 +63,17 @@ static PyObject *logger_LM_GEN1(PyObject *self, PyObject *args) */ static PyObject *logger_LM_GEN2(PyObject *self, PyObject *args) { - int log_facility; - int log_level; - char *msg; + int log_facility; + int log_level; + char *msg; - if(!PyArg_ParseTuple(args, "iis:LM_GEN2", &log_facility, &log_level, &msg)) - return NULL; + if(!PyArg_ParseTuple(args, "iis:LM_GEN2", &log_facility, &log_level, &msg)) + return NULL; - LM_GEN2(log_facility, log_level, "%s", msg); + LM_GEN2(log_facility, log_level, "%s", msg); - Py_INCREF(Py_None); - return Py_None; + Py_INCREF(Py_None); + return Py_None; } /* @@ -81,15 +81,15 @@ static PyObject *logger_LM_GEN2(PyObject *self, PyObject *args) */ static PyObject *logger_LM_ALERT(PyObject *self, PyObject *args) { - char *msg; + char *msg; - if(!PyArg_ParseTuple(args, "s:LM_ALERT", &msg)) - return NULL; + if(!PyArg_ParseTuple(args, "s:LM_ALERT", &msg)) + return NULL; - LM_ALERT("%s", msg); + LM_ALERT("%s", msg); - Py_INCREF(Py_None); - return Py_None; + Py_INCREF(Py_None); + return Py_None; } @@ -98,15 +98,15 @@ static PyObject *logger_LM_ALERT(PyObject *self, PyObject *args) */ static PyObject *logger_LM_CRIT(PyObject *self, PyObject *args) { - char *msg; + char *msg; - if(!PyArg_ParseTuple(args, "s:LM_CRIT", &msg)) - return NULL; + if(!PyArg_ParseTuple(args, "s:LM_CRIT", &msg)) + return NULL; - LM_CRIT("%s", msg); + LM_CRIT("%s", msg); - Py_INCREF(Py_None); - return Py_None; + Py_INCREF(Py_None); + return Py_None; } /* @@ -114,15 +114,15 @@ static PyObject *logger_LM_CRIT(PyObject *self, PyObject *args) */ static PyObject *logger_LM_WARN(PyObject *self, PyObject *args) { - char *msg; + char *msg; - if(!PyArg_ParseTuple(args, "s:LM_WARN", &msg)) - return NULL; + if(!PyArg_ParseTuple(args, "s:LM_WARN", &msg)) + return NULL; - LM_WARN("%s", msg); + LM_WARN("%s", msg); - Py_INCREF(Py_None); - return Py_None; + Py_INCREF(Py_None); + return Py_None; } /* @@ -130,15 +130,15 @@ static PyObject *logger_LM_WARN(PyObject *self, PyObject *args) */ static PyObject *logger_LM_NOTICE(PyObject *self, PyObject *args) { - char *msg; + char *msg; - if(!PyArg_ParseTuple(args, "s:LM_NOTICE", &msg)) - return NULL; + if(!PyArg_ParseTuple(args, "s:LM_NOTICE", &msg)) + return NULL; - LM_NOTICE("%s", msg); + LM_NOTICE("%s", msg); - Py_INCREF(Py_None); - return Py_None; + Py_INCREF(Py_None); + return Py_None; } /* @@ -146,15 +146,15 @@ static PyObject *logger_LM_NOTICE(PyObject *self, PyObject *args) */ static PyObject *logger_LM_ERR(PyObject *self, PyObject *args) { - char *msg; + char *msg; - if(!PyArg_ParseTuple(args, "s:LM_ERR", &msg)) - return NULL; + if(!PyArg_ParseTuple(args, "s:LM_ERR", &msg)) + return NULL; - LM_ERR("%s", msg); + LM_ERR("%s", msg); - Py_INCREF(Py_None); - return Py_None; + Py_INCREF(Py_None); + return Py_None; } /* @@ -162,15 +162,15 @@ static PyObject *logger_LM_ERR(PyObject *self, PyObject *args) */ static PyObject *logger_LM_INFO(PyObject *self, PyObject *args) { - char *msg; + char *msg; - if(!PyArg_ParseTuple(args, "s:LM_INFO", &msg)) - return NULL; + if(!PyArg_ParseTuple(args, "s:LM_INFO", &msg)) + return NULL; - LM_INFO("%s", msg); + LM_INFO("%s", msg); - Py_INCREF(Py_None); - return Py_None; + Py_INCREF(Py_None); + return Py_None; } /* @@ -178,69 +178,69 @@ static PyObject *logger_LM_INFO(PyObject *self, PyObject *args) */ static PyObject *logger_LM_DBG(PyObject *self, PyObject *args) { - char *msg; + char *msg; - if(!PyArg_ParseTuple(args, "s:LM_DBG", &msg)) - return NULL; + if(!PyArg_ParseTuple(args, "s:LM_DBG", &msg)) + return NULL; - LM_DBG("%s", msg); + LM_DBG("%s", msg); - Py_INCREF(Py_None); - return Py_None; + Py_INCREF(Py_None); + return Py_None; } PyMethodDef LoggerMethods[] = { - {"LM_GEN1", (PyCFunction)logger_LM_GEN1, METH_VARARGS, "Print GEN1 message."}, - {"LM_GEN2", (PyCFunction)logger_LM_GEN2, METH_VARARGS, "Print GEN2 message."}, - {"LM_ALERT", (PyCFunction)logger_LM_ALERT, METH_VARARGS, "Print alert message."}, - {"LM_CRIT", (PyCFunction)logger_LM_CRIT, METH_VARARGS, "Print critical message."}, - {"LM_ERR", (PyCFunction)logger_LM_ERR, METH_VARARGS, "Print error message."}, - {"LM_WARN", (PyCFunction)logger_LM_WARN, METH_VARARGS, "Print warning message."}, - {"LM_NOTICE", (PyCFunction)logger_LM_NOTICE, METH_VARARGS, "Print notice message."}, - {"LM_INFO", (PyCFunction)logger_LM_INFO, METH_VARARGS, "Print info message."}, - {"LM_DBG", (PyCFunction)logger_LM_DBG, METH_VARARGS, "Print debug message."}, - {NULL, NULL, 0, NULL} + {"LM_GEN1", (PyCFunction)logger_LM_GEN1, METH_VARARGS, "Print GEN1 message."}, + {"LM_GEN2", (PyCFunction)logger_LM_GEN2, METH_VARARGS, "Print GEN2 message."}, + {"LM_ALERT", (PyCFunction)logger_LM_ALERT, METH_VARARGS, "Print alert message."}, + {"LM_CRIT", (PyCFunction)logger_LM_CRIT, METH_VARARGS, "Print critical message."}, + {"LM_ERR", (PyCFunction)logger_LM_ERR, METH_VARARGS, "Print error message."}, + {"LM_WARN", (PyCFunction)logger_LM_WARN, METH_VARARGS, "Print warning message."}, + {"LM_NOTICE", (PyCFunction)logger_LM_NOTICE, METH_VARARGS, "Print notice message."}, + {"LM_INFO", (PyCFunction)logger_LM_INFO, METH_VARARGS, "Print info message."}, + {"LM_DBG", (PyCFunction)logger_LM_DBG, METH_VARARGS, "Print debug message."}, + {NULL, NULL, 0, NULL} }; void init_mod_Logger(void) { - logger_module = Py_InitModule("Router.Logger", LoggerMethods); - PyDict_SetItemString(main_module_dict, "Logger", logger_module); - - /* - * Log levels - * Reference: dprint.h - */ - PyModule_AddObject(logger_module, "L_ALERT", PyInt_FromLong((long)L_ALERT)); - PyModule_AddObject(logger_module, "L_BUG", PyInt_FromLong((long)L_BUG)); - PyModule_AddObject(logger_module, "L_CRIT2", PyInt_FromLong((long)L_CRIT2)); /* like L_CRIT, but adds prefix */ - PyModule_AddObject(logger_module, "L_CRIT", PyInt_FromLong((long)L_CRIT)); /* no prefix added */ - PyModule_AddObject(logger_module, "L_ERR", PyInt_FromLong((long)L_ERR)); - PyModule_AddObject(logger_module, "L_WARN", PyInt_FromLong((long)L_WARN)); - PyModule_AddObject(logger_module, "L_NOTICE", PyInt_FromLong((long)L_NOTICE)); - PyModule_AddObject(logger_module, "L_INFO", PyInt_FromLong((long)L_INFO)); - PyModule_AddObject(logger_module, "L_DBG", PyInt_FromLong((long)L_DBG)); - - /* - * Facility - * Reference: dprint.h - */ - PyModule_AddObject(logger_module, "DEFAULT_FACILITY", PyInt_FromLong((long)DEFAULT_FACILITY)); - - Py_INCREF(logger_module); + logger_module = Py_InitModule("Router.Logger", LoggerMethods); + PyDict_SetItemString(main_module_dict, "Logger", logger_module); + + /* + * Log levels + * Reference: dprint.h + */ + PyModule_AddObject(logger_module, "L_ALERT", PyInt_FromLong((long)L_ALERT)); + PyModule_AddObject(logger_module, "L_BUG", PyInt_FromLong((long)L_BUG)); + PyModule_AddObject(logger_module, "L_CRIT2", PyInt_FromLong((long)L_CRIT2)); /* like L_CRIT, but adds prefix */ + PyModule_AddObject(logger_module, "L_CRIT", PyInt_FromLong((long)L_CRIT)); /* no prefix added */ + PyModule_AddObject(logger_module, "L_ERR", PyInt_FromLong((long)L_ERR)); + PyModule_AddObject(logger_module, "L_WARN", PyInt_FromLong((long)L_WARN)); + PyModule_AddObject(logger_module, "L_NOTICE", PyInt_FromLong((long)L_NOTICE)); + PyModule_AddObject(logger_module, "L_INFO", PyInt_FromLong((long)L_INFO)); + PyModule_AddObject(logger_module, "L_DBG", PyInt_FromLong((long)L_DBG)); + + /* + * Facility + * Reference: dprint.h + */ + PyModule_AddObject(logger_module, "DEFAULT_FACILITY", PyInt_FromLong((long)DEFAULT_FACILITY)); + + Py_INCREF(logger_module); #ifdef WITH_EXTRA_DEBUG - LM_ERR("Module 'Router.Logger' has been initialized\n"); + LM_ERR("Module 'Router.Logger' has been initialized\n"); #endif } void destroy_mod_Logger(void) { - Py_XDECREF(logger_module); + Py_XDECREF(logger_module); #ifdef WITH_EXTRA_DEBUG - LM_ERR("Module 'Router.Logger' has been destroyed\n"); + LM_ERR("Module 'Router.Logger' has been destroyed\n"); #endif } diff --git a/modules/app_python/mod_Ranks.c b/modules/app_python/mod_Ranks.c index 128390cd72d..6c8f0d9da6e 100644 --- a/modules/app_python/mod_Ranks.c +++ b/modules/app_python/mod_Ranks.c @@ -42,41 +42,41 @@ #include "mod_Ranks.h" PyMethodDef RanksMethods[] = { - {NULL, NULL, 0, NULL} + {NULL, NULL, 0, NULL} }; void init_mod_Ranks(void) { - ranks_module = Py_InitModule("Router.Ranks", RanksMethods); - PyDict_SetItemString(main_module_dict, "Ranks", ranks_module); + ranks_module = Py_InitModule("Router.Ranks", RanksMethods); + PyDict_SetItemString(main_module_dict, "Ranks", ranks_module); - PyModule_AddObject(ranks_module, "PROC_MAIN", PyInt_FromLong((long)PROC_MAIN)); - PyModule_AddObject(ranks_module, "PROC_TIMER", PyInt_FromLong((long)PROC_TIMER)); - PyModule_AddObject(ranks_module, "PROC_RPC", PyInt_FromLong((long)PROC_RPC)); - PyModule_AddObject(ranks_module, "PROC_FIFO", PyInt_FromLong((long)PROC_FIFO)); - PyModule_AddObject(ranks_module, "PROC_TCP_MAIN", PyInt_FromLong((long)PROC_TCP_MAIN)); - PyModule_AddObject(ranks_module, "PROC_UNIXSOCK", PyInt_FromLong((long)PROC_UNIXSOCK)); - PyModule_AddObject(ranks_module, "PROC_ATTENDANT", PyInt_FromLong((long)PROC_ATTENDANT)); - PyModule_AddObject(ranks_module, "PROC_INIT", PyInt_FromLong((long)PROC_INIT)); - PyModule_AddObject(ranks_module, "PROC_NOCHLDINIT", PyInt_FromLong((long)PROC_NOCHLDINIT)); - PyModule_AddObject(ranks_module, "PROC_SIPINIT", PyInt_FromLong((long)PROC_SIPINIT)); - PyModule_AddObject(ranks_module, "PROC_SIPRPC", PyInt_FromLong((long)PROC_SIPRPC)); - PyModule_AddObject(ranks_module, "PROC_MIN", PyInt_FromLong((long)PROC_MIN)); + PyModule_AddObject(ranks_module, "PROC_MAIN", PyInt_FromLong((long)PROC_MAIN)); + PyModule_AddObject(ranks_module, "PROC_TIMER", PyInt_FromLong((long)PROC_TIMER)); + PyModule_AddObject(ranks_module, "PROC_RPC", PyInt_FromLong((long)PROC_RPC)); + PyModule_AddObject(ranks_module, "PROC_FIFO", PyInt_FromLong((long)PROC_FIFO)); + PyModule_AddObject(ranks_module, "PROC_TCP_MAIN", PyInt_FromLong((long)PROC_TCP_MAIN)); + PyModule_AddObject(ranks_module, "PROC_UNIXSOCK", PyInt_FromLong((long)PROC_UNIXSOCK)); + PyModule_AddObject(ranks_module, "PROC_ATTENDANT", PyInt_FromLong((long)PROC_ATTENDANT)); + PyModule_AddObject(ranks_module, "PROC_INIT", PyInt_FromLong((long)PROC_INIT)); + PyModule_AddObject(ranks_module, "PROC_NOCHLDINIT", PyInt_FromLong((long)PROC_NOCHLDINIT)); + PyModule_AddObject(ranks_module, "PROC_SIPINIT", PyInt_FromLong((long)PROC_SIPINIT)); + PyModule_AddObject(ranks_module, "PROC_SIPRPC", PyInt_FromLong((long)PROC_SIPRPC)); + PyModule_AddObject(ranks_module, "PROC_MIN", PyInt_FromLong((long)PROC_MIN)); - Py_INCREF(ranks_module); + Py_INCREF(ranks_module); #ifdef WITH_EXTRA_DEBUG - LM_ERR("Module 'Router.Ranks' has been initialized\n"); + LM_ERR("Module 'Router.Ranks' has been initialized\n"); #endif } void destroy_mod_Ranks(void) { - Py_XDECREF(ranks_module); + Py_XDECREF(ranks_module); #ifdef WITH_EXTRA_DEBUG - LM_ERR("Module 'Router.Ranks' has been destroyed\n"); + LM_ERR("Module 'Router.Ranks' has been destroyed\n"); #endif } diff --git a/modules/app_python/mod_Router.c b/modules/app_python/mod_Router.c index c6da323a6e2..3de1964c09d 100644 --- a/modules/app_python/mod_Router.c +++ b/modules/app_python/mod_Router.c @@ -41,29 +41,29 @@ PyMethodDef RouterMethods[] = { - {NULL, NULL, 0, NULL} + {NULL, NULL, 0, NULL} }; void init_mod_Router(void) { - main_module = Py_InitModule("Router", RouterMethods); - main_module_dict = PyModule_GetDict(main_module); + main_module = Py_InitModule("Router", RouterMethods); + main_module_dict = PyModule_GetDict(main_module); - Py_INCREF(main_module); + Py_INCREF(main_module); #ifdef WITH_EXTRA_DEBUG - LM_ERR("Module 'Router' has been initialized\n"); + LM_ERR("Module 'Router' has been initialized\n"); #endif } void destroy_mod_Router(void) { - Py_XDECREF(main_module); - Py_XDECREF(main_module_dict); + Py_XDECREF(main_module); + Py_XDECREF(main_module_dict); #ifdef WITH_EXTRA_DEBUG - LM_ERR("Module 'Router' has been destroyed\n"); + LM_ERR("Module 'Router' has been destroyed\n"); #endif } diff --git a/modules/app_python/python_iface.c b/modules/app_python/python_iface.c index 92699c2c74b..485ff4272e5 100644 --- a/modules/app_python/python_iface.c +++ b/modules/app_python/python_iface.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2009 Sippy Software, Inc., http://www.sippysoft.com * * This file is part of Kamailio, a free SIP server. @@ -38,11 +38,11 @@ int ap_init_modules(void) { - init_mod_Router(); - init_mod_Core(); - init_mod_Ranks(); - init_mod_Logger(); + init_mod_Router(); + init_mod_Core(); + init_mod_Ranks(); + init_mod_Logger(); - return 0; + return 0; } diff --git a/modules/app_python/python_mod.c b/modules/app_python/python_mod.c index 7cc7a2ecba8..5f568269f5d 100644 --- a/modules/app_python/python_mod.c +++ b/modules/app_python/python_mod.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * -*/ + */ #include #include @@ -55,330 +55,342 @@ PyThreadState *myThreadState; /** module parameters */ static param_export_t params[]={ - {"script_name", PARAM_STR, &script_name }, - {"mod_init_function", PARAM_STR, &mod_init_fname }, - {"child_init_method", PARAM_STR, &child_init_mname }, - {0,0,0} + {"script_name", PARAM_STR, &script_name }, + {"mod_init_function", PARAM_STR, &mod_init_fname }, + {"child_init_method", PARAM_STR, &child_init_mname }, + {0,0,0} }; /* * Exported functions */ static cmd_export_t cmds[] = { - { "python_exec", (cmd_function)python_exec1, 1, NULL, 0, ANY_ROUTE }, - { "python_exec", (cmd_function)python_exec2, 2, NULL, 0, ANY_ROUTE }, - { 0, 0, 0, 0, 0, 0 } + { "python_exec", (cmd_function)python_exec1, 1, NULL, 0, ANY_ROUTE }, + { "python_exec", (cmd_function)python_exec2, 2, NULL, 0, ANY_ROUTE }, + { 0, 0, 0, 0, 0, 0 } }; /** module exports */ struct module_exports exports = { - "app_python", /* module name */ - RTLD_NOW | RTLD_GLOBAL, /* dlopen flags */ - cmds, /* exported functions */ - params, /* exported parameters */ - 0, /* exported statistics */ - 0, /* exported MI functions */ - 0, /* exported pseudo-variables */ - 0, /* extra processes */ - mod_init, /* module initialization function */ - (response_function) NULL, /* response handling function */ - (destroy_function) mod_destroy, /* destroy function */ - child_init /* per-child init function */ + "app_python", /* module name */ + RTLD_NOW | RTLD_GLOBAL, /* dlopen flags */ + cmds, /* exported functions */ + params, /* exported parameters */ + 0, /* exported statistics */ + 0, /* exported MI functions */ + 0, /* exported pseudo-variables */ + 0, /* extra processes */ + mod_init, /* module initialization function */ + (response_function) NULL, /* response handling function */ + (destroy_function) mod_destroy, /* destroy function */ + child_init /* per-child init function */ }; static int mod_init(void) { - char *dname_src, *bname_src; - - int i; - PyObject *sys_path, *pDir, *pModule, *pFunc, *pArgs; - PyThreadState *mainThreadState; - - dname_src = as_asciiz(&script_name); - bname_src = as_asciiz(&script_name); - - if(dname_src==NULL || bname_src==NULL) - { - LM_ERR("no more pkg memory\n"); - return -1; - } - - dname = strdup(dirname(dname_src)); - if (strlen(dname) == 0) - dname = "."; - bname = strdup(basename(bname_src)); - i = strlen(bname); - if (bname[i - 1] == 'c' || bname[i - 1] == 'o') - i -= 1; - if (bname[i - 3] == '.' && bname[i - 2] == 'p' && bname[i - 1] == 'y') { - bname[i - 3] = '\0'; - } else { - LM_ERR("%s: script_name doesn't look like a python script\n", - script_name.s); - return -1; - } - - Py_Initialize(); - PyEval_InitThreads(); - mainThreadState = PyThreadState_Get(); - - format_exc_obj = InitTracebackModule(); - - if (format_exc_obj == NULL || !PyCallable_Check(format_exc_obj)) - { - Py_XDECREF(format_exc_obj); - PyEval_ReleaseLock(); - return -1; - } - - sys_path = PySys_GetObject("path"); - /* PySys_GetObject doesn't pass reference! No need to DEREF */ - if (sys_path == NULL) { - if (!PyErr_Occurred()) - PyErr_Format(PyExc_AttributeError, "'module' object 'sys' has no attribute 'path'"); - python_handle_exception("mod_init"); - Py_DECREF(format_exc_obj); - PyEval_ReleaseLock(); - return -1; - } - - pDir = PyString_FromString(dname); - if (pDir == NULL) { - if (!PyErr_Occurred()) - PyErr_Format(PyExc_AttributeError, "PyString_FromString() has failed"); - python_handle_exception("mod_init"); - Py_DECREF(format_exc_obj); - PyEval_ReleaseLock(); - return -1; - } - - PyList_Insert(sys_path, 0, pDir); - Py_DECREF(pDir); - - if (ap_init_modules() != 0) { - if (!PyErr_Occurred()) - PyErr_SetString(PyExc_AttributeError, "init_modules() has failed"); - python_handle_exception("mod_init"); - Py_DECREF(format_exc_obj); - PyEval_ReleaseLock(); - return -1; - } - - if (python_msgobj_init() != 0) { - if (!PyErr_Occurred()) - PyErr_SetString(PyExc_AttributeError, "python_msgobj_init() has failed"); - python_handle_exception("mod_init"); - Py_DECREF(format_exc_obj); - PyEval_ReleaseLock(); - return -1; - } - - pModule = PyImport_ImportModule(bname); - if (pModule == NULL) { - if (!PyErr_Occurred()) - PyErr_Format(PyExc_ImportError, "No module named '%s'", bname); - python_handle_exception("mod_init"); - Py_DECREF(format_exc_obj); - PyEval_ReleaseLock(); - return -1; - } - - pkg_free(dname_src); - pkg_free(bname_src); - - pFunc = PyObject_GetAttrString(pModule, mod_init_fname.s); - Py_DECREF(pModule); - - /* pFunc is a new reference */ - - if (pFunc == NULL) { - if (!PyErr_Occurred()) - PyErr_Format(PyExc_AttributeError, "'module' object '%s' has no attribute '%s'", bname, mod_init_fname.s); - python_handle_exception("mod_init"); - Py_DECREF(format_exc_obj); - Py_XDECREF(pFunc); - PyEval_ReleaseLock(); - return -1; - } - - if (!PyCallable_Check(pFunc)) { - if (!PyErr_Occurred()) - PyErr_Format(PyExc_AttributeError, "module object '%s' has is not callable attribute '%s'", bname, mod_init_fname.s); - python_handle_exception("mod_init"); - Py_DECREF(format_exc_obj); - Py_XDECREF(pFunc); - PyEval_ReleaseLock(); - return -1; - } - - - pArgs = PyTuple_New(0); - if (pArgs == NULL) { - python_handle_exception("mod_init"); - Py_DECREF(format_exc_obj); - Py_DECREF(pFunc); - PyEval_ReleaseLock(); - return -1; - } - - handler_obj = PyObject_CallObject(pFunc, pArgs); - - Py_XDECREF(pFunc); - Py_XDECREF(pArgs); - - if (handler_obj == Py_None) { - if (!PyErr_Occurred()) - PyErr_Format(PyExc_TypeError, "Function '%s' of module '%s' has returned None. Should be a class instance.", mod_init_fname.s, bname); - python_handle_exception("mod_init"); - Py_DECREF(format_exc_obj); - PyEval_ReleaseLock(); - return -1; - } - - if (PyErr_Occurred()) { - python_handle_exception("mod_init"); - Py_XDECREF(handler_obj); - Py_DECREF(format_exc_obj); - PyEval_ReleaseLock(); - return -1; - } - - if (handler_obj == NULL) { - LM_ERR("PyObject_CallObject() returned NULL but no exception!\n"); - if (!PyErr_Occurred()) - PyErr_Format(PyExc_TypeError, "Function '%s' of module '%s' has returned not returned object. Should be a class instance.", mod_init_fname.s, bname); - python_handle_exception("mod_init"); - Py_DECREF(format_exc_obj); - PyEval_ReleaseLock(); - return -1; - } - - myThreadState = PyThreadState_New(mainThreadState->interp); - PyEval_ReleaseLock(); - - return 0; -} + char *dname_src, *bname_src; + + int i; + PyObject *sys_path, *pDir, *pModule, *pFunc, *pArgs; + PyThreadState *mainThreadState; + + dname_src = as_asciiz(&script_name); + bname_src = as_asciiz(&script_name); + + if(dname_src==NULL || bname_src==NULL) + { + LM_ERR("no more pkg memory\n"); + return -1; + } + + dname = strdup(dirname(dname_src)); + if(dname==NULL) { + LM_ERR("no more system memory\n"); + return -1; + } + if (strlen(dname) == 0) { + free(dname); + dname = malloc(2); + if(dname==NULL) { + LM_ERR("no more system memory\n"); + return -1; + } + dname[0] = '.'; + dname[1] = '\0'; + } + bname = strdup(basename(bname_src)); + i = strlen(bname); + if (bname[i - 1] == 'c' || bname[i - 1] == 'o') + i -= 1; + if (bname[i - 3] == '.' && bname[i - 2] == 'p' && bname[i - 1] == 'y') { + bname[i - 3] = '\0'; + } else { + LM_ERR("%s: script_name doesn't look like a python script\n", + script_name.s); + return -1; + } + + Py_Initialize(); + PyEval_InitThreads(); + mainThreadState = PyThreadState_Get(); + + format_exc_obj = InitTracebackModule(); + + if (format_exc_obj == NULL || !PyCallable_Check(format_exc_obj)) + { + Py_XDECREF(format_exc_obj); + PyEval_ReleaseLock(); + return -1; + } + + sys_path = PySys_GetObject("path"); + /* PySys_GetObject doesn't pass reference! No need to DEREF */ + if (sys_path == NULL) { + if (!PyErr_Occurred()) + PyErr_Format(PyExc_AttributeError, "'module' object 'sys' has no attribute 'path'"); + python_handle_exception("mod_init"); + Py_DECREF(format_exc_obj); + PyEval_ReleaseLock(); + return -1; + } + + pDir = PyString_FromString(dname); + if (pDir == NULL) { + if (!PyErr_Occurred()) + PyErr_Format(PyExc_AttributeError, "PyString_FromString() has failed"); + python_handle_exception("mod_init"); + Py_DECREF(format_exc_obj); + PyEval_ReleaseLock(); + return -1; + } + + PyList_Insert(sys_path, 0, pDir); + Py_DECREF(pDir); + + if (ap_init_modules() != 0) { + if (!PyErr_Occurred()) + PyErr_SetString(PyExc_AttributeError, "init_modules() has failed"); + python_handle_exception("mod_init"); + Py_DECREF(format_exc_obj); + PyEval_ReleaseLock(); + return -1; + } + + if (python_msgobj_init() != 0) { + if (!PyErr_Occurred()) + PyErr_SetString(PyExc_AttributeError, "python_msgobj_init() has failed"); + python_handle_exception("mod_init"); + Py_DECREF(format_exc_obj); + PyEval_ReleaseLock(); + return -1; + } + + pModule = PyImport_ImportModule(bname); + if (pModule == NULL) { + if (!PyErr_Occurred()) + PyErr_Format(PyExc_ImportError, "No module named '%s'", bname); + python_handle_exception("mod_init"); + Py_DECREF(format_exc_obj); + PyEval_ReleaseLock(); + return -1; + } + + pkg_free(dname_src); + pkg_free(bname_src); + + pFunc = PyObject_GetAttrString(pModule, mod_init_fname.s); + Py_DECREF(pModule); + + /* pFunc is a new reference */ + + if (pFunc == NULL) { + if (!PyErr_Occurred()) + PyErr_Format(PyExc_AttributeError, "'module' object '%s' has no attribute '%s'", bname, mod_init_fname.s); + python_handle_exception("mod_init"); + Py_DECREF(format_exc_obj); + Py_XDECREF(pFunc); + PyEval_ReleaseLock(); + return -1; + } + + if (!PyCallable_Check(pFunc)) { + if (!PyErr_Occurred()) + PyErr_Format(PyExc_AttributeError, "module object '%s' has is not callable attribute '%s'", bname, mod_init_fname.s); + python_handle_exception("mod_init"); + Py_DECREF(format_exc_obj); + Py_XDECREF(pFunc); + PyEval_ReleaseLock(); + return -1; + } + + + pArgs = PyTuple_New(0); + if (pArgs == NULL) { + python_handle_exception("mod_init"); + Py_DECREF(format_exc_obj); + Py_DECREF(pFunc); + PyEval_ReleaseLock(); + return -1; + } + + handler_obj = PyObject_CallObject(pFunc, pArgs); -static int child_init(int rank) -{ - PyObject *pFunc, *pArgs, *pValue, *pResult; - int rval; - char *classname; - - PyEval_AcquireLock(); - PyThreadState_Swap(myThreadState); - - // get instance class name - classname = get_instance_class_name(handler_obj); - if (classname == NULL) - { - if (!PyErr_Occurred()) - PyErr_Format(PyExc_AttributeError, "'module' instance has no class name"); - python_handle_exception("child_init"); - Py_DECREF(format_exc_obj); - PyThreadState_Swap(NULL); + Py_XDECREF(pFunc); + Py_XDECREF(pArgs); + + if (handler_obj == Py_None) { + if (!PyErr_Occurred()) + PyErr_Format(PyExc_TypeError, "Function '%s' of module '%s' has returned None. Should be a class instance.", mod_init_fname.s, bname); + python_handle_exception("mod_init"); + Py_DECREF(format_exc_obj); + PyEval_ReleaseLock(); + return -1; + } + + if (PyErr_Occurred()) { + python_handle_exception("mod_init"); + Py_XDECREF(handler_obj); + Py_DECREF(format_exc_obj); + PyEval_ReleaseLock(); + return -1; + } + + if (handler_obj == NULL) { + LM_ERR("PyObject_CallObject() returned NULL but no exception!\n"); + if (!PyErr_Occurred()) + PyErr_Format(PyExc_TypeError, "Function '%s' of module '%s' has returned not returned object. Should be a class instance.", mod_init_fname.s, bname); + python_handle_exception("mod_init"); + Py_DECREF(format_exc_obj); + PyEval_ReleaseLock(); + return -1; + } + + myThreadState = PyThreadState_New(mainThreadState->interp); PyEval_ReleaseLock(); - return -1; - } - pFunc = PyObject_GetAttrString(handler_obj, child_init_mname.s); + return 0; +} - if (pFunc == NULL) { - python_handle_exception("child_init"); - Py_XDECREF(pFunc); - Py_DECREF(format_exc_obj); - PyThreadState_Swap(NULL); - PyEval_ReleaseLock(); - return -1; - } - - if (!PyCallable_Check(pFunc)) { - if (!PyErr_Occurred()) - PyErr_Format(PyExc_AttributeError, "class object '%s' has is not callable attribute '%s'", !classname ? "None" : classname, mod_init_fname.s); - python_handle_exception("child_init"); - Py_DECREF(format_exc_obj); - Py_XDECREF(pFunc); - PyThreadState_Swap(NULL); - PyEval_ReleaseLock(); - return -1; - } - - pArgs = PyTuple_New(1); - if (pArgs == NULL) { - python_handle_exception("child_init"); - Py_DECREF(format_exc_obj); - Py_DECREF(pFunc); - PyThreadState_Swap(NULL); - PyEval_ReleaseLock(); - return -1; - } - - pValue = PyInt_FromLong((long)rank); - if (pValue == NULL) { - python_handle_exception("child_init"); - Py_DECREF(format_exc_obj); - Py_DECREF(pArgs); - Py_DECREF(pFunc); - PyThreadState_Swap(NULL); - PyEval_ReleaseLock(); - return -1; - } - PyTuple_SetItem(pArgs, 0, pValue); - /* pValue has been stolen */ - - pResult = PyObject_CallObject(pFunc, pArgs); - Py_DECREF(pFunc); - Py_DECREF(pArgs); - - - - - if (PyErr_Occurred()) { - python_handle_exception("child_init"); - Py_DECREF(format_exc_obj); - Py_XDECREF(pResult); - PyThreadState_Swap(NULL); - PyEval_ReleaseLock(); - return -1; - } - - if (pResult == NULL) { - LM_ERR("PyObject_CallObject() returned NULL but no exception!\n"); - PyThreadState_Swap(NULL); - PyEval_ReleaseLock(); - return -1; - } - - if (!PyInt_Check(pResult)) - { - if (!PyErr_Occurred()) - PyErr_Format(PyExc_TypeError, "method '%s' of class '%s' should return 'int' type", child_init_mname.s, !classname ? "None" : classname); - python_handle_exception("child_init"); - Py_DECREF(format_exc_obj); - Py_XDECREF(pResult); +static int child_init(int rank) +{ + PyObject *pFunc, *pArgs, *pValue, *pResult; + int rval; + char *classname; + + PyEval_AcquireLock(); + PyThreadState_Swap(myThreadState); + + // get instance class name + classname = get_instance_class_name(handler_obj); + if (classname == NULL) + { + if (!PyErr_Occurred()) + PyErr_Format(PyExc_AttributeError, "'module' instance has no class name"); + python_handle_exception("child_init"); + Py_DECREF(format_exc_obj); + PyThreadState_Swap(NULL); + PyEval_ReleaseLock(); + return -1; + } + + pFunc = PyObject_GetAttrString(handler_obj, child_init_mname.s); + + if (pFunc == NULL) { + python_handle_exception("child_init"); + Py_XDECREF(pFunc); + Py_DECREF(format_exc_obj); + PyThreadState_Swap(NULL); + PyEval_ReleaseLock(); + return -1; + } + + if (!PyCallable_Check(pFunc)) { + if (!PyErr_Occurred()) + PyErr_Format(PyExc_AttributeError, "class object '%s' has is not callable attribute '%s'", !classname ? "None" : classname, mod_init_fname.s); + python_handle_exception("child_init"); + Py_DECREF(format_exc_obj); + Py_XDECREF(pFunc); + PyThreadState_Swap(NULL); + PyEval_ReleaseLock(); + return -1; + } + + pArgs = PyTuple_New(1); + if (pArgs == NULL) { + python_handle_exception("child_init"); + Py_DECREF(format_exc_obj); + Py_DECREF(pFunc); + PyThreadState_Swap(NULL); + PyEval_ReleaseLock(); + return -1; + } + + pValue = PyInt_FromLong((long)rank); + if (pValue == NULL) { + python_handle_exception("child_init"); + Py_DECREF(format_exc_obj); + Py_DECREF(pArgs); + Py_DECREF(pFunc); + PyThreadState_Swap(NULL); + PyEval_ReleaseLock(); + return -1; + } + PyTuple_SetItem(pArgs, 0, pValue); + /* pValue has been stolen */ + + pResult = PyObject_CallObject(pFunc, pArgs); + Py_DECREF(pFunc); + Py_DECREF(pArgs); + + + + + if (PyErr_Occurred()) { + python_handle_exception("child_init"); + Py_DECREF(format_exc_obj); + Py_XDECREF(pResult); + PyThreadState_Swap(NULL); + PyEval_ReleaseLock(); + return -1; + } + + if (pResult == NULL) { + LM_ERR("PyObject_CallObject() returned NULL but no exception!\n"); + PyThreadState_Swap(NULL); + PyEval_ReleaseLock(); + return -1; + } + + if (!PyInt_Check(pResult)) + { + if (!PyErr_Occurred()) + PyErr_Format(PyExc_TypeError, "method '%s' of class '%s' should return 'int' type", child_init_mname.s, !classname ? "None" : classname); + python_handle_exception("child_init"); + Py_DECREF(format_exc_obj); + Py_XDECREF(pResult); + PyThreadState_Swap(NULL); + PyEval_ReleaseLock(); + return -1; + } + + + rval = PyInt_AsLong(pResult); + Py_DECREF(pResult); PyThreadState_Swap(NULL); PyEval_ReleaseLock(); - return -1; - } - - - rval = PyInt_AsLong(pResult); - Py_DECREF(pResult); - PyThreadState_Swap(NULL); - PyEval_ReleaseLock(); - return rval; + return rval; } static void mod_destroy(void) { - if (dname) - free(dname); // dname was strdup'ed - if (bname) - free(bname); // bname was strdup'ed - - destroy_mod_Core(); - destroy_mod_Ranks(); - destroy_mod_Logger(); - destroy_mod_Router(); + if (dname) + free(dname); // dname was strdup'ed + if (bname) + free(bname); // bname was strdup'ed + + destroy_mod_Core(); + destroy_mod_Ranks(); + destroy_mod_Logger(); + destroy_mod_Router(); } diff --git a/modules/app_python/python_msgobj.c b/modules/app_python/python_msgobj.c index 125a0b407d5..020a17e3286 100644 --- a/modules/app_python/python_msgobj.c +++ b/modules/app_python/python_msgobj.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2009 Sippy Software, Inc., http://www.sippysoft.com * * This file is part of Kamailio, a free SIP server. @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * -*/ + */ #include @@ -30,8 +30,8 @@ #include "structmember.h" typedef struct { - PyObject_HEAD - struct sip_msg *msg; + PyObject_HEAD + struct sip_msg *msg; } msgobject; static PyTypeObject MSGtype; @@ -40,453 +40,453 @@ static PyTypeObject MSGtype; msgobject *newmsgobject(struct sip_msg *msg) { - msgobject *msgp; + msgobject *msgp; - msgp = PyObject_New(msgobject, &MSGtype); - if (msgp == NULL) - return NULL; + msgp = PyObject_New(msgobject, &MSGtype); + if (msgp == NULL) + return NULL; - msgp->msg = msg; - return msgp; + msgp->msg = msg; + return msgp; } void msg_invalidate(msgobject *self) { - self->msg = NULL; + self->msg = NULL; } static void msg_dealloc(msgobject *msgp) { - PyObject_Del(msgp); + PyObject_Del(msgp); } static PyObject *msg_copy(msgobject *self) { - msgobject *msgp; + msgobject *msgp; - if ((msgp = newmsgobject(self->msg)) == NULL) - return NULL; + if ((msgp = newmsgobject(self->msg)) == NULL) + return NULL; - return (PyObject *)msgp; + return (PyObject *)msgp; } static PyObject *msg_rewrite_ruri(msgobject *self, PyObject *args) { - char *ruri; - struct action act; - struct run_act_ctx ra_ctx; - - if (self->msg == NULL) { - PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); - Py_INCREF(Py_None); - return Py_None; - } - - if ((self->msg->first_line).type != SIP_REQUEST) { - PyErr_SetString(PyExc_RuntimeError, "Not a request message - rewrite is not possible.\n"); - Py_INCREF(Py_None); - return Py_None; - } - - if(!PyArg_ParseTuple(args, "s:rewrite_ruri", &ruri)) - return NULL; - - memset(&act, '\0', sizeof(act)); - - act.type = SET_URI_T; - act.val[0].type = STRING_ST; - act.val[0].u.str.s = ruri; - act.val[0].u.str.len = strlen(ruri); - - init_run_actions_ctx(&ra_ctx); - if (do_action(&ra_ctx, &act, self->msg) < 0) { - LM_ERR("Error in do_action\n"); - } - - Py_INCREF(Py_None); - return Py_None; + char *ruri; + struct action act; + struct run_act_ctx ra_ctx; + + if (self->msg == NULL) { + PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); + Py_INCREF(Py_None); + return Py_None; + } + + if ((self->msg->first_line).type != SIP_REQUEST) { + PyErr_SetString(PyExc_RuntimeError, "Not a request message - rewrite is not possible.\n"); + Py_INCREF(Py_None); + return Py_None; + } + + if(!PyArg_ParseTuple(args, "s:rewrite_ruri", &ruri)) + return NULL; + + memset(&act, '\0', sizeof(act)); + + act.type = SET_URI_T; + act.val[0].type = STRING_ST; + act.val[0].u.str.s = ruri; + act.val[0].u.str.len = strlen(ruri); + + init_run_actions_ctx(&ra_ctx); + if (do_action(&ra_ctx, &act, self->msg) < 0) { + LM_ERR("Error in do_action\n"); + } + + Py_INCREF(Py_None); + return Py_None; } static PyObject *msg_set_dst_uri(msgobject *self, PyObject *args) { - str ruri; - - if (self->msg == NULL) { - PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); - Py_INCREF(Py_None); - return Py_None; - } - - if ((self->msg->first_line).type != SIP_REQUEST) { - PyErr_SetString(PyExc_RuntimeError, "Not a request message - set destination is not possible.\n"); - Py_INCREF(Py_None); - return Py_None; - } - - if(!PyArg_ParseTuple(args, "s:set_dst_uri", &ruri.s)) - return NULL; - - ruri.len = strlen(ruri.s); - - if (set_dst_uri(self->msg, &ruri) < 0) { - LM_ERR("Error in set_dst_uri\n"); - PyErr_SetString(PyExc_RuntimeError, "Error in set_dst_uri\n"); - } - /* dst_uri changes, so it makes sense to re-use the current uri for - forking */ - ruri_mark_new(); /* re-use uri for serial forking */ - - Py_INCREF(Py_None); - return Py_None; + str ruri; + + if (self->msg == NULL) { + PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); + Py_INCREF(Py_None); + return Py_None; + } + + if ((self->msg->first_line).type != SIP_REQUEST) { + PyErr_SetString(PyExc_RuntimeError, "Not a request message - set destination is not possible.\n"); + Py_INCREF(Py_None); + return Py_None; + } + + if(!PyArg_ParseTuple(args, "s:set_dst_uri", &ruri.s)) + return NULL; + + ruri.len = strlen(ruri.s); + + if (set_dst_uri(self->msg, &ruri) < 0) { + LM_ERR("Error in set_dst_uri\n"); + PyErr_SetString(PyExc_RuntimeError, "Error in set_dst_uri\n"); + } + /* dst_uri changes, so it makes sense to re-use the current uri for + * forking */ + ruri_mark_new(); /* re-use uri for serial forking */ + + Py_INCREF(Py_None); + return Py_None; } static PyObject *msg_getHeader(msgobject *self, PyObject *args) { - struct hdr_field *hf; - str hname, *hbody; - - if (self->msg == NULL) { - PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); - Py_INCREF(Py_None); - return Py_None; - } - - if(!PyArg_ParseTuple(args, "s:getHeader", &hname.s)) - return NULL; - hname.len = strlen(hname.s); - - parse_headers(self->msg, ~0, 0); - hbody = NULL; - for (hf = self->msg->headers; hf != NULL; hf = hf->next) { - if (hname.len == hf->name.len && - strncasecmp(hname.s, hf->name.s, hname.len) == 0) { - hbody = &(hf->body); - break; - } - } - - if (hbody == NULL) { - Py_INCREF(Py_None); - return Py_None; - } - - return PyString_FromStringAndSize(hbody->s, hbody->len); + struct hdr_field *hf; + str hname, *hbody; + + if (self->msg == NULL) { + PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); + Py_INCREF(Py_None); + return Py_None; + } + + if(!PyArg_ParseTuple(args, "s:getHeader", &hname.s)) + return NULL; + hname.len = strlen(hname.s); + + parse_headers(self->msg, ~0, 0); + hbody = NULL; + for (hf = self->msg->headers; hf != NULL; hf = hf->next) { + if (hname.len == hf->name.len && + strncasecmp(hname.s, hf->name.s, hname.len) == 0) { + hbody = &(hf->body); + break; + } + } + + if (hbody == NULL) { + Py_INCREF(Py_None); + return Py_None; + } + + return PyString_FromStringAndSize(hbody->s, hbody->len); } static PyObject *msg_call_function(msgobject *self, PyObject *args) { - int i, rval; - char *fname, *arg1, *arg2; - sr31_cmd_export_t* fexport; - struct action *act; - struct run_act_ctx ra_ctx; - unsigned mod_ver; - - if (self->msg == NULL) { - PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); - Py_INCREF(Py_None); - return Py_None; - } - - i = PySequence_Size(args); - if (i < 1 || i > 3) { - PyErr_SetString(PyExc_RuntimeError, "call_function() should " \ - "have from 1 to 3 arguments"); - Py_INCREF(Py_None); - return Py_None; - } - - if(!PyArg_ParseTuple(args, "s|ss:call_function", &fname, &arg1, &arg2)) - return NULL; - - fexport = find_export_record(fname, i - 1, 0, &mod_ver); - if (fexport == NULL) { - PyErr_SetString(PyExc_RuntimeError, "no such function"); - Py_INCREF(Py_None); - return Py_None; - } - - act = mk_action(MODULE2_T, 4 /* number of (type, value) pairs */, - MODEXP_ST, fexport, /* function */ - NUMBER_ST, 2, /* parameter number */ - STRING_ST, arg1, /* param. 1 */ - STRING_ST, arg2 /* param. 2 */ - ); - - if (act == NULL) { - PyErr_SetString(PyExc_RuntimeError, - "action structure could not be created"); - Py_INCREF(Py_None); - return Py_None; - } - - if (fexport->fixup != NULL) { - if (i >= 3) { - rval = fexport->fixup(&(act->val[3].u.data), 2); - if (rval < 0) { - PyErr_SetString(PyExc_RuntimeError, "Error in fixup (2)"); - Py_INCREF(Py_None); - return Py_None; - } - act->val[3].type = MODFIXUP_ST; - } - if (i >= 2) { - rval = fexport->fixup(&(act->val[2].u.data), 1); - if (rval < 0) { - PyErr_SetString(PyExc_RuntimeError, "Error in fixup (1)"); - Py_INCREF(Py_None); - return Py_None; - } - act->val[2].type = MODFIXUP_ST; - } - if (i == 1) { - rval = fexport->fixup(0, 0); - if (rval < 0) { - PyErr_SetString(PyExc_RuntimeError, "Error in fixup (0)"); - Py_INCREF(Py_None); - return Py_None; - } - } - } - - init_run_actions_ctx(&ra_ctx); - rval = do_action(&ra_ctx, act, self->msg); - - if ((act->val[3].type == MODFIXUP_ST) && (act->val[3].u.data)) { - pkg_free(act->val[3].u.data); - } - - if ((act->val[2].type == MODFIXUP_ST) && (act->val[2].u.data)) { - pkg_free(act->val[2].u.data); - } - - pkg_free(act); - - return PyInt_FromLong(rval); + int i, rval; + char *fname, *arg1, *arg2; + sr31_cmd_export_t* fexport; + struct action *act; + struct run_act_ctx ra_ctx; + unsigned mod_ver; + + if (self->msg == NULL) { + PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); + Py_INCREF(Py_None); + return Py_None; + } + + i = PySequence_Size(args); + if (i < 1 || i > 3) { + PyErr_SetString(PyExc_RuntimeError, "call_function() should " \ + "have from 1 to 3 arguments"); + Py_INCREF(Py_None); + return Py_None; + } + + if(!PyArg_ParseTuple(args, "s|ss:call_function", &fname, &arg1, &arg2)) + return NULL; + + fexport = find_export_record(fname, i - 1, 0, &mod_ver); + if (fexport == NULL) { + PyErr_SetString(PyExc_RuntimeError, "no such function"); + Py_INCREF(Py_None); + return Py_None; + } + + act = mk_action(MODULE2_T, 4 /* number of (type, value) pairs */, + MODEXP_ST, fexport, /* function */ + NUMBER_ST, 2, /* parameter number */ + STRING_ST, arg1, /* param. 1 */ + STRING_ST, arg2 /* param. 2 */ + ); + + if (act == NULL) { + PyErr_SetString(PyExc_RuntimeError, + "action structure could not be created"); + Py_INCREF(Py_None); + return Py_None; + } + + if (fexport->fixup != NULL) { + if (i >= 3) { + rval = fexport->fixup(&(act->val[3].u.data), 2); + if (rval < 0) { + PyErr_SetString(PyExc_RuntimeError, "Error in fixup (2)"); + Py_INCREF(Py_None); + return Py_None; + } + act->val[3].type = MODFIXUP_ST; + } + if (i >= 2) { + rval = fexport->fixup(&(act->val[2].u.data), 1); + if (rval < 0) { + PyErr_SetString(PyExc_RuntimeError, "Error in fixup (1)"); + Py_INCREF(Py_None); + return Py_None; + } + act->val[2].type = MODFIXUP_ST; + } + if (i == 1) { + rval = fexport->fixup(0, 0); + if (rval < 0) { + PyErr_SetString(PyExc_RuntimeError, "Error in fixup (0)"); + Py_INCREF(Py_None); + return Py_None; + } + } + } + + init_run_actions_ctx(&ra_ctx); + rval = do_action(&ra_ctx, act, self->msg); + + if ((act->val[3].type == MODFIXUP_ST) && (act->val[3].u.data)) { + pkg_free(act->val[3].u.data); + } + + if ((act->val[2].type == MODFIXUP_ST) && (act->val[2].u.data)) { + pkg_free(act->val[2].u.data); + } + + pkg_free(act); + + return PyInt_FromLong(rval); } PyDoc_STRVAR(copy_doc, -"copy() -> msg object\n\ -\n\ -Return a copy (``clone'') of the msg object."); + "copy() -> msg object\n\ + \n\ + Return a copy (``clone'') of the msg object."); static PyMethodDef msg_methods[] = { - {"copy", (PyCFunction)msg_copy, METH_NOARGS, copy_doc}, - {"rewrite_ruri", (PyCFunction)msg_rewrite_ruri, METH_VARARGS, "Rewrite Request-URI."}, - {"set_dst_uri", (PyCFunction)msg_set_dst_uri, METH_VARARGS, "Set destination URI."}, - {"getHeader", (PyCFunction)msg_getHeader, METH_VARARGS, "Get SIP header field by name."}, - {"call_function", (PyCFunction)msg_call_function, METH_VARARGS, "Invoke function exported by the other module."}, - {NULL, NULL, 0, NULL} /* sentinel */ + {"copy", (PyCFunction)msg_copy, METH_NOARGS, copy_doc}, + {"rewrite_ruri", (PyCFunction)msg_rewrite_ruri, METH_VARARGS, "Rewrite Request-URI."}, + {"set_dst_uri", (PyCFunction)msg_set_dst_uri, METH_VARARGS, "Set destination URI."}, + {"getHeader", (PyCFunction)msg_getHeader, METH_VARARGS, "Get SIP header field by name."}, + {"call_function", (PyCFunction)msg_call_function, METH_VARARGS, "Invoke function exported by the other module."}, + {NULL, NULL, 0, NULL} /* sentinel */ }; static PyObject *msg_getType(msgobject *self, PyObject *unused) { - const char *rval; - - if (self->msg == NULL) { - PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); - Py_INCREF(Py_None); - return Py_None; - } - - switch ((self->msg->first_line).type) - { - case SIP_REQUEST: - rval = "SIP_REQUEST"; - break; - - case SIP_REPLY: - rval = "SIP_REPLY"; - break; - - default: - rval = "SIP_INVALID"; - break; - } - - return PyString_FromString(rval); + const char *rval; + + if (self->msg == NULL) { + PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); + Py_INCREF(Py_None); + return Py_None; + } + + switch ((self->msg->first_line).type) + { + case SIP_REQUEST: + rval = "SIP_REQUEST"; + break; + + case SIP_REPLY: + rval = "SIP_REPLY"; + break; + + default: + rval = "SIP_INVALID"; + break; + } + + return PyString_FromString(rval); } static PyObject *msg_getMethod(msgobject *self, PyObject *unused) { - str *rval; - - if (self->msg == NULL) { - PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); - Py_INCREF(Py_None); - return Py_None; - } - - if ((self->msg->first_line).type != SIP_REQUEST) { - PyErr_SetString(PyExc_RuntimeError, "Not a request message - no method available.\n"); - Py_INCREF(Py_None); - return Py_None; - } - rval = &((self->msg->first_line).u.request.method); - return PyString_FromStringAndSize(rval->s, rval->len); + str *rval; + + if (self->msg == NULL) { + PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); + Py_INCREF(Py_None); + return Py_None; + } + + if ((self->msg->first_line).type != SIP_REQUEST) { + PyErr_SetString(PyExc_RuntimeError, "Not a request message - no method available.\n"); + Py_INCREF(Py_None); + return Py_None; + } + rval = &((self->msg->first_line).u.request.method); + return PyString_FromStringAndSize(rval->s, rval->len); } static PyObject *msg_getStatus(msgobject *self, PyObject *unused) { - str *rval; - - if (self->msg == NULL) { - PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); - Py_INCREF(Py_None); - return Py_None; - } - - if ((self->msg->first_line).type != SIP_REPLY) { - PyErr_SetString(PyExc_RuntimeError, "Not a non-reply message - no status available.\n"); - Py_INCREF(Py_None); - return Py_None; - } - - rval = &((self->msg->first_line).u.reply.status); - return PyString_FromStringAndSize(rval->s, rval->len); + str *rval; + + if (self->msg == NULL) { + PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); + Py_INCREF(Py_None); + return Py_None; + } + + if ((self->msg->first_line).type != SIP_REPLY) { + PyErr_SetString(PyExc_RuntimeError, "Not a non-reply message - no status available.\n"); + Py_INCREF(Py_None); + return Py_None; + } + + rval = &((self->msg->first_line).u.reply.status); + return PyString_FromStringAndSize(rval->s, rval->len); } static PyObject *msg_getRURI(msgobject *self, PyObject *unused) { - str *rval; - - if (self->msg == NULL) { - PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); - Py_INCREF(Py_None); - return Py_None; - } - - if ((self->msg->first_line).type != SIP_REQUEST) { - PyErr_SetString(PyExc_RuntimeError, "Not a request message - RURI is not available.\n"); - Py_INCREF(Py_None); - return Py_None; - } - - rval = &((self->msg->first_line).u.request.uri); - return PyString_FromStringAndSize(rval->s, rval->len); + str *rval; + + if (self->msg == NULL) { + PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); + Py_INCREF(Py_None); + return Py_None; + } + + if ((self->msg->first_line).type != SIP_REQUEST) { + PyErr_SetString(PyExc_RuntimeError, "Not a request message - RURI is not available.\n"); + Py_INCREF(Py_None); + return Py_None; + } + + rval = &((self->msg->first_line).u.request.uri); + return PyString_FromStringAndSize(rval->s, rval->len); } static PyObject *msg_get_src_address(msgobject *self, PyObject *unused) { - PyObject *src_ip, *src_port, *pyRval; - - if (self->msg == NULL) { - PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); - Py_INCREF(Py_None); - return Py_None; - } - - src_ip = PyString_FromString(ip_addr2a(&self->msg->rcv.src_ip)); - if (src_ip == NULL) { - Py_INCREF(Py_None); - return Py_None; - } - - src_port = PyInt_FromLong(self->msg->rcv.src_port); - if (src_port == NULL) { - Py_DECREF(src_ip); - Py_INCREF(Py_None); - return Py_None; - } - - pyRval = PyTuple_Pack(2, src_ip, src_port); - Py_DECREF(src_ip); - Py_DECREF(src_port); - if (pyRval == NULL) { - Py_INCREF(Py_None); - return Py_None; - } - - return pyRval; + PyObject *src_ip, *src_port, *pyRval; + + if (self->msg == NULL) { + PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); + Py_INCREF(Py_None); + return Py_None; + } + + src_ip = PyString_FromString(ip_addr2a(&self->msg->rcv.src_ip)); + if (src_ip == NULL) { + Py_INCREF(Py_None); + return Py_None; + } + + src_port = PyInt_FromLong(self->msg->rcv.src_port); + if (src_port == NULL) { + Py_DECREF(src_ip); + Py_INCREF(Py_None); + return Py_None; + } + + pyRval = PyTuple_Pack(2, src_ip, src_port); + Py_DECREF(src_ip); + Py_DECREF(src_port); + if (pyRval == NULL) { + Py_INCREF(Py_None); + return Py_None; + } + + return pyRval; } static PyObject *msg_get_dst_address(msgobject *self, PyObject *unused) { - PyObject *dst_ip, *dst_port, *pyRval; - - if (self->msg == NULL) { - PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); - Py_INCREF(Py_None); - return Py_None; - } - - dst_ip = PyString_FromString(ip_addr2a(&self->msg->rcv.dst_ip)); - if (dst_ip == NULL) { - Py_INCREF(Py_None); - return Py_None; - } - - dst_port = PyInt_FromLong(self->msg->rcv.dst_port); - if (dst_port == NULL) { - Py_DECREF(dst_ip); - Py_INCREF(Py_None); - return Py_None; - } - - pyRval = PyTuple_Pack(2, dst_ip, dst_port); - Py_DECREF(dst_ip); - Py_DECREF(dst_port); - if (pyRval == NULL) { - Py_INCREF(Py_None); - return Py_None; - } - - return pyRval; + PyObject *dst_ip, *dst_port, *pyRval; + + if (self->msg == NULL) { + PyErr_SetString(PyExc_RuntimeError, "self->msg is NULL"); + Py_INCREF(Py_None); + return Py_None; + } + + dst_ip = PyString_FromString(ip_addr2a(&self->msg->rcv.dst_ip)); + if (dst_ip == NULL) { + Py_INCREF(Py_None); + return Py_None; + } + + dst_port = PyInt_FromLong(self->msg->rcv.dst_port); + if (dst_port == NULL) { + Py_DECREF(dst_ip); + Py_INCREF(Py_None); + return Py_None; + } + + pyRval = PyTuple_Pack(2, dst_ip, dst_port); + Py_DECREF(dst_ip); + Py_DECREF(dst_port); + if (pyRval == NULL) { + Py_INCREF(Py_None); + return Py_None; + } + + return pyRval; } static PyGetSetDef msg_getseters[] = { - {"Type", (getter)msg_getType, NULL, NULL, "Get message type - \"SIP_REQUEST\" or \"SIP_REPLY\"."}, - {"Method", (getter)msg_getMethod, NULL, NULL, "Get SIP method name."}, - {"Status", (getter)msg_getStatus, NULL, NULL, "Get SIP status code string."}, - {"RURI", (getter)msg_getRURI, NULL, NULL, "Get SIP Request-URI."}, - {"src_address", (getter)msg_get_src_address, NULL, NULL, "Get (IP, port) tuple representing source address of the message."}, - {"dst_address", (getter)msg_get_dst_address, NULL, NULL, "Get (IP, port) tuple representing destination address of the message."}, - {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ + {"Type", (getter)msg_getType, NULL, NULL, "Get message type - \"SIP_REQUEST\" or \"SIP_REPLY\"."}, + {"Method", (getter)msg_getMethod, NULL, NULL, "Get SIP method name."}, + {"Status", (getter)msg_getStatus, NULL, NULL, "Get SIP status code string."}, + {"RURI", (getter)msg_getRURI, NULL, NULL, "Get SIP Request-URI."}, + {"src_address", (getter)msg_get_src_address, NULL, NULL, "Get (IP, port) tuple representing source address of the message."}, + {"dst_address", (getter)msg_get_dst_address, NULL, NULL, "Get (IP, port) tuple representing destination address of the message."}, + {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; static PyTypeObject MSGtype = { #if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 6 - PyVarObject_HEAD_INIT(NULL, 0) + PyVarObject_HEAD_INIT(NULL, 0) #else - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ + PyObject_HEAD_INIT(NULL) + 0, /*ob_size*/ #endif - "Router.msg", /*tp_name*/ - sizeof(msgobject), /*tp_size*/ - 0, /*tp_itemsize*/ - /* methods */ - (destructor)msg_dealloc, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_compare*/ - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - msg_methods, /*tp_methods*/ - 0, /*tp_members*/ - msg_getseters, /*tp_getset*/ + "Router.msg", /*tp_name*/ + sizeof(msgobject), /*tp_size*/ + 0, /*tp_itemsize*/ + /* methods */ + (destructor)msg_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + msg_methods, /*tp_methods*/ + 0, /*tp_members*/ + msg_getseters, /*tp_getset*/ }; int python_msgobj_init(void) { - MSGtype.ob_type = &PyType_Type; - if (PyType_Ready(&MSGtype) < 0) - return -1; - return 0; + MSGtype.ob_type = &PyType_Type; + if (PyType_Ready(&MSGtype) < 0) + return -1; + return 0; } diff --git a/modules/app_python/python_support.c b/modules/app_python/python_support.c index 6ec6fe2da27..7a602145660 100644 --- a/modules/app_python/python_support.c +++ b/modules/app_python/python_support.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2009 Sippy Software, Inc., http://www.sippysoft.com * * This file is part of Kamailio, a free SIP server. @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * -*/ + */ #include #include @@ -31,223 +31,223 @@ void python_handle_exception(const char *fmt, ...) { - PyObject *pResult; - const char *msg; - char *buf; - size_t buflen, msglen; - PyObject *exception, *v, *tb, *args; - PyObject *line; - int i; - char *srcbuf; - - // We don't want to generate traceback when no errors occured - if (!PyErr_Occurred()) - return; - - if (fmt == NULL) - srcbuf = NULL; - else - srcbuf = make_message(fmt); - - PyErr_Fetch(&exception, &v, &tb); - PyErr_Clear(); - if (exception == NULL) { - LM_ERR("python_handle_exception(): Can't get traceback, PyErr_Fetch() has failed.\n"); - return; - } - - PyErr_NormalizeException(&exception, &v, &tb); - if (exception == NULL) { - LM_ERR("python_handle_exception(): Can't get traceback, PyErr_NormalizeException() has failed.\n"); - return; - } - - args = PyTuple_Pack(3, exception, v, tb ? tb : Py_None); - Py_XDECREF(exception); - Py_XDECREF(v); - Py_XDECREF(tb); - if (args == NULL) { - LM_ERR("python_handle_exception(): Can't get traceback, PyTuple_Pack() has failed.\n"); - return; - } - - pResult = PyObject_CallObject(format_exc_obj, args); - Py_DECREF(args); - if (pResult == NULL) { - LM_ERR("python_handle_exception(): Can't get traceback, traceback.format_exception() has failed.\n"); - return; - } - - buflen = 1; - buf = (char *)pkg_realloc(NULL, buflen * sizeof(char *)); - if (!buf) - { - LM_ERR("python_handle_exception(): Can't allocate memory (%lu bytes), pkg_realloc() has failed. Not enough memory.\n", (unsigned long)(buflen * sizeof(char *))); - return; - } - memset(buf, 0, sizeof(char *)); - - for (i = 0; i < PySequence_Size(pResult); i++) { - line = PySequence_GetItem(pResult, i); - if (line == NULL) { - LM_ERR("python_handle_exception(): Can't get traceback, PySequence_GetItem() has failed.\n"); - Py_DECREF(pResult); - if (buf) - pkg_free(buf); - return; - } + PyObject *pResult; + const char *msg; + char *buf; + size_t buflen, msglen; + PyObject *exception, *v, *tb, *args; + PyObject *line; + int i; + char *srcbuf; + + // We don't want to generate traceback when no errors occured + if (!PyErr_Occurred()) + return; + + if (fmt == NULL) + srcbuf = NULL; + else + srcbuf = make_message(fmt); - msg = PyString_AsString(line); + PyErr_Fetch(&exception, &v, &tb); + PyErr_Clear(); + if (exception == NULL) { + LM_ERR("python_handle_exception(): Can't get traceback, PyErr_Fetch() has failed.\n"); + return; + } - if (msg == NULL) { - LM_ERR("python_handle_exception(): Can't get traceback, PyString_AsString() has failed.\n"); - Py_DECREF(line); - Py_DECREF(pResult); - if (buf) - pkg_free(buf); - return; - } + PyErr_NormalizeException(&exception, &v, &tb); + if (exception == NULL) { + LM_ERR("python_handle_exception(): Can't get traceback, PyErr_NormalizeException() has failed.\n"); + return; + } - msglen = strlen(msg); - buflen += ++msglen; + args = PyTuple_Pack(3, exception, v, tb ? tb : Py_None); + Py_XDECREF(exception); + Py_XDECREF(v); + Py_XDECREF(tb); + if (args == NULL) { + LM_ERR("python_handle_exception(): Can't get traceback, PyTuple_Pack() has failed.\n"); + return; + } + + pResult = PyObject_CallObject(format_exc_obj, args); + Py_DECREF(args); + if (pResult == NULL) { + LM_ERR("python_handle_exception(): Can't get traceback, traceback.format_exception() has failed.\n"); + return; + } - buf = (char *)pkg_realloc(buf, buflen * sizeof(char *)); + buflen = 1; + buf = (char *)pkg_realloc(NULL, buflen * sizeof(char)); if (!buf) { - LM_ERR("python_handle_exception(): Can't allocate memory (%lu bytes), pkg_realloc() has failed. Not enough memory.\n", (unsigned long)(buflen * sizeof(char *))); - Py_DECREF(line); - Py_DECREF(pResult); - return; + LM_ERR("python_handle_exception(): Can't allocate memory (%lu bytes), pkg_realloc() has failed. Not enough memory.\n", (unsigned long)(buflen * sizeof(char *))); + return; + } + memset(buf, 0, buflen * sizeof(char)); + + for (i = 0; i < PySequence_Size(pResult); i++) { + line = PySequence_GetItem(pResult, i); + if (line == NULL) { + LM_ERR("python_handle_exception(): Can't get traceback, PySequence_GetItem() has failed.\n"); + Py_DECREF(pResult); + if (buf) + pkg_free(buf); + return; + } + + msg = PyString_AsString(line); + + if (msg == NULL) { + LM_ERR("python_handle_exception(): Can't get traceback, PyString_AsString() has failed.\n"); + Py_DECREF(line); + Py_DECREF(pResult); + if (buf) + pkg_free(buf); + return; + } + + msglen = strlen(msg); + buflen += ++msglen; + + buf = (char *)pkg_realloc(buf, buflen * sizeof(char *)); + if (!buf) + { + LM_ERR("python_handle_exception(): Can't allocate memory (%lu bytes), pkg_realloc() has failed. Not enough memory.\n", (unsigned long)(buflen * sizeof(char *))); + Py_DECREF(line); + Py_DECREF(pResult); + return; + } + + strncat(buf, msg, msglen >= buflen ? buflen-1 : msglen); + + Py_DECREF(line); } - strncat(buf, msg, msglen >= buflen ? buflen-1 : msglen); - - Py_DECREF(line); - } - - if (srcbuf == NULL) - LM_ERR("Unhandled exception in the Python code:\n%s", buf); - else - LM_ERR("%s: Unhandled exception in the Python code:\n%s", srcbuf, buf); + if (srcbuf == NULL) + LM_ERR("Unhandled exception in the Python code:\n%s", buf); + else + LM_ERR("%s: Unhandled exception in the Python code:\n%s", srcbuf, buf); - if (buf) - pkg_free(buf); + if (buf) + pkg_free(buf); - if (srcbuf) - pkg_free(srcbuf); + if (srcbuf) + pkg_free(srcbuf); - Py_DECREF(pResult); + Py_DECREF(pResult); } PyObject *InitTracebackModule() { - PyObject *pModule, *pTracebackObject; - - pModule = PyImport_ImportModule("traceback"); - if (pModule == NULL) { - LM_ERR("InitTracebackModule(): Cannot import module 'traceback'.\n"); - return NULL; - } - - pTracebackObject = PyObject_GetAttrString(pModule, "format_exception"); - Py_DECREF(pModule); - if (pTracebackObject == NULL || !PyCallable_Check(pTracebackObject)) { - LM_ERR("InitTracebackModule(): AttributeError: 'module' object 'traceback' has no attribute 'format_exception'.\n"); - Py_XDECREF(pTracebackObject); - return NULL; - } - - return pTracebackObject; + PyObject *pModule, *pTracebackObject; + + pModule = PyImport_ImportModule("traceback"); + if (pModule == NULL) { + LM_ERR("InitTracebackModule(): Cannot import module 'traceback'.\n"); + return NULL; + } + + pTracebackObject = PyObject_GetAttrString(pModule, "format_exception"); + Py_DECREF(pModule); + if (pTracebackObject == NULL || !PyCallable_Check(pTracebackObject)) { + LM_ERR("InitTracebackModule(): AttributeError: 'module' object 'traceback' has no attribute 'format_exception'.\n"); + Py_XDECREF(pTracebackObject); + return NULL; + } + + return pTracebackObject; } char *make_message(const char *fmt, ...) { - int n; - size_t size; - char *p, *np; - va_list ap; - - size = 100; /* Guess we need no more than 100 bytes. */ - p = (char *)pkg_realloc(NULL, size * sizeof(char *)); - if (!p) - { - LM_ERR("make_message(): Can't allocate memory (%lu bytes), pkg_malloc() has failed: Not enough memory.\n", (unsigned long)(size * sizeof(char *))); - return NULL; - } - memset(p, 0, size * sizeof(char *)); - - while (1) - { - va_start(ap, fmt); - n = vsnprintf(p, size, fmt, ap); - va_end(ap); - - if (n > -1 && n < size) - return p; - - if (n > -1) /* glibc 2.1 */ - size = n+1; - else /* glibc 2.0 */ - size *= 2; - - np = (char *)pkg_realloc(p, size * sizeof(char *)); - if (!np) + int n; + size_t size; + char *p, *np; + va_list ap; + + size = 100; /* Guess we need no more than 100 bytes. */ + p = (char *)pkg_realloc(NULL, size * sizeof(char *)); + if (!p) { - LM_ERR("make_message(): Can't allocate memory (%lu bytes), pkg_realloc() has failed: Not enough memory.\n", (unsigned long)size * sizeof(char *)); - if (p) - pkg_free(p); - return NULL; - } - else - p = np; - } + LM_ERR("make_message(): Can't allocate memory (%lu bytes), pkg_malloc() has failed: Not enough memory.\n", (unsigned long)(size * sizeof(char *))); + return NULL; + } + memset(p, 0, size * sizeof(char *)); + + while (1) + { + va_start(ap, fmt); + n = vsnprintf(p, size, fmt, ap); + va_end(ap); + + if (n > -1 && n < size) + return p; + + if (n > -1) /* glibc 2.1 */ + size = n+1; + else /* glibc 2.0 */ + size *= 2; + + np = (char *)pkg_realloc(p, size * sizeof(char *)); + if (!np) + { + LM_ERR("make_message(): Can't allocate memory (%lu bytes), pkg_realloc() has failed: Not enough memory.\n", (unsigned long)size * sizeof(char *)); + if (p) + pkg_free(p); + return NULL; + } + else + p = np; + } - return NULL; // shall not happened, but who knows ;) + return NULL; // shall not happened, but who knows ;) } char *get_class_name(PyObject *y) { - PyObject *p; - char *name; + PyObject *p; + char *name; - p = PyObject_GetAttrString(y, "__name__"); - if (p == NULL || p == Py_None) - { - Py_XDECREF(p); - return NULL; - } + p = PyObject_GetAttrString(y, "__name__"); + if (p == NULL || p == Py_None) + { + Py_XDECREF(p); + return NULL; + } - name = PyString_AsString(p); - Py_XDECREF(p); + name = PyString_AsString(p); + Py_XDECREF(p); - return name; + return name; } char *get_instance_class_name(PyObject *y) { - PyObject *p, *n; - char *name; + PyObject *p, *n; + char *name; - n = PyObject_GetAttrString(y, "__class__"); - if (n == NULL || n == Py_None) - { - Py_XDECREF(n); - return NULL; - } + n = PyObject_GetAttrString(y, "__class__"); + if (n == NULL || n == Py_None) + { + Py_XDECREF(n); + return NULL; + } - p = PyObject_GetAttrString(n, "__name__"); - if (p == NULL || p == Py_None) - { - Py_XDECREF(p); - return NULL; - } + p = PyObject_GetAttrString(n, "__name__"); + if (p == NULL || p == Py_None) + { + Py_XDECREF(p); + return NULL; + } - name = PyString_AsString(p); - Py_XDECREF(p); - Py_XDECREF(n); + name = PyString_AsString(p); + Py_XDECREF(p); + Py_XDECREF(n); - return name; + return name; } diff --git a/modules/async/README b/modules/async/README index ce4daf324e2..26db4879396 100644 --- a/modules/async/README +++ b/modules/async/README @@ -10,7 +10,7 @@ Daniel-Constantin Mierla - Copyright 2011 asipto.com + Copyright © 2011-2016 asipto.com __________________________________________________________________ Table of Contents @@ -83,7 +83,7 @@ Chapter 1. Admin Guide The following modules must be loaded before this module: * tm - transaction management. - tmx - transaction management extensions. + * tmx - transaction management extensions. 2.2. External Libraries or Applications @@ -113,7 +113,7 @@ modparam("async", "workers", 2) 4.2. async_sleep(seconds) 4.3. async_task_route(routename) -4.1. async_route(routename, seconds) +4.1. async_route(routename, seconds) Simulate a sleep of 'seconds' and then continue the processing of the SIP request with the route[routename]. In case of internal errors, the @@ -144,7 +144,7 @@ route[RESUME] { } ... -4.2. async_sleep(seconds) +4.2. async_sleep(seconds) Simulate a sleep of 'seconds' and then continue the processing of SIP request with the next action. In case of internal errors, the function @@ -163,7 +163,7 @@ send_reply("404", "Not found"); exit; ... -4.3. async_task_route(routename) +4.3. async_task_route(routename) Continue the processing of the SIP request with the route[routename] in one of the processes from core asynchronous framework. The core diff --git a/modules/async/doc/async.xml b/modules/async/doc/async.xml index a722fb04bda..6e794ad647a 100644 --- a/modules/async/doc/async.xml +++ b/modules/async/doc/async.xml @@ -8,7 +8,7 @@ ]> - + ASYNC Module sip-router.org @@ -25,13 +25,12 @@ - 2011 + 2011-2016 asipto.com - - - - + + + diff --git a/modules/async/doc/async_admin.xml b/modules/async/doc/async_admin.xml index 31ad797433d..c6d33e23e76 100644 --- a/modules/async/doc/async_admin.xml +++ b/modules/async/doc/async_admin.xml @@ -42,6 +42,8 @@ tm - transaction management. + + tmx - transaction management extensions. diff --git a/modules/auth/README b/modules/auth/README index 3dc63614d6f..b152bea41e2 100644 --- a/modules/auth/README +++ b/modules/auth/README @@ -15,7 +15,7 @@ Daniel-Constantin Mierla asipto.com - Copyright 2002, 2003 FhG FOKUS + Copyright © 2002, 2003 FhG FOKUS __________________________________________________________________ Table of Contents @@ -612,7 +612,7 @@ modparam("auth", "force_stateless_reply", 1) to SRV records (not all SIP clients support SRV lookup), a subdomain of the master domain can be defined for SIP purposes (like sip.mydomain.net pointing to same IP address as the SRV record for - mydomain.net). By ignoring the realm_prefix "sip.", at authentication, + mydomain.net). By ignoring the realm_prefix “sip.”, at authentication, sip.example.com will be equivalent to example.com . Default value is empty string. @@ -672,7 +672,7 @@ if (has_credentials("myrealm")) { } ... -4.3. www_challenge(realm, flags) +4.3. www_challenge(realm, flags) The function challenges a user agent. It will generate a WWW-Authorize header field containing a digest challenge, it will put the header @@ -686,7 +686,7 @@ if (has_credentials("myrealm")) { * realm - Realm is a opaque string that the user agent should present to the user so he can decide what username and password to use. Usually this is domain of the host the server is running on. - It must not be empty string "". In case of REGISTER requests, the + It must not be empty string “”. In case of REGISTER requests, the To header field domain (e.g., variable $td) can be used (because this header field represents the user being registered), for all other messages From header field domain can be used (e.g., variable @@ -709,7 +709,7 @@ if (!www_authenticate("$td", "subscriber")) { } ... -4.4. proxy_challenge(realm, flags) +4.4. proxy_challenge(realm, flags) The function challenges a user agent. It will generate a Proxy-Authorize header field containing a digest challenge, it will put @@ -731,7 +731,7 @@ if (!proxy_authenticate("$fd", "subscriber")) { }; ... -4.5. auth_challenge(realm, flags) +4.5. auth_challenge(realm, flags) The function challenges a user agent for authentication. It combines the functions www_challenge() and proxy_challenge(), by calling @@ -750,7 +750,7 @@ if (!auth_check("$fd", "subscriber", "1")) { }; ... -4.6. pv_www_authenticate(realm, passwd, flags [, method]) +4.6. pv_www_authenticate(realm, passwd, flags [, method]) The function verifies credentials according to RFC2617. If the credentials are verified successfully then the function will succeed @@ -773,7 +773,7 @@ if (!auth_check("$fd", "subscriber", "1")) { * realm - Realm is a opaque string that the user agent should present to the user so he can decide what username and password to use. Usually this is domain of the host the server is running on. - It must not be empty string "". In case of REGISTER requests To + It must not be empty string “”. In case of REGISTER requests To header field domain (e.g., varibale $td) can be used (because this header field represents a user being registered), for all other messages From header field domain can be used (e.g., varibale $fd). @@ -802,7 +802,7 @@ if (!pv_www_authenticate("$td", "123abc", "0")) { }; ... -4.7. pv_proxy_authenticate(realm, passwd, flags) +4.7. pv_proxy_authenticate(realm, passwd, flags) The function verifies credentials according to RFC2617. If the credentials are verified successfully then the function will succeed @@ -825,7 +825,7 @@ if (!pv_proxy_authenticate("$fd", "$avp(password)", "0")) { }; ... -4.8. pv_auth_check(realm, passwd, flags, checks) +4.8. pv_auth_check(realm, passwd, flags, checks) The function combines the functionalities of pv_www_authenticate and pv_proxy_authenticate, first being exectuted if the SIP request is a @@ -856,7 +856,7 @@ if (!pv_auth_check("$fd", "$avp(password)", "0", "1")) { }; ... -4.9. auth_get_www_authenticate(realm, flags, pvdest) +4.9. auth_get_www_authenticate(realm, flags, pvdest) Build WWW-Authentication header and set the resulting value in 'pvdest' pseudo-variable parameter. diff --git a/modules/auth/api.c b/modules/auth/api.c index 3407346d91d..0eb438fca2e 100644 --- a/modules/auth/api.c +++ b/modules/auth/api.c @@ -1,21 +1,21 @@ /* * Digest Authentication Module - * + * * Copyright (C) 2001-2003 FhG Fokus - * + * * This file is part of Kamailio, a free SIP server. - * + * * Kamailio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version - * + * * Kamailio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License + * + * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * @@ -42,28 +42,28 @@ static int auth_check_hdr_md5(struct sip_msg* msg, auth_body_t* auth_body, * @param check_hdr pointer to the function checking Authorization header field */ auth_result_t pre_auth(struct sip_msg* msg, str* realm, hdr_types_t hftype, - struct hdr_field** hdr, - check_auth_hdr_t check_auth_hdr) + struct hdr_field** hdr, + check_auth_hdr_t check_auth_hdr) { int ret; auth_body_t* c; check_auth_hdr_t check_hf; auth_result_t auth_rv; - /* ACK and CANCEL must be always authenticated, there is - * no way how to challenge ACK and CANCEL cannot be - * challenged because it must have the same CSeq as - * the request to be canceled. - * PRACK is also not authenticated - */ + /* ACK and CANCEL must be always authenticated, there is + * no way how to challenge ACK and CANCEL cannot be + * challenged because it must have the same CSeq as + * the request to be canceled. + * PRACK is also not authenticated + */ if (msg->REQ_METHOD & (METHOD_ACK|METHOD_CANCEL|METHOD_PRACK)) return AUTHENTICATED; - /* Try to find credentials with corresponding realm - * in the message, parse them and return pointer to - * parsed structure - */ + /* Try to find credentials with corresponding realm + * in the message, parse them and return pointer to + * parsed structure + */ strip_realm(realm); ret = find_credentials(msg, realm, hftype, hdr); if (ret < 0) { @@ -75,10 +75,10 @@ auth_result_t pre_auth(struct sip_msg* msg, str* realm, hdr_types_t hftype, return NO_CREDENTIALS; } - /* Pointer to the parsed credentials */ + /* Pointer to the parsed credentials */ c = (auth_body_t*)((*hdr)->parsed); - /* digest headers are in c->digest */ + /* digest headers are in c->digest */ DBG("auth: digest-algo: %.*s parsed value: %d\n", c->digest.alg.alg_str.len, c->digest.alg.alg_str.s, c->digest.alg.alg_parsed); @@ -88,7 +88,7 @@ auth_result_t pre_auth(struct sip_msg* msg, str* realm, hdr_types_t hftype, return ERROR; } - /* check authorization header field's validity */ + /* check authorization header field's validity */ if (check_auth_hdr == NULL) { check_hf = auth_check_hdr_md5; } else { /* use check function of external authentication module */ @@ -98,23 +98,23 @@ auth_result_t pre_auth(struct sip_msg* msg, str* realm, hdr_types_t hftype, if (!check_hf(msg, c, &auth_rv)) { return auth_rv; } - + return DO_AUTHENTICATION; } /** - * TODO move it to rfc2617.c - * + * TODO move it to rfc2617.c + * * @param auth_res return value of authentication. Maybe the it will be not affected. * @result if authentication should continue (1) or not (0) - * + * */ static int auth_check_hdr_md5(struct sip_msg* msg, auth_body_t* auth, auth_result_t* auth_res) { int ret; - - /* Check credentials correctness here */ + + /* Check credentials correctness here */ if (check_dig_cred(&auth->digest) != E_DIG_OK) { LOG(L_ERR, "auth:pre_auth: Credentials are not filled properly\n"); *auth_res = BAD_CREDENTIALS; @@ -125,8 +125,8 @@ static int auth_check_hdr_md5(struct sip_msg* msg, auth_body_t* auth, if (ret!=0){ if (ret==3 || ret==4){ /* failed auth_extra_checks or stale */ - auth->stale=1; /* we mark the nonce as stale - (hack that makes our life much easier) */ + auth->stale=1; /* we mark the nonce as stale + * (hack that makes our life much easier) */ *auth_res = STALE_NONCE; return 0; } else if (ret==6) { @@ -153,14 +153,14 @@ auth_result_t post_auth(struct sip_msg* msg, struct hdr_field* hdr) c = (auth_body_t*)((hdr)->parsed); if (c->stale ) { - if ((msg->REQ_METHOD == METHOD_ACK) || - (msg->REQ_METHOD == METHOD_CANCEL)) { - /* Method is ACK or CANCEL, we must accept stale - * nonces because there is no way how to challenge - * with new nonce (ACK has no response associated - * and CANCEL must have the same CSeq as the request - * to be canceled) - */ + if ((msg->REQ_METHOD == METHOD_ACK) || + (msg->REQ_METHOD == METHOD_CANCEL)) { + /* Method is ACK or CANCEL, we must accept stale + * nonces because there is no way how to challenge + * with new nonce (ACK has no response associated + * and CANCEL must have the same CSeq as the request + * to be canceled) + */ } else { c->stale = 1; res = NOT_AUTHENTICATED; @@ -192,9 +192,9 @@ int auth_check_response(dig_cred_t* cred, str* method, char* ha1) * from the user agent */ calc_response(ha1, &(cred->nonce), - &(cred->nc), &(cred->cnonce), - &(cred->qop.qop_str), cred->qop.qop_parsed == QOP_AUTHINT, - method, &(cred->uri), hent, resp); + &(cred->nc), &(cred->cnonce), + &(cred->qop.qop_str), cred->qop.qop_parsed == QOP_AUTHINT, + method, &(cred->uri), hent, resp); DBG("check_response: Our result = \'%s\'\n", resp); diff --git a/modules/auth/api.h b/modules/auth/api.h index 99bf2c283be..ff8a124a33e 100644 --- a/modules/auth/api.h +++ b/modules/auth/api.h @@ -1,21 +1,21 @@ /* * Digest Authentication Module - * + * * Copyright (C) 2001-2003 FhG Fokus - * + * * This file is part of Kamailio, a free SIP server. - * + * * Kamailio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version - * + * * Kamailio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License + * + * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * @@ -69,10 +69,10 @@ typedef enum auth_result { AUTHENTICATED, /* Authenticated by default, no digest authentication necessary */ BAD_CREDENTIALS, /* Digest credentials are malformed */ CREATE_CHALLENGE, /* when AKAv1-MD5 is used first request does not contain credentials, - * only usename, realm and algorithm. Server should get Authentication - * Vector from AuC/HSS, create challenge and send it to the UE. */ + * only usename, realm and algorithm. Server should get Authentication + * Vector from AuC/HSS, create challenge and send it to the UE. */ DO_RESYNCHRONIZATION /* When AUTS is received we need do resynchronization - * of sequnce numbers with mobile station. */ + * of sequnce numbers with mobile station. */ } auth_result_t; @@ -88,10 +88,10 @@ int check_auth_hdr(struct sip_msg* msg, auth_body_t* auth_body, * ACK and CANCEL */ typedef auth_result_t (*pre_auth_t)(struct sip_msg* msg, str* realm, - hdr_types_t hftype, struct hdr_field** hdr, + hdr_types_t hftype, struct hdr_field** hdr, check_auth_hdr_t check_auth_hdr); auth_result_t pre_auth(struct sip_msg* msg, str* realm, hdr_types_t hftype, - struct hdr_field** hdr, check_auth_hdr_t check_auth_hdr); + struct hdr_field** hdr, check_auth_hdr_t check_auth_hdr); /* @@ -122,10 +122,10 @@ int consume_credentials(struct sip_msg* msg); * Auth module API */ typedef struct auth_api_s { - pre_auth_t pre_auth; /* The function to be called before authentication */ - post_auth_t post_auth; /* The function to be called after authentication */ - build_challenge_hf_t build_challenge; /* Function to build digest challenge header */ - struct qp* qop; /* qop module parameter */ + pre_auth_t pre_auth; /* The function to be called before authentication */ + post_auth_t post_auth; /* The function to be called after authentication */ + build_challenge_hf_t build_challenge; /* Function to build digest challenge header */ + struct qp* qop; /* qop module parameter */ calc_HA1_t calc_HA1; calc_response_t calc_response; check_response_t check_response; diff --git a/modules/auth/auth_mod.c b/modules/auth/auth_mod.c index fe57a899123..dbf6b331277 100644 --- a/modules/auth/auth_mod.c +++ b/modules/auth/auth_mod.c @@ -1,21 +1,21 @@ /* * Digest Authentication Module - * + * * Copyright (C) 2001-2003 FhG Fokus - * + * * This file is part of Kamailio, a free SIP server. - * + * * Kamailio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version - * + * * Kamailio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License + * + * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * @@ -118,18 +118,18 @@ str proxy_challenge_header = STR_STATIC_INIT("Proxy-Authenticate"); str www_challenge_header = STR_STATIC_INIT("WWW-Authenticate"); struct qp auth_qop = { - STR_STATIC_INIT("auth"), - QOP_AUTH + STR_STATIC_INIT("auth"), + QOP_AUTH }; static struct qp auth_qauth = { - STR_STATIC_INIT("auth"), - QOP_AUTH + STR_STATIC_INIT("auth"), + QOP_AUTH }; static struct qp auth_qauthint = { - STR_STATIC_INIT("auth-int"), - QOP_AUTHINT + STR_STATIC_INIT("auth-int"), + QOP_AUTHINT }; /*! SL API structure */ @@ -139,32 +139,32 @@ sl_api_t slb; * Exported functions */ static cmd_export_t cmds[] = { - {"consume_credentials", w_consume_credentials, 0, - 0, REQUEST_ROUTE}, - {"www_challenge", (cmd_function)www_challenge, 2, - fixup_auth_challenge, REQUEST_ROUTE}, - {"proxy_challenge", (cmd_function)proxy_challenge, 2, - fixup_auth_challenge, REQUEST_ROUTE}, - {"auth_challenge", (cmd_function)w_auth_challenge, 2, - fixup_auth_challenge, REQUEST_ROUTE}, - {"pv_www_authorize", (cmd_function)pv_www_authenticate, 3, - fixup_pv_auth, REQUEST_ROUTE}, - {"pv_www_authenticate", (cmd_function)pv_www_authenticate, 3, - fixup_pv_auth, REQUEST_ROUTE}, - {"pv_www_authenticate", (cmd_function)pv_www_authenticate2, 4, - fixup_pv_auth, REQUEST_ROUTE}, - {"pv_proxy_authorize", (cmd_function)pv_proxy_authenticate, 3, - fixup_pv_auth, REQUEST_ROUTE}, - {"pv_proxy_authenticate", (cmd_function)pv_proxy_authenticate, 3, - fixup_pv_auth, REQUEST_ROUTE}, - {"auth_get_www_authenticate", (cmd_function)w_auth_get_www_authenticate, 3, - fixup_auth_get_www_authenticate, REQUEST_ROUTE}, - {"has_credentials", w_has_credentials, 1, - fixup_spve_null, REQUEST_ROUTE}, - {"pv_auth_check", (cmd_function)pv_auth_check, 4, - fixup_pv_auth_check, REQUEST_ROUTE}, - {"bind_auth_s", (cmd_function)bind_auth_s, 0, 0, 0 }, - {0, 0, 0, 0, 0} + {"consume_credentials", w_consume_credentials, 0, + 0, REQUEST_ROUTE}, + {"www_challenge", (cmd_function)www_challenge, 2, + fixup_auth_challenge, REQUEST_ROUTE}, + {"proxy_challenge", (cmd_function)proxy_challenge, 2, + fixup_auth_challenge, REQUEST_ROUTE}, + {"auth_challenge", (cmd_function)w_auth_challenge, 2, + fixup_auth_challenge, REQUEST_ROUTE}, + {"pv_www_authorize", (cmd_function)pv_www_authenticate, 3, + fixup_pv_auth, REQUEST_ROUTE}, + {"pv_www_authenticate", (cmd_function)pv_www_authenticate, 3, + fixup_pv_auth, REQUEST_ROUTE}, + {"pv_www_authenticate", (cmd_function)pv_www_authenticate2, 4, + fixup_pv_auth, REQUEST_ROUTE}, + {"pv_proxy_authorize", (cmd_function)pv_proxy_authenticate, 3, + fixup_pv_auth, REQUEST_ROUTE}, + {"pv_proxy_authenticate", (cmd_function)pv_proxy_authenticate, 3, + fixup_pv_auth, REQUEST_ROUTE}, + {"auth_get_www_authenticate", (cmd_function)w_auth_get_www_authenticate, 3, + fixup_auth_get_www_authenticate, REQUEST_ROUTE}, + {"has_credentials", w_has_credentials, 1, + fixup_spve_null, REQUEST_ROUTE}, + {"pv_auth_check", (cmd_function)pv_auth_check, 4, + fixup_pv_auth_check, REQUEST_ROUTE}, + {"bind_auth_s", (cmd_function)bind_auth_s, 0, 0, 0 }, + {0, 0, 0, 0, 0} }; @@ -172,14 +172,14 @@ static cmd_export_t cmds[] = { * Exported parameters */ static param_export_t params[] = { - {"secret", PARAM_STRING, &sec_param }, - {"nonce_expire", PARAM_INT, &nonce_expire }, + {"secret", PARAM_STRING, &sec_param }, + {"nonce_expire", PARAM_INT, &nonce_expire }, {"nonce_auth_max_drift", PARAM_INT, &nonce_auth_max_drift }, - {"protect_contacts", PARAM_INT, &protect_contacts }, - {"challenge_attr", PARAM_STR, &challenge_attr }, - {"proxy_challenge_header", PARAM_STR, &proxy_challenge_header}, - {"www_challenge_header", PARAM_STR, &www_challenge_header }, - {"qop", PARAM_STR, &auth_qop.qop_str }, + {"protect_contacts", PARAM_INT, &protect_contacts }, + {"challenge_attr", PARAM_STR, &challenge_attr }, + {"proxy_challenge_header", PARAM_STR, &proxy_challenge_header}, + {"www_challenge_header", PARAM_STR, &www_challenge_header }, + {"qop", PARAM_STR, &auth_qop.qop_str }, {"auth_checks_register", PARAM_INT, &auth_checks_reg }, {"auth_checks_no_dlg", PARAM_INT, &auth_checks_ood }, {"auth_checks_in_dlg", PARAM_INT, &auth_checks_ind }, @@ -190,10 +190,10 @@ static param_export_t params[] = { {"otn_in_flight_no", PARAM_INT, &otn_in_flight_no }, {"otn_in_flight_order", PARAM_INT, &otn_in_flight_k }, {"nid_pool_no", PARAM_INT, &nid_pool_no }, - {"force_stateless_reply", PARAM_INT, &force_stateless_reply }, + {"force_stateless_reply", PARAM_INT, &force_stateless_reply }, {"realm_prefix", PARAM_STRING, &auth_realm_prefix.s }, - {"use_domain", PARAM_INT, &auth_use_domain }, - {0, 0, 0} + {"use_domain", PARAM_INT, &auth_use_domain }, + {0, 0, 0} }; @@ -201,15 +201,15 @@ static param_export_t params[] = { * Module interface */ struct module_exports exports = { - "auth", - cmds, - 0, /* RPC methods */ - params, - mod_init, /* module initialization function */ - 0, /* response function */ - destroy, /* destroy function */ - 0, /* oncancel function */ - 0 /* child initialization function */ + "auth", + cmds, + 0, /* RPC methods */ + params, + mod_init, /* module initialization function */ + 0, /* response function */ + destroy, /* destroy function */ + 0, /* oncancel function */ + 0 /* child initialization function */ }; @@ -219,47 +219,47 @@ struct module_exports exports = { */ static inline int generate_random_secret(void) { - int i; - - sec_rand1 = (char*)pkg_malloc(RAND_SECRET_LEN); - sec_rand2 = (char*)pkg_malloc(RAND_SECRET_LEN); - if (!sec_rand1 || !sec_rand2) { - LOG(L_ERR, "auth:generate_random_secret: No memory left\n"); - if (sec_rand1){ - pkg_free(sec_rand1); - sec_rand1=0; + int i; + + sec_rand1 = (char*)pkg_malloc(RAND_SECRET_LEN); + sec_rand2 = (char*)pkg_malloc(RAND_SECRET_LEN); + if (!sec_rand1 || !sec_rand2) { + LOG(L_ERR, "auth:generate_random_secret: No memory left\n"); + if (sec_rand1){ + pkg_free(sec_rand1); + sec_rand1=0; + } + return -1; } - return -1; - } - - /* srandom(time(0)); -- seeded by core */ - - for(i = 0; i < RAND_SECRET_LEN; i++) { - sec_rand1[i] = 32 + (int)(95.0 * rand() / (RAND_MAX + 1.0)); - } - - secret1.s = sec_rand1; - secret1.len = RAND_SECRET_LEN; - - for(i = 0; i < RAND_SECRET_LEN; i++) { - sec_rand2[i] = 32 + (int)(95.0 * rand() / (RAND_MAX + 1.0)); - } - - secret2.s = sec_rand2; - secret2.len = RAND_SECRET_LEN; - - /* DBG("Generated secret: '%.*s'\n", secret.len, secret.s); */ - - return 0; + + /* srandom(time(0)); -- seeded by core */ + + for(i = 0; i < RAND_SECRET_LEN; i++) { + sec_rand1[i] = 32 + (int)(95.0 * rand() / (RAND_MAX + 1.0)); + } + + secret1.s = sec_rand1; + secret1.len = RAND_SECRET_LEN; + + for(i = 0; i < RAND_SECRET_LEN; i++) { + sec_rand2[i] = 32 + (int)(95.0 * rand() / (RAND_MAX + 1.0)); + } + + secret2.s = sec_rand2; + secret2.len = RAND_SECRET_LEN; + + /* DBG("Generated secret: '%.*s'\n", secret.len, secret.s); */ + + return 0; } static int mod_init(void) { - str attr; - - DBG("auth module - initializing\n"); - + str attr; + + DBG("auth module - initializing\n"); + auth_realm_prefix.len = strlen(auth_realm_prefix.s); /* bind the SL API */ @@ -269,17 +269,17 @@ static int mod_init(void) } /* If the parameter was not used */ - if (sec_param == 0) { + if (sec_param == 0) { /* Generate secret using random generator */ if (generate_random_secret() < 0) { LOG(L_ERR, "auth:mod_init: Error while generating random secret\n"); return -3; } - } else { + } else { /* Otherwise use the parameter's value */ secret1.s = sec_param; secret1.len = strlen(secret1.s); - + if (auth_checks_reg || auth_checks_ind || auth_checks_ood) { /* divide the secret in half: one half for secret1 and one half for * secret2 */ @@ -288,27 +288,27 @@ static int mod_init(void) secret2.s = secret1.s + secret1.len; if (secret2.len < 16) { WARN("auth: consider a longer secret when extra auth checks are" - " enabled (the config secret is divided in 2!)\n"); + " enabled (the config secret is divided in 2!)\n"); } } - } - - if ((!challenge_attr.s || challenge_attr.len == 0) || - challenge_attr.s[0] != '$') { + } + + if ((!challenge_attr.s || challenge_attr.len == 0) || + challenge_attr.s[0] != '$') { ERR("auth: Invalid value of challenge_attr module parameter\n"); return -1; - } - - attr.s = challenge_attr.s + 1; - attr.len = challenge_attr.len - 1; - - if (parse_avp_ident(&attr, &challenge_avpid) < 0) { + } + + attr.s = challenge_attr.s + 1; + attr.len = challenge_attr.len - 1; + + if (parse_avp_ident(&attr, &challenge_avpid) < 0) { ERR("auth: Error while parsing value of challenge_attr module" " parameter\n"); return -1; - } - - parse_qop(&auth_qop); + } + + parse_qop(&auth_qop); switch(auth_qop.qop_parsed){ case QOP_OTHER: ERR("auth: Unsupported qop parameter value\n"); @@ -318,7 +318,7 @@ static int mod_init(void) if (nc_enabled){ #ifndef USE_NC WARN("auth: nounce count support enabled from config, but" - " disabled at compile time (recompile with -DUSE_NC)\n"); + " disabled at compile time (recompile with -DUSE_NC)\n"); nc_enabled=0; #else if (nid_crt==0) @@ -344,7 +344,7 @@ static int mod_init(void) if (otn_enabled){ #ifdef USE_OT_NONCE if (nid_crt==0) init_nonce_id(); - if (init_ot_nonce()!=0) + if (init_ot_nonce()!=0) return -1; #else WARN("auth: one-time-nonce support enabled from config, but " @@ -353,14 +353,14 @@ static int mod_init(void) #endif /* USE_OT_NONCE */ } - return 0; + return 0; } static void destroy(void) { - if (sec_rand1) pkg_free(sec_rand1); - if (sec_rand2) pkg_free(sec_rand2); + if (sec_rand1) pkg_free(sec_rand1); + if (sec_rand2) pkg_free(sec_rand2); #ifdef USE_NC destroy_nonce_count(); #endif @@ -378,30 +378,30 @@ static void destroy(void) */ int consume_credentials(struct sip_msg* msg) { - struct hdr_field* h; - int len; + struct hdr_field* h; + int len; /* skip requests that can't be authenticated */ if (msg->REQ_METHOD & (METHOD_ACK|METHOD_CANCEL|METHOD_PRACK)) return -1; - get_authorized_cred(msg->authorization, &h); - if (!h) { + get_authorized_cred(msg->authorization, &h); + if (!h) { get_authorized_cred(msg->proxy_auth, &h); - if (!h) { + if (!h) { LOG(L_ERR, "auth:consume_credentials: No authorized " "credentials found (error in scripts)\n"); return -1; } - } - - len = h->len; - - if (del_lump(msg, h->name.s - msg->buf, len, 0) == 0) { + } + + len = h->len; + + if (del_lump(msg, h->name.s - msg->buf, len, 0) == 0) { LOG(L_ERR, "auth:consume_credentials: Can't remove credentials\n"); return -1; - } - - return 1; + } + + return 1; } /** @@ -417,7 +417,7 @@ int w_consume_credentials(struct sip_msg* msg, char* s1, char* s2) */ int w_has_credentials(sip_msg_t *msg, char* realm, char* s2) { - str srealm = {0, 0}; + str srealm = {0, 0}; hdr_field_t *hdr = NULL; int ret; @@ -450,8 +450,8 @@ int pv_authenticate(struct sip_msg *msg, str *realm, str *passwd, struct hdr_field* h; auth_body_t* cred; int ret; - str hf = {0, 0}; - avp_value_t val; + str hf = {0, 0}; + avp_value_t val; static char ha1[256]; struct qp *qop = NULL; @@ -537,13 +537,13 @@ int pv_authenticate(struct sip_msg *msg, str *realm, str *passwd, qop = &auth_qauth; } if (get_challenge_hf(msg, (cred ? cred->stale : 0), - realm, NULL, NULL, qop, hftype, &hf) < 0) { + realm, NULL, NULL, qop, hftype, &hf) < 0) { ERR("Error while creating challenge\n"); ret = AUTH_ERROR; } else { val.s = hf; if(add_avp(challenge_avpid.flags | AVP_VAL_STR, - challenge_avpid.name, val) < 0) { + challenge_avpid.name, val) < 0) { LM_ERR("Error while creating attribute with challenge\n"); ret = AUTH_ERROR; } @@ -560,9 +560,9 @@ int pv_authenticate(struct sip_msg *msg, str *realm, str *passwd, static int pv_proxy_authenticate(struct sip_msg *msg, char* realm, char *passwd, char *flags) { - int vflags = 0; - str srealm = {0, 0}; - str spasswd = {0, 0}; + int vflags = 0; + str srealm = {0, 0}; + str spasswd = {0, 0}; if (get_str_fparam(&srealm, msg, (fparam_t*)realm) < 0) { LM_ERR("failed to get realm value\n"); @@ -589,7 +589,7 @@ static int pv_proxy_authenticate(struct sip_msg *msg, char* realm, goto error; } return pv_authenticate(msg, &srealm, &spasswd, vflags, HDR_PROXYAUTH_T, - &msg->first_line.u.request.method); + &msg->first_line.u.request.method); error: return AUTH_ERROR; @@ -601,9 +601,9 @@ static int pv_proxy_authenticate(struct sip_msg *msg, char* realm, static int pv_www_authenticate(struct sip_msg *msg, char* realm, char *passwd, char *flags) { - int vflags = 0; - str srealm = {0, 0}; - str spasswd = {0, 0}; + int vflags = 0; + str srealm = {0, 0}; + str spasswd = {0, 0}; if (get_str_fparam(&srealm, msg, (fparam_t*)realm) < 0) { LM_ERR("failed to get realm value\n"); @@ -630,7 +630,7 @@ static int pv_www_authenticate(struct sip_msg *msg, char* realm, goto error; } return pv_authenticate(msg, &srealm, &spasswd, vflags, HDR_AUTHORIZATION_T, - &msg->first_line.u.request.method); + &msg->first_line.u.request.method); error: return AUTH_ERROR; @@ -639,10 +639,10 @@ static int pv_www_authenticate(struct sip_msg *msg, char* realm, static int pv_www_authenticate2(struct sip_msg *msg, char* realm, char *passwd, char *flags, char *method) { - int vflags = 0; - str srealm = {0, 0}; - str spasswd = {0, 0}; - str smethod = {0, 0}; + int vflags = 0; + str srealm = {0, 0}; + str spasswd = {0, 0}; + str smethod = {0, 0}; if (get_str_fparam(&srealm, msg, (fparam_t*)realm) < 0) { LM_ERR("failed to get realm value\n"); @@ -680,7 +680,7 @@ static int pv_www_authenticate2(struct sip_msg *msg, char* realm, } return pv_authenticate(msg, &srealm, &spasswd, vflags, HDR_AUTHORIZATION_T, - &smethod); + &smethod); error: return AUTH_ERROR; @@ -692,10 +692,10 @@ static int pv_www_authenticate2(struct sip_msg *msg, char* realm, static int pv_auth_check(sip_msg_t *msg, char *realm, char *passwd, char *flags, char *checks) { - int vflags = 0; - int vchecks = 0; - str srealm = {0, 0}; - str spasswd = {0, 0}; + int vflags = 0; + int vchecks = 0; + str srealm = {0, 0}; + str spasswd = {0, 0}; int ret; hdr_field_t *hdr; sip_uri_t *uri = NULL; @@ -750,10 +750,10 @@ static int pv_auth_check(sip_msg_t *msg, char *realm, if(msg->REQ_METHOD==METHOD_REGISTER) ret = pv_authenticate(msg, &srealm, &spasswd, vflags, HDR_AUTHORIZATION_T, - &msg->first_line.u.request.method); + &msg->first_line.u.request.method); else ret = pv_authenticate(msg, &srealm, &spasswd, vflags, HDR_PROXYAUTH_T, - &msg->first_line.u.request.method); + &msg->first_line.u.request.method); if(ret==AUTH_OK && (vchecks&AUTH_CHECK_ID_F)) { hdr = (msg->proxy_auth==0)?msg->authorization:msg->proxy_auth; @@ -770,7 +770,7 @@ static int pv_auth_check(sip_msg_t *msg, char *realm, uri = furi; } if(srealm.len!=uri->user.len - || strncmp(srealm.s, uri->user.s, srealm.len)!=0) + || strncmp(srealm.s, uri->user.s, srealm.len)!=0) return AUTH_USER_MISMATCH; if(msg->REQ_METHOD==METHOD_REGISTER || msg->REQ_METHOD==METHOD_PUBLISH) { @@ -779,7 +779,7 @@ static int pv_auth_check(sip_msg_t *msg, char *realm, || strncmp(furi->user.s, turi->user.s, furi->user.len)!=0) return AUTH_USER_MISMATCH; if(auth_use_domain!=0 && (furi->host.len!=turi->host.len - || strncmp(furi->host.s, turi->host.s, furi->host.len)!=0)) + || strncmp(furi->host.s, turi->host.s, furi->host.len)!=0)) return AUTH_USER_MISMATCH; /* check r-uri==from for publish */ if(msg->REQ_METHOD==METHOD_PUBLISH) { @@ -790,9 +790,9 @@ static int pv_auth_check(sip_msg_t *msg, char *realm, || strncmp(furi->user.s, uri->user.s, furi->user.len)!=0) return AUTH_USER_MISMATCH; if(auth_use_domain!=0 && (furi->host.len!=uri->host.len - || strncmp(furi->host.s, uri->host.s, furi->host.len)!=0)) + || strncmp(furi->host.s, uri->host.s, furi->host.len)!=0)) return AUTH_USER_MISMATCH; - } + } } return AUTH_OK; } @@ -848,9 +848,9 @@ static int fixup_pv_auth_check(void **param, int param_no) * */ static int auth_send_reply(struct sip_msg *msg, int code, char *reason, - char *hdr, int hdr_len) + char *hdr, int hdr_len) { - str reason_str; + str reason_str; /* Add new headers if there are any */ if ((hdr!=NULL) && (hdr_len>0)) { @@ -864,8 +864,8 @@ static int auth_send_reply(struct sip_msg *msg, int code, char *reason, reason_str.len = strlen(reason); return force_stateless_reply ? - slb.sreply(msg, code, &reason_str) : - slb.freply(msg, code, &reason_str); + slb.sreply(msg, code, &reason_str) : + slb.freply(msg, code, &reason_str); } /** @@ -874,8 +874,8 @@ static int auth_send_reply(struct sip_msg *msg, int code, char *reason, int auth_challenge_helper(struct sip_msg *msg, str *realm, int flags, int hftype, str *res) { - int ret, stale; - str hf = {0, 0}; + int ret, stale; + str hf = {0, 0}; struct qp *qop = NULL; ret = -1; @@ -886,17 +886,17 @@ int auth_challenge_helper(struct sip_msg *msg, str *realm, int flags, int hftype qop = &auth_qauth; } if (flags & 16) { - stale = 1; + stale = 1; } else { - stale = 0; + stale = 0; } if (get_challenge_hf(msg, stale, realm, NULL, NULL, qop, hftype, &hf) - < 0) { + < 0) { ERR("Error while creating challenge\n"); ret = -2; goto error; } - + ret = 1; if(res!=NULL) { @@ -908,12 +908,12 @@ int auth_challenge_helper(struct sip_msg *msg, str *realm, int flags, int hftype if(auth_send_reply(msg, 401, "Unauthorized", hf.s, hf.len) <0 ) ret = -3; - break; + break; case HDR_PROXYAUTH_T: if(auth_send_reply(msg, 407, "Proxy Authentication Required", hf.s, hf.len) <0 ) ret = -3; - break; + break; } if(hf.s) pkg_free(hf.s); return ret; @@ -1130,15 +1130,15 @@ static int fixup_auth_get_www_authenticate(void **param, int param_no) case 2: return fixup_var_int_12(param, 1); case 3: - if (fixup_pvar_null(param, 1) != 0) { - LM_ERR("failed to fixup result pvar\n"); - return -1; - } - if (((pv_spec_t *)(*param))->setf == NULL) { - LM_ERR("result pvar is not writeble\n"); - return -1; - } - return 0; + if (fixup_pvar_null(param, 1) != 0) { + LM_ERR("failed to fixup result pvar\n"); + return -1; + } + if (((pv_spec_t *)(*param))->setf == NULL) { + LM_ERR("result pvar is not writeble\n"); + return -1; + } + return 0; } return 0; } diff --git a/modules/auth/auth_mod.h b/modules/auth/auth_mod.h index 47e666ba988..eaba088501b 100644 --- a/modules/auth/auth_mod.h +++ b/modules/auth/auth_mod.h @@ -15,8 +15,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ diff --git a/modules/auth/challenge.c b/modules/auth/challenge.c index 6d537d2924d..1f9c5d0624b 100644 --- a/modules/auth/challenge.c +++ b/modules/auth/challenge.c @@ -1,21 +1,21 @@ /* * Digest Authentication Module - * + * * Copyright (C) 2001-2003 FhG Fokus - * + * * This file is part of Kamailio, a free SIP server. - * + * * Kamailio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version - * + * * Kamailio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License + * + * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * @@ -80,19 +80,19 @@ void strip_realm(str* _realm) * @param algorithm algorithm value * @param qop qop value * @return -1 on error, 0 on success - * + * * The result is stored in param ahf. * If nonce is not null that it is used, instead of call calc_nonce. * If algorithm is not null that it is used irrespective of _PRINT_MD5 - * - * Major usage of nonce and algorithm params is AKA authentication. + * + * Major usage of nonce and algorithm params is AKA authentication. */ int get_challenge_hf(struct sip_msg* msg, int stale, str* realm, str* nonce, str* algorithm, struct qp* qop, int hftype, str *ahf) { - char *p; - str* hfn, hf; - int nonce_len, l, cfg; + char *p; + str* hfn, hf; + int nonce_len, l, cfg; int t; #if defined USE_NC || defined USE_OT_NONCE unsigned int n_id; @@ -107,82 +107,82 @@ int get_challenge_hf(struct sip_msg* msg, int stale, str* realm, } strip_realm(realm); - if (realm) { - DEBUG("build_challenge_hf: realm='%.*s'\n", realm->len, realm->s); - } - if (nonce) { - DEBUG("build_challenge_hf: nonce='%.*s'\n", nonce->len, nonce->s); - } - if (algorithm) { - DEBUG("build_challenge_hf: algorithm='%.*s'\n", algorithm->len, + if (realm) { + DEBUG("build_challenge_hf: realm='%.*s'\n", realm->len, realm->s); + } + if (nonce) { + DEBUG("build_challenge_hf: nonce='%.*s'\n", nonce->len, nonce->s); + } + if (algorithm) { + DEBUG("build_challenge_hf: algorithm='%.*s'\n", algorithm->len, algorithm->s); - } - if (qop && qop->qop_parsed != QOP_UNSPEC) { - DEBUG("build_challenge_hf: qop='%.*s'\n", qop->qop_str.len, + } + if (qop && qop->qop_parsed != QOP_UNSPEC) { + DEBUG("build_challenge_hf: qop='%.*s'\n", qop->qop_str.len, qop->qop_str.s); - } + } - if (hftype == HDR_PROXYAUTH_T) { + if (hftype == HDR_PROXYAUTH_T) { hfn = &proxy_challenge_header; - } else { + } else { hfn = &www_challenge_header; - } - + } + cfg = get_auth_checks(msg); - nonce_len = get_nonce_len(cfg, nc_enabled || otn_enabled); + nonce_len = get_nonce_len(cfg, nc_enabled || otn_enabled); - hf.len = hfn->len; - if (realm) { + hf.len = hfn->len; + if (realm) { hf.len += DIGEST_REALM_LEN - + realm->len; - } + + realm->len; + } - hf.len += DIGEST_NONCE_LEN; + hf.len += DIGEST_NONCE_LEN; - if (nonce) { - hf.len += nonce->len - + 1; /* '"' */ - } - else { - hf.len += nonce_len - + 1; /* '"' */ - } + if (nonce) { + hf.len += nonce->len + + 1; /* '"' */ + } + else { + hf.len += nonce_len + + 1; /* '"' */ + } hf.len += ((stale) ? STALE_PARAM_LEN : 0); - if (algorithm) { - hf.len += DIGEST_ALGORITHM_LEN + algorithm->len; - } - else { - hf.len += 0 + if (algorithm) { + hf.len += DIGEST_ALGORITHM_LEN + algorithm->len; + } + else { + hf.len += 0 #ifdef _PRINT_MD5 - +DIGEST_MD5_LEN + +DIGEST_MD5_LEN #endif - ; - } - - if (qop && qop->qop_parsed != QOP_UNSPEC) { + ; + } + + if (qop && qop->qop_parsed != QOP_UNSPEC) { hf.len += QOP_PARAM_START_LEN + qop->qop_str.len + QOP_PARAM_END_LEN; - } + } hf.len += CRLF_LEN; - p = hf.s = pkg_malloc(hf.len); - if (!hf.s) { + p = hf.s = pkg_malloc(hf.len); + if (!hf.s) { ERR("auth: No memory left (%d bytes)\n", hf.len); return -1; - } + } - memcpy(p, hfn->s, hfn->len); p += hfn->len; + memcpy(p, hfn->s, hfn->len); p += hfn->len; - if(realm){ - memcpy(p, DIGEST_REALM, DIGEST_REALM_LEN); p += DIGEST_REALM_LEN; - memcpy(p, realm->s, realm->len); p += realm->len; - } + if(realm){ + memcpy(p, DIGEST_REALM, DIGEST_REALM_LEN); p += DIGEST_REALM_LEN; + memcpy(p, realm->s, realm->len); p += realm->len; + } - memcpy(p, DIGEST_NONCE, DIGEST_NONCE_LEN); p += DIGEST_NONCE_LEN; - if (nonce) { - memcpy(p, nonce->s, nonce->len); p += nonce->len; - } - else { - l=nonce_len; + memcpy(p, DIGEST_NONCE, DIGEST_NONCE_LEN); p += DIGEST_NONCE_LEN; + if (nonce) { + memcpy(p, nonce->s, nonce->len); p += nonce->len; + } + else { + l=nonce_len; t=time(0); #if defined USE_NC || defined USE_OT_NONCE if (nc_enabled || otn_enabled){ @@ -207,34 +207,34 @@ int get_challenge_hf(struct sip_msg* msg, int stale, str* realm, n_id=0; } if (calc_nonce(p, &l, cfg, t, t + nonce_expire, n_id, - pool | pool_flags, - &secret1, &secret2, msg) != 0) + pool | pool_flags, + &secret1, &secret2, msg) != 0) #else /* USE_NC || USE_OT_NONCE*/ - if (calc_nonce(p, &l, cfg, t, t + nonce_expire, - &secret1, &secret2, msg) != 0) + if (calc_nonce(p, &l, cfg, t, t + nonce_expire, + &secret1, &secret2, msg) != 0) #endif /* USE_NC || USE_OT_NONCE */ - { - ERR("auth: calc_nonce failed (len %d, needed %d)\n", - nonce_len, l); - pkg_free(hf.s); - return -1; - } - p += l; - } - *p = '"'; p++; + { + ERR("auth: calc_nonce failed (len %d, needed %d)\n", + nonce_len, l); + pkg_free(hf.s); + return -1; + } + p += l; + } + *p = '"'; p++; - if (qop && qop->qop_parsed != QOP_UNSPEC) { + if (qop && qop->qop_parsed != QOP_UNSPEC) { memcpy(p, QOP_PARAM_START, QOP_PARAM_START_LEN); p += QOP_PARAM_START_LEN; memcpy(p, qop->qop_str.s, qop->qop_str.len); p += qop->qop_str.len; memcpy(p, QOP_PARAM_END, QOP_PARAM_END_LEN); p += QOP_PARAM_END_LEN; - } - if (stale) { + } + if (stale) { memcpy(p, STALE_PARAM, STALE_PARAM_LEN); p += STALE_PARAM_LEN; - } + } if (algorithm) { memcpy(p, DIGEST_ALGORITHM, DIGEST_ALGORITHM_LEN); p += DIGEST_ALGORITHM_LEN; @@ -243,16 +243,16 @@ int get_challenge_hf(struct sip_msg* msg, int stale, str* realm, } else { #ifdef _PRINT_MD5 - memcpy(p, DIGEST_MD5, DIGEST_MD5_LEN ); p += DIGEST_MD5_LEN; + memcpy(p, DIGEST_MD5, DIGEST_MD5_LEN ); p += DIGEST_MD5_LEN; #endif } - memcpy(p, CRLF, CRLF_LEN); p += CRLF_LEN; - hf.len=(int)(p-hf.s); /* fix len, it might be smaller due to a smaller - nonce */ - - DBG("auth: '%.*s'\n", hf.len, ZSW(hf.s)); + memcpy(p, CRLF, CRLF_LEN); p += CRLF_LEN; + hf.len=(int)(p-hf.s); /* fix len, it might be smaller due to a smaller + * nonce */ + + DBG("auth: '%.*s'\n", hf.len, ZSW(hf.s)); *ahf = hf; - return 0; + return 0; } /** @@ -271,22 +271,22 @@ int get_challenge_hf(struct sip_msg* msg, int stale, str* realm, int build_challenge_hf(struct sip_msg* msg, int stale, str* realm, str* nonce, str* algorithm, int hftype) { - str hf = {0, 0}; - avp_value_t val; + str hf = {0, 0}; + avp_value_t val; int ret; ret = get_challenge_hf(msg, stale, realm, nonce, algorithm, &auth_qop, - hftype, &hf); + hftype, &hf); if(ret < 0) return ret; val.s = hf; - if(add_avp(challenge_avpid.flags | AVP_VAL_STR, challenge_avpid.name, val) + if(add_avp(challenge_avpid.flags | AVP_VAL_STR, challenge_avpid.name, val) < 0) { ERR("auth: Error while creating attribute with challenge\n"); pkg_free(hf.s); return -1; - } + } pkg_free(hf.s); return 0; } diff --git a/modules/auth/challenge.h b/modules/auth/challenge.h index 2645642d7a6..843fecabe9b 100644 --- a/modules/auth/challenge.h +++ b/modules/auth/challenge.h @@ -1,21 +1,21 @@ /* * Digest Authentication Module - * + * * Copyright (C) 2001-2003 FhG Fokus - * + * * This file is part of Kamailio, a free SIP server. - * + * * Kamailio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version - * + * * Kamailio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License + * + * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * @@ -32,12 +32,12 @@ * @param nonce nonce value * @param algorithm algorithm value * @return -1 on error, 0 on success - * + * * The result is stored in an attribute. * If nonce is not null that it is used, instead of call calc_nonce. * If algorithm is not null that it is used irrespective of _PRINT_MD5 - * - * Major usage of nonce and algorithm params is AKA authentication. + * + * Major usage of nonce and algorithm params is AKA authentication. */ typedef int (*build_challenge_hf_t)(struct sip_msg* msg, int stale, str* realm, str* nonce, str* algorithm, int hftype); diff --git a/modules/auth/nc.c b/modules/auth/nc.c index 632dea4df86..5036659076e 100644 --- a/modules/auth/nc.c +++ b/modules/auth/nc.c @@ -1,21 +1,21 @@ /* * Digest Authentication Module - * + * * Copyright (C) 2008 iptelorg GmbH - * + * * This file is part of Kamailio, a free SIP server. - * + * * Kamailio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version - * + * * Kamailio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License + * + * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * @@ -23,8 +23,8 @@ int nc_enabled=0; unsigned nc_array_k; /* array size bits (k in 2^k) */ -unsigned nc_array_size; /* 2^k == 1<=nc_array_size){ ERR("auth: nid_pool_no (%d) too high for the configured " "nc_array_size (%d)\n", nid_pool_no, nc_array_size); @@ -108,7 +108,7 @@ int init_nonce_count() nc_partition_mask=(1<= ((nid_t)(-1)/NID_INC)){ ERR("auth: nc_array_size too big, try decreasing it or increasing" "the number of pools/partitions\n"); @@ -121,8 +121,7 @@ int init_nonce_count() "nc_array_size/nid_pool_no >= %d\n", nid_pool_no, orig_array_size, MIN_NC_ARRAY_PARTITION); } - - + /* array size should be multiple of sizeof(unsigned int) since we * access it as an uint array */ nc_array=shm_malloc(sizeof(nc_t)*ROUND_INT(nc_array_size)); @@ -182,7 +181,7 @@ void destroy_nonce_count() * WARNING: NID_INC * nc_partition_size must fit inside an nidx_t*/ #define nc_id_check_overflow(id, pool) \ ((nid_t)(nid_get((pool))-(id)) >= \ - ((nid_t)NID_INC*nc_partition_size)) + ((nid_t)NID_INC*nc_partition_size)) /* re-init the stored nc for nonce id in pool p */ nid_t nc_new(nid_t id, unsigned char p) @@ -190,7 +189,7 @@ nid_t nc_new(nid_t id, unsigned char p) unsigned int i; unsigned n, r; unsigned int v, new_v; - + n=get_nc_array_raw_idx(id, p); /* n-th nc_t */ i=get_nc_array_uint_idx(n); /* aray index i, corresponding to n */ r=get_nc_int_pos(n); /* byte/short inside the uint corresponding to n */ @@ -205,7 +204,7 @@ nid_t nc_new(nid_t id, unsigned char p) -/* check if nonce-count nc w/ index i is expected/valid and if so it +/* check if nonce-count nc w/ index i is expected/valid and if so it * updated the stored nonce-count * returns: 0 - ok, < 0 some error: * NC_INV_POOL (pool number is invalid/corrupted) @@ -219,7 +218,7 @@ enum nc_check_ret nc_check_val(nid_t id, unsigned pool, unsigned int nc) unsigned int i; unsigned n, r; unsigned int v, crt_nc, new_v; - + if (unlikely(pool>=nid_pool_no)) return NC_INV_POOL; if (unlikely(nc_id_check_overflow(id, pool))) diff --git a/modules/auth/nc.h b/modules/auth/nc.h index 721892e6bd6..e42aa95bb3e 100644 --- a/modules/auth/nc.h +++ b/modules/auth/nc.h @@ -3,27 +3,27 @@ * nonce-count (nc) tracking * * Copyright (C) 2008 iptelorg GmbH - * + * * This file is part of Kamailio, a free SIP server. - * + * * Kamailio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version - * + * * Kamailio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License + * + * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ /* - * Defines: + * Defines: * USE_NC - if not defined no NC specific code will be compiled */ @@ -57,9 +57,9 @@ int init_nonce_count(); void destroy_nonce_count(); -enum nc_check_ret{ - NC_OK=0, NC_INV_POOL=-1, NC_ID_OVERFLOW=-2, NC_TOO_BIG=-3, - NC_REPLAY=-4 +enum nc_check_ret{ + NC_OK=0, NC_INV_POOL=-1, NC_ID_OVERFLOW=-2, NC_TOO_BIG=-3, + NC_REPLAY=-4 }; /* check if nonce-count nc w/ index i is expected/valid and record its diff --git a/modules/auth/nid.c b/modules/auth/nid.c index 72dafa3214f..df1e8c051e8 100644 --- a/modules/auth/nid.c +++ b/modules/auth/nid.c @@ -4,28 +4,28 @@ * time nonces) * * Copyright (C) 2008 iptelorg GmbH - * + * * This file is part of Kamailio, a free SIP server. - * + * * Kamailio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version - * + * * Kamailio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License + * + * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ /* - * Defines: - * USE_NC, USE_OT_NONCE - if neither of them defined no code will be + * Defines: + * USE_NC, USE_OT_NONCE - if neither of them defined no code will be * compiled */ @@ -51,8 +51,7 @@ unsigned int nid_pool_mask; /* mask for computing the current pool*/ int init_nonce_id() { unsigned pool_no, r; - - + if (nid_crt!=0) return 0; /* already init */ if (nid_pool_no==0){ @@ -70,7 +69,7 @@ int init_nonce_id() INFO("auth: nid_pool_no rounded down to %d\n", pool_no); } nid_pool_no=pool_no; - + nid_crt=shm_malloc(sizeof(*nid_crt)*nid_pool_no); if (nid_crt==0){ ERR("auth: init_nonce_id: memory allocation failure\n"); diff --git a/modules/auth/nid.h b/modules/auth/nid.h index d32718f812a..18b2ab74c0b 100644 --- a/modules/auth/nid.h +++ b/modules/auth/nid.h @@ -4,28 +4,28 @@ * time nonces) * * Copyright (C) 2008 iptelorg GmbH - * + * * This file is part of Kamailio, a free SIP server. - * + * * Kamailio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version - * + * * Kamailio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License + * + * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ /* - * Defines: - * USE_NC, USE_OT_NONCE - if neither of them defined no code will be + * Defines: + * USE_NC, USE_OT_NONCE - if neither of them defined no code will be * compiled */ diff --git a/modules/auth/nonce.c b/modules/auth/nonce.c index d65d9cd45fe..3cd8d75877a 100644 --- a/modules/auth/nonce.c +++ b/modules/auth/nonce.c @@ -1,22 +1,22 @@ /* * Digest Authentication Module * Nonce related functions - * + * * Copyright (C) 2001-2003 FhG Fokus - * + * * This file is part of Kamailio, a free SIP server. - * + * * Kamailio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version - * + * * Kamailio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License + * + * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * @@ -71,7 +71,7 @@ int get_auth_checks(struct sip_msg* msg) if (msg->REQ_METHOD == METHOD_REGISTER) { return auth_checks_reg; } - + if (!msg->to && parse_headers(msg, HDR_TO_F, 0) == -1) { DBG("auth: Error while parsing To header field\n"); return auth_checks_ood; @@ -89,16 +89,16 @@ int get_auth_checks(struct sip_msg* msg) * MD5s and returns the length of the binary nonce (cannot return error). * See calc_nonce below for more details.*/ inline static int calc_bin_nonce_md5(union bin_nonce* b_nonce, int cfg, - str* secret1, str* secret2, - struct sip_msg* msg) + str* secret1, str* secret2, + struct sip_msg* msg) { MD5_CTX ctx; - + str* s; int len; MD5Init(&ctx); - + U_MD5Update(&ctx, &b_nonce->raw[0], 4 + 4); if (cfg && msg){ /* auth extra checks => 2 md5s */ @@ -107,7 +107,7 @@ inline static int calc_bin_nonce_md5(union bin_nonce* b_nonce, int cfg, if (b_nonce->n.nid_pf & (NF_VALID_NC_ID | NF_VALID_OT_ID)){ /* if extra auth checks enabled, nid & pf are after the 2nd md5 */ U_MD5Update(&ctx, (unsigned char*)&b_nonce->n.nid_i, - nonce_nid_extra_size); + nonce_nid_extra_size); len+=nonce_nid_extra_size; } #endif /* USE_NC || USE_OT_NONCE */ @@ -119,14 +119,14 @@ inline static int calc_bin_nonce_md5(union bin_nonce* b_nonce, int cfg, s = GET_RURI(msg); MD5Update(&ctx, s->s, s->len); } - if ((cfg & AUTH_CHECK_CALLID) && - !(parse_headers(msg, HDR_CALLID_F, 0) < 0 || msg->callid == 0)) { + if ((cfg & AUTH_CHECK_CALLID) && + !(parse_headers(msg, HDR_CALLID_F, 0) < 0 || msg->callid == 0)) { MD5Update(&ctx, msg->callid->body.s, msg->callid->body.len); } if ((cfg & AUTH_CHECK_FROMTAG) && - !(parse_from_header(msg) < 0 )) { - MD5Update(&ctx, get_from(msg)->tag_value.s, - get_from(msg)->tag_value.len); + !(parse_from_header(msg) < 0 )) { + MD5Update(&ctx, get_from(msg)->tag_value.s, + get_from(msg)->tag_value.len); } if (cfg & AUTH_CHECK_SRC_IP) { U_MD5Update(&ctx, msg->rcv.src_ip.u.addr, msg->rcv.src_ip.len); @@ -141,14 +141,14 @@ inline static int calc_bin_nonce_md5(union bin_nonce* b_nonce, int cfg, /* if extra auth checks are not enabled, nid & pf are after the * 1st md5 */ U_MD5Update(&ctx, (unsigned char*)&b_nonce->n_small.nid_i, - nonce_nid_extra_size); + nonce_nid_extra_size); len+=nonce_nid_extra_size; } #endif /* USE_NC || USE_OT_NONCE*/ MD5Update(&ctx, secret1->s, secret1->len); MD5Final(&b_nonce->n.md5_1[0], &ctx); } - + return len; } @@ -170,45 +170,45 @@ inline static int calc_bin_nonce_md5(union bin_nonce* b_nonce, int cfg, * of the SIP request: * MD5(, , secret1) MD5(, secret2) * @param nonce Pointer to a buffer of *nonce_len. It must have enough - * space to hold the nonce. MAX_NONCE_LEN should be always + * space to hold the nonce. MAX_NONCE_LEN should be always * safe. * @param nonce_len A value/result parameter. Initially it contains the - * nonce buffer length. If the length is too small, it - * will be set to the needed length and the function will - * return error immediately. After a succesfull call it will - * contain the size of nonce written into the buffer, + * nonce buffer length. If the length is too small, it + * will be set to the needed length and the function will + * return error immediately. After a succesfull call it will + * contain the size of nonce written into the buffer, * without the terminating 0. * @param cfg This is the value of one of the tree module parameters that * control which optional checks are enabled/disabled and which * parts of the message will be included in the nonce string. * @param since Time when nonce was created, i.e. nonce is valid since up to - * @param expires Time in seconds after which the nonce will be considered + * @param expires Time in seconds after which the nonce will be considered * stale. * @param n_id Nounce count and/or one-time nonce index value * (32 bit counter) * @param pf First 2 bits are flags, the rest is the index pool number * used if nonce counts or one-time nonces are enabled. * The possible flags values are: NF_VALID_NC_ID which means - * the nonce-count support is enabled and NF_VALID_OT_ID + * the nonce-count support is enabled and NF_VALID_OT_ID * which means the one-time nonces support is enabled. * The pool number can be obtained by and-ing with * NF_POOL_NO_MASK * @param secret1 A secret used for the nonce expires integrity check: * MD5(, , secret1). - * @param secret2 A secret used for integrity check of the message parts + * @param secret2 A secret used for integrity check of the message parts * selected by auth_extra_checks (if any): * MD5(, secret2). - * @param msg The message for which the nonce is computed. If + * @param msg The message for which the nonce is computed. If * auth_extra_checks is set, the MD5 of some fields of the * message will be included in the generated nonce. * @return 0 on success and -1 on error */ int calc_nonce(char* nonce, int *nonce_len, int cfg, int since, int expires, #if defined USE_NC || defined USE_OT_NONCE - unsigned int n_id, unsigned char pf, + unsigned int n_id, unsigned char pf, #endif /* USE_NC || USE_OT_NONCE */ - str* secret1, str* secret2, - struct sip_msg* msg) + str* secret1, str* secret2, + struct sip_msg* msg) { union bin_nonce b_nonce; int len; @@ -222,8 +222,8 @@ int calc_nonce(char* nonce, int *nonce_len, int cfg, int since, int expires, BIN_NONCE_PREPARE(&b_nonce, expires, since, n_id, pf, cfg, msg); len=calc_bin_nonce_md5(&b_nonce, cfg, secret1, secret2, msg); - *nonce_len=base64_enc(&b_nonce.raw[0], len, - (unsigned char*)nonce, *nonce_len); + *nonce_len=base64_enc(&b_nonce.raw[0], len, + (unsigned char*)nonce, *nonce_len); assert(*nonce_len>=0); /*FIXME*/ return 0; } @@ -250,7 +250,7 @@ int calc_nonce(char* nonce, int *nonce_len, int cfg, int since, int expires, /** Checks if nonce is stale. - * This function checks if a nonce given to it in the parameter is stale. + * This function checks if a nonce given to it in the parameter is stale. * A nonce is stale if the expire time stored in the nonce is in the past. * @param b_nonce a pointer to a union bin_nonce to be checked. * @return 1 the nonce is stale, 0 the nonce is not stale. @@ -262,21 +262,21 @@ int calc_nonce(char* nonce, int *nonce_len, int cfg, int since, int expires, /** Utility to convert 8 hex digit string to int */ static inline int l8hex2int(char* _s, unsigned int *_r) { - unsigned int i, res = 0; - - for(i = 0; i < 8; i++) { - res *= 16; - if ((_s[i] >= '0') && (_s[i] <= '9')) { - res += _s[i] - '0'; - } else if ((_s[i] >= 'a') && (_s[i] <= 'f')) { - res += _s[i] - 'a' + 10; - } else if ((_s[i] >= 'A') && (_s[i] <= 'F')) { - res += _s[i] - 'A' + 10; - } else return -1; - } - - *_r = res; - return 0; + unsigned int i, res = 0; + + for(i = 0; i < 8; i++) { + res *= 16; + if ((_s[i] >= '0') && (_s[i] <= '9')) { + res += _s[i] - '0'; + } else if ((_s[i] >= 'a') && (_s[i] <= 'f')) { + res += _s[i] - 'a' + 10; + } else if ((_s[i] >= 'A') && (_s[i] <= 'F')) { + res += _s[i] - 'A' + 10; + } else return -1; + } + + *_r = res; + return 0; } @@ -291,11 +291,11 @@ static inline int l8hex2int(char* _s, unsigned int *_r) * @param nonce A nonce string to be verified. * @param secret1 A secret used for the nonce expires integrity check: * MD5(,, secret1). - * @param secret2 A secret used for integrity check of the message parts + * @param secret2 A secret used for integrity check of the message parts * selected by auth_extra_checks (if any): * MD5(, secret2). - * @param msg The message which contains the nonce being verified. - * @return 0 - success (the nonce was not tampered with and if + * @param msg The message which contains the nonce being verified. + * @return 0 - success (the nonce was not tampered with and if * auth_extra_checks are enabled - the selected message fields * have not changes from the time the nonce was generated) * -1 - invalid nonce @@ -307,7 +307,7 @@ static inline int l8hex2int(char* _s, unsigned int *_r) * 6 - nonce reused */ int check_nonce(auth_body_t* auth, str* secret1, str* secret2, - struct sip_msg* msg) + struct sip_msg* msg) { str * nonce; int since, b_nonce2_len, b_nonce_len, cfg; @@ -328,42 +328,42 @@ int check_nonce(auth_body_t* auth, str* secret1, str* secret2, if (unlikely(nonce->s == 0)) { return -1; /* Invalid nonce */ } - - if (unlikely(nonce->lenlen= then minimum length */ } - + #if defined USE_NC || defined USE_OT_NONCE /* clear all possible nonce flags positions prior to decoding, * to make sure they can be used even if the nonce is shorter */ b_nonce.n.nid_pf=0; b_nonce.n_small.nid_pf=0; #endif /* USE_NC || USE_OT_NONCE */ - + /* decode nonce */ b_nonce_len=base64_dec((unsigned char*)nonce->s, nonce->len, - &b_nonce.raw[0], sizeof(b_nonce)); + &b_nonce.raw[0], sizeof(b_nonce)); if (unlikely(b_nonce_len < MIN_BIN_NONCE_LEN)){ DBG("auth: check_nonce: base64_dec failed\n"); return -1; /* error decoding the nonce (invalid nonce since we checked - the len of the base64 enc. nonce above)*/ + * the len of the base64 enc. nonce above)*/ } - + since = get_bin_nonce_since(&b_nonce); if (unlikely(since < up_since)) { - /* if valid_since time is time pointing before ser was started - * then we consider nonce as stalled. - It may be the nonce generated by previous ser instance having - different length (for example because of different auth. - checks).. Therefore we force credentials to be rebuilt by UAC - without prompting for password */ + /* if valid_since time is time pointing before ser was started + * then we consider nonce as stalled. + * It may be the nonce generated by previous ser instance having + * different length (for example because of different auth. + * checks).. Therefore we force credentials to be rebuilt by UAC + * without prompting for password */ /* if current time is less than start time, reset the start time * (e.g., after start, the system clock was set in the past) */ t=time(0); if (t < up_since) up_since = t; if (since < t) - return 4; + return 4; } t=time(0); if (unlikely((since > t) && ((since-t) > nonce_auth_max_drift) )){ @@ -393,72 +393,72 @@ int check_nonce(auth_body_t* auth, str* secret1, str* secret2, * or is too short => either an old nonce (should * be caught by the ser start time check) or truncated nonce */ return 4; /* return stale for now */ - } +} #endif /* USE_NC */ #ifdef USE_OT_NONCE - if (unlikely(otn_enabled && !(pf & NF_VALID_OT_ID))){ - /* same as above for one-time-nonce */ - return 4; /* return stale for now */ - } +if (unlikely(otn_enabled && !(pf & NF_VALID_OT_ID))){ + /* same as above for one-time-nonce */ + return 4; /* return stale for now */ +} #endif /* USE_OT_NONCE */ - /* don't check if we got the expected length, if the length is smaller - * then expected then the md5 check below will fail (since the nid - * members of the bin_nonce struct will be 0); if the length is bigger - * and it was not caught by the base64_dec above, and the md5 matches, - * we ignore the extra stuff */ +/* don't check if we got the expected length, if the length is smaller + * then expected then the md5 check below will fail (since the nid + * members of the bin_nonce struct will be 0); if the length is bigger + * and it was not caught by the base64_dec above, and the md5 matches, + * we ignore the extra stuff */ #endif /* USE_NC || USE_OT_NONCE */ - b_nonce2_len=calc_bin_nonce_md5(&b_nonce2, cfg, secret1, secret2, msg); - if (!memcmp(&b_nonce.n.md5_1[0], &b_nonce2.n.md5_1[0], 16)) { +b_nonce2_len=calc_bin_nonce_md5(&b_nonce2, cfg, secret1, secret2, msg); +if (!memcmp(&b_nonce.n.md5_1[0], &b_nonce2.n.md5_1[0], 16)) { #ifdef USE_NC - /* if nounce-count checks enabled & auth. headers has nc */ - if (nc_enabled && (pf & NF_VALID_NC_ID) && auth->digest.nc.s && - auth->digest.nc.len){ - if ((auth->digest.nc.len != 8) || - l8hex2int(auth->digest.nc.s, &nc) != 0) { - ERR("check_nonce: bad nc value %.*s\n", - auth->digest.nc.len, auth->digest.nc.s); - return 5; /* invalid nc */ - } - switch(nc_check_val(n_id, pf & NF_POOL_NO_MASK, nc)){ - case NC_OK: - /* don't perform extra checks or one-time nonce checks - * anymore, if we have nc */ - goto check_stale; - case NC_ID_OVERFLOW: /* id too old => stale */ - case NC_TOO_BIG: /* nc overlfow => force re-auth => stale */ - case NC_REPLAY: /* nc seen before => re-auth => stale */ - case NC_INV_POOL: /* pool-no too big, maybe ser restart?*/ - return 4; /* stale */ - } + /* if nounce-count checks enabled & auth. headers has nc */ + if (nc_enabled && (pf & NF_VALID_NC_ID) && auth->digest.nc.s && + auth->digest.nc.len){ + if ((auth->digest.nc.len != 8) || + l8hex2int(auth->digest.nc.s, &nc) != 0) { + ERR("check_nonce: bad nc value %.*s\n", + auth->digest.nc.len, auth->digest.nc.s); + return 5; /* invalid nc */ } + switch(nc_check_val(n_id, pf & NF_POOL_NO_MASK, nc)){ + case NC_OK: + /* don't perform extra checks or one-time nonce checks + * anymore, if we have nc */ + goto check_stale; + case NC_ID_OVERFLOW: /* id too old => stale */ + case NC_TOO_BIG: /* nc overlfow => force re-auth => stale */ + case NC_REPLAY: /* nc seen before => re-auth => stale */ + case NC_INV_POOL: /* pool-no too big, maybe ser restart?*/ + return 4; /* stale */ + } + } #endif /* USE_NC */ #ifdef USE_OT_NONCE - if (otn_enabled && (pf & NF_VALID_OT_ID)){ - switch(otn_check_id(n_id, pf & NF_POOL_NO_MASK)){ - case OTN_OK: - /* continue in case auth extra checks are enabled */ - break; - case OTN_ID_OVERFLOW: - case OTN_INV_POOL: - case OTN_REPLAY: - return 6; /* reused */ - } + if (otn_enabled && (pf & NF_VALID_OT_ID)){ + switch(otn_check_id(n_id, pf & NF_POOL_NO_MASK)){ + case OTN_OK: + /* continue in case auth extra checks are enabled */ + break; + case OTN_ID_OVERFLOW: + case OTN_INV_POOL: + case OTN_REPLAY: + return 6; /* reused */ } + } #endif - if (cfg) { - if (unlikely(b_nonce_len != b_nonce2_len)) - return 2; /* someone truncated our nonce? */ - if (memcmp(&b_nonce.n.md5_2[0], &b_nonce2.n.md5_2[0], 16)) - return 3; /* auth_extra_checks failed */ - } + if (cfg) { + if (unlikely(b_nonce_len != b_nonce2_len)) + return 2; /* someone truncated our nonce? */ + if (memcmp(&b_nonce.n.md5_2[0], &b_nonce2.n.md5_2[0], 16)) + return 3; /* auth_extra_checks failed */ + } #ifdef USE_NC check_stale: #endif /* USE_NC */ - if (unlikely(is_bin_nonce_stale(&b_nonce, t))) - return 4; - return 0; - } - - return 2; + if (unlikely(is_bin_nonce_stale(&b_nonce, t))) + return 4; + return 0; +} + +return 2; } diff --git a/modules/auth/nonce.h b/modules/auth/nonce.h index 53a225efd45..384bcbea6cc 100644 --- a/modules/auth/nonce.h +++ b/modules/auth/nonce.h @@ -1,22 +1,22 @@ /* * Digest Authentication Module * Nonce related functions - * + * * Copyright (C) 2001-2003 FhG Fokus - * + * * This file is part of Kamailio, a free SIP server. - * + * * Kamailio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version - * + * * Kamailio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License + * + * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * @@ -44,17 +44,17 @@ * MD5(expire | since | secret1) (16) \ * [| MD5(info(auth_extra_checks) | secret2) (16) ] * if nonce-count or one-time nonces are enabled, the format changes to: - * bin_nonce = - * bin_nonce = expire_timestamp(4) | since_timestamp(4) | - * MD5(expire | since | nid | pf | secret1) [ | MD5... ] | nid(4) | pf(1) - * where pf is 1 byte, first 2 bits are flags, and the other 6 are + * bin_nonce = + * bin_nonce = expire_timestamp(4) | since_timestamp(4) | + * MD5(expire | since | nid | pf | secret1) [ | MD5... ] | nid(4) | pf(1) + * where pf is 1 byte, first 2 bits are flags, and the other 6 are * the pool no: * bit7 : on => nid & pool are valid for nonce-count * bit6 : on => nid & pool are valid for one-time nonce */ #if defined USE_NC || defined USE_OT_NONCE -#define NF_VALID_NC_ID 128 -#define NF_VALID_OT_ID 64 +#define NF_VALID_NC_ID 128 +#define NF_VALID_OT_ID 64 #define NF_POOL_NO_MASK 63 #endif @@ -76,7 +76,7 @@ struct bin_nonce_str{ #if defined USE_NC || defined USE_OT_NONCE unsigned int nid_i; unsigned char nid_pf; /* pool no & flags: - bits 7, 6 = flags, bits 5..0 pool no*/ + * bits 7, 6 = flags, bits 5..0 pool no*/ #endif /* USE_NC || USE_OT_NONCE */ }; @@ -88,7 +88,7 @@ struct bin_nonce_small_str{ #if defined USE_NC || defined USE_OT_NONCE unsigned int nid_i; unsigned char nid_pf; /* pool no & flags: - bits 7, 6 = flags, bits 5..0 pool no*/ + * bits 7, 6 = flags, bits 5..0 pool no*/ #endif /* USE_NC || USE_OT_NONCE */ }; @@ -153,9 +153,9 @@ union bin_nonce{ #endif /* USE_NC || USE_OT_NONCE */ /* minimum nonce length in binary form (not converted to base64/hex): - * expires_t | since_t | MD5(expires_t | since_t | s1) => 4 + 4 + 16 = 24 + * expires_t | since_t | MD5(expires_t | since_t | s1) => 4 + 4 + 16 = 24 * If nc_enabled the nonce will be bigger: - * expires_t | since_t | MD5... | nonce_id | flag+pool_no(1 byte) + * expires_t | since_t | MD5... | nonce_id | flag+pool_no(1 byte) * => 4 + 4 + 16 + 4 + 1 = 29, but we always return the minimum */ #define MIN_BIN_NONCE_LEN (4 + 4 + 16) @@ -170,7 +170,7 @@ union bin_nonce{ #define MAX_NONCE_LEN base64_enc_len(MAX_BIN_NONCE_LEN) /* * Minimum length of the nonce string - * nonce = expires_TIMESTAMP[4 chars] since_TIMESTAMP[4 chars] + * nonce = expires_TIMESTAMP[4 chars] since_TIMESTAMP[4 chars] * MD5SUM(expires_TIMESTAMP, since_TIMESTAMP, SECRET1)[16 chars] */ #define MIN_NONCE_LEN base64_enc_len(MIN_BIN_NONCE_LEN) diff --git a/modules/auth/ot_nonce.c b/modules/auth/ot_nonce.c index 09abbcd18fc..0807898fcaa 100644 --- a/modules/auth/ot_nonce.c +++ b/modules/auth/ot_nonce.c @@ -1,23 +1,23 @@ /* * Digest Authentication Module - * + * * one-time nonce support * * Copyright (C) 2008 iptelorg GmbH - * + * * This file is part of Kamailio, a free SIP server. - * + * * Kamailio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version - * + * * Kamailio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License + * + * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * @@ -46,7 +46,7 @@ static otn_cell_t * otn_array=0; unsigned otn_partition_size; /* partition==otn_in_flight_no/nid_pool_no*/ unsigned otn_partition_k; /* k such that 2^k==otn_partition_size */ unsigned otn_partition_mask; /* mask for computing the real idx. inside - one partition */ + * one partition */ /* returns -1 on error, 0 on success */ @@ -97,7 +97,7 @@ int init_ot_nonce() " memory(%ld bytes)\n", size, max_mem); } otn_in_flight_no=size; - + if (nid_pool_no>=otn_in_flight_no/(8*sizeof(otn_cell_t))){ ERR("auth: nid_pool_no (%d) too high for the configured " "otn_in_flight_no (%d)\n", nid_pool_no, otn_in_flight_no); @@ -108,7 +108,7 @@ int init_ot_nonce() otn_partition_mask=(1<= ((nid_t)(-1)/NID_INC)){ ERR("auth: otn_in_flight_no too big, try decreasing it or increasing" "the number of pools/partitions, such that " @@ -123,8 +123,7 @@ int init_ot_nonce() "otn_array_size/nid_pool_no >= %d\n", nid_pool_no, orig_array_size, MIN_OTN_PARTITION); } - - + /* array size should be multiple of sizeof(otn_cell_t) since we * access it as an otn_cell_t array */ otn_array=shm_malloc(ROUND2TYPE((otn_in_flight_no+7)/8, otn_cell_t)); @@ -174,14 +173,14 @@ void destroy_ot_nonce() * WARNING: NID_INC * otn_partition_size must fit inside an nidx_t*/ #define otn_id_check_overflow(id, pool) \ ((nid_t)(nid_get((pool))-(id)) >= \ - ((nid_t)NID_INC*otn_partition_size)) + ((nid_t)NID_INC*otn_partition_size)) /* re-init the stored nc for nonce id in pool p */ nid_t otn_new(nid_t id, unsigned char p) { unsigned int i; unsigned n, b; - + n=get_otn_array_bit_idx(id, p); /* n-th bit */ i=get_otn_array_cell_idx(n); /* aray index i, corresponding to n */ b=get_otn_cell_bit(n); /* bit pos corresponding to n */ @@ -208,7 +207,7 @@ enum otn_check_ret otn_check_id(nid_t id, unsigned pool) unsigned int i; unsigned n, b; otn_cell_t v, b_mask; - + if (unlikely(pool>=nid_pool_no)) return OTN_INV_POOL; if (unlikely(otn_id_check_overflow(id, pool))) @@ -217,7 +216,7 @@ enum otn_check_ret otn_check_id(nid_t id, unsigned pool) i=get_otn_array_cell_idx(n); /* aray index i, corresponding to n */ b=get_otn_cell_bit(n); /* bit pos corresponding to n */ b_mask= (otn_cell_t)1<> 4) & 0xf; if (j <= 9) { @@ -58,15 +58,15 @@ inline void cvt_hex(HASH _b, HASHHEX _h) } -/* - * calculate H(A1) as per spec +/* + * calculate H(A1) as per spec */ void calc_HA1(ha_alg_t _alg, str* _username, str* _realm, str* _password, - str* _nonce, str* _cnonce, HASHHEX _sess_key) + str* _nonce, str* _cnonce, HASHHEX _sess_key) { MD5_CTX Md5Ctx; HASH HA1; - + MD5Init(&Md5Ctx); MD5Update(&Md5Ctx, _username->s, _username->len); MD5Update(&Md5Ctx, ":", 1); @@ -89,26 +89,26 @@ void calc_HA1(ha_alg_t _alg, str* _username, str* _realm, str* _password, } -/* - * calculate request-digest/response-digest as per HTTP Digest spec +/* + * calculate request-digest/response-digest as per HTTP Digest spec */ void calc_response(HASHHEX _ha1, /* H(A1) */ - str* _nonce, /* nonce from server */ - str* _nc, /* 8 hex digits */ - str* _cnonce, /* client nonce */ - str* _qop, /* qop-value: "", "auth", "auth-int" */ - int _auth_int, /* 1 if auth-int is used */ - str* _method, /* method from the request */ - str* _uri, /* requested URL */ - HASHHEX _hentity, /* H(entity body) if qop="auth-int" */ - HASHHEX _response) /* request-digest or response-digest */ + str* _nonce, /* nonce from server */ + str* _nc, /* 8 hex digits */ + str* _cnonce, /* client nonce */ + str* _qop, /* qop-value: "", "auth", "auth-int" */ + int _auth_int, /* 1 if auth-int is used */ + str* _method, /* method from the request */ + str* _uri, /* requested URL */ + HASHHEX _hentity, /* H(entity body) if qop="auth-int" */ + HASHHEX _response) /* request-digest or response-digest */ { MD5_CTX Md5Ctx; HASH HA2; HASH RespHash; HASHHEX HA2Hex; - - /* calculate H(A2) */ + + /* calculate H(A2) */ MD5Init(&Md5Ctx); MD5Update(&Md5Ctx, _method->s, _method->len); MD5Update(&Md5Ctx, ":", 1); @@ -122,7 +122,7 @@ void calc_response(HASHHEX _ha1, /* H(A1) */ MD5Final(HA2, &Md5Ctx); cvt_hex(HA2, HA2Hex); - /* calculate response */ + /* calculate response */ MD5Init(&Md5Ctx); MD5Update(&Md5Ctx, _ha1, HASHHEXLEN); MD5Update(&Md5Ctx, ":", 1); diff --git a/modules/auth/rfc2617.h b/modules/auth/rfc2617.h index 9bb19097c04..191be570543 100644 --- a/modules/auth/rfc2617.h +++ b/modules/auth/rfc2617.h @@ -1,22 +1,22 @@ /* * Digest Authentication Module * Digest response calculation as per RFC2617 - * + * * Copyright (C) 2001-2003 FhG Fokus - * + * * This file is part of Kamailio, a free SIP server. - * + * * Kamailio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version - * + * * Kamailio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License + * + * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * @@ -52,46 +52,45 @@ typedef enum { void cvt_hex(HASH Bin, HASHHEX Hex); -/* - * calculate H(A1) as per HTTP Digest spec +/* + * calculate H(A1) as per HTTP Digest spec */ typedef void (*calc_HA1_t)(ha_alg_t _alg, /* Type of algorithm */ - str* _username, /* username */ - str* _realm, /* realm */ - str* _password, /* password */ - str* _nonce, /* nonce string */ - str* _cnonce, /* cnonce */ - HASHHEX _sess_key); /* Result will be stored here */ + str* _username, /* username */ + str* _realm, /* realm */ + str* _password, /* password */ + str* _nonce, /* nonce string */ + str* _cnonce, /* cnonce */ + HASHHEX _sess_key); /* Result will be stored here */ void calc_HA1(ha_alg_t _alg, /* Type of algorithm */ - str* _username, /* username */ - str* _realm, /* realm */ - str* _password, /* password */ - str* _nonce, /* nonce string */ - str* _cnonce, /* cnonce */ - HASHHEX _sess_key); /* Result will be stored here */ + str* _username, /* username */ + str* _realm, /* realm */ + str* _password, /* password */ + str* _nonce, /* nonce string */ + str* _cnonce, /* cnonce */ + HASHHEX _sess_key); /* Result will be stored here */ /* calculate request-digest/response-digest as per HTTP Digest spec */ typedef void (*calc_response_t)(HASHHEX _ha1, /* H(A1) */ - str* _nonce, /* nonce from server */ - str* _nc, /* 8 hex digits */ - str* _cnonce, /* client nonce */ - str* _qop, /* qop-value: "", "auth", "auth-int" */ - int _auth_int, /* 1 if auth-int is used */ - str* _method, /* method from the request */ - str* _uri, /* requested URL */ - HASHHEX _hentity, /* H(entity body) if qop="auth-int" */ - HASHHEX _response); /* request-digest or response-digest */ + str* _nonce, /* nonce from server */ + str* _nc, /* 8 hex digits */ + str* _cnonce, /* client nonce */ + str* _qop, /* qop-value: "", "auth", "auth-int" */ + int _auth_int, /* 1 if auth-int is used */ + str* _method, /* method from the request */ + str* _uri, /* requested URL */ + HASHHEX _hentity, /* H(entity body) if qop="auth-int" */ + HASHHEX _response); /* request-digest or response-digest */ void calc_response(HASHHEX _ha1, /* H(A1) */ - str* _nonce, /* nonce from server */ - str* _nc, /* 8 hex digits */ - str* _cnonce, /* client nonce */ - str* _qop, /* qop-value: "", "auth", "auth-int" */ - int _auth_int, /* 1 if auth-int is used */ - str* _method, /* method from the request */ - str* _uri, /* requested URL */ - HASHHEX _hentity, /* H(entity body) if qop="auth-int" */ - HASHHEX _response); /* request-digest or response-digest */ - + str* _nonce, /* nonce from server */ + str* _nc, /* 8 hex digits */ + str* _cnonce, /* client nonce */ + str* _qop, /* qop-value: "", "auth", "auth-int" */ + int _auth_int, /* 1 if auth-int is used */ + str* _method, /* method from the request */ + str* _uri, /* requested URL */ + HASHHEX _hentity, /* H(entity body) if qop="auth-int" */ + HASHHEX _response); /* request-digest or response-digest */ #endif /* RFC2617_H */ diff --git a/modules/auth_db/README b/modules/auth_db/README index 949878d7393..3697d10b66c 100644 --- a/modules/auth_db/README +++ b/modules/auth_db/README @@ -24,9 +24,9 @@ Jan Janak - Copyright 2002, 2003 FhG FOKUS + Copyright © 2002, 2003 FhG FOKUS - Copyright 2005 Voice Sistem SRL + Copyright © 2005 Voice Sistem SRL __________________________________________________________________ Table of Contents @@ -154,7 +154,7 @@ Chapter 1. Admin Guide For dbtext module (which stores data in plaintext files) it is directory in which the database resides. - Default value is "mysql://kamailioro:kamailioro@localhost/kamailio". + Default value is “mysql://kamailioro:kamailioro@localhost/kamailio”. Example 1.1. db_url parameter usage ... @@ -166,7 +166,7 @@ modparam("auth_db", "db_url", "dbdriver://username:password@dbhost/dbname") This is the name of the column holding usernames. Default value is fine for most people. Use the parameter if you really need to change it. - Default value is "username". + Default value is “username”. Example 1.2. user_column parameter usage ... @@ -179,7 +179,7 @@ modparam("auth_db", "user_column", "user") is fine for most people. Use the parameter if you really need to change it. - Default value is "domain". + Default value is “domain”. Example 1.3. domain_column parameter usage ... @@ -194,7 +194,7 @@ modparam("auth_db", "domain_column", "domain") safe because the server doesn't need to know plaintext passwords and they cannot be obtained from HA1 strings. - Default value is "ha1". + Default value is “ha1”. Example 1.4. password_column parameter usage ... @@ -222,16 +222,16 @@ modparam("auth_db", "password_column_2", "ha1_2") HA1 string or plaintext passwords for authentification. If the parameter is set to 0 and the username parameter of credentials - contains also "@domain" (some user agents append the domain to the + contains also “@domain” (some user agents append the domain to the username parameter), then the server will use the HA1 values from the - column specified in the "password_column_2" parameter. If the username + column specified in the “password_column_2” parameter. If the username parameter doesn't contain a domain, the server will use the HA1 values - from the column given in the "password_column"parameter. + from the column given in the “password_column”parameter. If the parameter is set to 1 then the HA1 value will be calculated from - the column specified in the "password_column" parameter. + the column specified in the “password_column” parameter. - The "password_column_2"column contain also HA1 strings but they should + The “password_column_2”column contain also HA1 strings but they should be calculated including the domain in the username parameter (as opposed to password_column which (when containing HA1 strings) should always contains HA1 strings calculated without domain in username. @@ -257,7 +257,7 @@ modparam("auth_db", "calculate_ha1", 1) IMPORTANT: before turning on this parameter, be sure that the domain column in subscriber table is properly populated. - Default value is "0 (false)". + Default value is “0 (false)”. Example 1.7. use_domain parameter usage ... @@ -276,7 +276,7 @@ modparam("auth_db", "use_domain", 1) * credential = (avp_specification '=' column_name) | (column_name) * avp_specification = '$avp(' + 'i:'ID | 's:'NAME | alias + ')' - Default value of this parameter is "NULL" (no credientials loaded). + Default value of this parameter is “NULL” (no credientials loaded). Example 1.8. load_credentials parameter usage ... @@ -290,7 +290,7 @@ modparam("auth_db", "load_credentials", "$avp(i:123)=rpid;email_address") If set to 0, the module will skip checking the version for subscriber table. - Default value is "1 (check for table version)". + Default value is “1 (check for table version)”. Example 1.9. version_table parameter usage ... @@ -306,7 +306,7 @@ modparam("auth_db", "version_table", 0) 4.5. auth_check(realm, table, flags) 4.6. is_subscriber(uri, dbtable, flags) -4.1. www_authenticate(realm, table [, method]) +4.1. www_authenticate(realm, table [, method]) Name alias: www_authorize(realm, table) @@ -335,7 +335,7 @@ modparam("auth_db", "version_table", 0) * realm - Realm is a opaque string that the user agent should present to the user so he can decide what username and password to use. Usually this is domain of the host the server is running on. - It must not be empty string "". In case of REGISTER requests To + It must not be empty string “”. In case of REGISTER requests To header field domain (e.g., variable $td) can be used (because this header field represents the user being registered), for all other messages From header field domain can be used (e.g., variable $fd). @@ -354,13 +354,13 @@ if (!www_authorize("kamailio.org", "subscriber")) { }; ... -4.2. www_authorize(realm, table) +4.2. www_authorize(realm, table) It is same function as www_authenticate(realm, table). This name is kept for backward compatibility, since it was named this way first time by it actually does user authentication. -4.3. proxy_authenticate(realm, table) +4.3. proxy_authenticate(realm, table) Name alias: proxy_authorize(realm, table) @@ -377,9 +377,9 @@ if (!www_authorize("kamailio.org", "subscriber")) { * realm - Realm is a opaque string that the user agent should present to the user so he can decide what username and password to use. Usually this is domain of the host the server is running on. - It must not be empty string "". Apart of a static string, typical + It must not be empty string “”. Apart of a static string, typical value is From header field domain (e.g., variable $fd). - If an empty string "" is used then the server will generate it from + If an empty string “” is used then the server will generate it from the request. From header field domain will be used as realm. The string may contain pseudo variables. * table - Table to be used to lookup usernames and passwords (usually @@ -394,13 +394,13 @@ if (!proxy_authorize("$fd", "subscriber)) { }; ... -4.4. proxy_authorize(realm, table) +4.4. proxy_authorize(realm, table) It is same function as proxy_authenticate(realm, table). This name is kept for backward compatibility, since it was named this way first time but it actually does user authentication. -4.5. auth_check(realm, table, flags) +4.5. auth_check(realm, table, flags) The function combines the functionalities of www_authenticate and proxy_authenticate, first being exectuted if the SIP request is a @@ -416,7 +416,7 @@ if (!proxy_authorize("$fd", "subscriber)) { * realm - Realm is a opaque string that the user agent should present to the user so he can decide what username and password to use. Usually this is domain of the host the server is running on. - It must not be empty string "". Apart of a static string, typical + It must not be empty string “”. Apart of a static string, typical value is From header field domain (e.g., variable $fd). The string may contain pseudo variables. * table - Table to be used to lookup usernames and passwords (usually @@ -446,7 +446,7 @@ if (!auth_check("$fd", "subscriber", "1")) { } ... -4.6. is_subscriber(uri, dbtable, flags) +4.6. is_subscriber(uri, dbtable, flags) The function checks if there is a subscriber corresponding to the AoR in uri parameter. It uses same database connection as for diff --git a/modules/auth_diameter/README b/modules/auth_diameter/README index e5b2cfa3ab7..050736d880a 100644 --- a/modules/auth_diameter/README +++ b/modules/auth_diameter/README @@ -8,7 +8,7 @@ Edited by Elena-Ramona Modroiu - Copyright 2003, 2004 FhG FOKUS + Copyright © 2003, 2004 FhG FOKUS __________________________________________________________________ Table of Contents @@ -137,7 +137,7 @@ Chapter 1. Admin Guide Hostname of the machine where the DIAMETER Client is running. - Default value is "localhost". + Default value is “localhost”. Example 1.2. Set diameter_client_host parameter ... @@ -148,7 +148,7 @@ modparam("auth_diameter", "diameter_client_host", "10.10.10.10") Port number where the DIAMETER Client is listening. - Default value is "3000". + Default value is “3000”. Example 1.3. Set diameter_client_port parameter ... @@ -160,7 +160,7 @@ modparam("auth_diameter", "diameter_client_port", 3000) Specifies whether the domain name part of URI is used when checking the user's privileges. - Default value is "0 (0==false and 1==true )". + Default value is “0 (0==false and 1==true )”. Example 1.4. Set use_domain parameter ... @@ -173,12 +173,12 @@ modparam("auth_diameter", "use_domain", 1) 4.2. diameter_proxy_authorize(realm) 4.3. diameter_is_user_in(who, group) -4.1. diameter_www_authorize(realm) +4.1. diameter_www_authorize(realm) SIP Server checks for authorization having a DIAMETER server in backend. If no credentials are provided inside the SIP request then a challenge is sent back to UAC. If the credentials don't match the ones - computed by DISC then "403 Forbidden" is sent back. + computed by DISC then “403 Forbidden” is sent back. Negative codes may be interpreted as follows: * -5 (generic error) - some generic error occurred and no reply was @@ -199,12 +199,12 @@ if(!diameter_www_authorize("siphub.net")) }; ... -4.2. diameter_proxy_authorize(realm) +4.2. diameter_proxy_authorize(realm) SIP Proxy checks for authorization having a DIAMETER server in backend. If no credentials are provided inside the SIP request then a challenge is sent back to UAC. If the credentials don't match the ones computed - by DISC then "403 Forbidden" is sent back. For more about the negative + by DISC then “403 Forbidden” is sent back. For more about the negative return codes, see the above function. Meaning of the parameters is as follows: @@ -221,14 +221,14 @@ if(!diameter_proxy_authorize("siphub.net")) }; ... -4.3. diameter_is_user_in(who, group) +4.3. diameter_is_user_in(who, group) The method performs group membership checking with DISC. Meaning of the parameters is as follows: * who - what header to be used to get the SIP URI that is wanted to be checked being member in a certain group. It can be: - "Request-URI", "From", "To" or "Credentials". + “Request-URI”, “From”, “To” or “Credentials”. * group - the group name where to check if the user is part of. This function can be used from REQUEST_ROUTE. diff --git a/modules/auth_ephemeral/authorize.c b/modules/auth_ephemeral/authorize.c index fcd8de025ae..a8914ba6477 100644 --- a/modules/auth_ephemeral/authorize.c +++ b/modules/auth_ephemeral/authorize.c @@ -334,17 +334,17 @@ int autheph_www2(struct sip_msg *_m, char *_realm, char *_method) return AUTH_ERROR; } - if (_m->REQ_METHOD == METHOD_ACK || _m->REQ_METHOD == METHOD_CANCEL) - { - return AUTH_OK; - } - if(_m == NULL || _realm == NULL) { LM_ERR("invalid parameters\n"); return AUTH_ERROR; } + if (_m->REQ_METHOD == METHOD_ACK || _m->REQ_METHOD == METHOD_CANCEL) + { + return AUTH_OK; + } + if (get_str_fparam(&srealm, _m, (fparam_t*)_realm) < 0) { LM_ERR("failed to get realm value\n"); diff --git a/modules/auth_identity/README b/modules/auth_identity/README index 042df572b1f..d9761bdbdf7 100644 --- a/modules/auth_identity/README +++ b/modules/auth_identity/README @@ -1,12 +1,11 @@ - SIP Authenticated Identity Module Gergely Kovacs Iptel.org - Copyright 2007 Iptel.org - _________________________________________________________________ + Copyright © 2007 Iptel.org + __________________________________________________________________ Table of Contents @@ -30,31 +29,31 @@ Gergely Kovacs 6. Functions - 6.1. auth_date_proc() + 6.1. auth_date_proc() 6.1.1. Dependencies - 6.2. auth_add_identity() + 6.2. auth_add_identity() 6.2.1. Dependencies - 6.3. vrfy_check_date() + 6.3. vrfy_check_date() 6.3.1. Dependencies - 6.4. vrfy_get_certificate() + 6.4. vrfy_get_certificate() 6.4.1. Dependencies - 6.5. vrfy_check_certificate() + 6.5. vrfy_check_certificate() 6.5.1. Dependencies - 6.6. vrfy_check_msgvalidity() + 6.6. vrfy_check_msgvalidity() 6.6.1. Dependencies - 6.7. vrfy_check_callid() + 6.7. vrfy_check_callid() 6.7.1. Dependencies @@ -64,14 +63,14 @@ Gergely Kovacs List of Examples 1.1. Set privatekey_path parameter - 1.2. Set certificate_path parameter - 1.3. Set certificate_url parameter - 1.4. Set msg_timeout parameter - 1.5. Set auth_validity_time parameter - 1.6. Set auth_validity_time parameter - 1.7. Set certificate_cache_limit parameter - 1.8. Set cainfo_path parameter - 1.9. Set accept_pem_certs parameter + 1.2. Set certificate_path parameter + 1.3. Set certificate_url parameter + 1.4. Set msg_timeout parameter + 1.5. Set auth_validity_time parameter + 1.6. Set auth_validity_time parameter + 1.7. Set certificate_cache_limit parameter + 1.8. Set cainfo_path parameter + 1.9. Set accept_pem_certs parameter Chapter 1. Admin Guide @@ -95,31 +94,31 @@ Chapter 1. Admin Guide 6. Functions - 6.1. auth_date_proc() + 6.1. auth_date_proc() 6.1.1. Dependencies - 6.2. auth_add_identity() + 6.2. auth_add_identity() 6.2.1. Dependencies - 6.3. vrfy_check_date() + 6.3. vrfy_check_date() 6.3.1. Dependencies - 6.4. vrfy_get_certificate() + 6.4. vrfy_get_certificate() 6.4.1. Dependencies - 6.5. vrfy_check_certificate() + 6.5. vrfy_check_certificate() 6.5.1. Dependencies - 6.6. vrfy_check_msgvalidity() + 6.6. vrfy_check_msgvalidity() 6.6.1. Dependencies - 6.7. vrfy_check_callid() + 6.7. vrfy_check_callid() 6.7.1. Dependencies @@ -129,17 +128,17 @@ Chapter 1. Admin Guide 1. Overview Auth Identity module provides functionalities for securely identifying - originators of SIP messages. It implements the SIP Identity standard - where a SIP proxy signs messages that is sent to other domains. This + originators of SIP messages. It implements the SIP Identity standard + where a SIP proxy signs messages that is sent to other domains. This module has two basic services: - * authorizer - authorizes a message and adds Identity and + * authorizer - authorizes a message and adds Identity and Identity-Info headers * verifier - verifies an authorized message Known limitations in this version: * authorizer and verifier support all SIP requests except for CANCEL and REGISTER - * verifier does not support the subjectAltName extension of + * verifier does not support the subjectAltName extension of certificates 2. Dependencies @@ -152,16 +151,16 @@ Chapter 1. Admin Guide * OpenSSL (version 0.9.8 or higher) for cryptographic functions * libcurl for HTTP, HTTPS functions - If you'd like to use TLS module too then use the corresponding LIB - line in auth_identity's Makefile + If you'd like to use TLS module too then use the corresponding LIB line + in auth_identity's Makefile 4. Installation And Running the Authorizer service needs to make the public key, which conveyed in - a certificate, available over HTTPS or HTTP for verifiers. The domain - the authorizer is responsible for and the domain part of the URL of - the certificate must be the same. This service needs access to the - private key too. + a certificate, available over HTTPS or HTTP for verifiers. The domain + the authorizer is responsible for and the domain part of the URL of the + certificate must be the same. This service needs access to the private + key too. 5. Parameters @@ -198,7 +197,7 @@ modparam("auth_identity","privatekey_path","/etc/ssl/private/key.pem") This parameter is required by authentication service. - Example 1.2. Set certificate_path parameter + Example 1.2. Set certificate_path parameter ... modparam("auth_identity","certificate_path","/var/www/ssl/mycert.pem") ... @@ -207,13 +206,13 @@ modparam("auth_identity","certificate_path","/var/www/ssl/mycert.pem") Note: this parameter is for authorizer service. - The url where certificate is available for other verifier services. - (value of Identity-info header) The certificate should be in DER + The url where certificate is available for other verifier services. + (value of Identity-info header) The certificate should be in DER format. This parameter is required by authentication service. - Example 1.3. Set certificate_url parameter + Example 1.3. Set certificate_url parameter ... modparam("auth_identity","certificate_url","https://foo.bar/mycert.der") ... @@ -222,13 +221,13 @@ modparam("auth_identity","certificate_url","https://foo.bar/mycert.der") Note: this parameter is for authorizer service. - If the Date header of message which is needed to be authenticated - contains a time different by more than this seconds from the current + If the Date header of message which is needed to be authenticated + contains a time different by more than this seconds from the current time noted by the authentication service then it rejects the message. This parameter is optional. The default value is "600". - Example 1.4. Set msg_timeout parameter + Example 1.4. Set msg_timeout parameter ... modparam("auth_identity","msg_timeout",600) ... @@ -237,13 +236,13 @@ modparam("auth_identity","msg_timeout",600) Note: this parameter is for verifier service. - The validity time of an authenticated message. The message will be + The validity time of an authenticated message. The message will be refused if it contains a time different by more than this seconds from the current time noted by the verification service. This parameter is optional. The default value is "3600". - Example 1.5. Set auth_validity_time parameter + Example 1.5. Set auth_validity_time parameter ... modparam("auth_identity","auth_validity_time",3600) ... @@ -252,15 +251,15 @@ modparam("auth_identity","auth_validity_time",3600) Note: this parameter is for verifier service. - The number of Call-IDs stored in order to recognize call replay - attacks. A Call-ID is stored auth_validity_time long and uses + The number of Call-IDs stored in order to recognize call replay + attacks. A Call-ID is stored auth_validity_time long and uses approximately 100 bytes memory. - This parameter is optional. The default value is "32768". (you should - increase the size of shared memory with -m command line switch if you + This parameter is optional. The default value is "32768". (you should + increase the size of shared memory with -m command line switch if you liked to store more callid than 10000) - Example 1.6. Set auth_validity_time parameter + Example 1.6. Set auth_validity_time parameter ... modparam("auth_identity","callid_cache_limit",32768) ... @@ -270,12 +269,12 @@ modparam("auth_identity","callid_cache_limit",32768) Note: this parameter is for verifier service. The number of certificates stored in order to avoid needless download. - A certificate is stored until its expiration date and uses + A certificate is stored until its expiration date and uses approximately 600 bytes memory. This parameter is optional. The default value is "4096". - Example 1.7. Set certificate_cache_limit parameter + Example 1.7. Set certificate_cache_limit parameter ... modparam("auth_identity","certificate_cache_limit",4096) ... @@ -284,13 +283,13 @@ modparam("auth_identity","certificate_cache_limit",4096) Note: this parameter is for verifier service. - A file of trusted certificates. The file should contain multiple - certificates in PEM format concatenated together. It could be useful + A file of trusted certificates. The file should contain multiple + certificates in PEM format concatenated together. It could be useful for verifying a certificate signed by a private CA. This parameter is optional. It has not got default value. - Example 1.8. Set cainfo_path parameter + Example 1.8. Set cainfo_path parameter ... modparam("auth_identity","cainfo_path","/etc/ssl/certs/ca-certificates.crt") ... @@ -303,38 +302,38 @@ modparam("auth_identity","cainfo_path","/etc/ssl/certs/ca-certificates.crt") This parameter is optional. The default value is "0". - Example 1.9. Set accept_pem_certs parameter + Example 1.9. Set accept_pem_certs parameter ... modparam("auth_identity","accept_pem_certs",1) ... 6. Functions - 6.1. auth_date_proc() + 6.1. auth_date_proc() 6.1.1. Dependencies - 6.2. auth_add_identity() + 6.2. auth_add_identity() 6.2.1. Dependencies - 6.3. vrfy_check_date() + 6.3. vrfy_check_date() 6.3.1. Dependencies - 6.4. vrfy_get_certificate() + 6.4. vrfy_get_certificate() 6.4.1. Dependencies - 6.5. vrfy_check_certificate() + 6.5. vrfy_check_certificate() 6.5.1. Dependencies - 6.6. vrfy_check_msgvalidity() + 6.6. vrfy_check_msgvalidity() 6.6.1. Dependencies - 6.7. vrfy_check_callid() + 6.7. vrfy_check_callid() 6.7.1. Dependencies @@ -342,12 +341,12 @@ modparam("auth_identity","accept_pem_certs",1) Note: this function is for authorizer service. - If a message, the auth service should authorize, contains Date header - then this function checks whether it falls in message timeout (set by - msg_timeout parameter). If there is not any Date header then the - module adds one. This function also checks whether the certificate of - the authentication service (set by certificate_path parameter) has - been expired. + If a message, the auth service should authorize, contains Date header + then this function checks whether it falls in message timeout (set by + msg_timeout parameter). If there is not any Date header then the module + adds one. This function also checks whether the certificate of the + authentication service (set by certificate_path parameter) has been + expired. 6.1.1. Dependencies @@ -357,17 +356,17 @@ modparam("auth_identity","accept_pem_certs",1) Note: this function is for authorizer service. - Assembles digest-string from the message, calculates its SHA1 hash, + Assembles digest-string from the message, calculates its SHA1 hash, encrypts it with the private key (set by privatekey_path parameter) of - the authorizer service, base64 encodes it and adds to the outgoing - message as the value of Identity header. This function also adds - Identity-Info header which contains an URI (set by certificate_url + the authorizer service, base64 encodes it and adds to the outgoing + message as the value of Identity header. This function also adds + Identity-Info header which contains an URI (set by certificate_url parameter) from which the certificate of auth service can be acquired. - Note: this function needs the final outgoing message for - authorization, so no module may modify any digest string related - headers (From, To, Call-ID, CSeq, Date, Contact) and body after - auth_add_identity()'s been called + Note: this function needs the final outgoing message for authorization, + so no module may modify any digest string related headers (From, To, + Call-ID, CSeq, Date, Contact) and body after auth_add_identity()'s been + called 6.2.1. Dependencies @@ -377,7 +376,7 @@ modparam("auth_identity","accept_pem_certs",1) Note: this function is for verifier service. - Checks Date header of the incoming message whether falls in validity + Checks Date header of the incoming message whether falls in validity time (set by auth_validity_time parameter) 6.3.1. Dependencies @@ -388,9 +387,9 @@ modparam("auth_identity","accept_pem_certs",1) Note: this function is for verifier service. - Tries to get certificate defined by the value of Identity-info header - from certificate table (which size is set by certificate_cache_limit - parameter). If the required certificate is not found there then this + Tries to get certificate defined by the value of Identity-info header + from certificate table (which size is set by certificate_cache_limit + parameter). If the required certificate is not found there then this function downloads it. 6.4.1. Dependencies @@ -401,9 +400,9 @@ modparam("auth_identity","accept_pem_certs",1) Note: this function is for verifier service. - Checks whether the downloaded certificate is valid (is not expired, - its subject and the domain part of the URL are the same) and adds it - to certificate table. + Checks whether the downloaded certificate is valid (is not expired, its + subject and the domain part of the URL are the same) and adds it to + certificate table. 6.5.1. Dependencies @@ -413,22 +412,22 @@ modparam("auth_identity","accept_pem_certs",1) Note: this function is for verifier service. - Assembles digest-string from the message, create SHA1 hash and - compares it with the decrypted value of Identity header. + Assembles digest-string from the message, create SHA1 hash and compares + it with the decrypted value of Identity header. 6.6.1. Dependencies - vrfy_get_certificate() must be called before and + vrfy_get_certificate() must be called before and vrfy_check_certificate() should be called before 6.7. vrfy_check_callid() Note: this function is for verifier service. - Checks whether the current call's been already processed in validity - time (set by auth_validity_time) to recognize call replay attacks. If + Checks whether the current call's been already processed in validity + time (set by auth_validity_time) to recognize call replay attacks. If this call (identified by Call-id, Cseq, and tag of From header triple) - has not been replayed then adds it to callid table (which size is set + has not been replayed then adds it to callid table (which size is set by callid_cache_limit parameter). 6.7.1. Dependencies diff --git a/modules/auth_identity/auth_crypt.c b/modules/auth_identity/auth_crypt.c index 1cb11ff6772..f9b40e6d7e4 100644 --- a/modules/auth_identity/auth_crypt.c +++ b/modules/auth_identity/auth_crypt.c @@ -37,6 +37,8 @@ #include #include #include +#include +#include #include "../../mem/mem.h" #include "../../parser/parse_uri.h" @@ -114,7 +116,11 @@ int check_x509_subj(X509 *pcert, str* sdom) if (actname->type == GEN_DNS || actname->type == GEN_URI) { /* we've found one */ +#if OPENSSL_VERSION_NUMBER >= 0x010100000L + altptr = (char *)ASN1_STRING_get0_data(actname->d.ia5); +#else altptr = (char *)ASN1_STRING_data(actname->d.ia5); +#endif if (actname->type == GEN_URI) { if (parse_uri(altptr, strlen(altptr), &suri) != 0) { continue; @@ -162,22 +168,30 @@ int check_x509_subj(X509 *pcert, str* sdom) int verify_x509(X509 *pcert, X509_STORE *pcacerts) { - X509_STORE_CTX ca_ctx; + X509_STORE_CTX *ca_ctx = NULL; char *strerr; + ca_ctx = X509_STORE_CTX_new(); + if(ca_ctx==NULL) { + LM_ERR("cannot get a x509 context\n"); + return -1; + } - if (X509_STORE_CTX_init(&ca_ctx, pcacerts, pcert, NULL) != 1) { + if (X509_STORE_CTX_init(ca_ctx, pcacerts, pcert, NULL) != 1) { LOG(L_ERR, "AUTH_IDENTITY:verify_x509: Unable to init X509 store ctx\n"); + X509_STORE_CTX_free(ca_ctx); return -1; } - if (X509_verify_cert(&ca_ctx) != 1) { - strerr = (char *) X509_verify_cert_error_string(ca_ctx.error); + if (X509_verify_cert(ca_ctx) != 1) { + strerr = (char *)X509_verify_cert_error_string(X509_STORE_CTX_get_error(ca_ctx)); LOG(L_ERR, "AUTH_IDENTITY VERIFIER: Certificate verification error: %s\n", strerr); - X509_STORE_CTX_cleanup(&ca_ctx); + X509_STORE_CTX_cleanup(ca_ctx); + X509_STORE_CTX_free(ca_ctx); return -2; } - X509_STORE_CTX_cleanup(&ca_ctx); + X509_STORE_CTX_cleanup(ca_ctx); + X509_STORE_CTX_free(ca_ctx); LOG(AUTH_DBG_LEVEL, "AUTH_IDENTITY VERIFIER: Certificate is valid\n"); diff --git a/modules/auth_identity/auth_hdrs.c b/modules/auth_identity/auth_hdrs.c index 06a773be7da..9afffd52bd6 100644 --- a/modules/auth_identity/auth_hdrs.c +++ b/modules/auth_identity/auth_hdrs.c @@ -449,7 +449,7 @@ int digeststr_asm(dynstr *sout, struct sip_msg *msg, str *sdate, int iflags) /* there was an error or the required header is missing */ if (iRes==AUTH_ERROR - || (iRes==AUTH_NOTFOUND && (pactpart[i1].iflag & DS_REQUIRED))) + || (iRes==AUTH_NOTFOUND && (pactpart[i1].iflag & DS_REQUIRED))) return -1; switch (pactpart[i1].itype) { @@ -552,7 +552,7 @@ int append_date(str *sdate, int idatesize, time_t *tout, struct sip_msg *msg) } ilen=strftime(date_str, sizeof(date_str), AUTH_TIME_FORMAT, bd_time); - if (ilen > sizeof(date_hf) - strlen("Date: \r\n") || ilen==0) { + if (ilen >= sizeof(date_hf) - strlen("Date: \r\n.") || ilen==0) { LOG(L_ERR, "AUTH_IDENTITY:append_date: unexpected time length\n"); return -3; } @@ -569,10 +569,12 @@ int append_date(str *sdate, int idatesize, time_t *tout, struct sip_msg *msg) if (sdate && idatesize >= ilen) { memcpy(sdate->s, date_str, ilen); sdate->len=ilen; - } else + } else { return -5; - if (tout) - *tout=tdate_now; + } + + if (tout) + *tout=tdate_now; return 0; } @@ -667,24 +669,24 @@ static char *auth_get_hf_name(char *begin, char *end, enum _hdr_types_t *type) goto other; } else { return (p + 1); - } + } /* Unknown header type */ other: p = q_memchr(p, ':', end - p); - if (!p) { /* No double colon found, error.. */ + if (!p) { /* No double colon found, error.. */ *type = HDR_ERROR_T; return 0; - } else { + } else { *type = HDR_OTHER_T; return (p + 1); - } + } return p; } /* parses buffer that contains a SIP message header, looks for "Contact" - header field and returns the value of that */ + * header field and returns the value of that */ static int get_contact_body(char *buf, unsigned int len, str *sout) { char *end, *s, *tmp, *match; diff --git a/modules/auth_radius/README b/modules/auth_radius/README index 583733340b8..b687a5b5c78 100644 --- a/modules/auth_radius/README +++ b/modules/auth_radius/README @@ -22,11 +22,17 @@ Jan Janak - Copyright 2002, 2003 FhG FOKUS +Edited by + +Phil Lavin + + - Copyright 2005 Voice Sistem SRL + Copyright © 2002, 2003 FhG FOKUS - Copyright 2008-2010 Juha Heinanen + Copyright © 2005 Voice Sistem SRL + + Copyright © 2008-2010 Juha Heinanen __________________________________________________________________ Table of Contents @@ -47,6 +53,7 @@ Jan Janak 4.3. auth_extra (string) 4.4. use_ruri_flag (integer) 4.5. radius_avps_mode (integer) + 4.6. append_realm_to_username (integer) 5. Functions @@ -55,14 +62,15 @@ Jan Janak List of Examples - 1.1. "SIP-AVP" RADIUS AVP exmaples + 1.1. “SIP-AVP” RADIUS AVP exmaples 1.2. radius_config parameter usage 1.3. service_type parameter usage 1.4. auth_extra parameter usage 1.5. use_ruri_flag parameter usage 1.6. radius_avps_mode parameter usage - 1.7. radius_www_authorize usage - 1.8. proxy_authorize usage + 1.7. append_realm_to_username parameter usage + 1.8. radius_www_authorize usage + 1.9. proxy_authorize usage Chapter 1. Admin Guide @@ -82,6 +90,7 @@ Chapter 1. Admin Guide 4.3. auth_extra (string) 4.4. use_ruri_flag (integer) 4.5. radius_avps_mode (integer) + 4.6. append_realm_to_username (integer) 5. Functions @@ -98,19 +107,20 @@ Chapter 1. Admin Guide to the radius server we perform some sanity checks over the credentials to make sure that only well formed credentials will get to the server. We have implemented radius authentication according to - draft-sterman-aaa-sip-00. This module requires radiusclient-ng library - version 0.5.0 or higher which is available from - http://developer.berlios.de/projects/radiusclient-ng/. + draft-sterman-aaa-sip-00. This module requires the radiusclient-ng + library version 0.5.0 or higheer or freeradius-client which is + available from https://github.com/FreeRADIUS/freeradius-client/. You + can also install this library from distribution repositories. 2. Additional Credentials - When performing authentification, the RADIUS server may include in the - response additional credentials. This scheme is very useful in fetching - additional user information from the RADIUS server without making extra - queries. + When performing authentification, the RADIUS server may include + additional credentials in the response. This scheme is very useful in + fetching additional user information from the RADIUS server without + making extra queries. The additional credentials are embedded in the RADIUS reply as AVPs - "SIP-AVP". The syntax of the value is: + “SIP-AVP”. The syntax of the value is: * value = SIP_AVP_NAME SIP_AVP_VALUE * SIP_AVP_NAME = STRING_NAME | '#'ID_NUMBER * SIP_AVP_VALUE = ':'STRING_VALUE | '#'NUMBER_VALUE @@ -120,7 +130,7 @@ Chapter 1. Admin Guide The RPID value may be fetch via this mechanism. - Example 1.1. "SIP-AVP" RADIUS AVP exmaples + Example 1.1. “SIP-AVP” RADIUS AVP exmaples .... "email:joe@yahoo.com" - STRING NAME AVP (email) with STRING VALUE (joe@yahoo.com) @@ -141,12 +151,17 @@ Chapter 1. Admin Guide The module depends on the following modules (in the other words the listed modules must be loaded before this module): - * modules/auth -- Generic authentication functions + * auth -- Generic authentication functions 3.2. External Libraries or Applications The following libraries or applications must be installed before compilling Kamailio with this module loaded: + + One of these libraries. Notice that development of radiusclient-ng has + stopped, as the project merged with freeradius-client. + * freeradius-client available from + https://github.com/FreeRADIUS/freeradius-client/. * radiusclient-ng 0.5.0 or higher -- library and development files. See http://developer.berlios.de/projects/radiusclient-ng/. @@ -157,13 +172,14 @@ Chapter 1. Admin Guide 4.3. auth_extra (string) 4.4. use_ruri_flag (integer) 4.5. radius_avps_mode (integer) + 4.6. append_realm_to_username (integer) 4.1. radius_config (string) This is the location of the configuration file of radius client libraries. - Default value is "/usr/local/etc/radiusclient-ng/radiusclient.conf". + Default value is “/usr/local/etc/radiusclient-ng/radiusclient.conf”. Example 1.2. radius_config parameter usage modparam("auth_radius", "radius_config", "/etc/radiusclient.conf") @@ -174,7 +190,7 @@ modparam("auth_radius", "radius_config", "/etc/radiusclient.conf") default should be fine for most people. See your radius client include files for numbers to be put in this parameter if you need to change it. - Default value is "15". + Default value is “15”. Example 1.3. service_type parameter usage modparam("auth_radius", "service_type", 15) @@ -203,7 +219,7 @@ modparam("auth_radius", "auth_extra", "Acct-Session-Id=$ci") authentication. At the time of this writing, certain versions of Linksys WRT54GL are known to do that. - Default value is "-1". + Default value is “-1”. Example 1.5. use_ruri_flag parameter usage modparam("auth_radius", "use_ruri_flag", 22) @@ -219,6 +235,17 @@ modparam("auth_radius", "use_ruri_flag", 22) Example 1.6. radius_avps_mode parameter usage modparam("auth_radius", "radius_avps_mode", 1) +4.6. append_realm_to_username (integer) + + If set to 1, the username passed to the RADIUS server will have the + digest realm appended to it, if no domain is provided in the digest + username. + + Default value is 1. + + Example 1.7. append_realm_to_username parameter usage +modparam("auth_radius", "append_realm_to_username", 0) + 5. Functions 5.1. radius_www_authorize(realm [, uri_user]) @@ -263,7 +290,7 @@ modparam("auth_radius", "radius_avps_mode", 1) This function can be used from REQUEST_ROUTE. - Example 1.7. radius_www_authorize usage + Example 1.8. radius_www_authorize usage ... if (!radius_www_authorize("$td")) { switch ($rc) { @@ -315,7 +342,7 @@ modparam("auth_radius", "radius_avps_mode", 1) This function can be used from REQUEST_ROUTE. - Example 1.8. proxy_authorize usage + Example 1.9. proxy_authorize usage ... if (!radius_proxy_authorize("$pd", "$pU")) { # Realm and URI user are taken switch ($rc) { # from P-Preferred-Identity diff --git a/modules/auth_radius/authorize.c b/modules/auth_radius/authorize.c index f9c45dd7186..19b81225d02 100644 --- a/modules/auth_radius/authorize.c +++ b/modules/auth_radius/authorize.c @@ -80,7 +80,7 @@ static inline int authorize(struct sip_msg* _msg, pv_elem_t* _realm, pv_spec_t * _uri_user, hdr_types_t _hftype) { int res; - auth_result_t ret; + auth_cfg_result_t ret; struct hdr_field* h; auth_body_t* cred; str *uri_user; diff --git a/modules/auth_radius/doc/auth_radius_admin.xml b/modules/auth_radius/doc/auth_radius_admin.xml index 0475d5746e9..22879374c34 100644 --- a/modules/auth_radius/doc/auth_radius_admin.xml +++ b/modules/auth_radius/doc/auth_radius_admin.xml @@ -22,18 +22,18 @@ to the radius server we perform some sanity checks over the credentials to make sure that only well formed credentials will get to the server. We have implemented radius authentication according to - draft-sterman-aaa-sip-00. This module requires radiusclient-ng - library version 0.5.0 or or freeradius-client or higher which is available from + draft-sterman-aaa-sip-00. This module requires the radiusclient-ng + library version 0.5.0 or higheer or freeradius-client which is available from https://github.com/FreeRADIUS/freeradius-client/. - Also can be installed from repos. + You can also install this library from distribution repositories.
Additional Credentials - When performing authentification, the RADIUS server may include in the - response additional credentials. This scheme is very useful in fetching + When performing authentification, the RADIUS server may include additional + credentials in the response. This scheme is very useful in fetching additional user information from the RADIUS server without making extra queries. @@ -85,7 +85,7 @@ the listed modules must be loaded before this module): - modules/auth + auth -- Generic authentication functions @@ -99,6 +99,16 @@ before compilling &kamailio; with this module loaded: + One of these libraries. Notice that development of + radiusclient-ng has stopped, as the project merged with + freeradius-client. + + + freeradius-client available from + + https://github.com/FreeRADIUS/freeradius-client/. + + radiusclient-ng 0.5.0 or higher -- library and development files. See - Copyright 2015 asipto.com + Copyright © 2015 asipto.com __________________________________________________________________ Table of Contents @@ -141,7 +141,7 @@ modparam("auth_xkeys", "xkey", "id=abc;name=xyz;value=secret;expires=72000") 4.1. auth_xkeys_add(hdr, kid, alg, data) 4.2. auth_xkeys_check(hdr, kid, alg, data) -4.1. auth_xkeys_add(hdr, kid, alg, data) +4.1. auth_xkeys_add(hdr, kid, alg, data) Add a header computed with the first key in the group kid, hasing with algorithm alg over the content of parameter data. The parameters can @@ -156,7 +156,7 @@ modparam("auth_xkeys", "xkey", "id=abc;name=xyz;value=secret;expires=72000") auth_xkeys_add("X-My-Key", "abc", "sha256", "$Ri:$fu:$ru:$hdr(CSeq)"); ... -4.2. auth_xkeys_check(hdr, kid, alg, data) +4.2. auth_xkeys_check(hdr, kid, alg, data) Check if the value of header hdr matches the value computed with the first key in the group kid, hasing with algorithm alg over the content diff --git a/modules/auth_xkeys/auth_xkeys.c b/modules/auth_xkeys/auth_xkeys.c index 67989482950..3dfc07e2ff4 100644 --- a/modules/auth_xkeys/auth_xkeys.c +++ b/modules/auth_xkeys/auth_xkeys.c @@ -153,7 +153,7 @@ int authx_xkey_add_params(str *sparam) param_hooks_t phooks; param_t *pit=NULL; auth_xkey_t tmp; - unsigned int uv; + unsigned int uv = 0; if (parse_params(sparam, CLASS_ANY, &phooks, ¶ms_list)<0) return -1; diff --git a/modules/avp/README b/modules/avp/README index e3855ba0e5b..2885c1cabda 100644 --- a/modules/avp/README +++ b/modules/avp/README @@ -10,7 +10,7 @@ Michal Matyska iptel - Copyright 2004, 2005, 2006 FhG FOKUS, iptelorg GmbH + Copyright © 2004, 2005, 2006 FhG FOKUS, iptelorg GmbH __________________________________________________________________ Table of Contents diff --git a/modules/avpops/README b/modules/avpops/README index 889cdc62d30..3dea0e75fe1 100644 --- a/modules/avpops/README +++ b/modules/avpops/README @@ -10,7 +10,7 @@ Ramona-Elena Modroiu - Copyright 2004, 2005 Voice Sistem SRL + Copyright © 2004, 2005 Voice Sistem SRL __________________________________________________________________ Table of Contents @@ -242,7 +242,7 @@ modparam("avpops","use_domain",1) Name of column containing the uuid (unique user id). - Default value is "uuid". + Default value is “uuid”. Example 1.5. Set uuid_column parameter ... @@ -253,7 +253,7 @@ modparam("avpops","uuid_column","uuid") Name of column containing the username. - Default value is "username". + Default value is “username”. Example 1.6. Set username_column parameter ... @@ -264,7 +264,7 @@ modparam("avpops","username_column","username") Name of column containing the domain name. - Default value is "domain". + Default value is “domain”. Example 1.7. Set domain_column parameter ... @@ -275,7 +275,7 @@ modparam("avpops","domain_column","domain") Name of column containing the attribute name (AVP name). - Default value is "attribute". + Default value is “attribute”. Example 1.8. Set attribute_column parameter ... @@ -286,7 +286,7 @@ modparam("avpops","attribute_column","attribute") Name of column containing the AVP value. - Default value is "value". + Default value is “value”. Example 1.9. Set value_column parameter ... @@ -297,7 +297,7 @@ modparam("avpops","value_column","value") Name of integer column containing the AVP type. - Default value is "type". + Default value is “type”. Possible column values are * 0 - AVP with string name and string value @@ -325,7 +325,7 @@ modparam("avpops","type_column","type") + 'value_type='('integer'|'string') + 'table='string - Default value is "NULL". + Default value is “NULL”. Example 1.11. Set db_scheme parameter ... @@ -349,7 +349,7 @@ modparam("avpops","db_scheme", 5.12. is_avp_set(name) 5.13. avp_print() -5.1. avp_db_load(source,name) +5.1. avp_db_load(source,name) Loads from DB into memory the AVPs corresponding to the given source. If given, it sets the script flags for loaded AVPs. It returns true if @@ -387,7 +387,7 @@ avp_db_load("$uuid","$avp(s:404fwd)/fwd_table"); avp_db_load("$ru","$avp(i1:123)/$some_scheme"); ... -5.2. avp_db_store(source,name) +5.2. avp_db_store(source,name) Stores to DB the AVPs corresponding to the given source. @@ -403,7 +403,7 @@ avp_db_store("$tu","$avp(i:678)"); avp_db_store("$ru/username","$avp(email)"); ... -5.3. avp_db_delete(source,name) +5.3. avp_db_delete(source,name) Deletes from DB the AVPs corresponding to the given source. @@ -420,7 +420,7 @@ avp_db_delete("$ru/username","$avp(email)"); avp_db_delete("$uuid","$avp(s:404fwd)/fwd_table"); ... -5.4. avp_db_query(query[,dest]) +5.4. avp_db_query(query[,dest]) Make a database query and store the result in AVPs. This command is deprecated, please use the more flexible and advanced sqlops module @@ -436,8 +436,8 @@ avp_db_delete("$uuid","$avp(s:404fwd)/fwd_table"); used in the query makes you vulnerable to SQL injection, e.g. make it possible for an outside attacker to alter your database content. * dest - a list with AVP names where to store the result. The format - is "$avp(name1);$avp(name2);...". If this parameter is ommited, the - result is stored in "$avp(i:1);$avp(i:2);...". If the result gives + is “$avp(name1);$avp(name2);...”. If this parameter is ommited, the + result is stored in “$avp(i:1);$avp(i:2);...”. If the result gives many rows, then multiple AVPs with corresponding name will be added. The value type of the AVP (string or integer) will be derived from the type of the columns. Please note that only this @@ -460,7 +460,7 @@ avp_db_query("select password, ha1 from subscriber where username='$tu'", avp_db_query("delete from subscriber"); ... -5.5. avp_delete(name) +5.5. avp_delete(name) Deletes from memory the AVPs with name or, if empty, all AVPs. @@ -482,7 +482,7 @@ avp_delete("i"); avp_delete("a3"); ... -5.6. avp_pushto(destination,name) +5.6. avp_pushto(destination,name) Pushes the value of AVP(s) into the SIP message. @@ -512,7 +512,7 @@ avp_pushto("$du","$avp(i:679)"); avp_pushto("$br","$avp(i:680)"); ... -5.7. avp_check(name,op_value) +5.7. avp_check(name,op_value) Checks the value of the AVP(s) against an operator and value. @@ -567,7 +567,7 @@ $var(id)=2; avp_check("$xavp(op=>foo[*])","fm/$xavp(op=>fm[$var(id)])/g"); ... -5.8. avp_copy(old_name,new_name) +5.8. avp_copy(old_name,new_name) Copy / move an avp under a new name. @@ -579,8 +579,11 @@ avp_check("$xavp(op=>foo[*])","fm/$xavp(op=>fm[$var(id)])/g"); + name = ( avp_name | avp_alias ) ['/'flags] + flags = 'g' | 'G' | 'd' | 'D' | 'n' | 'N' | 's' | 'S' - This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, - BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE. + NOTE: if a list of AVPs is copied/moved (flag g|G), then the order of + the values is reversed. Copy/move twice in order to get the same order + as in original list. + + This function can be used from ANY_ROUTE. Example 1.19. avp_copy usage ... @@ -588,7 +591,7 @@ avp_copy("$avp(i:678)", "$avp(s:345)/g"); avp_copy("$avp(old)","$avp(new)/gd"); ... -5.9. avp_printf(dest, format) +5.9. avp_printf(dest, format) NOTE: since Kamailio 1.3.0 the function has been moved to core and it is an alias to pv_printf(). @@ -612,7 +615,7 @@ avp_copy("$avp(old)","$avp(new)/gd"); avp_printf("$avp(i:20)", "This is a $rm request with call-id $hdr(call-id)"); ... -5.10. avp_subst(avps, subst) +5.10. avp_subst(avps, subst) Perl/sed-like subst applied to AVPs having string value. @@ -654,7 +657,7 @@ avp_subst("$avp(i:678)/$avp(i:679)/g", "/(.*)@(.*)/\1@$rd/"); after the first src_avp is processed, it will be added in avp list and next processing will use it. -5.11. avp_op(name,op_value) +5.11. avp_op(name,op_value) Different integer operations with avps. @@ -686,7 +689,7 @@ avp_op("$avp(i:678)", "add/i:345/g"); avp_op("$avp(number)","sub/$avp(number2)/d"); ... -5.12. is_avp_set(name) +5.12. is_avp_set(name) Check if any AVP with name is set. @@ -705,7 +708,7 @@ if(is_avp_set("$avp(i:678)")) log("AVP with integer id 678 exists\n"); ... -5.13. avp_print() +5.13. avp_print() Prints the list with all the AVPs from memory. This is only a helper/debug function. diff --git a/modules/avpops/doc/avpops_admin.xml b/modules/avpops/doc/avpops_admin.xml index 482bb895a94..82451060e9b 100644 --- a/modules/avpops/doc/avpops_admin.xml +++ b/modules/avpops/doc/avpops_admin.xml @@ -826,8 +826,12 @@ avp_check("$xavp(op=>foo[*])","fm/$xavp(op=>fm[$var(id)])/g"); - This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, - BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE. + NOTE: if a list of AVPs is copied/moved (flag g|G), then the order + of the values is reversed. Copy/move twice in order to get the same + order as in original list. + + + This function can be used from ANY_ROUTE. <function>avp_copy</function> usage diff --git a/modules/benchmark/README b/modules/benchmark/README index a2193de37a8..dfa34d8f529 100644 --- a/modules/benchmark/README +++ b/modules/benchmark/README @@ -15,9 +15,9 @@ Bastian Friedrich - Copyright 2007 Collax GmbH + Copyright © 2007 Collax GmbH - Copyright 2007 Voice System SRL + Copyright © 2007 Voice System SRL __________________________________________________________________ Table of Contents @@ -151,7 +151,7 @@ Chapter 1. Admin Guide that feature is implemented. * 1 - Globally enable benchmarking - Default value is "0". + Default value is “0”. Example 1.1. Set enable parameter ... @@ -164,7 +164,7 @@ modparam("benchmark", "enable", 1) function, but only every n'th call. n is defined through this variable. A sensible granularity seems to be 100. - Default value is "1". + Default value is “1”. Example 1.2. Set granularity parameter ... @@ -184,7 +184,7 @@ modparam("benchmark", "granularity", 500) * 2 - L_INFO * 3 - L_DBG - Default value is "3" (L_INFO). + Default value is “3” (L_INFO). Example 1.3. Set loglevel parameter ... @@ -198,16 +198,16 @@ modparam("benchmark", "loglevel", 4) 4.1. bm_start_timer(name) 4.2. bm_log_timer(name) -4.1. bm_start_timer(name) +4.1. bm_start_timer(name) - Start timer "name". A later call to "bm_log_timer()" logs this timer.. + Start timer “name”. A later call to “bm_log_timer()” logs this timer.. Example 1.4. bm_start_timer usage ... bm_start_timer("test"); ... -4.2. bm_log_timer(name) +4.2. bm_log_timer(name) This function logs the timer with the given ID. The following data are logged: @@ -215,7 +215,7 @@ bm_start_timer("test"); equals the granularity variable. * Last sum is the accumulated duration in the current logging - interval (i.e. for the last "granularity" calls). + interval (i.e. for the last “granularity” calls). * Last min is the minimum duration between start/log_timer calls during the last interval. @@ -318,18 +318,18 @@ Chapter 2. Developer Guide 1.2. bm_start(id) 1.3. bm_log(id) -1.1. bm_register(name, mode, id) +1.1. bm_register(name, mode, id) This function register a new timer and/or returns the internal ID associated with the timer. mode controls the creation of new timer if not found. id is to be used by start and log timer functions. -1.2. bm_start(id) +1.2. bm_start(id) This function equals the user-exported function bm_start_timer. The id is passed as an integer, though. -1.3. bm_log(id) +1.3. bm_log(id) This function equals the user-exported function bm_log_timer. The id is passed as an integer, though. diff --git a/modules/blst/README b/modules/blst/README index dc25cd65ec2..87e6aba63cc 100644 --- a/modules/blst/README +++ b/modules/blst/README @@ -1,12 +1,11 @@ - Blst Module - Blacklist Management Andrei Pelinescu-Onciul iptelorg GmbH - Copyright 2007 iptelorg GmbH - _________________________________________________________________ + Copyright © 2007 iptelorg GmbH + __________________________________________________________________ Table of Contents @@ -15,14 +14,14 @@ Andrei Pelinescu-Onciul 1. Overview 2. Functions - 2.1. blst_add([timeout]) - 2.2. blst_add_retry_after(min, max) - 2.3. blst_del() - 2.4. blst_is_blacklisted() - 2.5. blst_set_ignore([flags]) - 2.6. blst_rpl_set_ignore([flags]) - 2.7. blst_clear_ignore([flags]) - 2.8. blst_rpl_clear_ignore([flags]) + 2.1. blst_add([timeout]) + 2.2. blst_add_retry_after(min, max) + 2.3. blst_del() + 2.4. blst_is_blacklisted() + 2.5. blst_set_ignore([flags]) + 2.6. blst_rpl_set_ignore([flags]) + 2.7. blst_clear_ignore([flags]) + 2.8. blst_rpl_clear_ignore([flags]) List of Examples @@ -40,14 +39,14 @@ Chapter 1. Admin Guide 1. Overview 2. Functions - 2.1. blst_add([timeout]) - 2.2. blst_add_retry_after(min, max) - 2.3. blst_del() - 2.4. blst_is_blacklisted() - 2.5. blst_set_ignore([flags]) - 2.6. blst_rpl_set_ignore([flags]) - 2.7. blst_clear_ignore([flags]) - 2.8. blst_rpl_clear_ignore([flags]) + 2.1. blst_add([timeout]) + 2.2. blst_add_retry_after(min, max) + 2.3. blst_del() + 2.4. blst_is_blacklisted() + 2.5. blst_set_ignore([flags]) + 2.6. blst_rpl_set_ignore([flags]) + 2.7. blst_clear_ignore([flags]) + 2.8. blst_rpl_clear_ignore([flags]) 1. Overview @@ -55,19 +54,19 @@ Chapter 1. Admin Guide 2. Functions - 2.1. blst_add([timeout]) - 2.2. blst_add_retry_after(min, max) - 2.3. blst_del() - 2.4. blst_is_blacklisted() - 2.5. blst_set_ignore([flags]) - 2.6. blst_rpl_set_ignore([flags]) - 2.7. blst_clear_ignore([flags]) - 2.8. blst_rpl_clear_ignore([flags]) + 2.1. blst_add([timeout]) + 2.2. blst_add_retry_after(min, max) + 2.3. blst_del() + 2.4. blst_is_blacklisted() + 2.5. blst_set_ignore([flags]) + 2.6. blst_rpl_set_ignore([flags]) + 2.7. blst_clear_ignore([flags]) + 2.8. blst_rpl_clear_ignore([flags]) 2.1. blst_add([timeout]) - Adds the source of the current message to the blacklist for timeout - seconds. If timeout is missing or 0 it uses the default blacklist + Adds the source of the current message to the blacklist for timeout + seconds. If timeout is missing or 0 it uses the default blacklist timeout (dst_blacklist_expire). Example 1.1. blst_add usage @@ -80,11 +79,11 @@ else 2.2. blst_add_retry_after(min, max) - Adds the source of the current message to the blacklist for the time - interval specified in the Retry-After header. If the Retry-After - header is missing, it will fail (returns false). If the Retry-After - value is less than min, then min seconds will be used instead. If the - Retry-After value is greater than max, then max seconds will be used + Adds the source of the current message to the blacklist for the time + interval specified in the Retry-After header. If the Retry-After header + is missing, it will fail (returns false). If the Retry-After value is + less than min, then min seconds will be used instead. If the + Retry-After value is greater than max, then max seconds will be used instead. Example 1.2. blst_add_retry_after usage @@ -98,8 +97,8 @@ if (msg_status==503){ # blacklist 503 source for Retry-After seconds 2.3. blst_del() - Removes the source of the current message from the blacklist. If the - address is not present in the blacklist at the time of the call it + Removes the source of the current message from the blacklist. If the + address is not present in the blacklist at the time of the call it returns false. Example 1.3. blst_del usage @@ -121,24 +120,24 @@ if (msg_status==503){ # blacklist 503 source for Retry-After seconds 2.5. blst_set_ignore([flags]) - Set errors that will not be taken into account when deciding whether - to blacklist a destination for the current message or a local reply to - the current message. + Set errors that will not be taken into account when deciding whether to + blacklist a destination for the current message or a local reply to the + current message. - blst_set_ignore(..) works for forwarding the current message and - blst_rpl_set_ignore(...) works for local replies to the current + blst_set_ignore(..) works for forwarding the current message and + blst_rpl_set_ignore(...) works for local replies to the current message. - The variants of these functions with no parameters will ignore + The variants of these functions with no parameters will ignore everything (equivalent to passing 0xff). - The flags are stored internally as a bitmask, and are applied by + The flags are stored internally as a bitmask, and are applied by bitwise ANDing them together. The following flags are available: * 0x02 - generic send error (send denied/ failed). * 0x04 - connect failed (TCP, TLS or SCTP). * 0x08 - ICMP error (not currently used). * 0x10 - SIP transaction timeout. - * 0x20 - 503 reply (statefull mode only). For more details see + * 0x20 - 503 reply (statefull mode only). For more details see tmblst_503. Note @@ -156,7 +155,7 @@ Note 2.7. blst_clear_ignore([flags]) - Clears blacklist ignore flags previously set by the corresponding + Clears blacklist ignore flags previously set by the corresponding blst_set_ignore(...) or blst_rpl_set_ignore(...) functions. See also blst_set_ignore. diff --git a/modules/call_control/README b/modules/call_control/README index 28f5f1fe97d..9444eef1b85 100644 --- a/modules/call_control/README +++ b/modules/call_control/README @@ -10,7 +10,7 @@ Dan Pascu - Copyright (c) 2005-2008 Dan Pascu + Copyright © 2005-2008 Dan Pascu __________________________________________________________________ Table of Contents @@ -178,7 +178,7 @@ Chapter 1. Admin Guide return a code indicating that there is no limit associated with the call, allowing the use of the same configuration without changes. - Default value is "0". + Default value is “0”. Example 1.1. Setting the disable parameter ... @@ -190,7 +190,7 @@ modparam("call_control", "disable", 1) The path to the filesystem socket where the callcontrol application listens for commands from the module. - Default value is "/var/run/callcontrol/socket". + Default value is “/var/run/callcontrol/socket”. Example 1.2. Setting the socket_name parameter ... @@ -202,7 +202,7 @@ modparam("call_control", "socket_name", "/var/run/callcontrol/socket") How long time (in milliseconds) to wait for an answer from the callcontrol application. - Default value is "500" ms. + Default value is “500” ms. Example 1.3. Setting the socket_timeout parameter ... @@ -228,7 +228,7 @@ modparam("call_control", "socket_timeout", 500) call based on caller's SIP URI, caller's SIP domain or caller's IP address (whichever yields a rate forst, in this order). - Default value is "$avp(s:signaling_ip)". + Default value is “$avp(s:signaling_ip)”. Example 1.4. Setting the signaling_ip_avp parameter ... @@ -244,7 +244,7 @@ modparam("call_control", "signaling_ip_avp", "$avp(s:signaling_ip)") have a different, canonical form in the rating engine computation than it has in the ruri. - Default value is "$avp(s:can_uri)". + Default value is “$avp(s:can_uri)”. Example 1.5. Setting the canonical_uri_avp parameter ... @@ -258,7 +258,7 @@ modparam("call_control", "canonical_uri_avp", "$avp(s:can_uri)") by the rating engine as the billing party when finding the rates to apply to a given call, otherwise, the caller's URI taken from the From field will be used. When set, this AVP should contain a value in the - form "user@domain" (no sip: prefix should be used). + form “user@domain” (no sip: prefix should be used). This is useful when a destination diverts a call, thus becoming the new caller. In this case the billing party is the diverter and this AVP @@ -268,7 +268,7 @@ modparam("call_control", "canonical_uri_avp", "$avp(s:can_uri)") because B is the billing party in the call not A after the call was diverted. - Default value is "805". + Default value is “805”. Example 1.6. Setting the diverter_avp_id parameter ... diff --git a/modules/call_control/call_control.c b/modules/call_control/call_control.c index 62af9244f81..5450e0055c1 100644 --- a/modules/call_control/call_control.c +++ b/modules/call_control/call_control.c @@ -985,7 +985,7 @@ __dialog_ended(struct dlg_cell *dlg, int type, struct dlg_cb_params *_params) if( !msg || msg == FAKED_REPLY) msg = _params->req; call_control_stop(msg, dlg->callid); - *_params->param = (void*)CCInactive; + *_params->param = NULL; } } diff --git a/modules/carrierroute/README b/modules/carrierroute/README index 586b01f1741..ff3361339e8 100644 --- a/modules/carrierroute/README +++ b/modules/carrierroute/README @@ -35,7 +35,9 @@ Lucian Balaceanu 3.8. use_domain (int) 3.9. fallback_default (int) 3.10. fetch_rows (integer) - 3.11. match_mode (integer) + 3.11. db_load_description (integer) + 3.12. match_mode (integer) + 3.13. avoid_failed_destinations (integer) 4. Functions @@ -112,21 +114,23 @@ Lucian Balaceanu 1.8. Set use_domain parameter 1.9. Set fallback_default parameter 1.10. Set fetch_rows parameter - 1.11. Set match_mode parameter - 1.12. cr_replace_host usage - 1.13. cr_deactivate_host usage - 1.14. cr_activate_host usage - 1.15. cr_add_host usage - 1.16. cr_delete_host usage - 1.17. Configuration example - Routing to default tree - 1.18. Configuration example - Routing to user tree - 1.19. Configuration example - module configuration - 1.20. Example database content - carrierroute table - 1.21. Example database content - simple carrierfailureroute table - 1.22. Example database content - more complex carrierfailureroute table - 1.23. Example database content - carrier_name table - 1.24. Example database content - domain_name table - 1.25. Necessary extensions for the user table + 1.11. Unset db_load_description parameter + 1.12. Set match_mode parameter + 1.13. Set avoid_failed_destinations parameter + 1.14. cr_replace_host usage + 1.15. cr_deactivate_host usage + 1.16. cr_activate_host usage + 1.17. cr_add_host usage + 1.18. cr_delete_host usage + 1.19. Configuration example - Routing to default tree + 1.20. Configuration example - Routing to user tree + 1.21. Configuration example - module configuration + 1.22. Example database content - carrierroute table + 1.23. Example database content - simple carrierfailureroute table + 1.24. Example database content - more complex carrierfailureroute table + 1.25. Example database content - carrier_name table + 1.26. Example database content - domain_name table + 1.27. Necessary extensions for the user table 2.1. Set db_url parameter 2.2. Set carrierroute_table parameter 2.3. Set carrierroute_id_col parameter @@ -180,7 +184,9 @@ Chapter 1. Admin Guide 3.8. use_domain (int) 3.9. fallback_default (int) 3.10. fetch_rows (integer) - 3.11. match_mode (integer) + 3.11. db_load_description (integer) + 3.12. match_mode (integer) + 3.13. avoid_failed_destinations (integer) 4. Functions @@ -299,7 +305,9 @@ Chapter 1. Admin Guide 3.8. use_domain (int) 3.9. fallback_default (int) 3.10. fetch_rows (integer) - 3.11. match_mode (integer) + 3.11. db_load_description (integer) + 3.12. match_mode (integer) + 3.13. avoid_failed_destinations (integer) 3.1. subscriber_table (string) @@ -425,7 +433,20 @@ modparam("carrierroute", "fallback_default", 1) modparam("carrierroute", "fetch_rows", 3000) ... -3.11. match_mode (integer) +3.11. db_load_description (integer) + + Toggle on/off loading in memory the description column in the + carrierroute/carrierfailureroute database tables. This reduces the + shared memory used by the module. + + Default value is “1”. + + Example 1.11. Unset db_load_description parameter +... +modparam("carrierroute", "db_load_description", 0) +... + +3.12. match_mode (integer) The number of individual characters that are used for matching. Valid values are 10 or 128. When you specifiy 10, only digits will be used @@ -436,11 +457,24 @@ modparam("carrierroute", "fetch_rows", 3000) Default value is “10”. - Example 1.11. Set match_mode parameter + Example 1.12. Set match_mode parameter ... modparam("carrierroute", "match_mode", 10) ... +3.13. avoid_failed_destinations (integer) + + Integer parameter to toggle on/off the possibility that in the + failurerouting cases destinations that previously failed are avoided. + Possible values are 0 (off), 1 (on). Also see cr_route section. + + Default value is “1”. + + Example 1.13. Set avoid_failed_destinations parameter +... +modparam("carrierroute", "avoid_failed_destinations", 0) +... + 4. Functions 4.1. cr_user_carrier(user, domain, dstavp) @@ -500,10 +534,12 @@ descavp) This is useful if you need some additional informations that belongs to each gw, like the destination or the number of channels. - The function pays special attention to the failurerouting cases, so - that any destination that has failed to provide a successful response - will not be reused in a subsequent call of cr_route. This situation can - appear when different route domains contain a set of common gateways. + Depending on the value of the avoid_failed_destinations module + parameter, the function pays special attention to the failurerouting + cases, so that any destination that has failed to provide a successful + response will not be reused in a subsequent call of cr_route. This + situation can appear when different route domains contain a set of + common gateways. This function is only usable with rewrite_user and prefix_matching containing a valid string. This string needs to be numerical if the @@ -648,7 +684,7 @@ dstavp) Use the "null" prefix to specify an empty prefix. - Example 1.12. cr_replace_host usage + Example 1.14. cr_replace_host usage ... kamctl fifo cr_replace_host "-d proxy -p 49 -h proxy1 -t proxy2" ... @@ -669,7 +705,7 @@ kamctl fifo cr_replace_host "-d proxy -p 49 -h proxy1 -t proxy2" Use the "null" prefix to specify an empty prefix. - Example 1.13. cr_deactivate_host usage + Example 1.15. cr_deactivate_host usage ... kamctl fifo cr_deactivate_host "-d proxy -p 49 -h proxy1" ... @@ -684,7 +720,7 @@ kamctl fifo cr_deactivate_host "-d proxy -p 49 -h proxy1" Use the "null" prefix to specify an empty prefix. - Example 1.14. cr_activate_host usage + Example 1.16. cr_activate_host usage ... kamctl fifo cr_activate_host "-d proxy -p 49 -h proxy1" ... @@ -704,7 +740,7 @@ kamctl fifo cr_activate_host "-d proxy -p 49 -h proxy1" Use the "null" prefix to specify an empty prefix. - Example 1.15. cr_add_host usage + Example 1.17. cr_add_host usage ... kamctl fifo cr_add_host "-d proxy -p 49 -h proxy1 -w 0.25" ... @@ -725,14 +761,14 @@ kamctl fifo cr_add_host "-d proxy -p 49 -h proxy1 -w 0.25" Use the "null" prefix to specify an empty prefix. - Example 1.16. cr_delete_host usage + Example 1.18. cr_delete_host usage ... kamctl fifo cr_delete_host "-d proxy -p 49 -h proxy1 -w 0.25" ... 6. Configuration examples - Example 1.17. Configuration example - Routing to default tree + Example 1.19. Configuration example - Routing to default tree ... route { # route calls based on hash over callid @@ -766,7 +802,7 @@ failure_route[2] { # further processing } - Example 1.18. Configuration example - Routing to user tree + Example 1.20. Configuration example - Routing to user tree ... route[1] { cr_user_carrier("$fU", "$fd", "$avp(s:carrier)"); @@ -808,7 +844,7 @@ failure_route[1] { } ... - Example 1.19. Configuration example - module configuration + Example 1.21. Configuration example - module configuration The following config file specifies within the default carrier two domains, each with an prefix that contains two hosts. It is not @@ -891,7 +927,7 @@ domain register { 7.2. Database examples - Example 1.20. Example database content - carrierroute table + Example 1.22. Example database content - carrierroute table ... +----+---------+--------+-------------+-------+------+---------------+ | id | carrier | domain | scan_prefix | flags | prob | rewrite_host | @@ -928,7 +964,7 @@ domain register { flags are not set, the other two rules are used. The “strip”, “mask” and “comment” colums are omitted for brevity. - Example 1.21. Example database content - simple carrierfailureroute + Example 1.23. Example database content - simple carrierfailureroute table ... +----+---------+--------+---------------+------------+-------------+ @@ -950,7 +986,7 @@ domain register { entry in the carrierroute table, otherwise the module will not load the routing data. - Example 1.22. Example database content - more complex + Example 1.24. Example database content - more complex carrierfailureroute table ... +----+---------+-----------+------------+--------+-----+-------------+ @@ -977,7 +1013,7 @@ domain register { that holds domain entries for this routing rules. Not all table colums are show here for brevity. - Example 1.23. Example database content - carrier_name table + Example 1.25. Example database content - carrier_name table ... +----+----------+ | id | carrier | @@ -990,7 +1026,7 @@ domain register { This table contains the mapping of the carrier id to actual names. - Example 1.24. Example database content - domain_name table + Example 1.26. Example database content - domain_name table ... +----+----------+ | id | domain | @@ -1010,7 +1046,7 @@ domain register { specified as modul parameter) to choose the actual carrier for the users. - Example 1.25. Necessary extensions for the user table + Example 1.27. Necessary extensions for the user table Suggested changes: ... diff --git a/modules/cdp/README b/modules/cdp/README index 882b00412f3..1eec91da5f4 100644 --- a/modules/cdp/README +++ b/modules/cdp/README @@ -12,9 +12,9 @@ Edited by Richard Good - Copyright 2006 FhG Fokus + Copyright © 2006 FhG Fokus - Copyright 2012 Smile Communications + Copyright © 2012 Smile Communications __________________________________________________________________ Table of Contents @@ -32,6 +32,7 @@ Richard Good 4.1. config_file (string) 4.2. latency_threshold (int) + 4.3. workerq_length_threshold_percentage (int) 5. RPC Commands @@ -121,7 +122,8 @@ Richard Good 1.1. Set config_file parameter 1.2. Set latency_threshold parameter - 1.3. DiameterPeer.xml example + 1.3. Set workerq_length_threshold_percentage parameter + 1.4. DiameterPeer.xml example Chapter 1. Admin Guide @@ -138,6 +140,7 @@ Chapter 1. Admin Guide 4.1. config_file (string) 4.2. latency_threshold (int) + 4.3. workerq_length_threshold_percentage (int) 5. RPC Commands @@ -203,12 +206,13 @@ Chapter 1. Admin Guide 4.1. config_file (string) 4.2. latency_threshold (int) + 4.3. workerq_length_threshold_percentage (int) 4.1. config_file (string) This is the location of the XML configuration file. - Default value is "DiameterPeer.xml". + Default value is “DiameterPeer.xml”. Example 1.1. Set config_file parameter ... @@ -220,13 +224,26 @@ modparam("cdp", "config_file", "/etc/kamailio/diametercfg.xml") The time in ms above which a log error is wrtten to log file for long CDP transactions. - Default value is "500". + Default value is “500”. Example 1.2. Set latency_threshold parameter ... modparam("cdp", "latency_threshold", 1000) ... +4.3. workerq_length_threshold_percentage (int) + + The threshold of the length of the worker queue as a percentage of the + maximum queue size - when exceeded a warning is written to the log + file. 0 means disabled + + Default value is “0”. + + Example 1.3. Set workerq_length_threshold_percentage parameter +... +modparam("cdp", "workerq_length_threshold_percentage", 25) +... + 5. RPC Commands 5.1. cdp.disable_peer @@ -252,7 +269,7 @@ modparam("cdp", "latency_threshold", 1000) This is an example CDP configuration file. The location of this file is configured as a CDP parameter (config_file) - See section 4.1 Above - Example 1.3. DiameterPeer.xml example + Example 1.4. DiameterPeer.xml example - + &adminguide;
@@ -29,7 +29,7 @@ It is very lightweight, therefore suitable for handling heavy SIP - traffic. As the module has a small footprint and the ability to load + traffic. As the module has a small footprint and the ability to load balancing rules from a plain text file, it is suitable for embedded systems.
@@ -537,11 +537,11 @@ modparam("dispatcher", "force_dst", 1) ...
-
+
<varname>ds_ping_from</varname> (string) - With this Method you can define the "From:"-Line for the request, sent to the failed gateways. + With this Method you can define the "From:"-Line for the request, sent to the failed gateways. This method is only available, if compiled with the probing of failed gateways enabled. @@ -557,7 +557,7 @@ modparam("dispatcher", "force_dst", 1) ... -
+
<varname>ds_ping_interval</varname> (int) @@ -580,8 +580,8 @@ modparam("dispatcher", "force_dst", 1) ... -
- +
+
<varname>ds_probing_threshold</varname> (int) @@ -640,8 +640,8 @@ modparam("dispatcher", "force_dst", 1) PING-Method are not only the ones generated from the remote servers, but also those that are generated locally. E.g.: setting code=408 or class=400 will never set a backend down even if it is, because internally the Kamailio transaction layer - generates a 408 in the case of no response from the remote server, and this - internal code 408 is accepted as vaild value. + generates a 408 in the case of no response from the remote server, and this + internal code 408 is accepted as valid value. @@ -656,11 +656,11 @@ modparam("dispatcher", "force_dst", 1) ... -
+
<varname>ds_probing_mode</varname> (int) - Controls what gateways are tested to see if they are reachable. + Controls what gateways are tested to see if they are reachable. @@ -827,7 +827,7 @@ modparam("dispatcher", "force_dst", 1) <varname>ds_timer_mode</varname> (int) Specify the timer process to be used by the module for - keepalives and active dialogs tracking. + keepalives and active dialogs tracking. It can be set to: @@ -984,17 +984,17 @@ modparam("dispatcher", "force_dst", 1) 11 - use relative weight based load distribution. You have to set the attribute 'rweight' per each address in - destination set. Active host usage probability is - rweight/(SUM of all active host rweights in destination group). + destination set. Active host usage probability is + rweight/(SUM of all active host rweights in destination group). The major difference from the weight distribution is the - probability recalculation according to rweight value in case of + probability recalculation according to rweight value in case of host enabling/disabling - For example, 100 calls in 3-hosts group with rweight params 1/2/1 - will be distributed as 25/50/25. After third host failing + For example, 100 calls in 3-hosts group with rweight params 1/2/1 + will be distributed as 25/50/25. After third host failing distribution will be changed to 33/67/0. @@ -1314,7 +1314,7 @@ onreply_route { ds_set_state - Sets the status for a destination address (can be use to mark the destination + Sets the status for a destination address (can be use to mark the destination as active or inactive). @@ -1325,17 +1325,17 @@ onreply_route { _state_ : state of the destination address a: active - i: inactive - t: trying - d: disabled + i: inactive + t: trying + d: disabled The states a, i or t can be followed by p to set probing mode (e.g. 'ap', 'ip' or 'tp'). - + _group_: destination group id - + _address_: address of the destination in the _group_ @@ -1568,10 +1568,10 @@ onreply_route { sent to that gateways. - 'rweight' - used for relative weight based load - distribution. It must be set to a positive integer value - between 1 and 100 (otherwise host will be excluded from - relative weight distribution type). + 'rweight' - used for relative weight based load + distribution. It must be set to a positive integer value + between 1 and 100 (otherwise host will be excluded from + relative weight distribution type). 'socket' - used to set the sending socket for the gateway. @@ -1615,11 +1615,11 @@ setid(int) destination(sip uri) flags(int,opt) priority(int,opt) attrs(str,opt)
- +
&kamailio; config file - Next picture shows a sample usage of the dispatcher module. + Next listing shows a sample config for using the dispatcher module. &kamailio; config script - sample dispatcher usage diff --git a/modules/diversion/README b/modules/diversion/README index c4c5a85d63d..fee68aecc64 100644 --- a/modules/diversion/README +++ b/modules/diversion/README @@ -8,7 +8,7 @@ Edited by Jan Janak - Copyright 2004 FhG FOKUS + Copyright © 2004 FhG FOKUS __________________________________________________________________ Table of Contents @@ -95,7 +95,7 @@ Warning the parameter to specify additional parameters to be added to the header field, see the example. - Default value is "" (empty string). + Default value is “” (empty string). Example 1.1. suffix usage modparam("diversion", "suffix", ";privacy=full") @@ -158,7 +158,7 @@ Content-Length: 0 Chapter 2. Developer Guide - According to the specification a new "Diversion" header field should be + According to the specification a new “Diversion” header field should be inserted as the topmost Diversion header field in the message, that means before any other existing Diversion header field in the message. In addition to that, the add_diversion function can be called several diff --git a/modules/dmq/README b/modules/dmq/README index e9290c7c82b..754be4fdf4d 100644 --- a/modules/dmq/README +++ b/modules/dmq/README @@ -219,7 +219,7 @@ modparam("dmq", "multi_notify", 1) Example 1.5. Set num_workers parameter ... -modparam("dmq", "num_threads", 4) +modparam("dmq", "num_workers", 4) ... 3.5. ping_interval(int) diff --git a/modules/dmq/doc/dmq_admin.xml b/modules/dmq/doc/dmq_admin.xml index 14b4a8e570b..5f9e60f53e1 100644 --- a/modules/dmq/doc/dmq_admin.xml +++ b/modules/dmq/doc/dmq_admin.xml @@ -166,7 +166,7 @@ modparam("dmq", "multi_notify", 1) Set <varname>num_workers</varname> parameter ... -modparam("dmq", "num_threads", 4) +modparam("dmq", "num_workers", 4) ... diff --git a/modules/dmq_usrloc/README b/modules/dmq_usrloc/README index 5325413cd87..1d57c90f21f 100644 --- a/modules/dmq_usrloc/README +++ b/modules/dmq_usrloc/README @@ -12,7 +12,7 @@ Andrey Rybkin bks.tv - Copyright 2014 + Copyright © 2014 __________________________________________________________________ Table of Contents diff --git a/modules/dmq_usrloc/usrloc_sync.c b/modules/dmq_usrloc/usrloc_sync.c index f89500d7efb..1c78e713f72 100644 --- a/modules/dmq_usrloc/usrloc_sync.c +++ b/modules/dmq_usrloc/usrloc_sync.c @@ -298,9 +298,13 @@ int usrloc_dmq_handle_msg(struct sip_msg* msg, peer_reponse_t* resp, dmq_node_t* srjson_t *it = NULL; static ucontact_info_t ci; - int action, expires, cseq, flags, cflags, q, last_modified, methods, reg_id; + unsigned int action, expires, cseq, flags, cflags, q, last_modified, + methods, reg_id; str aor, ruid, c, received, path, callid, user_agent, instance; + action = expires = cseq = flags = cflags = q = last_modified + = methods = reg_id = 0; + parse_from_header(msg); body = ((struct to_body*)msg->from->parsed)->uri; @@ -340,7 +344,7 @@ int usrloc_dmq_handle_msg(struct sip_msg* msg, peer_reponse_t* resp, dmq_node_t* if (it->string == NULL) continue; if (strcmp(it->string, "action")==0) { - action = it->valueint; + action = SRJSON_GET_UINT(it); } else if (strcmp(it->string, "aor")==0) { aor.s = it->valuestring; aor.len = strlen(aor.s); @@ -366,21 +370,21 @@ int usrloc_dmq_handle_msg(struct sip_msg* msg, peer_reponse_t* resp, dmq_node_t* instance.s = it->valuestring; instance.len = strlen(instance.s); } else if (strcmp(it->string, "expires")==0) { // - expires = it->valueint; + expires = SRJSON_GET_UINT(it); } else if (strcmp(it->string, "cseq")==0) { - cseq = it->valueint; + cseq = SRJSON_GET_UINT(it); } else if (strcmp(it->string, "flags")==0) { - flags = it->valueint; + flags = SRJSON_GET_UINT(it); } else if (strcmp(it->string, "cflags")==0) { - cflags = it->valueint; + cflags = SRJSON_GET_UINT(it); } else if (strcmp(it->string, "q")==0) { - q = it->valueint; + q = SRJSON_GET_UINT(it); } else if (strcmp(it->string, "last_modified")==0) { - last_modified = it->valueint; + last_modified = SRJSON_GET_UINT(it); } else if (strcmp(it->string, "methods")==0) { - methods = it->valueint; + methods = SRJSON_GET_UINT(it); } else if (strcmp(it->string, "reg_id")==0) { - reg_id = it->valueint; + reg_id = SRJSON_GET_UINT(it); } else { LM_ERR("unrecognized field in json object\n"); } diff --git a/modules/dnssec/README b/modules/dnssec/README index 4ef2e0a5f1b..0137c5a40ac 100644 --- a/modules/dnssec/README +++ b/modules/dnssec/README @@ -2,7 +2,7 @@ Dnssec Module Marius Zbihlei - Copyright 2013 + Copyright © 2013 __________________________________________________________________ Table of Contents @@ -120,5 +120,6 @@ Chapter 1. Admin Guide ... modparam("dnssec", "general_query_flags", 1) # QUERY_DONT_VALIDATE disable vali dation - modparam("dnssec", "general_query_flags", 10) # QUERY_IGNORE_SKEW | QUERY_NO_DLV + modparam("dnssec", "general_query_flags", 10) # QUERY_IGNORE_SKEW | QUERY_NO_DL +V ... diff --git a/modules/domain/README b/modules/domain/README index 18b45d7a737..5308c44c72a 100644 --- a/modules/domain/README +++ b/modules/domain/README @@ -10,7 +10,7 @@ Juha Heinanen - Copyright 2002-2012 Juha Heinanen + Copyright © 2002-2012 Juha Heinanen __________________________________________________________________ Table of Contents @@ -112,18 +112,18 @@ Chapter 1. Admin Guide 1. Overview Domain module implements checks that based on domain table determine if - a domain is "local". A "local" domain is one that the proxy is + a domain is “local”. A “local” domain is one that the proxy is responsible for. SIP URIs of local users must have hostpart that is equal to one of these domains. Domain module reads the contents of domain and domain_attrs tables into cache memory when the module is loaded. Any changes in domain or - domain_attrs tables must thus be followed by "domain.reload" rpc + domain_attrs tables must thus be followed by “domain.reload” rpc command in order to reflect them in module behavior. Caching is implemented using a hash table. The size of the hash table - is given by HASH_SIZE constant defined in domain_mod.h. Its "factory - default" value is 128. + is given by HASH_SIZE constant defined in domain_mod.h. Its “factory + default” value is 128. 2. Dependencies @@ -147,7 +147,7 @@ Chapter 1. Admin Guide This is URL of the database to be used. - Default value is "mysql://kamailioro:kamailioro@localhost/kamailio" + Default value is “mysql://kamailioro:kamailioro@localhost/kamailio” Example 1.1. Setting db_url parameter modparam("domain", "db_url", "mysql://ser:pass@db_host/ser") @@ -157,7 +157,7 @@ modparam("domain", "db_url", "mysql://ser:pass@db_host/ser") Name of table containing names of local domains that the proxy is responsible for. - Default value is "domain". + Default value is “domain”. Example 1.2. Setting domain_table parameter modparam("domain", "domain_table", "new_name") @@ -166,7 +166,7 @@ modparam("domain", "domain_table", "new_name") Name of table containing attributes of local domains. - Default value is "domain_attrs". + Default value is “domain_attrs”. Example 1.3. Setting domain_attrs_table parameter modparam("domain", "domain_attrs_table", "local_domain_attributes") @@ -177,7 +177,7 @@ modparam("domain", "domain_attrs_table", "local_domain_attributes") domain_attrs tables. In domain table, a did column value may be NULL, which means that it has same value as domain column. - Default value is "did". + Default value is “did”. Example 1.4. Setting did_col parameter modparam("domain", "did_col", "domain_did") @@ -186,7 +186,7 @@ modparam("domain", "did_col", "domain_did") Name of column containing domain name in domain table. - Default value is "domain". + Default value is “domain”. Example 1.5. Setting domain_col parameter modparam("domain", "domain_col", "domain_name") @@ -195,7 +195,7 @@ modparam("domain", "domain_col", "domain_name") Name of column containing attribute name in domain_attrs table. - Default value is "name". + Default value is “name”. Example 1.6. Setting name_col parameter modparam("domain", "name_col", "attr_name") @@ -205,7 +205,7 @@ modparam("domain", "name_col", "attr_name") Name of column containing attribute type in domain_attrs table. Type value 0 is integer and type value 2 is string. - Default value is "type". + Default value is “type”. Example 1.7. Setting name_col parameter modparam("domain", "type_col", "attr_type") @@ -214,7 +214,7 @@ modparam("domain", "type_col", "attr_type") Name of column containing attribute value in domain_attrs table. - Default value is "value". + Default value is “value”. Example 1.8. Setting value_col parameter modparam("domain", "value_col", "attr_value") diff --git a/modules/domain/domain_mod.c b/modules/domain/domain_mod.c index 45697fd3d2b..4ea873706a7 100644 --- a/modules/domain/domain_mod.c +++ b/modules/domain/domain_mod.c @@ -15,8 +15,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -91,18 +91,18 @@ gen_lock_t *reload_lock; */ static cmd_export_t cmds[] = { {"is_from_local", (cmd_function)is_from_local, 0, 0, 0, - REQUEST_ROUTE|BRANCH_ROUTE|FAILURE_ROUTE|LOCAL_ROUTE}, + REQUEST_ROUTE|BRANCH_ROUTE|FAILURE_ROUTE|LOCAL_ROUTE}, {"is_uri_host_local", (cmd_function)is_uri_host_local, 0, 0, 0, - REQUEST_ROUTE|BRANCH_ROUTE|FAILURE_ROUTE|LOCAL_ROUTE}, + REQUEST_ROUTE|BRANCH_ROUTE|FAILURE_ROUTE|LOCAL_ROUTE}, {"is_domain_local", (cmd_function)w_is_domain_local, 1, fixup_pvar_null, - fixup_free_pvar_null, - REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|LOCAL_ROUTE}, + fixup_free_pvar_null, + REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|LOCAL_ROUTE}, {"lookup_domain", (cmd_function)w_lookup_domain_no_prefix, 1, - fixup_pvar_null, fixup_free_pvar_null, - REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|LOCAL_ROUTE}, + fixup_pvar_null, fixup_free_pvar_null, + REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|LOCAL_ROUTE}, {"lookup_domain", (cmd_function)w_lookup_domain, 2, fixup_pvar_str, - fixup_free_pvar_str, - REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|LOCAL_ROUTE}, + fixup_free_pvar_str, + REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|LOCAL_ROUTE}, {"bind_domain", (cmd_function)bind_domain, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0} }; @@ -129,9 +129,9 @@ static param_export_t params[] = { * Exported MI functions */ static mi_export_t mi_cmds[] = { - { MI_DOMAIN_RELOAD, mi_domain_reload, MI_NO_INPUT_FLAG, 0, 0 }, - { MI_DOMAIN_DUMP, mi_domain_dump, MI_NO_INPUT_FLAG, 0, 0 }, - { 0, 0, 0, 0, 0} + { MI_DOMAIN_RELOAD, mi_domain_reload, MI_NO_INPUT_FLAG, 0, 0 }, + { MI_DOMAIN_DUMP, mi_domain_dump, MI_NO_INPUT_FLAG, 0, 0 }, + { 0, 0, 0, 0, 0} }; @@ -156,125 +156,126 @@ struct module_exports exports = { static int mod_init(void) { - LM_DBG("initializing\n"); - - if (register_mi_mod(exports.name, mi_cmds) != 0) { - LM_ERR("failed to register MI commands\n"); - return -1; - } - if (domain_init_rpc() != 0) { - LM_ERR("failed to register RPC commands\n"); - return -1; - } + LM_DBG("initializing\n"); - if (domain_reg_myself !=0 ) { - if (register_check_self_func(domain_check_self) <0 ) { - LM_ERR("failed to register check self function\n"); - return -1; + if (register_mi_mod(exports.name, mi_cmds) != 0) { + LM_ERR("failed to register MI commands\n"); + return -1; + } + if (domain_init_rpc() != 0) { + LM_ERR("failed to register RPC commands\n"); + return -1; } - } - /* Bind database */ - if (domain_db_bind(&d_db_url)) { - LM_DBG("Usign db_url [%.*s]\n", d_db_url.len, d_db_url.s); - LM_ERR("no database module found. Have you configure thed \"db_url\" modparam properly?\n"); - return -1; - } + if (domain_reg_myself !=0 ) { + if (register_check_self_func(domain_check_self) <0 ) { + LM_ERR("failed to register check self function\n"); + return -1; + } + } - /* Check table versions */ - if (domain_db_init(&d_db_url) < 0) { - LM_ERR("unable to open database connection\n"); - return -1; - } - if (domain_db_ver(&domain_table, DOMAIN_TABLE_VERSION) < 0) { - LM_ERR("error during check of domain table version\n"); - domain_db_close(); - goto error; - } - if (domain_db_ver(&domain_attrs_table, DOMAIN_ATTRS_TABLE_VERSION) < 0) { - LM_ERR("error during check of domain_attrs table version\n"); + /* Bind database */ + if (domain_db_bind(&d_db_url)) { + LM_DBG("Usign db_url [%.*s]\n", d_db_url.len, d_db_url.s); + LM_ERR("no database module found. Have you configure" + " the \"db_url\" modparam properly?\n"); + return -1; + } + + /* Check table versions */ + if (domain_db_init(&d_db_url) < 0) { + LM_ERR("unable to open database connection\n"); + return -1; + } + if (domain_db_ver(&domain_table, DOMAIN_TABLE_VERSION) < 0) { + LM_ERR("error during check of domain table version\n"); + domain_db_close(); + goto error; + } + if (domain_db_ver(&domain_attrs_table, DOMAIN_ATTRS_TABLE_VERSION) < 0) { + LM_ERR("error during check of domain_attrs table version\n"); + domain_db_close(); + goto error; + } domain_db_close(); - goto error; - } - domain_db_close(); - - /* Initializing hash tables and hash table variable */ - hash_table = (struct domain_list ***)shm_malloc - (sizeof(struct domain_list *)); - hash_table_1 = (struct domain_list **)shm_malloc - (sizeof(struct domain_list *) * (DOM_HASH_SIZE + 1)); - hash_table_2 = (struct domain_list **)shm_malloc - (sizeof(struct domain_list *) * (DOM_HASH_SIZE + 1)); - if ((hash_table == 0) || (hash_table_1 == 0) || (hash_table_2 == 0)) { - LM_ERR("no memory for hash table\n"); - goto error; - } - memset(hash_table_1, 0, sizeof(struct domain_list *) * - (DOM_HASH_SIZE + 1)); - memset(hash_table_2, 0, sizeof(struct domain_list *) * - (DOM_HASH_SIZE + 1)); - *hash_table = hash_table_1; - - /* Allocate and initialize locks */ - reload_lock = lock_alloc(); - if (reload_lock == NULL) { - LM_ERR("cannot allocate reload_lock\n"); - goto error; - } - if (lock_init(reload_lock) == NULL) { - LM_ERR("cannot init reload_lock\n"); - goto error; - } - - /* First reload */ - lock_get(reload_lock); - if (reload_tables() == -1) { + + /* Initializing hash tables and hash table variable */ + hash_table = (struct domain_list ***)shm_malloc + (sizeof(struct domain_list **)); + hash_table_1 = (struct domain_list **)shm_malloc + (sizeof(struct domain_list *) * (DOM_HASH_SIZE + 1)); + hash_table_2 = (struct domain_list **)shm_malloc + (sizeof(struct domain_list *) * (DOM_HASH_SIZE + 1)); + if ((hash_table == 0) || (hash_table_1 == 0) || (hash_table_2 == 0)) { + LM_ERR("no memory for hash table\n"); + goto error; + } + memset(hash_table_1, 0, sizeof(struct domain_list *) * + (DOM_HASH_SIZE + 1)); + memset(hash_table_2, 0, sizeof(struct domain_list *) * + (DOM_HASH_SIZE + 1)); + *hash_table = hash_table_1; + + /* Allocate and initialize locks */ + reload_lock = lock_alloc(); + if (reload_lock == NULL) { + LM_ERR("cannot allocate reload_lock\n"); + goto error; + } + if (lock_init(reload_lock) == NULL) { + LM_ERR("cannot init reload_lock\n"); + goto error; + } + + /* First reload */ + lock_get(reload_lock); + if (reload_tables() == -1) { + lock_release(reload_lock); + LM_CRIT("domain reload failed\n"); + goto error; + } lock_release(reload_lock); - LM_CRIT("domain reload failed\n"); - goto error; - } - lock_release(reload_lock); - return 0; + return 0; error: - destroy(); - return -1; + destroy(); + return -1; } static int child_init(int rank) { - return 0; + return 0; } static void destroy(void) { - /* Destroy is called from the main process only, - * there is no need to close database here because - * it is closed in mod_init already - */ - if (hash_table) { - shm_free(hash_table); - hash_table = 0; - } - if (hash_table_1) { - hash_table_free(hash_table_1); - shm_free(hash_table_1); - hash_table_1 = 0; - } - if (hash_table_2) { - hash_table_free(hash_table_2); - shm_free(hash_table_2); - hash_table_2 = 0; - } + /* Destroy is called from the main process only, + * there is no need to close database here because + * it is closed in mod_init already + */ + if (hash_table) { + shm_free(hash_table); + hash_table = 0; + } + if (hash_table_1) { + hash_table_free(hash_table_1); + shm_free(hash_table_1); + hash_table_1 = 0; + } + if (hash_table_2) { + hash_table_free(hash_table_2); + shm_free(hash_table_2); + hash_table_2 = 0; + } } static const char* domain_rpc_reload_doc[2] = { - "Reload domain tables from database", - 0 + "Reload domain tables from database", + 0 }; @@ -283,17 +284,17 @@ static const char* domain_rpc_reload_doc[2] = { */ static void domain_rpc_reload(rpc_t* rpc, void* ctx) { - lock_get(reload_lock); - if (reload_tables() < 0) { - rpc->fault(ctx, 400, "Reload of domain tables failed"); - } - lock_release(reload_lock); + lock_get(reload_lock); + if (reload_tables() < 0) { + rpc->fault(ctx, 400, "Reload of domain tables failed"); + } + lock_release(reload_lock); } static const char* domain_rpc_dump_doc[2] = { - "Return the contents of domain and domain_attrs tables", - 0 + "Return the contents of domain and domain_attrs tables", + 0 }; @@ -302,56 +303,56 @@ static const char* domain_rpc_dump_doc[2] = { */ static void domain_rpc_dump(rpc_t* rpc, void* ctx) { - int i; - struct domain_list *np; - struct attr_list *ap; - struct domain_list **ht; - void* st; - - if(hash_table==0 || *hash_table==0) { - rpc->fault(ctx, 404, "Server Domain Cache Empty"); - return; - } - ht = *hash_table; - for (i = 0; i < DOM_HASH_SIZE; i++) { - np = ht[i]; - while (np) { - if (rpc->add(ctx, "{", &st) < 0) return; - rpc->struct_add(st, "SS", - "domain", &np->domain, - "did", &np->did); - np = np->next; + int i; + struct domain_list *np; + struct attr_list *ap; + struct domain_list **ht; + void* st; + + if(hash_table==0 || *hash_table==0) { + rpc->fault(ctx, 404, "Server Domain Cache Empty"); + return; } - } - np = ht[DOM_HASH_SIZE]; - while (np) { - if (rpc->add(ctx, "{", &st) < 0) return; - rpc->struct_add(st, "S", - "did", &np->did); - ap = np->attrs; - while (ap) { - rpc->struct_add(st, "S", - "attr", &ap->name); - ap = ap->next; + ht = *hash_table; + for (i = 0; i < DOM_HASH_SIZE; i++) { + np = ht[i]; + while (np) { + if (rpc->add(ctx, "{", &st) < 0) return; + rpc->struct_add(st, "SS", + "domain", &np->domain, + "did", &np->did); + np = np->next; + } + } + np = ht[DOM_HASH_SIZE]; + while (np) { + if (rpc->add(ctx, "{", &st) < 0) return; + rpc->struct_add(st, "S", + "did", &np->did); + ap = np->attrs; + while (ap) { + rpc->struct_add(st, "S", + "attr", &ap->name); + ap = ap->next; + } + np = np->next; } - np = np->next; - } - return; + return; } rpc_export_t domain_rpc_list[] = { - {"domain.reload", domain_rpc_reload, domain_rpc_reload_doc, 0}, - {"domain.dump", domain_rpc_dump, domain_rpc_dump_doc, 0}, - {0, 0, 0, 0} + {"domain.reload", domain_rpc_reload, domain_rpc_reload_doc, 0}, + {"domain.dump", domain_rpc_dump, domain_rpc_dump_doc, 0}, + {0, 0, 0, 0} }; static int domain_init_rpc(void) { - if (rpc_register_array(domain_rpc_list) != 0) { - LM_ERR("failed to register RPC commands\n"); - return -1; - } - return 0; + if (rpc_register_array(domain_rpc_list) != 0) { + LM_ERR("failed to register RPC commands\n"); + return -1; + } + return 0; } diff --git a/modules/domainpolicy/README b/modules/domainpolicy/README index 0c337f17ddd..4e0870e22c3 100644 --- a/modules/domainpolicy/README +++ b/modules/domainpolicy/README @@ -20,7 +20,7 @@ Klaus Darilion - Copyright 2002, 2003, 2006 Juha Heinanen, Otmar Lendl, Klaus Darilion + Copyright © 2002, 2003, 2006 Juha Heinanen, Otmar Lendl, Klaus Darilion __________________________________________________________________ Table of Contents @@ -151,7 +151,7 @@ Chapter 1. Admin Guide This is URL of the database to be used. - Default value is "mysql://openser:openserrw@localhost/openser" + Default value is “mysql://kamailio:kamailiorw@localhost/kamailio” Example 1.1. Setting db_url parameter modparam("domainpolicy", "db_url", "postgres://proxy:frog23@db.sip-router.org/si @@ -161,7 +161,7 @@ pdb") Name of table containing the local support domain policy setup. - Default value is "domainpolicy". + Default value is “domainpolicy”. Example 1.2. Setting dp_table parameter modparam("domainpolicy", "dp_table", "supportedpolicies") @@ -171,7 +171,7 @@ modparam("domainpolicy", "dp_table", "supportedpolicies") Name of column containing the domain policy rule name which is equal to the URI as published in the domain policy NAPTRs. - Default value is "rule". + Default value is “rule”. Example 1.3. Setting dp_col_rule parameter modparam("domainpolicy", "dp_col_rule", "rules") @@ -183,7 +183,7 @@ modparam("domainpolicy", "dp_col_rule", "rules") draft-lendl-speermint-technical-policy-00, this is "std". For direct domain lookups, this is "dom". - Default value is "type". + Default value is “type”. Example 1.4. Setting dp_col_rule parameter modparam("domainpolicy", "dp_col_type", "type") @@ -193,7 +193,7 @@ modparam("domainpolicy", "dp_col_type", "type") Name of column containing the AVP's name. If the rule stored in this row triggers, than dp_can_connect() will add an AVP with that name. - Default value is "att". + Default value is “att”. Example 1.5. Setting dp_col_att parameter modparam("domainpolicy", "dp_col_att", "attribute") @@ -203,7 +203,7 @@ modparam("domainpolicy", "dp_col_att", "attribute") Name of column containing the value for AVPs created by dp_can_connect(). - Default value is "val". + Default value is “val”. Example 1.6. Setting dp_col_val parameter modparam("domainpolicy", "dp_col_val", "values") @@ -213,7 +213,7 @@ modparam("domainpolicy", "dp_col_val", "values") This parameter defines the name of the AVP where dp_apply_policy() will look for an override port number. - Default value is "portoverride". + Default value is “portoverride”. Example 1.7. Setting port_override_avp parameter # string named AVP @@ -223,7 +223,7 @@ modparam("domainpolicy", "port_override_avp", "portoverride") Name of the AVP which contains the override transport setting. - Default value is "transportoverride". + Default value is “transportoverride”. Example 1.8. Setting transport_override_avp parameter # string named AVP @@ -233,7 +233,7 @@ modparam("domainpolicy", "transport_override_avp", "transportoverride") Name of the AVP which contains a domain replacement. - Default value is "domainreplacement". + Default value is “domainreplacement”. Example 1.9. Setting domain_replacement_avp parameter # string named AVP @@ -243,7 +243,7 @@ modparam("domainpolicy", "domain_replacement_avp", "domainreplacement") Name of the AVP which contains a domain prefix. - Default value is "domainprefix". + Default value is “domainprefix”. Example 1.10. Setting domain_prefix_avp parameter # string named AVP @@ -253,7 +253,7 @@ modparam("domainpolicy", "domain_prefix_avp", "domainprefix") Name of the AVP which contains a domain suffix. - Default value is "domainsuffix". + Default value is “domainsuffix”. Example 1.11. Setting domain_suffix_avp parameter # string named AVP @@ -267,7 +267,7 @@ modparam("domainpolicy", "domain_suffix_avp", "domainsuffix") this AVP and if defined, it will force the send socket to its value (similar to the force_send_socket core function). - Default value is "sendsocket". + Default value is “sendsocket”. Example 1.12. Setting send_socket_avp parameter # string named AVP diff --git a/modules/drouting/README b/modules/drouting/README index d9f858f0311..c0b7e2868f8 100644 --- a/modules/drouting/README +++ b/modules/drouting/README @@ -10,7 +10,7 @@ Edited by Anca-Maria Vamanu - Copyright 2005-2008 Voice Sistem SRL + Copyright © 2005-2008 Voice Sistem SRL __________________________________________________________________ Table of Contents @@ -234,7 +234,7 @@ Chapter 1. Admin Guide 1.4.1. Gateway Addresses - Default name for the table storing gateway addresses is "dr_gateways". + Default name for the table storing gateway addresses is “dr_gateways”. Gateway addresses are stored in a separate table because of need to access them independent of Dynamic Routing processing (e.g., adding/ removing gateway PRI prefix before/after performing other operation -- @@ -270,12 +270,12 @@ Chapter 1. Admin Guide group of destinations is delimited by semi-colon char. inside the whole destination list ( like: 2,4;5,78,23;4;7;2 ). The destinations from within a group may be act differently (like load-balancing, random - selection, etc), depending of the "sort_order" module parameter - more + selection, etc), depending of the “sort_order” module parameter - more about this is available under the module paramters section. 1.4.3. Routing Rules - Default name for the table storing rule definitions is "dr_rules". + Default name for the table storing rule definitions is “dr_rules”. Table 1.3. Definition of dr_rules table Column name Type Default Description @@ -304,18 +304,18 @@ Chapter 1. Admin Guide draft 09): Table 1.4. Time recurrence attributes - Attribute Description - dastard Start of interval (RFC 2445 DATE-TIME) - duration Length of interval (RFC 2445 DURATION) - freq Frequency of recurrence (secondly,minutely,hourly, daily,weekly, - monthly, or yearly). - until bound of recurrence (RFC 2445 DATE-TIME) - interval How often the recurrence repeats - byday List of days of the week - bymonthday List of days of the month - byyearday List of days of the year - byweekno List of weeks of the year - bymonth List of months of the year + Attribute Description + dastard Start of interval (RFC 2445 DATE-TIME) + duration Length of interval (RFC 2445 DURATION) + freq Frequency of recurrence (secondly,minutely,hourly, daily,weekly, + monthly, or yearly). + until bound of recurrence (RFC 2445 DATE-TIME) + interval How often the recurrence repeats + byday List of days of the week + bymonthday List of days of the month + byyearday List of days of the year + byweekno List of weeks of the year + bymonth List of months of the year The value stored in database has the format of: |||||| ||| @@ -325,52 +325,52 @@ Chapter 1. Admin Guide Detailed description of time recurrence attributes: + dtstart - specifies the beginning of the first period. + duration - specifies the duration of the period. For a - recurring interval, the "duration" parameter MUST be small + recurring interval, the “duration” parameter MUST be small enough such that subsequent intervals do not overlap. For non-recurring intervals, durations of any positive length are - permitted, zero-length duration means "forever". + permitted, zero-length duration means “forever”. Negative-length durations are not allowed. In the common case of a duration less than one day, the value starts with 'PT' followed by number of hours, minutes and seconds, e.g., a duration of 8 hours and 30 minutes is written 'PT8H30M'. See RFC 2445 DURATION specifications for full format. - + freq - takes one of the following values: "daily", to specify + + freq - takes one of the following values: “daily”, to specify repeating periods based on an interval of a day or more; - "weekly", to specify repeating periods based on an interval of - a week or more; "monthly", to specify repeating periods based - on an interval of a month or more; and "yearly", to specify + “weekly”, to specify repeating periods based on an interval of + a week or more; “monthly”, to specify repeating periods based + on an interval of a month or more; and “yearly”, to specify repeating periods based on an interval of a year or more. These values are not case-sensitive. + until - defines an iCalendar COS DATE or DATE-TIME value which bounds the recurrence rule in an inclusive manner. If the - value specified by "until" is synchronized with the specified + value specified by “until” is synchronized with the specified recurrence, this date or date-time becomes the last instance of the recurrence. If not present, the recurrence is considered to repeat forever. + interval - contains a positive integer representing how often - the recurrence rule repeats. The default value is "1", meaning - every day for a "daily" rule, every week for a "weekly" rule, - every month for a "monthly" rule and every year for a "yearly" + the recurrence rule repeats. The default value is “1”, meaning + every day for a “daily” rule, every week for a “weekly” rule, + every month for a “monthly” rule and every year for a “yearly” rule. + interval - contains a positive integer representing how often - the recurrence rule repeats. The default value is "1", meaning - every day for a "daily" rule, every week for a "weekly" rule, - every month for a "monthly" rule and every year for a "yearly" + the recurrence rule repeats. The default value is “1”, meaning + every day for a “daily” rule, every week for a “weekly” rule, + every month for a “monthly” rule and every year for a “yearly” rule. + byday - specifies a comma-separated list of days of the week. - "MO" indicates Monday; "TU" indicates Tuesday; "WE" indicates - Wednesday; "TH" indicates Thursday; "FR" indicates Friday; - "SA" indicates Saturday; "SU" indicates Sunday. These values + “MO” indicates Monday; “TU” indicates Tuesday; “WE” indicates + Wednesday; “TH” indicates Thursday; “FR” indicates Friday; + “SA” indicates Saturday; “SU” indicates Sunday. These values are not case-sensitive. - Each "byday" value can also be preceded by a positive (+n) or + Each “byday” value can also be preceded by a positive (+n) or negative (-n) integer. If present, this indicates the nth - occurrence of the specific day within the "monthly" or - "yearly" recurrence. For example, within a "monthly" rule, + occurrence of the specific day within the “monthly” or + “yearly” recurrence. For example, within a “monthly” rule, +1MO (or simply 1MO) represents the first Monday within the month, whereas -1MO represents the last Monday of the month. If an integer modifier is not present, it means all days of this type within the specified frequency. For example, within - a "monthly" rule, MO represents all Mondays within the month. + a “monthly” rule, MO represents all Mondays within the month. + bymonthday - parameter specifies a comma-separated list of days of the month. Valid values are 1 to 31 or -31 to -1. For example, -10 represents the tenth to the last day of the @@ -384,37 +384,37 @@ Chapter 1. Admin Guide to -1. + bymonth - parameter specifies a comma-separated list of months of the year. Valid values are 1 to 12. - A recurrence is specified by including the "freq" parameter, which + A recurrence is specified by including the “freq” parameter, which indicates the type of recurrence rule. Parameters other than - "dtstart" and "duration" SHOULD NOT be specified unless "freq" is + “dtstart” and “duration” SHOULD NOT be specified unless “freq” is present. If byxxx parameter values are found which are beyond the available - scope (ie, bymonthday="30" in February), they are simply ignored. + scope (ie, bymonthday=“30” in February), they are simply ignored. Byxxx parameters modify the recurrence in some manner. Byxxx rule parts for a period of time which is the same or greater than the frequency generally reduce or limit the number of occurrences of - the recurrence generated. For example, freq="daily" bymonth="1" + the recurrence generated. For example, freq=“daily” bymonth=“1” reduces the number of recurrence instances from all days (if the - "bymonth" parameter is not present) to all days in January. Byxxx + “bymonth” parameter is not present) to all days in January. Byxxx parameters for a period of time less than the frequency generally increase or expand the number of occurrences of the recurrence. For - example, freq="yearly" bymonth="1,2" increases the number of days - within the yearly recurrence set from 1 (if "bymonth" parameter is + example, freq=“yearly” bymonth=“1,2” increases the number of days + within the yearly recurrence set from 1 (if “bymonth” parameter is not present) to 2. If multiple Byxxx parameters are specified, then after evaluating - the specified "freq" and "interval" parameters, the Byxxx + the specified “freq” and “interval” parameters, the Byxxx parameters are applied to the current set of evaluated occurrences - in the following order: "bymonth", "byweekno", "byyearday", - "bymonthday", "byday"; then "until" is evaluated. + in the following order: “bymonth”, “byweekno”, “byyearday”, + “bymonthday”, “byday”; then “until” is evaluated. Here is an example of evaluating multiple Byxxx parameters. - dtstart="19970105T083000" duration="PT10M" freq="yearly" - interval="2" bymonth="1" byday="SU" - First, the interval="2" would be applied to freq="yearly" to arrive - at "every other year" . Then, bymonth="1" would be applied to - arrive at "every January, every other year". Then, byday="SU" would - be applied to arrive at "every Sunday in January, every other year, - from 8:30 to 8:40 ". The appropriate minutes and hours have been - retrieved from the "dtstart" and "duration" parameters. + dtstart=“19970105T083000” duration=“PT10M” freq=“yearly” + interval=“2” bymonth=“1” byday=“SU” + First, the interval=“2” would be applied to freq=“yearly” to arrive + at “every other year” . Then, bymonth=“1” would be applied to + arrive at “every January, every other year”. Then, byday=“SU” would + be applied to arrive at “every Sunday in January, every other year, + from 8:30 to 8:40 ”. The appropriate minutes and hours have been + retrieved from the “dtstart” and “duration” parameters. d. priority column If many rules are eligible, choose the one with highest priority. e. routeid column @@ -424,8 +424,8 @@ Chapter 1. Admin Guide level. f. gwlist column A comma separated list of gateway identifiers corresponding to a - row in table "dr_gateways". You can use a predefined list from the - table "dr_gw_lists" preceded by the character "#". The first + row in table “dr_gateways”. You can use a predefined list from the + table “dr_gw_lists” preceded by the character “#”. The first gateway is tried first and if routing to it fails, then the second one, and so one. If no gateway is left a negative response is sent back to caller. @@ -437,7 +437,7 @@ Chapter 1. Admin Guide 2 8 0049 20040101T083000 0 0 1,2 Rule 2 3 7,8,9 0049 20040101T083000 0 0 3 Rule 3 (The time recurrence for first rule is: - "20040101T083000|10H|weekly|||MO,TU,WE,TH,FR") + “20040101T083000|10H|weekly|||MO,TU,WE,TH,FR”) 1.5. Routing Rule Processing @@ -505,7 +505,7 @@ Chapter 1. Admin Guide The database url. - Default value is "NULL". + Default value is “NULL”. Example 1.1. Set db_url parameter ... @@ -517,7 +517,7 @@ modparam("drouting", "db_url", The name of the db table storing gateway addresses. - Default value is "dr_gateways". + Default value is “dr_gateways”. Example 1.2. Set drd_table parameter ... @@ -528,7 +528,7 @@ modparam("drouting", "drd_table", "dr_gateways") The name of the db table storing routing rules. - Default value is "dr_rules". + Default value is “dr_rules”. Example 1.3. Set drr_table parameter ... @@ -539,7 +539,7 @@ modparam("drouting", "drr_table", "rules") The name of the db table storing groups. - Default value is "dr_groups". + Default value is “dr_groups”. Example 1.4. Set drg_table parameter ... @@ -554,7 +554,7 @@ modparam("drouting", "drg_table", "groups") individual elements. Very useful to reuse a list of gateways in different places. - Default value is "dr_gw_lists". + Default value is “dr_gw_lists”. Example 1.5. Set drl_table parameter ... @@ -585,7 +585,7 @@ modparam("drouting", "drl_table", "my_gw_lists") case there are 2 failures, all the three gateways (1,2,3) will be tried in a random order. - Default value is "0". + Default value is “0”. Example 1.6. Set sort_order parameter ... @@ -597,7 +597,7 @@ modparam("drouting", "sort_order", 2) The name of the avp for storing Request URIs to be later used (alternative destiantions for the current one). - Default value is "NULL". + Default value is “NULL”. Example 1.7. Set ruri_avp parameter ... @@ -612,7 +612,7 @@ modparam("drouting", "ruri_avp", '$avp(i:33)') function), the AVP will be updated with the attrs of the new used destination. - Default value is "NULL". + Default value is “NULL”. Example 1.8. Set attrs_avp parameter ... @@ -625,7 +625,7 @@ modparam("drouting", "atrrs_avp", '$avp(i:67)') Flag to configure whether to use domain match when querying database for user's routing group. - Default value is "1". + Default value is “1”. Example 1.9. Set use_domain parameter ... @@ -636,7 +636,7 @@ modparam("drouting", "use_domain", 0) The name of the column in group db table where the username is stored. - Default value is "username". + Default value is “username”. Example 1.10. Set drg_user_col parameter ... @@ -647,7 +647,7 @@ modparam("drouting", "drg_user_col", "user") The name of the column in group db table where the domain is stored. - Default value is "domain". + Default value is “domain”. Example 1.11. Set drg_domain_col parameter ... @@ -658,7 +658,7 @@ modparam("drouting", "drg_domain_col", "host") The name of the column in group db table where the group id is stored. - Default value is "groupid". + Default value is “groupid”. Example 1.12. Set drg_grpid_col parameter ... @@ -670,7 +670,7 @@ modparam("drouting", "drg_grpid_col", "grpid") The number of rows that should be fetched from the result of a query in rules db table. - Default value is "2000". + Default value is “2000”. Example 1.13. Set fetch_rows parameter ... @@ -683,7 +683,7 @@ modparam("drouting", "fetch_rows", 1500) startup. If not enabled, the GW name will be blindly used during routing. - Default value is "1 (enabled)". + Default value is “1 (enabled)”. Example 1.14. Set force_dns parameter ... @@ -698,7 +698,7 @@ modparam("drouting", "force_dns", 0) 4.4. is_from_gw([type]) 4.5. is_from_gw( type, [flag]) -4.1. do_routing("[groupID]") +4.1. do_routing("[groupID]") Function to trigger routing of the message according to the rules in the database table and the configured parameters. @@ -718,7 +718,7 @@ do_routing("0"); ... do_routing("$avp(i:10)"); -4.2. use_next_gw()/next_routing() +4.2. use_next_gw()/next_routing() The function takes the next available destination (set by do_routing, as alternative destinations) and push it into RURI. Note that the @@ -741,7 +741,7 @@ if (use_next_gw()) { } ... -4.3. goes_to_gw([type]) +4.3. goes_to_gw([type]) Function returns true if the destination of the current request (destination URI or Request URI) points (as IP) to one of the gateways. @@ -762,7 +762,7 @@ if (goes_to_gw("1")) { } ... -4.4. is_from_gw([type]) +4.4. is_from_gw([type]) The function checks if the sender of the message is a gateway from a certain group. @@ -781,7 +781,7 @@ if (is_from_gw("1") { } ... -4.5. is_from_gw( type, [flag]) +4.5. is_from_gw( type, [flag]) The function checks if the sender of the message is a gateway from a certain group. @@ -803,7 +803,7 @@ if (is_from_gw("3","1") { 5.1. drouting.reload -5.1. drouting.reload +5.1. drouting.reload Command to reload routing rules from database. diff --git a/modules/enum/README b/modules/enum/README index b1f0c0007d6..fc4451ded11 100644 --- a/modules/enum/README +++ b/modules/enum/README @@ -8,7 +8,7 @@ Otmar Lendl - Copyright 2002, 2003 Juha Heinanen + Copyright © 2002, 2003 Juha Heinanen __________________________________________________________________ Table of Contents @@ -74,9 +74,9 @@ Chapter 1. Admin Guide phone number of the form +decimal-digits, where the number of digits is at least 2 and at most 20. Out of this number enum_query forms a domain name, where the digits are in reverse order and separated by dots - followed by domain suffix that by default is "e164.arpa.". For example, + followed by domain suffix that by default is “e164.arpa.”. For example, if the user part is +35831234567, the domain name will be - "7.6.5.4.3.2.1.3.8.5.3.e164.arpa.". i_enum_query operates in a similar + “7.6.5.4.3.2.1.3.8.5.3.e164.arpa.”. i_enum_query operates in a similar fashion. The only difference is that it adds a label (default "i") to branch off from the default, user-ENUM tree to an infrastructure ENUM tree. @@ -143,7 +143,7 @@ Chapter 1. Admin Guide digits of an E164 number. Can be overridden by a parameter to enum_query. - Default value is "e164.arpa." + Default value is “e164.arpa.” Example 1.1. Setting domain_suffix module parameter modparam("enum", "domain_suffix", "e1234.arpa.") @@ -158,7 +158,7 @@ Note Currently SIP Router does not support tel URIs. This means that at present tel_uri_params is appended as URI parameters to every URI. - Default value is "" + Default value is “” Example 1.2. Setting tel_uri_params module parameter modparam("enum", "tel_uri_params", ";npdi") @@ -168,7 +168,7 @@ modparam("enum", "tel_uri_params", ";npdi") The domain suffix to be used for i_enum_query() lookups. Can be overridden by a parameter to i_enum_query. - Default value is "e164.arpa." + Default value is “e164.arpa.” Example 1.3. Setting i_enum_suffix module parameter modparam("enum", "i_enum_suffix", "e1234.arpa.") @@ -178,7 +178,7 @@ modparam("enum", "i_enum_suffix", "e1234.arpa.") This parameter determines which label i_enum_query() will use to branch off to the infrastructure ENUM tree. - Default value is ""i"" + Default value is “"i"” Example 1.4. Setting brachlabel module parameter modparam("enum", "branchlabel", "i") @@ -217,7 +217,7 @@ i.1.e164.arpa. TYPE65300 \# 14 ( ; ) 9.9.9.8.7.6.5.i.4.3.2.1.e164.arpa. IN NAPTR "NAPTR content for +1 234 5678 999" - Default value is "cc" + Default value is “cc” Example 1.7. Setting the bl_algorithm module parameter modparam("enum", "bl_algorithm", "txt") @@ -229,10 +229,10 @@ modparam("enum", "bl_algorithm", "txt") 4.3. i_enum_query(["suffix"[,"service"]]) 4.4. is_from_user_enum() -4.1. enum_query(["suffix"[,"service"]]) +4.1. enum_query(["suffix"[,"service"]]) The function performs an enum query and rewrites the Request-URI with - the result of the query. See Section 1, "Overview" for more + the result of the query. See Section 1, “Overview” for more information. Meaning of the parameters is as follows: @@ -265,11 +265,11 @@ enum_query("e164.arpa.","voice"); enum_query("e164.arpa.","+sip+voice:sip"); ... -4.2. enum_pv_query("pvar"[,"suffix"[,"service"]]) +4.2. enum_pv_query("pvar"[,"suffix"[,"service"]]) The function performs an enum query on E.164 number stored in its pseudo variable argument and rewrites the Request-URI with the result - of the query. See Section 1, "Overview" for more information. + of the query. See Section 1, “Overview” for more information. Meaning of the parameters is as follows: * pvar - Pseudo variable that holds an E.164 number on which enum @@ -301,7 +301,7 @@ enum_pv_query("$avp(i:100)","e164.arpa.","voice"); enum_pv_query("$avp(i:100)","e164.arpa.","+sip+voice:sip"); ... -4.3. i_enum_query(["suffix"[,"service"]]) +4.3. i_enum_query(["suffix"[,"service"]]) The function performs an enum query and rewrites the Request-URI with the result of the query. This the Infrastructure-ENUM version of diff --git a/modules/enum/enum.c b/modules/enum/enum.c index 6439f54ef0f..1abd96253ce 100644 --- a/modules/enum/enum.c +++ b/modules/enum/enum.c @@ -254,7 +254,7 @@ static inline int is_e164(str* _user) int i; char c; - if ((_user->len > 2) && (_user->len < MAX_NUM_LEN) && ((_user->s)[0] == '+')) { + if ((_user->len > 1) && (_user->len < MAX_NUM_LEN) && ((_user->s)[0] == '+')) { for (i = 1; i < _user->len; i++) { c = (_user->s)[i]; if ((c < '0') || (c > '9')) return -1; @@ -762,14 +762,15 @@ int enum_query(struct sip_msg* _msg, str* suffix, str* service) return -1; } + user_s = _msg->parsed_uri.user.s; + user_len = _msg->parsed_uri.user.len; + if (is_e164(&(_msg->parsed_uri.user)) == -1) { - LM_ERR("R-URI user is not an E164 number\n"); + LM_ERR("R-URI user '<%.*s>' is not an E164 number\n", + user_len, user_s); return -1; } - user_s = _msg->parsed_uri.user.s; - user_len = _msg->parsed_uri.user.len; - memcpy(&(string[0]), user_s, user_len); string[user_len] = (char)0; diff --git a/modules/erlang/cnode.c b/modules/erlang/cnode.c index f0f6e03d4ca..1e9b5d67c0c 100644 --- a/modules/erlang/cnode.c +++ b/modules/erlang/cnode.c @@ -226,7 +226,7 @@ int init_cnode_sockets(int cnode_id) io_handler_ins(phandler); /* start epmd handler - publish Kamailo C node */ - if (epmd_init((epmd_handler_t*)phandler) < 0 ) { + if (epmd_init((epmd_handler_t*)phandler, &alivename) < 0 ) { return -1; } diff --git a/modules/erlang/epmd.c b/modules/erlang/epmd.c index 3a47e0fc2b4..43889aa7396 100644 --- a/modules/erlang/epmd.c +++ b/modules/erlang/epmd.c @@ -39,9 +39,9 @@ /** * \brief Initialize EPMD handler */ -int epmd_init(epmd_handler_t *epmd) +int epmd_init(epmd_handler_t *epmd, str *alivename) { - epmd->sockfd = erl_init_node(&epmd->ec, &cnode_alivename, &cnode_host, &cookie); + epmd->sockfd = erl_init_node(&epmd->ec, alivename, &cnode_host, &cookie); epmd->handle_f = handle_epmd; epmd->wait_tmo_f = NULL; epmd->destroy_f = NULL; diff --git a/modules/erlang/epmd.h b/modules/erlang/epmd.h index d5d45078e2e..09b3eb59f0a 100644 --- a/modules/erlang/epmd.h +++ b/modules/erlang/epmd.h @@ -55,7 +55,7 @@ typedef struct epmd_handler_s } epmd_handler_t; -int epmd_init(epmd_handler_t *epmd); +int epmd_init(epmd_handler_t *epmd, str *alivename); int handle_epmd(handler_common_t *phandler); #endif /* EPMD_H_ */ diff --git a/modules/erlang/erl_api.c b/modules/erlang/erl_api.c index 36d08f32f85..e33aac660fc 100644 --- a/modules/erlang/erl_api.c +++ b/modules/erlang/erl_api.c @@ -83,6 +83,48 @@ int _impl_api_rpc_call(ei_x_buff *reply, const str *module,const str *function, int buffsz=0; int rc; + if (!csockfd) { + + if (!enode) { + LM_NOTICE("there is no connected Erlang node\n"); + /* reply up with error */ + ei_x_format(reply, "{error,cnode,~a}", "no_erlang_node"); + return -1; + } + + if (rex_call_in_progress) { + LM_ERR("RPC loop detected\n"); + ei_x_format(reply, "{badrpc,cnode,~a}", "rpc_loop_detected"); + return -1; + } + + /* do RPC from event route */ + if (ei_rpc(&enode->ec,enode->sockfd,module->s,function->s,args->buff,args->index,reply) == ERL_ERROR) + { + reply->index = 0; /* re-use reply buffer */ + + if (erl_errno) + { + ei_x_format(reply, "{error,cnode,~s}", strerror(erl_errno)); + LM_ERR("ei_rpc failed on node=<%s> socket=<%d>: %s\n",enode->conn.nodename,enode->sockfd,strerror(erl_errno)); + } + else if (errno) + { + ei_x_format(reply, "{error,cnode,~s}", strerror(errno)); + LM_ERR("ei_rpc failed on node=<%s> socket=<%d>: %s\n",enode->conn.nodename,enode->sockfd,strerror(errno)); + } + else + { + ei_x_format(reply, "{error,cnode,~s}", "Unknown error."); + LM_ERR("ei_rpc failed on node=<%s> socket=<%d>, Unknown error.\n",enode->ec.thisalivename,enode->sockfd); + } + return -1; + } + /* reset response */ + enode->response.index = 0; + return 0; + } + memset(&msgh, 0, sizeof(msgh)); memset(&cnt, 0, sizeof(cnt)); @@ -187,6 +229,39 @@ int _impl_reg_send(const str *server, const ei_x_buff *msg) return -1; } + if (!csockfd) { + + if (!enode) { + LM_NOTICE("there is no connected Erlang node\n"); + return -1; + } + + if (rex_call_in_progress) { + LM_ERR("RPC in progress detected\n"); + return -1; + } + + /* do ERL_REG_SEND in event route */ + if ((rc = ei_reg_send(&enode->ec,enode->sockfd,server->s,msg->buff,msg->buffsz)) == ERL_ERROR) + { + if (erl_errno) + { + LM_ERR("ei_reg_send failed on node=<%s> socket=<%d>: %s\n",enode->conn.nodename,enode->sockfd,strerror(erl_errno)); + } + else if (errno) + { + LM_ERR("ei_reg_send failed on node=<%s> socket=<%d>: %s\n",enode->conn.nodename,enode->sockfd,strerror(errno)); + } + else + { + LM_ERR("ei_reg_send failed on node=<%s> socket=<%d>, Unknown error.\n",enode->ec.thisalivename,enode->sockfd); + } + } + /* reset response */ + enode->response.index = 0; + return 0; + } + /* Kamailio PID */ cnt[0].iov_base = (void*)&pid_no; cnt[0].iov_len = sizeof(pid_no); @@ -245,6 +320,12 @@ int _impl_reply(const ei_x_buff *msg) LM_ERR("not connected\n"); return -1; } + + if (rex_call_in_progress) { + LM_ERR("RPC in progress detected\n"); + return -1; + } + /* copy into reply */ if (enode->response.buffsz < msg->buffsz) { /* realocate */ @@ -277,11 +358,16 @@ int _impl_send(const erlang_pid *pid, const ei_x_buff *msg) return -1; } + if (rex_call_in_progress) { + LM_ERR("RPC in progress detected\n"); + return -1; + } + if (enode) { /* copy into reply */ if (enode->response.buffsz < msg->buffsz) { - /* realocate */ + /* reallocate */ enode->response.buff=realloc(enode->response.buff,msg->buffsz); if (!enode->response.buff) { LM_ERR("realloc failed: not enough memory\n"); diff --git a/modules/erlang/erl_helpers.c b/modules/erlang/erl_helpers.c index cc43e9277c6..1ec21d117eb 100644 --- a/modules/erlang/erl_helpers.c +++ b/modules/erlang/erl_helpers.c @@ -235,7 +235,6 @@ int erl_init_ec(ei_cnode *ec, const str *alivename, const str *hostname, const s char nodename[MAXNODELEN]; int result; - int port; /* copy the nodename into something we can modify */ if (snprintf(nodename, MAXNODELEN, "%.*s@%.*s", STR_FMT(alivename), STR_FMT(hostname)) >= MAXNODELEN) { @@ -256,8 +255,6 @@ int erl_init_ec(ei_cnode *ec, const str *alivename, const str *hostname, const s return -1; } - port = sockaddr_port(addr); - LM_DBG("initialized ec for cnode '%s' on %.*s[%s] creation %d.\n", nodename, STR_FMT(hostname), ip_addr2strz(&ip), creation); freeaddrinfo(ai); @@ -307,9 +304,9 @@ int erl_init_node(ei_cnode *ec, const str *alivename, const str *hostname, const sockaddr2ip_addr(&ip, addr); /* publish */ - if ((epmdfd = ei_publish_tmo(ec, port, timeout_ms)) == -1) { + if ((epmdfd = ei_publish_tmo(ec, port, timeout_ms)) < 0) { - LM_ERR("Failed to publish port %u to epmd, check is epmd started\n", port); + LM_DBG("Failed publish %s:%u[%u] as %s: %s (%d)\n",ip_addr2strz(&ip),port,listen_fd,nodename, strerror(erl_errno), epmdfd); erl_close_socket(listen_fd); return -1; diff --git a/modules/erlang/erl_helpers.h b/modules/erlang/erl_helpers.h index 2aed0636501..fa8fdc595d8 100644 --- a/modules/erlang/erl_helpers.h +++ b/modules/erlang/erl_helpers.h @@ -141,6 +141,7 @@ do { \ ei_s_print_term(&pbuf, pidbuf.buff, &i); \ ei_x_print_reg_msg(buf, pbuf, send); \ free(pbuf); \ + ei_x_free(&pidbuf); \ } while(0) int ei_decode_strorbin(char *buf, int *index, int maxlen, char *dst); diff --git a/modules/erlang/handle_emsg.c b/modules/erlang/handle_emsg.c index e43bb1f5de9..e1aa51f3681 100644 --- a/modules/erlang/handle_emsg.c +++ b/modules/erlang/handle_emsg.c @@ -22,6 +22,7 @@ */ #include +#include #include #include @@ -43,7 +44,7 @@ int handle_req_ref_tuple(cnode_handler_t *phandler, erlang_msg * msg); int handle_rpc_response(cnode_handler_t *phandler, erlang_msg * msg, int arity); int handle_rex_call(cnode_handler_t *phandler,erlang_ref_ex_t *ref, erlang_pid *pid); int handle_net_kernel(cnode_handler_t *phandler, erlang_msg * msg); -void encode_error_msg(ei_x_buff *response, erlang_ref_ex_t *ref, const char *type, const char *msg ); +void encode_error_msg(ei_x_buff *response, erlang_ref_ex_t *ref, const char *type, const char *msg, ...); int handle_reg_send(cnode_handler_t *phandler, erlang_msg * msg) { @@ -414,6 +415,36 @@ int handle_net_kernel(cnode_handler_t *phandler, erlang_msg * msg) int erlang_whereis(cnode_handler_t *phandler,erlang_ref_ex_t *ref, erlang_pid *pid) { ei_x_buff *response = &phandler->response; + ei_x_buff *request = &phandler->request; + char route[sizeof("erlang:")+MAXATOMLEN] = "erlang:"; + int arity; + int type; + int rt; + + ei_decode_list_header(request->buff,&request->index,&arity); + + if (arity != 1) { + response->index = 1; + encode_error_msg(response, ref, "badarith", "undefined function erlang:whereis/%d",arity); + return 0; + } + + ei_get_type(request->buff,&request->index,&type,&arity); + + if (type != ERL_ATOM_EXT) { + response->index = 1; + encode_error_msg(response, ref, "badarg", "bad argument"); + return 0; + } + + ei_decode_atom(request->buff,&request->index,route+sizeof("erlang:")-1); + + rt = route_get(&event_rt, route); + if (rt < 0 || event_rt.rlist[rt] == NULL) { + LM_WARN("can't find pseudo process %s\n", route); + ei_x_encode_atom(response,"undefined"); + return 0; + } ei_x_encode_pid(response,&phandler->ec.self); @@ -429,6 +460,7 @@ static int handle_erlang_calls(cnode_handler_t *phandler,erlang_ref_ex_t *ref, e return erlang_whereis(phandler,ref,pid); } else { + response->index = 1; encode_error_msg(response, ref, "badrpc", "Method Not Found"); } @@ -571,7 +603,9 @@ int handle_rex_call(cnode_handler_t *phandler,erlang_ref_ex_t *ref, erlang_pid * ctx.size = arity; /* call rpc */ + rex_call_in_progress = 1; exp->function(&erl_rpc_func_param,(void*)&ctx); + rex_call_in_progress = 0; if (ctx.no_params) { @@ -813,23 +847,27 @@ int handle_erlang_msg(cnode_handler_t *phandler, erlang_msg * msg) LM_ERR("ei_send failed on node=<%s> socket=<%d>, %s\n", phandler->ec.thisnodename,phandler->sockfd, strerror(erl_errno)); } - - /* reset pid */ - cnode_reply_to_pid = NULL; - return ret; } else { LM_DBG("** no reply **\n"); - - /* reset pid */ - cnode_reply_to_pid = NULL; - return 0; } + + /* reset pid */ + cnode_reply_to_pid = NULL; + return 0; } -void encode_error_msg(ei_x_buff *response, erlang_ref_ex_t *ref, const char *type, const char *msg ) +void encode_error_msg(ei_x_buff *response, erlang_ref_ex_t *ref, const char *type, const char *msg, ... ) { + char buffer[256]; + va_list args; + va_start (args, msg); + + vsnprintf (buffer, 255, msg, args); + + va_end (args); + ei_x_encode_tuple_header(response, 2); if (ref->with_node) @@ -844,5 +882,5 @@ void encode_error_msg(ei_x_buff *response, erlang_ref_ex_t *ref, const char *typ ei_x_encode_tuple_header(response,2); ei_x_encode_atom(response, type); - ei_x_encode_string(response, msg); + ei_x_encode_string(response, buffer); } diff --git a/modules/erlang/handle_emsg.h b/modules/erlang/handle_emsg.h index 60ee4416fdf..01dae2d05a8 100644 --- a/modules/erlang/handle_emsg.h +++ b/modules/erlang/handle_emsg.h @@ -27,6 +27,8 @@ #include "erl_helpers.h" #include "cnode.h" +extern int rex_in_progress; + int handle_erlang_msg(cnode_handler_t *handler, erlang_msg * msg); #endif /* HANDLE_EMSG_H_ */ diff --git a/modules/erlang/mod_erlang.c b/modules/erlang/mod_erlang.c index 032a0371cd5..f99b4f3f405 100644 --- a/modules/erlang/mod_erlang.c +++ b/modules/erlang/mod_erlang.c @@ -72,6 +72,11 @@ static int fixup_send(void** param, int param_no); static int fixup_reg(void** param, int param_no); static int fixup_reply(void** param, int param_no); +int fixup_free_rpc(void** param, int param_no); +int fixup_free_reg(void** param, int param_no); +int fixup_free_send(void** param, int param_no); +int fixup_free_reply(void** param, int param_no); + /* initialize common vars */ str cookie = STR_NULL; int trace_level = 0; @@ -83,6 +88,8 @@ int rpc_reply_with_struct = 0; str erlang_nodename = STR_NULL; str erlang_node_sname = STR_NULL; +int rex_call_in_progress = 0; + int *usocks[2]; int csockfd; @@ -176,10 +183,10 @@ static param_export_t parameters[] = static cmd_export_t commands[] = { - {"erl_rpc", (cmd_function)erl_rpc, 4, fixup_rpc, 0, ANY_ROUTE}, - {"erl_send", (cmd_function)erl_send_k, 2, fixup_send, 0, ANY_ROUTE}, - {"erl_reg_send", (cmd_function)erl_reg_send_k, 2, fixup_reg, 0, ANY_ROUTE}, - {"erl_reply", (cmd_function)erl_reply_k, 1, fixup_reply, 0, EVENT_ROUTE}, + {"erl_rpc", (cmd_function)erl_rpc, 4, fixup_rpc, fixup_free_rpc, ANY_ROUTE}, + {"erl_send", (cmd_function)erl_send_k, 2, fixup_send, fixup_free_send, ANY_ROUTE}, + {"erl_reg_send", (cmd_function)erl_reg_send_k, 2, fixup_reg, fixup_free_reg, ANY_ROUTE}, + {"erl_reply", (cmd_function)erl_reply_k, 1, fixup_reply, fixup_free_reply, EVENT_ROUTE}, {"load_erl",(cmd_function)load_erl,0, 0, 0, 0}, /* API loader */ { 0, 0, 0, 0, 0, 0 } }; @@ -434,7 +441,7 @@ static int erl_rpc(struct sip_msg *msg, char *_m, char *_f, char *_a, char *_r) sr_xavp_t *xreq=NULL; sr_xavp_t *xrepl=NULL; pv_spec_t sp; - pv_spec_t *nsp = NULL; + pv_spec_t *nsp; pv_param_t pvp; pv_name_t *pvn; pv_index_t *pvi; @@ -446,7 +453,7 @@ static int erl_rpc(struct sip_msg *msg, char *_m, char *_f, char *_a, char *_r) switch (m->type) { case ERL_PARAM_FPARAM: - if(get_str_fparam(&module,msg,&m->value.fp)) { + if(get_str_fparam(&module,msg,m->value.fp)) { LM_ERR("can't get module name\n"); } break; @@ -457,7 +464,7 @@ static int erl_rpc(struct sip_msg *msg, char *_m, char *_f, char *_a, char *_r) switch (f->type) { case ERL_PARAM_FPARAM: - if(get_str_fparam(&function,msg,&f->value.fp)) { + if(get_str_fparam(&function,msg,f->value.fp)) { LM_ERR("can't get function name\n"); } break; @@ -468,7 +475,7 @@ static int erl_rpc(struct sip_msg *msg, char *_m, char *_f, char *_a, char *_r) switch(a->type){ case ERL_PARAM_FPARAM: - if(get_str_fparam(&vname,msg,&a->value.fp)){ + if(get_str_fparam(&vname,msg,a->value.fp)){ LM_ERR("can't get name of arguments parameter\n"); return -1; } @@ -482,13 +489,8 @@ static int erl_rpc(struct sip_msg *msg, char *_m, char *_f, char *_a, char *_r) } break; case ERL_PARAM_XBUFF_SPEC: - sp = a->value.sp; - pvp = sp.pvp; /* work on copy */ - - if (pvp.pvn.type != PV_NAME_INTSTR || !(pvp.pvn.u.isname.type & AVP_NAME_STR)) { - LM_ERR("unsupported name of list\n"); - return -1; - } + nsp = NULL; + pvp = a->value.sp.pvp; /* work on copy */ if( pvp.pvn.type == PV_NAME_PVAR) { nsp = pvp.pvn.u.dname; @@ -497,9 +499,11 @@ static int erl_rpc(struct sip_msg *msg, char *_m, char *_f, char *_a, char *_r) if (nsp) { pvi = &nsp->pvp.pvi; pvn = &nsp->pvp.pvn; + sp = *nsp; } else { pvi = &pvp.pvi; pvn = &pvp.pvn; + sp = a->value.sp; } if (sp.setf == pv_list_set ) { @@ -512,7 +516,6 @@ static int erl_rpc(struct sip_msg *msg, char *_m, char *_f, char *_a, char *_r) /* fix index */ attr = xbuff_get_attr_flags(pvi->type); - pvi->type = xbuff_fix_index(pvi->type); /* get the index */ if(pv_get_spec_index(msg, &pvp, &idx, &idxf)) @@ -553,20 +556,15 @@ static int erl_rpc(struct sip_msg *msg, char *_m, char *_f, char *_a, char *_r) switch(r->type){ case ERL_PARAM_FPARAM: - if(get_str_fparam(&vname,msg,&r->value.fp)){ + if(get_str_fparam(&vname,msg,r->value.fp)){ LM_ERR("can't get name of arguments parameter\n"); return -1; } xrepl = pv_xbuff_get_xbuff(&vname); break; case ERL_PARAM_XBUFF_SPEC: - sp = r->value.sp; - pvp = sp.pvp; /* work on copy */ - - if (pvp.pvn.type != PV_NAME_INTSTR || !(pvp.pvn.u.isname.type & AVP_NAME_STR)) { - LM_ERR("unsupported name of xbuff\n"); - return -1; - } + nsp = NULL; + pvp = r->value.sp.pvp; /* work on copy */ if( pvp.pvn.type == PV_NAME_PVAR) { nsp = pvp.pvn.u.dname; @@ -575,9 +573,11 @@ static int erl_rpc(struct sip_msg *msg, char *_m, char *_f, char *_a, char *_r) if (nsp) { pvi = &nsp->pvp.pvi; pvn = &nsp->pvp.pvn; + sp = *nsp; } else { pvi = &pvp.pvi; pvn = &pvp.pvn; + sp = a->value.sp; } if (sp.setf == pv_xbuff_set ) { @@ -589,7 +589,6 @@ static int erl_rpc(struct sip_msg *msg, char *_m, char *_f, char *_a, char *_r) /* fix index */ attr = xbuff_get_attr_flags(pvi->type); - pvi->type = xbuff_fix_index(pvi->type); /* get the index */ if(pv_get_spec_index(msg, &pvp, &idx, &idxf)) @@ -653,6 +652,7 @@ static int erl_rpc(struct sip_msg *msg, char *_m, char *_f, char *_a, char *_r) static int fixup_rpc(void** param, int param_no) { erl_param_t *erl_param; + pv_spec_p psp; str s; @@ -669,7 +669,7 @@ static int fixup_rpc(void** param, int param_no) return -1; } erl_param->type = ERL_PARAM_FPARAM; - erl_param->value.fp = *(fparam_t*)*param; + erl_param->value.fp = (fparam_t*)*param; } if (param_no==3 || param_no==4) { @@ -689,22 +689,19 @@ static int fixup_rpc(void** param, int param_no) return E_UNSPEC; } erl_param->type = ERL_PARAM_FPARAM; - erl_param->value.fp = *(fparam_t*)*param; - } else if(pv_parse_spec( &s, &erl_param->value.sp)==NULL || erl_param->value.sp.type!=PVT_OTHER) { - - /* only XBUFF is accepted for args and reply */ - LM_ERR("wrong parameter #%d: accepted types are list of xbuff\n",param_no); - pv_spec_free(&erl_param->value.sp); - pkg_free((void*)erl_param); - return E_UNSPEC; + erl_param->value.fp = (fparam_t*)*param; } else { /* lets check what is acceptable */ - if (erl_param->value.sp.setf != pv_list_set && erl_param->value.sp.setf != pv_xbuff_set) { - LM_ERR("wrong parameter #%d: accepted types are list of xbuff\n",param_no); + psp = (pv_spec_p)erl_param->value.sp.pvp.pvn.u.dname; + + if (psp->setf != pv_list_set && psp->setf != pv_xbuff_set) { + LM_ERR("wrong parameter #%d: accepted types are list or xbuff\n",param_no); + pv_spec_free(&erl_param->value.sp); pkg_free((void*)erl_param); return E_UNSPEC; } erl_param->type = ERL_PARAM_XBUFF_SPEC; + LM_ERR("erl_param->value.sp.type=%d\n",erl_param->value.sp.type); } } @@ -713,6 +710,28 @@ static int fixup_rpc(void** param, int param_no) return 0; } +int fixup_free_rpc(void** param, int param_no) { + + erl_param_t *erl_param; + + erl_param = (erl_param_t*)*param; + + if(param_no==1 || param_no==2) { + return fixup_free_fparam_2((void**)&erl_param->value.fp,param_no); + } + + if (param_no==3 || param_no==4) { + LM_ERR("erl_param->value.sp.type=%d\n",erl_param->value.sp.type); + if (erl_param->value.sp.type == PVT_OTHER) { + pv_spec_free((pv_spec_p)erl_param->value.sp.pvp.pvn.u.dname); + } else if (erl_param->value.sp.pvp.pvn.type == PV_NAME_INTSTR) { + return fixup_free_fparam_2((void**)&erl_param->value.fp,param_no); + } + } + + return 0; +} + static int erl_reg_send_k(struct sip_msg *msg, char *_server, char *_emsg) { erl_param_t *param_server=(erl_param_t*)_server; @@ -733,7 +752,7 @@ static int erl_reg_send_k(struct sip_msg *msg, char *_server, char *_emsg) switch (param_server->type) { case ERL_PARAM_FPARAM: - if(get_str_fparam(&server,msg,¶m_server->value.fp)) { + if(get_str_fparam(&server,msg,param_server->value.fp)) { LM_ERR("can't get server process name\n"); } break; @@ -746,7 +765,7 @@ static int erl_reg_send_k(struct sip_msg *msg, char *_server, char *_emsg) switch(param_emsg->type){ case ERL_PARAM_FPARAM: - if(get_str_fparam(&str_msg,msg,¶m_emsg->value.fp)){ + if(get_str_fparam(&str_msg,msg,param_emsg->value.fp)){ LM_ERR("can't get emsg parameter\n"); goto err; } @@ -755,13 +774,7 @@ static int erl_reg_send_k(struct sip_msg *msg, char *_server, char *_emsg) break; case ERL_PARAM_XBUFF_SPEC: - sp = param_emsg->value.sp; - pvp = sp.pvp; /* work on copy */ - - if (pvp.pvn.type != PV_NAME_INTSTR || !(pvp.pvn.u.isname.type & AVP_NAME_STR)) { - LM_ERR("unsupported name of list\n"); - return -1; - } + pvp = param_emsg->value.sp.pvp; /* work on copy */ if( pvp.pvn.type == PV_NAME_PVAR) { nsp = pvp.pvn.u.dname; @@ -770,9 +783,11 @@ static int erl_reg_send_k(struct sip_msg *msg, char *_server, char *_emsg) if (nsp) { pvi = &nsp->pvp.pvi; pvn = &nsp->pvp.pvn; + sp = *nsp; } else { pvi = &pvp.pvi; pvn = &pvp.pvn; + sp = param_emsg->value.sp; } if (sp.setf == pv_list_set ) { @@ -785,7 +800,6 @@ static int erl_reg_send_k(struct sip_msg *msg, char *_server, char *_emsg) /* fix index */ attr = xbuff_get_attr_flags(pvi->type); - pvi->type = xbuff_fix_index(pvi->type); /* get the index */ if(pv_get_spec_index(msg, &pvp, &idx, &idxf)) @@ -843,6 +857,7 @@ static int erl_reg_send_k(struct sip_msg *msg, char *_server, char *_emsg) static int fixup_reg(void** param, int param_no) { erl_param_t *erl_param; + pv_spec_p psp; str s; @@ -861,7 +876,7 @@ static int fixup_reg(void** param, int param_no) return -1; } erl_param->type = ERL_PARAM_FPARAM; - erl_param->value.fp = *(fparam_t*)*param; + erl_param->value.fp = (fparam_t*)*param; } if (param_no==2) { @@ -881,30 +896,27 @@ static int fixup_reg(void** param, int param_no) return E_UNSPEC; } erl_param->type = ERL_PARAM_FPARAM; - erl_param->value.fp = *(fparam_t*)*param; - } else if(pv_parse_spec( &s, &erl_param->value.sp)==NULL) { - - /* only XBUFF is accepted for emsg and reply */ - LM_ERR("wrong parameter #%d\n",param_no); - pv_spec_free(&erl_param->value.sp); - pkg_free((void*)erl_param); - return E_UNSPEC; + erl_param->value.fp = (fparam_t*)*param; } else { - if (erl_param->value.sp.type ==PVT_XAVP) { + if (erl_param->value.sp.type == PVT_XAVP) { LM_ERR("XAVP not acceptable for parameter #%d\n",param_no); pkg_free((void*)erl_param); return E_UNSPEC; } - if (erl_param->value.sp.setf == pv_list_set - || erl_param->value.sp.setf == pv_xbuff_set - || erl_param->value.sp.setf == pv_tuple_set - || erl_param->value.sp.setf == pv_atom_set) { + psp = (pv_spec_p)erl_param->value.sp.pvp.pvn.u.dname; + + if (psp->setf == pv_list_set + || psp->setf == pv_xbuff_set + || psp->setf == pv_tuple_set + || psp->setf == pv_atom_set) { erl_param->type = ERL_PARAM_XBUFF_SPEC; } else { - erl_param->type = ERL_PARAM_FPARAM; - erl_param->value.fp = *(fparam_t*)*param; + LM_ERR("wrong parameter #%d\n",param_no); + pv_spec_free(&erl_param->value.sp); + pkg_free((void*)erl_param); + return E_UNSPEC; } } } @@ -914,6 +926,28 @@ static int fixup_reg(void** param, int param_no) return 0; } +int fixup_free_reg(void** param, int param_no) { + + erl_param_t *erl_param; + + erl_param = (erl_param_t*)*param; + + if(param_no==1) { + return fixup_free_fparam_1((void**)&erl_param->value.fp,param_no); + } + + if (param_no==2) { + LM_ERR("erl_param->value.sp.type=%d\n",erl_param->value.sp.type); + if (erl_param->value.sp.type == PVT_OTHER) { + pv_spec_free((pv_spec_p)erl_param->value.sp.pvp.pvn.u.dname); + } else if (erl_param->value.sp.pvp.pvn.type == PV_NAME_INTSTR) { + return fixup_free_fparam_2((void**)&erl_param->value.fp,param_no); + } + } + + return 0; +} + static int erl_reply_k(struct sip_msg *msg, char *_emsg) { erl_param_t *param_emsg=(erl_param_t*)_emsg; @@ -934,7 +968,7 @@ static int erl_reply_k(struct sip_msg *msg, char *_emsg) switch(param_emsg->type){ case ERL_PARAM_FPARAM: - if(get_str_fparam(&str_msg,msg,¶m_emsg->value.fp)){ + if(get_str_fparam(&str_msg,msg,param_emsg->value.fp)){ LM_ERR("can't get emsg parameter\n"); goto err; } @@ -943,13 +977,7 @@ static int erl_reply_k(struct sip_msg *msg, char *_emsg) break; case ERL_PARAM_XBUFF_SPEC: - sp = param_emsg->value.sp; - pvp = sp.pvp; /* work on copy */ - - if (pvp.pvn.type != PV_NAME_INTSTR || !(pvp.pvn.u.isname.type & AVP_NAME_STR)) { - LM_ERR("unsupported name of list\n"); - return -1; - } + pvp = param_emsg->value.sp.pvp; /* work on copy */ if( pvp.pvn.type == PV_NAME_PVAR) { nsp = pvp.pvn.u.dname; @@ -958,9 +986,11 @@ static int erl_reply_k(struct sip_msg *msg, char *_emsg) if (nsp) { pvi = &nsp->pvp.pvi; pvn = &nsp->pvp.pvn; + sp = *nsp; } else { pvi = &pvp.pvi; pvn = &pvp.pvn; + sp = param_emsg->value.sp; } if (sp.setf == pv_list_set ) { @@ -1031,6 +1061,7 @@ static int erl_reply_k(struct sip_msg *msg, char *_emsg) static int fixup_reply(void** param, int param_no) { erl_param_t *erl_param; + pv_spec_p psp; str s; @@ -1060,14 +1091,7 @@ static int fixup_reply(void** param, int param_no) return E_UNSPEC; } erl_param->type = ERL_PARAM_FPARAM; - erl_param->value.fp = *(fparam_t*)*param; - } else if(pv_parse_spec( &s, &erl_param->value.sp)==NULL) { - - /* only XBUFF is accepted for emsg and reply */ - LM_ERR("wrong parameter #%d\n",param_no); - pv_spec_free(&erl_param->value.sp); - pkg_free((void*)erl_param); - return E_UNSPEC; + erl_param->value.fp = (fparam_t*)*param; } else { if (erl_param->value.sp.type ==PVT_XAVP) { LM_ERR("XAVP not acceptable for parameter #%d\n",param_no); @@ -1075,15 +1099,19 @@ static int fixup_reply(void** param, int param_no) return E_UNSPEC; } - if (erl_param->value.sp.setf == pv_list_set - || erl_param->value.sp.setf == pv_xbuff_set - || erl_param->value.sp.setf == pv_tuple_set - || erl_param->value.sp.setf == pv_atom_set) { + psp = (pv_spec_p)erl_param->value.sp.pvp.pvn.u.dname; + + if (psp->setf == pv_list_set + || psp->setf == pv_xbuff_set + || psp->setf == pv_tuple_set + || psp->setf == pv_atom_set) { erl_param->type = ERL_PARAM_XBUFF_SPEC; } else { - erl_param->type = ERL_PARAM_FPARAM; - erl_param->value.fp = *(fparam_t*)*param; + LM_ERR("wrong parameter #%d\n",param_no); + pv_spec_free(&erl_param->value.sp); + pkg_free((void*)erl_param); + return E_UNSPEC; } } } @@ -1093,6 +1121,24 @@ static int fixup_reply(void** param, int param_no) return 0; } +int fixup_free_reply(void** param, int param_no) { + + erl_param_t *erl_param; + + erl_param = (erl_param_t*)*param; + + if (param_no==1) { + LM_ERR("erl_param->value.sp.type=%d\n",erl_param->value.sp.type); + if (erl_param->value.sp.type == PVT_OTHER) { + pv_spec_free((pv_spec_p)erl_param->value.sp.pvp.pvn.u.dname); + } else if (erl_param->value.sp.pvp.pvn.type == PV_NAME_INTSTR) { + return fixup_free_fparam_2((void**)&erl_param->value.fp,param_no); + } + } + + return 0; +} + static int erl_send_k(struct sip_msg *msg, char *_pid, char *_emsg) { erl_param_t *param_pid=(erl_param_t*)_pid; @@ -1101,7 +1147,7 @@ static int erl_send_k(struct sip_msg *msg, char *_pid, char *_emsg) str str_msg; sr_xavp_t *xmsg=NULL; pv_spec_t sp; - pv_spec_t *nsp = NULL; + pv_spec_t *nsp; pv_param_t pvp; pv_name_t *pvn; pv_index_t *pvi; @@ -1113,13 +1159,8 @@ static int erl_send_k(struct sip_msg *msg, char *_pid, char *_emsg) switch (param_pid->type) { case ERL_PARAM_XBUFF_SPEC: - sp = param_pid->value.sp; - pvp = sp.pvp; /* work on copy */ - - if (pvp.pvn.type != PV_NAME_INTSTR || !(pvp.pvn.u.isname.type & AVP_NAME_STR)) { - LM_ERR("unsupported name of pid\n"); - return -1; - } + nsp = NULL; + pvp = param_pid->value.sp.pvp; /* work on copy */ if( pvp.pvn.type == PV_NAME_PVAR) { nsp = pvp.pvn.u.dname; @@ -1128,9 +1169,11 @@ static int erl_send_k(struct sip_msg *msg, char *_pid, char *_emsg) if (nsp) { pvi = &nsp->pvp.pvi; pvn = &nsp->pvp.pvn; + sp = *nsp; } else { pvi = &pvp.pvi; pvn = &pvp.pvn; + sp = param_pid->value.sp; } if (sp.getf == pv_pid_get ) { @@ -1144,7 +1187,6 @@ static int erl_send_k(struct sip_msg *msg, char *_pid, char *_emsg) /* fix index */ attr = xbuff_get_attr_flags(pvi->type); - pvi->type = xbuff_fix_index(pvi->type); /* get the index */ if(pv_get_spec_index(msg, &pvp, &idx, &idxf)) @@ -1190,7 +1232,7 @@ static int erl_send_k(struct sip_msg *msg, char *_pid, char *_emsg) switch(param_emsg->type){ case ERL_PARAM_FPARAM: - if(get_str_fparam(&str_msg,msg,¶m_emsg->value.fp)){ + if(get_str_fparam(&str_msg,msg,param_emsg->value.fp)){ LM_ERR("can't get emsg parameter\n"); goto err; } @@ -1199,13 +1241,8 @@ static int erl_send_k(struct sip_msg *msg, char *_pid, char *_emsg) break; case ERL_PARAM_XBUFF_SPEC: - sp = param_emsg->value.sp; - pvp = sp.pvp; /* work on copy */ - - if (pvp.pvn.type != PV_NAME_INTSTR || !(pvp.pvn.u.isname.type & AVP_NAME_STR)) { - LM_ERR("unsupported name of list\n"); - return -1; - } + nsp = NULL; + pvp = param_emsg->value.sp.pvp; /* work on copy */ if( pvp.pvn.type == PV_NAME_PVAR) { nsp = pvp.pvn.u.dname; @@ -1214,9 +1251,11 @@ static int erl_send_k(struct sip_msg *msg, char *_pid, char *_emsg) if (nsp) { pvi = &nsp->pvp.pvi; pvn = &nsp->pvp.pvn; + sp = *nsp; } else { pvi = &pvp.pvi; pvn = &pvp.pvn; + sp = param_emsg->value.sp; } if (sp.getf == pv_list_get ) { @@ -1233,7 +1272,6 @@ static int erl_send_k(struct sip_msg *msg, char *_pid, char *_emsg) /* fix index */ attr = xbuff_get_attr_flags(pvi->type); - pvi->type = xbuff_fix_index(pvi->type); /* get the index */ if(pv_get_spec_index(msg, &pvp, &idx, &idxf)) @@ -1291,6 +1329,7 @@ static int erl_send_k(struct sip_msg *msg, char *_pid, char *_emsg) static int fixup_send(void** param, int param_no) { erl_param_t *erl_param; + pv_spec_p psp; str s; @@ -1320,27 +1359,24 @@ static int fixup_send(void** param, int param_no) return E_UNSPEC; } erl_param->type = ERL_PARAM_FPARAM; - erl_param->value.fp = *(fparam_t*)*param; - } else if(pv_parse_spec( &s, &erl_param->value.sp)==NULL) { - - /* only XBUFF is accepted for emsg */ - LM_ERR("wrong parameter #%d\n",param_no); - pv_spec_free(&erl_param->value.sp); - pkg_free((void*)erl_param); - return E_UNSPEC; - } else { - if (erl_param->value.sp.type ==PVT_XAVP) { + erl_param->value.fp = (fparam_t*)*param; + } + else { + if (erl_param->value.sp.type == PVT_XAVP) { LM_ERR("XAVP not acceptable for parameter #%d\n",param_no); pkg_free((void*)erl_param); return E_UNSPEC; } - if (erl_param->value.sp.getf == pv_pid_get - || erl_param->value.sp.getf == pv_xbuff_get) { + psp = (pv_spec_p)erl_param->value.sp.pvp.pvn.u.dname; + + if (psp->getf == pv_pid_get || psp->getf == pv_xbuff_get) { erl_param->type = ERL_PARAM_XBUFF_SPEC; } else { - erl_param->type = ERL_PARAM_FPARAM; - erl_param->value.fp = *(fparam_t*)*param; + LM_ERR("wrong parameter #%d\n",param_no); + pv_spec_free(&erl_param->value.sp); + pkg_free((void*)erl_param); + return E_UNSPEC; } } } @@ -1362,14 +1398,7 @@ static int fixup_send(void** param, int param_no) return E_UNSPEC; } erl_param->type = ERL_PARAM_FPARAM; - erl_param->value.fp = *(fparam_t*)*param; - } else if(pv_parse_spec( &s, &erl_param->value.sp)==NULL) { - - /* only XBUFF is accepted for emsg */ - LM_ERR("wrong parameter #%d\n",param_no); - pv_spec_free(&erl_param->value.sp); - pkg_free((void*)erl_param); - return E_UNSPEC; + erl_param->value.fp = (fparam_t*)*param; } else { if (erl_param->value.sp.type ==PVT_XAVP) { LM_ERR("XAVP not acceptable for parameter #%d\n",param_no); @@ -1377,16 +1406,20 @@ static int fixup_send(void** param, int param_no) return E_UNSPEC; } - if (erl_param->value.sp.getf == pv_list_get - || erl_param->value.sp.getf == pv_xbuff_get - || erl_param->value.sp.getf == pv_tuple_get - || erl_param->value.sp.getf == pv_atom_get - || erl_param->value.sp.getf == pv_pid_get) { + psp = (pv_spec_p)erl_param->value.sp.pvp.pvn.u.dname; + + if (psp->getf == pv_list_get + || psp->getf == pv_xbuff_get + || psp->getf == pv_tuple_get + || psp->getf == pv_atom_get + || psp->getf == pv_pid_get) { erl_param->type = ERL_PARAM_XBUFF_SPEC; } else { - erl_param->type = ERL_PARAM_FPARAM; - erl_param->value.fp = *(fparam_t*)*param; + LM_ERR("wrong parameter #%d\n",param_no); + pv_spec_free(&erl_param->value.sp); + pkg_free((void*)erl_param); + return E_UNSPEC; } } } @@ -1395,3 +1428,20 @@ static int fixup_send(void** param, int param_no) return 0; } + +int fixup_free_send(void** param, int param_no) { + + erl_param_t *erl_param; + + erl_param = (erl_param_t*)*param; + + if (param_no==1 || param_no==2) { + if (erl_param->value.sp.type == PVT_OTHER) { + pv_spec_free((pv_spec_p)erl_param->value.sp.pvp.pvn.u.dname); + } else if (erl_param->value.sp.pvp.pvn.type == PV_NAME_INTSTR) { + return fixup_free_fparam_2((void**)&erl_param->value.fp,param_no); + } + } + + return 0; +} diff --git a/modules/erlang/mod_erlang.h b/modules/erlang/mod_erlang.h index 34b06a66685..912d5345b83 100644 --- a/modules/erlang/mod_erlang.h +++ b/modules/erlang/mod_erlang.h @@ -39,6 +39,8 @@ extern int rpc_reply_with_struct; extern str erlang_nodename; extern str erlang_node_sname; +extern int rex_call_in_progress; + /* sockets kamailio <-> cnode */ extern int *usocks[2]; @@ -63,7 +65,7 @@ typedef enum { typedef struct erl_param_s { erl_param_type type; union { - fparam_t fp; + fparam_t *fp; pv_spec_t sp; } value; } erl_param_t; diff --git a/modules/erlang/worker.c b/modules/erlang/worker.c index 0bf1be80672..86ad3f9d5d9 100644 --- a/modules/erlang/worker.c +++ b/modules/erlang/worker.c @@ -44,6 +44,7 @@ int worker_init(worker_handler_t *phandler, int fd, const ei_cnode *ec) phandler->sockfd = fd; phandler->ec = *ec; phandler->next = NULL; + phandler->new = NULL; return 0; } diff --git a/modules/evapi/README b/modules/evapi/README index a8465ce6bf2..204d87bb24c 100644 --- a/modules/evapi/README +++ b/modules/evapi/README @@ -109,7 +109,7 @@ Chapter 1. Admin Guide The following libraries or applications must be installed before running Kamailio with this module loaded: - * libev - http://software.schmorp.de/pkg/libev + * libev - http://software.schmorp.de/pkg/libev.html 3. Parameters diff --git a/modules/evapi/doc/evapi_admin.xml b/modules/evapi/doc/evapi_admin.xml index 574adefae17..30fa61d841b 100644 --- a/modules/evapi/doc/evapi_admin.xml +++ b/modules/evapi/doc/evapi_admin.xml @@ -54,7 +54,7 @@ - libev - http://software.schmorp.de/pkg/libev + libev - http://software.schmorp.de/pkg/libev.html diff --git a/modules/evapi/evapi_dispatch.c b/modules/evapi/evapi_dispatch.c index 502809bdf9c..846d650aebe 100644 --- a/modules/evapi/evapi_dispatch.c +++ b/modules/evapi/evapi_dispatch.c @@ -221,6 +221,8 @@ int evapi_dispatch_notify(char *obuf, int olen) } } + LM_DBG("the message was sent to %d clients\n", n); + return n; } diff --git a/modules/evapi/evapi_mod.c b/modules/evapi/evapi_mod.c index 146c9d25559..ab4fa6fc348 100644 --- a/modules/evapi/evapi_mod.c +++ b/modules/evapi/evapi_mod.c @@ -51,6 +51,7 @@ static char *_evapi_bind_param = NULL; static int _evapi_netstring_format_param = 1; static tm_api_t tmb; +static int _evapi_dispatcher_pid = -1; static int mod_init(void); static int child_init(int); @@ -164,7 +165,9 @@ static int child_init(int rank) } if (rank!=PROC_MAIN) { - evapi_close_notify_sockets_parent(); + if(_evapi_dispatcher_pid!=getpid()) { + evapi_close_notify_sockets_parent(); + } return 0; } @@ -173,7 +176,13 @@ static int child_init(int rank) return -1; /* error */ if(pid==0) { /* child */ + _evapi_dispatcher_pid = getpid(); + /* do child init to allow execution of rpc like functions */ + if(init_child(PROC_RPC) < 0) { + LM_DBG("failed to do RPC child init for dispatcher\n"); + return -1; + } /* initialize the config framework */ if (cfg_child_init()) return -1; diff --git a/modules/exec/README b/modules/exec/README index b28278d01a7..2e9c2bcd2af 100644 --- a/modules/exec/README +++ b/modules/exec/README @@ -12,7 +12,7 @@ Edited by Jan Janak - Copyright 2003 FhG FOKUS + Copyright © 2003 FhG FOKUS __________________________________________________________________ Table of Contents @@ -40,8 +40,8 @@ Jan Janak List of Examples - 1.1. Set "setvars" parameter - 1.2. Set "time_to_kill" parameter + 1.1. Set “setvars” parameter + 1.2. Set “time_to_kill” parameter 1.3. exec_dset usage 1.4. exec_msg usage 1.5. exec_avp usage @@ -73,7 +73,7 @@ Chapter 1. Admin Guide The exec module allows external commands to be executed from a Kamailio script. The commands may be any valid shell commands--the command - string is passed to the shell using "popen" command. Kamailio passes + string is passed to the shell using “popen” command. Kamailio passes additional information about the request in environment variables: * SIP_HF_ contains value of each header field in request. If a header field occurred multiple times, values are concatenated and @@ -122,19 +122,19 @@ Chapter 1. Admin Guide Default value is 1. - Example 1.1. Set "setvars" parameter + Example 1.1. Set “setvars” parameter ... modparam("exec", "setvars", 1) ... -3.2. time_to_kill (integer) +3.2. time_to_kill (integer) Specifies the longest time a program is allowed to execute. If the time is exceeded, the program is killed. Default value is 0. - Example 1.2. Set "time_to_kill" parameter + Example 1.2. Set “time_to_kill” parameter ... modparam("exec", "time_to_kill", 20) ... @@ -145,7 +145,7 @@ modparam("exec", "time_to_kill", 20) 4.2. exec_msg(command) 4.3. exec_avp(command [, avplist]) -4.1. exec_dset(command) +4.1. exec_dset(command) Executes an external command. Current URI is passed to the command as parameter. Output of the command is considered URI set (separated by @@ -166,13 +166,13 @@ exec_dset("echo TEST > /tmp/test.txt"); exec_dset("echo TEST > /tmp/$rU.txt"); ... -4.2. exec_msg(command) +4.2. exec_msg(command) Executes an external command. The whole message is passed to it in input, no command-line parameters are added, output of the command is not processed. - The "examples" directory in the source tarball contains several + The “examples” directory in the source tarball contains several examples that shows how to use this function. Meaning of the parameters is as follows: @@ -190,7 +190,7 @@ exec_msg("echo TEST > /tmp/test.txt"); exec_msg("echo TEST > /tmp/$rU.txt"); ... -4.3. exec_avp(command [, avplist]) +4.3. exec_avp(command [, avplist]) Executes an external command. Each line from output of the command is saved in an AVP from 'avplist'. If 'avplist' is missing, the AVPs are diff --git a/modules/geoip2/geoip2_pv.c b/modules/geoip2/geoip2_pv.c index 69bd7199eb2..e239d962ae2 100644 --- a/modules/geoip2/geoip2_pv.c +++ b/modules/geoip2/geoip2_pv.c @@ -407,7 +407,11 @@ int pv_get_geoip2(struct sip_msg *msg, pv_param_t *param, return pv_get_null(msg, param, res); if(MMDB_get_value(&gpv->item->r.record.entry, &entry_data, "country","iso_code", NULL - ) != MMDB_SUCCESS) + ) != MMDB_SUCCESS + && MMDB_get_value(&gpv->item->r.record.entry, &entry_data, + "registered_country","iso_code", NULL + ) != MMDB_SUCCESS + ) return pv_get_null(msg, param, res); if(entry_data.has_data && entry_data.type == MMDB_DATA_TYPE_UTF8_STRING) { gpv->item->r.country.s = (char *)entry_data.utf8_string; diff --git a/modules/group/README b/modules/group/README index c0a27b12530..1570efe9424 100644 --- a/modules/group/README +++ b/modules/group/README @@ -12,7 +12,7 @@ Edited by Jan Janak - Copyright 2003 FhG FOKUS + Copyright © 2003 FhG FOKUS __________________________________________________________________ Table of Contents @@ -155,7 +155,7 @@ Chapter 1. Admin Guide URL of the database table to be used. - Default value is "mysql://kamailioro:kamailioro@localhost/kamailio". + Default value is “mysql://kamailioro:kamailioro@localhost/kamailio”. Example 1.1. Set db_url parameter ... @@ -167,7 +167,7 @@ modparam("group", "db_url", "dbdriver://username:password@dbhost/dbname") Name of the table holding strict definitions of groups and their members. - Default value is "grp". + Default value is “grp”. Example 1.2. Set table parameter ... @@ -176,9 +176,9 @@ modparam("group", "table", "grp_table") 3.3. user_column (string) - Name of the "table" column holding usernames. + Name of the “table” column holding usernames. - Default value is "username". + Default value is “username”. Example 1.3. Set user_column parameter ... @@ -187,9 +187,9 @@ modparam("group", "user_column", "user") 3.4. domain_column (string) - Name of the "table" column holding domains. + Name of the “table” column holding domains. - Default value is "domain". + Default value is “domain”. Example 1.4. Set domain_column parameter ... @@ -198,9 +198,9 @@ modparam("group", "domain_column", "realm") 3.5. group_column (string) - Name of the "table" column holding group names. + Name of the “table” column holding group names. - Default value is "grp". + Default value is “grp”. Example 1.5. Set group_column parameter ... @@ -226,7 +226,7 @@ modparam("group", "use_domain", 1) groups. If no table is defined, the regular-expression support is disabled. - Default value is "NULL". + Default value is “NULL”. Example 1.7. Set re_table parameter ... @@ -235,10 +235,10 @@ modparam("group", "re_table", "re_grp") 3.8. re_exp_column (string) - Name of the "re_table" column holding the regular expression used for + Name of the “re_table” column holding the regular expression used for user matching. - Default value is "reg_exp". + Default value is “reg_exp”. Example 1.8. Set re_exp_column parameter ... @@ -247,9 +247,9 @@ modparam("group", "re_exp_column", "re") 3.9. re_gid_column (string) - Name of the "re_table" column holding the group IDs. + Name of the “re_table” column holding the group IDs. - Default value is "group_id". + Default value is “group_id”. Example 1.9. Set re_gid_column parameter ... @@ -262,7 +262,7 @@ modparam("group", "re_gid_column", "grp_id") all group IDs that match the user; otherwise only the first will be returned. - Default value is "1" (enabled). + Default value is “1” (enabled). Example 1.10. Set multiple_gid parameter ... @@ -274,7 +274,7 @@ modparam("group", "multiple_gid", 0) 4.1. is_user_in(URI, group) 4.2. get_user_group(URI, AVP) -4.1. is_user_in(URI, group) +4.1. is_user_in(URI, group) This function is to be used for script group membership. The function returns true if username in the given URI is a member of the given @@ -301,7 +301,7 @@ if (is_user_in("Request-URI", "ld")) { }; ... -4.2. get_user_group(URI, AVP) +4.2. get_user_group(URI, AVP) This function is to be used for regular expression based group membership. The function returns true if username in the given URI diff --git a/modules/gzcompress/README b/modules/gzcompress/README index 0f9532d95ed..b5393fb1911 100644 --- a/modules/gzcompress/README +++ b/modules/gzcompress/README @@ -10,7 +10,7 @@ Daniel-Constantin Mierla - Copyright 2013 asipto.com + Copyright © 2013 asipto.com __________________________________________________________________ Table of Contents diff --git a/modules/htable/README b/modules/htable/README index 109a18254ee..a37fed09646 100644 --- a/modules/htable/README +++ b/modules/htable/README @@ -11,15 +11,19 @@ Elena-Ramona Modroiu +Edited by + Alex Balashov +Edited by + Ovidiu Sas - Copyright 2008-2011 http://www.asipto.com + Copyright © 2008-2011 http://www.asipto.com __________________________________________________________________ Table of Contents @@ -195,7 +199,7 @@ Chapter 1. Admin Guide You can read more about hash tables at: http://en.wikipedia.org/wiki/Hash_table. - The "name" can be a static string or can include pseudo- variables that + The “name” can be a static string or can include pseudo- variables that will be replaced at runtime. Example 1.1. Accessing $sht(htname=>key) @@ -209,7 +213,7 @@ $sht(a=>$ci::srcip) = $si; Next example shows a way to protect against dictionary attacks. If someone fails to authenticate 3 times, it is forbidden for 15min. Authenticatiion against database is expensive as it does a select on - the "subscriberthe" table. By disabling the DB auth for 15min, + the “subscriberthe” table. By disabling the DB auth for 15min, resources on the server are saved and time to discover the password is increased substantially. Additional alerting can be done by writing a message to syslog or sending email, etc. @@ -218,7 +222,7 @@ $sht(a=>$ci::srcip) = $si; the failed authentications per user and one for storing the time of last authentication attempt. To ensure a unique name per user, the hash table uses a combination of authentication username and text - "::auth_count" and "::last_auth". + “::auth_count” and “::last_auth”. Example 1.2. Dictionary attack limitation ... @@ -454,7 +458,7 @@ $ kamcmd htable.dump htable however, in which case this attribute can be set to 0. * dmqreplicate - if set to 1, any actions (set, update, delete etc.) performed upon entries in this table will be replicated to other - nodes (htable peers). Please note, module parameter "enable_dmq" + nodes (htable peers). Please note, module parameter “enable_dmq” must also be set in order for this to apply (see below). Default is 0 (no replication). @@ -631,7 +635,7 @@ modparam("htable", "timer_procs", 4) 4.8. sht_iterator_end(iname) 4.9. sht_iterator_next(iname) -4.1. sht_print() +4.1. sht_print() Dump content of hash table to L_ERR log level. Intended for debug purposes. @@ -644,7 +648,7 @@ modparam("htable", "timer_procs", 4) sht_print(); ... -4.2. sht_rm_name_re(htable=>regexp) +4.2. sht_rm_name_re(htable=>regexp) Delete all entries in the htable that match the name against regular expression. @@ -657,7 +661,7 @@ sht_print(); sht_rm_name_re("ha=>.*"); ... -4.3. sht_rm_value_re(htable=>regexp) +4.3. sht_rm_value_re(htable=>regexp) Delete all entries in the htable that match the value against regular expression. @@ -670,7 +674,7 @@ sht_rm_name_re("ha=>.*"); sht_rm_value_re("ha=>.*"); ... -4.4. sht_reset(htable) +4.4. sht_reset(htable) Delete all entries in the htable. The name of the hash table can be a dynamic string with variables. @@ -682,7 +686,7 @@ sht_rm_value_re("ha=>.*"); sht_reset("ha$var(x)"); ... -4.5. sht_lock(htable=>key) +4.5. sht_lock(htable=>key) Lock the slot in htable corespoding to the key item. Note that the locking is re-entrant for the process, therefore the lock and unlock @@ -695,7 +699,7 @@ sht_reset("ha$var(x)"); sht_lock("ha=>test"); ... -4.6. sht_unlock(htable=>key) +4.6. sht_unlock(htable=>key) Unlock the slot in htable corespoding to the key item. Note that the locking is re-entrant for the process, therefore the lock and unlock @@ -710,7 +714,7 @@ $sht(ha=>test) = $sht(ha=>test) + 10; sht_unlock("ha=>test"); ... -4.7. sht_iterator_start(iname, hname) +4.7. sht_iterator_start(iname, hname) Start an iterator for hash table named by the value of parameter hname. The parameter iname is used to identify the iterator. There can be up @@ -730,7 +734,7 @@ sht_unlock("ha=>test"); sht_iterator_start("i1", "h1"); ... -4.8. sht_iterator_end(iname) +4.8. sht_iterator_end(iname) Close the iterator identified by iname parameter and release the hash table slot aquired by the iterator. The iname value must be the same @@ -745,7 +749,7 @@ sht_iterator_start("i1", "h1"); sht_iterator_end("i1"); ... -4.9. sht_iterator_next(iname) +4.9. sht_iterator_next(iname) Move the iterator to the next item in hash table. It must be called also after sht_iterator_start() to get the first item in the hash @@ -778,7 +782,8 @@ sht_iterator_end("i1"); * $shtcn(htable=>key) * $shtcv(htable=>key) * $shtinc(htable=>key) - * $shtval(htable=>key) + * $shtitkey(iname) + * $shtitval(iname) * $shtrecord(attribute) Exported pseudo-variables are documented at @@ -790,7 +795,7 @@ sht_iterator_end("i1"); 6.2. sht_dump 6.3. sht_delete -6.1. sht_reload +6.1. sht_reload Reload a hash table from database. @@ -803,7 +808,7 @@ sht_iterator_end("i1"); _hash_table_name_ _empty_line_ -6.2. sht_dump +6.2. sht_dump Dump content of a hash table via MI. @@ -816,7 +821,7 @@ sht_iterator_end("i1"); _hash_table_name_ _empty_line_ -6.3. sht_delete +6.3. sht_delete Delete a key from a hash table via MI. @@ -846,7 +851,7 @@ sht_iterator_end("i1"); 7.7. htable.listTables 7.8. htable.stats -7.1. htable.get htable key +7.1. htable.get htable key Lists one value in a hash table @@ -865,7 +870,7 @@ kamcmd htable.get students daniel kamcmd htable.get students course[0] ... -7.2. htable.delete htable key +7.2. htable.delete htable key Delete one value in a hash table @@ -884,7 +889,7 @@ kamcmd htable.delete students anna kamcmd htable.delete students course[0] ... -7.3. htable.sets htable key value +7.3. htable.sets htable key value Set an item in hash table to string value. @@ -904,7 +909,7 @@ kamcmd htable.sets test x abc kamcmd htable.sets test x[0] abc ... -7.4. htable.seti htable key value +7.4. htable.seti htable key value Set an item in hash table to integer value. @@ -924,7 +929,7 @@ kamcmd htable.seti test x 123 kamcmd htable.sets test x[0] 123 ... -7.5. htable.dump htable +7.5. htable.dump htable Lists all the values in a hash table @@ -938,7 +943,7 @@ kamcmd htable.sets test x[0] 123 kamcmd htable.dump ipban ... -7.6. htable.reload htable +7.6. htable.reload htable Reload hash table from database. @@ -952,7 +957,7 @@ kamcmd htable.dump ipban kamcmd htable.reload ipban ... -7.7. htable.listTables +7.7. htable.listTables Lists all defined tables @@ -966,7 +971,7 @@ kamcmd htable.reload ipban kamcmd htable.listTables ... -7.8. htable.stats +7.8. htable.stats Get statistics for hash tables - name, number of slots, number of items, max number of items per slot, min number of items per slot. @@ -986,7 +991,7 @@ kamcmd htable.stats 8.1. htable:mod-init 8.2. htable:expired: -8.1. htable:mod-init +8.1. htable:mod-init When defined, the module calls event_route[htable:mod-init] after all modules have been initialized. A typical use case is to initialise @@ -999,7 +1004,7 @@ event_route[htable:mod-init] { } ... -8.2. htable:expired:
+8.2. htable:expired:
When defined, the module calls event_route[htable:expired:
] when an entry in the given table expires. In this event route, the key and diff --git a/modules/htable/api.c b/modules/htable/api.c index 1116a0dcadf..dcdfbeda2f4 100644 --- a/modules/htable/api.c +++ b/modules/htable/api.c @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ - + #include #include #include diff --git a/modules/htable/doc/htable_admin.xml b/modules/htable/doc/htable_admin.xml index 44873ac946b..3d077656943 100644 --- a/modules/htable/doc/htable_admin.xml +++ b/modules/htable/doc/htable_admin.xml @@ -913,7 +913,10 @@ sht_iterator_end("i1"); $shtinc(htable=>key) - $shtval(htable=>key) + $shtitkey(iname) + + + $shtitval(iname) $shtrecord(attribute) diff --git a/modules/htable/ht_api.c b/modules/htable/ht_api.c index f0ac4d2a191..b96ff135a6e 100644 --- a/modules/htable/ht_api.c +++ b/modules/htable/ht_api.c @@ -240,7 +240,7 @@ ht_t* ht_get_table(str *name) ht = _ht_root; while(ht!=NULL) { - if(htid == ht->htid && name->len==ht->name.len + if(htid == ht->htid && name->len==ht->name.len && strncmp(name->s, ht->name.s, name->len)==0) { LM_DBG("htable found [%.*s]\n", name->len, name->s); @@ -266,7 +266,7 @@ int ht_add_table(str *name, int autoexp, str *dbtable, str *dbcols, int size, ht = _ht_root; while(ht!=NULL) { - if(htid == ht->htid && name->len==ht->name.len + if(htid == ht->htid && name->len==ht->name.len && strncmp(name->s, ht->name.s, name->len)==0) { LM_ERR("htable already configured [%.*s]\n", name->len, name->s); @@ -461,7 +461,7 @@ int ht_set_cell(ht_t *ht, str *name, int type, int_str *val, int mode) return -1; hid = ht_compute_hash(name); - + idx = ht_get_entry(hid, ht->htsize); now = 0; @@ -477,7 +477,7 @@ int ht_set_cell(ht_t *ht, str *name, int type, int_str *val, int mode) } while(it!=NULL && it->cellid == hid) { - if(name->len==it->name.len + if(name->len==it->name.len && strncmp(name->s, it->name.s, name->len)==0) { /* update value */ @@ -491,7 +491,7 @@ int ht_set_cell(ht_t *ht, str *name, int type, int_str *val, int mode) it->value.s.len = val->s.len; memcpy(it->value.s.s, val->s.s, val->s.len); it->value.s.s[it->value.s.len] = '\0'; - + if(ht->updateexpire) it->expire = now + ht->htexpire; } else { @@ -602,20 +602,20 @@ int ht_del_cell(ht_t *ht, str *name) return -1; hid = ht_compute_hash(name); - + idx = ht_get_entry(hid, ht->htsize); /* head test and return */ if(ht->entries[idx].first==NULL) return 0; - + ht_slot_lock(ht, idx); it = ht->entries[idx].first; while(it!=NULL && it->cellid < hid) it = it->next; while(it!=NULL && it->cellid == hid) { - if(name->len==it->name.len + if(name->len==it->name.len && strncmp(name->s, it->name.s, name->len)==0) { /* found */ @@ -781,20 +781,20 @@ ht_cell_t* ht_cell_pkg_copy(ht_t *ht, str *name, ht_cell_t *old) return NULL; hid = ht_compute_hash(name); - + idx = ht_get_entry(hid, ht->htsize); /* head test and return */ if(ht->entries[idx].first==NULL) return NULL; - + ht_slot_lock(ht, idx); it = ht->entries[idx].first; while(it!=NULL && it->cellid < hid) it = it->next; while(it!=NULL && it->cellid == hid) { - if(name->len==it->name.len + if(name->len==it->name.len && strncmp(name->s, it->name.s, name->len)==0) { /* found */ @@ -938,12 +938,12 @@ int ht_table_spec(char *spec) if(str2int(&tok, &updateexpire) != 0) goto error; - LM_DBG("htable [%.*s] - updateexpire [%u]\n", name.len, name.s, updateexpire); + LM_DBG("htable [%.*s] - updateexpire [%u]\n", name.len, name.s, updateexpire); } else if(pit->name.len == 12 && strncmp(pit->name.s, "dmqreplicate", 12) == 0) { if(str2int(&tok, &dmqreplicate) != 0) goto error; - LM_DBG("htable [%.*s] - dmqreplicate [%u]\n", name.len, name.s, dmqreplicate); + LM_DBG("htable [%.*s] - dmqreplicate [%u]\n", name.len, name.s, dmqreplicate); } else { goto error; } } @@ -1129,7 +1129,7 @@ int ht_set_cell_expire(ht_t *ht, str *name, int type, int_str *val) return 0; hid = ht_compute_hash(name); - + idx = ht_get_entry(hid, ht->htsize); now = 0; @@ -1144,7 +1144,7 @@ int ht_set_cell_expire(ht_t *ht, str *name, int type, int_str *val) it = it->next; while(it!=NULL && it->cellid == hid) { - if(name->len==it->name.len + if(name->len==it->name.len && strncmp(name->s, it->name.s, name->len)==0) { /* update value */ @@ -1174,7 +1174,7 @@ int ht_get_cell_expire(ht_t *ht, str *name, unsigned int *val) return 0; hid = ht_compute_hash(name); - + idx = ht_get_entry(hid, ht->htsize); now = time(NULL); @@ -1184,7 +1184,7 @@ int ht_get_cell_expire(ht_t *ht, str *name, unsigned int *val) it = it->next; while(it!=NULL && it->cellid == hid) { - if(name->len==it->name.len + if(name->len==it->name.len && strncmp(name->s, it->name.s, name->len)==0) { /* update value */ @@ -1410,18 +1410,18 @@ int ht_count_cells_re(str *sre, ht_t *ht, int mode) cnt++; break; case 2: /* rlike */ - if(sval.len<=tval.len + if(sval.len<=tval.len && strncmp(sval.s, tval.s+tval.len-sval.len, sval.len)==0) cnt++; break; case 3: /* llike */ - if(sval.len<=tval.len + if(sval.len<=tval.len && strncmp(sval.s, tval.s, sval.len)==0) cnt++; break; case 4: /* str eq */ - if(sval.len==tval.len + if(sval.len==tval.len && strncmp(sval.s, tval.s, sval.len)==0) cnt++; break; diff --git a/modules/htable/ht_db.c b/modules/htable/ht_db.c index 701660f3734..e1ab7daa709 100644 --- a/modules/htable/ht_db.c +++ b/modules/htable/ht_db.c @@ -74,7 +74,7 @@ int ht_db_init_con(void) if (!DB_CAPABILITY(ht_dbf, DB_CAP_ALL)) { LM_ERR("database module does not " - "implement all functions needed by the module\n"); + "implement all functions needed by the module\n"); return -1; } return 0; @@ -89,10 +89,10 @@ int ht_db_open_con(void) ht_db_con = ht_dbf.init(&ht_db_url); if(ht_db_con==NULL) { - LM_ERR("failed to connect to the database\n"); + LM_ERR("failed to connect to the database\n"); return -1; } - + LM_DBG("database connection opened successfully\n"); return 0; } @@ -435,7 +435,7 @@ int ht_db_load_table(ht_t *ht, str *dbtable, int mode) goto error; } } - + if(ht_set_cell(ht, &hname, (vtype)?0:AVP_VAL_STR, &val, mode)) { LM_ERR("error adding to hash table\n"); @@ -451,7 +451,7 @@ int ht_db_load_table(ht_t *ht, str *dbtable, int mode) } } } - } + } if (DB_CAPABILITY(ht_dbf, DB_CAP_FETCH)) { if(ht_dbf.fetch_result(ht_db_con, &db_res, ht_fetch_rows)<0) { LM_ERR("Error while fetching!\n"); diff --git a/modules/htable/ht_dmq.c b/modules/htable/ht_dmq.c index 7fa29597512..975daf09bfb 100644 --- a/modules/htable/ht_dmq.c +++ b/modules/htable/ht_dmq.c @@ -1,5 +1,5 @@ /** - * + * * Copyright (C) 2013 Charles Chance (Sipcentric Ltd) * * This file is part of Kamailio, a free SIP server. @@ -14,8 +14,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -50,13 +50,13 @@ int ht_dmq_initialize() { dmq_peer_t not_peer; - /* load the DMQ API */ - if (dmq_load_api(&ht_dmqb)!=0) { - LM_ERR("cannot load dmq api\n"); - return -1; - } else { - LM_DBG("loaded dmq api\n"); - } + /* load the DMQ API */ + if (dmq_load_api(&ht_dmqb)!=0) { + LM_ERR("cannot load dmq api\n"); + return -1; + } else { + LM_DBG("loaded dmq api\n"); + } not_peer.callback = ht_dmq_handle_msg; not_peer.init_callback = NULL; @@ -76,14 +76,15 @@ int ht_dmq_initialize() return -1; } -int ht_dmq_broadcast(str* body) { - if (!ht_dmq_peer) { - LM_ERR("ht_dmq_peer is null!\n"); - return -1; - } - LM_DBG("sending broadcast...\n"); - ht_dmqb.bcast_message(ht_dmq_peer, body, 0, &ht_dmq_resp_callback, 1, &ht_dmq_content_type); - return 0; +int ht_dmq_broadcast(str* body) +{ + if (!ht_dmq_peer) { + LM_ERR("ht_dmq_peer is null!\n"); + return -1; + } + LM_DBG("sending broadcast...\n"); + ht_dmqb.bcast_message(ht_dmq_peer, body, 0, &ht_dmq_resp_callback, 1, &ht_dmq_content_type); + return 0; } /** @@ -102,7 +103,9 @@ int ht_dmq_handle_msg(struct sip_msg* msg, peer_reponse_t* resp, dmq_node_t* dmq /* received dmq message */ LM_DBG("dmq message received\n"); - + + srjson_InitDoc(&jdoc, NULL); + if(!msg->content_length) { LM_ERR("no content length header found\n"); goto invalid; @@ -122,9 +125,8 @@ int ht_dmq_handle_msg(struct sip_msg* msg, peer_reponse_t* resp, dmq_node_t* dmq } /* parse body */ - LM_DBG("body: %.*s\n", body.len, body.s); + LM_DBG("body: %.*s\n", body.len, body.s); - srjson_InitDoc(&jdoc, NULL); jdoc.buf = body; if(jdoc.root == NULL) { @@ -140,7 +142,7 @@ int ht_dmq_handle_msg(struct sip_msg* msg, peer_reponse_t* resp, dmq_node_t* dmq { LM_DBG("found field: %s\n", it->string); if (strcmp(it->string, "action")==0) { - action = it->valueint; + action = SRJSON_GET_INT(it); } else if (strcmp(it->string, "htname")==0) { htname.s = it->valuestring; htname.len = strlen(htname.s); @@ -148,19 +150,19 @@ int ht_dmq_handle_msg(struct sip_msg* msg, peer_reponse_t* resp, dmq_node_t* dmq cname.s = it->valuestring; cname.len = strlen(cname.s); } else if (strcmp(it->string, "type")==0) { - type = it->valueint; + type = SRJSON_GET_INT(it); } else if (strcmp(it->string, "strval")==0) { val.s.s = it->valuestring; val.s.len = strlen(val.s.s); } else if (strcmp(it->string, "intval")==0) { - val.n = it->valueint; + val.n = SRJSON_GET_INT(it); } else if (strcmp(it->string, "mode")==0) { - mode = it->valueint; + mode = SRJSON_GET_INT(it); } else { LM_ERR("unrecognized field in json object\n"); goto invalid; } - } + } if (ht_dmq_replay_action(action, &htname, &cname, type, &val, mode)!=0) { LM_ERR("failed to replay action\n"); @@ -181,7 +183,7 @@ int ht_dmq_handle_msg(struct sip_msg* msg, peer_reponse_t* resp, dmq_node_t* dmq error: srjson_DestroyDoc(&jdoc); resp->reason = dmq_500_rpl; - resp->resp_code = 500; + resp->resp_code = 500; return 0; } @@ -189,7 +191,7 @@ int ht_dmq_replicate_action(ht_dmq_action_t action, str* htname, str* cname, int srjson_doc_t jdoc; - LM_DBG("replicating action to dmq peers...\n"); + LM_DBG("replicating action to dmq peers...\n"); srjson_InitDoc(&jdoc, NULL); @@ -214,7 +216,7 @@ int ht_dmq_replicate_action(ht_dmq_action_t action, str* htname, str* cname, int } } - srjson_AddNumberToObject(&jdoc, jdoc.root, "mode", mode); + srjson_AddNumberToObject(&jdoc, jdoc.root, "mode", mode); jdoc.buf.s = srjson_PrintUnformatted(&jdoc, jdoc.root); if(jdoc.buf.s!=NULL) { @@ -251,7 +253,7 @@ int ht_dmq_replay_action(ht_dmq_action_t action, str* htname, str* cname, int ty return -1; } - LM_DBG("replaying action %d on %.*s=>%.*s...\n", action, htname->len, htname->s, cname->len, cname->s); + LM_DBG("replaying action %d on %.*s=>%.*s...\n", action, htname->len, htname->s, cname->len, cname->s); if (action==HT_DMQ_SET_CELL) { return ht_set_cell(ht, cname, type, val, mode); diff --git a/modules/htable/ht_var.c b/modules/htable/ht_var.c index 085d3c5c3d2..36cceb4fb95 100644 --- a/modules/htable/ht_var.c +++ b/modules/htable/ht_var.c @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ - + #include "ht_api.h" #include "ht_var.h" #include "ht_dmq.h" @@ -62,7 +62,7 @@ int pv_get_ht_cell(struct sip_msg *msg, pv_param_t *param, if(htc->flags&AVP_VAL_STR) return pv_get_strval(msg, param, res, &htc->value.s); - + /* integer */ return pv_get_sintval(msg, param, res, htc->value.n); } @@ -241,7 +241,7 @@ int pv_set_ht_cell_expire(struct sip_msg* msg, pv_param_t *param, } if (hpv->ht->dmqreplicate>0 && ht_dmq_replicate_action(HT_DMQ_SET_CELL_EXPIRE, &hpv->htname, &htname, 0, &isval, 0)!=0) { LM_ERR("dmq relication failed\n"); - } + } if(ht_set_cell_expire(hpv->ht, &htname, 0, &isval)!=0) { LM_ERR("cannot set $sht(%.*s)\n", htname.len, htname.s); @@ -271,7 +271,7 @@ int pv_get_ht_cn(struct sip_msg *msg, pv_param_t *param, LM_ERR("cannot get $sht name\n"); return -1; } - + cnt = ht_count_cells_re(&htname, hpv->ht, 0); /* integer */ @@ -298,7 +298,7 @@ int pv_get_ht_cv(struct sip_msg *msg, pv_param_t *param, LM_ERR("cannot get $sht name\n"); return -1; } - + cnt = ht_count_cells_re(&htname, hpv->ht, 1); /* integer */ @@ -344,7 +344,7 @@ int pv_get_ht_add(struct sip_msg *msg, pv_param_t *param, if (ht_dmq_replicate_action(HT_DMQ_SET_CELL, &hpv->htname, &htname, 0, &htc->value, 1)!=0) { LM_ERR("dmq relication failed\n"); } - } + } return pv_get_sintval(msg, param, res, htc->value.n); } @@ -363,7 +363,7 @@ int pv_get_ht_dec(struct sip_msg *msg, pv_param_t *param, int pv_parse_ht_expired_cell(pv_spec_t *sp, str *in) { if ((in->len != 3 || strncmp(in->s, "key", in->len) != 0) && - (in->len != 5 || strncmp(in->s, "value", in->len) != 0)) + (in->len != 5 || strncmp(in->s, "value", in->len) != 0)) { return -1; } diff --git a/modules/htable/htable.c b/modules/htable/htable.c index 80764f3c9b8..7ee49214f63 100644 --- a/modules/htable/htable.c +++ b/modules/htable/htable.c @@ -13,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -250,7 +250,7 @@ static int child_init(int rank) if (rank!=PROC_INIT) return 0; - + rt = route_get(&event_rt, "htable:mod-init"); if(rt>=0 && event_rt.rlist[rt]!=NULL) { LM_DBG("executing event_route[htable:mod-init] (%d)\n", rt); @@ -573,7 +573,7 @@ static struct mi_root* ht_mi_reload(struct mi_root* cmd_tree, void* param) if(ht_db_url.len<=0) return init_mi_tree(500, MI_ERR_RELOAD, MI_ERR_RELOAD_LEN); - + if(ht_db_init_con()!=0) return init_mi_tree(500, MI_ERR_RELOAD, MI_ERR_RELOAD_LEN); if(ht_db_open_con()!=0) @@ -884,7 +884,7 @@ static void htable_rpc_get(rpc_t* rpc, void* c) { goto error; } } - + error: /* Release the allocated memory */ ht_cell_pkg_free(htc); @@ -910,7 +910,7 @@ static void htable_rpc_sets(rpc_t* rpc, void* c) { rpc->fault(c, 500, "No such htable"); return; } - + if (ht->dmqreplicate>0 && ht_dmq_replicate_action(HT_DMQ_SET_CELL, &ht->name, &keyname, AVP_VAL_STR, &keyvalue, 1)!=0) { LM_ERR("dmq relication failed\n"); } @@ -948,7 +948,7 @@ static void htable_rpc_seti(rpc_t* rpc, void* c) { if (ht->dmqreplicate>0 && ht_dmq_replicate_action(HT_DMQ_SET_CELL, &ht->name, &keyname, 0, &keyvalue, 1)!=0) { LM_ERR("dmq relication failed\n"); } - + if(ht_set_cell(ht, &keyname, 0, &keyvalue, 1)!=0) { LM_ERR("cannot set $sht(%.*s=>%.*s)\n", htname.len, htname.s, diff --git a/modules/http_async_client/Makefile b/modules/http_async_client/Makefile index 8ebe26f6664..a9ae495cf27 100644 --- a/modules/http_async_client/Makefile +++ b/modules/http_async_client/Makefile @@ -5,24 +5,42 @@ include ../../Makefile.defs auto_gen= NAME=http_async_client.so -#ifeq ($(CROSS_COMPILE),) -#CURL_BUILDER=$(shell \ -# if pkg-config --exists libcurl; then \ -# echo 'pkg-config libcurl'; \ -# else \ -# which curl-config; \ -# fi) -#endif +ifeq ($(CROSS_COMPILE),) +CURL_BUILDER=$(shell \ + if pkg-config --exists libcurl; then \ + echo 'pkg-config libcurl'; \ + else \ + which curl-config; \ + fi) +endif ifneq ($(CURL_BUILDER),) - DEFS += $(shell $(CURL_BUILDER) --cflags) - LIBS += $(shell $(CURL_BUILDER) --libs) -else - DEFS+=-I$(LOCALBASE)/include -I$(SYSBASE)/include - LIBS+=-L$(LOCALBASE)/lib -L$(SYSBASE)/lib -lcurl -levent + CURLDEFS += $(shell $(CURL_BUILDER) --cflags) + CURLLIBS += $(shell $(CURL_BUILDER) --libs) +else + CURLDEFS+=-I$(LOCALBASE)/include -I$(SYSBASE)/include + CURLLIBS+=-L$(LOCALBASE)/lib -L$(SYSBASE)/lib -lcurl -levent +endif + +ifeq ($(CROSS_COMPILE),) +LEVENT_BUILDER = $(shell \ + if pkg-config --exists libevent; then \ + echo 'pkg-config libevent'; \ + fi) endif +ifeq ($(LEVENT_BUILDER),) + LEVENTDEFS=-I$(LOCALBASE)/include -I$(SYSBASE)/include + LEVENTLIBS=-L$(LOCALBASE)/lib -levent +else + LEVENTDEFS = $(shell $(LEVENT_BUILDER) --cflags) + LEVENTLIBS = $(shell $(LEVENT_BUILDER) --libs) +endif + +DEFS+=$(CURLDEFS) $(LEVENTDEFS) +LIBS=$(CURLLIBS) $(LEVENTLIBS) + DEFS+=-DKAMAILIO_MOD_INTERFACE SERLIBPATH=../../lib diff --git a/modules/http_async_client/README b/modules/http_async_client/README index e5131063a28..047d3c19847 100644 --- a/modules/http_async_client/README +++ b/modules/http_async_client/README @@ -263,7 +263,7 @@ modparam("http_async_client", "curl_verbose", 1) Choose the memory manager used by curl: * shm: curl will use kamailio's SHM pool and memory manager - * sys: curl will use the system memory amd memory manager (malloc, + * sys: curl will use the system memory and memory manager (malloc, free, ...) Note: if this module is used in conjunction with another module using diff --git a/modules/http_async_client/async_http.c b/modules/http_async_client/async_http.c index d1e9f6e3755..24dc8ba727e 100644 --- a/modules/http_async_client/async_http.c +++ b/modules/http_async_client/async_http.c @@ -94,6 +94,26 @@ int async_http_init_sockets(async_http_worker_t *worker) return 0; } +static inline char *strfindcasestrz(str *haystack, char *needlez) +{ + int i,j; + str needle; + + needle.s = needlez; + needle.len = strlen(needlez); + for(i=0;ilen-needle.len;i++) { + for(j=0;js[i+j]==needle.s[j]) || + ( isalpha((int)haystack->s[i+j]) + && ((haystack->s[i+j])^(needle.s[j]))==0x20 )) ) + break; + } + if (j==needle.len) + return haystack->s+i; + } + return 0; +} + void async_http_cb(struct http_m_reply *reply, void *param) { async_query_t *aq; @@ -101,6 +121,7 @@ void async_http_cb(struct http_m_reply *reply, void *param) unsigned int tindex; unsigned int tlabel; struct cell *t = NULL; + char *p; sip_msg_t *fmsg; if (reply->result != NULL) { @@ -119,6 +140,18 @@ void async_http_cb(struct http_m_reply *reply, void *param) ah_error.len = strlen(ah_error.s); } else { /* success */ + + /* check for HTTP Via header + * - HTTP Via format is different that SIP Via + * - workaround: replace with Hia to be ignored by SIP parser + */ + if((p=strfindcasestrz(reply->result, "\nVia:"))!=NULL) + { + p++; + *p = 'H'; + LM_DBG("replaced HTTP Via with Hia [[\n%.*s]]\n", reply->result->len, reply->result->s); + } + ah_reply->buf = reply->result->s; ah_reply->len = reply->result->len; diff --git a/modules/http_async_client/doc/http_async_client_admin.xml b/modules/http_async_client/doc/http_async_client_admin.xml index dd5b396bb9d..b3582c82a1b 100644 --- a/modules/http_async_client/doc/http_async_client_admin.xml +++ b/modules/http_async_client/doc/http_async_client_admin.xml @@ -209,7 +209,7 @@ modparam("http_async_client", "curl_verbose", 1) shm: curl will use kamailio's SHM pool and memory manager - sys: curl will use the system memory amd memory manager (malloc, free, ...) + sys: curl will use the system memory and memory manager (malloc, free, ...) diff --git a/modules/http_async_client/http_async_client_mod.c b/modules/http_async_client/http_async_client_mod.c index 0ea29235960..ddbd882520d 100644 --- a/modules/http_async_client/http_async_client_mod.c +++ b/modules/http_async_client/http_async_client_mod.c @@ -54,6 +54,7 @@ #include "../../modules/tm/tm_load.h" #include "../../modules/pv/pv_api.h" + #include "async_http.h" MODULE_VERSION @@ -227,6 +228,18 @@ struct module_exports exports = { }; +int mod_register(char *path, int *dlflags, void *p1, void *p2) +{ + pv_register_api_t pvra; + + pvra = (pv_register_api_t)find_export("pv_register_api", NO_SCRIPT, 0); + if (!pvra) { + LM_ERR("Cannot import pv functions (pv module must be loaded before this module)\n"); + return -1; + } + pvra(&pv_api); + return 0; +} /** * init module function @@ -234,7 +247,6 @@ struct module_exports exports = { static int mod_init(void) { unsigned int n; - pv_register_api_t pvra; LM_INFO("Initializing Http Async module\n"); #ifdef STATISTICS @@ -304,13 +316,6 @@ static int mod_init(void) memset(&tmb, 0, sizeof(tm_api_t)); } - pvra = (pv_register_api_t)find_export("pv_register_api", NO_SCRIPT, 0); - if (!pvra) { - LM_ERR("Cannot import pv functions (pv module must be loaded before this module)\n"); - return -1; - } - pvra(&pv_api); - /* allocate workers array */ workers = shm_malloc(num_workers * sizeof(*workers)); if(workers == NULL) { @@ -496,11 +501,7 @@ static int w_http_async_post(sip_msg_t *msg, char *query, char* post, char* rt) return -1; } - if(async_send_query(msg, &sdata, &post_data, act)<0) - return -1; - - /* force exit in config */ - return 0; + return async_send_query(msg, &sdata, &post_data, act); } #define _IVALUE_ERROR(NAME) LM_ERR("invalid parameter '" #NAME "' (must be a number)\n") diff --git a/modules/http_client/README b/modules/http_client/README index e1c6d5133be..fb8608095b5 100644 --- a/modules/http_client/README +++ b/modules/http_client/README @@ -48,8 +48,9 @@ Hugh Waite 3.9. verify_peer (int) 3.10. verify_host (int) 3.11. tlsversion (int) - 3.12. httpcon (string) - 3.13. config_file (string) + 3.12. authmethod (int) + 3.13. httpcon (string) + 3.14. config_file (string) 4. Functions @@ -92,11 +93,12 @@ Hugh Waite 1.9. Set verify_peer parameter 1.10. Set verify_host parameter 1.11. Set tlsversion parameter - 1.12. Set httpcon parameter - 1.13. Set config_file parameter - 1.14. Short http_client config file - 1.15. http_connect() usage - 1.16. curl_http_query() usage + 1.12. Set authmethod parameter + 1.13. Set httpcon parameter + 1.14. Set config_file parameter + 1.15. Short http_client config file + 1.16. http_connect() usage + 1.17. curl_http_query() usage Chapter 1. Admin Guide @@ -121,8 +123,9 @@ Chapter 1. Admin Guide 3.9. verify_peer (int) 3.10. verify_host (int) 3.11. tlsversion (int) - 3.12. httpcon (string) - 3.13. config_file (string) + 3.12. authmethod (int) + 3.13. httpcon (string) + 3.14. config_file (string) 4. Functions @@ -168,6 +171,12 @@ Chapter 1. Admin Guide and get access to parts of the reply. This function has been ported from the utils module and now use the same libcurl functions. + The http_client module use the CURL library setting up connections. The + CURL library by default use the system configured DNS resolvers, not + the Kamailio resolver. + + The module is limited to using HTTP and HTTPS protocols. + 2. Dependencies 2.1. Kamailio Modules @@ -198,17 +207,15 @@ Chapter 1. Admin Guide 3.9. verify_peer (int) 3.10. verify_host (int) 3.11. tlsversion (int) - 3.12. httpcon (string) - 3.13. config_file (string) + 3.12. authmethod (int) + 3.13. httpcon (string) + 3.14. config_file (string) 3.1. httpredirect (int) If set to 1, enabled, http_client will follow HTTP 302 Redirects. If set to 0, http_client will not follow redirects. Default is 1, enabled. - The latest redirect URL will be stored in the $curlredirect - pseudovariable. - Example 1.1. Set httpredirect parameter ... modparam("http_client", "httpredirect", 0) @@ -259,8 +266,7 @@ modparam("http_client", "connection_timeout", 2) Example 1.5. Set client_cert parameter ... -modparam("http_client", "client_cert", "/var/certs/sollentuna.example.com.cert" -) +modparam("http_client", "client_cert", "/var/certs/sollentuna.example.com.cert") ... 3.6. client_key (string) @@ -302,8 +308,8 @@ modparam("http_client", "cacert", "/var/certs/ca/edvina-sip-ca.pem") Example 1.8. Set cipher_suites parameter ... -modparam("http_client", "cipher_suites", "ecdhe_ecdsa_aes_128_gcm_sha_256,rsa_a -es_128_gcm_sha_256") +modparam("http_client", "cipher_suites", "ecdhe_ecdsa_aes_128_gcm_sha_256,rsa_ae +s_128_gcm_sha_256") ... 3.9. verify_peer (int) @@ -365,7 +371,28 @@ modparam("http_client", "verify_host", 2) modparam("http_client", "tlsversion", 6) ... -3.12. httpcon (string) +3.12. authmethod (int) + + Sets the preferred authentication mode for HTTP/HTTPS requests. The + value is a bitmap and multiple methods can be used. Note that in this + case, the CURL library will make an extra request to discover + server-supported authentication methods. You may want to use a specific + value. + + Valid values are: + * 1 - BASIC authentication + * 2 - HTTP Digest authentication + * 4 - GSS-Negotiate authentication + * 8 - NTLM authentication + * 16 - HTTP Digest with IE flavour + + Example 1.12. Set authmethod parameter +... +# Use the best of BASIC and Digest authentication. +modparam("http_client", "authmetod", 3) +... + +3.13. httpcon (string) Defines a connection and credentials for the connection for use in a connection-oriented function call in this module. @@ -402,17 +429,17 @@ modparam("http_client", "tlsversion", 6) * httpredirect Set to 1 for following HTTP 302 redirect. 0 to disable. Overrides the default httpredirect modparam. - Example 1.12. Set httpcon parameter + Example 1.13. Set httpcon parameter ... modparam("http_client", "httpcon", "apione=>http://atlanta.example.com") modparam("http_client", "httpcon", "apitwo=>http://atlanta.example.com/api/12") -modparam("http_client", "httpcon", "apithree=>http://annabella:mysecret@atlanta -.example.com/api/12") -modparam("http_client", "httpcon", "apifour=>http://stockholm.example.com/api/g -etstuff;timeout=12") +modparam("http_client", "httpcon", "apithree=>http://annabella:mysecret@atlanta. +example.com/api/12") +modparam("http_client", "httpcon", "apifour=>http://stockholm.example.com/api/ge +tstuff;timeout=12") ... -3.13. config_file (string) +3.14. config_file (string) The file name of a configuration file containing definitions of http connections. This is an alternative to the "httpcon" module parameter - @@ -460,12 +487,16 @@ etstuff;timeout=12") path and anything else a path relative to the directory of the current Kamailio main config file. - Example 1.13. Set config_file parameter + To set a string value to null, in order to override default settings, + you can specify an value of "" - two quotation marks. In order to + disable a http proxy setting you can set the port to zero. + + Example 1.14. Set config_file parameter ... modparam("http_client", "config_file", "httpconnections.cfg) ... - Example 1.14. Short http_client config file + Example 1.15. Short http_client config file [authapiserver] url = https://api.runbo.example.com/v4.2/auth timeout = 1 @@ -503,20 +534,20 @@ http_follow_redirect = no This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE, FAILURE_ROUTE, and BRANCH_ROUTE. - Example 1.15. http_connect() usage + Example 1.16. http_connect() usage ... modparam("http_client", "httpcon", "apiserver=>http://kamailio.org/api/"); ... # POST Request -$var(res) = http_connect("apiserver", "/mailbox", "application/json", "{ ok, {2 -00, ok}}", "$avp(gurka)"); -xlog("L_INFO", "API-server HTTP connection: $avp(gurka) Result code $var(res)\n -"); +$var(res) = http_connect("apiserver", "/mailbox", "application/json", "{ ok, {20 +0, ok}}", "$avp(gurka)"); +xlog("L_INFO", "API-server HTTP connection: $avp(gurka) Result code $var(res)\n" +); -$var(res) = http_connect("apiserver", "/callroute", "application/json", "$var(j -sondata)", "$avp(route)"); -xlog("L_INFO", "API-server HTTP connection: $avp(route) Result code $var(res)\n -"); +$var(res) = http_connect("apiserver", "/callroute", "application/json", "$var(js +ondata)", "$avp(route)"); +xlog("L_INFO", "API-server HTTP connection: $avp(route) Result code $var(res)\n" +); ... 4.2. http_client_query(url, [post-data], result) @@ -541,21 +572,21 @@ xlog("L_INFO", "API-server HTTP connection: $avp(route) Result code $var(res)\n utils module. It is changed to use the same base library and settings as the rest of the functions in this module. - Example 1.16. curl_http_query() usage + Example 1.17. curl_http_query() usage ... # GET-Request -http_client_query("http://tutpro.com/index.php?r_uri=$(ru{s.escape.param})&f_ur -i=$(fu{s.escape.param})", - "$var(result)") +http_client_query("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$( +fu{s.escape.param})", + "$var(result)"); switch ($retcode) { ... } ... ... # POST-Request -http_client_query("http://tutpro.com/index.php", "r_uri=$(ru{s.escape.param})&f -_uri=$(fu{s.escape.param})", - "$var(result)") +http_client_query("http://api.com/index.php", "r_uri=$(ru{s.escape.param})&f_uri +=$(fu{s.escape.param})", + "$var(result)"); switch ($retcode) { ... } diff --git a/modules/http_client/curlcon.c b/modules/http_client/curlcon.c index d5dca0af92d..b0eafb45533 100644 --- a/modules/http_client/curlcon.c +++ b/modules/http_client/curlcon.c @@ -58,12 +58,15 @@ typedef struct raw_http_client_conn str clientcert; str clientkey; str ciphersuites; + str http_proxy; + int http_proxy_port; int verify_peer; int verify_host; int tlsversion; int timeout; int maxdatasize; int http_follow_redirect; + int authmethod; struct raw_http_client_conn *next; } raw_http_client_conn_t; @@ -82,20 +85,23 @@ static cfg_option_t tls_versions[] = { }; static cfg_option_t http_client_options[] = { - {"url", .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM}, - {"username", .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM}, - {"password", .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM}, - {"failover", .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM}, - {"useragent", .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM}, - {"verify_peer", .f = cfg_parse_bool_opt}, - {"verify_host", .f = cfg_parse_bool_opt}, - {"client_cert", .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM}, - {"client_key", .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM}, - {"cipher_suites", .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM}, - {"tlsversion", .f = cfg_parse_enum_opt, .param = tls_versions}, - {"timeout", .f = cfg_parse_int_opt}, - {"maxdatasize", .f = cfg_parse_int_opt}, - {"httpredirect", .f = cfg_parse_bool_opt}, + {"url", .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM}, /* 0 */ + {"username", .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM}, /* 1 */ + {"password", .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM}, /* 2 */ + {"failover", .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM}, /* 3 */ + {"useragent", .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM}, /* 4 */ + {"verify_peer", .f = cfg_parse_bool_opt}, /* 5 */ + {"verify_host", .f = cfg_parse_bool_opt}, /* 6 */ + {"client_cert", .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM}, /* 7 */ + {"client_key", .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM}, /* 8 */ + {"cipher_suites", .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM}, /* 9 */ + {"tlsversion", .f = cfg_parse_enum_opt, .param = tls_versions}, /* 10 */ + {"timeout", .f = cfg_parse_int_opt}, /* 11 */ + {"maxdatasize", .f = cfg_parse_int_opt}, /* 12 */ + {"httpredirect", .f = cfg_parse_bool_opt}, /* 13 */ + {"httpproxy", .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM}, /* 14 */ + {"httpproxyport", .f = cfg_parse_int_opt}, /* 15 */ + {"authmethod", .f = cfg_parse_int_opt}, /* 16 */ {0} }; @@ -171,13 +177,16 @@ int curl_parse_param(char *val) str client_key = default_tls_clientkey; str ciphersuites = default_cipher_suite_list; str useragent = default_useragent; + str http_proxy = default_http_proxy; + unsigned int http_proxy_port = default_http_proxy_port; unsigned int maxdatasize = default_maxdatasize; unsigned int timeout = default_connection_timeout; unsigned int http_follow_redirect = default_http_follow_redirect; unsigned int verify_peer = default_tls_verify_peer; unsigned int verify_host = default_tls_verify_host; unsigned int tlsversion = default_tls_version; + unsigned int authmethod = default_authmethod; str in; char *p; @@ -185,8 +194,9 @@ int curl_parse_param(char *val) param_t *conparams = NULL; curl_con_t *cc = NULL; - LM_INFO("curl modparam parsing starting\n"); + LM_INFO("http_client modparam parsing starting\n"); LM_DBG("modparam httpcon: %s\n", val); + LM_DBG(" *** Default httproxy: %s\n", http_proxy.s); /* parse: name=>http_url*/ in.s = val; @@ -425,6 +435,7 @@ int curl_parse_param(char *val) cc->username = username.s ? as_asciiz(&username) : NULL; cc->password = password.s ? as_asciiz(&password) : NULL; cc->schema = schema; + cc->authmethod = authmethod; cc->failover = failover; cc->useragent = as_asciiz(&useragent); cc->url = url; @@ -436,13 +447,22 @@ int curl_parse_param(char *val) cc->verify_host = verify_host; cc->timeout = timeout; cc->maxdatasize = maxdatasize; + if (http_proxy_port > 0) { + cc->http_proxy_port = http_proxy_port; + cc->http_proxy = http_proxy.s ? as_asciiz(&http_proxy) : NULL; + LM_DBG("*** Setting HTTP proxy for connection to %s \n", cc->http_proxy); + } cc->http_follow_redirect = http_follow_redirect; LM_DBG("cname: [%.*s] url: [%.*s] username [%s] password [%s] failover [%.*s] timeout [%d] useragent [%s] maxdatasize [%d]\n", cc->name.len, cc->name.s, cc->url.len, cc->url.s, cc->username ? cc->username : "", cc->password ? cc->password : "", cc->failover.len, cc->failover.s, cc->timeout, cc->useragent, cc->maxdatasize); - LM_DBG("cname: [%.*s] client_cert [%s] client_key [%s] ciphersuites [%s] tlsversion [%d] verify_peer [%d] verify_host [%d]\n", - cc->name.len, cc->name.s, cc->clientcert, cc->clientkey, cc->ciphersuites, cc->tlsversion, cc->verify_peer, cc->verify_host); + LM_DBG("cname: [%.*s] client_cert [%s] client_key [%s] ciphersuites [%s] tlsversion [%d] verify_peer [%d] verify_host [%d] authmethod [%d]\n", + cc->name.len, cc->name.s, cc->clientcert, cc->clientkey, cc->ciphersuites, cc->tlsversion, cc->verify_peer, cc->verify_host, cc->authmethod); + if (cc->http_proxy_port > 0) { + LM_DBG("cname: [%.*s] http_proxy [%s] http_proxy_port [%d]\n", + cc->name.len, cc->name.s, cc->http_proxy, cc->http_proxy_port); + } return 0; @@ -501,16 +521,24 @@ int curl_parse_conn(void *param, cfg_parser_t *parser, unsigned int flags) if (default_cipher_suite_list.s != NULL) pkg_str_dup(&raw_cc->ciphersuites, &default_cipher_suite_list); pkg_str_dup(&raw_cc->useragent, &default_useragent); + if (default_http_proxy_port > 0) { + raw_cc->http_proxy_port = default_http_proxy_port; + if (default_http_proxy.s != NULL) { + pkg_str_dup(&raw_cc->http_proxy, &default_http_proxy); + } + } raw_cc->verify_peer = default_tls_verify_peer; raw_cc->verify_host = default_tls_verify_host; raw_cc->maxdatasize = default_maxdatasize; raw_cc->timeout = default_connection_timeout; raw_cc->http_follow_redirect = default_http_follow_redirect; raw_cc->tlsversion = default_tls_version; + raw_cc->authmethod = default_authmethod; for(i = 0; tls_versions[i].name; i++) { tls_versions[i].param = &raw_cc->tlsversion; } + /* Index from above structure (see top of file) */ http_client_options[0].param = &raw_cc->url; http_client_options[1].param = &raw_cc->username; http_client_options[2].param = &raw_cc->password; @@ -525,7 +553,9 @@ int curl_parse_conn(void *param, cfg_parser_t *parser, unsigned int flags) http_client_options[11].param = &raw_cc->timeout; http_client_options[12].param = &raw_cc->maxdatasize; http_client_options[13].param = &raw_cc->http_follow_redirect; - + http_client_options[14].param = &raw_cc->http_proxy; + http_client_options[15].param = &raw_cc->http_proxy_port; + http_client_options[16].param = &raw_cc->authmethod; cfg_set_options(parser, http_client_options); @@ -551,7 +581,7 @@ int fixup_raw_http_client_conn_list(void) schema.s = raw_cc->url.s; pos = schema.s; end = raw_cc->url.s + raw_cc->url.len; - while (pos != '\0' && (pos < end)) + while ((pos < end) && (*pos != '\0')) { if (*pos == ':') break; pos++; @@ -572,6 +602,7 @@ int fixup_raw_http_client_conn_list(void) cc->username = raw_cc->username.s ? as_asciiz(&raw_cc->username) : NULL; cc->password = raw_cc->password.s ? as_asciiz(&raw_cc->password) : NULL; + cc->authmethod = raw_cc->authmethod; if (raw_cc->failover.s != NULL) pkg_str_dup(&cc->failover, &raw_cc->failover); cc->useragent = as_asciiz(&raw_cc->useragent); @@ -583,6 +614,11 @@ int fixup_raw_http_client_conn_list(void) LM_WARN("curl connection [%.*s]: tlsversion %d unsupported value. Using default\n", cc->name.len, cc->name.s, cc->tlsversion); cc->tlsversion = default_tls_version; } + cc->http_proxy_port = raw_cc->http_proxy_port; + if (cc->http_proxy_port > 0 && raw_cc->http_proxy.s != NULL) { + cc->http_proxy = raw_cc->http_proxy.s ? as_asciiz(&raw_cc->http_proxy) : NULL; + } + cc->verify_peer = raw_cc->verify_peer; cc->verify_host = raw_cc->verify_host; cc->timeout = raw_cc->timeout; @@ -594,6 +630,10 @@ int fixup_raw_http_client_conn_list(void) cc->failover.len, cc->failover.s, cc->timeout, cc->useragent, cc->maxdatasize); LM_DBG("cname: [%.*s] client_cert [%s] client_key [%s] ciphersuites [%s] tlsversion [%d] verify_peer [%d] verify_host [%d]\n", cc->name.len, cc->name.s, cc->clientcert, cc->clientkey, cc->ciphersuites, cc->tlsversion, cc->verify_peer, cc->verify_host); + if (cc->http_proxy_port > 0) { + LM_DBG("cname: [%.*s] http_proxy [%s] http_proxy_port [%d]\n", + cc->name.len, cc->name.s, cc->http_proxy, cc->http_proxy_port); + } } done: @@ -609,6 +649,7 @@ int fixup_raw_http_client_conn_list(void) if (raw_cc->clientcert.s) pkg_free(raw_cc->clientcert.s); if (raw_cc->clientkey.s) pkg_free(raw_cc->clientkey.s); if (raw_cc->ciphersuites.s) pkg_free(raw_cc->ciphersuites.s); + if (raw_cc->http_proxy.s) pkg_free(raw_cc->http_proxy.s); pkg_free(raw_cc); raw_conn_list = raw_conn_list->next; } diff --git a/modules/http_client/doc/http_client_admin.xml b/modules/http_client/doc/http_client_admin.xml index 994baac4d12..db44d9d3950 100644 --- a/modules/http_client/doc/http_client_admin.xml +++ b/modules/http_client/doc/http_client_admin.xml @@ -43,6 +43,14 @@ been ported from the utils module and now use the same libcurl functions. + + The http_client module use the CURL library setting up connections. + The CURL library by default use the system configured DNS resolvers, + not the Kamailio resolver. + + + The module is limited to using HTTP and HTTPS protocols. +
Dependencies @@ -85,10 +93,6 @@ If set to 1, enabled, http_client will follow HTTP 302 Redirects. If set to 0, http_client will not follow redirects. Default is 1, enabled. - - The latest redirect URL will be stored in the $curlredirect - pseudovariable. - Set <varname>httpredirect</varname> parameter @@ -327,6 +331,34 @@ modparam("http_client", "verify_host", 2) ... modparam("http_client", "tlsversion", 6) +... + + +
+
+ <varname>authmethod</varname> (int) + + Sets the preferred authentication mode for HTTP/HTTPS requests. The value is a bitmap + and multiple methods can be used. Note that in this case, the CURL library will make an + extra request to discover server-supported authentication methods. You may want to use + a specific value. + + + Valid values are: + + 1 - BASIC authentication + 2 - HTTP Digest authentication + 4 - GSS-Negotiate authentication + 8 - NTLM authentication + 16 - HTTP Digest with IE flavour + + + + Set <varname>authmethod</varname> parameter + +... +# Use the best of BASIC and Digest authentication. +modparam("http_client", "authmetod", 3) ... @@ -465,6 +497,11 @@ modparam("http_client", "httpcon", "apifour=>http://stockholm.example.com/api/ge absolute path and anything else a path relative to the directory of the current &kamailio; main config file. + + To set a string value to null, in order to override default settings, + you can specify an value of "" - two quotation marks. In order to disable + a http proxy setting you can set the port to zero. + Set <varname>config_file</varname> parameter @@ -590,8 +627,8 @@ xlog("L_INFO", "API-server HTTP connection: $avp(route) Result code $var(res)\n" ... # GET-Request -http_client_query("http://tutpro.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu{s.escape.param})", - "$var(result)") +http_client_query("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu{s.escape.param})", + "$var(result)"); switch ($retcode) { ... } @@ -600,8 +637,8 @@ switch ($retcode) { ... # POST-Request -http_client_query("http://tutpro.com/index.php", "r_uri=$(ru{s.escape.param})&f_uri=$(fu{s.escape.param})", - "$var(result)") +http_client_query("http://api.com/index.php", "r_uri=$(ru{s.escape.param})&f_uri=$(fu{s.escape.param})", + "$var(result)"); switch ($retcode) { ... } @@ -635,7 +672,6 @@ switch ($retcode) { Parameters: No parameters -
diff --git a/modules/http_client/functions.c b/modules/http_client/functions.c index e5fe6bda559..c1305acd32a 100644 --- a/modules/http_client/functions.c +++ b/modules/http_client/functions.c @@ -55,6 +55,9 @@ typedef struct { char *clientkey; char *cacert; char *ciphersuites; + char *http_proxy; + unsigned int authmethod; + unsigned int http_proxy_port; unsigned int tlsversion; unsigned int verify_peer; unsigned int verify_host; @@ -153,7 +156,7 @@ static int curL_query_url(struct sip_msg* _m, const char* _url, str* _dst, const if (params->username) { res |= curl_easy_setopt(curl, CURLOPT_USERNAME, params->username); - res |= curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (CURLAUTH_DIGEST|CURLAUTH_BASIC)); + res |= curl_easy_setopt(curl, CURLOPT_HTTPAUTH, params->authmethod); } if (params->secret) { res |= curl_easy_setopt(curl, CURLOPT_PASSWORD, params->secret); @@ -180,6 +183,18 @@ static int curL_query_url(struct sip_msg* _m, const char* _url, str* _dst, const res |= curl_easy_setopt(curl, CURLOPT_SSL_CIPHER_LIST, params->ciphersuites); } + if (params->http_proxy != NULL) { + LM_DBG("****** ##### CURL proxy [%s] \n", params->http_proxy); + res |= curl_easy_setopt(curl, CURLOPT_PROXY, params->http_proxy); + } else { + LM_DBG("****** ##### CURL proxy NOT SET \n"); + } + + if (params->http_proxy_port > 0) { + res |= curl_easy_setopt(curl, CURLOPT_PROXYPORT, params->http_proxy_port); + } + + res |= curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, (long) params->verify_peer); res |= curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, (long) params->verify_host?2:0); @@ -191,6 +206,7 @@ static int curL_query_url(struct sip_msg* _m, const char* _url, str* _dst, const res |= curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_function); res |= curl_easy_setopt(curl, CURLOPT_WRITEDATA, &stream); + if (res != CURLE_OK) { /* PANIC */ LM_ERR("Could not set CURL options. Library error \n"); @@ -207,6 +223,8 @@ static int curL_query_url(struct sip_msg* _m, const char* _url, str* _dst, const LM_WARN("failed to connect() to host\n"); } else if ( res == CURLE_COULDNT_RESOLVE_HOST ) { LM_WARN("couldn't resolve host\n"); + } else if ( res == CURLE_COULDNT_RESOLVE_PROXY ) { + LM_WARN("couldn't resolve http_proxy host\n"); } else { LM_ERR("failed to perform curl (%d)\n", res); } @@ -353,6 +371,7 @@ int curl_con_query_url(struct sip_msg* _m, const str *connection, const str* url memset(&query_params, 0, sizeof(curl_query_t)); query_params.username = conn->username; query_params.secret = conn->password; + query_params.authmethod = conn->authmethod; query_params.contenttype = contenttype ? (char*)contenttype : "text/plain"; query_params.post = postdata; query_params.clientcert = conn->clientcert; @@ -366,6 +385,13 @@ int curl_con_query_url(struct sip_msg* _m, const str *connection, const str* url query_params.http_follow_redirect = conn->http_follow_redirect; query_params.oneline = 0; query_params.maxdatasize = maxdatasize; + query_params.http_proxy_port = conn->http_proxy_port; + if (conn->http_proxy) { + query_params.http_proxy = conn->http_proxy; + LM_DBG("****** ##### CURL proxy [%s] \n", query_params.http_proxy); + } else { + LM_DBG("**** Curl HTTP_proxy not set \n"); + } res = curL_query_url(_m, urlbuf, result, &query_params); @@ -394,6 +420,7 @@ int http_query(struct sip_msg* _m, char* _url, str* _dst, char* _post) memset(&query_params, 0, sizeof(curl_query_t)); query_params.username = NULL; query_params.secret = NULL; + query_params.authmethod = default_authmethod; query_params.contenttype = "text/plain"; query_params.post = _post; query_params.clientcert = NULL; @@ -407,6 +434,12 @@ int http_query(struct sip_msg* _m, char* _url, str* _dst, char* _post) query_params.http_follow_redirect = default_http_follow_redirect; query_params.oneline = 1; query_params.maxdatasize = 0; + if(default_http_proxy.s!=NULL && default_http_proxy.len>0) { + query_params.http_proxy = default_http_proxy.s; + if(default_http_proxy_port>0) { + query_params.http_proxy_port = default_http_proxy_port; + } + } res = curL_query_url(_m, _url, _dst, &query_params); diff --git a/modules/http_client/http_client.c b/modules/http_client/http_client.c index 4dd2b66b7f5..a5aa800ea08 100644 --- a/modules/http_client/http_client.c +++ b/modules/http_client/http_client.c @@ -80,11 +80,12 @@ str default_cipher_suite_list = STR_NULL; /*!< List of allowed cipher suites * unsigned int default_tls_version = 0; /*!< 0 = Use libcurl default */ unsigned int default_tls_verify_peer = 1; /*!< 0 = Do not verify TLS server cert. 1 = Verify TLS cert (default) */ unsigned int default_tls_verify_host = 2; /*!< 0 = Do not verify TLS server CN/SAN 2 = Verify TLS server CN/SAN (default) */ -char *default_http_proxy = NULL; /*!< Default HTTP proxy to use */ +str default_http_proxy = STR_NULL; /*!< Default HTTP proxy to use */ unsigned int default_http_proxy_port = 0; /*!< Default HTTP proxy port to use */ unsigned int default_http_follow_redirect = 0; /*!< Follow HTTP redirects CURLOPT_FOLLOWLOCATION */ str default_useragent = { CURL_USER_AGENT, CURL_USER_AGENT_LEN }; /*!< Default CURL useragent. Default "Kamailio Curl " */ unsigned int default_maxdatasize = 0; /*!< Default download size. 0=disabled */ +unsigned int default_authmethod = CURLAUTH_BASIC | CURLAUTH_DIGEST; /*!< authentication method - Basic, Digest or both */ str http_client_config_file = STR_NULL; @@ -116,8 +117,6 @@ static int w_curl_connect_post(struct sip_msg* _m, char* _con, char * _url, char static int curl_con_param(modparam_t type, void* val); static int pv_parse_curlerror(pv_spec_p sp, str *in); static int pv_get_curlerror(struct sip_msg *msg, pv_param_t *param, pv_value_t *res); -static int pv_parse_curlredirect(pv_spec_p sp, str *in); -static int pv_get_curlredirect(struct sip_msg *msg, pv_param_t *param, pv_value_t *res); /* Exported functions */ static cmd_export_t cmds[] = { @@ -134,13 +133,13 @@ static cmd_export_t cmds[] = { fixup_free_curl_connect_post, REQUEST_ROUTE|ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE}, {"bind_http_client", (cmd_function)bind_httpc_api, 0, 0, 0, 0}, + {0,0,0,0,0,0} }; /* Exported parameters */ static param_export_t params[] = { {"connection_timeout", PARAM_INT, &default_connection_timeout}, - {"httpcon", PARAM_STRING|USE_FUNC_PARAM, (void*)curl_con_param}, {"cacert", PARAM_STRING, &default_tls_cacert }, {"client_cert", PARAM_STR, &default_tls_clientcert }, {"client_key", PARAM_STR, &default_tls_clientkey }, @@ -149,11 +148,13 @@ static param_export_t params[] = { {"verify_peer", PARAM_INT, &default_tls_verify_peer }, {"verify_host", PARAM_INT, &default_tls_verify_host }, {"httpproxyport", PARAM_INT, &default_http_proxy_port }, - {"httpproxy", PARAM_STRING, &default_http_proxy}, + {"httpproxy", PARAM_STR, &default_http_proxy}, {"httpredirect", PARAM_INT, &default_http_follow_redirect }, {"useragent", PARAM_STR, &default_useragent }, {"maxdatasize", PARAM_INT, &default_maxdatasize }, {"config_file", PARAM_STR, &http_client_config_file }, + {"httpcon", PARAM_STRING|USE_FUNC_PARAM, (void*)curl_con_param}, + {"authmetod", PARAM_INT, &default_authmethod }, {0, 0, 0} }; @@ -165,9 +166,6 @@ static pv_export_t mod_pvs[] = { {{"curlerror", (sizeof("curlerror")-1)}, /* Curl error codes */ PVT_OTHER, pv_get_curlerror, 0, pv_parse_curlerror, 0, 0, 0}, - {{"curlredirect", (sizeof("redirect")-1)}, /* Curl error codes */ - PVT_OTHER, pv_get_curlredirect, 0, - pv_parse_curlredirect, 0, 0, 0}, {{0, 0}, 0, 0, 0, 0, 0, 0, 0} }; @@ -216,7 +214,7 @@ static void curl_counter_init() /* Module initialization function */ static int mod_init(void) { - + LM_DBG("init curl module\n"); /* Initialize curl */ @@ -271,7 +269,7 @@ static int mod_init(void) LM_DBG("**** init curl: Cipher Suites: %.*s \n", default_cipher_suite_list.len, default_cipher_suite_list.s); LM_DBG("**** init curl: SSL Version: %d \n", default_tls_version); LM_DBG("**** init curl: verifypeer: %d verifyhost: %d\n", default_tls_verify_peer, default_tls_verify_host); - LM_DBG("**** init curl: HTTP Proxy: %s Port %d\n", default_http_proxy, default_http_proxy_port); + LM_DBG("**** init curl: HTTP Proxy: %.*s Port %d\n", default_http_proxy.len, default_http_proxy.s, default_http_proxy_port); LM_DBG("Extra: Curl supports %s %s %s \n", (curl_info->features & CURL_VERSION_SSL ? "SSL" : ""), @@ -296,7 +294,7 @@ int curl_support_ipv6() /* Child initialization function */ static int child_init(int rank) -{ +{ if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN) { return 0; /* do nothing for the main process */ } @@ -370,7 +368,7 @@ static int fixup_free_http_query_get(void** param, int param_no) if (param_no == 2) { return fixup_free_pvar_null(param, 1); } - + LM_ERR("invalid parameter number <%d>\n", param_no); return -1; } @@ -408,8 +406,8 @@ static int fixup_curl_connect(void** param, int param_no) } /* - * Fix curl_connect params when posting (5 parameters): - * connection (string/pvar), url (string with pvars), content-type, + * Fix curl_connect params when posting (5 parameters): + * connection (string/pvar), url (string with pvars), content-type, * data (string/pvar, pvar) */ static int fixup_curl_connect_post(void** param, int param_no) @@ -456,7 +454,7 @@ static int fixup_free_curl_connect_post(void** param, int param_no) if (param_no == 5) { return fixup_free_pvar_null(param, 1); } - + LM_ERR("invalid parameter number <%d>\n", param_no); return -1; } @@ -477,7 +475,7 @@ static int fixup_free_curl_connect(void** param, int param_no) if (param_no == 3) { return fixup_free_pvar_null(param, 1); } - + LM_ERR("invalid parameter number <%d>\n", param_no); return -1; } @@ -518,7 +516,7 @@ static int w_curl_connect(struct sip_msg* _m, char* _con, char * _url, char* _re if (result.s != NULL) pkg_free(result.s); - return ret; + return (ret==0)?-1:ret; } /* @@ -560,7 +558,7 @@ static int w_curl_connect_post(struct sip_msg* _m, char* _con, char * _url, char if (result.s != NULL) pkg_free(result.s); - return ret; + return (ret==0)?-1:ret; } @@ -602,7 +600,7 @@ static int fixup_free_http_query_post(void** param, int param_no) if (param_no == 3) { return fixup_free_pvar_null(param, 1); } - + LM_ERR("invalid parameter number <%d>\n", param_no); return -1; } @@ -631,7 +629,7 @@ static int w_http_query(struct sip_msg* _m, char* _url, char* _result) { if (result.s != NULL) pkg_free(result.s); - return ret; + return (ret==0)?-1:ret; } @@ -663,7 +661,7 @@ static int w_http_query_post(struct sip_msg* _m, char* _url, char* _post, char* if (result.s != NULL) pkg_free(result.s); - return ret; + return (ret==0)?-1:ret; } /*! @@ -675,7 +673,7 @@ static int pv_parse_curlerror(pv_spec_p sp, str *in) if(sp==NULL || in==NULL || in->len<=0) return -1; - + cerr = atoi(in->s); LM_DBG(" =====> CURL ERROR %d \n", cerr); sp->pvp.pvn.u.isname.name.n = cerr; @@ -714,31 +712,3 @@ static int pv_get_curlerror(struct sip_msg *msg, pv_param_t *param, pv_value_t * return pv_get_strval(msg, param, res, &curlerr); } -/*! - * Parse arguments to pv $curlredirect - */ -static int pv_parse_curlredirect(pv_spec_p sp, str *in) -{ - if(sp==NULL || in==NULL || in->len<=0) { - return -1; - } - - // DO SOMETHING HERE - return 0; -} - -/* - * PV - return curl redirect URL for httpcon - * $curlredirect("httpcon"); - */ -static int pv_get_curlredirect(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) -{ - str redirecturl; - - if(param==NULL) { - return -1; - } - - // DO SOMETHING HERE - return pv_get_strval(msg, param, res, &redirecturl); -} diff --git a/modules/http_client/http_client.h b/modules/http_client/http_client.h index c4ebf92aa5a..f7abc5eaad0 100644 --- a/modules/http_client/http_client.h +++ b/modules/http_client/http_client.h @@ -43,11 +43,13 @@ extern str default_cipher_suite_list; /*!< List of allowed cipher suites */ extern unsigned int default_tls_version; /*!< 0 = Use libcurl default */ extern unsigned int default_tls_verify_peer; /*!< 0 = Do not verify TLS server cert. 1 = Verify TLS cert (default) */ extern unsigned int default_tls_verify_host; /*!< 0 = Do not verify TLS server CN/SAN. 2 = Verify TLS server CN/SAN (default) */ -extern char *default_http_proxy; /*!< Default HTTP proxy to use */ +extern str default_http_proxy; /*!< Default HTTP proxy to use */ extern unsigned int default_http_proxy_port; /*!< Default HTTP proxy port to use */ extern unsigned int default_http_follow_redirect; /*!< Follow HTTP redirects CURLOPT_FOLLOWLOCATION */ extern str default_useragent; /*!< Default CURL useragent. Default "Kamailio Curl " */ extern unsigned int default_maxdatasize; /*!< Default Maximum download size */ +extern unsigned int default_authmethod; /*!< authentication method - Basic, Digest or both */ + extern counter_handle_t connections; /* Number of connection definitions */ extern counter_handle_t connok; /* Successful Connection attempts */ @@ -71,6 +73,7 @@ typedef struct _curl_con str schema; /*!< The URL schema */ char *username; /*!< The username to use for auth */ char *password; /*!< The password to use for auth */ + unsigned int authmethod; /*!< Authentication method -digest or basic or both */ str failover; /*!< Another connection to use if this one fails */ char *useragent; /*!< Useragent to use for this connection */ char *cacert; /*!< File name of CA cert to use */ @@ -87,6 +90,8 @@ typedef struct _curl_con curl_res_stream_t *stream; /*!< Curl stream */ struct _curl_con *next; /*!< next connection */ char redirecturl[512]; /*!< Last redirect URL - to use for $curlredirect(curlcon) pv */ + char *http_proxy; /*!< HTTP proxy for this connection */ + unsigned int http_proxy_port; /*!< HTTP proxy port for this connection */ } curl_con_t; diff --git a/modules/imc/README b/modules/imc/README index c6220be6110..410e93a0eb8 100644 --- a/modules/imc/README +++ b/modules/imc/README @@ -14,7 +14,7 @@ Edited by Anca-Maria Vamanu - Copyright 2006 Voice Sistem SRL + Copyright © 2006 Voice Sistem SRL __________________________________________________________________ Table of Contents @@ -149,7 +149,7 @@ Chapter 1. Admin Guide The database url. - The default value is "mysql://kamailio:kamailiorw@localhost/kamailio". + The default value is “mysql://kamailio:kamailiorw@localhost/kamailio”. Example 1.1. Set db_url parameter ... diff --git a/modules/imc/imc_mng.c b/modules/imc/imc_mng.c index 2f3d6abf8b9..8ea8b589ffd 100644 --- a/modules/imc/imc_mng.c +++ b/modules/imc/imc_mng.c @@ -96,14 +96,15 @@ int imc_htable_destroy(void) for(i=0; inext; - imc_del_room(&irp->name, &irp->domain); - irp = irp_temp; - } + } + irp = _imc_htable[i].rooms; + while(irp){ + irp_temp = irp->next; + imc_del_room(&irp->name, &irp->domain); + irp = irp_temp; + } } shm_free(_imc_htable); _imc_htable = NULL; @@ -258,12 +259,14 @@ int imc_del_room(str* name, str* domain) && !strncasecmp(irp->name.s, name->s, name->len) && !strncasecmp(irp->domain.s, domain->s, domain->len)) { - if(irp->prev==NULL) + if(irp->prev==NULL) { _imc_htable[hidx].rooms = irp->next; - else + } else { irp->prev->next = irp->next; - if(irp->next!=NULL) + } + if(irp->next!=NULL) { irp->next->prev = irp->prev; + } /* delete members */ imp = irp->members; @@ -332,9 +335,9 @@ imc_member_p imc_add_member(imc_room_p room, str* user, str* domain, int flags) room->nr_of_members++; - if(room->members==NULL) + if(room->members==NULL) { room->members = imp; - else { + } else { imp->next = room->members->next; if((room->members)->next!=NULL) ((room->members)->next)->prev = imp; diff --git a/modules/ims_auth/README b/modules/ims_auth/README index 32b43716072..96695fe862d 100644 --- a/modules/ims_auth/README +++ b/modules/ims_auth/README @@ -15,9 +15,17 @@ Richard Good Smile Communications +Edited by + +Carsten Bock + + ng-voice GmbH + Copyright © 2007 FhG FOKUS Copyright © 2012 Smile Communications + + Copyright © 2015 ng-voice GmbH __________________________________________________________________ Table of Contents @@ -42,14 +50,20 @@ Richard Good 3.8. registration_qop (string) 3.9. cxdx_forced_peer (string) 3.10. cxdx_dest_realm (string) + 3.11. cxdx_dest_host (string) + 3.12. max_nonce_reuse (integer) + 3.13. add_authinfo_hdr (integer) + 3.14. ignore_failed_auth (integer) + 3.15. av_check_only_impu (integer) 4. Functions 4.1. ims_www_authorize(realm, table) - 4.2. ims_www_authenticate(realm, table) - 4.3. ims_www_challenge(realm, table) - 4.4. ims_proxy_challenge(realm, table) - 4.5. ims_proxy_authenticate(realm, table) + 4.2. ims_www_authenticate(realm) + 4.3. ims_www_challenge(route_block, realm) + 4.4. ims_www_challenge(route_block, realm, algorithm) + 4.5. ims_proxy_challenge(route_block, realm, table) + 4.6. ims_proxy_authenticate(realm, table) 5. Statistics @@ -65,12 +79,18 @@ Richard Good 1.5. av_request_at_once parameter usage 1.6. av_request_at_sync parameter usage 1.7. registration_default_algorithm parameter usage - 1.8. load_credentials parameter usage + 1.8. registration_qop parameter usage 1.9. cxdx_forced_peer parameter usage - 1.10. version_table parameter usage - 1.11. www_authorize usage - 1.12. proxy_authorize usage - 1.13. proxy_authorize usage + 1.10. cxdx_dest_realm parameter usage + 1.11. cxdx_dest_host parameter usage + 1.12. max_nonce_reuse parameter usage + 1.13. add_authinfo_hdr parameter usage + 1.14. ignore_failed_auth parameter usage + 1.15. av_check_only_impu parameter usage + 1.16. www_authorize usage + 1.17. ims_www_challenge usage + 1.18. ims_www_challenge usage + 1.19. proxy_authorize usage Chapter 1. Admin Guide @@ -94,14 +114,20 @@ Chapter 1. Admin Guide 3.8. registration_qop (string) 3.9. cxdx_forced_peer (string) 3.10. cxdx_dest_realm (string) + 3.11. cxdx_dest_host (string) + 3.12. max_nonce_reuse (integer) + 3.13. add_authinfo_hdr (integer) + 3.14. ignore_failed_auth (integer) + 3.15. av_check_only_impu (integer) 4. Functions 4.1. ims_www_authorize(realm, table) - 4.2. ims_www_authenticate(realm, table) - 4.3. ims_www_challenge(realm, table) - 4.4. ims_proxy_challenge(realm, table) - 4.5. ims_proxy_authenticate(realm, table) + 4.2. ims_www_authenticate(realm) + 4.3. ims_www_challenge(route_block, realm) + 4.4. ims_www_challenge(route_block, realm, algorithm) + 4.5. ims_proxy_challenge(route_block, realm, table) + 4.6. ims_proxy_authenticate(realm, table) 5. Statistics @@ -144,6 +170,11 @@ Chapter 1. Admin Guide 3.8. registration_qop (string) 3.9. cxdx_forced_peer (string) 3.10. cxdx_dest_realm (string) + 3.11. cxdx_dest_host (string) + 3.12. max_nonce_reuse (integer) + 3.13. add_authinfo_hdr (integer) + 3.14. ignore_failed_auth (integer) + 3.15. av_check_only_impu (integer) 3.1. name (string) @@ -237,14 +268,17 @@ modparam("ims_auth", "registration_default_algorithm", "HSS-Selected") Default value of this parameter is “auth,auth-int”. - Example 1.8. load_credentials parameter usage + Example 1.8. registration_qop parameter usage ... -modparam("ims_auth", "load_credentials", "auth-int") +modparam("ims_auth", "registration_qop", "auth-int") ... 3.9. cxdx_forced_peer (string) - FQDN of Diameter Peer (HSS) to use for communication (MAR) + FQDN of Diameter Peer (HSS) to use for communication (MAR). If you use + this, the routing defined in your diameter xml configuration file (CDP) + will be ignored and as a result you will lose the benefits of load + balancing and failover. Default value is “”. @@ -255,22 +289,88 @@ modparam("ims_auth", "cxdx_forced_peer", "hss.ims.smilecoms.com") 3.10. cxdx_dest_realm (string) - Destination realm to be used in Diameter messags to HSS + Destination realm to be used in Diameter messages to HSS Default value is “ims.smilecoms.com”. - Example 1.10. version_table parameter usage + Example 1.10. cxdx_dest_realm parameter usage ... modparam("ims_auth", "cxdx_dest_realm", "ims.smilecoms.com") ... +3.11. cxdx_dest_host (string) + + Destination Host to be used in Diameter-MAR messages to HSS + + Default value is “” (not set). + + Example 1.11. cxdx_dest_host parameter usage +... +modparam("ims_auth", "cxdx_dest_host", "hss.ims.ng-voice.com") +... + +3.12. max_nonce_reuse (integer) + + Defines, how many times a nonce can be reused (provided nc is + incremented) + + Default value is “0” (don't allow reuse). + + Example 1.12. max_nonce_reuse parameter usage +... +modparam("ims_auth", "max_nonce_reuse", 1) +... + +3.13. add_authinfo_hdr (integer) + + Should an Authentication-Info header be added on 200 OK responses? + + Default value is “1” (add Authentication-Info header). + + Example 1.13. add_authinfo_hdr parameter usage +... +modparam("ims_auth", "add_authinfo_hdr", 0) +... + +3.14. ignore_failed_auth (integer) + + Ignore invalid passwords (only IMPI/IMPU is checked). + + It should be used only for testing, e.g. load balancing with SIPP where + we don't want to worry about auth. + + Default value is “0” (don't ingnore the failed authentication). + + Example 1.14. ignore_failed_auth parameter usage +... +modparam("ims_auth", "ignore_failed_auth", 1) +... + +3.15. av_check_only_impu (integer) + + When storing the authentication vectors for an account, use either + IMPI/IMPU (=0, default) or IMPU (=1). + + In case the IMPI is different from the IMPU, this option needs to be + enabled to allow registration from classic "SIP-clients", such as Snom + phones and others, as they do not send an authentication username in + the first REGISTER. + + Default value is “0” (store authentication vectors based on IMPI/IMPU). + + Example 1.15. av_check_only_impu parameter usage +... +modparam("ims_auth", "av_check_only_impu", 1) +... + 4. Functions 4.1. ims_www_authorize(realm, table) - 4.2. ims_www_authenticate(realm, table) - 4.3. ims_www_challenge(realm, table) - 4.4. ims_proxy_challenge(realm, table) - 4.5. ims_proxy_authenticate(realm, table) + 4.2. ims_www_authenticate(realm) + 4.3. ims_www_challenge(route_block, realm) + 4.4. ims_www_challenge(route_block, realm, algorithm) + 4.5. ims_proxy_challenge(route_block, realm, table) + 4.6. ims_proxy_authenticate(realm, table) 4.1. ims_www_authorize(realm, table) @@ -301,20 +401,20 @@ modparam("ims_auth", "cxdx_dest_realm", "ims.smilecoms.com") This function can be used from REQUEST_ROUTE. - Example 1.11. www_authorize usage + Example 1.16. www_authorize usage ... if (!www_authorize("kamailio.org", "subscriber")) { - www_challenge("kamailio.org", "1"); + www_challenge(""REG_MAR_REPLY"", "kamailio.org", "1"); }; ... -4.2. ims_www_authenticate(realm, table) +4.2. ims_www_authenticate(realm) - It is same function as www_authenticate(realm, table). This name is + It is the same function as www_authenticate(realm, table). This name is kept for backward compatibility, since it was named this way first time by it actually does user authentication. -4.3. ims_www_challenge(realm, table) +4.3. ims_www_challenge(route_block, realm) Name alias: proxy_authorize(realm, table) @@ -328,6 +428,7 @@ if (!www_authorize("kamailio.org", "subscriber")) { Negative return codes have the same meaning as for www_authenticate(). Meaning of the parameters is as follows: + * Route block to resume after async MAR Diameter reply. * realm - Realm is a opaque string that the user agent should present to the user so he can decide what username and password to use. Usually this is domain of the host the server is running on. @@ -336,19 +437,77 @@ if (!www_authorize("kamailio.org", "subscriber")) { If an empty string “” is used then the server will generate it from the request. From header field domain will be used as realm. The string may contain pseudo variables. - * table - Table to be used to lookup usernames and passwords (usually - subscribers table). This function can be used from REQUEST_ROUTE. - Example 1.12. proxy_authorize usage + Example 1.17. ims_www_challenge usage ... if (!proxy_authorize("$fd", "subscriber)) { - proxy_challenge("$fd", "1"); # Realm will be autogenerated + proxy_challenge(""REG_MAR_REPLY","$fd"); # Realm will be autogenerated }; ... + ... +route[REG_MAR_REPLY] +{ + #this is async so to know status we have to check the reply avp + xlog("L_DBG","maa_return code is $avp(s:maa_return_code)\n"); + + switch ($avp(s:maa_return_code)){ + case 1: #success + xlog("L_DBG", "MAR success - 401/407 response sent from mod +ule\n"); + break; + case -1: #failure + xlog("L_ERR", "MAR failure - error response sent from modul +e\n"); + break; + case -2: #error + xlog("L_ERR", "MAR error - sending error response now\n"); + t_reply("500", "MAR failed"); + break; + default: + xlog("L_ERR", "Unknown return code from MAR, value is [$avp +(s:uaa_return_code)]\n"); + t_reply("500", "Unknown response code from MAR"); + break; + } + exit; +} + +4.4. ims_www_challenge(route_block, realm, algorithm) + + Same as 4.3 except here there is the addiional option to specify the + authorisation algorithm + * algorithm - The algorithm to be used when challenging the client. + Can be AKAv1-MD5, AKAv2-MD5, MD5, or HSS-Selected. If left as an + empty string, the default algorithm will be chosen according to the + parameter registration_default_algorithm (see section 3.7) -4.4. ims_proxy_challenge(realm, table) + This function can be used from REQUEST_ROUTE. + + Example 1.18. ims_www_challenge usage +... + if (!ims_www_authenticate(NETWORKNAME)) { + #user has not been authenticated. Lets send a challenge via 401 +Unauthorized + if ($? == -2) { + t_reply("403", "Authentication Failed"); + exit; + } else if ($? == -3) { + t_reply("400", "Bad Request"); + exit; + } else if ($? == -9) { + xlog("L_DBG", "Authentication re-sync requested\n"); + ims_www_resync_auth("REG_RESYNC_REPLY", "$td"); + exit; + } else { + xlog("L_DBG","About to challenge! auth_ims\n"); + ims_www_challenge("REG_MAR_REPLY", "$td", "MD5"); + exit; + } + } + +4.5. ims_proxy_challenge(route_block, realm, table) Name alias: proxy_authorize(realm, table) @@ -362,6 +521,7 @@ if (!proxy_authorize("$fd", "subscriber)) { Negative return codes have the same meaning as for www_authenticate(). Meaning of the parameters is as follows: + * Route block to resume after async MAR Diameter reply. * realm - Realm is a opaque string that the user agent should present to the user so he can decide what username and password to use. Usually this is domain of the host the server is running on. @@ -375,14 +535,42 @@ if (!proxy_authorize("$fd", "subscriber)) { This function can be used from REQUEST_ROUTE. - Example 1.13. proxy_authorize usage + Example 1.19. proxy_authorize usage ... if (!proxy_authorize("$fd", "subscriber)) { - proxy_challenge("$fd", "1"); # Realm will be autogenerated + proxy_challenge("REG_MAR_REPLY","$fd", "1"); # Realm will be autogenera +ted }; ... +route[REG_MAR_REPLY] +{ + #this is async so to know status we have to check the reply avp + xlog("L_DBG","maa_return code is $avp(s:maa_return_code)\n"); + + switch ($avp(s:maa_return_code)){ + case 1: #success + xlog("L_DBG", "MAR success - 401/407 response sent from mod +ule\n"); + break; + case -1: #failure + xlog("L_ERR", "MAR failure - error response sent from modul +e\n"); + break; + case -2: #error + xlog("L_ERR", "MAR error - sending error response now\n"); + t_reply("500", "MAR failed"); + break; + default: + xlog("L_ERR", "Unknown return code from MAR, value is [$avp +(s:uaa_return_code)]\n"); + t_reply("500", "Unknown response code from MAR"); + break; + } + exit; +} +... -4.5. ims_proxy_authenticate(realm, table) +4.6. ims_proxy_authenticate(realm, table) It is same function as proxy_authenticate(realm, table). This name is kept for backward compatibility, since it was named this way first time diff --git a/modules/ims_charging/README b/modules/ims_charging/README index a93f9330edf..66a69fd69d3 100644 --- a/modules/ims_charging/README +++ b/modules/ims_charging/README @@ -15,9 +15,9 @@ Carlos Ruiz Diaz ng-voice GmbH - Copyright 2013 Smile Communications + Copyright © 2013 Smile Communications - Copyright 2013 ng-voice GmbH + Copyright © 2013 ng-voice GmbH __________________________________________________________________ Table of Contents diff --git a/modules/ims_dialog/README b/modules/ims_dialog/README index 4e2a5f4cc5a..94ef2daa4d5 100644 --- a/modules/ims_dialog/README +++ b/modules/ims_dialog/README @@ -20,15 +20,21 @@ Edited by Bogdan-Andrei Iancu +Edited by + Carsten Bock +Edited by + Jason Penton +Edited by + Richard Good - Copyright 2006 Voice Sistem SRL + Copyright © 2006 Voice Sistem SRL - Copyright 2011-2013 Carsten Bock, http://www.ng-voice.com + Copyright © 2011-2013 Carsten Bock, http://www.ng-voice.com __________________________________________________________________ Table of Contents @@ -261,14 +267,14 @@ Chapter 1. Admin Guide 2. How it works To create the dialog associated to an initial request, the flag - "dlg_flag" ( Section 5.4, " dlg_flag (integer) ") must be set before + “dlg_flag” ( Section 5.4, “ dlg_flag (integer) ”) must be set before creating the corresponding transaction. - The dialog is automatically destroyed when a "BYE" is received. In case - of no "BYE", the dialog lifetime is controlled via the default timeout - (see "default_timeout" - Section 5.6, " default_timeout (integer) ") - and custom timeout (see "timeout_avp" - Section 5.5, " timeout_avp - (string) "). The dialog timeout is reset each time a sequential request + The dialog is automatically destroyed when a “BYE” is received. In case + of no “BYE”, the dialog lifetime is controlled via the default timeout + (see “default_timeout” - Section 5.6, “ default_timeout (integer) ”) + and custom timeout (see “timeout_avp” - Section 5.5, “ timeout_avp + (string) ”). The dialog timeout is reset each time a sequential request passes. 3. Dialog profiling @@ -333,12 +339,12 @@ Chapter 1. Admin Guide 5.17. bridge_controller (string) 5.18. initial_cbs_inscript (string) -5.1. enable_stats (integer) +5.1. enable_stats (integer) This function is currently not supported by the ims_dialog module. To be incorporated in the future. -5.2. hash_size (integer) +5.2. hash_size (integer) The size of the hash table internally used to keep the dialogs. A larger table is much faster but consumes more memory. The hash size @@ -349,78 +355,78 @@ Chapter 1. Admin Guide not take place. If you really want to modify the hash_size you must delete all table's rows before restarting the server. - Default value is "4096". + Default value is “4096”. Example 1.1. Set hash_size parameter ... modparam("ims_dialog", "hash_size", 1024) ... -5.3. rr_param (string) +5.3. rr_param (string) Name of the Record-Route parameter to be added with the dialog cookie. It is used for the fast dialog matching of sequential requests. - Default value is "did". + Default value is “did”. Example 1.2. Set rr_param parameter ... modparam("ims_dialog", "rr_param", "xyz") ... -5.4. dlg_flag (integer) +5.4. dlg_flag (integer) Flag to be used for marking if a dialog should be constructed for the current request (this make sense only for initial requests). - Default value is "none". + Default value is “none”. Example 1.3. Set dlg_flag parameter ... modparam("ims_dialog", "dlg_flag", 4) ... -5.5. timeout_avp (string) +5.5. timeout_avp (string) The specification of an AVP that contain a custom timeout (in seconds) for the dialog. It may be used only in a request (initial or sequential) context - Default value is "none". + Default value is “none”. Example 1.4. Set timeout_avp parameter ... modparam("ims_dialog", "timeout_avp", "$avp(i:10)") ... -5.6. default_timeout (integer) +5.6. default_timeout (integer) The default dialog timeout (in seconds) if no custom one is set. - Default value is "43200 (12 hours)". + Default value is “43200 (12 hours)”. Example 1.5. Set default_timeout parameter ... modparam("ims_dialog", "default_timeout", 21600) ... -5.7. dlg_extra_hdrs (string) +5.7. dlg_extra_hdrs (string) A string containing the extra headers (full format, with EOH) to be added in the requests generated by the module (like BYEs). - Default value is "NULL". + Default value is “NULL”. Example 1.6. Set dlf_extra_hdrs parameter ... modparam("ims_dialog", "dlg_extra_hdrs", "Hint: credit expired\r\n") ... -5.8. dlg_match_mode (integer) +5.8. dlg_match_mode (integer) Deprecated - in the new dialog module we always match using DID ONLY -5.9. detect_spirals (integer) +5.9. detect_spirals (integer) Whether spirals (i.e., messages routed through the proxy multiple times) should be detected or not. @@ -437,60 +443,60 @@ modparam("ims_dialog", "dlg_extra_hdrs", "Hint: credit expired\r\n") modparam("ims_dialog", "detect_spirals", 1) ... -5.10. db_url (string) +5.10. db_url (string) Db storage not yet supported by ims_dialog - this to be done in future. -5.11. db_mode (integer) +5.11. db_mode (integer) Db storage not yet supported by ims_dialog - this to be done in future. -5.12. db_update_period (integer) +5.12. db_update_period (integer) Db storage not yet supported by ims_dialog - this to be done in future. -5.13. db_fetch_rows (integer) +5.13. db_fetch_rows (integer) Db storage not yet supported by ims_dialog - this to be done in future. -5.14. table_name (string) +5.14. table_name (string) Db storage not yet supported by ims_dialog - this to be done in future. -5.15. profiles_with_value (string) +5.15. profiles_with_value (string) List of names for profiles with values. - Default value is "empty". + Default value is “empty”. Example 1.8. Set profiles_with_value parameter ... modparam("dialog", "profiles_with_value", "caller ; my_profile") ... -5.16. profiles_no_value (string) +5.16. profiles_no_value (string) List of names for profiles without values. - Default value is "empty". + Default value is “empty”. Example 1.9. Set profiles_no_value parameter ... modparam("dialog", "profiles_no_value", "inbound ; outbound") ... -5.17. bridge_controller (string) +5.17. bridge_controller (string) SIP address to be used in From header when initiating a call bridge. - Default value is "sip:controller@kamailio.org". + Default value is “sip:controller@kamailio.org”. Example 1.10. Set bridge_controller parameter ... modparam("dialog", "bridge_controller", "sip:ctd@kamailio.org") ... -5.18. initial_cbs_inscript (string) +5.18. initial_cbs_inscript (string) This has been deprecated since dlg_manage has been removed. @@ -510,7 +516,7 @@ modparam("dialog", "bridge_controller", "sip:ctd@kamailio.org") 6.12. dlg_get(callid, ftag, ttag) 6.13. is_known_dlg() -6.1. set_dlg_profile(profile,[value]) +6.1. set_dlg_profile(profile,[value]) Inserts the current dialog into a profile. Note that if the profile does not supports values, this will be silently discarded. Also, there @@ -526,13 +532,13 @@ modparam("dialog", "bridge_controller", "sip:ctd@kamailio.org") This function can be used from REQUEST_ROUTE, BRANCH_ROUTE, REPLY_ROUTE and FAILURE_ROUTE. - Example 1.11. set_dlg_profile usage + Example 1.11. set_dlg_profile usage ... set_dlg_profile("inbound_call"); set_dlg_profile("caller","$fu"); ... -6.2. unset_dlg_profile(profile,[value]) +6.2. unset_dlg_profile(profile,[value]) Removes the current dialog from a profile. @@ -545,13 +551,13 @@ set_dlg_profile("caller","$fu"); This function can be used from BRANCH_ROUTE, REPLY_ROUTE and FAILURE_ROUTE. - Example 1.12. unset_dlg_profile usage + Example 1.12. unset_dlg_profile usage ... unset_dlg_profile("inbound_call"); unset_dlg_profile("caller","$fu"); ... -6.3. is_in_profile(profile,[value]) +6.3. is_in_profile(profile,[value]) Checks if the current dialog belongs to a profile. If the profile supports values, the check can be reinforced to take into account a @@ -568,7 +574,7 @@ unset_dlg_profile("caller","$fu"); This function can be used from REQUEST_ROUTE, BRANCH_ROUTE, REPLY_ROUTE and FAILURE_ROUTE. - Example 1.13. is_in_profile usage + Example 1.13. is_in_profile usage ... if (is_in_profile("inbound_call")) { log("this request belongs to a inbound call\n"); @@ -579,7 +585,7 @@ if (is_in_profile("caller","XX")) { } ... -6.4. get_profile_size(profile,[value],size) +6.4. get_profile_size(profile,[value],size) Returns the number of dialogs belonging to a profile. If the profile supports values, the check can be reinforced to take into account a @@ -597,7 +603,7 @@ if (is_in_profile("caller","XX")) { This function can be used from REQUEST_ROUTE, BRANCH_ROUTE, REPLY_ROUTE and FAILURE_ROUTE. - Example 1.14. get_profile_size usage + Example 1.14. get_profile_size usage ... if(get_profile_size("inbound_call","$avp(size)")) xlog("currently there are $avp(size) inbound calls\n"); @@ -606,7 +612,7 @@ if(get_profile_size("caller","$fu","$avp(size)")) xlog("currently, the user $fu has $avp(size) active outgoing calls\n"); ... -6.5. dlg_isflagset(flag) +6.5. dlg_isflagset(flag) Check if the dialog flag is set or not. @@ -616,7 +622,7 @@ if(get_profile_size("caller","$fu","$avp(size)")) This function can be used from BRANCH_ROUTE, REQUEST_ROUTE, ONREPLY_ROUTE and FAILURE_ROUTE. - Example 1.15. dlg_isflagset usage + Example 1.15. dlg_isflagset usage ... if(dlg_isflagset("1")) { @@ -624,7 +630,7 @@ if(dlg_isflagset("1")) } ... -6.6. dlg_setflag(flag) +6.6. dlg_setflag(flag) Set the dialog flag. @@ -634,12 +640,12 @@ if(dlg_isflagset("1")) This function can be used from BRANCH_ROUTE, REQUEST_ROUTE, ONREPLY_ROUTE and FAILURE_ROUTE. - Example 1.16. dlg_setflag usage + Example 1.16. dlg_setflag usage ... dlg_setflag("1"); ... -6.7. dlg_resetflag(flag) +6.7. dlg_resetflag(flag) Reset the dialog flag. @@ -649,12 +655,12 @@ dlg_setflag("1"); This function can be used from BRANCH_ROUTE, REQUEST_ROUTE, ONREPLY_ROUTE and FAILURE_ROUTE. - Example 1.17. dlg_resetflag usage + Example 1.17. dlg_resetflag usage ... redlg_setflag("1"); ... -6.8. dlg_terminate +6.8. dlg_terminate Terminates a dialog. In ims_dialog module this function now includes support for early as well as confirmed dialogs. @@ -667,28 +673,28 @@ redlg_setflag("1"); This function can be used from BRANCH_ROUTE, REQUEST_ROUTE, ONREPLY_ROUTE and FAILURE_ROUTE. - Example 1.18. dlg_terminate usage + Example 1.18. dlg_terminate usage ... dlg_terminate("all", "Insufficient QoS"); ... -6.9. dlg_refer(side, address) +6.9. dlg_refer(side, address) This function is currently not supported by the ims_dialog module. To be incorporated in the future. -6.10. dlg_manage() +6.10. dlg_manage() This has been deprecated in ims_dialog. Instead set dialog flag for initial INVITE and Route-parameter-callback execution for within-dialog requests. -6.11. dlg_bridge(from, to, op) +6.11. dlg_bridge(from, to, op) This function is currently not supported by the ims_dialog module. To be incorporated in the future. -6.12. dlg_get(callid, ftag, ttag) +6.12. dlg_get(callid, ftag, ttag) Search and set current dialog based on Call-ID, From-Tag and To-Tag parameters. @@ -709,7 +715,7 @@ if(dlg_get("abcdef", "123", "456")) } ... -6.13. is_known_dlg() +6.13. is_known_dlg() This function is currently not supported by the ims_dialog module. To be incorporated in the future. @@ -722,27 +728,27 @@ if(dlg_get("abcdef", "123", "456")) 7.4. expired_dialogs 7.5. failed_dialogs -7.1. active_dialogs +7.1. active_dialogs This function is currently not supported by the ims_dialog module. To be incorporated in the future. -7.2. early_dialogs +7.2. early_dialogs This function is currently not supported by the ims_dialog module. To be incorporated in the future. -7.3. processed_dialogs +7.3. processed_dialogs This function is currently not supported by the ims_dialog module. To be incorporated in the future. -7.4. expired_dialogs +7.4. expired_dialogs This function is currently not supported by the ims_dialog module. To be incorporated in the future. -7.5. failed_dialogs +7.5. failed_dialogs This function is currently not supported by the ims_dialog module. To be incorporated in the future. @@ -757,7 +763,7 @@ if(dlg_get("abcdef", "123", "456")) 8.6. profile_list_dlgs 8.7. dlg_bridge -8.1. dlg_list +8.1. dlg_list Lists the description of a dialog or of all dialogs (calls). If only one dialogs is to be listed, the dialog identifiers are to be passed as @@ -781,17 +787,17 @@ if(dlg_get("abcdef", "123", "456")) abcdrssfrs122444@192.168.1.1 AAdfeEFF33 -8.2. dlg_list_ctx +8.2. dlg_list_ctx This function is currently not supported by the ims_dialog module. To be incorporated in the future. -8.3. dlg_end_dlg +8.3. dlg_end_dlg This function is currently not supported by the ims_dialog module. To be incorporated in the future. -8.4. dlg_terminate_dlg +8.4. dlg_terminate_dlg Terminates a singe dialog, identified by the call_id, ftag, ttag. In ims_dialog module this dialog can be terminated in the early or @@ -811,17 +817,17 @@ if(dlg_get("abcdef", "123", "456")) abcdrssfrs122444@192.168.1.1 AAdfeEFF33 ftag-1234 t-tag1234 -8.5. profile_get_size +8.5. profile_get_size This function is currently not supported by the ims_dialog module. To be incorporated in the future. -8.6. profile_list_dlgs +8.6. profile_list_dlgs This function is currently not supported by the ims_dialog module. To be incorporated in the future. -8.7. dlg_bridge +8.7. dlg_bridge This function is currently not supported by the ims_dialog module. To be incorporated in the future. @@ -837,42 +843,42 @@ if(dlg_get("abcdef", "123", "456")) 9.7. dlg.profile_list 9.8. dlg.bridge_dlg -9.1. dlg.list +9.1. dlg.list This function is currently not supported by the ims_dialog module. To be incorporated in the future. -9.2. dlg.list_ctx +9.2. dlg.list_ctx This function is currently not supported by the ims_dialog module. To be incorporated in the future. -9.3. dlg.dlg_list +9.3. dlg.dlg_list This function is currently not supported by the ims_dialog module. To be incorporated in the future. -9.4. dlg.dlg_list_ctx +9.4. dlg.dlg_list_ctx This function is currently not supported by the ims_dialog module. To be incorporated in the future. -9.5. dlg.end_dlg +9.5. dlg.end_dlg This function is currently not supported by the ims_dialog module. To be incorporated in the future. -9.6. dlg.profile_get_size +9.6. dlg.profile_get_size This function is currently not supported by the ims_dialog module. To be incorporated in the future. -9.7. dlg.profile_list +9.7. dlg.profile_list This function is currently not supported by the ims_dialog module. To be incorporated in the future. -9.8. dlg.bridge_dlg +9.8. dlg.bridge_dlg This function is currently not supported by the ims_dialog module. To be incorporated in the future. @@ -886,32 +892,32 @@ if(dlg_get("abcdef", "123", "456")) 10.5. $dlg_ctx(...) 10.6. $dlg_var(key) -10.1. $DLG_count +10.1. $DLG_count This function is currently not supported by the ims_dialog module. To be incorporated in the future. -10.2. $DLG_status +10.2. $DLG_status This function is currently not supported by the ims_dialog module. To be incorporated in the future. -10.3. $DLG_lifetime +10.3. $DLG_lifetime This function is currently not supported by the ims_dialog module. To be incorporated in the future. -10.4. $dlg(...) +10.4. $dlg(...) This function is currently not supported by the ims_dialog module. To be incorporated in the future. -10.5. $dlg_ctx(...) +10.5. $dlg_ctx(...) This function is currently not supported by the ims_dialog module. To be incorporated in the future. -10.6. $dlg_var(key) +10.6. $dlg_var(key) This function is currently not supported by the ims_dialog module. To be incorporated in the future. @@ -942,7 +948,7 @@ Chapter 2. Developer Guide 1.5. get_dlg_var (dlg, key) 1.6. get_current_dialog () -1.1. register_dlgcb (dialog, type, cb, param, free_param_cb) +1.1. register_dlgcb (dialog, type, cb, param, free_param_cb) Register a new callback to the dialog. @@ -984,14 +990,14 @@ Chapter 2. Developer Guide + DLGCB_SPIRALED - called when the dialog matches a spiraling request - it's a per dialog type. + DLGCB_DESTROY - * dialog_cb cb - callback function to be called. Prototype is: "void + * dialog_cb cb - callback function to be called. Prototype is: “void (dialog_cb) (struct dlg_cell* dlg, int type, struct dlg_cb_params * - params); " + params); ” * void *param - parameter to be passed to the callback function. * param_free callback_param_free - callback function to be called to - free the param. Prototype is: "void (param_free_cb) (void *param);" + free the param. Prototype is: “void (param_free_cb) (void *param);” -1.2. terminate_dlg (str callid, str ftag, str ttag, hdrs) +1.2. terminate_dlg (str callid, str ftag, str ttag, hdrs) Terminate a Dialog identified by callid, ftag and ttag in early or confirmed state. @@ -1003,7 +1009,7 @@ Chapter 2. Developer Guide * str* hdrs - string containg extra headers (full format) to be added to the BYE requests of the dialog. -1.3. lookup_terminate_dlg (unsigned int h_entry, unsigned int h_id, hdrs) +1.3. lookup_terminate_dlg (unsigned int h_entry, unsigned int h_id, hdrs) Terminate a Dialog identified by h_entry and h_id (similar to dlg_end_dlg command via XMLRPC). @@ -1016,7 +1022,7 @@ Chapter 2. Developer Guide * str* hdrs - string containg extra headers (full format) to be added to the BYE requests of the dialog. -1.4. set_dlg_var (dlg, key, val) +1.4. set_dlg_var (dlg, key, val) Add a variable to the dialog structure @@ -1025,7 +1031,7 @@ Chapter 2. Developer Guide * str* key - Name of the variable. * str* val - Value of the variable. -1.5. get_dlg_var (dlg, key) +1.5. get_dlg_var (dlg, key) Retrieves a variable attached to the dialog structure @@ -1033,13 +1039,13 @@ Chapter 2. Developer Guide * struct dlg_cell* dlg - dialog to get the variable from. * str* key - Name of the variable. -1.6. get_current_dialog () +1.6. get_current_dialog () Get the current dialog for a message, if exists Chapter 3. Frequently Asked Questions - 3.1. What happend with "use_tight_match" parameter? + 3.1. What happend with “use_tight_match” parameter? 3.2. Why is there a ims_dialog module and a dialog module? 3.3. Where can I find more about Kamailio? 3.4. Where can I post a question about this module? @@ -1047,49 +1053,49 @@ Chapter 3. Frequently Asked Questions 3.1. - What happend with "use_tight_match" parameter? + What happend with “use_tight_match” parameter? - The parameter was removed with version 1.3 as the option of tight - matching became mandatory and not configurable. Now, the tight matching - is done all the time (when using DID matching). + The parameter was removed with version 1.3 as the option of tight + matching became mandatory and not configurable. Now, the tight matching + is done all the time (when using DID matching). 3.2. - Why is there a ims_dialog module and a dialog module? + Why is there a ims_dialog module and a dialog module? - The ims_dialog module addresses shortcomings in the intial dialog - module design. It makes some large changes to the API and therefore - must be introduced slowly. It is currently in the early development - stages. Eventually the ims_dialog module should replace the dialog - module. + The ims_dialog module addresses shortcomings in the intial dialog + module design. It makes some large changes to the API and therefore + must be introduced slowly. It is currently in the early development + stages. Eventually the ims_dialog module should replace the dialog + module. 3.3. - Where can I find more about Kamailio? + Where can I find more about Kamailio? - Take a look at http://www.kamailio.org/. + Take a look at http://www.kamailio.org/. 3.4. - Where can I post a question about this module? + Where can I post a question about this module? - First at all check if your question was already answered on one of our - mailing lists: - * User Mailing List - - http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users - * Developer Mailing List - - http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev + First at all check if your question was already answered on one of our + mailing lists: + * User Mailing List - + http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users + * Developer Mailing List - + http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev - E-mails regarding any stable Kamailio release should be sent to - and e-mails regarding development - versions should be sent to . + E-mails regarding any stable Kamailio release should be sent to + and e-mails regarding development + versions should be sent to . - If you want to keep the mail private, send it to - . + If you want to keep the mail private, send it to + . 3.5. - How can I report a bug? + How can I report a bug? - Please follow the guidelines provided at: - http://sip-router.org/tracker. + Please follow the guidelines provided at: + https://github.com/kamailio/kamailio/issues. diff --git a/modules/ims_dialog/dlg_hash.c b/modules/ims_dialog/dlg_hash.c index 26817aca9dc..cc6db50c3a7 100644 --- a/modules/ims_dialog/dlg_hash.c +++ b/modules/ims_dialog/dlg_hash.c @@ -671,7 +671,7 @@ void dlg_remove_dlg_out(struct dlg_cell_out *dlg_out_do_not_remove, struct dlg_c LM_DBG("This is the dlg_out not to be removed!\n"); } else { //check if this the last entry in the entry_table - if ((d_entry_out->first == d_entry_out->last)) { + if (d_entry_out->first == d_entry_out->last) { //we shouldnt ever get here LM_DBG("This is the last dlg_out_entry in the dlg_entries_out\n"); //this is the last then set entry_out-> first and entry_out->last to zero diff --git a/modules/ims_icscf/README b/modules/ims_icscf/README index 06154d85c3a..926a5648123 100644 --- a/modules/ims_icscf/README +++ b/modules/ims_icscf/README @@ -37,13 +37,17 @@ Richard Good 3.3. scscf_entry_expiry (integer) 3.4. cxdx_forced_peer (string) 3.5. cxdx_dest_realm (string) + 3.6. use_preferred_scscf_uri (int) + 3.7. preferred_scscf_uri (string) 4. Functions 4.1. I_scscf_select(initial) 4.2. I_scscf_drop() - 4.3. I_perform_user_authorization_request(capabalities) - 4.4. I_perform_location_information_request() + 4.3. I_perform_user_authorization_request(route_block, + capabalities) + + 4.4. I_perform_location_information_request(route_block) 5. Statistics @@ -58,11 +62,13 @@ Richard Good 1.2. route_uar_user_unknown parameter usage 1.3. scscf_entry_expiry parameter usage 1.4. cxdx_forced_peer parameter usage - 1.5. version_table parameter usage - 1.6. I_scscf_select usage - 1.7. I_scscf_drop usage - 1.8. I_perform_user_authorization_request usage - 1.9. proxy_authorize usage + 1.5. cxdx_dest_realm parameter usage + 1.6. use_preferred_scscf_uri parameter usage + 1.7. preferred_scscf_uri parameter usage + 1.8. I_scscf_select usage + 1.9. I_scscf_drop usage + 1.10. I_perform_user_authorization_request usage + 1.11. I_perform_location_information_request Chapter 1. Admin Guide @@ -81,13 +87,17 @@ Chapter 1. Admin Guide 3.3. scscf_entry_expiry (integer) 3.4. cxdx_forced_peer (string) 3.5. cxdx_dest_realm (string) + 3.6. use_preferred_scscf_uri (int) + 3.7. preferred_scscf_uri (string) 4. Functions 4.1. I_scscf_select(initial) 4.2. I_scscf_drop() - 4.3. I_perform_user_authorization_request(capabalities) - 4.4. I_perform_location_information_request() + 4.3. I_perform_user_authorization_request(route_block, + capabalities) + + 4.4. I_perform_location_information_request(route_block) 5. Statistics @@ -124,6 +134,8 @@ Chapter 1. Admin Guide 3.3. scscf_entry_expiry (integer) 3.4. cxdx_forced_peer (string) 3.5. cxdx_dest_realm (string) + 3.6. use_preferred_scscf_uri (int) + 3.7. preferred_scscf_uri (string) 3.1. route_lir_user_unknown (string) @@ -163,7 +175,10 @@ modparam("ims_icscf","scscf_entry_expiry", 300) 3.4. cxdx_forced_peer (string) - FQDN of Diameter Peer (HSS) to use for communication (MAR) + FQDN of Diameter Peer (HSS) to use for communication (UAR, LIR). If you + use this, the routing defined in your diameter xml configuration file + (CDP) will be ignored and as a result you will lose the benefits of + load balancing and failover. Default value is "". @@ -178,17 +193,42 @@ modparam("ims_icscf", "cxdx_forced_peer", "hss.ims.smilecoms.com") Default value is "ims.smilecoms.com". - Example 1.5. version_table parameter usage + Example 1.5. cxdx_dest_realm parameter usage ... modparam("ims_icscf", "cxdx_dest_realm", "ims.smilecoms.com") ... +3.6. use_preferred_scscf_uri (int) + + Whether or not this ICSCF has a preferred S-CSCF to use when the HSS + returns a list of SCSCFs. 0 means this I-CSCF has no preferred SCSCF. 1 + means it has a preferred S-CSCF. + + Default value is 0. + + Example 1.6. use_preferred_scscf_uri parameter usage +... +modparam("ims_icscf", "use_preferred_scscf_uri", 1) +... + +3.7. preferred_scscf_uri (string) + + If use_preferred_scscf_uri is set then this is the URI of the preferred + SCSCF. + + Default value is "". + + Example 1.7. preferred_scscf_uri parameter usage +... +modparam("ims_icscf", "preferred_scscf_uri", "sip:scscf.ims.smilecoms.com:6060") +... + 4. Functions 4.1. I_scscf_select(initial) 4.2. I_scscf_drop() - 4.3. I_perform_user_authorization_request(capabalities) - 4.4. I_perform_location_information_request() + 4.3. I_perform_user_authorization_request(route_block, capabalities) + 4.4. I_perform_location_information_request(route_block) 4.1. I_scscf_select(initial) @@ -203,7 +243,7 @@ modparam("ims_icscf", "cxdx_dest_realm", "ims.smilecoms.com") This function can be used from REQUEST_ROUTE | FAILURE_ROUTE. - Example 1.6. I_scscf_select usage + Example 1.8. I_scscf_select usage ... if (I_scscf_select("0")) { #there is an S-CSCF list - no need to do a UAR @@ -220,19 +260,20 @@ if (I_scscf_select("0")) { This function can be used from REQUEST_ROUTE | FAILURE_ROUTE | REPLY_ROUTE - Example 1.7. I_scscf_drop usage + Example 1.9. I_scscf_drop usage ... I_scscf_drop(); ... . -4.3. I_perform_user_authorization_request(capabalities) +4.3. I_perform_user_authorization_request(route_block, capabalities) Perform a UAR on Diameter CXDX interface. This function will build a list of SCSCFs to be used and populate the SCSCF list for the request. On a succesful return of this message you can get the next available SCSCF by using the I_scscf_select functoin in 4.1. + * Route block to resume after async UAR Diameter reply. * capabilities - whether to request capabilities or not "1" - with capabilities, "0" - no capabilities. @@ -241,49 +282,86 @@ I_scscf_drop(); p.s. this is executed asynchronously. See example on how to retrieve return value - Example 1.8. I_perform_user_authorization_request usage + Example 1.10. I_perform_user_authorization_request usage +... +I_perform_user_authorization_request("REG_UAR_REPLY","0"); #0=REG/DEREG; 1=REG+C +apabilities +exit; ... - I_perform_user_authorization_request("0"); #0=REG/DEREG; 1=REG+Capab -ilities - #this is async so to know status we have to check the reply avp - switch ($avp(s:uaa_return_code)){ - case 1: #success +route[REG_UAR_REPLY] +{ + #this is async so to know status we have to check the reply avp + switch ($avp(s:uaa_return_code)){ + case 1: #success if (I_scscf_select("0")){ - t_on_failure("register_failure"); - t_on_reply("register_reply"); - if (!t_relay()) { - t_reply("500", "Error forwarding to SCSCF"); - } + t_on_failure("register_failure"); + t_on_reply("register_reply"); + #now relay to appropriate SCSCF + if (!t_relay()) { + t_reply("500", "Error forwarding to SCSCF"); + } } else {#select failed - I_scscf_drop(); - t_reply("500", "Server error on SCSCF Select (UAR)"); + I_scscf_drop(); + t_reply("500", "Server error on SCSCF Select (UAR)") +; } break; - case -1: #failure + case -1: #failure xlog("L_ERR", "UAR failure - error response sent from module -"); +\n"); break; - case -2: #error - xlog("L_ERR", "UAR error - sending error response now"); + case -2: #error + xlog("L_ERR", "UAR error - sending error response now\n"); t_reply("500", "UAR failed"); break; - default: + default: xlog("L_ERR", "Unknown return code from UAR, value is [$avp( -s:uaa_return_code)]"); +s:uaa_return_code)]\n"); t_reply("500", "Unknown response code from UAR"); break; - } + } +} ... -4.4. I_perform_location_information_request() +4.4. I_perform_location_information_request(route_block) + + Perform a LIR on Diameter CXDX interface. + * Route block to resume after async LIR Diameter reply. This function can be used from REQUEST_ROUTE. - Example 1.9. proxy_authorize usage + p.s. this is executed asynchronously. See example on how to retrieve + return value + + Example 1.11. I_perform_location_information_request +... +I_perform_location_information_request("SESSION_LIR_REPLY","0"); +exit; ... -if (!proxy_authorize("$fd", "subscriber)) { -proxy_challenge("$fd", "1"); # Realm will be autogenerated -}; +route[SESSION_LIR_REPLY] +{ + if ($avp(lia_return_code) == 1) { + if (I_scscf_select("0")) { + append_branch(); + t_on_reply("initial_request_reply"); + t_on_failure("initial_request_failure"); + if (!t_relay()) { + t_reply("500","Error forwarding towards S-CSCF"); + break; + } + break; + } else { + xlog("L_DBG", "dropping scscf list on initial request\n"); + I_scscf_drop(); + t_reply("500", "Server error on LIR select S-CSCF"); + break; + } + } else { + t_reply("500", "Server error on LIR"); + break; + } + break; +} ... 5. Statistics diff --git a/modules/ims_isc/README b/modules/ims_isc/README index e8a83507ce2..91eecf7a6ef 100644 --- a/modules/ims_isc/README +++ b/modules/ims_isc/README @@ -36,6 +36,7 @@ Richard Good 3.2. expires_grace (integer) 3.3. isc_fr_timeout (integer) 3.4. isc_fr_inv_timeout (integer) + 3.5. add_p_served_user (integer) 4. Functions @@ -49,9 +50,10 @@ Richard Good 1.2. expires_grace parameter usage 1.3. isc_fr_timeout parameter usage 1.4. isc_fr_inv_timeout parameter usage - 1.5. isc_match_filter_reg usage - 1.6. isc_match_filter usage - 1.7. isc_from_as usage + 1.5. add_p_served_user parameter usage + 1.6. isc_match_filter_reg usage + 1.7. isc_match_filter usage + 1.8. isc_from_as usage Chapter 1. Admin Guide @@ -69,6 +71,7 @@ Chapter 1. Admin Guide 3.2. expires_grace (integer) 3.3. isc_fr_timeout (integer) 3.4. isc_fr_inv_timeout (integer) + 3.5. add_p_served_user (integer) 4. Functions @@ -102,6 +105,7 @@ Chapter 1. Admin Guide 3.2. expires_grace (integer) 3.3. isc_fr_timeout (integer) 3.4. isc_fr_inv_timeout (integer) + 3.5. add_p_served_user (integer) 3.1. my_uri (string) @@ -154,6 +158,19 @@ modparam("ims_isc", "isc_fr_timeout", 5000) modparam("ims_isc", "isc_fr_inv_timeout", 20000) ... +3.5. add_p_served_user (integer) + + This boolean indicates if a P-Served-User should be added on the ISC + interface, according to RFC 5502. + + Default value is 0 (false) + + Example 1.5. add_p_served_user parameter usage +... +modparam("ims_isc", "add_p_served_user", 1) +# p-served user header will be enabled +... + 4. Functions 4.1. isc_match_filter_reg(reg_state,domain) @@ -176,7 +193,7 @@ modparam("ims_isc", "isc_fr_inv_timeout", 20000) This function can be used from REQUEST_ROUTE. - Example 1.5. isc_match_filter_reg usage + Example 1.6. isc_match_filter_reg usage ... isc_match_filter_reg("1","location"); ... @@ -196,7 +213,7 @@ isc_match_filter_reg("1","location"); This function can be used from REQUEST_ROUTE | FAILURE_ROUTE. - Example 1.6. isc_match_filter usage + Example 1.7. isc_match_filter usage ... isc_match_filter("orig","location"); ... @@ -214,7 +231,7 @@ isc_match_filter("orig","location"); This function can be used from REQUEST_ROUTE | FAILURE_ROUTE. - Example 1.7. isc_from_as usage + Example 1.8. isc_from_as usage ... if (!isc_from_as("orig")) { remove_hf("P-Asserted-Identity"); diff --git a/modules/ims_qos/README b/modules/ims_qos/README index 8420696b257..9bf7f7d2006 100644 --- a/modules/ims_qos/README +++ b/modules/ims_qos/README @@ -49,6 +49,8 @@ Carsten Bock 3.8. cdp_event_list_size_threshold (integer) 3.9. audio_default_bandwidth (integer) 3.10. video_default_bandwidth (integer) + 3.11. early_qosrelease_reason (String) + 3.12. confirmed_qosrelease_headers (String) 4. Functions @@ -73,8 +75,10 @@ Carsten Bock 1.8. cdp_event_list_size_threshold parameter usage 1.9. audio_default_bandwidth parameter usage 1.10. video_default_bandwidth parameter usage - 1.11. Rx_AAR_Register - 1.12. Rx_AAR + 1.11. early_qosrelease_reason parameter usage + 1.12. confirmed_qosrelease_headers parameter usage + 1.13. Rx_AAR_Register + 1.14. Rx_AAR Chapter 1. Admin Guide @@ -98,6 +102,8 @@ Chapter 1. Admin Guide 3.8. cdp_event_list_size_threshold (integer) 3.9. audio_default_bandwidth (integer) 3.10. video_default_bandwidth (integer) + 3.11. early_qosrelease_reason (String) + 3.12. confirmed_qosrelease_headers (String) 4. Functions @@ -148,6 +154,8 @@ Chapter 1. Admin Guide 3.8. cdp_event_list_size_threshold (integer) 3.9. audio_default_bandwidth (integer) 3.10. video_default_bandwidth (integer) + 3.11. early_qosrelease_reason (String) + 3.12. confirmed_qosrelease_headers (String) 3.1. rx_dest_realm (string) @@ -276,6 +284,33 @@ modparam("ims_qos", "audio_default_bandwidth", 32) modparam("ims_qos", "video_default_bandwidth", 256) ... +3.11. early_qosrelease_reason (String) + + This sets the default Reason, when a call is terminated in early stage + due to QoS-failure. + + Default value is "QoS released", an call in early stage would be + released with "488 QoS released". + + Example 1.11. early_qosrelease_reason parameter usage +... +modparam("ims_qos", "early_qosrelease_reason", "Sorry - QoS failed") +... + +3.12. confirmed_qosrelease_headers (String) + + These headers are added to the BYE-Message, when an confirmed call is + terminated due to a QoS failure. + + Default value is "", no Extra-Headers + + The headers must end with CRLF. + + Example 1.12. confirmed_qosrelease_headers parameter usage +... +modparam("ims_qos", "confirmed_qosrelease_headers", "X-Reason: QoS failed\r\n") +... + 4. Functions 4.1. Rx_AAR_Register(route_block, domain) @@ -306,7 +341,7 @@ modparam("ims_qos", "video_default_bandwidth", 256) p.s. this is executed asynchronously. See example on how to retrieve return value - Example 1.11. Rx_AAR_Register + Example 1.13. Rx_AAR_Register ... if(Rx_AAR_Register("REG_AAR_REPLY","location")==0){ exit; @@ -348,7 +383,7 @@ route[REG_AAR_REPLY] p.s. this is executed asynchronously. See example on how to retrieve return value - Example 1.12. Rx_AAR + Example 1.14. Rx_AAR ... if(Rx_AAR("ORIG_SESSION_AAR_REPLY","orig","",-1)==0){ exit; diff --git a/modules/ims_registrar_pcscf/save.c b/modules/ims_registrar_pcscf/save.c index 1f8fba4f1de..5a98d369294 100644 --- a/modules/ims_registrar_pcscf/save.c +++ b/modules/ims_registrar_pcscf/save.c @@ -97,26 +97,6 @@ static inline int calc_contact_expires(contact_t *c,int expires_hdr, int local_t return local_time_now + r; } -static inline char* strnistr(const char *s, const char *find, size_t slen) -{ - char c, sc; - size_t len; - - if ((c = *find++) != '\0') { - len = strlen(find); - do { - do { - if ((sc = *s++) == '\0' || slen-- < 1) - return (NULL); - } while (sc != c); - if (len > slen) - return (NULL); - } while (strncasecmp(s, find, len) != 0); - s--; - } - return ((char *)s); -} - /** * Updates the registrar with the new values @@ -170,7 +150,7 @@ static inline int update_contacts(struct sip_msg *req,struct sip_msg *rpl, udoma ci.num_service_routes = service_route_cnt; ci.reg_state = PCONTACT_REGISTERED|PCONTACT_REG_PENDING|PCONTACT_REG_PENDING_AAR; //we don't want to add contacts that did not come through us (pcscf) - if (c->uri.len > 6 && (strnistr(c->uri.s, "alias=", c->uri.len))) { + if (c->uri.len > 6 && (_strnistr(c->uri.s, "alias=", c->uri.len))) { LM_DBG("contact has an alias - we can use that as the received.... - TODO\n"); } ci.received_host.len = 0; diff --git a/modules/ims_registrar_pcscf/service_routes.c b/modules/ims_registrar_pcscf/service_routes.c index 3d29d6109fd..bcdb368e39f 100644 --- a/modules/ims_registrar_pcscf/service_routes.c +++ b/modules/ims_registrar_pcscf/service_routes.c @@ -228,6 +228,9 @@ pcontact_t * getContactP(struct sip_msg* _m, udomain_t* _d, enum pcontact_reg_st search_ci.received_port = _m->rcv.src_port; search_ci.received_proto = _m->rcv.proto; search_ci.searchflag = SEARCH_RECEIVED; + if (is_registered_fallback2ip == 1) { + search_ci.searchflag = SEARCH_NORMAL; + } search_ci.via_host = host; search_ci.via_port = port; search_ci.via_prot = proto; @@ -255,6 +258,7 @@ pcontact_t * getContactP(struct sip_msg* _m, udomain_t* _d, enum pcontact_reg_st LM_INFO("Contact not found based on Contact-header, trying IP/Port/Proto\n"); // received_host.len = ip_addr2sbuf(&_m->rcv.src_ip, srcip, sizeof(srcip)); // received_host.s = srcip; + search_ci.searchflag = SEARCH_RECEIVED; if (ul.get_pcontact(_d, &search_ci, &c) == 1) { LM_DBG("No entry in usrloc for %.*s:%i (Proto %i) found!\n", received_host.len, received_host.s, _m->rcv.src_port, _m->rcv.proto); } else { @@ -264,6 +268,17 @@ pcontact_t * getContactP(struct sip_msg* _m, udomain_t* _d, enum pcontact_reg_st } } + if ((c == NULL) && (is_registered_fallback2ip == 2)) { + LM_INFO("Contact not found based on IP/Port/Proto, trying Contact-header\n"); + search_ci.searchflag = SEARCH_NORMAL; + if (ul.get_pcontact(_d, &search_ci, &c) == 1) { + } else { + if (checkcontact(_m, c) != 0) { + c = NULL; + } + } + } + asserted_identity = NULL; registration_contact = NULL; if (c) { diff --git a/modules/ims_registrar_scscf/README b/modules/ims_registrar_scscf/README index a3ef80cc3c2..05f0d3812ea 100644 --- a/modules/ims_registrar_scscf/README +++ b/modules/ims_registrar_scscf/README @@ -10,7 +10,7 @@ Richard Good Smile Communications - Copyright 2012 Smile Communications + Copyright © 2012 Smile Communications __________________________________________________________________ Table of Contents @@ -788,31 +788,31 @@ Chapter 2. Frequently Asked Questions 2.1. - Where can I find more about Kamailio? + Where can I find more about Kamailio? - Take a look at http://www.kamailio.org/. + Take a look at http://www.kamailio.org/. 2.2. - Where can I post a question about this module? + Where can I post a question about this module? - First at all check if your question was already answered on one of our - mailing lists: - * User Mailing List - - http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users - * Developer Mailing List - - http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev + First at all check if your question was already answered on one of our + mailing lists: + * User Mailing List - + http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users + * Developer Mailing List - + http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev - E-mails regarding any stable Kamailio release should be sent to - and e-mails regarding development - versions should be sent to . + E-mails regarding any stable Kamailio release should be sent to + and e-mails regarding development + versions should be sent to . - If you want to keep the mail private, send it to - . + If you want to keep the mail private, send it to + . 2.3. - How can I report a bug? + How can I report a bug? - Please follow the guidelines provided at: - http://sip-router.org/tracker. + Please follow the guidelines provided at: + https://github.com/kamailio/kamailio/issues. diff --git a/modules/ims_usrloc_pcscf/README b/modules/ims_usrloc_pcscf/README index f4b9c5c0f72..1edbb4beba9 100644 --- a/modules/ims_usrloc_pcscf/README +++ b/modules/ims_usrloc_pcscf/README @@ -10,7 +10,7 @@ Richard Good Smile Communications - Copyright 2012 Smile Communications + Copyright © 2012 Smile Communications __________________________________________________________________ Table of Contents @@ -31,6 +31,7 @@ Richard Good 3.4. db_mode (int) 3.5. hashing_type (int) 3.6. lookup_check_received (int) + 3.7. match_contact_host_port (int) 4. RPC Commands @@ -52,6 +53,7 @@ Richard Good 1.4. Set db_mode parameter 1.5. Set hashing_type parameter 1.6. Set lookup_check_received parameter + 1.7. Set match_contact_host_port parameter Chapter 1. Admin Guide @@ -71,6 +73,7 @@ Chapter 1. Admin Guide 3.4. db_mode (int) 3.5. hashing_type (int) 3.6. lookup_check_received (int) + 3.7. match_contact_host_port (int) 4. RPC Commands @@ -122,6 +125,7 @@ Chapter 1. Admin Guide 3.4. db_mode (int) 3.5. hashing_type (int) 3.6. lookup_check_received (int) + 3.7. match_contact_host_port (int) 3.1. hash_size (int) @@ -206,7 +210,9 @@ modparam("ims_usrloc_pcscf", "db_mode", 1) can deny the request. * 0 - This uses the original hash over AOR method. By default we are backwards compatible... - * 1 - Use the newer hash over IP:PORT. + * 1 - Use the newer hash over the Host from Contact-Header. + * 2 - Use the newer hash over the source-IP from where the request + was received (useful for NAT-Scenarios) Default value is 0. @@ -229,6 +235,21 @@ modparam("ims_usrloc_pcscf", "hashing_type", 1) modparam("ims_usrloc_pcscf", "lookup_check_received", 0) ... +3.7. match_contact_host_port (int) + + If set to 1 (default), the contact is matched using only host and port + in the contact URI. + * 0 - When matching contact do full contact match procedure. + * 1 - When matching contact compare only host and port of the contact + URI. + + Default value is 1. + + Example 1.7. Set match_contact_host_port parameter +... +modparam("ims_usrloc_pcscf", "match_contact_host_port", 0) +... + 4. RPC Commands 4.1. ulpcscf.status @@ -267,31 +288,31 @@ Chapter 2. Frequently Asked Questions 2.1. - Where can I find more about Kamailio? + Where can I find more about Kamailio? - Take a look at http://www.kamailio.org/. + Take a look at http://www.kamailio.org/. 2.2. - Where can I post a question about this module? + Where can I post a question about this module? - First at all check if your question was already answered on one of our - mailing lists: - * User Mailing List - - http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users - * Developer Mailing List - - http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev + First at all check if your question was already answered on one of our + mailing lists: + * User Mailing List - + http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users + * Developer Mailing List - + http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev - E-mails regarding any stable Kamailio release should be sent to - and e-mails regarding development - versions should be sent to . + E-mails regarding any stable Kamailio release should be sent to + and e-mails regarding development + versions should be sent to . - If you want to keep the mail private, send it to - . + If you want to keep the mail private, send it to + . 2.3. - How can I report a bug? + How can I report a bug? - Please follow the guidelines provided at: - http://sip-router.org/tracker. + Please follow the guidelines provided at: + https://github.com/kamailio/kamailio/issues. diff --git a/modules/ims_usrloc_scscf/impurecord.c b/modules/ims_usrloc_scscf/impurecord.c index 9dd82ed974b..ceee7e5b127 100644 --- a/modules/ims_usrloc_scscf/impurecord.c +++ b/modules/ims_usrloc_scscf/impurecord.c @@ -332,6 +332,10 @@ static str rollback = str_init("ROLLBACK"); static str autocommit_on = str_init("SET AUTOCOMMIT=1"); static inline void start_dbtransaction() { + + if (db_mode == NO_DB) + return; + if (ul_dbf.raw_query(ul_dbh, &autocommit_off, NULL) < 0) { LM_ERR("could not " "set autocommit off!\n"); diff --git a/modules/ipops/README b/modules/ipops/README index bc487511b04..236771d6970 100644 --- a/modules/ipops/README +++ b/modules/ipops/README @@ -1,16 +1,16 @@ ipops Module -Iaki Baz Castillo +Iñaki Baz Castillo Edited by -Iaki Baz Castillo +Iñaki Baz Castillo - Copyright 2011 Iaki Baz Castillo + Copyright © 2011 Iñaki Baz Castillo __________________________________________________________________ Table of Contents @@ -101,9 +101,9 @@ Chapter 1. Admin Guide When using IPv6 in an URI (i.e. a SIP URI) the IP address must be written in "IPv6 reference" format (which is the textual representation of the IPv6 enclosed between [ ] symbols). An example is - "sip:alice@[2001:DB8:0:0:8:800:200C:417A]". This allows separation of + “sip:alice@[2001:DB8:0:0:8:800:200C:417A]”. This allows separation of address and port number with a :, like - "[2001:DB8:0:0:8:800:200C:417A]:5060". This module also allows + “[2001:DB8:0:0:8:800:200C:417A]:5060”. This module also allows comparing an IPv6 address with its IPv6 reference representation. 2. Dependencies @@ -141,7 +141,7 @@ Chapter 1. Admin Guide 4.13. dns_query(hostname, pvid) 4.14. srv_query(srvcname, pvid) -4.1. is_ip (ip) +4.1. is_ip (ip) Returns TRUE if the argument is a valid IPv4, IPv6 or IPv6 reference. FALSE otherwise. @@ -153,14 +153,14 @@ Chapter 1. Admin Guide This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE and LOCAL_ROUTE. - Example 1.1. is_ip usage + Example 1.1. is_ip usage ... if (is_ip($rd)) { xlog("L_INFO", "RURI domain is an IP address (not a host name/domain)\n"); } ... -4.2. is_pure_ip (ip) +4.2. is_pure_ip (ip) Returns TRUE if the argument is a valid IPv4 or IPv6. FALSE otherwise. @@ -170,7 +170,7 @@ if (is_ip($rd)) { This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE and LOCAL_ROUTE. - Example 1.2. is_pure_ip usage + Example 1.2. is_pure_ip usage ... $var(ip) = "::1"; if (is_pure_ip($var(ip))) { @@ -178,7 +178,7 @@ if (is_pure_ip($var(ip))) { } ... -4.3. is_ipv4 (ip) +4.3. is_ipv4 (ip) Returns TRUE if the argument is a valid IPv4. FALSE otherwise. @@ -188,14 +188,14 @@ if (is_pure_ip($var(ip))) { This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE and LOCAL_ROUTE. - Example 1.3. is_ipv4 usage + Example 1.3. is_ipv4 usage ... if (is_ipv4("1.2.3.4")) { xlog("L_INFO", "it's IPv4\n"); } ... -4.4. is_ipv6 (ip) +4.4. is_ipv6 (ip) Returns TRUE if the argument is a valid IPv6. FALSE otherwise. @@ -205,14 +205,14 @@ if (is_ipv4("1.2.3.4")) { This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE and LOCAL_ROUTE. - Example 1.4. is_ipv6 usage + Example 1.4. is_ipv6 usage ... if (is_ipv6("1080:0:0:0:8:800:200C:417A")) { xlog("L_INFO", "it's IPv6\n"); } ... -4.5. is_ipv6_reference (ip) +4.5. is_ipv6_reference (ip) Returns TRUE if the argument is a valid IPv6 reference. FALSE otherwise. @@ -223,14 +223,14 @@ if (is_ipv6("1080:0:0:0:8:800:200C:417A")) { This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE and LOCAL_ROUTE. - Example 1.5. is_ipv6_reference usage + Example 1.5. is_ipv6_reference usage ... if (is_ipv6_reference("[1080:0:0:0:8:800:200C:417A]")) { xlog("L_INFO", "it's IPv6 reference\n"); } ... -4.6. ip_type (ip) +4.6. ip_type (ip) Returns the type of the given IP. @@ -246,7 +246,7 @@ if (is_ipv6_reference("[1080:0:0:0:8:800:200C:417A]")) { This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE and LOCAL_ROUTE. - Example 1.6. ip_type usage + Example 1.6. ip_type usage ... ip_type($var(myip)); switch($rc) { @@ -265,7 +265,7 @@ switch($rc) { } ... -4.7. compare_ips (ip1, ip2) +4.7. compare_ips (ip1, ip2) Returns TRUE if both IP addresses are the same. FALSE otherwise. This function also allows comparing an IPv6 address against an IPv6 @@ -279,7 +279,7 @@ switch($rc) { This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE and LOCAL_ROUTE. - Example 1.7. compare_ips usage + Example 1.7. compare_ips usage ... if (compare_ips("1080:0000:0000:0000:0008:0800:200C:417A", "[1080::8:800:200C:41 7A]")) { @@ -287,7 +287,7 @@ if (compare_ips("1080:0000:0000:0000:0008:0800:200C:417A", "[1080::8:800:200C:41 } ... -4.8. compare_pure_ips (ip1, ip2) +4.8. compare_pure_ips (ip1, ip2) Returns TRUE if both IP's are the same. FALSE otherwise. This function does NOT allow comparing an IPv6 against an IPv6 reference. @@ -301,14 +301,14 @@ if (compare_ips("1080:0000:0000:0000:0008:0800:200C:417A", "[1080::8:800:200C:41 This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE and LOCAL_ROUTE. - Example 1.8. compare_pure_ips usage + Example 1.8. compare_pure_ips usage ... if (compare_pure_ips($si, "1080::8:800:200C:417A")) { xlog("L_INFO", "both are the same IP\n"); } ... -4.9. is_ip_rfc1918 (ip) +4.9. is_ip_rfc1918 (ip) Returns TRUE if the argument is a private IPv4 according to RFC 1918. FALSE otherwise. @@ -319,14 +319,14 @@ if (compare_pure_ips($si, "1080::8:800:200C:417A")) { This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE and LOCAL_ROUTE. - Example 1.9. is_ip_rfc1918 usage + Example 1.9. is_ip_rfc1918 usage ... if (is_ip_rfc1918("10.0.123.123")) { xlog("L_INFO", "it's a private IPv4\n"); } ... -4.10. is_in_subnet (ip, subnet) +4.10. is_in_subnet (ip, subnet) Returns TRUE if the first argument is an IP address within the (CIDR notation) subnet in the second argument. FALSE otherwise. @@ -339,14 +339,14 @@ if (is_ip_rfc1918("10.0.123.123")) { This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE and LOCAL_ROUTE. - Example 1.10. is_in_subnet usage + Example 1.10. is_in_subnet usage ... if (is_in_subnet("10.0.123.123", "10.0.123.1/24")) { xlog("L_INFO", "it's in the subnet\n"); } ... -4.11. dns_sys_match_ip(hostname, ipaddr) +4.11. dns_sys_match_ip(hostname, ipaddr) Returns TRUE if ipaddr is associated by DNS to hostname. FALSE otherwise. It does not use the internal DNS resolver, but directly @@ -362,14 +362,14 @@ if (is_in_subnet("10.0.123.123", "10.0.123.1/24")) { This function can be used from ANY_ROUTE. - Example 1.11. dns_sys_match_ip usage + Example 1.11. dns_sys_match_ip usage ... if (!dns_sys_match_ip("myhost.com", "1.2.3.4")) { xdbg("ip address not associated with hostname\n"); } ... -4.12. dns_int_match_ip(hostname, ipaddr) +4.12. dns_int_match_ip(hostname, ipaddr) Returns TRUE if ipaddr is associated by DNS to hostname. FALSE otherwise. It uses internal DNS resolver. At this moment, the function @@ -386,14 +386,14 @@ if (!dns_sys_match_ip("myhost.com", "1.2.3.4")) { This function can be used from ANY_ROUTE. - Example 1.12. dns_int_match_ip usage + Example 1.12. dns_int_match_ip usage ... if (!dns_int_match_ip("myhost.com", "1.2.3.4")) { xdbg("ip address not associated with hostname\n"); } ... -4.13. dns_query(hostname, pvid) +4.13. dns_query(hostname, pvid) Store the IP addresses and their type that correspond to hostname in a config variable $dns(pvid=>key). @@ -405,7 +405,7 @@ if (!dns_int_match_ip("myhost.com", "1.2.3.4")) { This function can be used from ANY_ROUTE. - Example 1.13. dns_query usage + Example 1.13. dns_query usage ... if(dns_query("test.com", "xyz")) { @@ -421,7 +421,7 @@ if(dns_query("test.com", "xyz")) } ... -4.14. srv_query(srvcname, pvid) +4.14. srv_query(srvcname, pvid) Queries DNS SRV records to resolve a service/protocol name into a list of priorities, weights, ports, and targets sorted by priority and @@ -447,7 +447,7 @@ if(dns_query("test.com", "xyz")) * target [index] - target host name * weight [index] - weight number as defined by RFC 2782 - Example 1.14. srv_query usage + Example 1.14. srv_query usage ... if (srv_query ("_sip._udp.example.com", "udp") > 0) { $var(cnt) = $srvquery(udp=>count); diff --git a/modules/ipops/ipops_mod.c b/modules/ipops/ipops_mod.c index 916a7130d06..2f1c71611c5 100644 --- a/modules/ipops/ipops_mod.c +++ b/modules/ipops/ipops_mod.c @@ -535,7 +535,7 @@ static int w_ip_is_in_subnet(struct sip_msg* _msg, char* _s1, char* _s2) str string1, string2; enum enum_ip_type ip1_type, ip2_type; char *cidr_pos = NULL; - int netmask = 0; + int netmask = -1; if (_s1 == NULL || _s2 == NULL ) { LM_ERR("bad parameters\n"); @@ -586,7 +586,7 @@ static int w_ip_is_in_subnet(struct sip_msg* _msg, char* _s1, char* _s2) break; } - if (netmask == 0) + if (netmask == -1) { if (_compare_ips(string1.s, string1.len, ip1_type, string2.s, string2.len, ip2_type)) return 1; diff --git a/modules/iptrtpproxy/README b/modules/iptrtpproxy/README index 50b62b02d2f..508127973ee 100644 --- a/modules/iptrtpproxy/README +++ b/modules/iptrtpproxy/README @@ -1,12 +1,11 @@ - The Iptrtpproxy module Tomas Mandys Iptel.org - Copyright 2007 Tomas Mandys - _________________________________________________________________ + Copyright © 2007 Tomas Mandys + __________________________________________________________________ Table of Contents @@ -25,32 +24,32 @@ Tomas Mandys 4. Functions - 4.1. iptrtpproxy_alloc(gate_a_to_b [, existing_sess_ids]) - 4.2. iptrtpproxy_update(gate_a_to_b, session_ids) - 4.3. iptrtpproxy_adjust_timeout(gate_a_to_b, session_ids) - 4.4. iptrtpproxy_delete(session_ids) - 4.5. iptrtpproxy_authorize_media() - 4.6. iptrtpproxy_set_param(param, value) + 4.1. iptrtpproxy_alloc(gate_a_to_b [, existing_sess_ids]) + 4.2. iptrtpproxy_update(gate_a_to_b, session_ids) + 4.3. iptrtpproxy_adjust_timeout(gate_a_to_b, session_ids) + 4.4. iptrtpproxy_delete(session_ids) + 4.5. iptrtpproxy_authorize_media() + 4.6. iptrtpproxy_set_param(param, value) 4.7. - iptrtpproxy_set_param("(aggregation/switchboard)_by_sip - _ip_(a/b)", sip_ip) + iptrtpproxy_set_param("(aggregation/switchboard)_by_sip_ + ip_(a/b)", sip_ip) 4.8. iptrtpproxy_set_param("protected_session_ids", - sess_ids) + sess_ids) - 4.9. iptrtpproxy_set_param("o_name", value) - 4.10. iptrtpproxy_set_param("o_addr", value) - 4.11. iptrtpproxy_set_param("codec_set", value) - 4.12. iptrtpproxy_set_param("remove_codec_mask", value) + 4.9. iptrtpproxy_set_param("o_name", value) + 4.10. iptrtpproxy_set_param("o_addr", value) + 4.11. iptrtpproxy_set_param("codec_set", value) + 4.12. iptrtpproxy_set_param("remove_codec_mask", value) 5. Selects - 5.1. @iptrtpproxy.session_ids - 5.2. @iptrtpproxy.sdp_ip - 5.3. @iptrtpproxy.o_name - 5.4. @iptrtpproxy.o_addr - 5.5. @iptrtpproxy.auth_rights - 5.6. @iptrtpproxy.active_media_num + 5.1. @iptrtpproxy.session_ids + 5.2. @iptrtpproxy.sdp_ip + 5.3. @iptrtpproxy.o_name + 5.4. @iptrtpproxy.o_addr + 5.5. @iptrtpproxy.auth_rights + 5.6. @iptrtpproxy.active_media_num List of Examples @@ -79,55 +78,55 @@ Chapter 1. Admin Guide 4. Functions - 4.1. iptrtpproxy_alloc(gate_a_to_b [, existing_sess_ids]) - 4.2. iptrtpproxy_update(gate_a_to_b, session_ids) - 4.3. iptrtpproxy_adjust_timeout(gate_a_to_b, session_ids) - 4.4. iptrtpproxy_delete(session_ids) - 4.5. iptrtpproxy_authorize_media() - 4.6. iptrtpproxy_set_param(param, value) + 4.1. iptrtpproxy_alloc(gate_a_to_b [, existing_sess_ids]) + 4.2. iptrtpproxy_update(gate_a_to_b, session_ids) + 4.3. iptrtpproxy_adjust_timeout(gate_a_to_b, session_ids) + 4.4. iptrtpproxy_delete(session_ids) + 4.5. iptrtpproxy_authorize_media() + 4.6. iptrtpproxy_set_param(param, value) 4.7. - iptrtpproxy_set_param("(aggregation/switchboard)_by_sip_ip_(a - /b)", sip_ip) + iptrtpproxy_set_param("(aggregation/switchboard)_by_sip_ip_(a/ + b)", sip_ip) - 4.8. iptrtpproxy_set_param("protected_session_ids", sess_ids) - 4.9. iptrtpproxy_set_param("o_name", value) - 4.10. iptrtpproxy_set_param("o_addr", value) - 4.11. iptrtpproxy_set_param("codec_set", value) - 4.12. iptrtpproxy_set_param("remove_codec_mask", value) + 4.8. iptrtpproxy_set_param("protected_session_ids", sess_ids) + 4.9. iptrtpproxy_set_param("o_name", value) + 4.10. iptrtpproxy_set_param("o_addr", value) + 4.11. iptrtpproxy_set_param("codec_set", value) + 4.12. iptrtpproxy_set_param("remove_codec_mask", value) 5. Selects - 5.1. @iptrtpproxy.session_ids - 5.2. @iptrtpproxy.sdp_ip - 5.3. @iptrtpproxy.o_name - 5.4. @iptrtpproxy.o_addr - 5.5. @iptrtpproxy.auth_rights - 5.6. @iptrtpproxy.active_media_num + 5.1. @iptrtpproxy.session_ids + 5.2. @iptrtpproxy.sdp_ip + 5.3. @iptrtpproxy.o_name + 5.4. @iptrtpproxy.o_addr + 5.5. @iptrtpproxy.auth_rights + 5.6. @iptrtpproxy.active_media_num 1. Overview - This module provides similar functionality as nathelper but - communicates with netfilter kernel xt_RTPPROXY module using the - libipt_RTPPROXY userspace library. All RTP streams are manipulated - directly in kernel space, no data is copied from kernel to userspace + This module provides similar functionality as nathelper but + communicates with netfilter kernel xt_RTPPROXY module using the + libipt_RTPPROXY userspace library. All RTP streams are manipulated + directly in kernel space, no data is copied from kernel to userspace and back, it reduces load and delay. See http://www.2p.cz/en/netfilter_rtp_proxy for more details. - This Kamailio module is written as a light-weight module, there is no - dialog managment as in Nathelper. The reason is that such an API - should be provided by core or a specialized dialog manager module. - Because such module is not in git, session information may be stored - in extra attributes of the avp_db module and the session id itself in + This Kamailio module is written as a light-weight module, there is no + dialog management as in Nathelper. The reason is that such an API + should be provided by core or a specialized dialog manager module. + Because such module is not in git, session information may be stored in + extra attributes of the avp_db module and the session id itself in record route as cookie, see the rr module. - It should be able to support all cases as re-invites when SIP client - offers media change in SDP and when number of medias in offer/answer + It should be able to support all cases as re-invites when SIP client + offers media change in SDP and when number of medias in offer/answer are different. Nathelper may be still used for testing if client is behind the NAT. - There is also support for media authorization. Number of codec sets - may be defined. When a message containing SDP offer/answer is being + There is also support for media authorization. Number of codec sets may + be defined. When a message containing SDP offer/answer is being processed then current codecs and streams may be inspected, removed or signallized according a codec set. @@ -137,14 +136,14 @@ Chapter 1. Admin Guide 2. Dependencies - The following libraries or applications must be installed before + The following libraries or applications must be installed before running Kamailio with this module loaded: - * netfilter xt_RTPPROXY & libipt_RTPPROXY, see + * netfilter xt_RTPPROXY & libipt_RTPPROXY, see http://www.2p.cz/en/netfilter_rtp_proxy Note - The modules Makefile must be edited and iptdir setup to the directory + The modules Makefile must be edited and iptdir setup to the directory with the iptable sources (if different from ~/iptables). Alternatively compile the module using: make -C modules/iptrtpproxy iptdir=path_to_iptables_src @@ -160,8 +159,8 @@ Note 3.1. config (string) - References iptrtpproxy.cfg, see iptrtpproxy_helper. Default value is - /etc/iptrtpproxy.cfg. If only codec authorization is to be used then + References iptrtpproxy.cfg, see iptrtpproxy_helper. Default value is + /etc/iptrtpproxy.cfg. If only codec authorization is to be used then /dev/null may be used. 3.2. switchboard (string) @@ -173,26 +172,25 @@ Note name = "aggregation" | "sip-addr-" - The name is the switchboard name as declared in config and will be - used by script functions and references switchboard. It's mandatory + The name is the switchboard name as declared in config and will be used + by script functions and references switchboard. It's mandatory parameter. The special name * set values for all switchboards. - The sip-addr is address used by iptrtpproxy_ser_param(by_sip_ip) to - find a switchboard for particular connection. If not explicitly - configured then RTP switchboard gate address are used for this - feature. + The sip-addr is address used by iptrtpproxy_ser_param(by_sip_ip) to + find a switchboard for particular connection. If not explicitly + configured then RTP switchboard gate address are used for this feature. - The aggregation enables to aggregate more switchboards in cluster and - to widden bandwidth. Aggregation will take sip-addr from the first + The aggregation enables to aggregate more switchboards in cluster and + to widden bandwidth. Aggregation will take sip-addr from the first switchboard of its. Example 1.1. Declare switchboard ... modparam("iptrtpproxy", "config", "/etc/iptrtpproxy.cfg"); - modparam("iptrtpproxy", "switchboard", "name=my1;sip-addr-a=1.2.3.4;sip --addr-b=5.6.7.8"); - modparam("iptrtpproxy", "switchboard", "name=my2;sip-addr-a=2.3.4.5;sip --addr-b=3.4.5.6;aggregation=my23"); + modparam("iptrtpproxy", "switchboard", "name=my1;sip-addr-a=1.2.3.4;sip- +addr-b=5.6.7.8"); + modparam("iptrtpproxy", "switchboard", "name=my2;sip-addr-a=2.3.4.5;sip- +addr-b=3.4.5.6;aggregation=my23"); modparam("iptrtpproxy", "switchboard", "name=my3;aggregation=my23"); modparam("iptrtpproxy", "switchboard", "name=*;aggregation=my123"); ... @@ -201,14 +199,14 @@ Note Timeout in seconds used for rerequest remote RTP proxy via RPC command after preceeding error. In other words if a RPC server is unresponsive - at the moment then next attempt will be forced after this timeout. + at the moment then next attempt will be forced after this timeout. Default value is 30. 3.4. hostname (string) - The hostname used by RPC to identify machine where Ser is running to - communicate which RTP proxy via local interface. Default value is - taken from system hostname. + The hostname used by RPC to identify machine where Ser is running to + communicate which RTP proxy via local interface. Default value is taken + from system hostname. 3.5. declare_codec (string) @@ -217,112 +215,110 @@ Note 3.6. codec_set (string) - Declares new codec set. Codecs are declared for each media type + Declares new codec set. Codecs are declared for each media type independently. The format is: "name=" value * ( ";" name "=" value ) name = "media_type" | "rights" | "codecs" | "max_streams" | ( "rtp" | "rtcp" - ) "_" ( "bytes" | "packets" ) +) "_" ( "bytes" | "packets" ) media_types = "audio" | "video" | "application" | "text" | "message" | "data" - | "control" | "?" | "*" +| "control" | "?" | "*" The name is the codec set name to be defined. - The media_type belongs to type at m= SDP line. Question mark means + The media_type belongs to type at m= SDP line. Question mark means "unknown media" type and asterisk "all media types". - The max_streams defines how many streams (m= lines) is allowed per + The max_streams defines how many streams (m= lines) is allowed per media type. - The rights defines if particular codec is allowed 0, disallowed, i.e. - will be removed if bit AND operation with remove_codec_mask is - non-zero or its presence will be signallized by - @iptrtpproxy.auth_rights (any other value). + The rights defines if particular codec is allowed 0, disallowed, i.e. + will be removed if bit AND operation with remove_codec_mask is non-zero + or its presence will be signallized by @iptrtpproxy.auth_rights (any + other value). - The codecs comma separated list of codecs. Previous media_type&rights + The codecs comma separated list of codecs. Previous media_type&rights will be applied. - The rtp/rtcp_bytes/packets limits bandwidth per media_type (0 is - unlimited). It will override bandwidth limited by + The rtp/rtcp_bytes/packets limits bandwidth per media_type (0 is + unlimited). It will override bandwidth limited by iptrtpproxy_set_param("throttle_*"). Example 1.2. Declare codec_set ... # enable all codecs, default state when codec is declared - modparam("iptrtpproxy", "codec_set", "name=cs1;media_type=*;max_streams -=9999;rights=0;codecs=*"); + modparam("iptrtpproxy", "codec_set", "name=cs1;media_type=*;max_streams= +9999;rights=0;codecs=*"); # allow only 2 audio and 1 video stream - modparam("iptrtpproxy", "codec_set", "name=cs2;media_type=*;max_streams -=0;media_type=audio;max_streams=2;media_type=video;max_streams=1"); - # dtto, allow only a few audio and video codecs, GSM codec is allowed b -ut signallized - modparam("iptrtpproxy", "codec_set", "name=cs3;media_type=*;max_streams -=0;rights=1;codecs=*;media_type=audio;max_streams=2;rights=0;codecs=PCMU,G729,G -728,parityfec,telephone-events;rights=2;codecs=GSM;media_type=video;max_streams -=1;rights=0;codecs=jpeg,parityfec"); - # limit max. bandwidth for video - modparam("iptrtpproxy", "codec_set", "name=cs4;media_type=video;rtp_byt -es=10000;rtcp_bytes=1000"); + modparam("iptrtpproxy", "codec_set", "name=cs2;media_type=*;max_streams= +0;media_type=audio;max_streams=2;media_type=video;max_streams=1"); + # dtto, allow only a few audio and video codecs, GSM codec is allowed bu +t signallized + modparam("iptrtpproxy", "codec_set", "name=cs3;media_type=*;max_streams= +0;rights=1;codecs=*;media_type=audio;max_streams=2;rights=0;codecs=PCMU,G729,G72 +8,parityfec,telephone-events;rights=2;codecs=GSM;media_type=video;max_streams=1; +rights=0;codecs=jpeg,parityfec"); + # limit max. bandwidth for video¨ + modparam("iptrtpproxy", "codec_set", "name=cs4;media_type=video;rtp_byte +s=10000;rtcp_bytes=1000"); ... 4. Functions - 4.1. iptrtpproxy_alloc(gate_a_to_b [, existing_sess_ids]) - 4.2. iptrtpproxy_update(gate_a_to_b, session_ids) - 4.3. iptrtpproxy_adjust_timeout(gate_a_to_b, session_ids) - 4.4. iptrtpproxy_delete(session_ids) - 4.5. iptrtpproxy_authorize_media() - 4.6. iptrtpproxy_set_param(param, value) - 4.7. - iptrtpproxy_set_param("(aggregation/switchboard)_by_sip_ip_(a/b)", - sip_ip) - - 4.8. iptrtpproxy_set_param("protected_session_ids", sess_ids) - 4.9. iptrtpproxy_set_param("o_name", value) - 4.10. iptrtpproxy_set_param("o_addr", value) - 4.11. iptrtpproxy_set_param("codec_set", value) - 4.12. iptrtpproxy_set_param("remove_codec_mask", value) + 4.1. iptrtpproxy_alloc(gate_a_to_b [, existing_sess_ids]) + 4.2. iptrtpproxy_update(gate_a_to_b, session_ids) + 4.3. iptrtpproxy_adjust_timeout(gate_a_to_b, session_ids) + 4.4. iptrtpproxy_delete(session_ids) + 4.5. iptrtpproxy_authorize_media() + 4.6. iptrtpproxy_set_param(param, value) + 4.7. iptrtpproxy_set_param("(aggregation/switchboard)_by_sip_ip_(a/b)", + sip_ip) + + 4.8. iptrtpproxy_set_param("protected_session_ids", sess_ids) + 4.9. iptrtpproxy_set_param("o_name", value) + 4.10. iptrtpproxy_set_param("o_addr", value) + 4.11. iptrtpproxy_set_param("codec_set", value) + 4.12. iptrtpproxy_set_param("remove_codec_mask", value) 4.1. iptrtpproxy_alloc(gate_a_to_b [, existing_sess_ids]) - Parses SDP content and allocates for each RTP media stream one RTP - proxy session. SDP is updates to reflect allocated sessions. - Switchboard/aggregation is set using iptrtpproxy_set_param(by_sip_ip) + Parses SDP content and allocates for each RTP media stream one RTP + proxy session. SDP is updates to reflect allocated sessions. + Switchboard/aggregation is set using iptrtpproxy_set_param(by_sip_ip) or iptrtpproxy_set_param("switchboard/aggregation"). - Aggregation supports load balancing among more RTP proxies controlled - by RPC. The module try to allocate at machines/switchboards in - following order (priorities) not yet asked (or being heartbeated) - machines, responsive machines, switchboards having percentualy more + Aggregation supports load balancing among more RTP proxies controlled + by RPC. The module try to allocate at machines/switchboards in + following order (priorities) not yet asked (or being heartbeated) + machines, responsive machines, switchboards having percentualy more free slots, non responsive machines. - Proxy may hide caller identity provided at o= line using - @iptrtpproxy.o_name/addr and iptrtpproxy_set_param(o_name/addr) - functions. But the script is responsible for rewritting to original - values in a response or a callee initiated re-INVITE. Therefore + Proxy may hide caller identity provided at o= line using + @iptrtpproxy.o_name/addr and iptrtpproxy_set_param(o_name/addr) + functions. But the script is responsible for rewritting to original + values in a response or a callee initiated re-INVITE. Therefore original value need to be stored in-dialog. - * if gate_a_to_b bit 0 is set then SDP regards to gate-a to gate-b + * if gate_a_to_b bit 0 is set then SDP regards to gate-a to gate-b direction. - * protected_session_ids list of existing sessions enables reusing - already allocated sessions in re-INVITE without allocating new - sessions for each stream in SDP regardless a IP/port is required. + * protected_session_ids list of existing sessions enables reusing + already allocated sessions in re-INVITE without allocating new + sessions for each stream in SDP regardless a IP/port is required. It's mostly undesirable, typically "hold-on" is done via re-INVITE without any change. There is drawback because callee cannot change - IP:port in 200OK which is legal case in RFC3264. But because some - non-RFC3264 compliant phones dislike proactively changed IP:port - at RTP proxy it seems it's less evil. - * function returns true is a session was created, identifier is + IP:port in 200OK which is legal case in RFC3264. But because some + non-RFC3264 compliant phones dislike proactively changed IP:port at + RTP proxy it seems it's less evil. + * function returns true is a session was created, identifier is available via select @iptrtpproxy.session_ids. Example 1.3. iptrtpproxy_alloc usage ... - if (!iptrtpproxy_set_param("aggregation_by_sip_ip_a", "@received.ip")) -{ - if (!iptrtpproxy_set_param("switchboard_by_sip_ip_a", "@receive -d.ip")) { + if (!iptrtpproxy_set_param("aggregation_by_sip_ip_a", "@received.ip")) { + if (!iptrtpproxy_set_param("switchboard_by_sip_ip_a", "@received +.ip")) { t_reply("500", "RTP proxy error"); drop; } @@ -330,19 +326,19 @@ d.ip")) { eval_push("x:%@next_hop.src_ip"); if (@eval.get[-1] == @received.ip) { if (@iptrtpproxy.aggregation_a) { - iptrtpproxy_set_param("aggregation_b", "@iptrtpproxy.ag -gregation_a"); + iptrtpproxy_set_param("aggregation_b", "@iptrtpproxy.agg +regation_a"); } else { - iptrtpproxy_set_param("switchboard_b", "@iptrtpproxy.sw -itchboard_a"); + iptrtpproxy_set_param("switchboard_b", "@iptrtpproxy.swi +tchboard_a"); } } else { - if (!iptrtpproxy_set_param("aggregation_by_sip_ip_b", "@eval.ge -t[-1]")) { - if (!iptrtpproxy_set_param("switchboard_by_sip_ip_b", " -@eval.get[-1]")) { + if (!iptrtpproxy_set_param("aggregation_by_sip_ip_b", "@eval.get +[-1]")) { + if (!iptrtpproxy_set_param("switchboard_by_sip_ip_b", "@ +eval.get[-1]")) { t_reply("500", "RTP proxy error"); drop; } @@ -359,20 +355,20 @@ t[-1]")) { 4.2. iptrtpproxy_update(gate_a_to_b, session_ids) - Parses SDP content and updates sessions provided by session_ids and - updates SDP. If succesfull then session_ids may be changed (in case - e.g. media stream has port zero particular session is released), the - result of @iptrtpproxy.session_ids should be stored for future + Parses SDP content and updates sessions provided by session_ids and + updates SDP. If succesfull then session_ids may be changed (in case + e.g. media stream has port zero particular session is released), the + result of @iptrtpproxy.session_ids should be stored for future in-dialog usage. The SDP contect is also affected by iptrtpproxy_set_param(o_name/addr) - functions. If a stream is deactivated in SDP then Sessions may be + functions. If a stream is deactivated in SDP then Sessions may be deleted unless mentioned in protected_session_ids. - * if gate_a_to_b bit 0 is set then SDP regards to gate-a to gate-b + * if gate_a_to_b bit 0 is set then SDP regards to gate-a to gate-b direction. - if gate_a_to_b bit 1 is set then SDP is updated only, no RTP - session are affected. Should be used when handling retransmission - in onreply route, retransmission replies are not eaten be tm + if gate_a_to_b bit 1 is set then SDP is updated only, no RTP + session are affected. Should be used when handling retransmission + in onreply route, retransmission replies are not eaten be tm module! Example 1.4. iptrtpproxy_update usage @@ -386,9 +382,9 @@ t[-1]")) { 4.3. iptrtpproxy_adjust_timeout(gate_a_to_b, session_ids) - Adjust timeout for particular gate. It's useful in "200 OK" decrease + Adjust timeout for particular gate. It's useful in "200 OK" decrease timeout to learning timeout if INVITE has set (long) ringing timeout. - * if gate_a_to_b bit 0 is set then it regards to gate-a to gate-b + * if gate_a_to_b bit 0 is set then it regards to gate-a to gate-b direction. Example 1.5. iptrtpproxy_adjust_timeout usage @@ -406,9 +402,9 @@ t[-1]")) { 4.4. iptrtpproxy_delete(session_ids) - Delete sessions identified by session_ids. May be used when dialog is - being destroyed (BYE) or when INVITE failed in failure route. If - protected_session_ids list is provided then this set is excluded from + Delete sessions identified by session_ids. May be used when dialog is + being destroyed (BYE) or when INVITE failed in failure route. If + protected_session_ids list is provided then this set is excluded from sessions to be deleted. Example 1.6. iptrtpproxy_delete usage @@ -420,13 +416,13 @@ t[-1]")) { 4.5. iptrtpproxy_authorize_media() Authorizes SDP media according currect codec_set. If bit AND operation - between rights in codec set and remove_codec_mask is non zero then - such a codec are to be removed. The result may be obtained from - @iptrtpproxy.auth_rights which returns max. right which has been + between rights in codec set and remove_codec_mask is non zero then such + a codec are to be removed. The result may be obtained from + @iptrtpproxy.auth_rights which returns max. right which has been applied when processing all codecs of enabled streams. - The function MUST NOT be called after iptrtpproxy_alloc/update! But - the function may be called several times to authorize using more codec + The function MUST NOT be called after iptrtpproxy_alloc/update! But the + function may be called several times to authorize using more codec sets. Example 1.7. iptrtpproxy_authorize_media usage @@ -458,22 +454,22 @@ t[-1]")) { 4.6. iptrtpproxy_set_param(param, value) Set particular parameter needed mainly by - iptrtpproxy_alloc/update/adjust_timeout. The paramter value is - availble via @iptrtpproxy.. - * Supported parameters: expiration_timeout, ttl, learning_timeout, - always_learn, aggregation_a, aggregation_b, switchboard_a, - switchboard_b, throttle_mark, throttle_rtp_max_bytes, - throttle_rtp_max_packets, throttle_rtcp_max_bytes, + iptrtpproxy_alloc/update/adjust_timeout. The paramter value is availble + via @iptrtpproxy.. + * Supported parameters: expiration_timeout, ttl, learning_timeout, + always_learn, aggregation_a, aggregation_b, switchboard_a, + switchboard_b, throttle_mark, throttle_rtp_max_bytes, + throttle_rtp_max_packets, throttle_rtcp_max_bytes, throttle_rtcp_max_packets. 4.7. iptrtpproxy_set_param("(aggregation/switchboard)_by_sip_ip_(a/b)", sip_ip) - Find corresponding aggregation or switchboard and set - @iptrtpproxy.aggregation_a/b or @iptrtpproxy.switchboard_a/b. - Switchboards/aggregations are compared against sip-addr, it allow + Find corresponding aggregation or switchboard and set + @iptrtpproxy.aggregation_a/b or @iptrtpproxy.switchboard_a/b. + Switchboards/aggregations are compared against sip-addr, it allow separate SIP and RTP traffic and RTP aggregation. - * sip_ip IP to be compared, typically @received.ip or + * sip_ip IP to be compared, typically @received.ip or @next_hop.src_ip. * function returns true if switchboard/aggregation was found @@ -484,9 +480,8 @@ sip_ip) 4.9. iptrtpproxy_set_param("o_name", value) - Username to be rewritten at o= line by iptrtpproxy_alloc/update to - hide caller identity. If value is blank then username is left - unchanged. + Username to be rewritten at o= line by iptrtpproxy_alloc/update to hide + caller identity. If value is blank then username is left unchanged. 4.10. iptrtpproxy_set_param("o_addr", value) @@ -495,7 +490,7 @@ sip_ip) 4.11. iptrtpproxy_set_param("codec_set", value) - Codec set for iptrtpproxy_authorize_media. Current codec set may be + Codec set for iptrtpproxy_authorize_media. Current codec set may be obtained by @iptrtpproxy.codec_set. 4.12. iptrtpproxy_set_param("remove_codec_mask", value) @@ -505,20 +500,20 @@ sip_ip) 5. Selects - 5.1. @iptrtpproxy.session_ids - 5.2. @iptrtpproxy.sdp_ip - 5.3. @iptrtpproxy.o_name - 5.4. @iptrtpproxy.o_addr - 5.5. @iptrtpproxy.auth_rights - 5.6. @iptrtpproxy.active_media_num + 5.1. @iptrtpproxy.session_ids + 5.2. @iptrtpproxy.sdp_ip + 5.3. @iptrtpproxy.o_name + 5.4. @iptrtpproxy.o_addr + 5.5. @iptrtpproxy.auth_rights + 5.6. @iptrtpproxy.active_media_num 5.1. @iptrtpproxy.session_ids Returns sessions allocated/updated in iptrtpproxy_alloc/update. The format is: -switchboard_name [ ":" [ session_id "/" created ] * ( "," session_id "/" create -d ) ] ] +switchboard_name [ ":" [ session_id "/" created ] * ( "," session_id "/" created + ) ] ] session_id = * ( [0-9] ) ; empty when no session allocated created = timestamp @@ -540,6 +535,6 @@ created = timestamp 5.6. @iptrtpproxy.active_media_num - Returns number of active media streams in SDP. - iptrtpproxy_authorize_media may disable some streams, i.e. returned + Returns number of active media streams in SDP. + iptrtpproxy_authorize_media may disable some streams, i.e. returned value may change after authorization. diff --git a/modules/jansson/Makefile b/modules/jansson/Makefile index 2d033a415e4..7680f718199 100644 --- a/modules/jansson/Makefile +++ b/modules/jansson/Makefile @@ -1,21 +1,28 @@ # # jansson module makefile # -# +# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs auto_gen= NAME=jansson.so -BUILDER = $(shell which pkg-config) -ifeq ($(BUILDER),) - DEFS+=-I$(LOCALBASE)/include \ - LIBS+=-L$(SYSBASE)/include/lib -L$(LOCALBASE)/lib -ljansson +ifeq ($(CROSS_COMPILE),) +JNS_BUILDER=$(shell \ + if pkg-config --exists jansson; then \ + echo 'pkg-config jansson'; \ + fi) +endif + +ifneq ($(JNS_BUILDER),) + DEFS += $(shell $(JNS_BUILDER) --cflags) + LIBS += $(shell $(JNS_BUILDER) --libs) else - DEFS+= $(shell pkg-config --cflags jansson) - LIBS+= $(shell pkg-config --libs jansson) + DEFS+=-I$(LOCALBASE)/include + LIBS+=-L$(SYSBASE)/include/lib -L$(LOCALBASE)/lib -ljansson endif + DEFS+=-DOPENSER_MOD_INTERFACE SERLIBPATH=../../lib diff --git a/modules/jansson/README b/modules/jansson/README index 87d28a84a3a..1a3dc118e27 100644 --- a/modules/jansson/README +++ b/modules/jansson/README @@ -10,7 +10,11 @@ Matthew Williams - Copyright 2013 Flowroute LLC (flowroute.com) +Carsten Bock + + + + Copyright © 2013 Flowroute LLC (flowroute.com) __________________________________________________________________ Table of Contents @@ -23,17 +27,13 @@ Matthew Williams 2.1. Kamailio Modules 2.2. External Libraries or Applications - 3. Parameters - - 3.1. + 3. Functions - 4. Functions - - 4.1. jansson_get(key/path, src, dst) - 4.2. jansson_set(type, key/path, value, result) - 4.3. jansson_append(type, key/path, value, result) - 4.4. jansson_array_size(key/path, src, dst) - 4.5. jansson_get_field(src, field_name, dst) + 3.1. jansson_get(key/path, src, dst) + 3.2. jansson_set(type, key/path, value, result) + 3.3. jansson_append(type, key/path, value, result) + 3.4. jansson_array_size(key/path, src, dst) + 3.5. jansson_get_field(src, field_name, dst) List of Examples @@ -54,17 +54,13 @@ Chapter 1. Admin Guide 2.1. Kamailio Modules 2.2. External Libraries or Applications - 3. Parameters - - 3.1. - - 4. Functions + 3. Functions - 4.1. jansson_get(key/path, src, dst) - 4.2. jansson_set(type, key/path, value, result) - 4.3. jansson_append(type, key/path, value, result) - 4.4. jansson_array_size(key/path, src, dst) - 4.5. jansson_get_field(src, field_name, dst) + 3.1. jansson_get(key/path, src, dst) + 3.2. jansson_set(type, key/path, value, result) + 3.3. jansson_append(type, key/path, value, result) + 3.4. jansson_array_size(key/path, src, dst) + 3.5. jansson_get_field(src, field_name, dst) 1. Overview @@ -87,21 +83,15 @@ Chapter 1. Admin Guide running Kamailio with this module loaded: * jansson (http://www.digip.org/jansson/), tested with: 2.2+ -3. Parameters +3. Functions - 3.1. + 3.1. jansson_get(key/path, src, dst) + 3.2. jansson_set(type, key/path, value, result) + 3.3. jansson_append(type, key/path, value, result) + 3.4. jansson_array_size(key/path, src, dst) + 3.5. jansson_get_field(src, field_name, dst) - None - -4. Functions - - 4.1. jansson_get(key/path, src, dst) - 4.2. jansson_set(type, key/path, value, result) - 4.3. jansson_append(type, key/path, value, result) - 4.4. jansson_array_size(key/path, src, dst) - 4.5. jansson_get_field(src, field_name, dst) - -4.1. jansson_get(key/path, src, dst) +3.1. jansson_get(key/path, src, dst) Copy the value at the location 'path' from the json object 'src' and store it in pvar 'dst'. @@ -115,13 +105,16 @@ Chapter 1. Admin Guide the pvar is not changed. If it had a previous value, that value remains unchanged. + Note: For JSON-Integer values exceeding the C-Integer boundaries, a + String representing the number is returned. + Example 1.1. jansson_get usage ... jansson_get("inner.deep.list[3]", $var(myjson), "$var(n)"); xlog("foo is $var(n)"); ... -4.2. jansson_set(type, key/path, value, result) +3.2. jansson_set(type, key/path, value, result) Insert 'value' as 'type' at location 'path' into 'result'. @@ -132,6 +125,10 @@ xlog("foo is $var(n)"); as 'int', 'str', and 'obj'. 'value' is ignored when type is 'true', 'false', or 'null'. + Note: If you want to insert a JSON-Integer value exceeding the + C-Integer boundaries (e.g. C-type long), the a the number can be + provided as a string. + Example 1.2. jansson_set usage ... # create a new json object and put a string in it at key "mystr" @@ -156,7 +153,7 @@ jansson_set("str", "myobj.foo", "baz", "$var(myjson)"); :3.14159, "myobj":{"foo":"baz"}}' ... -4.3. jansson_append(type, key/path, value, result) +3.3. jansson_append(type, key/path, value, result) Like jansson_set but can be used to append to arrays. It can also be used to combine two json objects. @@ -190,7 +187,7 @@ jansson_append('obj', "", '{"a":1, "b":100}', "$var(newobj)"); # $var(newobj) == '{"a":1,"b":100","c":3}'; ... -4.4. jansson_array_size(key/path, src, dst) +3.4. jansson_array_size(key/path, src, dst) Puts the size of the array in 'src' at location 'path' into the pvar 'dst'. @@ -222,7 +219,7 @@ while($var(count) < $var(appendme_size)) { } ... -4.5. jansson_get_field(src, field_name, dst) +3.5. jansson_get_field(src, field_name, dst) Copy field 'field_name' from json object 'src' and store it in pvar 'dst'. diff --git a/modules/jansson/doc/jansson.xml b/modules/jansson/doc/jansson.xml index 4d05657129d..134fe7abf2b 100644 --- a/modules/jansson/doc/jansson.xml +++ b/modules/jansson/doc/jansson.xml @@ -23,6 +23,11 @@ Williams matthew@flowroute.com + + Carsten + Bock + carsten@ng-voice.com + 2013 diff --git a/modules/jansson/doc/jansson_admin.xml b/modules/jansson/doc/jansson_admin.xml index baab6864e61..4af2afb011c 100644 --- a/modules/jansson/doc/jansson_admin.xml +++ b/modules/jansson/doc/jansson_admin.xml @@ -51,23 +51,15 @@ -
- Parameters -
- - None - -
-
Functions -
+
<function moreinfo="none">jansson_get(key/path, src, dst)</function> - Copy the value at the location 'path' from the json object 'src' and store it in pvar 'dst'. + Copy the value at the location 'path' from the json object 'src' and store it in pvar 'dst'. The path string supports dot delimited notation (e.g. foo.bar.baz), array notation (e.g. [0]), or a combination of the two (e.g. foo.bar[0][1].baz). @@ -77,6 +69,9 @@ If the key/path can't be found in the JSON data structure, the pvar is not changed. If it had a previous value, that value remains unchanged. + + Note: For JSON-Integer values exceeding the C-Integer boundaries, a String representing the number is returned. + <function>jansson_get</function> usage @@ -87,7 +82,7 @@ xlog("foo is $var(n)");
-
+
<function moreinfo="none">jansson_set(type, key/path, value, result)</function> @@ -101,6 +96,9 @@ xlog("foo is $var(n)"); Valid 'type' parameters are 'integer', 'real', 'string', 'object', 'array', 'true', 'false', and 'null' as well as abbriviated names such as 'int', 'str', and 'obj'. 'value' is ignored when type is 'true', 'false', or 'null'. + + Note: If you want to insert a JSON-Integer value exceeding the C-Integer boundaries (e.g. C-type long), the a the number can be provided as a string. + <function>jansson_set</function> usage @@ -126,7 +124,7 @@ jansson_set("str", "myobj.foo", "baz", "$var(myjson)");
-
+
<function moreinfo="none">jansson_append(type, key/path, value, result)</function> @@ -165,7 +163,7 @@ jansson_append('obj', "", '{"a":1, "b":100}', "$var(newobj)");
-
+
<function moreinfo="none">jansson_array_size(key/path, src, dst)</function> @@ -207,7 +205,7 @@ while($var(count) < $var(appendme_size)) {
-
+
<function moreinfo="none">jansson_get_field(src, field_name, dst)</function> diff --git a/modules/jansson/jansson_funcs.c b/modules/jansson/jansson_funcs.c index fbae7410f9d..e99eb643786 100644 --- a/modules/jansson/jansson_funcs.c +++ b/modules/jansson/jansson_funcs.c @@ -135,7 +135,7 @@ int janssonmod_set(unsigned int append, struct sip_msg* msg, char* type_in, json_t* result_json = NULL; json_t* value = NULL; char* freeme = NULL; - json_error_t parsing_error; + json_error_t parsing_error = {0}; char* endptr; /* check the type */ @@ -163,7 +163,7 @@ int janssonmod_set(unsigned int append, struct sip_msg* msg, char* type_in, }else if(STR_EQ_STATIC(type_s, "integer") || STR_EQ_STATIC(type_s, "int")) { - int i = strtol(value_s.s, &endptr, 10); + long long i = strtoll(value_s.s, &endptr, 10); if(*endptr != '\0') { ERR("parsing int failed for \"%s\"\n", value_s.s); goto fail; diff --git a/modules/jansson/jansson_utils.c b/modules/jansson/jansson_utils.c index 4919b0e11c1..637ff270207 100644 --- a/modules/jansson/jansson_utils.c +++ b/modules/jansson/jansson_utils.c @@ -23,6 +23,7 @@ #define _GNU_SOURCE #include #include +#include #include "../../lvalue.h" @@ -57,9 +58,21 @@ int jansson_to_val(pv_value_t* val, char** freeme, json_t* v) { val->rs.len = strlen(value); val->flags = PV_VAL_STR; }else if(json_is_integer(v)) { - int value = json_integer_value(v); - val->ri = value; - val->flags = PV_TYPE_INT|PV_VAL_INT; + long long value = json_integer_value(v); + if ((value > INT_MAX) || (value < INT_MIN)) { + char* svalue = NULL; + if (asprintf(&svalue, "%"JSON_INTEGER_FORMAT, value) < 0) { + ERR("asprintf failed\n"); + return -1; + } + *freeme = svalue; + val->rs.s = svalue; + val->rs.len = strlen(svalue); + val->flags = PV_VAL_STR; + } else { + val->ri = (int)value; + val->flags = PV_TYPE_INT|PV_VAL_INT; + } }else if(json_is_null(v)) { val->flags = PV_VAL_NULL; }else { diff --git a/modules/janssonrpc-c/README b/modules/janssonrpc-c/README index 53c3ca20de1..1aa13f03473 100644 --- a/modules/janssonrpc-c/README +++ b/modules/janssonrpc-c/README @@ -10,7 +10,7 @@ Matthew Williams - Copyright 2013 Flowroute LLC (flowroute.com) + Copyright © 2013 Flowroute LLC (flowroute.com) __________________________________________________________________ Table of Contents @@ -129,7 +129,7 @@ modparam("janssonrpc-c", "min_srv_ttl", 30) The PV spec where to store the result of a call to janssonrpc_request(). It can be any writtable PV. - Default value is "$var(jsrpc_result)". + Default value is “$var(jsrpc_result)”. Example 1.2. Set result_pv parameter ... @@ -189,7 +189,7 @@ modparam("janssonrpc-s", "retry_codes", "-32603, -32000..-32099"); 4.2. janssonrpc_request(conn, method, params[, options]]) 4.3. Error Handling -4.1. janssonrpc_notification(conn, method, parameters) +4.1. janssonrpc_notification(conn, method, parameters) * conn - name for a collection of servers (required) * method - jsonrpc method (required) @@ -211,7 +211,7 @@ janssonrpc_notification("user_db", "update_user", '{"id": 1234, "name": "Daniel" }'); ... -4.2. janssonrpc_request(conn, method, params[, options]]) +4.2. janssonrpc_request(conn, method, params[, options]]) The conn, method, params, and options can be a static string or a dynamic string value with config variables. @@ -261,7 +261,7 @@ route[RESPONSE] { } ... -4.3. Error Handling +4.3. Error Handling When a route is specified as part of the janssonrpc_request() function, a JSON object is stored in the result pseudo-variable (see diff --git a/modules/janssonrpc-c/janssonrpc_io.c b/modules/janssonrpc-c/janssonrpc_io.c index 1e1a82b7ac0..7cdb229aecd 100644 --- a/modules/janssonrpc-c/janssonrpc_io.c +++ b/modules/janssonrpc-c/janssonrpc_io.c @@ -39,6 +39,7 @@ #include "../../action.h" #include "../../route_struct.h" #include "../../lvalue.h" +#include "../../cfg/cfg_struct.h" #include "../../rand/fastrand.h" #include "../tm/tm_load.h" #include "../jansson/jansson_utils.h" @@ -57,11 +58,15 @@ void io_shutdown(int sig); int jsonrpc_io_child_process(int cmd_pipe) { + struct event* pipe_ev = NULL; + global_ev_base = event_base_new(); global_evdns_base = evdns_base_new(global_ev_base, 1); set_non_blocking(cmd_pipe); - struct event* pipe_ev = event_new(global_ev_base, cmd_pipe, EV_READ | EV_PERSIST, cmd_pipe_cb, NULL); + pipe_ev = event_new(global_ev_base, cmd_pipe, + EV_READ | EV_PERSIST, cmd_pipe_cb, NULL); + if(!pipe_ev) { ERR("Failed to create pipe event\n"); return -1; @@ -423,15 +428,19 @@ int jsonrpc_send(str conn, jsonrpc_request_t* req, bool notify_only) if(ns) pkg_free(ns); if(json) free(json); - if (sent && notify_only == false) { - - const struct timeval tv = ms_to_tv(req->timeout); + if (sent) { + if (notify_only == true) { // free the request if using janssonrpc_notification function + free_req_cmd(req->cmd); + free_request(req); + } else { + const struct timeval tv = ms_to_tv(req->timeout); - req->timeout_ev = evtimer_new(global_ev_base, timeout_cb, (void*)req); - if(event_add(req->timeout_ev, &tv)<0) { - ERR("event_add failed while setting request timer (%s).", - strerror(errno)); - return -1; + req->timeout_ev = evtimer_new(global_ev_base, timeout_cb, (void*)req); + if(event_add(req->timeout_ev, &tv)<0) { + ERR("event_add failed while setting request timer (%s).", + strerror(errno)); + return -1; + } } } @@ -449,6 +458,7 @@ void cmd_pipe_cb(int fd, short event, void *arg) return; } + cfg_update(); switch(cmd->type) { case CMD_CLOSE: diff --git a/modules/janssonrpc-c/janssonrpc_mod.c b/modules/janssonrpc-c/janssonrpc_mod.c index 7db22ccc50f..b54bc0faf52 100644 --- a/modules/janssonrpc-c/janssonrpc_mod.c +++ b/modules/janssonrpc-c/janssonrpc_mod.c @@ -29,6 +29,7 @@ #include "../../trim.h" #include "../../sr_module.h" #include "../../timer_proc.h" +#include "../../cfg/cfg_struct.h" #include "../tm/tm_load.h" #include "../jansson/jansson_utils.h" @@ -158,7 +159,7 @@ static int child_init(int rank) { int pid; - if (rank>PROC_MAIN) + if (rank!=PROC_INIT) cmd_pipe = pipe_fds[1]; if (rank!=PROC_MAIN) @@ -194,6 +195,7 @@ static int child_init(int rank) return -1; /* error */ if(pid==0){ /* child */ + if (cfg_child_init()) return -1; close(pipe_fds[1]); return jsonrpc_io_child_process(pipe_fds[0]); } diff --git a/modules/janssonrpc-c/netstring.c b/modules/janssonrpc-c/netstring.c index a559224fab9..7414f0d204b 100644 --- a/modules/janssonrpc-c/netstring.c +++ b/modules/janssonrpc-c/netstring.c @@ -141,12 +141,14 @@ int netstring_read_fd(int fd, netstring_t **netstring) int bytes, offset; size_t read_len; char *temp_buffer; + int total; + int i, len; + char peek[10]={0}; temp_buffer = NULL; offset = 0; if (*netstring == NULL) { /* No buffer yet. Peek at first 10 bytes, to get length and colon. */ - char peek[10]={0}; bytes = recv(fd,peek,10,MSG_PEEK); if (bytes < 3) return NETSTRING_INCOMPLETE; @@ -158,7 +160,6 @@ int netstring_read_fd(int fd, netstring_t **netstring) /* The netstring must start with a number */ if (!isdigit(peek[0])) return NETSTRING_ERROR_NO_LENGTH; - int i, len; len = i = 0; /* Read the number of bytes */ @@ -194,7 +195,8 @@ int netstring_read_fd(int fd, netstring_t **netstring) /* Read from the socket */ bytes = recv(fd, temp_buffer, read_len, 0); - int total = (*netstring)->read += bytes; + (*netstring)->read += bytes; + total = (*netstring)->read; /* See if we have the whole netstring yet */ if (read_len > bytes) { diff --git a/modules/json/README b/modules/json/README index b74bd697de8..c0bcea4b5cb 100644 --- a/modules/json/README +++ b/modules/json/README @@ -10,7 +10,7 @@ Matthew Williams - Copyright 2011 Flowroute LLC (flowroute.com) + Copyright © 2011 Flowroute LLC (flowroute.com) __________________________________________________________________ Table of Contents @@ -69,7 +69,7 @@ Chapter 1. Admin Guide 3.1. json_get_field(json_string, field_name, destination) -3.1. json_get_field(json_string, field_name, destination) +3.1. json_get_field(json_string, field_name, destination) Copy field 'field_name' from json object 'json_string' and store it in pvar 'destination'. diff --git a/modules/json/json_funcs.c b/modules/json/json_funcs.c index 106eef11d5c..4d73c73b969 100644 --- a/modules/json/json_funcs.c +++ b/modules/json/json_funcs.c @@ -39,6 +39,8 @@ int json_get_field(struct sip_msg* msg, char* json, char* field, char* dst) pv_value_t dst_val; char *value; struct json_object *j = NULL; + struct json_object *oj = NULL; + int ret; if (fixup_get_svalue(msg, (gparam_p)json, &json_s) != 0) { LM_ERR("cannot get json string value\n"); @@ -61,13 +63,18 @@ int json_get_field(struct sip_msg* msg, char* json, char* field, char* dst) return -1; } - value = (char*)json_object_to_json_string(json_object_object_get(j, field_s.s)); - - dst_val.rs.s = value; - dst_val.rs.len = strlen(value); - dst_val.flags = PV_VAL_STR; - dst_pv->setf(msg, &dst_pv->pvp, (int)EQ_T, &dst_val); + json_object_object_get_ex(j, field_s.s, &oj); + if(oj!=NULL) { + value = (char*)json_object_to_json_string(oj); + dst_val.rs.s = value; + dst_val.rs.len = strlen(value); + dst_val.flags = PV_VAL_STR; + dst_pv->setf(msg, &dst_pv->pvp, (int)EQ_T, &dst_val); + ret = 1; + } else { + ret = -1; + } if(j!=NULL) json_object_put(j); - return 1; + return ret; } diff --git a/modules/jsonrpc-c/README b/modules/jsonrpc-c/README index 20676eea931..603fcc71fca 100644 --- a/modules/jsonrpc-c/README +++ b/modules/jsonrpc-c/README @@ -10,7 +10,7 @@ Jordan Levy - Copyright 2011 Flowroute LLC (flowroute.com) + Copyright © 2011 Flowroute LLC (flowroute.com) __________________________________________________________________ Table of Contents @@ -26,6 +26,7 @@ Jordan Levy 3. Parameters 3.1. servers (string) + 3.2. max_conn_attempts (int) 4. Functions @@ -36,8 +37,9 @@ Jordan Levy List of Examples 1.1. Set servers parameter - 1.2. jsonrpc_notification usage - 1.3. jsonrpc_request usage + 1.2. Set max_conn_attempts parameter + 1.3. jsonrpc_notification usage + 1.4. jsonrpc_request usage Chapter 1. Admin Guide @@ -52,6 +54,7 @@ Chapter 1. Admin Guide 3. Parameters 3.1. servers (string) + 3.2. max_conn_attempts (int) 4. Functions @@ -96,6 +99,7 @@ Chapter 1. Admin Guide 3. Parameters 3.1. servers (string) + 3.2. max_conn_attempts (int) 3.1. servers (string) @@ -110,13 +114,23 @@ modparam("jsonrpc", "servers", "localhost:9999,2 10.10.0.1:9999,2 backup.server: 9999,1") ... +3.2. max_conn_attempts (int) + + Max number of connection attempts for a server. -1 will keep + reconnecting forever, 0 will skip any attempt to reconnect. + + Example 1.2. Set max_conn_attempts parameter +... +modparam("jsonrpc", "max_conn_attempts", 10) +... + 4. Functions 4.1. jsonrpc_notification(method, parameters) 4.2. jsonrpc_request(method, parameters, return_route, error_route, result_var) -4.1. jsonrpc_notification(method, parameters) +4.1. jsonrpc_notification(method, parameters) Invokes the remote 'method' with the given 'parameters' as a notification. Unlike jsonrpc_request (below), notifications do not @@ -126,12 +140,12 @@ modparam("jsonrpc", "servers", "localhost:9999,2 10.10.0.1:9999,2 backup.server: The method and parameters can be a static string or dynamic string value with config variables. - Example 1.2. jsonrpc_notification usage + Example 1.3. jsonrpc_notification usage ... jsonrpc_notification("update_user", "{'id': 1234, 'name': 'Petros'}") ... -4.2. jsonrpc_request(method, parameters, return_route, error_route, +4.2. jsonrpc_request(method, parameters, return_route, error_route, result_var) Invokes the remote 'method' with the given 'parameters'. When the @@ -154,7 +168,7 @@ result_var) variable is set after the response is received, it is possible to use a $var for this parameter. - Example 1.3. jsonrpc_request usage + Example 1.4. jsonrpc_request usage ... jsonrpc_request("get_user", "{'id': 1234}", "RESPONSE", "ERROR", "$var(result)") ; diff --git a/modules/jsonrpc-c/jsonrpc.c b/modules/jsonrpc-c/jsonrpc.c index 7baed545f45..834a7dd1404 100644 --- a/modules/jsonrpc-c/jsonrpc.c +++ b/modules/jsonrpc-c/jsonrpc.c @@ -70,34 +70,38 @@ jsonrpc_request_t* build_jsonrpc_request(char *method, json_object *params, char return req; } -json_object* build_jsonrpc_notification(char *method, json_object *params) +json_object* build_jsonrpc_notification(char *method, json_object *params) { json_object *req = json_object_new_object(); json_object_object_add(req, "jsonrpc", json_object_new_string("2.0")); json_object_object_add(req, "method", json_object_new_string(method)); json_object_object_add(req, "params", params); - return req; + return req; } int handle_jsonrpc_response(json_object *response) { - jsonrpc_request_t *req; - json_object *_id = json_object_object_get(response, "id"); - int id = json_object_get_int(_id); - + jsonrpc_request_t *req; + json_object *_id = NULL; + int id = 0; + json_object *result = NULL; + + json_object_object_get_ex(response, "id", &_id); + id = json_object_get_int(_id); if (!(req = get_request(id))) { json_object_put(response); return -1; } - json_object *result = json_object_object_get(response, "result"); - + json_object_object_get_ex(response, "result", &result); + if (result) { req->cbfunc(result, req->cbdata, 0); } else { - json_object *error = json_object_object_get(response, "error"); + json_object *error = NULL; + json_object_object_get_ex(response, "error", &error); if (error) { req->cbfunc(error, req->cbdata, 1); } else { @@ -105,7 +109,7 @@ int handle_jsonrpc_response(json_object *response) return -1; } } - + if (req->timer_ev) { close(req->timerfd); event_del(req->timer_ev); @@ -125,14 +129,14 @@ jsonrpc_request_t* get_request(int id) { int key = id_hash(id); jsonrpc_request_t *req, *prev_req = NULL; req = request_table[key]; - + while (req && req->id != id) { prev_req = req; if (!(req = req->next)) { break; }; } - + if (req && req->id == id) { if (prev_req != NULL) { prev_req-> next = req->next; diff --git a/modules/jsonrpc-c/jsonrpc_mod.c b/modules/jsonrpc-c/jsonrpc_mod.c index f462a1457b0..39d881975a6 100644 --- a/modules/jsonrpc-c/jsonrpc_mod.c +++ b/modules/jsonrpc-c/jsonrpc_mod.c @@ -115,15 +115,15 @@ static int mod_init(void) { LM_ERR("pipe() failed\n"); return -1; } - + return(0); } -static int child_init(int rank) +static int child_init(int rank) { int pid; - - if (rank>PROC_MAIN) + + if (rank!=PROC_INIT) cmd_pipe = pipe_fds[1]; if (rank!=PROC_MAIN) diff --git a/modules/jsonrpc-s/README b/modules/jsonrpc-s/README index 5d1e328b5b9..6e8339b1673 100644 --- a/modules/jsonrpc-s/README +++ b/modules/jsonrpc-s/README @@ -10,7 +10,7 @@ Daniel-Constantin Mierla - Copyright 2014 asipto.com + Copyright © 2014 asipto.com __________________________________________________________________ Table of Contents @@ -221,7 +221,7 @@ modparam("jsonrpc-s", "fifo_user", "root") Directory to be used for creating the reply FIFO files. - Default value is "/tmp/" + Default value is “/tmp/” Example 1.7. Set fifo_reply_dir parameter ... @@ -233,7 +233,7 @@ modparam("jsonrpc-s", "fifo_reply_dir", "/home/kamailio/tmp/") 4.1. jsonrpc_dispatch() 4.2. jsonrpc_exec(cmd) -4.1. jsonrpc_dispatch() +4.1. jsonrpc_dispatch() Handle the JSONRPC request and generate a response. @@ -280,7 +280,7 @@ event_route[xhttp:request] { } ... -4.2. jsonrpc_exec(cmd) +4.2. jsonrpc_exec(cmd) Execute a JSON-RPC command given as a parameter. diff --git a/modules/jsonrpc-s/jsonrpc-s_mod.c b/modules/jsonrpc-s/jsonrpc-s_mod.c index 62f25064a6e..71d0f8d9677 100644 --- a/modules/jsonrpc-s/jsonrpc-s_mod.c +++ b/modules/jsonrpc-s/jsonrpc-s_mod.c @@ -327,7 +327,7 @@ static int jsonrpc_send(jsonrpc_ctx_t* ctx) nj->valuestring, strlen(nj->valuestring)); } else { srjson_AddNumberToObject(ctx->jrpl, ctx->jrpl->root, "id", - nj->valueint); + nj->valuedouble); } } @@ -519,14 +519,20 @@ static int jsonrpc_scan(jsonrpc_ctx_t* ctx, char* fmt, ...) auto_convert = 1; continue; case 'b': /* Bool */ + uint_ptr = va_arg(ap, unsigned int*); + *uint_ptr = SRJSON_GET_UINT(ctx->req_node); + break; case 't': /* Date and time */ + uint_ptr = va_arg(ap, unsigned int*); + *uint_ptr = SRJSON_GET_UINT(ctx->req_node); + break; case 'd': /* Integer */ int_ptr = va_arg(ap, int*); - *int_ptr = ctx->req_node->valueint; + *int_ptr = SRJSON_GET_INT(ctx->req_node); break; - case 'u': /* Integer */ + case 'u': /* Unsigned Integer */ uint_ptr = va_arg(ap, unsigned int*); - *uint_ptr = (unsigned int)ctx->req_node->valueint; + *uint_ptr = SRJSON_GET_UINT(ctx->req_node); break; case 'f': /* double */ double_ptr = va_arg(ap, double*); @@ -538,7 +544,8 @@ static int jsonrpc_scan(jsonrpc_ctx_t* ctx, char* fmt, ...) *char_ptr = ctx->req_node->valuestring; } else if(auto_convert == 1) { if(ctx->req_node->type==srjson_Number) { - *char_ptr = int2str(ctx->req_node->valueint, &stmp.len); + *char_ptr = int2str(SRJSON_GET_ULONG(ctx->req_node), + &stmp.len); } else { *char_ptr = NULL; goto error; @@ -555,7 +562,7 @@ static int jsonrpc_scan(jsonrpc_ctx_t* ctx, char* fmt, ...) str_ptr->len = strlen(ctx->req_node->valuestring); } else if(auto_convert == 1) { if(ctx->req_node->type==srjson_Number) { - str_ptr->s = int2str(ctx->req_node->valueint, + str_ptr->s = int2str(SRJSON_GET_ULONG(ctx->req_node), &str_ptr->len); } else { str_ptr->s = NULL; @@ -571,7 +578,7 @@ static int jsonrpc_scan(jsonrpc_ctx_t* ctx, char* fmt, ...) case '{': case '[': LM_ERR("Unsupported param type '%c'\n", *fmt); - jsonrpc_fault(ctx, 500, "Unsupported param type"); + jsonrpc_fault(ctx, 400, "Unsupported param type"); goto error; default: LM_ERR("Invalid param type in formatting string: [%c]\n", *fmt); @@ -1041,7 +1048,7 @@ static int jsonrpc_dispatch(sip_msg_t* msg, char* s1, char* s2) ctx->jreq = srjson_NewDoc(NULL); if(ctx->jreq==NULL) { LM_ERR("Failed to init the json document\n"); - return NONSIP_MSG_PASS; + return NONSIP_MSG_ERROR; } ctx->jreq->buf.s = get_body(msg); @@ -1050,7 +1057,7 @@ static int jsonrpc_dispatch(sip_msg_t* msg, char* s1, char* s2) if(ctx->jreq->root == NULL) { LM_ERR("invalid json doc [[%s]]\n", ctx->jreq->buf.s); - return NONSIP_MSG_PASS; + return NONSIP_MSG_ERROR; } if (jsonrpc_init_reply(ctx) < 0) goto send_reply; diff --git a/modules/kazoo/README b/modules/kazoo/README index 659a978f365..2a66143a92a 100644 --- a/modules/kazoo/README +++ b/modules/kazoo/README @@ -51,13 +51,15 @@ Luis Azedo 4.3.1. amqp_consumer_ack_timeout(str) 4.3.2. amqp_interprocess_timeout(str) - 4.3.3. amqp_waitframe_timout(str) - 4.3.4. amqp_query_timout(str) + 4.3.3. amqp_waitframe_tiemout(str) + 4.3.4. amqp_query_timeout(str) + 4.3.5. amqp_query_timeout_avp(str) 4.4. presence related 4.4.1. db_url(str) 4.4.2. presentity_table(str) + 4.4.3. pua_mode(int) 5. Functions @@ -102,19 +104,21 @@ Luis Azedo 1.12. Set single_consumer_on_reconnect parameter 1.13. Set amqp_consumer_ack_timeout parameter 1.14. Set amqp_interprocess_timeout parameter - 1.15. Set amqp_waitframe_timout parameter - 1.16. Set amqp_query_timout parameter - 1.17. Set db_url parameter - 1.18. Set presentity_table parameter - 1.19. kazoo_publish usage - 1.20. kazoo_query usage - 1.21. kazoo_subscribe usage - 1.22. kazoo_subscribe usage - 1.23. kazoo_pua_publish usage - 1.24. kazoo_encode usage - 1.25. kazoo_json usage - 1.26. kz.json usage - 1.27. kz.encode usage + 1.15. Set amqp_waitframe_timeout parameter + 1.16. Set amqp_query_timeout parameter + 1.17. >Set amqp_query_timeout_avp parameter + 1.18. Set db_url parameter + 1.19. Set presentity_table parameter + 1.20. Set pua_mode parameter + 1.21. kazoo_publish usage + 1.22. kazoo_query usage + 1.23. kazoo_subscribe usage + 1.24. kazoo_subscribe usage + 1.25. kazoo_pua_publish usage + 1.26. kazoo_encode usage + 1.27. kazoo_json usage + 1.28. kz.json usage + 1.29. kz.encode usage Chapter 1. Admin Guide @@ -154,13 +158,15 @@ Chapter 1. Admin Guide 4.3.1. amqp_consumer_ack_timeout(str) 4.3.2. amqp_interprocess_timeout(str) - 4.3.3. amqp_waitframe_timout(str) - 4.3.4. amqp_query_timout(str) + 4.3.3. amqp_waitframe_tiemout(str) + 4.3.4. amqp_query_timeout(str) + 4.3.5. amqp_query_timeout_avp(str) 4.4. presence related 4.4.1. db_url(str) 4.4.2. presentity_table(str) + 4.4.3. pua_mode(int) 5. Functions @@ -246,16 +252,16 @@ event_route[kazoo:consumer-event-presence-update] { # presence is the value extracted from Event-Category field in json payload # update is the value extracted from Event-Name field in json payload -xlog("L_INFO", "received $(kzE{kz.json,Event-Package}) update for $(kzE{kz.json -,From})"); +xlog("L_INFO", "received $(kzE{kz.json,Event-Package}) update for $(kzE{kz.json, +From})"); ... } event_route[kazoo:consumer-event-presence] { # presence is the value extracted from Event-Category field in json payload -xlog("L_INFO", "received $(kzE{kz.json,Event-Package}) update for $(kzE{kz.json -,From})"); +xlog("L_INFO", "received $(kzE{kz.json,Event-Package}) update for $(kzE{kz.json, +From})"); ... } @@ -324,13 +330,15 @@ event_route[kazoo:consumer-event] 4.3.1. amqp_consumer_ack_timeout(str) 4.3.2. amqp_interprocess_timeout(str) - 4.3.3. amqp_waitframe_timout(str) - 4.3.4. amqp_query_timout(str) + 4.3.3. amqp_waitframe_tiemout(str) + 4.3.4. amqp_query_timeout(str) + 4.3.5. amqp_query_timeout_avp(str) 4.4. presence related 4.4.1. db_url(str) 4.4.2. presentity_table(str) + 4.4.3. pua_mode(int) 4.1. amqp related @@ -510,29 +518,48 @@ modparam("kazoo", "amqp_interprocess_timeout_sec", 1) modparam("kazoo", "amqp_interprocess_timeout_micro", 200000) ... -4.3.3. amqp_waitframe_timout(str) +4.3.3. amqp_waitframe_tiemout(str) Timeout when checking for messages from rabbitmq. Default value is 100000 micro. - Example 1.15. Set amqp_waitframe_timout parameter + Example 1.15. Set amqp_waitframe_timeout parameter ... -modparam("kazoo", "amqp_waitframe_timout_sec", 1) -modparam("kazoo", "amqp_waitframe_timout_micro", 200000) +modparam("kazoo", "amqp_waitframe_timeout_sec", 1) +modparam("kazoo", "amqp_waitframe_timeout_micro", 200000) ... -4.3.4. amqp_query_timout(str) +4.3.4. amqp_query_timeout(str) Timeout when checking for reply messages from rabbitmq for kazoo_query commands. Default value is 2 sec. - Example 1.16. Set amqp_query_timout parameter + Example 1.16. Set amqp_query_timeout parameter ... -modparam("kazoo", "amqp_query_timout_sec", 1) -modparam("kazoo", "amqp_query_timout_micro", 200000) +modparam("kazoo", "amqp_query_timeout_sec", 1) +modparam("kazoo", "amqp_query_timeout_micro", 200000) +... + +4.3.5. amqp_query_timeout_avp(str) + + avp holding the value in seconds for Timeout when checking for reply + messages from rabbitmq for kazoo_query commands. + + Default value is NULL (no value). + + Example 1.17. >Set amqp_query_timeout_avp parameter +... +modparam("kazoo", "amqp_query_timeout_avp", "$var(kz_timeout)") + +route[SOME_ROUTE] +{ + $var(kz_timeout) = 12; + kazoo_query(exchange, routingkey, payload); +} + ... 4.4. presence related @@ -546,7 +573,7 @@ modparam("kazoo", "amqp_query_timout_micro", 200000) Default value is “NULL”. - Example 1.17. Set db_url parameter + Example 1.18. Set db_url parameter ... modparam("kazoo", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio") ... @@ -557,11 +584,23 @@ modparam("kazoo", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio") Default value is “presentity”. - Example 1.18. Set presentity_table parameter + Example 1.19. Set presentity_table parameter ... modparam("kazoo", "presentity_table", "my_presentity_table") ... +4.4.3. pua_mode(int) + + Control if the module has to connect to presence database tables. Set + it to 0 to not connect to database. + + Default value is “1”. + + Example 1.20. Set pua_mode parameter +... +modparam("kazoo", "pua_mode", 0) +... + 5. Functions 5.1. amqp related @@ -593,15 +632,14 @@ modparam("kazoo", "presentity_table", "my_presentity_table") This function can be used from ANY ROUTE. - Example 1.19. kazoo_publish usage + Example 1.21. kazoo_publish usage ... -$var(amqp_payload_request) = "{'Event-Category' : 'directory', 'Event-Name' : ' -reg_success', 'Contact' : '" + $var(fs_contact) + "', 'Call-ID' : '" + $ci + "' -, 'Realm' : '" + $fd +"', 'Username' : '" + $fU + "', 'From-User' : '" + $fU + -"', 'From-Host' : '" + $fd + "', 'To-User' : '" + $tU +"', 'To-Host' : '" + $td - + "', 'User-Agent' : '" + $ua +"' ," + $var(register_contants)+ " }"; -$var(amqp_routing_key) = "registration.success." + $(fd{kz.encode}) + "." + $fU -; +$var(amqp_payload_request) = "{'Event-Category' : 'directory', 'Event-Name' : 'r +eg_success', 'Contact' : '" + $var(fs_contact) + "', 'Call-ID' : '" + $ci + "', +'Realm' : '" + $fd +"', 'Username' : '" + $fU + "', 'From-User' : '" + $fU + "', + 'From-Host' : '" + $fd + "', 'To-User' : '" + $tU +"', 'To-Host' : '" + $td + " +', 'User-Agent' : '" + $ua +"' ," + $var(register_contants)+ " }"; +$var(amqp_routing_key) = "registration.success." + $(fd{kz.encode}) + "." + $fU; kazoo_publish("callmgr", $var(amqp_routing_key), $var(amqp_payload_request)); ... @@ -614,15 +652,15 @@ kazoo_publish("callmgr", $var(amqp_routing_key), $var(amqp_payload_request)); This function can be used from ANY ROUTE. - Example 1.20. kazoo_query usage + Example 1.22. kazoo_query usage ... $var(amqp_payload_request) = "{'Event-Category' : 'call_event' , 'Event-Name' : - 'query_user_channels_req', 'Realm' : '" + $fd + "', 'Username' : '" + $fU + "' -, 'Active-Only' : false }"; +'query_user_channels_req', 'Realm' : '" + $fd + "', 'Username' : '" + $fU + "', +'Active-Only' : false }"; kazoo_encode("$ci", "$var(callid_encoded)"); $var(amqp_routing_key) = "call.status_req.$var(callid_encoded)"; -if(kazoo_query("callevt", $var(amqp_routing_key), $var(amqp_payload_request), " -$var(amqp_result)")) { +if(kazoo_query("callevt", $var(amqp_routing_key), $var(amqp_payload_request), "$ +var(amqp_result)")) { kazoo_json("$var(amqp_result)", "Channels[0].switch_url", "$du"); if($du != $null) { xlog("L_INFO", "$ci|log|user channels found redirecting call to $du"); @@ -638,12 +676,12 @@ $var(amqp_result)")) { This function must be called from event_route[kazoo:mod-init]. - Example 1.21. kazoo_subscribe usage + Example 1.23. kazoo_subscribe usage ... event_route[kazoo:mod-init] { - kazoo_subscribe("dialoginfo", "direct", "BLF-QUEUE-MY_HOSTNAME", "BLF-MY_HOS -TNAME"); + kazoo_subscribe("dialoginfo", "direct", "BLF-QUEUE-MY_HOSTNAME", "BLF-MY_HOST +NAME"); } event_route[kazoo:consumer-event] @@ -670,13 +708,13 @@ event_route[kazoo:consumer-event] This function must be called from event_route[kazoo:mod-init]. - Example 1.22. kazoo_subscribe usage + Example 1.24. kazoo_subscribe usage ... event_route[kazoo:mod-init] { $var(payload) = "{ 'exchange' : 'dialoginfo' , 'type' : 'direct', 'queue' : - 'BLF-QUEUE-MY_HOSTNAME', 'routing' : 'BLF-MY_HOSTNAME', 'auto_delete' : 0, 'du -rable' : 1, 'no_ack' : 0, 'wait_for_consumer_ack' : 1 }"; +'BLF-QUEUE-MY_HOSTNAME', 'routing' : 'BLF-MY_HOSTNAME', 'auto_delete' : 0, 'dura +ble' : 1, 'no_ack' : 0, 'wait_for_consumer_ack' : 1 }"; kazoo_subscribe("$var(payload)"); } @@ -695,15 +733,15 @@ event_route[kazoo:consumer-event] This function can be used from ANY ROUTE. - Example 1.23. kazoo_pua_publish usage + Example 1.25. kazoo_pua_publish usage ... event_route[kazoo:consumer-event-presence-update] { - xlog("L_INFO", "received $(kzE{kz.json,Event-Package}) update for $(kzE{kz. -json,From})"); + xlog("L_INFO", "received $(kzE{kz.json,Event-Package}) update for $(kzE{kz.j +son,From})"); kazoo_pua_publish($kzE); - pres_refresh_watchers("$(kzE{kz.json,From})", "$(kzE{kz.json,Event-Package} -)", 1); + pres_refresh_watchers("$(kzE{kz.json,From})", "$(kzE{kz.json,Event-Package}) +", 1); } ... @@ -716,7 +754,7 @@ json,From})"); This function can be used from ANY ROUTE. - Example 1.24. kazoo_encode usage + Example 1.26. kazoo_encode usage ... kazoo_encode("$ci", "$var(callid_encoded)"); $var(amqp_routing_key) = "call.status_req.$var(callid_encoded)"; @@ -729,7 +767,7 @@ $var(amqp_routing_key) = "call.status_req.$var(callid_encoded)"; This function can be used from ANY ROUTE. - Example 1.25. kazoo_json usage + Example 1.27. kazoo_json usage ... kazoo_json("$var(amqp_result)", "Channels[0].switch_url", "$du"); if($du != $null) { @@ -747,7 +785,7 @@ if($du != $null) { The prefix for kazoo transformations is kz. * json - Example 1.26. kz.json usage + Example 1.28. kz.json usage ... #kazoo_json("$var(amqp_result)", "Channels[0].switch_url", "$du"); $du = $kzR{kz.json,Channels[0].switch_url}; @@ -757,7 +795,7 @@ if($du != $null) { } ... * encode - Example 1.27. kz.encode usage + Example 1.29. kz.encode usage ... #kazoo_encode("$ci", "$var(callid_encoded)"); #$var(amqp_routing_key) = "call.status_req.$var(callid_encoded)"; diff --git a/modules/kazoo/doc/kazoo_admin.xml b/modules/kazoo/doc/kazoo_admin.xml index 93846986f87..44900a1f1d5 100644 --- a/modules/kazoo/doc/kazoo_admin.xml +++ b/modules/kazoo/doc/kazoo_admin.xml @@ -556,7 +556,25 @@ modparam("kazoo", "presentity_table", "my_presentity_table")
- +
+ <varname>pua_mode</varname>(int) + + Control if the module has to connect to presence database tables. + Set it to 0 to not connect to database. + + + Default value is 1. + + + Set <varname>pua_mode</varname> parameter + +... +modparam("kazoo", "pua_mode", 0) +... + + +
+
diff --git a/modules/kazoo/kazoo.c b/modules/kazoo/kazoo.c index 28c97bd1229..060242dd047 100644 --- a/modules/kazoo/kazoo.c +++ b/modules/kazoo/kazoo.c @@ -393,6 +393,7 @@ static int mod_child_init(int rank) if (pid<0) return -1; /* error */ if(pid==0){ + if (cfg_child_init()) return -1; close(kz_worker_pipes_fds[i*2+1]); return(kz_amqp_consumer_worker_proc(kz_worker_pipes_fds[i*2])); } @@ -406,6 +407,7 @@ static int mod_child_init(int rank) if (pid<0) return -1; /* error */ if(pid==0){ + if (cfg_child_init()) return -1; return(kz_amqp_consumer_proc(s)); } } @@ -416,6 +418,7 @@ static int mod_child_init(int rank) if (pid<0) return -1; /* error */ if(pid==0){ + if (cfg_child_init()) return -1; close(kz_cmd_pipe_fds[1]); kz_amqp_publisher_proc(kz_cmd_pipe_fds[0]); } diff --git a/modules/kex/README b/modules/kex/README index 7e12a866c41..4909bacf78a 100644 --- a/modules/kex/README +++ b/modules/kex/README @@ -30,47 +30,48 @@ Ovidiu Sas 1. Admin Guide - 1.1. Overview - 1.2. Dependencies - - 1.2.1. Kamailio Modules - 1.2.2. External Libraries or Applications - - 1.3. Functions - - 1.3.1. setsflag(flag) - 1.3.2. issflagset(flag) - 1.3.3. resetsflag(flag) - 1.3.4. setbflag(flag [, branch]) - 1.3.5. isbflagset(flag [, branch]) - 1.3.6. resetbflag(flag [, branch]) - 1.3.7. setdsturi(uri) - 1.3.8. resetdsturi() - 1.3.9. isdsturiset() - 1.3.10. pv_printf(var, str) - 1.3.11. is_myself(uri) - 1.3.12. setdebug(level) - 1.3.13. resetdebug() - 1.3.14. km_append_branch([uri]) - - 1.4. MI Commands - - 1.4.1. arg - 1.4.2. kill - 1.4.3. pwd - 1.4.4. uptime - 1.4.5. version - 1.4.6. which - 1.4.7. get_statistics - 1.4.8. reset_statistics - 1.4.9. clear_statistics - - 1.5. RPC Commands - - 1.5.1. pkg.stats - 1.5.2. stats.get_statistics - 1.5.3. stats.reset_statistics - 1.5.4. stats.clear_statistics + 1. Overview + 2. Dependencies + + 2.1. Kamailio Modules + 2.2. External Libraries or Applications + + 3. Functions + + 3.1. setsflag(flag) + 3.2. issflagset(flag) + 3.3. resetsflag(flag) + 3.4. setbflag(flag [, branch]) + 3.5. isbflagset(flag [, branch]) + 3.6. resetbflag(flag [, branch]) + 3.7. setdsturi(uri) + 3.8. resetdsturi() + 3.9. isdsturiset() + 3.10. pv_printf(var, str) + 3.11. is_myself(uri) + 3.12. setdebug(level) + 3.13. resetdebug() + 3.14. km_append_branch([uri]) + + 4. MI Commands + + 4.1. arg + 4.2. kill + 4.3. pwd + 4.4. uptime + 4.5. version + 4.6. which + 4.7. get_statistics + 4.8. reset_statistics + 4.9. clear_statistics + + 5. RPC Commands + + 5.1. pkg.stats + 5.2. stats.get_statistics + 5.3. stats.reset_statistics + 5.4. stats.clear_statistics + 5.5. mod.stats module_name/all pkg/shm/all List of Examples @@ -90,28 +91,91 @@ Ovidiu Sas Chapter 1. Admin Guide -1.1. Overview + Table of Contents + + 1. Overview + 2. Dependencies + + 2.1. Kamailio Modules + 2.2. External Libraries or Applications + + 3. Functions + + 3.1. setsflag(flag) + 3.2. issflagset(flag) + 3.3. resetsflag(flag) + 3.4. setbflag(flag [, branch]) + 3.5. isbflagset(flag [, branch]) + 3.6. resetbflag(flag [, branch]) + 3.7. setdsturi(uri) + 3.8. resetdsturi() + 3.9. isdsturiset() + 3.10. pv_printf(var, str) + 3.11. is_myself(uri) + 3.12. setdebug(level) + 3.13. resetdebug() + 3.14. km_append_branch([uri]) + + 4. MI Commands + + 4.1. arg + 4.2. kill + 4.3. pwd + 4.4. uptime + 4.5. version + 4.6. which + 4.7. get_statistics + 4.8. reset_statistics + 4.9. clear_statistics + + 5. RPC Commands + + 5.1. pkg.stats + 5.2. stats.get_statistics + 5.3. stats.reset_statistics + 5.4. stats.clear_statistics + 5.5. mod.stats module_name/all pkg/shm/all + +1. Overview This module collects extensions from Kamailio core. Kamailio Core CookBook is available at: http://kamailio.org/dokuwiki/ -1.2. Dependencies +2. Dependencies + + 2.1. Kamailio Modules + 2.2. External Libraries or Applications -1.2.1. Kamailio Modules +2.1. Kamailio Modules The following modules must be loaded before this module: * No dependencies on other Kamailio modules. -1.2.2. External Libraries or Applications +2.2. External Libraries or Applications The following libraries or applications must be installed before running Kamailio with this module loaded: * None. -1.3. Functions - -1.3.1. setsflag(flag) +3. Functions + + 3.1. setsflag(flag) + 3.2. issflagset(flag) + 3.3. resetsflag(flag) + 3.4. setbflag(flag [, branch]) + 3.5. isbflagset(flag [, branch]) + 3.6. resetbflag(flag [, branch]) + 3.7. setdsturi(uri) + 3.8. resetdsturi() + 3.9. isdsturiset() + 3.10. pv_printf(var, str) + 3.11. is_myself(uri) + 3.12. setdebug(level) + 3.13. resetdebug() + 3.14. km_append_branch([uri]) + +3.1. setsflag(flag) Set the script flag. @@ -129,7 +193,7 @@ $var(flag) = 11; setsflag("$var(flag)"); ... -1.3.2. issflagset(flag) +3.2. issflagset(flag) Return true of the script flag is set. @@ -147,7 +211,7 @@ if(issflagset("1")) } ... -1.3.3. resetsflag(flag) +3.3. resetsflag(flag) Reset the script flag. @@ -162,7 +226,7 @@ if(issflagset("1")) resetsflag("1"); ... -1.3.4. setbflag(flag [, branch]) +3.4. setbflag(flag [, branch]) Set the branch flag. @@ -183,7 +247,7 @@ $var(flag) = 11; setbflag("$var(flag)", "1"); ... -1.3.5. isbflagset(flag [, branch]) +3.5. isbflagset(flag [, branch]) Return true of the branch flag is set. @@ -204,7 +268,7 @@ if(isbflagset("1")) } ... -1.3.6. resetbflag(flag [, branch]) +3.6. resetbflag(flag [, branch]) Reset the branch flag. @@ -222,7 +286,7 @@ if(isbflagset("1")) resetbflag("1"); ... -1.3.7. setdsturi(uri) +3.7. setdsturi(uri) Set the destination address URI (outbound proxy address). @@ -239,7 +303,7 @@ resetbflag("1"); setdsturi("sip:10.0.0.10"); ... -1.3.8. resetdsturi() +3.8. resetdsturi() Reset the destination address URI (outbound proxy address). @@ -250,7 +314,7 @@ setdsturi("sip:10.0.0.10"); resetdsturi(); ... -1.3.9. isdsturiset() +3.9. isdsturiset() Check if the destination address URI (outbound proxy address) is set. @@ -264,7 +328,7 @@ if(isdsturiset()) } ... -1.3.10. pv_printf(var, str) +3.10. pv_printf(var, str) Evalues the str and sets the resulting value to variable var. For backward compatibility reasons, the same function can be executed via @@ -283,7 +347,7 @@ pv_printf("$ru", "sip:$rU@$fd"); pv_printf("$avp(x)", "From: $fU - To: $tU"); ... -1.3.11. is_myself(uri) +3.11. is_myself(uri) Check if the parameter matches the 'myself' condition (i.e., is a local IP or domain). @@ -302,7 +366,7 @@ if(is_myself("$fu")) { } ... -1.3.12. setdebug(level) +3.12. setdebug(level) Set the debug log level per process. @@ -320,7 +384,7 @@ $var(level) = 2; setdebug("$var(level)"); ... -1.3.13. resetdebug() +3.13. resetdebug() Reset the local debug log level back to the value of core parameter 'debug'. @@ -332,14 +396,24 @@ setdebug("$var(level)"); resetdebug(); ... -1.3.14. km_append_branch([uri]) +3.14. km_append_branch([uri]) This function was replaced by append_branch() from corex module, starting with version 4.0.0. -1.4. MI Commands +4. MI Commands + + 4.1. arg + 4.2. kill + 4.3. pwd + 4.4. uptime + 4.5. version + 4.6. which + 4.7. get_statistics + 4.8. reset_statistics + 4.9. clear_statistics -1.4.1. arg +4.1. arg Print command line arguments. @@ -351,7 +425,7 @@ resetdebug(); :arg:_reply_fifo_file_ _empty_line_ -1.4.2. kill +4.2. kill Kill the application. @@ -363,7 +437,7 @@ resetdebug(); :kill:_reply_fifo_file_ _empty_line_ -1.4.3. pwd +4.3. pwd Print working directory. @@ -375,7 +449,7 @@ resetdebug(); :pwd:_reply_fifo_file_ _empty_line_ -1.4.4. uptime +4.4. uptime Print uptime. @@ -387,7 +461,7 @@ resetdebug(); :uptime:_reply_fifo_file_ _empty_line_ -1.4.5. version +4.5. version Print version information. @@ -399,7 +473,7 @@ resetdebug(); :version:_reply_fifo_file_ _empty_line_ -1.4.6. which +4.6. which Print list of available MI commands. @@ -411,7 +485,7 @@ resetdebug(); :which:_reply_fifo_file_ _empty_line_ -1.4.7. get_statistics +4.7. get_statistics Print the list of available internal statistics. @@ -427,7 +501,7 @@ resetdebug(); _statsid_ _empty_line_ -1.4.8. reset_statistics +4.8. reset_statistics Reset internal statistics. @@ -440,7 +514,7 @@ resetdebug(); _statsid_ _empty_line_ -1.4.9. clear_statistics +4.9. clear_statistics Return statistics and reset their value in one command. @@ -453,9 +527,15 @@ resetdebug(); _statsid_ _empty_line_ -1.5. RPC Commands +5. RPC Commands -1.5.1. pkg.stats + 5.1. pkg.stats + 5.2. stats.get_statistics + 5.3. stats.reset_statistics + 5.4. stats.clear_statistics + 5.5. mod.stats module_name/all pkg/shm/all + +5.1. pkg.stats Print private memory (pkg) usage statistics per process. It can take optinally a filter to print statistics only for a specific process or @@ -473,7 +553,7 @@ resetdebug(); kamcmd pkg.stats rank 1 kamcmd pkg.stats index 10 -1.5.2. stats.get_statistics +5.2. stats.get_statistics Print the list of available internal statistics. @@ -488,7 +568,7 @@ resetdebug(); kamcmd stats.get_statistics unsupported_methods kamcmd stats.get_statistics shmem: fwd_requests fwd_replies -1.5.3. stats.reset_statistics +5.3. stats.reset_statistics Reset internal statistics. @@ -500,7 +580,7 @@ resetdebug(); kamcmd stats.reset_statistics unsupported_methods kamcmd stats.reset_statistics shmem: fwd_requests fwd_replies -1.5.4. stats.clear_statistics +5.4. stats.clear_statistics Return statistics and reset their value in one command. @@ -511,3 +591,48 @@ resetdebug(); kamcmd stats.reset_statistics core: kamcmd stats.reset_statistics unsupported_methods kamcmd stats.reset_statistics shmem: fwd_requests fwd_replies + +5.5. mod.stats module_name/all pkg/shm/all + + Print private(pkg) or shared(shm) memory currently allocated a given + module or by all modules. + + NOTE: Processing is done only when the command is issued and involves + iterating throug the list of memory fragments and printing details + about them. + + NOTE: Only the module functions that directly calls shm_alloc or + pkg_alloc are taken into consideration. + + The first parameter can be one of the following: + * module_name - print statistics for specific module. Either a module + name (like "usrloc") or "core" for the Kamailio core. + * all - print statistics for all modules that uses memory. + + The second parameter can be: + * pkg - print private (process) memory statistics. + * shm - print shared memory statistics. + * all - print both private and shared memory statistics. + + Examples: + kamcmd mod.stats core all + kamcmd mod.stats userblacklist shm + kamcmd mod.stats kex pkg + kamcmd mod.stats all all + + Output: +Module: kex +{ + // this is the pkg zone of the module + // function_name(line_where_pkg_malloc_was_called): size_alloc'ed_by_pkg_mal +loc + init_mi_uptime(74): 56 + Total: 56 +} +{ + // this is the shm zone of the module + // function_name(line_where_shm_malloc_was_called): size_alloc'ed_by_shm_mal +loc + pkg_proc_stats_init(79): 864 + Total: 864 +} diff --git a/modules/kex/doc/kex_admin.xml b/modules/kex/doc/kex_admin.xml index e73723f3b6e..1288fdd282e 100644 --- a/modules/kex/doc/kex_admin.xml +++ b/modules/kex/doc/kex_admin.xml @@ -728,11 +728,12 @@ resetdebug(); NOTE: Only the module functions that directly calls shm_alloc or pkg_alloc are taken into consideration. - The firt parameter can be: + The first parameter can be one of the following: - module_name - print statistics for specific module. + module_name - print statistics for specific module. Either + a module name (like "usrloc") or "core" for the &kamailio; core. @@ -746,7 +747,7 @@ resetdebug(); - pkg - print private memory statistics. + pkg - print private (process) memory statistics. diff --git a/modules/ldap/README b/modules/ldap/README index a95c1d1b1b4..2249686988d 100644 --- a/modules/ldap/README +++ b/modules/ldap/README @@ -5,7 +5,7 @@ Christian Schlatter University of North Carolina - Copyright 2007 University of North Carolina + Copyright © 2007 University of North Carolina __________________________________________________________________ Table of Contents @@ -173,26 +173,26 @@ Chapter 1. Admin Guide 1.1. Usage Basics LDAP sessions is specified in an external configuration file (as - described in Section 3, "LDAP Configuration File"). Each of these LDAP + described in Section 3, “LDAP Configuration File”). Each of these LDAP sessions includes LDAP server access parameters like server hostname or connection timeouts. Normally only a single LDAP session per process will be used unless there is a need to access more than one LDAP server. The LDAP session name will then be used in the Kamailio configuration script to refer to a specific LDAP session. - The ldap_search function (Section 5.1, "ldap_search(ldap_url)") + The ldap_search function (Section 5.1, “ldap_search(ldap_url)”) performs an LDAP search operation. It expects an LDAP URL as input which includes the LDAP session name and search parameters. The section - Section 1.2, "LDAP URLs" provides a quick overview on LDAP URLs. + Section 1.2, “LDAP URLs” provides a quick overview on LDAP URLs. The result of a LDAP search is stored internally and can be accessed with one of the ldap_result* functions. ldap_result (Section 5.2, - "ldap_result("ldap_attr_name/avp_spec[/avp_type]" [, regex_subst])") + “ldap_result("ldap_attr_name/avp_spec[/avp_type]" [, regex_subst])”) stores resulting LDAP attribute values as AVPs. ldap_result_check - (Section 5.3, "ldap_result_check("ldap_attr_name/string_to_match" [, - regex_subst])") is a convenience function to compare a string with LDAP + (Section 5.3, “ldap_result_check("ldap_attr_name/string_to_match" [, + regex_subst])”) is a convenience function to compare a string with LDAP attribute values using regular expression matching. Finally, - ldap_result_next (Section 5.4, "ldap_result_next()") allows using LDAP + ldap_result_next (Section 5.4, “ldap_result_next()”) allows using LDAP search queries that return more than one LDAP entry. All ldap_result* functions always access the LDAP result set from the @@ -224,7 +224,7 @@ Chapter 1. Admin Guide Comma separated list of LDAP attributes to be returned scope - Scope for LDAP search, valid values are "base", "one", or "sub" + Scope for LDAP search, valid values are “base”, “one”, or “sub” filter LDAP search filter definition following rules of RFC 4515 @@ -250,7 +250,7 @@ Note as "%3F", since "?" is used as a URL delimiter. The exported function ldap_filter_url_encode (Section 5.5, - "ldap_filter_url_encode(string, avp_spec)") implements RFC 4515/4516 + “ldap_filter_url_encode(string, avp_spec)”) implements RFC 4515/4516 LDAP search filter and URL escaping rules. 2. Dependencies @@ -348,7 +348,7 @@ ldap_version = 2 currently only supports SIMPLE_AUTH). Empty string enables anonymous LDAP bind. - Default value: "" (empty string --> anonymous bind) + Default value: “” (empty string --> anonymous bind) Example 1.3. ldap_bind_dn example @@ -358,7 +358,7 @@ ldap_bind_dn = "cn=root,dc=example,dc=com"; Authentication password used to bind to LDAP server (SIMPLE_AUTH). Empty string enables anonymous bind. - Default value: "" (empty string --> anonymous bind) + Default value: “” (empty string --> anonymous bind) Example 1.4. ldap_bind_password example @@ -451,7 +451,7 @@ modparam("ldap", "config_file", "/usr/local/etc/kamailio/ldap.ini") ldap_url An LDAP URL defining the LDAP search operation (refer to - Section 1.2, "LDAP URLs" for a description of the LDAP URL + Section 1.2, “LDAP URLs” for a description of the LDAP URL format). The hostport part must be one of the LDAP session names declared in the LDAP configuration script. @@ -915,7 +915,7 @@ typedef int (*ldap_url_search_t)(char* _ldap_url, Function arguments: char* _ldap_url - LDAP URL as described in Section 1.2, "LDAP URLs". + LDAP URL as described in Section 1.2, “LDAP URLs”. int* _result_count The function stores the number of returned LDAP entries in @@ -1024,7 +1024,7 @@ typedef int (*ldap_str2scope_t)(char* scope_str); 2.7. ldap_rfc4515_escape Applies escaping rules described in Section 5.5, - "ldap_filter_url_encode(string, avp_spec)". + “ldap_filter_url_encode(string, avp_spec)”. typedef int (*ldap_rfc4515_escape_t)(str *sin, str *sout, int url_encode); Function arguments: diff --git a/modules/ldap/ldap_escape.c b/modules/ldap/ldap_escape.c index e6507f85cdd..9fb4ca299ad 100644 --- a/modules/ldap/ldap_escape.c +++ b/modules/ldap/ldap_escape.c @@ -29,8 +29,6 @@ #include #include "ldap_escape.h" -static const char hex[] = "0123456789ABCDEF"; - /* * escape string following RFC 4515 (LDAP filter syntax) escaping rules: * @@ -48,8 +46,8 @@ static const char hex[] = "0123456789ABCDEF"; int ldap_rfc4515_escape(str *sin, str *sout, int url_encode) { char *src, *dst; - - if (sin == NULL || sout == NULL || sin->s == NULL || sout->s == NULL + + if (sin == NULL || sout == NULL || sin->s == NULL || sout->s == NULL || sin->len <= 0 || sout->len < 3*sin->len+1) { return -1; diff --git a/modules/log_custom/README b/modules/log_custom/README index 41156682647..8e93b3c572b 100644 --- a/modules/log_custom/README +++ b/modules/log_custom/README @@ -10,7 +10,7 @@ Daniel-Constantin Mierla - Copyright 2015 asipto.com + Copyright © 2015 asipto.com __________________________________________________________________ Table of Contents @@ -93,7 +93,7 @@ loadmodule "log_custom.so" 4.1. log_udp(text) -4.1. log_udp(text) +4.1. log_udp(text) Send the text to the address specified in core parameter log_engine_data. It is provided as sample function mainly for testing, diff --git a/modules/log_custom/log_custom_mod.c b/modules/log_custom/log_custom_mod.c index b66ec10716e..7f61bcf1b81 100644 --- a/modules/log_custom/log_custom_mod.c +++ b/modules/log_custom/log_custom_mod.c @@ -126,7 +126,7 @@ static int mod_init(void) } /** - * @brief Initialize async module children + * @brief Initialize module children */ static int child_init(int rank) { @@ -142,6 +142,7 @@ static int child_init(int rank) return -1; } } + LM_DBG("setting udp-send custom logging function\n"); km_log_func_set(&_lc_core_log_udp); _lc_log_udp = 1; @@ -189,8 +190,8 @@ void _lc_core_log_udp(int lpriority, const char *format, ...) va_start(arglist, format); n = 0; - n += snprintf(obuf+n, 1024-n, "(%d) ", my_pid()); - n += vsnprintf(obuf+n, 1024-n, format, arglist); + n += snprintf(obuf + n, LC_LOG_MSG_MAX_SIZE - n, "(%d) ", my_pid()); + n += vsnprintf(obuf + n, LC_LOG_MSG_MAX_SIZE - n, format, arglist); va_end(arglist); udp_send(&_lc_udp_dst, obuf, n); } diff --git a/modules/malloc_test/README b/modules/malloc_test/README index 517102fa3e1..305bcae7ead 100644 --- a/modules/malloc_test/README +++ b/modules/malloc_test/README @@ -1,12 +1,11 @@ - The malloc_test Module Andrei Pelinescu-Onciul iptelorg GmbH - Copyright 2010 iptelorg GmbH - _________________________________________________________________ + Copyright © 2010 iptelorg GmbH + __________________________________________________________________ Table of Contents @@ -27,9 +26,9 @@ Andrei Pelinescu-Onciul 4.1. mt.mem_alloc size [unit] 4.2. mt.mem_free [size] [unit] 4.3. mt.mem_used [unit] - 4.4. mt.mem_rnd_alloc min max total [unit] + 4.4. mt.mem_rnd_alloc min max total [unit] 4.5. mt.mem_test_start min max total min_int max_int - total_time [unit] + total_time [unit] 4.6. mt.mem_test_stop id 4.7. mt.mem_test_destroy id @@ -38,8 +37,8 @@ Andrei Pelinescu-Onciul List of Examples - 1.1. Set check_content in the config file - 1.2. Set check_content at runtime via sercmd + 1.1. Set check_content in the config file + 1.2. Set check_content at runtime via sercmd 1.3. men_alloc usage 1.4. mem_free usage 1.5. mt.mem_alloc usage @@ -71,9 +70,9 @@ Chapter 1. Admin Guide 4.1. mt.mem_alloc size [unit] 4.2. mt.mem_free [size] [unit] 4.3. mt.mem_used [unit] - 4.4. mt.mem_rnd_alloc min max total [unit] + 4.4. mt.mem_rnd_alloc min max total [unit] 4.5. mt.mem_test_start min max total min_int max_int total_time - [unit] + [unit] 4.6. mt.mem_test_stop id 4.7. mt.mem_test_destroy id @@ -82,8 +81,8 @@ Chapter 1. Admin Guide 1. Overview - This is a debugging/test module. It implements functions (both script - and rpcs) that can be used to stress the memory allocator or force + This is a debugging/test module. It implements functions (both script + and rpcs) that can be used to stress the memory allocator or force memory leaks. Warning @@ -96,7 +95,7 @@ Warning 2.1. check_content - When doing the tests, check also for the possibility of the memory + When doing the tests, check also for the possibility of the memory being overwritten. When activated, the allocated memory will be filled with a special pattern, that will be checked on free. @@ -104,10 +103,10 @@ Warning It can be changed also at runtime, via the rpc interface. - Example 1.1. Set check_content in the config file + Example 1.1. Set check_content in the config file modparam("malloc_test", "check_content", 1) - Example 1.2. Set check_content at runtime via sercmd + Example 1.2. Set check_content at runtime via sercmd $ kamcmd cfg.set_now_int malloc_test check_content 1 3. Functions @@ -121,7 +120,7 @@ $ kamcmd cfg.set_now_int malloc_test check_content 1 Note - This is a debugging function for simulating memory leaks or stressing + This is a debugging function for simulating memory leaks or stressing the memory allocator. It should not be used in production setups Example 1.3. men_alloc usage @@ -135,7 +134,7 @@ mem_alloc(1048576); # 1MB Note - This is a debugging function for simulating memory leaks or stressing + This is a debugging function for simulating memory leaks or stressing the memory allocator. It should not be used in production setups Example 1.4. mem_free usage @@ -148,9 +147,8 @@ mem_free(); 4.1. mt.mem_alloc size [unit] 4.2. mt.mem_free [size] [unit] 4.3. mt.mem_used [unit] - 4.4. mt.mem_rnd_alloc min max total [unit] + 4.4. mt.mem_rnd_alloc min max total [unit] 4.5. mt.mem_test_start min max total min_int max_int total_time [unit] - 4.6. mt.mem_test_stop id 4.7. mt.mem_test_destroy id 4.8. mt.mem_test_destroy_all id @@ -158,7 +156,7 @@ mem_free(); 4.1. mt.mem_alloc size [unit] - Allocates the specified number of bytes. unit is optional and can be + Allocates the specified number of bytes. unit is optional and can be one of: * b - bytes * k - KB @@ -170,7 +168,7 @@ mem_free(); 4.2. mt.mem_free [size] [unit] - Frees at least size bytes from the memory allocated by other + Frees at least size bytes from the memory allocated by other malloc_test functions (e.g. mt.mem_alloc). size is optional. If missing, everything will be freed. @@ -186,7 +184,7 @@ mem_free(); 4.3. mt.mem_used [unit] - Returns/displays how many bytes are allocated. The default unit is + Returns/displays how many bytes are allocated. The default unit is bytes (for all the possible units see above). unit is optional and can be one of: @@ -201,8 +199,8 @@ mem_free(); 4.4. mt.mem_rnd_alloc min max total [unit] - Allocates total_size memory, in pieces of random size between min .. - max (inclusive). unit is optional and represents the unit for all the + Allocates total_size memory, in pieces of random size between min .. + max (inclusive). unit is optional and represents the unit for all the given sizes (see above). Example 1.8. mt.mem_rnd_alloc usage @@ -210,12 +208,12 @@ mem_free(); 4.5. mt.mem_test_start min max total min_int max_int total_time [unit] - Starts a malloc test that will take total_time to execute. Memory - allocations will be performed at intervals randomly chosen between - min_int and max_int (in ms). Each allocation will have a randomly + Starts a malloc test that will take total_time to execute. Memory + allocations will be performed at intervals randomly chosen between + min_int and max_int (in ms). Each allocation will have a randomly chosen size between min and max unit bytes. After total unit bytes are - allocated, everything is released/freed again and the allocations are - restarted. All the times are expressed in milliseconds. unit is + allocated, everything is released/freed again and the allocations are + restarted. All the times are expressed in milliseconds. unit is optional and represents the unit for all the given sizes (see above). Several tests can be run in parallel. @@ -235,8 +233,8 @@ mem_free(); 4.7. mt.mem_test_destroy id - Destroys the test indentified by id (besides stopping it, it also - frees all the data, including the statistics). + Destroys the test indentified by id (besides stopping it, it also frees + all the data, including the statistics). Example 1.11. mt.mem_test_destroy usage $ kamcmd mt.mem_test_destroy 1 @@ -250,10 +248,10 @@ mem_free(); 4.9. mt.mem_test_list [id] [unit] - Returns/displays data about the test identified by id, or if no id is + Returns/displays data about the test identified by id, or if no id is specified, it lists all the tests (running or stopped). - unit is optional. The default is is bytes (for all the possible units + unit is optional. The default is is bytes (for all the possible units see above). Example 1.13. mt.mem_test_list usage diff --git a/modules/mangler/README b/modules/mangler/README index 5ec56220996..f023ecde955 100644 --- a/modules/mangler/README +++ b/modules/mangler/README @@ -4,7 +4,7 @@ Gabriel Vasile FhG FOKUS - Copyright 2003 FhG FOKUS + Copyright © 2003 FhG FOKUS __________________________________________________________________ Table of Contents @@ -86,7 +86,7 @@ modparam("mangler", "contact_flds_separator", "-") 3.4. decode_contact() 3.5. decode_contact_header() -3.1. sdp_mangle_ip(pattern, newip) +3.1. sdp_mangle_ip(pattern, newip) Changes IP addresses inside SDP document in lines describing connections like c=IN IP4 . Currently this function only changes IP4 @@ -107,7 +107,7 @@ modparam("mangler", "contact_flds_separator", "-") sdp_mangle_ip("10.0.0.0/8","193.175.135.38"); ... -3.2. sdp_mangle_port(offset) +3.2. sdp_mangle_port(offset) Changes ports in SDP document in lines starting a media section like "m=audio 13451". @@ -123,7 +123,7 @@ sdp_mangle_ip("10.0.0.0/8","193.175.135.38"); sdp_mangle_port("-12000"); ... -3.3. encode_contact(encoding_prefix) +3.3. encode_contact(encoding_prefix) This function will encode URIs inside the "Contact" header in the following manner "sip:username:password@ip:port;transport=protocol" @@ -142,7 +142,7 @@ sdp_mangle_port("-12000"); if (src_ip == 10.0.0.0/8) encode_contact("enc_prefix","193.175.135.38"); ... -3.4. decode_contact() +3.4. decode_contact() This function will decode the URI in first line in packets which come with encoded URI in the following manner @@ -160,7 +160,7 @@ if (src_ip == 10.0.0.0/8) encode_contact("enc_prefix","193.175.135.38"); if (uri =~ "^enc*") { decode_contact(); } ... -3.5. decode_contact_header() +3.5. decode_contact_header() This function will decode URIs inside the "Contact" header in the same manner as decode_contact(). The difference is that no dst_uri is set diff --git a/modules/matrix/README b/modules/matrix/README index 69e50899d0b..93b357d848e 100644 --- a/modules/matrix/README +++ b/modules/matrix/README @@ -11,7 +11,7 @@ Henning Westerholt 1&1 Internet AG - Copyright 2008 1&1 Internet AG + Copyright © 2008 1&1 Internet AG __________________________________________________________________ Table of Contents @@ -139,7 +139,7 @@ Chapter 1. Admin Guide The URL for the database connection. - Default value is "mysql://kamailioro:kamailioro@localhost/kamailio". + Default value is “mysql://kamailioro:kamailioro@localhost/kamailio”. Example 1.1. Set db_url parameter ... @@ -150,7 +150,7 @@ modparam("matrix", "db_url", "mysql://kamailioro:kamailioro@localhost/kamailio") The name of the table containing the matrix data. - Default value is "matrix". + Default value is “matrix”. Example 1.2. Set matrix_table parameter ... @@ -161,7 +161,7 @@ modparam("matrix", "matrix_table", "matrix") The name of the column containing the first row in the matrix. - Default value is "first". + Default value is “first”. Example 1.3. Set matrix_first_col parameter ... @@ -172,7 +172,7 @@ modparam("matrix", "matrix_first_col", "first") The name of the column containing the second row in the matrix. - Default value is "second". + Default value is “second”. Example 1.4. Set matrix_second_col parameter ... @@ -183,7 +183,7 @@ modparam("matrix", "matrix_second_col", "second") The name of the column containing the result ID to be used. - Default value is "res". + Default value is “res”. Example 1.5. Set matrix_res_col parameter ... @@ -194,7 +194,7 @@ modparam("matrix", "matrix_res_col", "res") 4.1. matrix (string first, string second, string dstavp) -4.1. matrix (string first, string second, string dstavp) +4.1. matrix (string first, string second, string dstavp) Looks up the desired result ID in the matrix for the given column and value and saves the result in dstavp. Returns false if the cell is not @@ -213,7 +213,7 @@ cr_route("$avp(route_tree)", "$rd", "$rU", "$rU", "call_id"); 5.1. reload_matrix -5.1. reload_matrix +5.1. reload_matrix Reloads the internal matrix representation from the database. This is necessary after entries in the database have been changed. @@ -264,7 +264,7 @@ Chapter 2. Module parameter for database access. URL to the database containing the data. - Default value is "mysql://kamailioro:kamailioro@localhost/kamailio". + Default value is “mysql://kamailioro:kamailioro@localhost/kamailio”. Example 2.1. Set db_url parameter ... @@ -275,7 +275,7 @@ modparam("matrix", "db_url", "dbdriver://username:password@dbhost/dbname") Name of the matrix table for the matrix module. - Default value is "matrix". + Default value is “matrix”. Example 2.2. Set matrix_table parameter ... diff --git a/modules/maxfwd/README b/modules/maxfwd/README index f381e66fb55..e18aa9b61af 100644 --- a/modules/maxfwd/README +++ b/modules/maxfwd/README @@ -8,7 +8,7 @@ Edited by Bogdan-Andrei Iancu - Copyright 2003 FhG FOKUS + Copyright © 2003 FhG FOKUS __________________________________________________________________ Table of Contents @@ -99,7 +99,7 @@ Chapter 1. Admin Guide Set an upper limit for the max-forward value in the outgoing requests. If the header is present, the decremented value is not allowed to exceed this max_limits - if it does, the header value will by decreased - to "max_limit". + to “max_limit”. Note: This check is done when calling the maxfwd_process() function. @@ -107,7 +107,7 @@ Chapter 1. Admin Guide MAX-FORWARDS value allowed by RFC 3261. The value can be changed at runtime. - Default value is "70". + Default value is “70”. Example 1.1. Set max_limit parameter ... @@ -123,10 +123,10 @@ modparam("maxfwd", "max_limit", 32) 4.5. maxfwd_at_least(max_value) 4.6. mf_lowlimit(max_value) -4.1. maxfwd_process(max_value) +4.1. maxfwd_process(max_value) If no Max-Forward header is present in the received request, a header - will be added having the original value equal with "max_value". If a + will be added having the original value equal with “max_value”. If a Max-Forward header is already present, its value will be decremented (if not 0). The parameter can be a variable. @@ -139,8 +139,8 @@ modparam("maxfwd", "max_limit", 32) decremented). * -2 (false) - error during processing. - The return code may be extensivly tested via script variable "retcode" - (or "$?"). + The return code may be extensivly tested via script variable “retcode” + (or “$?”). Meaning of the parameters is as follows: * max_value - Value to be added if there is no Max-Forwards header @@ -158,30 +158,30 @@ if (!maxfwd_process("10") && $retcode==-1) { }; ... -4.2. mf_process_maxfwd_header(max_value) +4.2. mf_process_maxfwd_header(max_value) Same as maxfwd_process(max_value). -4.3. process_maxfwd(max_value) +4.3. process_maxfwd(max_value) Same as maxfwd_process(max_value). -4.4. is_maxfwd_lt(max_value) +4.4. is_maxfwd_lt(max_value) - Checks if the Max-Forward header value is less then the "max_value" + Checks if the Max-Forward header value is less then the “max_value” parameter value. It considers also the value of the new inserted header (if locally added). The parameter can be a variable. Retuning codes: * 1 (true) - header was found or set and its value is stricly less - than "max_value". + than “max_value”. * -1 (false) - the header was found or set and its value is greater - or equal to "max_value". + or equal to “max_value”. * -2 (false) - header was not found or not set. * -3 (false) - error during processing. - The return code may be extensivly tested via script variable "retcode" - (or "$?"). + The return code may be extensivly tested via script variable “retcode” + (or “$?”). Meaning of the parameters is as follows: * max_value - value to check the Max-Forward.value against (as less @@ -197,10 +197,10 @@ if ( is_maxfwd_lt("1") ) { }; ... -4.5. maxfwd_at_least(max_value) +4.5. maxfwd_at_least(max_value) Same as is_maxfwd_lt(max_value). -4.6. mf_lowlimit(max_value) +4.6. mf_lowlimit(max_value) Same as is_maxfwd_lt(max_value). diff --git a/modules/mediaproxy/mediaproxy.c b/modules/mediaproxy/mediaproxy.c index 3bca16d160d..df338b915c9 100644 --- a/modules/mediaproxy/mediaproxy.c +++ b/modules/mediaproxy/mediaproxy.c @@ -1926,7 +1926,7 @@ __dialog_ended(struct dlg_cell *dlg, int type, struct dlg_cb_params *_params) { if ((int)(long)*_params->param == MPActive) { end_media_session(dlg->callid, dlg->tag[DLG_CALLER_LEG], dlg->tag[DLG_CALLEE_LEG]); - *_params->param = MPInactive; + *_params->param = NULL; } } diff --git a/modules/mi_datagram/README b/modules/mi_datagram/README index b041f7e3586..6930a61d703 100644 --- a/modules/mi_datagram/README +++ b/modules/mi_datagram/README @@ -8,7 +8,7 @@ Edited by Andreea-Ancuta Onofrei - Copyright 2007 Voice Sistem SRL + Copyright © 2007 Voice Sistem SRL __________________________________________________________________ Table of Contents @@ -194,7 +194,7 @@ modparam("mi_datagram", "socket_timeout", 2000) Strings to be used for line indentation. As the MI data structure is tree oriendeted, the depth level will printed as identation. - Default value is ""\t" (TAB)". + Default value is “"\t" (TAB)”. Example 1.7. Set reply_ident parameter ... @@ -207,8 +207,8 @@ modparam("mi_datagram", "reply_ident", " ") 6. Example - This is an example showing the DATAGRAM format for the "get_statistics - dialog: tm:" MI commad: response. + This is an example showing the DATAGRAM format for the “get_statistics + dialog: tm:” MI commad: response. Example 1.8. DATAGRAM request :get_statistics:\n @@ -225,44 +225,44 @@ Chapter 2. Frequently Asked Questions 2.1. - Both UNIX and UDP type of socket can be created simultaneusly? + Both UNIX and UDP type of socket can be created simultaneusly? - This version supports only one kind of socket at a time. If there are - more than one value set for socket_name the last one will take effect. + This version supports only one kind of socket at a time. If there are + more than one value set for socket_name the last one will take effect. 2.2. - Is there a limit in the datagram request's size? + Is there a limit in the datagram request's size? - The maximum length of a datagram request or reply is 65457 bytes. + The maximum length of a datagram request or reply is 65457 bytes. 2.3. - Where can I find more about Kamailio? + Where can I find more about Kamailio? - Take a look at http://www.kamailio.org/. + Take a look at http://www.kamailio.org/. 2.4. - Where can I post a question about this module? + Where can I post a question about this module? - First at all check if your question was already answered on one of our - mailing lists: - * User Mailing List - - http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users - * Developer Mailing List - - http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev + First at all check if your question was already answered on one of our + mailing lists: + * User Mailing List - + http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users + * Developer Mailing List - + http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev - E-mails regarding any stable Kamailio release should be sent to - and e-mails regarding development - versions should be sent to . + E-mails regarding any stable Kamailio release should be sent to + and e-mails regarding development + versions should be sent to . - If you want to keep the mail private, send it to - . + If you want to keep the mail private, send it to + . 2.5. - How can I report a bug? + How can I report a bug? - Please follow the guidelines provided at: - http://sip-router.org/tracker. + Please follow the guidelines provided at: + https://github.com/kamailio/kamailio/issues. diff --git a/modules/mi_datagram/mi_datagram.c b/modules/mi_datagram/mi_datagram.c index 771f9130339..5075a9fbae2 100644 --- a/modules/mi_datagram/mi_datagram.c +++ b/modules/mi_datagram/mi_datagram.c @@ -200,7 +200,7 @@ static int mi_mod_init(void) LM_ERR("invalid port number; must be in [1024,%d]\n",MAX_NB_PORT); return -1; } - + if(! (host = resolvehost(host_s)) ) { LM_ERR("failed to resolve %s\n", host_s); return -1; @@ -212,10 +212,10 @@ static int mi_mod_init(void) } mi_socket_domain = host->h_addrtype; goto done; - } + } /* in case of a Unix socket*/ LM_DBG("we have an UNIX socket\n"); - + n=stat(mi_socket, &filestat); if( n==0) { LM_INFO("the socket %s already exists, trying to delete it...\n", mi_socket); @@ -235,14 +235,14 @@ static int mi_mod_init(void) LM_WARN("cannot specify mi_unix_socket_mode = 0, forcing it to rw-------\n"); mi_unix_socket_mode = S_IRUSR| S_IWUSR; } - + if (mi_unix_socket_uid_s) { if (user2uid(&mi_unix_socket_uid, &mi_unix_socket_gid, mi_unix_socket_uid_s)<0) { LM_ERR("bad user name %s\n", mi_unix_socket_uid_s); return -1; } } - + if (mi_unix_socket_gid_s) { if (group2gid(&mi_unix_socket_gid, mi_unix_socket_gid_s)<0) { LM_ERR("bad group name %s\n", mi_unix_socket_gid_s); @@ -252,7 +252,11 @@ static int mi_mod_init(void) /*create the unix socket address*/ mi_dtgram_addr.unix_addr.sun_family = AF_LOCAL; - memcpy( mi_dtgram_addr.unix_addr.sun_path, mi_socket, strlen(mi_socket)); + if(strlen(mi_socket)>=sizeof(mi_dtgram_addr.unix_addr.sun_path)-1) { + LM_ERR("mi socket path is too long\n"); + return -1; + } + memcpy(mi_dtgram_addr.unix_addr.sun_path, mi_socket, strlen(mi_socket)); done: /* add space for extra processes */ @@ -369,7 +373,7 @@ static int mi_destroy(void) if (n==0) { if(config_check==0) { if (unlink(mi_socket)<0){ - LM_ERR("cannot delete the socket (%s): %s\n", + LM_ERR("cannot delete the socket (%s): %s\n", mi_socket, strerror(errno)); goto error; } diff --git a/modules/mi_fifo/README b/modules/mi_fifo/README index a9a83036dff..be41e7768d0 100644 --- a/modules/mi_fifo/README +++ b/modules/mi_fifo/README @@ -8,7 +8,7 @@ Edited by Bogdan-Andrei Iancu - Copyright 2006 Voice Sistem SRL + Copyright © 2006 Voice Sistem SRL __________________________________________________________________ Table of Contents @@ -166,7 +166,7 @@ modparam("mi_fifo", "fifo_user", "root") Directory to be used for creating the reply FIFO files. - Default value is "/tmp/" + Default value is “/tmp/” Example 1.5. Set reply_dir parameter ... @@ -178,7 +178,7 @@ modparam("mi_fifo", "reply_dir", "/home/kamailio/tmp/") Strings to be used for line indentation. As the MI data structure is tree oriented, the depth level will be printed as indentation. - Default value is ""\t" (TAB)". + Default value is “"\t" (TAB)”. Example 1.6. Set reply_indent parameter ... @@ -191,8 +191,8 @@ modparam("mi_fifo", "reply_indent", " ") 6. Example - This is an example showing the FIFO format for the "get_statistics - dialog: tm:" MI command response. + This is an example showing the FIFO format for the “get_statistics + dialog: tm:” MI command response. Example 1.7. FIFO request :get_statistics:reply_fifo\n diff --git a/modules/mi_fifo/fifo_fnc.c b/modules/mi_fifo/fifo_fnc.c index eaa6cb7dbaa..1d33bf242ff 100644 --- a/modules/mi_fifo/fifo_fnc.c +++ b/modules/mi_fifo/fifo_fnc.c @@ -108,15 +108,18 @@ FILE *mi_init_fifo_server(char *fifo_name, int mi_fifo_mode, mi_fifo_write=open( fifo_name, O_WRONLY|O_NONBLOCK, 0); if (mi_fifo_write<0) { LM_ERR("fifo_write did not open: %s\n", strerror(errno)); + fclose(fifo_stream); return 0; } /* set read fifo blocking mode */ if ((opt=fcntl(mi_fifo_read, F_GETFL))==-1){ LM_ERR("fcntl(F_GETFL) failed: %s [%d]\n", strerror(errno), errno); + fclose(fifo_stream); return 0; } if (fcntl(mi_fifo_read, F_SETFL, opt & (~O_NONBLOCK))==-1){ LM_ERR("cntl(F_SETFL) failed: %s [%d]\n", strerror(errno), errno); + fclose(fifo_stream); return 0; } @@ -125,6 +128,7 @@ FILE *mi_init_fifo_server(char *fifo_name, int mi_fifo_mode, reply_fifo_s = pkg_malloc(MAX_MI_FILENAME); if ( mi_buf==NULL|| reply_fifo_s==NULL) { LM_ERR("no more private memory\n"); + fclose(fifo_stream); return 0; } @@ -146,7 +150,7 @@ static int mi_fifo_check(int fd, char* fname) { struct stat fst; struct stat lst; - + if (fstat(fd, &fst)<0){ LM_ERR("security: fstat on %s failed: %s\n", fname, strerror(errno)); return -1; @@ -200,7 +204,7 @@ static FILE *mi_open_reply_pipe( char *pipe_name ) } tryagain: - /* open non-blocking to make sure that a broken client will not + /* open non-blocking to make sure that a broken client will not * block the FIFO server forever */ fifofd=open( pipe_name, O_WRONLY | O_NONBLOCK ); if (fifofd==-1) { @@ -225,7 +229,7 @@ static FILE *mi_open_reply_pipe( char *pipe_name ) return 0; } - /* security checks: is this really a fifo?, is + /* security checks: is this really a fifo?, is * it hardlinked? is it a soft link? */ if (mi_fifo_check(fifofd, pipe_name)<0) goto error; @@ -280,7 +284,7 @@ int mi_read_line( char *b, int max, FILE *stream, int *read) kill(0, SIGTERM); } /* if we did not read whole line, our buffer is too small - and we cannot process the request; consume the remainder of + and we cannot process the request; consume the remainder of request */ @@ -407,13 +411,17 @@ void mi_fifo_server(FILE *fifo_stream) int line_len; char *file_sep, *command, *file; struct mi_cmd *f; - FILE *reply_stream; + FILE *reply_stream = NULL; while(1) { /* update the local config framework structures */ cfg_update(); - reply_stream = NULL; + + if(reply_stream) { + fclose(reply_stream); + reply_stream = NULL; + } /* commands must look this way '::[filename]' */ if (mi_read_line(mi_buf,MAX_MI_FIFO_BUFFER,fifo_stream, &line_len)) { @@ -428,7 +436,7 @@ void mi_fifo_server(FILE *fifo_stream) line_len--; mi_buf[line_len]=0; } else break; - } + } if (line_len==0) { LM_DBG("fifo command empty\n"); @@ -525,6 +533,7 @@ void mi_fifo_server(FILE *fifo_stream) free_async_handler(hdl); /* close reply fifo */ fclose(reply_stream); + reply_stream = NULL; /* destroy request tree */ if (mi_cmd) free_mi_tree( mi_cmd ); @@ -542,9 +551,11 @@ void mi_fifo_server(FILE *fifo_stream) consume3: free_async_handler(hdl); - if (reply_stream) consume2: - fclose(reply_stream); + if (reply_stream) { + fclose(reply_stream); + reply_stream = NULL; + } consume1: mi_do_consume(); } diff --git a/modules/mi_rpc/README b/modules/mi_rpc/README index 693fb8790b3..56a2685c9a1 100644 --- a/modules/mi_rpc/README +++ b/modules/mi_rpc/README @@ -11,7 +11,7 @@ Daniel-Constantin Mierla - Copyright 2009 http://www.asipto.com + Copyright © 2009 http://www.asipto.com __________________________________________________________________ Table of Contents @@ -112,7 +112,7 @@ modparam("mi_rpc","rpc_url","tcp:localhost:2046") 5.1. mi mi_dg mi_fifo mi_xmlrpc -5.1. mi mi_dg mi_fifo mi_xmlrpc +5.1. mi mi_dg mi_fifo mi_xmlrpc Execute a MI command. diff --git a/modules/mi_rpc/mi_rpc_mod.c b/modules/mi_rpc/mi_rpc_mod.c index 32d444fe280..718aab865ba 100644 --- a/modules/mi_rpc/mi_rpc_mod.c +++ b/modules/mi_rpc/mi_rpc_mod.c @@ -496,25 +496,28 @@ static struct mi_root* mi_run_rpc(struct mi_root* cmd_tree, void* param) struct binrpc_handle rpc_handle; struct binrpc_response_handle resp_handle; int i; - + str *fn; struct mi_node *node; char *command = NULL; int param_count = 0; char **parameters = NULL; struct mi_root* result; - + int resp_type; int resp_code; char *resp; - /* response will be malloced by binrpc_response_to_text. + /* response will be malloced by binrpc_response_to_text. We do not free it. It must remain after this call. It will be reused by subsequent calls */ static unsigned char *response = NULL; static int resp_len = 0; - - if (binrpc_open_connection_url(&rpc_handle, rpc_url) != 0) + + memset(&rpc_handle, 0, sizeof(struct binrpc_handle)); + memset(&resp_handle, 0, sizeof(struct binrpc_response_handle)); + + if (binrpc_open_connection_url(&rpc_handle, rpc_url) != 0) { LM_ERR( "Open connect to %s failed\n", rpc_url); result = init_mi_tree( 500, (char *)CONNECT_FAILED, strlen(CONNECT_FAILED) ); @@ -527,12 +530,12 @@ static struct mi_root* mi_run_rpc(struct mi_root* cmd_tree, void* param) return( init_mi_tree( 400, MI_MISSING_PARM_S, MI_MISSING_PARM_LEN )); fn = &node->value; - + /* find_rpc_exports needs 0 terminated strings */ command = pkg_malloc(fn->len+1); memcpy(command, fn->s, fn->len); command[fn->len] = '\0'; - + /* Count the parameters. */ node = node->next; while (node) { @@ -564,9 +567,9 @@ static struct mi_root* mi_run_rpc(struct mi_root* cmd_tree, void* param) result = init_mi_tree( 500, (char *)FAILED, strlen(FAILED) ); goto end; } - + resp_type = binrpc_get_response_type(&resp_handle); - + /* If we already have a buffer make it NULL terminated to discard any previous content */ if (resp_len > 0) response[0]='\0'; @@ -582,12 +585,12 @@ static struct mi_root* mi_run_rpc(struct mi_root* cmd_tree, void* param) /* Some functions don't give a text answer; use a default */ result = init_mi_tree( 200, MI_OK_S, MI_OK_LEN ); break; - + case 1: /* Valid failure */ binrpc_parse_error_response(&resp_handle, &resp_code, &resp); if (resp_len < strlen(resp) + 1) - { + { if (resp_len==0) response = malloc(strlen(resp) + 1); else @@ -601,7 +604,7 @@ static struct mi_root* mi_run_rpc(struct mi_root* cmd_tree, void* param) /* Some functions don't give a text answer; use a default */ result = init_mi_tree( resp_code, (char *)FAILED, strlen(FAILED) ); break; - + default: result = init_mi_tree( 500, (char *)FAILED, strlen(FAILED) ); goto end; @@ -610,7 +613,7 @@ static struct mi_root* mi_run_rpc(struct mi_root* cmd_tree, void* param) end: if (param_count > 0) { - for (i=0; i - Copyright 2004-2008 Juha Heinanen + Copyright © 2004-2008 Juha Heinanen __________________________________________________________________ Table of Contents @@ -47,7 +47,7 @@ Daniel-Constantin Mierla List of Examples - 1.1. "SIP-AVP" RADIUS AVP exmaples + 1.1. “SIP-AVP” RADIUS AVP exmaples 1.2. radius_config parameter usage 1.3. caller_service_type parameter usage 1.4. callee_service_type parameter usage @@ -113,7 +113,7 @@ Chapter 1. Admin Guide * SIP_AVP_NAME = STRING_NAME | '#'ID_NUMBER * SIP_AVP_VALUE = ':'STRING_VALUE | '#'NUMBER_VALUE - Example 1.1. "SIP-AVP" RADIUS AVP exmaples + Example 1.1. “SIP-AVP” RADIUS AVP exmaples .... "email:joe@yahoo.com" -> STRING NAME AVP (email) with STRING VALUE (joe@yahoo.com) @@ -126,7 +126,7 @@ Chapter 1. Admin Guide .... Unlike in old avp_radius module, functions radius_load_calle[re]_avps() - do not prefix string names of AVPs by string "caller_" or "callee_" + do not prefix string names of AVPs by string “caller_” or “callee_” depending if caller's or callee's attributes were loaded. If you need these prefixes, make your RADIUS server to prepend them into attribute names when it constructs reply items. @@ -149,9 +149,14 @@ Chapter 1. Admin Guide 2.2. External Libraries or Applications The following libraries or applications must be installed before - compilling Kamailio with this module loaded: - * radiusclient-ng 0.5.6 or higher -- library and development files. - See http://developer.berlios.de/projects/radiusclient-ng/. + running Kamailio with this module loaded: + * radiusclient-ng 0.5.0 or higher, freeradius-client + https://github.com/FreeRADIUS/freeradius-client/ or radcli + http://radcli.github.io/radcli/. + * freeradius-client library can be used after setting FREERADIUS + variable in source code with 'export FREERADIUS=1' before compile. + * radcli library can be used after setting RADCLI variable in source + code with 'export RADCLI=1' before compile. 3. Parameters @@ -172,7 +177,7 @@ Chapter 1. Admin Guide This is the location of the configuration file of radius client libraries. - Default value is "/usr/local/etc/radiusclient-ng/radiusclient.conf". + Default value is “/usr/local/etc/radiusclient-ng/radiusclient.conf”. Example 1.2. radius_config parameter usage ... @@ -183,7 +188,7 @@ modparam("misc_radius", "radius_config", "/etc/radiusclient.conf") This is the value of the Service-Type radius attribute to be used, when caller's attributes are loaded. - Default value is dictionary value of "SIP-Caller-AVPs" Service-Type. + Default value is dictionary value of “SIP-Caller-AVPs” Service-Type. Example 1.3. caller_service_type parameter usage ... @@ -194,7 +199,7 @@ modparam("misc_radius", "caller_service_type", 18) This is the value of the Service-Type radius attribute to be used, when callee's attributes are loaded. - Default value is dictionary value of "SIP-Callee-AVPs" Service-Type. + Default value is dictionary value of “SIP-Callee-AVPs” Service-Type. Example 1.4. callee_service_type parameter usage ... @@ -205,7 +210,7 @@ modparam("misc_radius", "callee_service_type", 19) This is the value of Service-Type RADIUS attribute to be used, when radius_is_user_in() function is called. - Default value is dictionary value of "Group-Check" Service-Type. + Default value is dictionary value of “Group-Check” Service-Type. Example 1.5. group_service_type parameter usage ... @@ -216,7 +221,7 @@ modparam("misc_radius", "group_service_type", 20) This is the value of Service-Type RADIUS attribute to be used, when radius_does_uri[_user]_exist() function is called. - Default value is dictionary value of "Call-Check" Service-Type. + Default value is dictionary value of “Call-Check” Service-Type. Example 1.6. uri_service_type parameter usage ... @@ -297,7 +302,7 @@ modparam("misc_radius", "use_sip_uri_host", 1) as AVPs in radius_load_caller_avps and radius_load_callee_avps with name as radius attribute name and value as radius attribute value. - Default value is "0". + Default value is “0”. Example 1.12. common_response parameter usage ... @@ -339,7 +344,7 @@ eout#161 next-hop-ip:h323/0001111@myvoip-gate.kamailio.org" 4.1. radius_load_caller_avps(caller) The functions loads caller's attributes from radius and stores them - into AVPs. Parameter "caller" is a string that may contain pseudo + into AVPs. Parameter “caller” is a string that may contain pseudo variables. It indicates the user, whose attributes are loaded. This function can be used from REQUEST_ROUTE, FAILURE_ROUTE. @@ -354,7 +359,7 @@ radius_load_caller_avps("$au@$ar"); # take caller from Authorization 4.2. radius_load_callee_avps(callee) The functions loads callee's attributes from radius and stores them - into AVPs. Parameter "callee" is a string that may contain pseudo + into AVPs. Parameter “callee” is a string that may contain pseudo variables. It indicates the user, whose attributes are loaded. This function can be used from REQUEST_ROUTE, FAILURE_ROUTE. diff --git a/modules/misc_radius/doc/misc_radius_admin.xml b/modules/misc_radius/doc/misc_radius_admin.xml index 49c4a3477d1..97289d6379e 100644 --- a/modules/misc_radius/doc/misc_radius_admin.xml +++ b/modules/misc_radius/doc/misc_radius_admin.xml @@ -89,25 +89,34 @@
External Libraries or Applications - The following libraries or applications must be installed - before compilling &kamailio; with this module loaded: + The following libraries or applications must be installed + before running &kamailio; with this module loaded: - radiusclient-ng 0.5.0 or freeradius-client -+ or higher. - library and development files. See radiusclient-ng 0.5.0 or higher, + freeradius-client -+ https://github.com/FreeRADIUS/freeradius-client/. + https://github.com/FreeRADIUS/freeradius-client/ or + radcli + http://radcli.github.io/radcli/. -+ -+ freeradius-client library can be used after -+ setting FREERADIUS variable in source code with -+ 'export FREERADIUS=1' command before compile. - - + + freeradius-client library can be used after + setting FREERADIUS variable in source code with + 'export FREERADIUS=1' before compile. + + + + + radcli library can be used after + setting RADCLI variable in source code with + 'export RADCLI=1' before compile. + +
diff --git a/modules/misc_radius/functions.c b/modules/misc_radius/functions.c index fb9ec784c1f..e171468a748 100644 --- a/modules/misc_radius/functions.c +++ b/modules/misc_radius/functions.c @@ -44,7 +44,7 @@ static inline int extract_avp(VALUE_PAIR* vp, unsigned short *flags, char *end; /* empty? */ - if (vp->lvalue==0 || vp->strvalue==0) + if (vp->lvalue==0) goto error; p = vp->strvalue; diff --git a/modules/mohqueue/README b/modules/mohqueue/README index ab9cf1e23f9..8094ed0ce75 100644 --- a/modules/mohqueue/README +++ b/modules/mohqueue/README @@ -136,8 +136,8 @@ Chapter 1. Admin Guide Example 1.1. Set db_url: ... -modparam ("mohqueue", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio -") +modparam ("mohqueue", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio" +) ... 3.2. db_qtable and db_ctable (str) diff --git a/modules/mohqueue/mohq.c b/modules/mohqueue/mohq.c index bc54aca84d5..55a85ea83ae 100644 --- a/modules/mohqueue/mohq.c +++ b/modules/mohqueue/mohq.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-15 Robert Boisvert + * Copyright (C) 2013-16 Robert Boisvert * * This file is part of the mohqueue module for Kamailio, a free SIP server. * @@ -42,6 +42,7 @@ static int mod_init (void); **********/ mod_data *pmod_data; +pv_spec_t *prtp_pv; /********** * module exports @@ -97,6 +98,12 @@ struct module_exports exports = { mod_child_init, /* per-child initialization function */ }; +/********** +* local constants +**********/ + +str prtpstat [1] = {STR_STATIC_INIT ("$rtpstat")}; + /********** * local functions **********/ @@ -349,6 +356,8 @@ return; int mod_init (void) { +int rtplen; + /********** * o allocate shared mem and init * o init configuration data @@ -430,6 +439,23 @@ if (!pmod_data->fn_rtp_destroy) goto initerr; } +/********** +* get RTPSTAT pv spec +**********/ + +rtplen = pv_locate_name (prtpstat); +if(rtplen != prtpstat->len) + { + LM_ERR ("Unable to find RTPSTAT pv!\n"); + goto initerr; + } +prtp_pv = pv_cache_get (&prtpstat); +if(!prtp_pv) + { + LM_ERR ("Unable to find pv spec for RTPSTAT!\n"); + goto initerr; + } + /********** * init MOH and call queue locks **********/ diff --git a/modules/mohqueue/mohq.h b/modules/mohqueue/mohq.h index 207bcbaea2c..de2ef6654f6 100644 --- a/modules/mohqueue/mohq.h +++ b/modules/mohqueue/mohq.h @@ -131,6 +131,7 @@ typedef struct **********/ extern mod_data *pmod_data; +extern pv_spec_t *prtp_pv; extern rtpmap prtpmap []; #endif /* MOHQ_H */ \ No newline at end of file diff --git a/modules/mohqueue/mohq_funcs.c b/modules/mohqueue/mohq_funcs.c index 86699aeb618..3722e00555a 100644 --- a/modules/mohqueue/mohq_funcs.c +++ b/modules/mohqueue/mohq_funcs.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-15 Robert Boisvert + * Copyright (C) 2013-16 Robert Boisvert * * This file is part of the mohqueue module for Kamailio, a free SIP server. * @@ -32,7 +32,7 @@ #define ALLOWHDR "Allow: INVITE, ACK, BYE, CANCEL, NOTIFY, PRACK" #define CLENHDR "Content-Length" #define SIPEOL "\r\n" -#define USRAGNT "Kamailio MOH Queue v1.2" +#define USRAGNT "Kamailio MOH Queue v1.3" /********** * local constants @@ -403,6 +403,26 @@ else return; } +/********** +* Check if RTP Still Active +* +* INPUT: +* Arg (1) = SIP message pointer +* OUTPUT: =0 if inactive +**********/ + +int chk_rtpstat (sip_msg_t *pmsg) + +{ +pv_value_t pval [1]; +memset (pval, 0, sizeof (pv_value_t)); +if (pv_get_spec_value (pmsg, prtp_pv, pval)) + { return 0; } +if (pval->flags & PV_VAL_NULL) + { return 0; } +return 1; +} + /********** * Close the Call * @@ -1664,10 +1684,23 @@ return nret; static void refer_cb (struct cell *ptrans, int ntype, struct tmcb_params *pcbp) - { char *pfncname = "refer_cb: "; call_lst *pcall = (call_lst *)*pcbp->param; +if (pcall->call_state != CLSTA_REFER) + { + if (!pcall->call_state) + { + LM_ERR + ("%sREFER response ignored because call not in queue!\n", pfncname); + } + else + { + LM_ERR ("%sCall (%s) ignored because not in REFER state!\n", pfncname, + pcall->call_from); + } + return; + } if ((ntype == TMCB_ON_FAILURE) || (pcbp->req == FAKED_REPLY)) { LM_ERR ("%sCall (%s) did not respond to REFER!\n", pfncname, @@ -1676,6 +1709,11 @@ if ((ntype == TMCB_ON_FAILURE) || (pcbp->req == FAKED_REPLY)) delete_call (pcall); return; } + +/********** +* check reply +**********/ + int nreply = pcbp->code; if ((nreply / 100) == 2) { @@ -1692,8 +1730,17 @@ else { delete_call (pcall); } else { - pcall->call_state = CLSTA_INQUEUE; - update_call_rec (pcall); + if (!chk_rtpstat (pcbp->req)) + { + LM_ERR ("%sRTP for call (%s) no longer active!\n", + pfncname, pcall->call_from); + delete_call (pcall); + } + else + { + pcall->call_state = CLSTA_INQUEUE; + update_call_rec (pcall); + } } } return; diff --git a/modules/mqueue/README b/modules/mqueue/README index 952e900436e..e4a4cec0e55 100644 --- a/modules/mqueue/README +++ b/modules/mqueue/README @@ -17,7 +17,7 @@ Alex Balashov Evariste Systems - Copyright 2010 Elena-Ramona Modroiu (asipto.com) + Copyright © 2010 Elena-Ramona Modroiu (asipto.com) __________________________________________________________________ Table of Contents @@ -109,7 +109,7 @@ Chapter 1. Admin Guide Definition of a memory queue - Default value is "none". + Default value is “none”. Value must be a list of parameters: attr=value;... The attribute 'name' is mandatory, defining the name of the queue. Optional attribute 'size' @@ -132,7 +132,7 @@ modparam("mqueue", "mqueue", "name=qaz") 4.3. mq_pv_free(queue) 4.4. mq_size(queue) -4.1. mq_add(queue, key, value) +4.1. mq_add(queue, key, value) Add a new item (key, value) in the queue. If max size of queue is exceeded, the oldest one is removed. @@ -142,7 +142,7 @@ modparam("mqueue", "mqueue", "name=qaz") mq_add("myq", "$rU", "call from $fU"); ... -4.2. mq_fetch(queue) +4.2. mq_fetch(queue) Take oldest item from queue and fill $mqk(queue) and $mqv(queue) pseudo variables. @@ -158,7 +158,7 @@ while(mq_fetch("myq")) } ... -4.3. mq_pv_free(queue) +4.3. mq_pv_free(queue) Free the item fetched in pseudo-variables. It is optional, a new fetch frees the previous values. @@ -168,7 +168,7 @@ while(mq_fetch("myq")) mq_pv_free("myq"); ... -4.4. mq_size(queue) +4.4. mq_size(queue) Returns the current number of elements in the mqueue. diff --git a/modules/mqueue/mqueue_api.c b/modules/mqueue/mqueue_api.c index 93d6b86b2ee..45ae08d2f48 100644 --- a/modules/mqueue/mqueue_api.c +++ b/modules/mqueue/mqueue_api.c @@ -44,7 +44,6 @@ typedef struct _mq_item { str key; str val; - struct _mq_item *prev; struct _mq_item *next; } mq_item_t; @@ -266,8 +265,6 @@ int mq_head_fetch(str *name) mh->ifirst = mh->ifirst->next; if(mh->ifirst==NULL) { mh->ilast = NULL; - } else { - mh->ifirst->prev = NULL; } mh->csize--; @@ -332,7 +329,6 @@ int mq_item_add(str *qname, str *key, str *val) mh->ilast = mi; } else { mh->ilast->next = mi; - mi->prev = mh->ilast; mh->ilast = mi; } mh->csize++; @@ -341,9 +337,9 @@ int mq_item_add(str *qname, str *key, str *val) mi = mh->ifirst; mh->ifirst = mh->ifirst->next; if(mh->ifirst==NULL) + { mh->ilast = NULL; - else - mh->ifirst->prev = NULL; + } mh->csize--; shm_free(mi); } diff --git a/modules/msilo/README b/modules/msilo/README index 310e8ece8fb..5d4ff2146d3 100644 --- a/modules/msilo/README +++ b/modules/msilo/README @@ -20,9 +20,9 @@ Juha Heinanen - Copyright 2003 FhG FOKUS + Copyright © 2003 FhG FOKUS - Copyright 2009 Juha Heinanen + Copyright © 2009 Juha Heinanen __________________________________________________________________ Table of Contents @@ -39,28 +39,28 @@ Juha Heinanen 3.1. db_url (string) 3.2. db_table (string) - 3.3. from_address (string) - 3.4. contact_hdr (string) - 3.5. extra_hdrs (string) - 3.6. offline_message (string) - 3.7. content_type_hdr (string) - 3.8. reminder (string) - 3.9. outbound_proxy (string) - 3.10. expire_time (int) - 3.11. check_time (int) - 3.12. send_time (int) - 3.13. clean_period (int) - 3.14. use_contact (int) - 3.15. sc_mid (string) - 3.16. sc_from (string) - 3.17. sc_to (string) - 3.18. sc_uri_user (string) - 3.19. sc_uri_host (string) - 3.20. sc_body (string) - 3.21. sc_ctype (string) - 3.22. sc_exp_time (string) - 3.23. sc_inc_time (string) - 3.24. sc_snd_time (string) + 3.3. sc_mid (string) + 3.4. sc_from (string) + 3.5. sc_to (string) + 3.6. sc_uri_user (string) + 3.7. sc_uri_host (string) + 3.8. sc_body (string) + 3.9. sc_ctype (string) + 3.10. sc_exp_time (string) + 3.11. sc_inc_time (string) + 3.12. sc_snd_time (string) + 3.13. from_address (string) + 3.14. contact_hdr (string) + 3.15. extra_hdrs (string) + 3.16. offline_message (string) + 3.17. content_type_hdr (string) + 3.18. reminder (string) + 3.19. outbound_proxy (string) + 3.20. expire_time (int) + 3.21. check_time (int) + 3.22. send_time (int) + 3.23. clean_period (int) + 3.24. use_contact (int) 3.25. snd_time_avp (str) 3.26. add_date (int) 3.27. max_messages (int) @@ -87,36 +87,36 @@ Juha Heinanen List of Examples - 1.1. Set the "db_url" parameter - 1.2. Set the "db_table" parameter - 1.3. Set the "from_address" parameter - 1.4. Set the "contact_hdr" parameter - 1.5. Set the "extra_hdrs" parameter - 1.6. Set the "offline_message" parameter - 1.7. Set the "content_type_hdr" parameter - 1.8. Set the "reminder" parameter - 1.9. Set the "outbound_proxy" parameter - 1.10. Set the "expire_time" parameter - 1.11. Set the "check_time" parameter - 1.12. Set the "send_time" parameter - 1.13. Set the "clean_period" parameter - 1.14. Set the "use_contact" parameter - 1.15. Set the "sc_mid" parameter - 1.16. Set the "sc_from" parameter - 1.17. Set the "sc_to" parameter - 1.18. Set the "sc_uri_user" parameter - 1.19. Set the "sc_uri_host" parameter - 1.20. Set the "sc_body" parameter - 1.21. Set the "sc_ctype" parameter - 1.22. Set the "sc_exp_time" parameter - 1.23. Set the "sc_inc_time" parameter - 1.24. Set the "sc_snd_time" parameter - 1.25. Set the "snd_time_avp" parameter - 1.26. Set the "add_date" parameter - 1.27. Set the "max_messages" parameter - 1.28. Set the "add_contact" parameter - 1.29. Set the "extra_hdrs_avp" parameter - 1.30. Set the "skip_notification_flag" parameter + 1.1. Set the “db_url” parameter + 1.2. Set the “db_table” parameter + 1.3. Set the “sc_mid” parameter + 1.4. Set the “sc_from” parameter + 1.5. Set the “sc_to” parameter + 1.6. Set the “sc_uri_user” parameter + 1.7. Set the “sc_uri_host” parameter + 1.8. Set the “sc_body” parameter + 1.9. Set the “sc_ctype” parameter + 1.10. Set the “sc_exp_time” parameter + 1.11. Set the “sc_inc_time” parameter + 1.12. Set the “sc_snd_time” parameter + 1.13. Set the “from_address” parameter + 1.14. Set the “contact_hdr” parameter + 1.15. Set the “extra_hdrs” parameter + 1.16. Set the “offline_message” parameter + 1.17. Set the “content_type_hdr” parameter + 1.18. Set the “reminder” parameter + 1.19. Set the “outbound_proxy” parameter + 1.20. Set the “expire_time” parameter + 1.21. Set the “check_time” parameter + 1.22. Set the “send_time” parameter + 1.23. Set the “clean_period” parameter + 1.24. Set the “use_contact” parameter + 1.25. Set the “snd_time_avp” parameter + 1.26. Set the “add_date” parameter + 1.27. Set the “max_messages” parameter + 1.28. Set the “add_contact” parameter + 1.29. Set the “extra_hdrs_avp” parameter + 1.30. Set the “skip_notification_flag” parameter 1.31. m_store usage 1.32. m_dump usage 1.33. Kamailio config script - sample msilo usage @@ -135,28 +135,28 @@ Chapter 1. Admin Guide 3.1. db_url (string) 3.2. db_table (string) - 3.3. from_address (string) - 3.4. contact_hdr (string) - 3.5. extra_hdrs (string) - 3.6. offline_message (string) - 3.7. content_type_hdr (string) - 3.8. reminder (string) - 3.9. outbound_proxy (string) - 3.10. expire_time (int) - 3.11. check_time (int) - 3.12. send_time (int) - 3.13. clean_period (int) - 3.14. use_contact (int) - 3.15. sc_mid (string) - 3.16. sc_from (string) - 3.17. sc_to (string) - 3.18. sc_uri_user (string) - 3.19. sc_uri_host (string) - 3.20. sc_body (string) - 3.21. sc_ctype (string) - 3.22. sc_exp_time (string) - 3.23. sc_inc_time (string) - 3.24. sc_snd_time (string) + 3.3. sc_mid (string) + 3.4. sc_from (string) + 3.5. sc_to (string) + 3.6. sc_uri_user (string) + 3.7. sc_uri_host (string) + 3.8. sc_body (string) + 3.9. sc_ctype (string) + 3.10. sc_exp_time (string) + 3.11. sc_inc_time (string) + 3.12. sc_snd_time (string) + 3.13. from_address (string) + 3.14. contact_hdr (string) + 3.15. extra_hdrs (string) + 3.16. offline_message (string) + 3.17. content_type_hdr (string) + 3.18. reminder (string) + 3.19. outbound_proxy (string) + 3.20. expire_time (int) + 3.21. check_time (int) + 3.22. send_time (int) + 3.23. clean_period (int) + 3.24. use_contact (int) 3.25. snd_time_avp (str) 3.26. add_date (int) 3.27. max_messages (int) @@ -183,31 +183,33 @@ Chapter 1. Admin Guide 1. Overview - This modules provides offline message storage for the Kamailio SIP - Server Platform. It stores received messages for an offline user and - sends them when the user becomes online. + This module provides offline message storage for Kamailio SIP Server + Platform. It stores received messages for an offline user and sends + them when the user comes back online. It can also send reminders and + auto-expire messages. - For each message, the modules stores "Request-URI" ("R-URI") only if it - is a complete address of record ("username@hostname"), URI from "To" - header, URI from "From" header, incoming time, expiration time, content - type and body of the message. If "R-URI" is not an address of record + For each message, the modules stores “Request-URI” (“R-URI”) only if it + is a complete address of record (“username@hostname”), URI from “To” + header, URI from “From” header, incoming time, expiration time, content + type and body of the message. If “R-URI” is not an address of record (it might be the contact address for current SIP session) the URI from - "To" header will be used as R-URI. + “To” header will be used as R-URI. - When the expiration time passed, the message is discarded from + When the expiration time is passed, the message is discarded from database. Expiration time is computed based on incoming time and one of the module's parameters. Every time when a user registers with Kamailio, the module is looking in database for offline messages intended for that user. All of them - will be sent to contact address provided in REGISTER request. + will be sent to contact address provided in REGISTER request and then + be deleted. - It may happen that the SIP user to be registered use a SIP User Agent - that has no support for MESSAGE requests. In this case the - "failure_route" should be used to re-store the undelivered requests. + It may happen that the SIP user registering use a SIP User Agent that + has no support for MESSAGE requests. In this case the “failure_route” + should be used to re-store the undelivered requests. - Another functionality provided by the module is to send messages at a - certain time -- the reminder functionality. Using config logic, a + Another functionality provided by the MSILO module is to send messages + at a certain time -- the reminder functionality. Using config logic, a received message can be stored and delivered at a time specified while storing with the 'snd_time_avp'. @@ -220,7 +222,7 @@ Chapter 1. Admin Guide The following modules must be loaded before this module: * database module - mysql, dbtext or other module that implements the - "db" interface and provides support for storing/receiving data + “db” interface and provides support for storing/receiving data to/from a database system. * TM--transaction module-- used to send SIP requests. @@ -234,28 +236,28 @@ Chapter 1. Admin Guide 3.1. db_url (string) 3.2. db_table (string) - 3.3. from_address (string) - 3.4. contact_hdr (string) - 3.5. extra_hdrs (string) - 3.6. offline_message (string) - 3.7. content_type_hdr (string) - 3.8. reminder (string) - 3.9. outbound_proxy (string) - 3.10. expire_time (int) - 3.11. check_time (int) - 3.12. send_time (int) - 3.13. clean_period (int) - 3.14. use_contact (int) - 3.15. sc_mid (string) - 3.16. sc_from (string) - 3.17. sc_to (string) - 3.18. sc_uri_user (string) - 3.19. sc_uri_host (string) - 3.20. sc_body (string) - 3.21. sc_ctype (string) - 3.22. sc_exp_time (string) - 3.23. sc_inc_time (string) - 3.24. sc_snd_time (string) + 3.3. sc_mid (string) + 3.4. sc_from (string) + 3.5. sc_to (string) + 3.6. sc_uri_user (string) + 3.7. sc_uri_host (string) + 3.8. sc_body (string) + 3.9. sc_ctype (string) + 3.10. sc_exp_time (string) + 3.11. sc_inc_time (string) + 3.12. sc_snd_time (string) + 3.13. from_address (string) + 3.14. contact_hdr (string) + 3.15. extra_hdrs (string) + 3.16. offline_message (string) + 3.17. content_type_hdr (string) + 3.18. reminder (string) + 3.19. outbound_proxy (string) + 3.20. expire_time (int) + 3.21. check_time (int) + 3.22. send_time (int) + 3.23. clean_period (int) + 3.24. use_contact (int) 3.25. snd_time_avp (str) 3.26. add_date (int) 3.27. max_messages (int) @@ -267,9 +269,9 @@ Chapter 1. Admin Guide Database URL. - Default value is "mysql://kamailio:kamailiorw@localhost/kamailio". + Default value is “mysql://kamailio:kamailiorw@localhost/kamailio”. - Example 1.1. Set the "db_url" parameter + Example 1.1. Set the “db_url” parameter ... modparam("msilo", "db_url", "mysql://user:passwd@host.com/dbname") ... @@ -278,280 +280,280 @@ modparam("msilo", "db_url", "mysql://user:passwd@host.com/dbname") The name of table where to store the messages. - Default value is "silo". + Default value is “silo”. - Example 1.2. Set the "db_table" parameter + Example 1.2. Set the “db_table” parameter ... modparam("msilo", "db_table", "silo") ... -3.3. from_address (string) +3.3. sc_mid (string) - The SIP address used to inform users that destination of their message - is not online and the message will be delivered next time when that - user goes online. If the parameter is not set, the module will not send - any notification. It can contain pseudo-variables. + The name of the column in silo table used to store the message id. - Default value is "NULL". + Default value is “mid”. - Example 1.3. Set the "from_address" parameter + Example 1.3. Set the “sc_mid” parameter ... -modparam("msilo", "from_address", "sip:registrar@example.org") -modparam("msilo", "from_address", "sip:$rU@example.org") +modparam("msilo", "sc_mid", "other_mid") ... -3.4. contact_hdr (string) +3.4. sc_from (string) - The value of the "Contact" header (including header name and ending - \r\n) to be added in notification messages. It can contain - pseudo-variables. + The name of the column in silo table, storing the source address. - Default value is "NULL". + Default value is “src_addr”. - Example 1.4. Set the "contact_hdr" parameter + Example 1.4. Set the “sc_from” parameter ... -modparam("msilo", "contact_hdr", "Contact: \r\n") +modparam("msilo", "sc_from", "source_address") ... -3.5. extra_hdrs (string) +3.5. sc_to (string) - Extra headers (each ending with \r\n) to be added in messages sent from - silo by m_dump. It can contain pseudo-variables. + The name of the column in silo table, storing the destination address. - Default value is "NULL". + Default value is “dst_addr”. - Example 1.5. Set the "extra_hdrs" parameter + Example 1.5. Set the “sc_to” parameter ... -modparam("msilo", "extra_hdrs", "X-Extra: $tu\r\nY-Extra: foo\r\n") +modparam("msilo", "sc_to", "destination_address") ... -3.6. offline_message (string) +3.6. sc_uri_user (string) - The body of the notification message. It can contain pseudo-variables. + The name of the column in silo table, storing the user name. - Default value is "NULL". + Default value is “username”. - Example 1.6. Set the "offline_message" parameter + Example 1.6. Set the “sc_uri_user” parameter ... -modparam("msilo", "offline_message", "*** User $rU is offline!") -modparam("msilo", "offline_message", "I am offline!") +modparam("msilo", "sc_uri_user", "user") ... -3.7. content_type_hdr (string) +3.7. sc_uri_host (string) - The value of the Content-Type header (including header name and ending - \r\n) to be added in notification messages. It must reflect what the - 'offline_message' contains. It can contain pseudo-variables. + The name of the column in silo table, storing the domain. - Default value is "NULL". + Default value is “domain”. - Example 1.7. Set the "content_type_hdr" parameter + Example 1.7. Set the “sc_uri_host” parameter ... -modparam("msilo", "content_type_hdr", "Content-Type: text/plain\r\n") -modparam("msilo", "content_type_hdr", "Content-Type: text/html\r\n") +modparam("msilo", "sc_uri_host", "domain") ... -3.8. reminder (string) +3.8. sc_body (string) - The SIP address used to send reminder messages. If this value is not - set, the reminder feature is disabled. + The name of the column storing the message body in silo table. - Default value is "NULL". + Default value is “body”. - Example 1.8. Set the "reminder" parameter + Example 1.8. Set the “sc_body” parameter ... -modparam("msilo", "reminder", "sip:registrar@example.org") +modparam("msilo", "sc_body", "message_body") ... -3.9. outbound_proxy (string) +3.9. sc_ctype (string) - The SIP address used as next hop when sending the message. Very useful - when using Kamailio with a domain name not in DNS, or when using a - separate Kamailio instance for msilo processing. If not set, the - message will be sent to the address in destination URI. + The name of the column in silo table, storing content type. - Default value is "NULL". + Default value is “ctype”. - Example 1.9. Set the "outbound_proxy" parameter + Example 1.9. Set the “sc_ctype” parameter ... -modparam("msilo", "outbound_proxy", "sip:kamailio.org;transport=tcp") +modparam("msilo", "sc_ctype", "content_type") ... -3.10. expire_time (int) +3.10. sc_exp_time (string) - Expire time of stored messages - seconds. When this time passed, the - message is silently discarded from database. + The name of the column in silo table, storing the expire time of the + message. - Default value is "259200 (72 hours = 3 days)". + Default value is “exp_time”. - Example 1.10. Set the "expire_time" parameter + Example 1.10. Set the “sc_exp_time” parameter ... -modparam("msilo", "expire_time", 36000) +modparam("msilo", "sc_exp_time", "expire_time") ... -3.11. check_time (int) +3.11. sc_inc_time (string) - Timer interval to check if dumped messages are sent OK - seconds. The - module keeps each request send by itself for a new online user and if - the reply is 2xx then the message is deleted from database. + The name of the column in silo table, storing the incoming time of the + message. - Default value is "30". + Default value is “inc_time”. - Example 1.11. Set the "check_time" parameter + Example 1.11. Set the “sc_inc_time” parameter ... -modparam("msilo", "check_time", 10) +modparam("msilo", "sc_inc_time", "incoming_time") ... -3.12. send_time (int) - - Timer interval in seconds to check if there are reminder messages. The - module takes all reminder messages that must be sent at that moment or - before that moment. +3.12. sc_snd_time (string) - If the value is 0, the reminder feature is disabled. + The name of the column in silo table, storing the send time for the + reminder. - Default value is "0". + Default value is “snd_time”. - Example 1.12. Set the "send_time" parameter + Example 1.12. Set the “sc_snd_time” parameter ... -modparam("msilo", "send_time", 60) +modparam("msilo", "sc_snd_time", "send_reminder_time") ... -3.13. clean_period (int) +3.13. from_address (string) - Number of "check_time" cycles when to check if there are expired - messages in database. + The SIP address used to inform users that destination of their message + is not online and the message will be delivered next time when that + user goes online. If the parameter is not set, the module will not send + any notification. This parameter may contain pseudo-variables. - Default value is "5". + Default value is “NULL”. - Example 1.13. Set the "clean_period" parameter + Example 1.13. Set the “from_address” parameter ... -modparam("msilo", "clean_period", 3) +modparam("msilo", "from_address", "sip:registrar@example.org") +modparam("msilo", "from_address", "sip:$rU@example.org") ... -3.14. use_contact (int) +3.14. contact_hdr (string) - Turns on/off the usage of the "Contact" address to send notification - back to sender whose message is stored by MSILO. + The value of the “Contact” header (including header name and ending + \r\n) to be added in notification messages. It can contain + pseudo-variables. - Default value is "1 (0 = off, 1 = on)". + Default value is “NULL”. - Example 1.14. Set the "use_contact" parameter + Example 1.14. Set the “contact_hdr” parameter ... -modparam("msilo", "use_contact", 0) +modparam("msilo", "contact_hdr", "Contact: \r\n") ... -3.15. sc_mid (string) +3.15. extra_hdrs (string) - The name of the column in silo table, storing message id. + Extra headers (each ending with \r\n) to be added in messages sent from + silo by m_dump. It can contain pseudo-variables. - Default value is "mid". + Default value is “NULL”. - Example 1.15. Set the "sc_mid" parameter + Example 1.15. Set the “extra_hdrs” parameter ... -modparam("msilo", "sc_mid", "other_mid") +modparam("msilo", "extra_hdrs", "X-Extra: $tu\r\nY-Extra: foo\r\n") ... -3.16. sc_from (string) +3.16. offline_message (string) - The name of the column in silo table, storing the source address. + The body of the notification message. It can contain pseudo-variables. - Default value is "src_addr". + Default value is “NULL”. - Example 1.16. Set the "sc_from" parameter + Example 1.16. Set the “offline_message” parameter ... -modparam("msilo", "sc_from", "source_address") +modparam("msilo", "offline_message", "*** User $rU is offline!") +modparam("msilo", "offline_message", "I am offline!") ... -3.17. sc_to (string) +3.17. content_type_hdr (string) - The name of the column in silo table, storing the destination address. + The value of the Content-Type header (including header name and ending + \r\n) to be added in notification messages. It must reflect what the + 'offline_message' contains. It can contain pseudo-variables. - Default value is "dst_addr". + Default value is “NULL”. - Example 1.17. Set the "sc_to" parameter + Example 1.17. Set the “content_type_hdr” parameter ... -modparam("msilo", "sc_to", "destination_address") +modparam("msilo", "content_type_hdr", "Content-Type: text/plain\r\n") +modparam("msilo", "content_type_hdr", "Content-Type: text/html\r\n") ... -3.18. sc_uri_user (string) +3.18. reminder (string) - The name of the column in silo table, storing the user name. + The SIP address used to send reminder messages. If this value is not + set, the reminder feature is disabled. - Default value is "username". + Default value is “NULL”. - Example 1.18. Set the "sc_uri_user" parameter + Example 1.18. Set the “reminder” parameter ... -modparam("msilo", "sc_uri_user", "user") +modparam("msilo", "reminder", "sip:registrar@example.org") ... -3.19. sc_uri_host (string) +3.19. outbound_proxy (string) - The name of the column in silo table, storing the domain. + The SIP address used as next hop when sending the message. Very useful + when using Kamailio with a domain name not in DNS, or when using a + separate Kamailio instance for msilo processing. If not set, the + message will be sent to the address in destination URI. - Default value is "domain". + Default value is “NULL”. - Example 1.19. Set the "sc_uri_host" parameter + Example 1.19. Set the “outbound_proxy” parameter ... -modparam("msilo", "sc_uri_host", "domain") +modparam("msilo", "outbound_proxy", "sip:kamailio.org;transport=tcp") ... -3.20. sc_body (string) +3.20. expire_time (int) - The name of the column storing the message body in silo table. + Expire time of stored messages - seconds. When this time passed, the + message is silently discarded from database. - Default value is "body". + Default value is “259200 (72 hours = 3 days)”. - Example 1.20. Set the "sc_body" parameter + Example 1.20. Set the “expire_time” parameter ... -modparam("msilo", "sc_body", "message_body") +modparam("msilo", "expire_time", 36000) ... -3.21. sc_ctype (string) +3.21. check_time (int) - The name of the column in silo table, storing content type. + Timer interval to check if dumped messages are sent OK - seconds. The + module keeps each request send by itself for a new online user and if + the reply is 2xx then the message is deleted from database. - Default value is "ctype". + Default value is “30”. - Example 1.21. Set the "sc_ctype" parameter + Example 1.21. Set the “check_time” parameter ... -modparam("msilo", "sc_ctype", "content_type") +modparam("msilo", "check_time", 10) ... -3.22. sc_exp_time (string) +3.22. send_time (int) - The name of the column in silo table, storing the expire time of the - message. + Timer interval in seconds to check if there are reminder messages. The + module takes all reminder messages that must be sent at that moment or + before that moment. + + If the value is 0, the reminder feature is disabled. - Default value is "exp_time". + Default value is “0”. - Example 1.22. Set the "sc_exp_time" parameter + Example 1.22. Set the “send_time” parameter ... -modparam("msilo", "sc_exp_time", "expire_time") +modparam("msilo", "send_time", 60) ... -3.23. sc_inc_time (string) +3.23. clean_period (int) - The name of the column in silo table, storing the incoming time of the - message. + Number of “check_time” cycles when to check if there are expired + messages in database. - Default value is "inc_time". + Default value is “5”. - Example 1.23. Set the "sc_inc_time" parameter + Example 1.23. Set the “clean_period” parameter ... -modparam("msilo", "sc_inc_time", "incoming_time") +modparam("msilo", "clean_period", 3) ... -3.24. sc_snd_time (string) +3.24. use_contact (int) - The name of the column in silo table, storing the send time for the - reminder. + Turns on/off the usage of the “Contact” address to send notification + back to sender whose message is stored by MSILO. - Default value is "snd_time". + Default value is “1 (0 = off, 1 = on)”. - Example 1.24. Set the "sc_snd_time" parameter + Example 1.24. Set the “use_contact” parameter ... -modparam("msilo", "sc_snd_time", "send_reminder_time") +modparam("msilo", "use_contact", 0) ... 3.25. snd_time_avp (str) @@ -561,23 +563,23 @@ modparam("msilo", "sc_snd_time", "send_reminder_time") If the parameter is not set, the module does not look for this AVP. If the value is set to a valid AVP name, then the module expects in the - AVP to be a time value in format "YYYYMMDDHHMMSS" (e.g., + AVP to be a time value in format “YYYYMMDDHHMMSS” (e.g., 20060101201500). - Default value is "null". + Default value is “null”. - Example 1.25. Set the "snd_time_avp" parameter + Example 1.25. Set the “snd_time_avp” parameter ... modparam("msilo", "snd_time_avp", "$avp(i:123)") ... 3.26. add_date (int) - Wheter to add as prefix the date when the message was stored. + Whether to add as prefix the date when the message was stored. - Default value is "1" (1==on/0==off). + Default value is “1” (1==on/0==off). - Example 1.26. Set the "add_date" parameter + Example 1.26. Set the “add_date” parameter ... modparam("msilo", "add_date", 0) ... @@ -589,7 +591,7 @@ modparam("msilo", "add_date", 0) Default value is 0. - Example 1.27. Set the "max_messages" parameter + Example 1.27. Set the “max_messages” parameter ... modparam("msilo", "max_messages", 0) ... @@ -599,9 +601,9 @@ modparam("msilo", "max_messages", 0) Wheter to add contact header to generated messages. The contact address is the From URI. - Default value is "0" (1==on; 0==off as per RFC3428). + Default value is “0” (1==on; 0==off as per RFC3428). - Example 1.28. Set the "add_contact" parameter + Example 1.28. Set the “add_contact” parameter ... modparam("msilo", "add_contact", 1) ... @@ -615,9 +617,9 @@ modparam("msilo", "add_contact", 1) If the parameter is not set, m_store() does not look for extra headers from any AVP. - Default value is "null". + Default value is “null”. - Example 1.29. Set the "extra_hdrs_avp" parameter + Example 1.29. Set the “extra_hdrs_avp” parameter ... modparam("msilo", "extra_hdrs_avp", "$avp(msilo_extra_hdrs)") ... @@ -627,9 +629,9 @@ modparam("msilo", "extra_hdrs_avp", "$avp(msilo_extra_hdrs)") Flag to mark the message for which no notification should be sent back to sender when storing in msilo. Valid value is in between 0 and 31. - Default value is "-1" (feature disabled). + Default value is “-1” (feature disabled). - Example 1.30. Set the "skip_notification_flag" parameter + Example 1.30. Set the “skip_notification_flag” parameter ... modparam("msilo", "skip_notification_flag", 18) ... @@ -648,7 +650,7 @@ m_store(...); be called when the request type is MESSAGE and the destination user is offline or his UA does not support MESSAGE requests). If the user is registered with a UA which does not support MESSAGE requests you should - not use mode="0" if you have changed the request uri with the contact + not use mode=“0” if you have changed the request uri with the contact address of user's UA. Meaning of the parameters is as follows: @@ -666,9 +668,9 @@ m_store("$tu"); 4.2. m_dump([owner]) - The method sends stored messages for the SIP user that is going to - register to his actual contact address. The method should be called - when a REGISTER request is received and the "Expire" header has a value + The method sends stored messages for the SIP user that has registerered + to the contact address in the registration. The method should be called + when a REGISTER request is received and the “Expire” header has a value greater than zero. Meaning of the parameters is as follows: @@ -722,7 +724,6 @@ m_dump("$fu"); Example 1.33. Kamailio config script - sample msilo usage ... -# $Id$ # # MSILO usage example # diff --git a/modules/msilo/doc/msilo.cfg b/modules/msilo/doc/msilo.cfg index 9dcc009de34..05329f0299d 100644 --- a/modules/msilo/doc/msilo.cfg +++ b/modules/msilo/doc/msilo.cfg @@ -1,4 +1,3 @@ -# $Id$ # # MSILO usage example # diff --git a/modules/msilo/doc/msilo_admin.xml b/modules/msilo/doc/msilo_admin.xml index dfb3829cd7a..cbae9ef7b28 100644 --- a/modules/msilo/doc/msilo_admin.xml +++ b/modules/msilo/doc/msilo_admin.xml @@ -16,9 +16,10 @@
Overview - This modules provides offline message storage for the &kamailioname;. It + This module provides offline message storage for &kamailioname;. It stores received messages for an offline user and sends them when the - user becomes online. + user comes back online. It can also send reminders and auto-expire + messages. For each message, the modules stores Request-URI @@ -31,22 +32,22 @@ from To header will be used as R-URI. - When the expiration time passed, the message is discarded from + When the expiration time is passed, the message is discarded from database. Expiration time is computed based on incoming time and one of the module's parameters. Every time when a user registers with &kamailio;, the module is looking in database for offline messages intended for that user. All of them will - be sent to contact address provided in REGISTER request. + be sent to contact address provided in REGISTER request and then be deleted. - It may happen that the &sip; user to be registered use a &sip; User Agent + It may happen that the &sip; user registering use a &sip; User Agent that has no support for MESSAGE requests. In this case the failure_route should be used to re-store the undelivered requests. - Another functionality provided by the module is to send messages at + Another functionality provided by the MSILO module is to send messages at a certain time -- the reminder functionality. Using config logic, a received message can be stored and delivered at a time specified while storing with the 'snd_time_avp'. @@ -132,13 +133,165 @@ modparam("msilo", "db_table", "silo")
+ +
+ <varname>sc_mid</varname> (string) + + The name of the column in silo table used to store the message id. + + Default value is mid. + + Set the <quote>sc_mid</quote> parameter + +... +modparam("msilo", "sc_mid", "other_mid") +... + + +
+ +
+ <varname>sc_from</varname> (string) + + The name of the column in silo table, storing the source address. + + Default value is src_addr. + + Set the <quote>sc_from</quote> parameter + +... +modparam("msilo", "sc_from", "source_address") +... + + +
+
+ <varname>sc_to</varname> (string) + + The name of the column in silo table, storing the destination address. + + Default value is dst_addr. + + Set the <quote>sc_to</quote> parameter + +... +modparam("msilo", "sc_to", "destination_address") +... + + +
+
+ <varname>sc_uri_user</varname> (string) + + The name of the column in silo table, storing the user name. + + Default value is username. + + Set the <quote>sc_uri_user</quote> parameter + +... +modparam("msilo", "sc_uri_user", "user") +... + + +
+
+ <varname>sc_uri_host</varname> (string) + + The name of the column in silo table, storing the domain. + + Default value is domain. + + Set the <quote>sc_uri_host</quote> parameter + +... +modparam("msilo", "sc_uri_host", "domain") +... + + +
+
+ <varname>sc_body</varname> (string) + + The name of the column storing the message body in silo table. + + Default value is body. + + Set the <quote>sc_body</quote> parameter + +... +modparam("msilo", "sc_body", "message_body") +... + + +
+
+ <varname>sc_ctype</varname> (string) + + The name of the column in silo table, storing content type. + + Default value is ctype. + + Set the <quote>sc_ctype</quote> parameter + +... +modparam("msilo", "sc_ctype", "content_type") +... + + +
+
+ <varname>sc_exp_time</varname> (string) + + The name of the column in silo table, storing the expire time of the message. + + Default value is exp_time. + + Set the <quote>sc_exp_time</quote> parameter + +... +modparam("msilo", "sc_exp_time", "expire_time") +... + + +
+
+ <varname>sc_inc_time</varname> (string) + + The name of the column in silo table, storing the incoming time of the message. + + Default value is inc_time. + + Set the <quote>sc_inc_time</quote> parameter + +... +modparam("msilo", "sc_inc_time", "incoming_time") +... + + +
+
+ <varname>sc_snd_time</varname> (string) + + The name of the column in silo table, storing the send time for the reminder. + + Default value is snd_time. + + Set the <quote>sc_snd_time</quote> parameter + +... +modparam("msilo", "sc_snd_time", "send_reminder_time") +... + + +
<varname>from_address</varname> (string) The &sip; address used to inform users that destination of their message is not online and the message will be delivered next time when that user goes online. If the parameter is not set, the module - will not send any notification. It can contain pseudo-variables. + will not send any notification. This parameter may contain pseudo-variables. @@ -180,7 +333,7 @@ modparam("msilo", "contact_hdr", "Contact: <sip:null@example.com>\r\n") <varname>extra_hdrs</varname> (string) Extra headers (each ending with \r\n) to be added in - messages sent from silo by m_dump. + messages sent from silo by m_dump. It can contain pseudo-variables. @@ -389,158 +542,6 @@ modparam("msilo", "use_contact", 0)
-
- <varname>sc_mid</varname> (string) - - The name of the column in silo table, storing message id. - - Default value is mid. - - Set the <quote>sc_mid</quote> parameter - -... -modparam("msilo", "sc_mid", "other_mid") -... - - -
- -
- <varname>sc_from</varname> (string) - - The name of the column in silo table, storing the source address. - - Default value is src_addr. - - Set the <quote>sc_from</quote> parameter - -... -modparam("msilo", "sc_from", "source_address") -... - - -
-
- <varname>sc_to</varname> (string) - - The name of the column in silo table, storing the destination address. - - Default value is dst_addr. - - Set the <quote>sc_to</quote> parameter - -... -modparam("msilo", "sc_to", "destination_address") -... - - -
-
- <varname>sc_uri_user</varname> (string) - - The name of the column in silo table, storing the user name. - - Default value is username. - - Set the <quote>sc_uri_user</quote> parameter - -... -modparam("msilo", "sc_uri_user", "user") -... - - -
-
- <varname>sc_uri_host</varname> (string) - - The name of the column in silo table, storing the domain. - - Default value is domain. - - Set the <quote>sc_uri_host</quote> parameter - -... -modparam("msilo", "sc_uri_host", "domain") -... - - -
-
- <varname>sc_body</varname> (string) - - The name of the column storing the message body in silo table. - - Default value is body. - - Set the <quote>sc_body</quote> parameter - -... -modparam("msilo", "sc_body", "message_body") -... - - -
-
- <varname>sc_ctype</varname> (string) - - The name of the column in silo table, storing content type. - - Default value is ctype. - - Set the <quote>sc_ctype</quote> parameter - -... -modparam("msilo", "sc_ctype", "content_type") -... - - -
-
- <varname>sc_exp_time</varname> (string) - - The name of the column in silo table, storing the expire time of the message. - - Default value is exp_time. - - Set the <quote>sc_exp_time</quote> parameter - -... -modparam("msilo", "sc_exp_time", "expire_time") -... - - -
-
- <varname>sc_inc_time</varname> (string) - - The name of the column in silo table, storing the incoming time of the message. - - Default value is inc_time. - - Set the <quote>sc_inc_time</quote> parameter - -... -modparam("msilo", "sc_inc_time", "incoming_time") -... - - -
-
- <varname>sc_snd_time</varname> (string) - - The name of the column in silo table, storing the send time for the reminder. - - Default value is snd_time. - - Set the <quote>sc_snd_time</quote> parameter - -... -modparam("msilo", "sc_snd_time", "send_reminder_time") -... - - -
-
<varname>snd_time_avp</varname> (str) @@ -570,7 +571,7 @@ modparam("msilo", "snd_time_avp", "$avp(i:123)")
<varname>add_date</varname> (int) - Wheter to add as prefix the date when the message was stored. + Whether to add as prefix the date when the message was stored. @@ -721,10 +722,10 @@ m_store("$tu");
<function moreinfo="none">m_dump([owner])</function> - The method sends stored messages for the &sip; user that is going to - register to his actual contact address. The method should be called - when a REGISTER request is received and the Expire - header has a value greater than zero. + The method sends stored messages for the &sip; user that has + registerered to the contact address in the registration. + The method should be called when a REGISTER request is received + and the Expire header has a value greater than zero. Meaning of the parameters is as follows: diff --git a/modules/msrp/README b/modules/msrp/README index e9e882b802a..6d336de8bfd 100644 --- a/modules/msrp/README +++ b/modules/msrp/README @@ -16,7 +16,7 @@ Alex Balashov - Copyright 2012 asipto.com + Copyright © 2012 asipto.com __________________________________________________________________ Table of Contents @@ -179,7 +179,7 @@ Chapter 1. Admin Guide 3.1. sipmsg (int) If set to 1, the module will build a SIP message from MSRP frame - headers, providing it to "event_route[msrp:frame-in]". All the config + headers, providing it to “event_route[msrp:frame-in]”. All the config file functions (apart from SIP request relay) that can be used in a request route block can be used in the MSRP event_route. @@ -216,7 +216,7 @@ modparam("msrp", "timer_interval", 90) 3.4. auth_min_expires (int) - The minimum value accepted for the "Expires" header in AUTH requests. + The minimum value accepted for the “Expires” header in AUTH requests. Default value is '60'. @@ -227,7 +227,7 @@ modparam("msrp", "auth_min_expiresl", 90) 3.5. auth_max_expires (int) - The maximum value accepted for "Expires" header in AUTH requests. + The maximum value accepted for “Expires” header in AUTH requests. Default value is '3600'. @@ -259,7 +259,7 @@ modparam("msrp", "use_path_addr", "msrp.kamailio.org:5061") 4.8. msrp_cmap_save() 4.9. msrp_cmap_lookup() -4.1. msrp_relay() +4.1. msrp_relay() Relay MSRP frame according to the To-Path. This function has to be executed for each MSRP request or reply that has to be forwarded. Note @@ -275,7 +275,7 @@ event_route[msrp:frame-in] { } ... -4.2. msrp_reply(code, text [, hdrs]) +4.2. msrp_reply(code, text [, hdrs]) Send a reply for the current MSRP request, adding optional headers. @@ -290,7 +290,7 @@ event_route[msrp:frame-in] { } ... -4.3. msrp_is_request() +4.3. msrp_is_request() Return true if the MSRP frame is a request. @@ -307,7 +307,7 @@ event_route[msrp:frame-in] { } ... -4.4. msrp_is_reply() +4.4. msrp_is_reply() Return true if the MSRP frame is a reply. @@ -324,7 +324,7 @@ event_route[msrp:frame-in] { } ... -4.5. msrp_set_dst(addr, sock) +4.5. msrp_set_dst(addr, sock) Set destination attributes: addr - target address as MSRP URI; sock - local socket to be used (format 'proto:ip:port'). @@ -342,7 +342,7 @@ event_route[msrp:frame-in] { } ... -4.6. msrp_relay_flags(flags) +4.6. msrp_relay_flags(flags) Set transport layer sending flags for forwarding current MSRP frame; flags - a bitmask of flags - 1 (don't create a new connection), 2 @@ -361,7 +361,7 @@ event_route[msrp:frame-in] { } ... -4.7. msrp_reply_flags(flags) +4.7. msrp_reply_flags(flags) Set transport layer sending flags for replies to the current MSRP frame; flags - a bitmask of flags - 1 (don't create a new connection), @@ -380,7 +380,7 @@ event_route[msrp:frame-in] { } ... -4.8. msrp_cmap_save() +4.8. msrp_cmap_save() Save details of a MSRP connection upon AUTH request inside the internal map table, indexed by session id. @@ -396,7 +396,7 @@ event_route[msrp:frame-in] { } ... -4.9. msrp_cmap_lookup() +4.9. msrp_cmap_lookup() Lookup MSRP connection details for current session id. @@ -432,7 +432,7 @@ event_route[msrp:frame-in] { 6.1. msrp.cmaplist -6.1. msrp.cmaplist +6.1. msrp.cmaplist List active MSRP connections. diff --git a/modules/mtree/README b/modules/mtree/README index 2f62e82ece8..4d801b8b11a 100644 --- a/modules/mtree/README +++ b/modules/mtree/README @@ -14,13 +14,15 @@ Juha Heinanen tutpro.com +Edited by + Juha Heinanen - Copyright 2010 Daniel-Constantin Mierla (asipto.com) + Copyright © 2010 Daniel-Constantin Mierla (asipto.com) - Copyright 2011 Juha Heinanen + Copyright © 2011 Juha Heinanen __________________________________________________________________ Table of Contents @@ -175,7 +177,7 @@ Chapter 1. Admin Guide URL of the database server to be used. - Default value is "mysql://kamailio:kamailiorw@localhost/kamailio". + Default value is “mysql://kamailio:kamailiorw@localhost/kamailio”. Example 1.1. Set db_url parameter ... @@ -187,7 +189,7 @@ modparam("mtree", "db_url", "dbdriver://username:password@dbhost/dbname") Name of database table where data for trees is stored. It is ignored if a 'mtree' parameter is defined. - Default value is "mtrees". + Default value is “mtrees”. Example 1.2. Set db_table parameter ... @@ -222,7 +224,7 @@ modparam("mtree", "db_table", "mymtrees") This parameter can be set many times to add more trees in memory. - Default value is "none". + Default value is “none”. Example 1.3. Set mtree parameter ... @@ -236,7 +238,7 @@ modparam("mtree", "mtree", Name of 'tname' column. - Default value is "tname". + Default value is “tname”. Example 1.4. Set tname_column parameter ... @@ -247,7 +249,7 @@ modparam("mtree", "tname_column", "name") Name of 'tprefix' column. - Default value is "tprefix". + Default value is “tprefix”. Example 1.5. Set tprefix_column parameter ... @@ -258,7 +260,7 @@ modparam("mtree", "tprefix_column", "prefix") Name of 'tvalue' column. - Default value is "tvalue". + Default value is “tvalue”. Example 1.6. Set tvalue_column parameter ... @@ -280,7 +282,7 @@ modparam("mtree", "fetch_rows", 4000) The list with characters allowed in prefix. - Default value is "0123456789". + Default value is “0123456789”. Example 1.8. Set char_list parameter ... @@ -292,7 +294,7 @@ modparam("mtree", "char_list", "0123456789*+") The PV spec where to store the matched value. It can be any writable PV. - Default value is "$avp(s:tvalue)". + Default value is “$avp(s:tvalue)”. Example 1.9. Set pv_value parameter ... @@ -304,7 +306,7 @@ modparam("mtree", "pv_value", "$var(mtval)") The AVP where to store the matched values when mtree is of type 0 or 2 and mode of mt_match() call has value 2. - Default value is "$avp(s:tvalues)". + Default value is “$avp(s:tvalues)”. Example 1.10. Set pv_values parameter ... @@ -349,7 +351,7 @@ modparam("mtree", "mt_allow_duplicates", 1) 4.1. mt_match(mtree, pv, mode) -4.1. mt_match(mtree, pv, mode) +4.1. mt_match(mtree, pv, mode) Match 'pv' value against 'mtree'. If 'mtree' type is 0 or 2 and value of 'mode' is NOT 2, sets a value of the longest matching prefix to @@ -373,7 +375,7 @@ mt_match("mytree", "$rU", "0"); 5.3. mt_summary 5.4. mt_match -5.1. mt_list +5.1. mt_list List content of a tree. @@ -387,7 +389,7 @@ mt_match("mytree", "$rU", "0"); _mtname_ _empty_line_ -5.2. mt_reload +5.2. mt_reload Reload mtree from database. @@ -402,7 +404,7 @@ mt_match("mytree", "$rU", "0"); _mtname_ _empty_line_ -5.3. mt_summary +5.3. mt_summary List usage summary for all trees. @@ -414,7 +416,7 @@ mt_match("mytree", "$rU", "0"); :mt_summary:_reply_fifo_file_ _empty_line_ -5.4. mt_match +5.4. mt_match Match prefix value against mtree. @@ -438,7 +440,7 @@ mt_match("mytree", "$rU", "0"); 6.2. mtree.reload 6.3. mtree.match -6.1. mtree.summary +6.1. mtree.summary List usage summary for all trees or for the tree whose name is given as parameter. @@ -446,7 +448,7 @@ mt_match("mytree", "$rU", "0"); Parameters: * _mtree_ - (optional) the name of the tree. -6.2. mtree.reload +6.2. mtree.reload Reload mtree from database to memory. @@ -454,7 +456,7 @@ mt_match("mytree", "$rU", "0"); * _mtree_ - name of mtree or empty string meaning all mtrees -6.3. mtree.match +6.3. mtree.match Match prefix value against mtree diff --git a/modules/nat_traversal/README b/modules/nat_traversal/README index 63a0a51ad36..9b37228d60d 100644 --- a/modules/nat_traversal/README +++ b/modules/nat_traversal/README @@ -10,7 +10,7 @@ Dan Pascu - Copyright 2008 Dan Pascu + Copyright © 2008 Dan Pascu __________________________________________________________________ Table of Contents @@ -407,7 +407,7 @@ Chapter 1. Admin Guide each endpoint will receive exactly one keepalive message. A negative value or zero will disable the keepalive functionality. - Default value is "60". + Default value is “60”. Example 1.1. Setting the keepalive_interval parameter ... @@ -420,7 +420,7 @@ modparam("nat_traversal", "keepalive_interval", 90) for this purpose are NOTIFY and OPTIONS. NOTIFY generates smaller replies from user agents, but they are almost entirely negative replies. Apparently almost none of the user agents understand that the - purpose of the NOTIFY with a "keep-alive" event is to keep NAT open, + purpose of the NOTIFY with a “keep-alive” event is to keep NAT open, even though many user agents send such NOTIFY requests themselves. However this does not affect the result at all, since the purpose is to trigger a response from the user agent behind NAT, positive or negative @@ -435,7 +435,7 @@ modparam("nat_traversal", "keepalive_interval", 90) times bigger than negative replies or replies to NOTIFY requests. For this reason the default value for the used method is NOTIFY. - Default value is "NOTIFY". + Default value is “NOTIFY”. Example 1.2. Setting the keepalive_method parameter ... @@ -450,7 +450,7 @@ modparam("nat_traversal", "keepalive_method", "OPTIONS") keepalive message, which is the same interface on which the request that triggered keepalive functionality arrived. - Default value is "sip:keepalive@proxy_ip" with proxy_ip being the + Default value is “sip:keepalive@proxy_ip” with proxy_ip being the actual IP of the outgoing interface. Example 1.3. Setting the keepalive_from parameter @@ -489,7 +489,7 @@ MyHeader: some_value\r\n") case it will store it in the Kamailio working directory, or an absolute path. - Default value is undefined "keepalive_state". + Default value is undefined “keepalive_state”. Example 1.5. Setting the keepalive_state_file parameter ... @@ -503,7 +503,7 @@ tate") 5.2. fix_contact() 5.3. nat_keepalive() -5.1. client_nat_test(type) +5.1. client_nat_test(type) Check if the client is behind NAT. What tests are performed is specified by the type parameter which is an integer given by the sum of @@ -533,7 +533,7 @@ if (client_nat_test("3")) { } ... -5.2. fix_contact() +5.2. fix_contact() Will replace the IP and port in the Contact header with the IP and port the SIP message was received from. Usually called after a succesful @@ -549,7 +549,7 @@ if (client_nat_test("3")) { } ... -5.3. nat_keepalive() +5.3. nat_keepalive() Trigger keepalive functionality for the source address of the request. When called it only sets some internal flags, which will trigger later diff --git a/modules/nat_traversal/nat_traversal.c b/modules/nat_traversal/nat_traversal.c index 0acdd1725d1..fb1dd307376 100644 --- a/modules/nat_traversal/nat_traversal.c +++ b/modules/nat_traversal/nat_traversal.c @@ -1508,6 +1508,8 @@ ClientNatTest(struct sip_msg *msg, unsigned int tests) #define FROM_PREFIX "sip:keepalive@" +#define MAX_BRANCHID 9999999 +#define MIN_BRANCHID 1000000 static void send_keepalive(NAT_Contact *contact) @@ -1536,7 +1538,7 @@ send_keepalive(NAT_Contact *contact) len = snprintf(buffer, sizeof(buffer), "%s %s SIP/2.0\r\n" - "Via: SIP/2.0/UDP %.*s:%d;branch=0\r\n" + "Via: SIP/2.0/UDP %.*s:%d;branch=z9hG4bK%ld\r\n" "From: %s;tag=%x\r\n" "To: %s\r\n" "Call-ID: %s-%x-%x@%.*s\r\n" @@ -1546,6 +1548,7 @@ send_keepalive(NAT_Contact *contact) keepalive_params.method, contact->uri, contact->socket->address_str.len, contact->socket->address_str.s, contact->socket->port_no, + (long)(rand()/(float)RAND_MAX * (MAX_BRANCHID-MIN_BRANCHID) + MIN_BRANCHID), from_uri, keepalive_params.from_tag++, contact->uri, keepalive_params.callid_prefix, keepalive_params.callid_counter++, get_ticks(), diff --git a/modules/nathelper/README b/modules/nathelper/README index b44037f6b3b..4d08229c06d 100644 --- a/modules/nathelper/README +++ b/modules/nathelper/README @@ -24,13 +24,13 @@ Edited by Ovidiu Sas - Copyright 2003-2008 Sippy Software, Inc. + Copyright © 2003-2008 Sippy Software, Inc. - Copyright 2005 Voice Sistem SRL + Copyright © 2005 Voice Sistem SRL - Copyright 2009 TuTPro Inc. + Copyright © 2009 TuTPro Inc. - Copyright 2010 VoIPEmbedded Inc. + Copyright © 2010 VoIPEmbedded Inc. __________________________________________________________________ Table of Contents @@ -177,14 +177,14 @@ Chapter 1. Admin Guide connections. In particular, it helps symmetric UAs that don't advertise they are symmetric and are not able to determine their public address. - The function fix_nated_contact() rewrites the "Contact" header field + The function fix_nated_contact() rewrites the “Contact” header field with request's source address:port pair. The function fix_nated_sdp() adds the active direction indication to SDP (flag 0x01) and updates the source IP address too (flag 0x02). The function fix_nated_register() exports exports the request's source address:port into an AVP to be - used during save() and should be used for "REGISTER" requests. + used during save() and should be used for “REGISTER” requests. - Note: fix_nated_contact changes the "Contact" header, thus it breaks + Note: fix_nated_contact changes the “Contact” header, thus it breaks the RFC. Although usually this is not an issue, it may cause problems with strict SIP clients. An alternative is to use add_contact_alias() that together with the handle_ruri_alias() is standards conforming and @@ -193,7 +193,7 @@ Chapter 1. Admin Guide 2. NAT pinging types Currently, the nathelper module supports two types of NAT pings: - * UDP package - 4 bytes (zero filled) UDP packages are sent to the + * UDP packet - 4 bytes (zero filled) UDP packets are sent to the contact address. + Advantages: low bandwitdh traffic, easy to generate by Kamailio; @@ -248,7 +248,7 @@ Chapter 1. Admin Guide Socket to be used when sending NAT pings for UDP communication. If no one specified, the OS will choose a socket. - Default value is "NULL". + Default value is “NULL”. Example 1.1. Set force_socket parameter ... @@ -275,7 +275,7 @@ modparam("nathelper", "natping_interval", 10) 4.3. ping_nated_only (integer) - If this variable is set then only contacts that have "behind_NAT" flag + If this variable is set then only contacts that have “behind_NAT” flag in user location database set will get ping. Default value is 0. @@ -320,7 +320,7 @@ modparam("nathelper", "natping_socket", "192.168.1.1:5006") Note You must set this parameter if you use fix_nated_register. In such case - you must set the parameter with same name in the "registrar" module to + you must set the parameter with same name in the “registrar” module to same value. Default value is "NULL" (disabled). @@ -334,7 +334,7 @@ modparam("nathelper", "received_avp", "$avp(i:42)") Which branch flag should be used by the module to identify NATed contacts for which it should perform NAT ping via a SIP request instead - if dummy UDP package. + of dummy UDP packet. Default value is -1 (disabled). @@ -350,7 +350,7 @@ modparam("nathelper", "sipping_bflag", 7) feature, you have to set this parameter. The SIP request pinging will be used only for requests marked so. - Default value is "NULL". + Default value is “NULL”. Example 1.8. Set sipping_from parameter ... @@ -362,7 +362,7 @@ modparam("nathelper", "sipping_from", "sip:pinger@siphub.net") The parameter sets the SIP method to be used in generating the SIP requests for NAT ping purposes. - Default value is "OPTIONS". + Default value is “OPTIONS”. Example 1.9. Set sipping_method parameter ... @@ -394,7 +394,7 @@ Note The string must be a complete SDP line, including the EOH (\r\n). - Default value is "a=nortpproxy:yes\r\n". + Default value is “a=nortpproxy:yes\r\n”. Example 1.11. Set nortpproxy_str parameter ... @@ -413,7 +413,7 @@ modparam("nathelper", "nortpproxy_str", "a=sdpmangled:yes\r\n") Keepalives are sent stateless, not using TM module. The value of this parameter has to be few times higher than natping_interval. - Default value is "0" (feature disabled). + Default value is “0” (feature disabled). Example 1.12. Set keepalive_timeout parameter ... @@ -425,7 +425,7 @@ modparam("nathelper", "keepalive_timeout", 120) Enable sending UDP pings (keepalives) using raw socket from Path address. - Default value is "0" (feature disabled). + Default value is “0” (feature disabled). Example 1.13. Set udpping_from_path parameter ... @@ -437,7 +437,7 @@ modparam("nathelper", "udpping_from_path", 1) The parameter controls if oldmediaip field should be appended to the SDP. - Default value is "1" (feature enabled). + Default value is “1” (feature enabled). Example 1.14. Set append_sdp_oldmediaip parameter ... @@ -456,9 +456,9 @@ modparam("nathelper", "append_sdp_oldmediaip", 1) 5.8. handle_ruri_alias() 5.9. set_contact_alias() -5.1. fix_nated_contact() +5.1. fix_nated_contact() - Rewrites the "Contact" header to contain the request's source + Rewrites the “Contact” header to contain the request's source address:port. This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE, @@ -469,20 +469,20 @@ modparam("nathelper", "append_sdp_oldmediaip", 1) if (search("User-Agent: Cisco ATA.*") {fix_nated_contact();}; ... -5.2. fix_nated_sdp(flags [, ip_address]) +5.2. fix_nated_sdp(flags [, ip_address]) Alters the SDP information in orer to facilitate NAT traversal. What - changes to be performed may be controled via the "flags" parameter. + changes to be performed may be controled via the “flags” parameter. Return value is -1 if error occurred, 1 if ip's were replaced, 2 if no ip's were replaced. Meaning of the parameters is as follows: * flags - the value may be a bitwise OR of the following flags: - + 0x01 - adds "a=direction:active" SDP line; + + 0x01 - adds “a=direction:active” SDP line; + 0x02 - rewrite media IP address (c=) with source address of the message or the provided IP address (the provide IP address take precedence over the source address). - + 0x04 - adds "a=nortpproxy:yes" SDP line; + + 0x04 - adds “a=nortpproxy:yes” SDP line; + 0x08 - rewrite IP from origin description (o=) with source address of the message or the provided IP address (the provide IP address take precedence over the source address). @@ -499,9 +499,9 @@ if (search("User-Agent: Cisco ATA.*") {fix_nated_contact();}; if (search("User-Agent: Cisco ATA.*") {fix_nated_sdp("3");}; ... -5.3. add_rcv_param([flag]), +5.3. add_rcv_param([flag]), - Add a received parameter to the "Contact" header fields or the Contact + Add a received parameter to the “Contact” header fields or the Contact URI. The parameter will contain the URI created from the source IP, port, and protocol of the packet containing the SIP message. The parameter can be then processed by another registrar. This is useful, @@ -523,14 +523,14 @@ add_rcv_param(); # add the parameter to the Contact header add_rcv_param("1"); # add the parameter to the Contact URI ... -5.4. fix_nated_register() +5.4. fix_nated_register() The function creates a URI consisting of the source IP, port, and protocol and stores the URI in an Attribute-Value-Pair. The URI will be appended as "received" parameter to Contact in 200 OK and registrar will store it in the received cloumn in the location table. - Note: You have to set the "received_avp" parameter of the nathelper + Note: You have to set the “received_avp” parameter of the nathelper module and the registrar module (both module parameters must have the same value) to use this function. @@ -541,26 +541,26 @@ add_rcv_param("1"); # add the parameter to the Contact URI fix_nated_register(); ... -5.5. nat_uac_test(flags) +5.5. nat_uac_test(flags) Tries to guess if client's request originated behind a nat. The parameter determines what heuristics is used. Meaning of the flags is as follows: - * 1 - The "Contact" header field is searched for occurrence of + * 1 - The “Contact” header field is searched for occurrence of RFC1918 or RFC6598 addresses. - * 2 - the "received" test is used: address in the "Via" header is + * 2 - the "received" test is used: address in the “Via” header is compared against source IP address of signaling - * 4 - The Top Most "Via" is searched for occurrence of RFC1918 or + * 4 - The Top Most “Via” is searched for occurrence of RFC1918 or RFC6598 addresses * 8 - The SDP is searched for occurrence of RFC1918 or RFC6598 addresses * 16 - Test if the source port is different from the port in the - "Via" header + “Via” header * 32 - Test if the source IP address of signaling is a RFC1918 or RFC6598 address * 64 - Test if the source connection of signaling is a WebSocket - * 128 - Test if the "Contact" header URI port differs from the source + * 128 - Test if the “Contact” header URI port differs from the source port of the request (Warning: this is might be legal or even intended combination in non NATted scenarios) @@ -577,7 +577,7 @@ if(nat_uac_test("19")) { } ... -5.6. is_rfc1918(ip_address) +5.6. is_rfc1918(ip_address) Determines if the address in the parameter is an rfc1918 or rfc6598 address. The parameter allows pseudo-variables usage. @@ -591,11 +591,11 @@ if(is_rfc1918("$rd")) { } ... -5.7. add_contact_alias([ip_addr, port, proto]) +5.7. add_contact_alias([ip_addr, port, proto]) - Adds an ";alias=ip~port~transport" parameter to the contact URI + Adds an “;alias=ip~port~transport” parameter to the contact URI containing either received ip, port, and transport protocol or those - given as parameters. If called without parameters, ";alias" parameter + given as parameters. If called without parameters, “;alias” parameter is only added if received ip and port differ from those in contact URI. This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE, @@ -612,17 +612,17 @@ if(is_rfc1918("$rd")) { }; ... -5.8. handle_ruri_alias() +5.8. handle_ruri_alias() - Checks if the Request URI has an "alias" parameter and if so, removes - it and sets the "$du" based on its value. Note that this means that - routing of request is based on ";alias" parameter value of the Request + Checks if the Request URI has an “alias” parameter and if so, removes + it and sets the “$du” based on its value. Note that this means that + routing of request is based on “;alias” parameter value of the Request URI rather than the Request URI itself. If you call handle_ruri_alias() on a request, make sure that you screen the alias parameter value of Request URI the same way as you would screen the Request URI itself. - Returns 1 if ";alias" parameter was found and "$du" was set and the - "$ru" rewritten, 2 if the alias parameter was not found and nothing was + Returns 1 if “;alias” parameter was found and “$du” was set and the + “$ru” rewritten, 2 if the alias parameter was not found and nothing was done, or -1 in case of error. This function can be used from REQUEST_ROUTE, BRANCH_ROUTE, and @@ -647,9 +647,9 @@ if(is_rfc1918("$rd")) { }; ... -5.9. set_contact_alias() +5.9. set_contact_alias() - Adds an ";alias=ip~port~transport" parameter to the contact URI + Adds an “;alias=ip~port~transport” parameter to the contact URI containing the received ip, port, and transport protocol. The new contact URI is immediately visible to other modules in the way the fix_nated_contact() does it. @@ -730,45 +730,45 @@ $c2 = @nathelper.rewrite_contact[1].nameaddr.uri; Chapter 2. Frequently Asked Questions - 2.1. What happend with "rtpproxy_disable" parameter? + 2.1. What happend with “rtpproxy_disable” parameter? 2.2. Where can I find more about Kamailio? 2.3. Where can I post a question about this module? 2.4. How can I report a bug? 2.1. - What happend with "rtpproxy_disable" parameter? + What happend with “rtpproxy_disable” parameter? - It was removed as it became obsolete - now "rtpproxy_sock" can take - empty value to disable the rtpproxy functionality. + It was removed as it became obsolete - now “rtpproxy_sock” can take + empty value to disable the rtpproxy functionality. 2.2. - Where can I find more about Kamailio? + Where can I find more about Kamailio? - Take a look at http://www.kamailio.org/. + Take a look at http://www.kamailio.org/. 2.3. - Where can I post a question about this module? + Where can I post a question about this module? - First at all check if your question was already answered on one of our - mailing lists: - * User Mailing List - - http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users - * Developer Mailing List - - http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev + First at all check if your question was already answered on one of our + mailing lists: + * User Mailing List - + http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users + * Developer Mailing List - + http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev - E-mails regarding any stable Kamailio release should be sent to - and e-mails regarding development - versions should be sent to . + E-mails regarding any stable Kamailio release should be sent to + and e-mails regarding development + versions should be sent to . - If you want to keep the mail private, send it to - . + If you want to keep the mail private, send it to + . 2.4. - How can I report a bug? + How can I report a bug? - Please follow the guidelines provided at: - http://sip-router.org/tracker. + Please follow the guidelines provided at: + https://github.com/kamailio/kamailio/issues. diff --git a/modules/nathelper/doc/nathelper_admin.xml b/modules/nathelper/doc/nathelper_admin.xml index 176e17fb032..f6ef435bfaf 100644 --- a/modules/nathelper/doc/nathelper_admin.xml +++ b/modules/nathelper/doc/nathelper_admin.xml @@ -49,8 +49,8 @@ - UDP package - 4 bytes (zero filled) UDP - packages are sent to the contact address. + UDP packet - 4 bytes (zero filled) UDP + packets are sent to the contact address. @@ -265,7 +265,7 @@ modparam("nathelper", "received_avp", "$avp(i:42)") Which branch flag should be used by the module to identify NATed contacts for which it should perform NAT ping via a SIP request - instead if dummy UDP package. + instead of dummy UDP packet. diff --git a/modules/nathelper/sip_pinger.h b/modules/nathelper/sip_pinger.h index 7cd5e0cedd0..5166a750b34 100644 --- a/modules/nathelper/sip_pinger.h +++ b/modules/nathelper/sip_pinger.h @@ -116,6 +116,9 @@ static inline char* build_sipping(str *curi, struct socket_info* s, str *path, str *ruid, unsigned int aorhash, int *len_p) { #define s_len(_s) (sizeof(_s)-1) +#define MAX_BRANCHID 9999999 +#define MIN_BRANCHID 1000000 +#define LEN_BRANCHID 7 /* NOTE: this must be sync with the MX and MIN values !! */ static char buf[MAX_SIPPING_SIZE]; char *p; int len; @@ -135,7 +138,7 @@ static inline char* build_sipping(str *curi, struct socket_info* s, str *path, if ( sipping_method.len + 1 + curi->len + s_len(" SIP/2.0"CRLF) + s_len("Via: SIP/2.0/UDP ") + vaddr.len + ((s->address.af==AF_INET6)?2:0) + - 1 + vport.len + s_len(";branch=0") + + 1 + vport.len + s_len(";branch=z9hG4bK") + LEN_BRANCHID + (path->len ? (s_len(CRLF"Route: ") + path->len) : 0) + s_len(CRLF"From: ") + sipping_from.len + s_len(";tag=") + ruid->len + 1 + 8 + 1 + 8 + @@ -164,13 +167,16 @@ static inline char* build_sipping(str *curi, struct socket_info* s, str *path, } *(p++) = ':'; append_str( p, vport.s, vport.len); + append_fix( p, ";branch=z9hG4bK"); + int2bstr( + (long)(rand()/(float)RAND_MAX * (MAX_BRANCHID-MIN_BRANCHID) + MIN_BRANCHID), + p+LEN_BRANCHID-INT2STR_MAX_LEN+1, NULL); + p += LEN_BRANCHID; if (path->len) { - append_fix( p, ";branch=0"CRLF"Route: "); + append_fix( p, CRLF"Route: "); append_str( p, path->s, path->len); - append_fix( p, CRLF"From: "); - } else { - append_fix( p, ";branch=0"CRLF"From: "); } + append_fix( p, CRLF"From: "); append_str( p, sipping_from.s, sipping_from.len); append_fix( p, ";tag="); append_str( p, ruid->s, ruid->len); diff --git a/modules/ndb_cassandra/README b/modules/ndb_cassandra/README index 63779d762ec..3cc451cede4 100644 --- a/modules/ndb_cassandra/README +++ b/modules/ndb_cassandra/README @@ -10,7 +10,7 @@ Luis Martin Gil - Copyright 2013 www.indigital.net + Copyright © 2013 www.indigital.net __________________________________________________________________ Table of Contents @@ -108,7 +108,7 @@ modparam("ndb_cassandra", "port", 9160) 4.1. cass_insert(keyspace, column_family, key, column, value) 4.2. cass_retrieve(keyspace, column_family, key, column, value) -4.1. cass_insert(keyspace, column_family, key, column, value) +4.1. cass_insert(keyspace, column_family, key, column, value) Inserts the value for the given key, column, column_family and keyspace. There must be an existing keyspace called 'keyspace' with a @@ -118,7 +118,7 @@ modparam("ndb_cassandra", "port", 9160) * ret < 0, error * ret > 0, success -4.2. cass_retrieve(keyspace, column_family, key, column, value) +4.2. cass_retrieve(keyspace, column_family, key, column, value) Retrieves the value for the given key, column, column_family and keyspace. There must be an existing keyspace called 'keyspace' with a diff --git a/modules/ndb_mongodb/README b/modules/ndb_mongodb/README index 01b1ce5de3f..cac80810a45 100644 --- a/modules/ndb_mongodb/README +++ b/modules/ndb_mongodb/README @@ -98,6 +98,14 @@ Chapter 1. Admin Guide running Kamailio with this module loaded: * mongo-c-driver - available at https://github.com/mongodb/mongo-c-driver + Note: if you use tls module, use at least mongo-c-driver v1.3.5 and + compile the library by configuring it without automatic init and + cleanup (you have to run: './configure + --disable-automatic-init-and-cleanup') -- this option is planned to + be removed in future versions. An alternative for v1.3.5 could be + the patch from: + https://github.com/miconda/mongo-c-driver/commit/51d95009de39eaeca4 + 8491682a5ffec4f83cde55 3. Parameters diff --git a/modules/ndb_mongodb/doc/ndb_mongodb_admin.xml b/modules/ndb_mongodb/doc/ndb_mongodb_admin.xml index ec43474642f..bdfaf76ff39 100644 --- a/modules/ndb_mongodb/doc/ndb_mongodb_admin.xml +++ b/modules/ndb_mongodb/doc/ndb_mongodb_admin.xml @@ -52,6 +52,15 @@ mongo-c-driver - available at https://github.com/mongodb/mongo-c-driver + + Note: if you use tls module, use at least mongo-c-driver v1.3.5 + and compile the library by configuring it without automatic init + and cleanup (you have to run: + './configure --disable-automatic-init-and-cleanup') -- this + option is planned to be removed in future versions. An alternative + for v1.3.5 could be the patch from: + https://github.com/miconda/mongo-c-driver/commit/51d95009de39eaeca48491682a5ffec4f83cde55 + diff --git a/modules/ndb_redis/Makefile b/modules/ndb_redis/Makefile index 6e2d86ba8f2..5874c317ce2 100644 --- a/modules/ndb_redis/Makefile +++ b/modules/ndb_redis/Makefile @@ -5,8 +5,29 @@ include ../../Makefile.defs auto_gen= NAME=ndb_redis.so -DEFS += -I/usr/local/include -LIBS = -lhiredis +ifeq ($(CROSS_COMPILE),) +HIREDIS_BUILDER = $(shell \ + if pkg-config --exists hiredis; then \ + echo 'pkg-config hiredis'; \ + fi) +endif + +ifeq ($(HIREDIS_BUILDER),) + HIREDISDEFS=-I$(LOCALBASE)/include + HIREDISLIBS=-L$(LOCALBASE)/lib -lhiredis +else + HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags) + HIREDISLIBS = $(shell $(HIREDIS_BUILDER) --libs) + +ifeq ($(HIREDISLIBS),-L -lhiredis) + HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags) /opt/local/include + HIREDISLIBS = -L/opt/local/lib -lhiredis +endif + +endif + +DEFS+=$(HIREDISDEFS) +LIBS=$(HIREDISLIBS) DEFS+=-DKAMAILIO_MOD_INTERFACE diff --git a/modules/ndb_redis/README b/modules/ndb_redis/README index 96a336364f0..846c9ba1671 100644 --- a/modules/ndb_redis/README +++ b/modules/ndb_redis/README @@ -117,8 +117,8 @@ Chapter 1. Admin Guide Example 1.1. Set server parameter ... modparam("ndb_redis", "server", "name=srvN;addr=127.0.0.1;port=6379;db=1") -modparam("ndb_redis", "server", "name=srvX;addr=127.0.0.2;port=6379;db=4;pass=m -ypassword") +modparam("ndb_redis", "server", "name=srvX;addr=127.0.0.2;port=6379;db=4;pass=my +password") # Unix domain socket modparam("ndb_redis", "server", "name=srvY;unix=/tmp/redis.sock;db=3") diff --git a/modules/ndb_redis/redis_client.c b/modules/ndb_redis/redis_client.c index 02aa7b866be..1b9c8197f05 100644 --- a/modules/ndb_redis/redis_client.c +++ b/modules/ndb_redis/redis_client.c @@ -348,7 +348,6 @@ int redisc_exec(str *srv, str *res, str *cmd, ...) va_start(ap, cmd); va_copy(ap2, ap); - rsrv = redisc_get_server(srv); if(srv==NULL || cmd==NULL || res==NULL) { LM_ERR("invalid parameters"); @@ -359,6 +358,7 @@ int redisc_exec(str *srv, str *res, str *cmd, ...) LM_ERR("invalid parameters"); goto error_exec; } + rsrv = redisc_get_server(srv); if(rsrv==NULL) { LM_ERR("no redis server found: %.*s\n", srv->len, srv->s); @@ -429,7 +429,8 @@ void * redisc_exec_argv(redisc_server_t *rsrv, int argc, const char **argv, cons if(rsrv==NULL || rsrv->ctxRedis==NULL) { LM_ERR("no redis context found for server %.*s\n", - rsrv->sname->len, rsrv->sname->s); + (rsrv)?rsrv->sname->len:0, + (rsrv)?rsrv->sname->s:""); return NULL; } if(argc<=0) diff --git a/modules/nosip/README b/modules/nosip/README index 864cd3a981c..bf7e0ef7783 100644 --- a/modules/nosip/README +++ b/modules/nosip/README @@ -10,7 +10,7 @@ Daniel-Constantin Mierla - Copyright 2014 asipto.com + Copyright © 2014 asipto.com __________________________________________________________________ Table of Contents @@ -126,7 +126,7 @@ modparam("nosip", "msg_skip", "^GET ") 4.1. event_route[nosip:msg] -4.1. event_route[nosip:msg] +4.1. event_route[nosip:msg] Event route block to be executed when a non-sip message is received by a SIP worker process. diff --git a/modules/outbound/Makefile b/modules/outbound/Makefile index df433601150..4f6f0f38444 100644 --- a/modules/outbound/Makefile +++ b/modules/outbound/Makefile @@ -1,4 +1,4 @@ -# +# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs @@ -6,15 +6,32 @@ auto_gen= NAME=outbound.so ifeq ($(CROSS_COMPILE),) + BUILDER = $(shell which pkg-config) +endif + +ifneq ($(BUILDER),) SSL_BUILDER=$(shell \ if pkg-config --exists libssl; then \ echo 'pkg-config libssl'; \ fi) + +CRYPTO_BUILDER=$(shell \ + if pkg-config --exists libcrypto; then \ + echo 'pkg-config libcrypto'; \ + fi) endif +ifneq ($(BUILDER),) + ifneq ($(SSL_BUILDER),) DEFS += $(shell $(SSL_BUILDER) --cflags) LIBS += $(shell $(SSL_BUILDER) --libs) +endif +ifneq ($(CRYPTO_BUILDER),) + DEFS += $(shell $(CRYPTO_BUILDER) --cflags) + LIBS += $(shell $(CRYPTO_BUILDER) --libs) +endif + else DEFS += -I$(LOCALBASE)/ssl/include LIBS += -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib \ diff --git a/modules/p_usrloc/README b/modules/p_usrloc/README index e64cad7e48f..13970df449c 100644 --- a/modules/p_usrloc/README +++ b/modules/p_usrloc/README @@ -10,7 +10,7 @@ Patric Marschall 1&1 Internet AG - Copyright 2007 1&1 Internet AG + Copyright © 2007 1&1 Internet AG __________________________________________________________________ Table of Contents @@ -281,7 +281,7 @@ Warning The url to the master database where errors are written to. - Default value is "mysql://kamailio:kamailiorw@localhost/kamailio" + Default value is “mysql://kamailio:kamailiorw@localhost/kamailio” Example 1.1. Set write_db_url parameter ... @@ -307,7 +307,7 @@ modparam("p_usrloc", "read_db_url", "mysql://user:passwd@localhost/db") Specifies the table where the information about the distributed databases is stored. - Default value is "locdb". + Default value is “locdb”. Example 1.3. Set reg_db_table parameter ... @@ -318,7 +318,7 @@ modparam("p_usrloc", "reg_db_table", "locdb") Specifies the column where the id of a distributed database is stored. - Default value is "id". + Default value is “id”. Example 1.4. Set id_column parameter ... @@ -332,7 +332,7 @@ modparam("p_usrloc", "id_column", "id") least two databases available, the databases above the second are ignored. - Default value is "no". + Default value is “no”. Example 1.5. Set num_column parameter ... @@ -344,7 +344,7 @@ modparam("p_usrloc", "num_column", "nr") Specifies the column where the url of the distributed database is stored. - Default value is "url". + Default value is “url”. Example 1.6. Set url_column parameter ... @@ -356,7 +356,7 @@ modparam("p_usrloc", "url_column", "url") Specifies the column where the status of the distributed database is stored. - Default value is "status". + Default value is “status”. Example 1.7. Set status_column parameter ... @@ -369,7 +369,7 @@ modparam("p_usrloc", "status_column", "status") is stored. This field is set to the current time when a databases is turned off or turned on. - Default value is "failover". + Default value is “failover”. Example 1.8. Set failover_time_column parameter ... @@ -384,7 +384,7 @@ modparam("p_usrloc", "failover_time_column", "fail") stored in two databases and it takes the spare the complete expire time to be up to date, it is not very useful. - Default value is "spare". + Default value is “spare”. Example 1.9. Set spare_flag_column parameter ... @@ -397,7 +397,7 @@ modparam("p_usrloc", "spare_flag_column", "spare") stored. Each call to db_handle_error increases the error counter. After exceeding the error threshold, the database's status is set to off. - Default value is "errors". + Default value is “errors”. Example 1.10. Set error_column parameter ... @@ -411,7 +411,7 @@ modparam("p_usrloc", "error_column", "error") is only useful when using spares and prevents the module from taking a spare which shares the same risk as the broken database. - Default value is "rg". + Default value is “rg”. Example 1.11. Set risk_group_column parameter ... @@ -425,7 +425,7 @@ modparam("p_usrloc", "risk_group_column", "rg") equal or greater than the contact expiration time of the registrar module. - Default value is "3600". + Default value is “3600”. Example 1.12. Set expire_time parameter ... @@ -436,7 +436,7 @@ modparam("p_usrloc", "expire_time", "3600") Specifies the error value on which a database shall be turned of. - Default value is "50". + Default value is “50”. Example 1.13. Set db_err_threshold parameter ... @@ -450,7 +450,7 @@ modparam("p_usrloc", "db_err_threshold", "50") * 2 - Try to find a spare, if none found, just turn off the broken database - Default value is "1". + Default value is “1”. Example 1.14. Set failover_level parameter ... @@ -465,7 +465,7 @@ modparam("p_usrloc", "failover_level", "1") to provide a writeable master database, otherwise this check stays disabled. - Default value is "10". + Default value is “10”. Example 1.15. Set db_retry_interval parameter ... @@ -478,7 +478,7 @@ modparam("p_usrloc", "db_retry_interval", "10") data consistency. Keep in mind that this will probably decrease performance. - Default value is "0". + Default value is “0”. Example 1.16. Set db_use_transactions parameter ... @@ -492,7 +492,7 @@ modparam("p_usrloc", "db_use_transactions", "0") activate transaction the db_use_transactions parameter must be also set. - Default value is "READ UNCOMMITED". + Default value is “READ UNCOMMITED”. Example 1.17. Set db_transaction_level parameter ... @@ -504,7 +504,7 @@ modparam("p_usrloc", "db_transaction_level", "READ UNCOMMITED") Sets the write access to the master database. If set to 0, no write operations are permitted on the master database. - Default value is "0". + Default value is “0”. Example 1.18. Set write_on_master_db parameter ... @@ -516,7 +516,7 @@ modparam("p_usrloc", "write_on_master_db", "0") Sets the write access to the distributed databases. If set to 0, no write operations are permitted on the databases. - Default value is "0". + Default value is “0”. Example 1.19. Set write_on_db parameter ... @@ -528,7 +528,7 @@ modparam("p_usrloc", "write_on_db", "0") Specifies the period (in seconds) after a database connection expires. Usage of a too small value will probably decrease the performance. - Default value is "300". + Default value is “300”. Example 1.20. Set connection_expires parameter ... @@ -541,7 +541,7 @@ modparam("p_usrloc", "connection_expires", "300") the moment the only way is to use the CRC32 algorithm to compute the location ID. Any integer value is fine. - Default value is "0". + Default value is “0”. Example 1.21. Set alg_location parameter ... @@ -554,7 +554,7 @@ modparam("p_usrloc", "alg_location", 1) single. For example, if you have a location table that is large and needs to be partitioned, and a smaller table cfa that is ok to be on only the master db(so there is no need to have it distributed), you can - set this parameter to "location=cluster,cfa=single". This means that a + set this parameter to “location=cluster,cfa=single”. This means that a call to lookup(location) @@ -564,7 +564,7 @@ lookup(cfa) will be done on only the master database (as with usrloc module) - Default value is "location=cluster,cfa=single". + Default value is “location=cluster,cfa=single”. Example 1.22. Set domain_db parameter ... @@ -577,7 +577,7 @@ modparam("p_usrloc", "domain_db", "location=cluster,cfa=single") definition, the type is configured by using this parameter. Accepted values are single and cluster. - Default value is "single". + Default value is “single”. Example 1.23. Set default_db_type parameter ... @@ -590,7 +590,7 @@ modparam("p_usrloc", "default_db_type", "cluster") value. If it is set to 0, the old style using aor, contact and call-id is done. - Default value is "1". + Default value is “1”. Example 1.24. Set db_ops_ruid parameter ... @@ -603,7 +603,7 @@ modparam("p_usrloc", "db_ops_ruid", 0) UPDATE DB operations. It is recommended to set this parameter if you use Cassandra as a DB backend. - Default value is "0". + Default value is “0”. Example 1.25. Set db_update_as_insert parameter ... @@ -615,7 +615,7 @@ modparam("usrloc", "db_update_as_insert", 1) The URL of the default database for Location domains (for domains that are single). This must be configured if they are use. - Default value is "DEFAULT_DB_URL". + Default value is “DEFAULT_DB_URL”. Example 1.26. Set default_db_type parameter ... @@ -702,16 +702,16 @@ modparam("p_usrloc", "db_mode", 2) The module supports the decativation of redundant databases for maintenance reasons. This can be done by setting the status column of - the respective database in the p_usrloc to the value "2". This setting + the respective database in the p_usrloc to the value “2”. This setting is autodetected from all modules on the server cluster. Changes in the locdb table are periodically polled with help of a timer process. After one minute the all read and write traffic is removed from the deactivated database, and maintenance can be done. In order to activate the database again, after the maintenance has been - finished, the respective status column needs to be set to "0". This is + finished, the respective status column needs to be set to “0”. This is autodetected as well, the first module that noticed the change will set - the status column to "1" and setting the failover column to the current + the status column to “1” and setting the failover column to the current time and date. Write requests are now transfered again to the database, but no reads are done yet. @@ -757,14 +757,14 @@ Chapter 2. Developer's Guide These are the primary functions that are used to perform the SQL queries. -1. load_ul_db_api(ul_db_api_t * api) +1. load_ul_db_api(ul_db_api_t * api) Import the dbd API, setup the master database connection. Meaning of the parameters is as follows: * api - Pointer to distributed database API structure -2. int (* ul_db_insert_t) (str * table, str * first, str * second, db_key_t* +2. int (* ul_db_insert_t) (str * table, str * first, str * second, db_key_t* _k, db_val_t* _v, int _n) Lookup the first and if needed the second key, and insert the given @@ -778,7 +778,7 @@ _k, db_val_t* _v, int _n) * _v - Pointer to the inserted db values. * _n - Number of key-value pairs in _k and _v parameters. -3. int (* ul_db_update_t) (str * table, str * first, str * second, db_key_t* +3. int (* ul_db_update_t) (str * table, str * first, str * second, db_key_t* _k, db_op_t * _op, db_val_t* _v, db_key_t* _uk, db_val_t* _uv, int _n, int _un); @@ -797,7 +797,7 @@ _un); * _n - Number of key-value pairs in _k and _v parameters. * _un - Number of key-value pairs in _uk and _uv parameters. -4. int (* ul_db_insert_update_t) (str * table, str * first, str * second, +4. int (* ul_db_insert_update_t) (str * table, str * first, str * second, db_key_t* _k, db_val_t* _v, int _n) Lookup the first and if needed the second key, and insert on duplicate @@ -812,8 +812,8 @@ db_key_t* _k, db_val_t* _v, int _n) * _v - Pointer to the inserted or updated db values. * _n - Number of key-value pairs in _k and _v parameters. -5. int (* ul_db_replace_t) (str * table, str * first, str * second, db_key_t* -_k, db_val_t* _v, int _n) +5. int (* ul_db_replace_t) (str * table, str * first, str * second, +db_key_t* _k, db_val_t* _v, int _n) Lookup the first and if needed the second key, and replace the given values in the choosen databases. @@ -826,7 +826,7 @@ _k, db_val_t* _v, int _n) * _v - Pointer to the replaced db values. * _n - Number of key-value pairs in _k and _v parameters. -6. int (* ul_db_delete_t) (str * table, str * first, str * second, db_key_t* +6. int (* ul_db_delete_t) (str * table, str * first, str * second, db_key_t* _k, db_op_t* _o, db_val_t* _v, int _n) Lookup the first and if needed the second key, and delete the given @@ -841,7 +841,7 @@ _k, db_op_t* _o, db_val_t* _v, int _n) * _v - Pointer to the deleted db values. * _n - Number of key-value pairs in _k and _v parameters. -7. int (* ul_db_query_t) (str * table, str * first, str * second, db_con_t +7. int (* ul_db_query_t) (str * table, str * first, str * second, db_con_t *** _r_h, db_key_t* _k, db_op_t* _op, db_val_t* _v, db_key_t* _c, int _n, int _nc, db_key_t _o, db_res_t** _r); @@ -865,7 +865,7 @@ _nc, db_key_t _o, db_res_t** _r); * _o - Order by options for the query. * _nc - Pointer to the result set. -8. int (* ul_db_free_result_t)(db_con_t ** dbh, db_res_t * res); +8. int (* ul_db_free_result_t)(db_con_t ** dbh, db_res_t * res); Frees the given result set, . diff --git a/modules/p_usrloc/dlist.c b/modules/p_usrloc/dlist.c index 5c16508f6a1..75914f50d1a 100644 --- a/modules/p_usrloc/dlist.c +++ b/modules/p_usrloc/dlist.c @@ -52,7 +52,7 @@ static inline struct domain_list_item * find_dlist (str *name) { for (item = domain_list; item != NULL; item = item->next) { if (item->name.len == name->len - && memcmp (item->name.s, name->s, name->len) == 0) { + && memcmp (item->name.s, name->s, name->len) == 0) { return item; } } @@ -64,16 +64,17 @@ static inline struct domain_list_item * find_dlist (str *name) { static inline struct domain_list_item * add_to_dlist (str *name, int type) { struct domain_list_item *item; - int i; + int i; item = (struct domain_list_item *) - pkg_malloc (sizeof (struct domain_list_item)); + pkg_malloc (sizeof (struct domain_list_item)); if (item == NULL) { - LM_ERR("Out of shared memory.\n"); + LM_ERR("Out of pkg memory.\n"); return NULL; } item->name.s = (char *) pkg_malloc (name->len + 1); if (item->name.s == NULL) { - LM_ERR("Out of shared memory.\n"); + LM_ERR("Out of pkg memory (1).\n"); + pkg_free(item); return NULL; } memcpy (item->name.s, name->s, name->len); @@ -86,7 +87,9 @@ static inline struct domain_list_item * add_to_dlist (str *name, int type) { item->domain.table = (hslot_t*)pkg_malloc(sizeof(hslot_t) * ul_hash_size); if (!item->domain.table) { - LM_ERR("no memory left 2\n"); + LM_ERR("Out of pkg memory (2)\n"); + pkg_free(item->name.s); + pkg_free(item); return NULL; } diff --git a/modules/path/README b/modules/path/README index 944a5fe9718..7f52dbb2d58 100644 --- a/modules/path/README +++ b/modules/path/README @@ -174,7 +174,7 @@ modparam("path", "use_received", 1) If the “outbound” module was loaded before this module, and outbound is required for this request, the header will be in the form “Path: - ”, where “flowtoken” is the RFC 5636 + ”, where “flowtoken” is the RFC 5626 flow-token that can be used to identify the source and local address and transport the request was received on, and where “1.2.3.4” is the address of the outgoing interface. diff --git a/modules/path/doc/path_admin.xml b/modules/path/doc/path_admin.xml index 2a7ade6fc3e..218915a3034 100644 --- a/modules/path/doc/path_admin.xml +++ b/modules/path/doc/path_admin.xml @@ -98,7 +98,7 @@
External Libraries or Applications - The following libraries or applications must be installed before + The following libraries or applications must be installed before running &kamailio; with this module loaded: @@ -113,7 +113,7 @@
Parameters -
+
<varname>use_received</varname> (int) If set to 1, the received parameter of the first Route &uri; is evaluated and @@ -137,12 +137,12 @@ modparam("path", "use_received", 1)
Functions -
+
<function moreinfo="none">add_path()</function> - This function is used to insert a Path header in the form + This function is used to insert a Path header in the form Path: <sip:1.2.3.4;lr>, where 1.2.3.4 is the address of the outgoing interface. @@ -170,12 +170,12 @@ if (!add_path()) {
-
+
<function moreinfo="none">add_path(user)</function> - This function adds a Path header in the form + This function adds a Path header in the form Path: <sip:user@1.2.3.4;lr>. Meaning of the parameters is as follows: @@ -203,12 +203,12 @@ if (!add_path("loadbalancer")) {
-
+
<function moreinfo="none">add_path(user, parameters)</function> - This function adds a Path header in the form + This function adds a Path header in the form Path: <sip:user@1.2.3.4;lr> and appends the given parameters as additional URI parameters. @@ -245,13 +245,13 @@ if (!add_path("loadbalancer", "ob")) {
-
+
<function moreinfo="none">add_path_received()</function> - This function adds a Path header in the form - Path: <sip:1.2.3.4;received=sip:2.3.4.5:1234;lr>, setting its own + This function adds a Path header in the form + Path: <sip:1.2.3.4;received=sip:2.3.4.5:1234;lr>, setting its own outgoing address as domain-part, and the address the request has been received from as received-parameter. @@ -271,14 +271,14 @@ if (!add_path_received()) {
-
+
<function moreinfo="none">add_path_received(user)</function> - This function adds a Path header in the form + This function adds a Path header in the form Path: <sip:user@1.2.3.4;received=sip:2.3.4.5:1234;lr>, setting - 'user' as username part of address, its own + 'user' as username part of address, its own outgoing address as domain-part, and the address the request has been received from as received-parameter. @@ -298,14 +298,14 @@ if (!add_path_received("inbound")) {
-
+
<function moreinfo="none">add_path_received(user, parameters)</function> - This function adds a Path header in the form + This function adds a Path header in the form Path: <sip:user@1.2.3.4;received=sip:2.3.4.5:1234;lr>, setting - 'user' as username part of address, its own + 'user' as username part of address, its own outgoing address as domain-part, and the address the request has been received from as received-parameter. diff --git a/modules/pdb/README b/modules/pdb/README index c49d968c01c..081655ea66e 100644 --- a/modules/pdb/README +++ b/modules/pdb/README @@ -14,7 +14,7 @@ Pawel Kuzak 1&1 Internet AG - Copyright 2009 1&1 Internet AG + Copyright © 2009 1&1 Internet AG __________________________________________________________________ Table of Contents @@ -120,7 +120,7 @@ Chapter 1. Admin Guide This is the timeout in milliseconds for the pdb_query function. - Default value is "50". + Default value is “50”. Example 1.1. Set timeout parameter ... @@ -142,7 +142,7 @@ modparam("pdb", "server", "localhost:10001,host.name:10001,192.168.1.7:10002") 4.1. pdb_query (string query, string dstavp) -4.1. pdb_query (string query, string dstavp) +4.1. pdb_query (string query, string dstavp) Sends the query string to all configured servers and stores the answer in dstavp. If it takes more than the configured timeout, false is @@ -166,7 +166,7 @@ cr_route("$avp(i:82)", "$rd", "$rU", "$rU", "call_id"); 5.2. pdb_activate 5.3. pdb_deactivate -5.1. pdb_status +5.1. pdb_status Prints the status of the module. This can either be "active" or "deactivated". @@ -176,7 +176,7 @@ cr_route("$avp(i:82)", "$rd", "$rU", "$rU", "call_id"); kamctl fifo pdb_status ... -5.2. pdb_activate +5.2. pdb_activate Activates the module. This is the default after loading the module. @@ -185,7 +185,7 @@ kamctl fifo pdb_status kamctl fifo pdb_activate ... -5.3. pdb_deactivate +5.3. pdb_deactivate Deactivates the module. No more queries are performed until it is activated again. As long as the module is deactivated, the pdb_query diff --git a/modules/pdt/README b/modules/pdt/README index 9773bfaa08a..192e44d52b8 100644 --- a/modules/pdt/README +++ b/modules/pdt/README @@ -11,11 +11,11 @@ Elena-Ramona Modroiu - Copyright 2003 FhG FOKUS + Copyright © 2003 FhG FOKUS - Copyright 2004 Voice Sistem SRL + Copyright © 2004 Voice Sistem SRL - Copyright 2008 Elena-Ramona Modroiu + Copyright © 2008 Elena-Ramona Modroiu __________________________________________________________________ Table of Contents @@ -181,7 +181,7 @@ sip:12391001@mydomain.com => sip:91001@alpha.org URL of the database table to be used. - Default value is "mysql://openser:openserrw@localhost/openser". + Default value is “mysql://kamailio:kamailiorw@localhost/kamailio”. Example 1.2. Set db_url parameter ... @@ -192,7 +192,7 @@ modparam("pdt", "db_url", "dbdriver://username:password@dbhost/dbname") Table name. - Default value is "pdt". + Default value is “pdt”. Example 1.3. Set db_table parameter ... @@ -203,7 +203,7 @@ modparam("pdt", "db_table", "pdt") Name of 'sdomain' column. - Default value is "sdomain". + Default value is “sdomain”. Example 1.4. Set sdomain_column parameter ... @@ -214,7 +214,7 @@ modparam("pdt", "domain_column", "source_domain") Name of 'prefix' column. - Default value is "prefix". + Default value is “prefix”. Example 1.5. Set prefix_column parameter ... @@ -225,7 +225,7 @@ modparam("pdt", "prefix_column", "prefix") Name of 'domain' column. - Default value is "domain". + Default value is “domain”. Example 1.6. Set domain_column parameter ... @@ -262,7 +262,7 @@ modparam("pdt", "fetch_rows", 4000) The list with characters allowed in prefix. - Default value is "0123456789". + Default value is “0123456789”. Example 1.9. Set char_list parameter ... @@ -288,7 +288,7 @@ modparam("pdt", "check_domain", 0) 4.3. prefix2domain() 4.4. pd_translate(sdomain, rewrite_mode) -4.1. prefix2domain(rewrite_mode, multidomain_mode) +4.1. prefix2domain(rewrite_mode, multidomain_mode) Build a new URI if it is necessary. Returns 1 when the translation was made or there was nothing to translate (user part of the URI is empty, @@ -305,14 +305,14 @@ modparam("pdt", "check_domain", 0) of source domain. This can be achieved inserting in the database entries where sdomain has the value "*". - The "rewrite_mode" parameter specifies whether to strip or not the + The “rewrite_mode” parameter specifies whether to strip or not the prefix from user part. The possible values are: * 0: the prefix is removed along with the leading prefix. * 1: only the leading prefix is removed. * 2: the user part of the URI is not changed. * $PV : any PV holding one of the above values. - The "multidomain_mode" parameter specifies the kind of multidomain + The “multidomain_mode” parameter specifies the kind of multidomain support to use. The possible values are: * 0 : Translation of URI regardless of source domain. * 1 : Translation of URI using as source domain the domain in @@ -332,7 +332,7 @@ $var(a) = 1; prefix2domain("$var(a)", "2"); ... -4.2. prefix2domain(rewrite_mode) +4.2. prefix2domain(rewrite_mode) The same as prefix2domain(rewrite_mode, "0"), that is without multidomain support, translation of URI being done regardless of the @@ -341,14 +341,14 @@ prefix2domain("$var(a)", "2"); prefix2domain("2"); ... -4.3. prefix2domain() +4.3. prefix2domain() The same as prefix2domain("0", "0"). ... prefix2domain(); ... -4.4. pd_translate(sdomain, rewrite_mode) +4.4. pd_translate(sdomain, rewrite_mode) Translate R-URI based on source domain and longest prefix matching. Returns 1 when the translation was made or there was nothing to @@ -357,11 +357,11 @@ prefix2domain(); The translation is done based on lookup up for an entry in the database where the sdomain parameter equals the sdomain in database table. - The "sdomain" parameter specifies the source domain to be used to match + The “sdomain” parameter specifies the source domain to be used to match the longest prefix. Can be a static string or dynamic parameter with variables inside. - The "rewrite_mode" parameter specifies whether to strip or not the + The “rewrite_mode” parameter specifies whether to strip or not the prefix from user part. The possible values are: * 0: the prefix is removed along with the leading prefix. * 1: only the leading prefix is removed. @@ -389,7 +389,7 @@ pd_translate("*", "$var(a)"); changes made via these commands are applied to database and the cache is updated correspondingly. -5.1. pdt_list +5.1. pdt_list Produces a listing of the entries prefixes/domains/sdomains. @@ -413,14 +413,14 @@ pd_translate("*", "$var(a)"); _empty_line_ Examples: - * "pdt_list siph 2 ." : Lists the entries where sdomain is starting + * “pdt_list siph 2 .” : Lists the entries where sdomain is starting with 'siph', prefix is starting with '2' and domain is anything - * "pdt_list siph 2" : Lists the entries where sdomain is starting + * “pdt_list siph 2” : Lists the entries where sdomain is starting with 'siph', prefix is starting with '2' and domain is anything - * "pdt_list . 2 open" : Lists the entries where sdomain is anything, + * “pdt_list . 2 open” : Lists the entries where sdomain is anything, prefix starts with '2' and domain starts with 'open'. -5.2. pdt_reload +5.2. pdt_reload Reload all sdomain-prefix-domain records from database. diff --git a/modules/peering/verify.c b/modules/peering/verify.c index cafd12ccad7..743fcfe2992 100644 --- a/modules/peering/verify.c +++ b/modules/peering/verify.c @@ -55,7 +55,7 @@ static inline int extract_avp(VALUE_PAIR* vp, unsigned short *flags, char *end; /* empty? */ - if (vp->lvalue==0 || vp->strvalue==0) + if (vp->lvalue==0) goto error; p = vp->strvalue; diff --git a/modules/permissions/README b/modules/permissions/README index b613bd43347..931179e4898 100644 --- a/modules/permissions/README +++ b/modules/permissions/README @@ -84,18 +84,20 @@ Emmanuel Schmidbauer 5.1. address_reload 5.2. address_dump 5.3. subnet_dump - 5.4. trusted_reload - 5.5. trusted_dump - 5.6. allow_uri + 5.4. perm_domain_dump + 5.5. trusted_reload + 5.6. trusted_dump + 5.7. allow_uri 6. RPC Commands 6.1. addressReload 6.2. addressDump 6.3. subnetDump - 6.4. testUri basename uri contact - 6.5. trustedReload - 6.6. trustedDump + 6.4. domainDump + 6.5. testUri basename uri contact + 6.6. trustedReload + 6.7. trustedDump List of Examples @@ -194,18 +196,20 @@ Chapter 1. Admin Guide 5.1. address_reload 5.2. address_dump 5.3. subnet_dump - 5.4. trusted_reload - 5.5. trusted_dump - 5.6. allow_uri + 5.4. perm_domain_dump + 5.5. trusted_reload + 5.6. trusted_dump + 5.7. allow_uri 6. RPC Commands 6.1. addressReload 6.2. addressDump 6.3. subnetDump - 6.4. testUri basename uri contact - 6.5. trustedReload - 6.6. trustedDump + 6.4. domainDump + 6.5. testUri basename uri contact + 6.6. trustedReload + 6.7. trustedDump 1. Overview @@ -274,7 +278,7 @@ Chapter 1. Admin Guide The function for registration checking is called allow_register and the algorithm is very similar to the algorithm described in Section 1.1, - "Call Routing". The only difference is in the way how pairs are + “Call Routing”. The only difference is in the way how pairs are created. Instead of the From header field the function uses the To header field @@ -286,7 +290,7 @@ Chapter 1. Admin Guide (To, Contact 2), (To, Contact 3), and so on.. The algorithm of matching is the same as described in Section 1.1, - "Call Routing". + “Call Routing”. 1.3. URI Permissions @@ -414,7 +418,7 @@ Chapter 1. Admin Guide don't specify a full pathname then the directory in which is the main config file is located will be used. - Default value is "permissions.allow". + Default value is “permissions.allow”. Example 1.1. Set default_allow_file parameter ... @@ -427,7 +431,7 @@ modparam("permissions", "default_allow_file", "/etc/permissions.allow") no parameters. If you don't specify a full pathname then the directory in which the main config file is located will be used. - Default value is "permissions.deny". + Default value is “permissions.deny”. Example 1.2. Set default_deny_file parameter ... @@ -462,7 +466,7 @@ Note Including leading dot. - Default value is ".allow". + Default value is “.allow”. Example 1.4. Set allow_suffix parameter ... @@ -479,7 +483,7 @@ Note Including leading dot. - Default value is ".deny". + Default value is “.deny”. Example 1.5. Set deny_suffix parameter ... @@ -491,7 +495,7 @@ modparam("permissions", "deny_suffix", ".deny") This is URL of the database to be used to store rules used by allow_trusted function. - Default value is "NULL". + Default value is “NULL”. Example 1.6. Set db_url parameter ... @@ -503,7 +507,7 @@ modparam("permissions", "db_url", "dbdriver://username:password@dbhost/dbname") The name of the database table containing IP subnets and DNS domain names used by allow_address and allow_source_address functions. - Default value is "address". + Default value is “address”. Example 1.7. Set address_table parameter ... @@ -515,7 +519,7 @@ modparam("permissions", "address_table", "addr") Name of address table column containing the group identifier of the address. - Default value is "grp". + Default value is “grp”. Example 1.8. Set grp_col parameter ... @@ -527,7 +531,7 @@ modparam("permissions", "grp_col", "group_id") Name of address table column containing the IP address part of the address. - Default value is "ip_addr". + Default value is “ip_addr”. Example 1.9. Set ip_addr_col parameter ... @@ -540,7 +544,7 @@ modparam("permissions", "ip_addr_col", "ip_address") address. Possible values are 0-32 for IPv4 and 0-128 for IPv6 addresses. - Default value is "mask". + Default value is “mask”. Example 1.10. Set mask_col parameter ... @@ -551,11 +555,11 @@ modparam("permissions", "mask_col", "subnet_length") Name of address table column containing the port part of the address. - Default value is "port". + Default value is “port”. Example 1.11. Set port_col parameter ... -modparam("permissions", "port_col", "prt") +modparam("permissions", "port_col", "port") ... 3.12. db_mode (integer) @@ -575,7 +579,7 @@ modparam("permissions", "db_mode", 1) Name of database table containing the matching rules used by the allow_trusted function. - Default value is "trusted". + Default value is “trusted”. Example 1.13. Set trusted_table parameter ... @@ -584,10 +588,10 @@ modparam("permissions", "trusted_table", "pbx") 3.14. source_col (string) - Name of column in the "trusted" table containing the source IP address + Name of column in the “trusted” table containing the source IP address that is matched against source IP address of received request. - Default value is "src_ip". + Default value is “src_ip”. Example 1.14. Set source_col parameter ... @@ -596,13 +600,13 @@ modparam("permissions", "source_col", "source_ip_address") 3.15. proto_col (string) - Name of column in the "trusted" table containing the transport protocol + Name of column in the “trusted” table containing the transport protocol that is matched against transport protocol of the received request. - Possible values that can be stored in proto_col are "any", "udp", - "tcp", "tls", "sctp", "ws", "wss", and "none". Value "any" matches - always and value "none" never. + Possible values that can be stored in proto_col are “any”, “udp”, + “tcp”, “tls”, “sctp”, “ws”, “wss”, and “none”. Value “any” matches + always and value “none” never. - Default value is "proto". + Default value is “proto”. Example 1.15. Set proto_col parameter ... @@ -614,7 +618,7 @@ modparam("permissions", "proto_col", "transport") Name of the column trusted table containing a regular expression that is matched against the From URI. - Default value is "from_pattern". + Default value is “from_pattern”. Example 1.16. Set from_col parameter ... @@ -626,7 +630,7 @@ modparam("permissions", "from_col", "regexp") Name of the column trusted table containing a regular expression that is matched against the Request URI. - Default value is "ruri_pattern". + Default value is “ruri_pattern”. Example 1.17. Set ruri_col parameter ... @@ -635,11 +639,11 @@ modparam("permissions", "ruri_col", "regexp") 3.18. tag_col (string) - Name of the column in the "address" or "trusted" table containing a + Name of the column in the “address” or “trusted” table containing a string that is added as value to peer_tag AVP if peer_tag AVP has been defined and if the address or peer matches. - Default value is "tag". + Default value is “tag”. Example 1.18. Set tag_col parameter ... @@ -654,7 +658,7 @@ modparam("permissions", "tag_col", "peer_tag") In non-caching mode, priority order (ASC vs DESC) is determined by database. - Default value is "priority". + Default value is “priority”. Example 1.19. Set priority_col parameter ... @@ -666,7 +670,7 @@ modparam("permissions", "priority_col", "column_name") If defined, the AVP will be set as a side effect of allow_trusted call to not NULL tag column value of the matching peer. - Default value is "undefined". + Default value is “undefined”. Example 1.20. Set peer_tag_avp parameter ... @@ -675,12 +679,12 @@ modparam("permissions", "peer_tag_avp", "$avp(i:707)") 3.21. peer_tag_mode (integer) - Tag mode for allow_trusted. "0" sets only the tag of the first match. - "1" adds the tags of all matches to the avp. In addition the return + Tag mode for allow_trusted. “0” sets only the tag of the first match. + “1” adds the tags of all matches to the avp. In addition the return value of allow_trusted is the number of matches. This parameter is not used for address table matching functions. - Default value is "0". + Default value is “0”. Example 1.21. Set peer_tag_mode parameter ... @@ -691,7 +695,7 @@ modparam("permissions", "peer_tag_mode", 1) The maximum number of subnet addresses to be loaded from address table. - Default value is "512". + Default value is “512”. Example 1.22. Set max_subnets parameter ... @@ -712,10 +716,10 @@ modparam("permissions", "max_subnets", 1024) 4.10. allow_address_group(addr, port) 4.11. allow_trusted([src_ip_pvar, proto_pvar]) -4.1. allow_routing() +4.1. allow_routing() Returns true if all pairs constructed as described in Section 1.1, - "Call Routing" have appropriate permissions according to the + “Call Routing” have appropriate permissions according to the configuration files. This function uses default configuration files specified in default_allow_file and default_deny_file. @@ -728,10 +732,10 @@ if (allow_routing()) { }; ... -4.2. allow_routing(basename) +4.2. allow_routing(basename) Returns true if all pairs constructed as described in Section 1.1, - "Call Routing" have appropriate permissions according to the + “Call Routing” have appropriate permissions according to the configuration files given as parameters. Meaning of the parameters is as follows: @@ -751,10 +755,10 @@ if (allow_routing("basename")) { }; ... -4.3. allow_routing(allow_file,deny_file) +4.3. allow_routing(allow_file,deny_file) Returns true if all pairs constructed as described in Section 1.1, - "Call Routing" have appropriate permissions according to the + “Call Routing” have appropriate permissions according to the configuration files given as parameters. Meaning of the parameters is as follows: @@ -776,10 +780,10 @@ if (allow_routing("rules.allow", "rules.deny")) { }; ... -4.4. allow_register(basename) +4.4. allow_register(basename) The function returns true if all pairs constructed as described in - Section 1.2, "Registration Permissions" have appropriate permissions + Section 1.2, “Registration Permissions” have appropriate permissions according to the configuration files given as parameters. Meaning of the parameters is as follows: @@ -804,10 +808,10 @@ if (method=="REGISTER") { }; ... -4.5. allow_register(allow_file, deny_file) +4.5. allow_register(allow_file, deny_file) The function returns true if all pairs constructed as described in - Section 1.2, "Registration Permissions" have appropriate permissions + Section 1.2, “Registration Permissions” have appropriate permissions according to the configuration files given as parameters. Meaning of the parameters is as follows: @@ -834,10 +838,10 @@ if (method=="REGISTER") { }; ... -4.6. allow_uri(basename, pvar) +4.6. allow_uri(basename, pvar) - Returns true if the pair constructed as described in Section 1.3, "URI - Permissions" have appropriate permissions according to the + Returns true if the pair constructed as described in Section 1.3, “URI + Permissions” have appropriate permissions according to the configuration files specified by the parameter. Meaning of the parameter is as follows: @@ -861,7 +865,7 @@ if (allow_uri("basename", "$avp(i:705)") { // Check URI stored in $avp(i:705) }; ... -4.7. allow_address(group_id, ip_addr_pvar, port_pvar) +4.7. allow_address(group_id, ip_addr_pvar, port_pvar) Returns true if the address and port given as values of pvar arguments belonging to a group given as group_id argument matches an IP subnet or @@ -871,8 +875,8 @@ if (allow_uri("basename", "$avp(i:705)") { // Check URI stored in $avp(i:705) with the records from that group that are of type exact IP or subnet. If the argument is not an IP it is tried to be matched with the records that are DNS domain names. No DNS lookup is performed, only strict - matching. Cached address table entry containing port value "0" matches - any port. The "group_id" argument can be an integer string or a pseudo + matching. Cached address table entry containing port value “0” matches + any port. The “group_id” argument can be an integer string or a pseudo variable. This function can be used from REQUEST_ROUTE, FAILURE_ROUTE. @@ -892,9 +896,9 @@ if (!allow_address("2", "$avp(dst_adr)", "$avp(dst_port)") { }; ... -4.8. allow_source_address([group_id]) +4.8. allow_source_address([group_id]) - Equal to "allow_address(group_id, "$si", "$sp")". If 'group_id' is + Equal to “allow_address(group_id, "$si", "$sp")”. If 'group_id' is missing, the function is equal to allow_address("1", "$si", "$sp"). This function can be used from REQUEST_ROUTE, FAILURE_ROUTE. @@ -908,7 +912,7 @@ if (!allow_source_address("1")) { }; ... -4.9. allow_source_address_group() +4.9. allow_source_address_group() Checks if source address/port is found in cached address or subnet table in any group. If yes, returns that group. If not returns -1. Port @@ -925,7 +929,7 @@ if ($var(group) != -1) { }; ... -4.10. allow_address_group(addr, port) +4.10. allow_address_group(addr, port) Checks if address/port is found in cached address or subnet table in any group. If yes, returns that group. If not returns -1. Port value 0 @@ -943,13 +947,13 @@ if ($var(group) != -1) { }; ... -4.11. allow_trusted([src_ip_pvar, proto_pvar]) +4.11. allow_trusted([src_ip_pvar, proto_pvar]) Checks based either on request's source address and transport protocol or source address and transport protocol given in pvar arguments, and From URI of request if request can be trusted without authentication. - Returns "1" if a match is found as described in Section 1.5, "Trusted - Requests" and "-1" otherwise. If a match is found and peer_tag_avp has + Returns “1” if a match is found as described in Section 1.5, “Trusted + Requests” and “-1” otherwise. If a match is found and peer_tag_avp has been defined, adds a non-NULL tag column value of the matching peer to AVP peer_tag_avp. @@ -975,11 +979,12 @@ if (allow_trusted("$si", "$proto")) { 5.1. address_reload 5.2. address_dump 5.3. subnet_dump - 5.4. trusted_reload - 5.5. trusted_dump - 5.6. allow_uri + 5.4. perm_domain_dump + 5.5. trusted_reload + 5.6. trusted_dump + 5.7. allow_uri -5.1. address_reload +5.1. address_reload Causes the permissions module to re-read the contents of address database table into cache memory. The in-cache memory entries are for @@ -988,35 +993,42 @@ if (allow_trusted("$si", "$proto")) { Parameters: none -5.2. address_dump +5.2. address_dump Causes permissions module to dump contents of cache memory address table. Parameters: none -5.3. subnet_dump +5.3. subnet_dump Causes permissions module to dump contents of cache memory subnet table. Parameters: none -5.4. trusted_reload +5.4. perm_domain_dump + + Causes permissions module to dump contents of cache memory domain + table. + + Parameters: none + +5.5. trusted_reload Causes the permissions module to re-read the contents of trusted table into cache memory. Parameters: none -5.5. trusted_dump +5.6. trusted_dump Causes the permissions module to dump the contents of trusted table from cache memory. Parameters: none -5.6. allow_uri +5.7. allow_uri Tests if (URI, Contact) pair is allowed according to the allow/deny files. The files must already have been loaded by Kamailio. @@ -1033,11 +1045,12 @@ if (allow_trusted("$si", "$proto")) { 6.1. addressReload 6.2. addressDump 6.3. subnetDump - 6.4. testUri basename uri contact - 6.5. trustedReload - 6.6. trustedDump + 6.4. domainDump + 6.5. testUri basename uri contact + 6.6. trustedReload + 6.7. trustedDump -6.1. addressReload +6.1. addressReload Causes the permissions module to re-read the contents of address database table into cache memory. In cache memory the entries are for @@ -1046,21 +1059,28 @@ if (allow_trusted("$si", "$proto")) { Parameters: none -6.2. addressDump +6.2. addressDump Causes the permissions module to dump the contents of cache memory address table. (Not the subnet table). Parameters: none -6.3. subnetDump +6.3. subnetDump Causes permissions module to dump contents of cache memory subnet table. Parameters: none -6.4. testUri basename uri contact +6.4. domainDump + + Causes permissions module to dump contents of cache memory domain + table. + + Parameters: none + +6.5. testUri basename uri contact Tests if the (URI, Contact) pair is allowed according to allow/deny files. The files must already have been loaded by Kamailio. @@ -1072,14 +1092,14 @@ if (allow_trusted("$si", "$proto")) { * URI - URI to be tested * Contact - Contact to be tested -6.5. trustedReload +6.6. trustedReload Causes the permissions module to re-read the contents of the trusted database table into cache memory. Parameters: none -6.6. trustedDump +6.7. trustedDump Causes the permissions module to dump contents of the trusted database table from cache memory. diff --git a/modules/permissions/doc/permissions_admin.xml b/modules/permissions/doc/permissions_admin.xml index c7517433477..b3e1f7743b5 100644 --- a/modules/permissions/doc/permissions_admin.xml +++ b/modules/permissions/doc/permissions_admin.xml @@ -19,22 +19,22 @@ The Permissions module provides functions for handling IP based access control lists (ACL) in a number of ways. - - Call Routing - - - Registration permissions - - - URI permissions - - - Address permissions - - - Trusted Requests - - + + Call Routing + + + Registration permissions + + + URI permissions + + + Address permissions + + + Trusted Requests + + The Address permissions and Trusted request handling supports using a database to load ACLs into RAM for fast processing. @@ -269,7 +269,7 @@ Rules are stored in a database table specified by the module parameters. There is a module parameter called - db_mode that + db_mode that determines if the rules are cached into memory for faster matching or if the database is consulted for each invocation of the allow_trusted() function call. @@ -458,8 +458,8 @@ modparam("permissions", "db_url", "&exampledb;") The name of the database table containing IP subnets and DNS domain names used by allow_address and - allow_source_address - functions. + allow_source_address + functions. @@ -551,7 +551,7 @@ modparam("permissions", "mask_col", "subnet_length") Set <varname>port_col</varname> parameter ... -modparam("permissions", "port_col", "prt") +modparam("permissions", "port_col", "port") ... @@ -690,7 +690,7 @@ modparam("permissions", "ruri_col", "regexp") Name of the column in the address or trusted table containing a string that is added as value to peer_tag AVP if peer_tag AVP - has been defined and if the address or peer matches. + has been defined and if the address or peer matches. @@ -711,8 +711,8 @@ modparam("permissions", "tag_col", "peer_tag") The column name used to store the priority of the corresponding rule from the database row. Priority values should be integer. When db_mode is set to 1 (caching), priorities - are ordered from highest to lowest. In non-caching mode, priority order (ASC vs DESC) - is determined by database. + are ordered from highest to lowest. In non-caching mode, priority order (ASC vs DESC) + is determined by database. @@ -732,7 +732,7 @@ modparam("permissions", "priority_col", "column_name") <varname>peer_tag_avp</varname> (AVP string) If defined, the AVP will be - set as a side effect of allow_trusted + set as a side effect of allow_trusted call to not NULL tag column value of the matching peer. @@ -1172,7 +1172,7 @@ if ($var(group) != -1) { as described in and -1 otherwise. If a match is found and peer_tag_avp has been defined, adds a - non-NULL tag column value of the + non-NULL tag column value of the matching peer to AVP peer_tag_avp. @@ -1212,10 +1212,9 @@ if (allow_trusted("$si", "$proto")) { address database table into cache memory. The in-cache memory entries are for performance reasons stored in two - different tables: address table and + different tables: address table and subnet table depending on the value of the mask field (32 or smaller). - Parameters: none
@@ -1226,8 +1225,7 @@ if (allow_trusted("$si", "$proto")) { Causes permissions module to dump - contents of cache memory address table. - + contents of cache memory address table. Parameters: none
@@ -1238,9 +1236,19 @@ if (allow_trusted("$si", "$proto")) { Causes permissions module to dump - contents of cache memory subnet table. + contents of cache memory subnet table. + + Parameters: none +
- +
+ + <function moreinfo="none">perm_domain_dump</function> + + + Causes permissions module to dump + contents of cache memory domain table. + Parameters: none
@@ -1249,8 +1257,8 @@ if (allow_trusted("$si", "$proto")) { trusted_reload - Causes the permissions module to re-read the contents of - trusted table into cache memory. + Causes the permissions module to re-read the contents of + trusted table into cache memory. Parameters: none
@@ -1260,8 +1268,8 @@ if (allow_trusted("$si", "$proto")) { trusted_dump - Causes the permissions module to dump the - contents of trusted table from cache memory. + Causes the permissions module to dump the + contents of trusted table from cache memory. Parameters: none
@@ -1273,22 +1281,22 @@ if (allow_trusted("$si", "$proto")) { Tests if (URI, Contact) pair is allowed according to the allow/deny files. The files must already have been - loaded by &kamailio;. + loaded by &kamailio;. Parameters: basename - - Basename from which allow and deny filenames will be created by - appending contents of allow_suffix and deny_suffix - parameters. + Basename from which allow and deny filenames will be created by + appending contents of allow_suffix + and deny_suffix + parameters. URI - URI to be tested - Contact - Contact - to be tested + Contact - Contact to be tested @@ -1306,7 +1314,7 @@ if (allow_trusted("$si", "$proto")) { address database table into cache memory. In cache memory the entries are for performance reasons stored in two - different tables: address table and + different tables: address table and subnet table depending on the value of the mask field (32 or smaller). @@ -1320,7 +1328,7 @@ if (allow_trusted("$si", "$proto")) { Causes the permissions module to dump - the contents of cache memory address table. + the contents of cache memory address table. (Not the subnet table). @@ -1333,10 +1341,22 @@ if (allow_trusted("$si", "$proto")) { Causes permissions module to dump - contents of cache memory subnet table. + contents of cache memory subnet table. + + Parameters: none +
+ +
+ + <function moreinfo="none">domainDump</function> + + + Causes permissions module to dump + contents of cache memory domain table. Parameters: none
+
<function moreinfo="none">testUri basename uri contact</function> diff --git a/modules/permissions/hash.c b/modules/permissions/hash.c index cfc81fe4427..84b20e2d416 100644 --- a/modules/permissions/hash.c +++ b/modules/permissions/hash.c @@ -423,6 +423,7 @@ void empty_hash_table(struct trusted_list **table) while (np) { if (np->src_ip.s) shm_free(np->src_ip.s); if (np->pattern) shm_free(np->pattern); + if (np->ruri_pattern) shm_free(np->ruri_pattern); if (np->tag.s) shm_free(np->tag.s); next = np->next; shm_free(np); diff --git a/modules/pike/README b/modules/pike/README index bb7466b3240..59f068a5123 100644 --- a/modules/pike/README +++ b/modules/pike/README @@ -8,7 +8,7 @@ Edited by Bogdan-Andrei Iancu - Copyright 2003 FhG FOKUS + Copyright © 2003 FhG FOKUS __________________________________________________________________ Table of Contents @@ -120,7 +120,7 @@ Chapter 1. Admin Guide IMPORTANT: a too small value may lead to performance penalties due to timer process overloading. - Default value is "2". + Default value is “2”. Example 1.1. Set sampling_time_unit parameter ... @@ -174,7 +174,7 @@ modparam("pike", "pike_log_level", -1) 4.1. pike_check_req() -4.1. pike_check_req() +4.1. pike_check_req() Process the source IP of the current request and return false if the IP was exceeding the blocking limit. @@ -200,7 +200,7 @@ if (!pike_check_req()) { exit; }; 5.1. pike_list -5.1. pike_list +5.1. pike_list Lists the nodes in the pike tree. @@ -218,7 +218,7 @@ Chapter 2. RPC calls 1. pike.top -1. pike.top +1. pike.top Pike.top behaves like a 'top' command and shows source IP addresses of incoming requestes to pike_check_req() function. @@ -253,21 +253,21 @@ tree root / \ 142 the nodes corresponding to each byte of the ip address are expanded. In order to be expended a node has to be hit for a given number of times (possible by different addresses; in the previous example, the node - "37" was expended by the 195.37.78.163 and 195.37.79.134 hits). + “37” was expended by the 195.37.78.163 and 195.37.79.134 hits). For 193.175.132.164 with x= reqs_density_per_unit: - * After first req hits -> the "193" node is built. - * After x more hits, the "175" node is build; the hits of "193" node + * After first req hits -> the “193” node is built. + * After x more hits, the “175” node is build; the hits of “193” node are split between itself and its child--both of them gone have x/2. - * And so on for node "132" and "164". - * Once "164" build the entire address can be found in the tree. "164" + * And so on for node “132” and “164”. + * Once “164” build the entire address can be found in the tree. “164” becomes a leaf. After it will be hit as a leaf for x times, it will - become "RED" (further request from this address will be blocked). + become “RED” (further request from this address will be blocked). So, to build and block this address were needed 3*x hits. Now, if reqs start coming from 193.175.132.142, the first 3 bytes are already in the tree (they are shared with the previous address), so I will need only x - hits (to build node "142" and to make it "RED") to make this address + hits (to build node “142” and to make it “RED”) to make this address also to be blocked. This is the reason for the variable number of hits necessary to block an IP. diff --git a/modules/pipelimit/README b/modules/pipelimit/README index 2cc8197732e..e9872ecf245 100644 --- a/modules/pipelimit/README +++ b/modules/pipelimit/README @@ -24,9 +24,9 @@ Daniel-Constantin Mierla 1. Admin Guide 1. Overview - - 1.1 Algorithms - + + 1.1. Algorithms + 2. Dependencies 2.1. Kamailio Modules @@ -88,7 +88,7 @@ Chapter 1. Admin Guide Table of Contents 1. Overview - + 1.1. Algorithms 2. Dependencies @@ -147,15 +147,15 @@ Chapter 1. Admin Guide of pipes limits in database and dynamic names. Complexity of keeping everything in a module and make it dual mode functional resulted in a new module which is focused on just traffic shaping policies. - + 1.1. Algorithms Algorithms are based from the ratelimit module, which describes the algorithms in more detail. The algorithms are used by the pipelimit module to determine if a message should be blocked. - + Tail Drop Algorithm (TAILDROP) - + This is a trivial algorithm that imposes some risks when used in conjunction with long timer intervals. At the start of each interval an internal counter is reset and incremented for each incoming message. @@ -172,7 +172,7 @@ Chapter 1. Admin Guide interval. As a negative side effect Kamailio might drop messages although the limit might not be reached within the interval. Decrease the timer interval if you encounter this. - + Network Algorithm (NETWORK) This algorithm relies on information provided by network interfaces. @@ -231,7 +231,7 @@ Chapter 1. Admin Guide have many pipes, increase this value for proper performances, but don't go too high (hash_size=10 means 1024 slots). - Default value is "6" (64 slots). + Default value is “6” (64 slots). Example 1.1. Set hash_size parameter ... @@ -242,7 +242,7 @@ modparam("pipelimit", "hash_size", 10) URL of the database server to be used. - Default value is "mysql://kamailio:kamailiorw@localhost/kamailio". + Default value is “mysql://kamailio:kamailiorw@localhost/kamailio”. Example 1.2. Set db_url parameter ... @@ -253,7 +253,7 @@ modparam("pipelimit", "db_url", "dbdriver://username:password@dbhost/dbname") Name of DB table where data definition for pipes is stores. - Default value is "pl_pipes". + Default value is “pl_pipes”. Example 1.3. Set plp_table_name parameter ... @@ -264,7 +264,7 @@ modparam("pipelimit", "plp_table_name", "mypipes") Name of 'pipeid' column. - Default value is "pipeid". + Default value is “pipeid”. Example 1.4. Set plp_pipeid_column parameter ... @@ -275,7 +275,7 @@ modparam("pipelimit", "plp_pipeid_column", "name") Name of 'limit' column. - Default value is "limit". + Default value is “limit”. Example 1.5. Set plp_limit_column parameter ... @@ -286,7 +286,7 @@ modparam("pipelimit", "plp_limit_column", "name") Name of 'algorithm' column. - Default value is "algorithm". + Default value is “algorithm”. Example 1.6. Set plp_algorithm_column parameter ... @@ -346,7 +346,7 @@ kamcmd cfg.set_now_string pipelimit reply_reason "Limiting" 4.1. pl_check(name [, algorithm, limit]) 4.2. pl_drop([ [min ], max ]) -4.1. pl_check(name [, algorithm, limit]) +4.1. pl_check(name [, algorithm, limit]) Check the current request against the 'name' pipe. @@ -415,15 +415,15 @@ with unexpected retcode=$var(check_result)\n"); ... # perform pipe match for INVITE if (is_method("INVITE")) { - $var(invlimit) = 10; - if (!pl_check("$si", "TAILDROP", "$var(invlimit)")) { - pl_drop(); - exit; - } + $var(invlimit) = 10; + if (!pl_check("$si", "TAILDROP", "$var(invlimit)")) { + pl_drop(); + exit; + } } ... -4.2. pl_drop([ [min ], max ]) +4.2. pl_drop([ [min ], max ]) For the current request, a "503 - Server Unavailable" reply is sent back. The reply may or may not have a "Retry-After" header. If no @@ -458,7 +458,7 @@ with unexpected retcode=$var(check_result)\n"); 5.5. pl_get_pid 5.6. pl_push_load -5.1. pl_stats +5.1. pl_stats Lists the parameters and variables in the pipelimit module. @@ -470,7 +470,7 @@ with unexpected retcode=$var(check_result)\n"); :pl_stats:_reply_fifo_file_ _empty_line_ -5.2. pl_set_pipe +5.2. pl_set_pipe Sets the pipe parameters for the given pipe id. @@ -488,7 +488,7 @@ with unexpected retcode=$var(check_result)\n"); 10 _empty_line_ -5.3. pl_get_pipes +5.3. pl_get_pipes Gets the list of in use pipes. @@ -500,7 +500,7 @@ with unexpected retcode=$var(check_result)\n"); :pl_get_pipes:_reply_fifo_file_ _empty_line_ -5.4. pl_set_pid +5.4. pl_set_pid Sets the PID Controller parameters for the Feedback Algorithm. @@ -518,7 +518,7 @@ with unexpected retcode=$var(check_result)\n"); 0.5 _empty_line_ -5.5. pl_get_pid +5.5. pl_get_pid Gets the list of in use PID Controller parameters. @@ -530,7 +530,7 @@ with unexpected retcode=$var(check_result)\n"); :pl_get_pid:_reply_fifo_file_ _empty_line_ -5.6. pl_push_load +5.6. pl_push_load Force the value of the load parameter. This command is useful for testing the Feedback algorithm. @@ -555,7 +555,7 @@ with unexpected retcode=$var(check_result)\n"); 6.5. pl.get_pid 6.6. pl.push_load -6.1. pl.stats +6.1. pl.stats Lists the parameters and variabiles in the pipelimit module: pipe id, pipe load and pipe couter. @@ -567,7 +567,7 @@ with unexpected retcode=$var(check_result)\n"); RPC Command Format: kamcmd pl.stats -6.2. pl.set_pipe +6.2. pl.set_pipe Sets the pipe parameters for the given pipe id. @@ -581,7 +581,7 @@ with unexpected retcode=$var(check_result)\n"); RPC Command Format: kamcmd pl.set_pipe 2 RED 10 -6.3. pl.get_pipes +6.3. pl.get_pipes Gets the list of in use pipes. @@ -592,7 +592,7 @@ with unexpected retcode=$var(check_result)\n"); RPC Command Format: kamcmd pl.get_pipes -6.4. pl.set_pid +6.4. pl.set_pid Sets the PID Controller parameters for the Feedback Algorithm. @@ -606,7 +606,7 @@ with unexpected retcode=$var(check_result)\n"); RPC Command Format: kamcmd pl.set_pid 0.5 0.5 0.5 -6.5. pl.get_pid +6.5. pl.get_pid Gets the list of in use PID Controller parameters. @@ -617,7 +617,7 @@ with unexpected retcode=$var(check_result)\n"); RPC Command Format: kamcmd pl.get_pid -6.6. pl.push_load +6.6. pl.push_load Force the value of the load parameter. This command is useful for testing the Feedback algorithm. diff --git a/modules/pipelimit/pipelimit.c b/modules/pipelimit/pipelimit.c index 5ed5c13dc34..2a15fbb3f87 100644 --- a/modules/pipelimit/pipelimit.c +++ b/modules/pipelimit/pipelimit.c @@ -912,8 +912,8 @@ void rpc_pl_push_load(rpc_t *rpc, void *c) { } static rpc_export_t rpc_methods[] = { - {"pl.stats", rpc_pl_stats, rpc_pl_stats_doc, 0}, - {"pl.get_pipes", rpc_pl_get_pipes, rpc_pl_get_pipes_doc, 0}, + {"pl.stats", rpc_pl_stats, rpc_pl_stats_doc, RET_ARRAY}, + {"pl.get_pipes", rpc_pl_get_pipes, rpc_pl_get_pipes_doc, RET_ARRAY}, {"pl.set_pipe", rpc_pl_set_pipe, rpc_pl_set_pipe_doc, 0}, {"pl.get_pid", rpc_pl_get_pid, rpc_pl_get_pid_doc, 0}, {"pl.set_pid", rpc_pl_set_pid, rpc_pl_set_pid_doc, 0}, diff --git a/modules/prefix_route/README b/modules/prefix_route/README index ba3663c76f2..b28d6322380 100644 --- a/modules/prefix_route/README +++ b/modules/prefix_route/README @@ -1,14 +1,13 @@ - prefix_route Module Alfred E. Heggestad Telio Telecom - Copyright 2007 Alfred E. Heggestad + Copyright © 2007 Alfred E. Heggestad - Copyright 2008 Telio Telecom AS - _________________________________________________________________ + Copyright © 2008 Telio Telecom AS + __________________________________________________________________ Table of Contents @@ -64,13 +63,13 @@ Chapter 1. Admin Guide 1. Overview - The prefix_route module does routing based on a set of prefixes from - the database. The prefix rule-set is loaded from the database into a - binary tree in memory, either on startup or when issuing the - "prefix_route.reload" RPC command. When calling the "prefix_route()" - function from the ser.cfg configuration script, it will try to match - the user part of the request URI with the best matching route. If a - route is found, it will be used for further processing. If not found + The prefix_route module does routing based on a set of prefixes from + the database. The prefix rule-set is loaded from the database into a + binary tree in memory, either on startup or when issuing the + "prefix_route.reload" RPC command. When calling the "prefix_route()" + function from the ser.cfg configuration script, it will try to match + the user part of the request URI with the best matching route. If a + route is found, it will be used for further processing. If not found normal processing will continue. Development was sponsored by Telio Telecom. @@ -105,8 +104,8 @@ modparam("prefix_route", "db_table", "new_prefix_route") 2.3. exit (int) - If set, exit the execution of the configuration file when a route - block is executed upon matching a prefix. Otherwise return 1 (true). + If set, exit the execution of the configuration file when a route block + is executed upon matching a prefix. Otherwise return 1 (true). Default value is 1 (on). @@ -121,7 +120,7 @@ modparam("prefix_route", "exit", 0) 3.1. prefix_route([user]) - This function tries to find a route from the user part of the request + This function tries to find a route from the user part of the request URI (if no parameter is provided), or from the value of the parameter. The parameter can contain config variables. diff --git a/modules/presence/README b/modules/presence/README index 9d4c2193276..1f80ee394e1 100644 --- a/modules/presence/README +++ b/modules/presence/README @@ -1132,17 +1132,16 @@ typedef struct pres_ev free_body_t* free_body; /* sometimes it is necessary that a module make changes for a body for each * active watcher (e.g. setting the "version" parameter in an XML document. - * If a module registers the aux_body_processing callback, it gets called f -or - * each watcher. It either gets the body received by the PUBLISH, or the bo -dy + * If a module registers the aux_body_processing callback, it gets called fo +r + * each watcher. It either gets the body received by the PUBLISH, or the bod +y * generated by the agg_nbody function. * The module can deceide if it makes a copy of the original body, which is - then +then * manipulated, or if it works directly in the original body. If the module - makes a - * copy of the original body, it also has to register the aux_free_body() t -o +makes a + * copy of the original body, it also has to register the aux_free_body() to * free this "per watcher" body. */ aux_body_processing_t* aux_body_processing; @@ -1319,8 +1318,8 @@ typedef char* (*pres_get_sphere_t)(str* pres_uri); Field type: ... -typedef str* (*pres_get_presentity_t)(str pres_uri, pres_ev_t *ev, str *etag, s -tr *contact); +typedef str* (*pres_get_presentity_t)(str pres_uri, pres_ev_t *ev, str *etag, st +r *contact); ... This function returns a pointer to a str containing an XML document diff --git a/modules/presence/event_list.c b/modules/presence/event_list.c index e814db357aa..792449c140e 100644 --- a/modules/presence/event_list.c +++ b/modules/presence/event_list.c @@ -13,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -22,7 +22,7 @@ /*! * \file * \brief Kamailio presence module :: Events - * \ingroup presence + * \ingroup presence */ @@ -31,9 +31,9 @@ #include <string.h> #include "../../str.h" #include "../../dprint.h" -#include "../../parser/parse_event.h" -#include "../../mem/shm_mem.h" -#include "../../mem/mem.h" +#include "../../parser/parse_event.h" +#include "../../mem/shm_mem.h" +#include "../../mem/mem.h" #include "event_list.h" #include "hash.h" @@ -89,7 +89,7 @@ event_t* shm_copy_event(event_t* e) ev->params.hooks.event_dialog.from_tag = p2; if (e->params.hooks.event_dialog.to_tag == p1) ev->params.hooks.event_dialog.to_tag = p2; - if (e->params.hooks.event_dialog.include_session_description == p1) + if (e->params.hooks.event_dialog.include_session_description == p1) ev->params.hooks.event_dialog.include_session_description = p2; if (e->params.hooks.event_dialog.sla == p1) ev->params.hooks.event_dialog.sla = p2; @@ -109,7 +109,7 @@ void shm_free_event(event_t* ev) { if(ev== NULL) return; - + if(ev->name.s) shm_free(ev->name.s); @@ -141,7 +141,7 @@ int add_event(pres_ev_t* event) LM_ERR("NULL content_type param\n"); return -1; } - + ev= contains_event(&event->name, &parsed_event); if(ev== NULL) { @@ -182,7 +182,7 @@ int add_event(pres_ev_t* event) if(ev->content_type.s== NULL) { ERR_MEM(SHARE_MEM); - } + } ev->content_type.len= event->content_type.len; memcpy(ev->content_type.s, event->content_type.s, event->content_type.len); @@ -191,7 +191,7 @@ int add_event(pres_ev_t* event) if(*sep=='.') break; if(sep>=parsed_event.name.s+parsed_event.name.len) sep=0; if(sep && strncmp(sep+1, "winfo", 5)== 0) - { + { ev->type= WINFO_TYPE; wipeer_name.s= parsed_event.name.s; wipeer_name.len= sep - parsed_event.name.s; @@ -203,7 +203,7 @@ int add_event(pres_ev_t* event) } } else - { + { ev->type= PUBL_TYPE; if (parsed_event.name.len + 6 > 50) { LM_ERR("buffer too small\n"); @@ -221,11 +221,11 @@ int add_event(pres_ev_t* event) parsed_event.name.len,parsed_event.name.s); } } - - if(ev->wipeer) + + if(ev->wipeer) ev->wipeer->wipeer= ev; - if(event->req_auth && + if(event->req_auth && ( event->get_auth_status==0 ||event->get_rules_doc== 0)) { LM_ERR("bad event structure\n"); @@ -251,7 +251,7 @@ int add_event(pres_ev_t* event) EvList->events= ev; } EvList->ev_count++; - + LM_DBG("successfully added event: %.*s - len= %d\n",ev->name.len, ev->name.s, ev->name.len); done: @@ -261,7 +261,7 @@ int add_event(pres_ev_t* event) free_event_params(parsed_event.params.list, PKG_MEM_TYPE); if(ev && not_in_list) { - free_pres_event(ev); + free_pres_event(ev); } return -1; } @@ -294,16 +294,16 @@ evlist_t* init_evlist(void) } list->ev_count= 0; list->events= NULL; - + return list; -} +} pres_ev_t* contains_event(str* sname, event_t* parsed_event) { event_t event; event_t *pe; pres_ev_t* e; - + pe = (parsed_event)?parsed_event:&event; memset(pe, 0, sizeof(event_t)); @@ -336,7 +336,7 @@ void free_event_params(param_t* params, int mem_type) pkg_free(t1); t1= t2; } - + } pres_ev_t* search_event(event_t* event) @@ -358,11 +358,11 @@ pres_ev_t* search_event(event_t* event) { return pres_ev; } - + /* search all parameters in event in ev */ if(search_event_params(event, pres_ev->evp)< 0) goto cont; - + /* search all parameters in ev in event */ if(search_event_params(pres_ev->evp, event)< 0) goto cont; @@ -386,19 +386,20 @@ int search_event_params(event_t* ev, event_t* searched_ev) { p= searched_ev->params.list; found= 0; - + while(p) { - if(p->name.len== ps->name.len && - strncmp(p->name.s,ps->name.s, ps->name.len)== 0) + if(p->name.len== ps->name.len && + strncmp(p->name.s,ps->name.s, ps->name.len)== 0) { if((p->body.s== 0 && ps->body.s== 0) || - (p->body.len== ps->body.len && + (p->body.len== ps->body.len && strncmp(p->body.s,ps->body.s,ps->body.len)== 0)) { found= 1; break; } - p= p->next; + } + p= p->next; } if(found== 0) return -1; @@ -409,15 +410,15 @@ int search_event_params(event_t* ev, event_t* searched_ev) } int get_event_list(str** ev_list) -{ +{ pres_ev_t* ev= EvList->events; int i; str* list; *ev_list= NULL; - + if(EvList->ev_count== 0) return 0; - + list= (str*)pkg_malloc(sizeof(str)); if(list== NULL) { @@ -433,36 +434,34 @@ int get_event_list(str** ev_list) return -1; } list->s[0]= '\0'; - + for(i= 0; i< EvList->ev_count; i++) { if(i> 0) { memcpy(list->s+ list->len, ", ", 2); list->len+= 2; - } + } memcpy(list->s+ list->len, ev->name.s, ev->name.len ); list->len+= ev->name.len ; ev= ev->next; } - + *ev_list= list; return 0; } void destroy_evlist(void) { - pres_ev_t* e1, *e2; - if (EvList) - { + pres_ev_t* e1, *e2; + if (EvList) { e1= EvList->events; - while(e1) - { + while(e1) { e2= e1->next; free_pres_event(e1); e1= e2; - } + } shm_free(EvList); - } + } } diff --git a/modules/presence/event_list.h b/modules/presence/event_list.h index 640e6d553f4..c74ee10ef1d 100644 --- a/modules/presence/event_list.h +++ b/modules/presence/event_list.h @@ -13,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -22,7 +22,7 @@ /*! * \file * \brief Kamailio presence module :: Events - * \ingroup presence + * \ingroup presence */ @@ -47,14 +47,14 @@ typedef int (publ_handling_t)(struct sip_msg*); typedef int (subs_handling_t)(struct sip_msg*); typedef str* (agg_nbody_t)(str* pres_user, str* pres_domain, str** body_array, int n, int off_index); -/* params for agg_body_t +/* params for agg_body_t * body_array= an array with all the bodies stored for that resource * n= the number of bodies * off_index= the index of the registration(etag) for which a Publish * with Expires: 0 has just been received * */ typedef str* (aux_body_processing_t)(struct subscription *subs, str* body); -/* params for agg_body_t +/* params for agg_body_t * subs= a subscription structure to manipulate the body for a certain watcher * body= the original body * @@ -79,16 +79,16 @@ struct pres_ev str name; event_t* evp; str content_type; - int default_expires; + unsigned int default_expires; int type; /* category type: WINFO_TIPE, PUBL_TYPE, ...*/ int etag_not_new; /* * 0 - the standard mechanism (allocating new etag for each Publish) - * 1 - allocating an etag only for an initial Publish + * 1 - allocating an etag only for an initial Publish * */ /* fileds that deal with authorization rules*/ /* - * req_auth -> flag 0 - if not require + * req_auth -> flag 0 - if not require * is_watcher_allowed - get subscription state from xcap rules * apply_auth_nbody - alter the body according to authorization rules */ @@ -97,17 +97,17 @@ struct pres_ev get_pidf_doc_t* get_pidf_doc; apply_auth_t* apply_auth_nbody; is_allowed_t* get_auth_status; - + /* an agg_body_t function should be registered if the event permits having * multiple published states and requires an aggregation of the information - * otherwise, this field should be NULL and the last published state is taken - * when constructing Notify msg + * otherwise, this field should be NULL and the last published state is taken + * when constructing Notify msg * */ agg_nbody_t* agg_nbody; publ_handling_t * evs_publ_handl; subs_handling_t * evs_subs_handl; free_body_t* free_body; - /* sometimes it is necessary that a module make changes for a body for each + /* sometimes it is necessary that a module make changes for a body for each * active watcher (e.g. setting the "version" parameter in an XML document. * If a module registers the aux_body_processing callback, it gets called for * each watcher. It either gets the body received by the PUBLISH, or the body @@ -119,9 +119,9 @@ struct pres_ev */ aux_body_processing_t* aux_body_processing; free_body_t* aux_free_body; - struct pres_ev* wipeer; + struct pres_ev* wipeer; struct pres_ev* next; - + }; typedef struct pres_ev pres_ev_t; @@ -129,7 +129,7 @@ typedef struct evlist { int ev_count; pres_ev_t* events; -}evlist_t; +} evlist_t; evlist_t* init_evlist(void); diff --git a/modules/presence/hash.c b/modules/presence/hash.c index 5c302911734..bfce59da387 100644 --- a/modules/presence/hash.c +++ b/modules/presence/hash.c @@ -101,6 +101,7 @@ void destroy_shtable(shtable_t htable, int hash_size) lock_destroy(&htable[i].lock); free_subs_list(htable[i].entries->next, SHM_MEM_TYPE, 1); shm_free(htable[i].entries); + htable[i].entries = NULL; } shm_free(htable); htable= NULL; @@ -318,9 +319,14 @@ int delete_shtable(shtable_t htable,unsigned int hash_code,subs_t* subs) { found= s->local_cseq +1; ps->next= s->next; - if(s->contact.s!=NULL) + if(s->contact.s!=NULL) { shm_free(s->contact.s); - shm_free(s); + s->contact.s = NULL; + } + if (s) { + shm_free(s); + s = NULL; + } break; } ps= s; @@ -340,15 +346,21 @@ void free_subs_list(subs_t* s_array, int mem_type, int ic) s_array= s_array->next; if(mem_type & PKG_MEM_TYPE) { - if(ic) + if(ic) { pkg_free(s->contact.s); + s->contact.s = NULL; + } pkg_free(s); + s = NULL; } else { - if(ic) + if(ic) { shm_free(s->contact.s); + s->contact.s = NULL; + } shm_free(s); + s = NULL; } } diff --git a/modules/presence/notify.c b/modules/presence/notify.c index 7e7b0b25e2d..b9d948bf366 100644 --- a/modules/presence/notify.c +++ b/modules/presence/notify.c @@ -583,8 +583,9 @@ str* build_empty_bla_body(str pres_uri) str* get_p_notify_body(str pres_uri, pres_ev_t* event, str* etag, str* contact) { - db_key_t query_cols[3]; - db_val_t query_vals[3]; + db_key_t query_cols[4]; + db_val_t query_vals[4]; + db_op_t query_ops[4]; db_key_t result_cols[3]; db1_res_t *result = NULL; int body_col, etag_col= 0, sender_col; @@ -634,18 +635,28 @@ str* get_p_notify_body(str pres_uri, pres_ev_t* event, str* etag, query_vals[n_query_cols].type = DB1_STR; query_vals[n_query_cols].nul = 0; query_vals[n_query_cols].val.str_val = uri.host; + query_ops[n_query_cols] = OP_EQ; n_query_cols++; query_cols[n_query_cols] = &str_username_col; query_vals[n_query_cols].type = DB1_STR; query_vals[n_query_cols].nul = 0; query_vals[n_query_cols].val.str_val = uri.user; + query_ops[n_query_cols] = OP_EQ; n_query_cols++; query_cols[n_query_cols] = &str_event_col; query_vals[n_query_cols].type = DB1_STR; query_vals[n_query_cols].nul = 0; query_vals[n_query_cols].val.str_val= event->name; + query_ops[n_query_cols] = OP_EQ; + n_query_cols++; + + query_cols[n_query_cols] = &str_expires_col; + query_vals[n_query_cols].type = DB1_INT; + query_vals[n_query_cols].nul = 0; + query_vals[n_query_cols].val.int_val= (int)time(NULL); + query_ops[n_query_cols] = OP_GT; n_query_cols++; result_cols[body_col=n_result_cols++] = &str_body_col; @@ -659,11 +670,11 @@ str* get_p_notify_body(str pres_uri, pres_ev_t* event, str* etag, } if(pres_retrieve_order==1) { - query_str = str_priority_col; + query_str = pres_retrieve_order_by; } else { query_str = str_received_time_col; } - if (pa_dbf.query (pa_db, query_cols, 0, query_vals, + if (pa_dbf.query (pa_db, query_cols, query_ops, query_vals, result_cols, n_query_cols, n_result_cols, &query_str , &result) < 0) { LM_ERR("failed to query %.*s table\n", presentity_table.len, presentity_table.s); @@ -2126,7 +2137,7 @@ int add_waiting_watchers(watcher_t *watchers, str pres_uri, str event) #define EXTRACT_STRING(strng, chars)\ do {\ strng.s = (char *) chars;\ - strng.len = strlen(strng.s);\ + strng.len = strng.s == NULL ? 0 : strlen(strng.s);\ } while(0); static int unset_watchers_updated_winfo(str *pres_uri) diff --git a/modules/presence/presence.c b/modules/presence/presence.c index 1847c72380a..0b50e728efe 100644 --- a/modules/presence/presence.c +++ b/modules/presence/presence.c @@ -157,6 +157,7 @@ int pres_notifier_poll_rate = 10; int pres_notifier_processes = 1; str pres_xavp_cfg = {0}; int pres_retrieve_order = 0; +str pres_retrieve_order_by = str_init("priority"); int db_table_lock_type = 1; db_locking_t db_table_lock = DB_LOCKING_WRITE; @@ -218,6 +219,7 @@ static param_export_t params[]={ { "subs_remove_match", PARAM_INT, &pres_subs_remove_match}, { "xavp_cfg", PARAM_STR, &pres_xavp_cfg}, { "retrieve_order", PARAM_INT, &pres_retrieve_order}, + { "retrieve_order_by", PARAM_STR, &pres_retrieve_order_by}, { "sip_uri_match", PARAM_INT, &pres_uri_match}, {0,0,0} }; diff --git a/modules/presence/presence.h b/modules/presence/presence.h index cee3052822b..bd76a1389cf 100644 --- a/modules/presence/presence.h +++ b/modules/presence/presence.h @@ -90,6 +90,7 @@ extern int pres_notifier_poll_rate; extern int pres_notifier_processes; extern str pres_xavp_cfg; extern int pres_retrieve_order; +extern str pres_retrieve_order_by; extern int phtable_size; extern phtable_t* pres_htable; diff --git a/modules/presence/presentity.c b/modules/presence/presentity.c index 1c385b53e0a..3f79cfa4ef9 100644 --- a/modules/presence/presentity.c +++ b/modules/presence/presentity.c @@ -13,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -22,7 +22,7 @@ /*! * \file * \brief Kamailio presence module :: Presentity handling - * \ingroup presence + * \ingroup presence */ @@ -39,7 +39,7 @@ #include "../../str.h" #include "../../data_lump_rpl.h" #include "presentity.h" -#include "presence.h" +#include "presence.h" #include "notify.h" #include "publish.h" #include "hash.h" @@ -101,9 +101,9 @@ int publ_send200ok(struct sip_msg *msg, int lexpire, str etag) if (msg == NULL) return 0; - LM_DBG("send 200OK reply\n"); + LM_DBG("send 200OK reply\n"); LM_DBG("etag= %s - len= %d\n", etag.s, etag.len); - + hdr_append.s = buf; hdr_append.s[0]='\0'; hdr_append.len = snprintf(hdr_append.s, buf_len, "Expires: %d\r\n", @@ -119,7 +119,7 @@ int publ_send200ok(struct sip_msg *msg, int lexpire, str etag) goto error; } hdr_append.s[hdr_append.len]= '\0'; - + if (add_lump_rpl( msg, hdr_append.s, hdr_append.len, LUMP_RPL_HDR)==0 ) { LM_ERR("unable to add lump_rl\n"); @@ -192,17 +192,17 @@ unsigned int pres_get_priority(void) /** * create new presentity record */ -presentity_t* new_presentity( str* domain,str* user,int expires, +presentity_t* new_presentity( str* domain,str* user,int expires, pres_ev_t* event, str* etag, str* sender) { presentity_t *presentity= NULL; int size, init_len; - + /* allocating memory for presentity */ size = sizeof(presentity_t)+ domain->len+ user->len+ etag->len +1; if(sender) size+= sizeof(str)+ sender->len* sizeof(char); - + init_len= size; presentity = (presentity_t*)pkg_malloc(size); @@ -216,8 +216,8 @@ presentity_t* new_presentity( str* domain,str* user,int expires, presentity->domain.s = (char*)presentity+ size; strncpy(presentity->domain.s, domain->s, domain->len); presentity->domain.len = domain->len; - size+= domain->len; - + size+= domain->len; + presentity->user.s = (char*)presentity+size; strncpy(presentity->user.s, user->s, user->len); presentity->user.len = user->len; @@ -229,7 +229,7 @@ presentity_t* new_presentity( str* domain,str* user,int expires, presentity->etag.len = etag->len; size+= etag->len+1; - + if(sender) { presentity->sender= (str*)((char*)presentity+ size); @@ -250,7 +250,7 @@ presentity_t* new_presentity( str* domain,str* user,int expires, presentity->received_time= (int)time(NULL); presentity->priority = pres_get_priority(); return presentity; - + error: if(presentity) pkg_free(presentity); @@ -268,10 +268,14 @@ xmlNodePtr xmlNodeGetChildByName(xmlNodePtr node, const char *name) return NULL; } -int check_if_dialog(str body, int *is_dialog) +int check_if_dialog(str body, int *is_dialog, char **dialog_id) { xmlDocPtr doc; xmlNodePtr node; + char *tmp_dialog_id; + + *dialog_id = NULL; + *is_dialog = 0; doc = xmlParseMemory(body.s, body.len); if(doc== NULL) @@ -283,15 +287,267 @@ int check_if_dialog(str body, int *is_dialog) node = doc->children; node = xmlNodeGetChildByName(node, "dialog"); - if(node == NULL) - *is_dialog = 0; - else + if(node != NULL) + { + *is_dialog = 1; + tmp_dialog_id = (char *)xmlGetProp(node, (xmlChar *)"id"); + + if (tmp_dialog_id != NULL) + { + *dialog_id = strdup(tmp_dialog_id); + xmlFree(tmp_dialog_id); + } + } + + xmlFreeDoc(doc); + return 0; +} + +int parse_dialog_state_from_body(str body, int *is_dialog, char **state) +{ + xmlDocPtr doc; + xmlNodePtr node; + xmlNodePtr childNode; + char *tmp_state; + + *state = NULL; + *is_dialog = 0; + + doc = xmlParseMemory(body.s, body.len); + if(doc== NULL) + { + LM_ERR("failed to parse xml document\n"); + return -1; + } + + node = doc->children; + node = xmlNodeGetChildByName(node, "dialog"); + + if(node != NULL) + { *is_dialog = 1; + childNode = xmlNodeGetChildByName(node, "state"); + tmp_state = (char *)xmlNodeGetContent(childNode); + + if (tmp_state != NULL) + { + *state = strdup(tmp_state); + xmlFree(tmp_state); + } + } + xmlFreeDoc(doc); return 0; } +int delete_presentity_if_dialog_id_exists(presentity_t* presentity, char* dialog_id) { + db_key_t query_cols[13], result_cols[6]; + db_op_t query_ops[13]; + db_val_t query_vals[13]; + int n_query_cols = 0; + int rez_body_col = 0, rez_etag_col = 0, n_result_cols= 0; + db1_res_t *result = NULL; + db_row_t *row = NULL; + db_val_t *row_vals = NULL; + char* db_dialog_id = NULL; + int db_is_dialog = 0; + str tmp_db_body, tmp_db_etag; + int i = 0; + presentity_t old_presentity; + + query_cols[n_query_cols] = &str_domain_col; + query_ops[n_query_cols] = OP_EQ; + query_vals[n_query_cols].type = DB1_STR; + query_vals[n_query_cols].nul = 0; + query_vals[n_query_cols].val.str_val = presentity->domain; + n_query_cols++; + + query_cols[n_query_cols] = &str_username_col; + query_ops[n_query_cols] = OP_EQ; + query_vals[n_query_cols].type = DB1_STR; + query_vals[n_query_cols].nul = 0; + query_vals[n_query_cols].val.str_val = presentity->user; + n_query_cols++; + + query_cols[n_query_cols] = &str_event_col; + query_ops[n_query_cols] = OP_EQ; + query_vals[n_query_cols].type = DB1_STR; + query_vals[n_query_cols].nul = 0; + query_vals[n_query_cols].val.str_val = presentity->event->name; + n_query_cols++; + + result_cols[rez_body_col=n_result_cols++] = &str_body_col; + result_cols[rez_etag_col=n_result_cols++] = &str_etag_col; + + if (pa_dbf.use_table(pa_db, &presentity_table) < 0) + { + LM_ERR("unsuccessful sql use table\n"); + return -1; + } + + if (pa_dbf.query (pa_db, query_cols, query_ops, query_vals, + result_cols, n_query_cols, n_result_cols, 0, &result) < 0) + { + LM_ERR("unsuccessful sql query\n"); + return -2; + } + + if(result == NULL) + return -3; + + /* no results from query definitely means no dialog exists */ + if (result->n <= 0) { + pa_dbf.free_result(pa_db, result); + return 0; + } + + // Loop the rows returned from the DB + for (i=0; i < result->n; i++) + { + row = &result->rows[i]; + row_vals = ROW_VALUES(row); + tmp_db_body.s = (char*)row_vals[rez_body_col].val.string_val; + tmp_db_body.len = strlen(tmp_db_body.s); + + tmp_db_etag.s = (char*)row_vals[rez_etag_col].val.string_val; + tmp_db_etag.len = strlen(tmp_db_etag.s); + + if (check_if_dialog(tmp_db_body, &db_is_dialog, &db_dialog_id) == 0) + { + // If ID from DB matches the one we supplied + if (db_dialog_id && !strcmp(db_dialog_id, dialog_id)) + { + old_presentity.domain = presentity->domain; + old_presentity.user = presentity->user; + old_presentity.event = presentity->event; + old_presentity.etag = tmp_db_etag; + + LM_WARN("Presentity already exists - deleting it\n"); + + delete_presentity(&old_presentity); + + pa_dbf.free_result(pa_db, result); + result = NULL; + free(db_dialog_id); + db_dialog_id = NULL; + + return 1; + } + + free(db_dialog_id); + db_dialog_id = NULL; + } + } + + pa_dbf.free_result(pa_db, result); + result = NULL; + return 0; +} + +int get_dialog_state(presentity_t* presentity, char** state) +{ + db_key_t query_cols[13], result_cols[6]; + db_op_t query_ops[13]; + db_val_t query_vals[13]; + int n_query_cols = 0; + int rez_body_col = 0, n_result_cols= 0; + db1_res_t *result = NULL; + db_row_t *row = NULL; + db_val_t *row_vals = NULL; + int db_is_dialog = 0; + str tmp_db_body; + int i = 0, parse_state_result = 0; + + *state = NULL; + + query_cols[n_query_cols] = &str_domain_col; + query_ops[n_query_cols] = OP_EQ; + query_vals[n_query_cols].type = DB1_STR; + query_vals[n_query_cols].nul = 0; + query_vals[n_query_cols].val.str_val = presentity->domain; + n_query_cols++; + + query_cols[n_query_cols] = &str_username_col; + query_ops[n_query_cols] = OP_EQ; + query_vals[n_query_cols].type = DB1_STR; + query_vals[n_query_cols].nul = 0; + query_vals[n_query_cols].val.str_val = presentity->user; + n_query_cols++; + + query_cols[n_query_cols] = &str_event_col; + query_ops[n_query_cols] = OP_EQ; + query_vals[n_query_cols].type = DB1_STR; + query_vals[n_query_cols].nul = 0; + query_vals[n_query_cols].val.str_val = presentity->event->name; + n_query_cols++; + + query_cols[n_query_cols] = &str_etag_col; + query_ops[n_query_cols] = OP_EQ; + query_vals[n_query_cols].type = DB1_STR; + query_vals[n_query_cols].nul = 0; + query_vals[n_query_cols].val.str_val = presentity->etag; + n_query_cols++; + + result_cols[rez_body_col=n_result_cols++] = &str_body_col; + + if (pa_dbf.use_table(pa_db, &presentity_table) < 0) + { + LM_ERR("unsuccessful sql use table\n"); + return -1; + } + + if (pa_dbf.query (pa_db, query_cols, query_ops, query_vals, + result_cols, n_query_cols, n_result_cols, 0, &result) < 0) + { + LM_ERR("unsuccessful sql query\n"); + return -2; + } + + if(result == NULL) + return -3; + + /* no results from query definitely means no dialog exists */ + if (result->n <= 0) { + pa_dbf.free_result(pa_db, result); + return 0; + } + + // Loop the rows returned from the DB + for (i=0; i < result->n; i++) + { + row = &result->rows[i]; + row_vals = ROW_VALUES(row); + tmp_db_body.s = (char*)row_vals[rez_body_col].val.string_val; + tmp_db_body.len = strlen(tmp_db_body.s); + + parse_state_result = parse_dialog_state_from_body(tmp_db_body, + &db_is_dialog, state); + + pa_dbf.free_result(pa_db, result); + result = NULL; + + return parse_state_result; + } + + pa_dbf.free_result(pa_db, result); + result = NULL; + return 0; +} + +int is_dialog_terminated(presentity_t* presentity) +{ + char *state = NULL; + int rtn; + + get_dialog_state(presentity, &state); + + rtn = state && !strcasecmp(state, "terminated"); + + free(state); + + return rtn; +} int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, int new_t, int* sent_reply, char* sphere) @@ -316,6 +572,7 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, int ret = -1; int db_record_exists = 0; int num_watchers = 0; + char *old_dialog_id = NULL, *dialog_id = NULL; if (sent_reply) *sent_reply= 0; if(pres_notifier_processes == 0 && presentity->event->req_auth) @@ -328,7 +585,7 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, goto error; } } - + if(uandd_to_uri(presentity->user, presentity->domain, &pres_uri)< 0) { LM_ERR("constructing uri from user and domain\n"); @@ -342,7 +599,7 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, query_vals[n_query_cols].nul = 0; query_vals[n_query_cols].val.str_val = presentity->domain; n_query_cols++; - + query_cols[n_query_cols] = &str_username_col; query_ops[n_query_cols] = OP_EQ; query_vals[n_query_cols].type = DB1_STR; @@ -367,7 +624,7 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, result_cols[rez_body_col= n_result_cols++] = &str_body_col; result_cols[rez_sender_col= n_result_cols++] = &str_sender_col; - if(new_t) + if(new_t) { /* insert new record in hash_table */ @@ -377,8 +634,8 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, LM_ERR("inserting record in hash table\n"); goto error; } - - /* insert new record into database */ + + /* insert new record into database */ query_cols[n_query_cols] = &str_sender_col; query_vals[n_query_cols].type = DB1_STR; query_vals[n_query_cols].nul = 0; @@ -397,7 +654,7 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, query_vals[n_query_cols].nul = 0; query_vals[n_query_cols].val.str_val = *body; n_query_cols++; - + query_cols[n_query_cols] = &str_received_time_col; query_vals[n_query_cols].type = DB1_INT; query_vals[n_query_cols].nul = 0; @@ -409,7 +666,7 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, query_vals[n_query_cols].nul = 0; query_vals[n_query_cols].val.int_val = presentity->priority; n_query_cols++; - + if (presentity->expires != -1) { /* A real PUBLISH */ @@ -419,8 +676,8 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, query_vals[n_query_cols].val.int_val = presentity->expires+ (int)time(NULL); n_query_cols++; - - if (pa_dbf.use_table(pa_db, &presentity_table) < 0) + + if (pa_dbf.use_table(pa_db, &presentity_table) < 0) { LM_ERR("unsuccessful use_table\n"); goto error; @@ -435,9 +692,20 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, } } + check_if_dialog(*body, &is_dialog, &dialog_id); + if ( dialog_id ) { + if (delete_presentity_if_dialog_id_exists(presentity, dialog_id) < 0) { + free(dialog_id); + dialog_id = NULL; + goto error; + } + + free(dialog_id); + dialog_id = NULL; + } LM_DBG("inserting %d cols into table\n",n_query_cols); - - if (pa_dbf.insert(pa_db, query_cols, query_vals, n_query_cols) < 0) + + if (pa_dbf.insert(pa_db, query_cols, query_vals, n_query_cols) < 0) { LM_ERR("inserting new record in database\n"); goto error; @@ -451,8 +719,8 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, query_vals[n_query_cols].nul = 0; query_vals[n_query_cols].val.int_val = -1; n_query_cols++; - - if (pa_dbf.use_table(pa_db, &presentity_table) < 0) + + if (pa_dbf.use_table(pa_db, &presentity_table) < 0) { LM_ERR("unsuccessful use_table\n"); goto error; @@ -474,7 +742,7 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, } - if (pa_dbf.replace(pa_db, query_cols, query_vals, n_query_cols, 4, 0) < 0) + if (pa_dbf.replace(pa_db, query_cols, query_vals, n_query_cols, 4, 0) < 0) { LM_ERR("replacing record in database\n"); goto error; @@ -490,9 +758,9 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, goto send_notify; } else - { + { - if (pa_dbf.use_table(pa_db, &presentity_table) < 0) + if (pa_dbf.use_table(pa_db, &presentity_table) < 0) { LM_ERR("unsuccessful sql use table\n"); goto error; @@ -511,7 +779,7 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, { if (pa_dbf.query (pa_db, query_cols, query_ops, query_vals, - result_cols, n_query_cols, n_result_cols, 0, &result) < 0) + result_cols, n_query_cols, n_result_cols, 0, &result) < 0) { LM_ERR("unsuccessful sql query\n"); goto error; @@ -521,7 +789,7 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, if (!(result->n > 0)) goto send_412; - + db_record_exists= 1; /* analize if previous body has a dialog */ row = &result->rows[0]; @@ -529,23 +797,46 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, old_body.s = (char*)row_vals[rez_body_col].val.string_val; old_body.len = strlen(old_body.s); - if(check_if_dialog(*body, &is_dialog)< 0) + if(check_if_dialog(*body, &is_dialog, &dialog_id)< 0) { LM_ERR("failed to check if dialog stored\n"); + if(dialog_id) { + free(dialog_id); + dialog_id = NULL; + } goto error; } - if(is_dialog== 1) /* if the new body has a dialog - overwrite */ + free(dialog_id); + + if(is_dialog== 1) /* if the new body has a dialog - overwrite */ + { goto after_dialog_check; + } - if(check_if_dialog(old_body, &is_dialog)< 0) + if(check_if_dialog(old_body, &is_dialog, &old_dialog_id)< 0) { LM_ERR("failed to check if dialog stored\n"); + if(old_dialog_id) { + free(old_dialog_id); + old_dialog_id = NULL; + } goto error; } - if(is_dialog==0 ) /* if the old body has no dialog - overwrite */ + /* if the old body has no dialog - overwrite */ + if(is_dialog==0 ) { + if(old_dialog_id) { + free(old_dialog_id); + old_dialog_id = NULL; + } goto after_dialog_check; + } + + if(old_dialog_id) { + free(old_dialog_id); + old_dialog_id = NULL; + } sender.s = (char*)row_vals[rez_sender_col].val.string_val; sender.len= strlen(sender.s); @@ -553,23 +844,23 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, LM_DBG("old_sender = %.*s\n", sender.len, sender.s ); if(presentity->sender) { - if(!(presentity->sender->len == sender.len && - presence_sip_uri_match(presentity->sender, &sender)== 0)) - bla_update_publish= 0; + if(!(presentity->sender->len == sender.len && + presence_sip_uri_match(presentity->sender, &sender)== 0)) + bla_update_publish= 0; } after_dialog_check: pa_dbf.free_result(pa_db, result); result = NULL; - + } - if(presentity->expires <= 0) + if(presentity->expires <= 0) { if (!db_record_exists) { if (pa_dbf.query (pa_db, query_cols, query_ops, query_vals, - result_cols, n_query_cols, n_result_cols, 0, &result) < 0) + result_cols, n_query_cols, n_result_cols, 0, &result) < 0) { LM_ERR("unsuccessful sql query\n"); goto error; @@ -658,7 +949,7 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, } if(presentity->event->etag_not_new== 0) - { + { /* generate another etag */ unsigned int publ_nr; str str_publ_nr= {0, 0}; @@ -673,7 +964,7 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, { LM_ERR("wrong etag\n"); goto error; - } + } str_publ_nr.s= dot+1; str_publ_nr.len--; @@ -689,7 +980,7 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, goto error; } etag.len=(strlen(etag.s)); - + cur_etag= etag; update_keys[n_update_cols] = &str_etag_col; @@ -701,7 +992,28 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, } else cur_etag= presentity->etag; - + + if (presentity->event->evp->type==EVENT_DIALOG) { + if(is_dialog_terminated(presentity)) + { + LM_WARN("Trying to update an already terminated state." + " Skipping update.\n"); + + /* send 200OK */ + if (publ_send200ok(msg, presentity->expires, cur_etag)< 0) { + LM_ERR("sending 200OK reply\n"); + goto error; + } + if (sent_reply) *sent_reply= 1; + + if(etag.s) + pkg_free(etag.s); + etag.s= NULL; + + goto done; + } + } + update_keys[n_update_cols] = &str_expires_col; update_vals[n_update_cols].type = DB1_INT; update_vals[n_update_cols].nul = 0; @@ -730,7 +1042,7 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, n_update_cols++; /* updated stored sphere */ - if(sphere_enable && + if(sphere_enable && presentity->event->evp->type== EVENT_PRESENCE) { if( publ_cache_enabled && @@ -741,8 +1053,7 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, } } } - - + if( presentity->sender) { update_keys[n_update_cols] = &str_sender_col; @@ -756,14 +1067,14 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, if (!pa_dbf.affected_rows && !db_record_exists) { if (pa_dbf.query (pa_db, query_cols, query_ops, query_vals, - result_cols, n_query_cols, n_result_cols, 0, &result) < 0) + result_cols, n_query_cols, n_result_cols, 0, &result) < 0) { LM_ERR("unsuccessful sql query\n"); goto error; } if(result== NULL) goto error; - + if (!(result->n > 0)) goto send_412; @@ -773,7 +1084,7 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, } if( pa_dbf.update( pa_db,query_cols, query_ops, query_vals, - update_keys, update_vals, n_query_cols, n_update_cols )<0) + update_keys, update_vals, n_query_cols, n_update_cols )<0) { LM_ERR("updating published info in database\n"); goto error; @@ -871,21 +1182,19 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, pa_dbf.free_result(pa_db, result); if(etag.s) pkg_free(etag.s); - if(rules_doc) - { + if(rules_doc) { if(rules_doc->s) pkg_free(rules_doc->s); pkg_free(rules_doc); } - if(pres_uri.s) + if(pres_uri.s) { pkg_free(pres_uri.s); + pres_uri.s = NULL; + } - if (pa_dbf.abort_transaction) - { - if (pa_dbf.abort_transaction(pa_db) < 0) - { + if (pa_dbf.abort_transaction) { + if (pa_dbf.abort_transaction(pa_db) < 0) { LM_ERR("in abort_transaction\n"); - goto error; } } @@ -894,7 +1203,7 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, int pres_htable_restore(void) { - /* query all records from presentity table and insert records + /* query all records from presentity table and insert records * in presentity table */ db_key_t result_cols[6]; db1_res_t *result= NULL; @@ -944,9 +1253,6 @@ int pres_htable_restore(void) row = &result->rows[i]; row_vals = ROW_VALUES(row); - if(row_vals[expires_col].val.int_val< (int)time(NULL)) - continue; - sphere= NULL; user.s= (char*)row_vals[user_col].val.string_val; user.len= strlen(user.s); @@ -970,7 +1276,7 @@ int pres_htable_restore(void) goto error; } /* insert in hash_table*/ - + if(sphere_enable && event== EVENT_PRESENCE ) { body.s= (char*)row_vals[body_col].val.string_val; @@ -1000,7 +1306,7 @@ int pres_htable_restore(void) error: if(result) pa_dbf.free_result(pa_db, result); - return -1; + return -1; } char* extract_sphere(str body) @@ -1010,7 +1316,7 @@ char* extract_sphere(str body) xmlDocPtr doc= NULL; xmlNodePtr node; char* cont, *sphere= NULL; - + doc= xmlParseMemory(body.s, body.len); if(doc== NULL) @@ -1020,7 +1326,7 @@ char* extract_sphere(str body) } node= xmlNodeGetNodeByName(doc->children, "sphere", "rpid"); - + if(node== NULL) node= xmlNodeGetNodeByName(doc->children, "sphere", "r"); @@ -1144,27 +1450,27 @@ char* get_sphere(str* pres_uri) n_query_cols++; result_cols[n_result_cols++] = &str_body_col; - - if (pa_dbf.use_table(pa_db, &presentity_table) < 0) + + if (pa_dbf.use_table(pa_db, &presentity_table) < 0) { LM_ERR("in use_table\n"); return NULL; } if(pres_retrieve_order==1) { - query_str = str_priority_col; + query_str = pres_retrieve_order_by; } else { query_str = str_received_time_col; } if (pa_dbf.query (pa_db, query_cols, 0, query_vals, - result_cols, n_query_cols, n_result_cols, &query_str , &result) < 0) + result_cols, n_query_cols, n_result_cols, &query_str , &result) < 0) { LM_ERR("failed to query %.*s table\n", presentity_table.len, presentity_table.s); if(result) pa_dbf.free_result(pa_db, result); return NULL; } - + if(result== NULL) return NULL; @@ -1190,7 +1496,7 @@ char* get_sphere(str* pres_uri) LM_ERR("Empty notify body record\n"); goto error; } - + sphere= extract_sphere(body); pa_dbf.free_result(pa_db, result); @@ -1290,7 +1596,7 @@ int mark_presentity_for_delete(presentity_t *pres) if (RES_ROW_N(result) > 1) { /* More that one is prevented by DB constraint - but handle - it anyway */ + * it anyway */ LM_ERR("Found %d presentities - expected 1\n", RES_ROW_N(result)); if (delete_presentity(pres) < 0) @@ -1300,7 +1606,7 @@ int mark_presentity_for_delete(presentity_t *pres) } /* Want the calling function to continue properly so do not - return an error */ + * return an error */ goto done; } @@ -1341,7 +1647,7 @@ int mark_presentity_for_delete(presentity_t *pres) n_update_cols++; if (pa_dbf.update(pa_db, query_cols, 0, query_vals, update_cols, - update_vals, n_query_cols, n_update_cols) < 0) + update_vals, n_query_cols, n_update_cols) < 0) { LM_ERR("unsuccessful sql update operation"); goto error; diff --git a/modules/presence/subscribe.c b/modules/presence/subscribe.c index f3a53c90043..5ef17854def 100644 --- a/modules/presence/subscribe.c +++ b/modules/presence/subscribe.c @@ -56,8 +56,8 @@ static str pu_500_rpl = str_init("Server Internal Error"); static str pu_489_rpl = str_init("Bad Event"); static str pu_423_rpl = str_init("Interval Too Brief"); -int send_2XX_reply(struct sip_msg * msg, int reply_code, int lexpire, - str* local_contact) +static int send_2XX_reply(sip_msg_t *msg, int reply_code, + unsigned int lexpire, str *local_contact) { str hdr_append = {0, 0}; str tmp; @@ -1335,7 +1335,7 @@ int handle_subscribe(struct sip_msg* msg, str watcher_user, str watcher_domain) } -int extract_sdialog_info_ex(subs_t* subs,struct sip_msg* msg, uint32_t miexp, +int extract_sdialog_info_ex(subs_t* subs, struct sip_msg* msg, uint32_t miexp, uint32_t mexp, int* to_tag_gen, str scontact, str watcher_user, str watcher_domain, int* reply_code, str* reply_str) @@ -1349,20 +1349,15 @@ int extract_sdialog_info_ex(subs_t* subs,struct sip_msg* msg, uint32_t miexp, struct sip_uri uri; /* examine the expire header field */ - if(msg->expires && msg->expires->body.len > 0) - { - if (!msg->expires->parsed && (parse_expires(msg->expires) < 0)) - { + if(msg->expires && msg->expires->body.len > 0) { + if (!msg->expires->parsed && (parse_expires(msg->expires) < 0)) { LM_ERR("cannot parse Expires header\n"); goto error; } lexpire = ((exp_body_t*)msg->expires->parsed)->val; - LM_DBG("'Expires' header found, value= %d\n", lexpire); - - } - else - { - LM_DBG("'expires' not found; default=%d\n",subs->event->default_expires); + LM_DBG("'Expires' header found, value= %u\n", lexpire); + } else { + LM_DBG("'expires' not found; default=%u\n",subs->event->default_expires); lexpire = subs->event->default_expires; } if(lexpire > mexp) @@ -1370,34 +1365,32 @@ int extract_sdialog_info_ex(subs_t* subs,struct sip_msg* msg, uint32_t miexp, if (lexpire && miexp && lexpire < miexp) { if(min_expires_action == 1) { - LM_DBG("subscription expiration invalid , requested=%d, minimum=%d, returning error \"423 Interval Too brief\"\n", lexpire, miexp); + LM_DBG("subscription expiration invalid , requested=%u, minimum=%u," + " returning error \"423 Interval Too brief\"\n", + lexpire, miexp); *reply_code = INTERVAL_TOO_BRIEF; *reply_str = pu_423_rpl; goto error; } else { - LM_DBG("subscription expiration set to minimum (%d) for requested (%d)\n", lexpire, miexp); + LM_DBG("subscription expiration set to minimum (%u) for requested" + " (%u)\n", lexpire, miexp); lexpire = miexp; } } subs->expires = lexpire; - if( msg->to==NULL || msg->to->body.s==NULL) - { + if( msg->to==NULL || msg->to->body.s==NULL) { LM_ERR("cannot parse TO header\n"); goto error; } /* examine the to header */ - if(msg->to->parsed != NULL) - { + if(msg->to->parsed != NULL) { pto = (struct to_body*)msg->to->parsed; LM_DBG("'To' header ALREADY PARSED: <%.*s>\n",pto->uri.len,pto->uri.s); - } - else - { + } else { parse_to(msg->to->body.s,msg->to->body.s + msg->to->body.len + 1, &TO); - if( TO.uri.len <= 0 ) - { + if( TO.uri.len <= 0 ) { LM_DBG("'To' header NOT parsed\n"); goto error; } @@ -1405,15 +1398,11 @@ int extract_sdialog_info_ex(subs_t* subs,struct sip_msg* msg, uint32_t miexp, } if( pto->parsed_uri.user.s && pto->parsed_uri.host.s && - pto->parsed_uri.user.len && pto->parsed_uri.host.len) - { + pto->parsed_uri.user.len && pto->parsed_uri.host.len) { subs->to_user = pto->parsed_uri.user; subs->to_domain = pto->parsed_uri.host; - } - else - { - if(parse_uri(pto->uri.s, pto->uri.len, &uri)< 0) - { + } else { + if(parse_uri(pto->uri.s, pto->uri.len, &uri)< 0) { LM_ERR("while parsing uri\n"); goto error; } @@ -1422,13 +1411,11 @@ int extract_sdialog_info_ex(subs_t* subs,struct sip_msg* msg, uint32_t miexp, } /* examine the from header */ - if (!msg->from || !msg->from->body.s) - { + if (!msg->from || !msg->from->body.s) { LM_DBG("cannot find 'from' header!\n"); goto error; } - if (msg->from->parsed == NULL) - { + if (msg->from->parsed == NULL) { LM_DBG("'From' header not parsed\n"); /* parsing from header */ if ( parse_from_header( msg )<0 ) @@ -1440,15 +1427,11 @@ int extract_sdialog_info_ex(subs_t* subs,struct sip_msg* msg, uint32_t miexp, pfrom = (struct to_body*)msg->from->parsed; if( pfrom->parsed_uri.user.s && pfrom->parsed_uri.host.s && - pfrom->parsed_uri.user.len && pfrom->parsed_uri.host.len) - { + pfrom->parsed_uri.user.len && pfrom->parsed_uri.host.len) { subs->from_user = pfrom->parsed_uri.user; subs->from_domain = pfrom->parsed_uri.host; - } - else - { - if(parse_uri(pfrom->uri.s, pfrom->uri.len, &uri)< 0) - { + } else { + if(parse_uri(pfrom->uri.s, pfrom->uri.len, &uri)< 0) { LM_ERR("while parsing uri\n"); goto error; } @@ -1460,61 +1443,50 @@ int extract_sdialog_info_ex(subs_t* subs,struct sip_msg* msg, uint32_t miexp, subs->watcher_domain = watcher_domain; /* get to_tag if the message does not have a to_tag*/ - if (pto->tag_value.s==NULL || pto->tag_value.len==0 ) - { + if (pto->tag_value.s==NULL || pto->tag_value.len==0 ) { LM_DBG("generating to_tag\n"); *to_tag_gen = 1; rtag_value.len = 0; - if(slb.get_reply_totag(msg, &rtag_value)<0 || rtag_value.len <= 0) - { + if(slb.get_reply_totag(msg, &rtag_value)<0 || rtag_value.len <= 0) { LM_ERR("while creating to_tag\n"); goto error; } - } - else - { + } else { *to_tag_gen = 0; rtag_value=pto->tag_value; } subs->to_tag = rtag_value; - if( msg->callid==NULL || msg->callid->body.s==NULL) - { + if( msg->callid==NULL || msg->callid->body.s==NULL) { LM_ERR("cannot parse callid header\n"); goto error; } subs->callid = msg->callid->body; - if( msg->cseq==NULL || msg->cseq->body.s==NULL) - { + if( msg->cseq==NULL || msg->cseq->body.s==NULL) { LM_ERR("cannot parse cseq header\n"); goto error; } - if (str2int( &(get_cseq(msg)->number), &subs->remote_cseq)!=0 ) - { + if (str2int( &(get_cseq(msg)->number), &subs->remote_cseq)!=0 ) { LM_ERR("cannot parse cseq number\n"); goto error; } - if( msg->contact==NULL || msg->contact->body.s==NULL) - { + if( msg->contact==NULL || msg->contact->body.s==NULL) { LM_ERR("cannot parse contact header\n"); goto error; } - if( parse_contact(msg->contact) <0 ) - { + if( parse_contact(msg->contact) <0 ) { LM_ERR(" cannot parse contact" " header\n"); goto error; } b= (contact_body_t* )msg->contact->parsed; - if(b == NULL) - { + if(b == NULL) { LM_ERR("cannot parse contact header\n"); goto error; } - if(b->star || b->contacts==NULL) - { + if(b->star || b->contacts==NULL) { LM_ERR("Wrong contact header\n"); goto error; } @@ -1524,29 +1496,24 @@ int extract_sdialog_info_ex(subs_t* subs,struct sip_msg* msg, uint32_t miexp, LM_DBG("subs->contact= %.*s - len = %d\n",subs->contact.len, subs->contact.s, subs->contact.len); - if (EVENT_DIALOG_SLA(subs->event->evp)) - { + if (EVENT_DIALOG_SLA(subs->event->evp)) { /* user_contact@from_domain */ - if(parse_uri(subs->contact.s, subs->contact.len, &uri)< 0) - { + if(parse_uri(subs->contact.s, subs->contact.len, &uri)< 0) { LM_ERR("failed to parse contact uri\n"); goto error; } - if(uandd_to_uri(uri.user, subs->from_domain, &subs->pres_uri)< 0) - { + if(uandd_to_uri(uri.user, subs->from_domain, &subs->pres_uri)< 0) { LM_ERR("failed to construct uri\n"); goto error; } - LM_DBG("&&&&&&&&&&&&&&& dialog pres_uri= %.*s\n", + LM_DBG("dialog pres_uri= %.*s\n", subs->pres_uri.len, subs->pres_uri.s); } /*process record route and add it to a string*/ - if(*to_tag_gen && msg->record_route!=NULL) - { + if(*to_tag_gen && msg->record_route!=NULL) { rt = print_rr_body(msg->record_route, &rec_route, 0, 0); - if(rt != 0) - { + if(rt != 0) { LM_ERR("processing the record route [%d]\n", rt); rec_route.s=NULL; rec_route.len=0; @@ -1557,8 +1524,7 @@ int extract_sdialog_info_ex(subs_t* subs,struct sip_msg* msg, uint32_t miexp, subs->sockinfo_str= msg->rcv.bind_address->sock_str; - if( pfrom->tag_value.s ==NULL || pfrom->tag_value.len == 0) - { + if( pfrom->tag_value.s ==NULL || pfrom->tag_value.len == 0) { LM_ERR("no from tag value present\n"); goto error; } @@ -1566,16 +1532,14 @@ int extract_sdialog_info_ex(subs_t* subs,struct sip_msg* msg, uint32_t miexp, subs->version = 1; - if((!scontact.s) || (scontact.len== 0)) - { - if(ps_fill_local_contact(msg, &subs->local_contact)<0) - { + if((!scontact.s) || (scontact.len== 0)) { + if(ps_fill_local_contact(msg, &subs->local_contact)<0) { LM_ERR("cannot get local contact address\n"); goto error; } - } - else + } else { subs->local_contact= scontact; + } if (parse_headers(msg, HDR_USERAGENT_F, 0) != -1 && msg->user_agent && msg->user_agent->body.len>0 && msg->user_agent->body.len<MAX_UA_SIZE) { diff --git a/modules/presence/utils_func.c b/modules/presence/utils_func.c index c56c6cb9505..15d48327d19 100644 --- a/modules/presence/utils_func.c +++ b/modules/presence/utils_func.c @@ -43,19 +43,6 @@ static const char base64digits[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -#define BAD -1 -static const char base64val[] = { -BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, -BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, -BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD, 62, BAD,BAD,BAD, 63, -52, 53, 54, 55, 56, 57, 58, 59, 60, 61,BAD,BAD, BAD,BAD,BAD,BAD, -BAD, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,BAD, BAD,BAD,BAD,BAD, -BAD, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, -41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,BAD, BAD,BAD,BAD,BAD -}; -#define DECODE64(c) (isascii(c) ? base64val[c] : BAD) - void to64frombits(unsigned char *out, const unsigned char *in, int inlen) { for (; inlen >= 3; inlen -= 3) diff --git a/modules/presence_conference/pidf.c b/modules/presence_conference/pidf.c index 7af6c8252f6..f33943f8113 100644 --- a/modules/presence_conference/pidf.c +++ b/modules/presence_conference/pidf.c @@ -34,23 +34,22 @@ /** * make strptime available * use 600 for 'Single UNIX Specification, Version 3' - * _XOPEN_SOURCE creates conflict in header definitions in Solaris */ -#ifndef __OS_solaris - #define _XOPEN_SOURCE 600 /* glibc2 on linux, bsd */ +#ifdef __OS_linux + #define _XOPEN_SOURCE 600 /* glibc2 on linux */ #define _BSD_SOURCE 1 /* needed on linux to "fix" the effect of the above define on features.h/unistd.h syscall() */ + #define _DEFAULT_SOURCE 1 /* _BSD_SOURCE is deprecated */ +#endif +#ifdef __OS_darwin #define _DARWIN_C_SOURCE 1 -#else - #define _XOPEN_SOURCE_EXTENDED 1 /* solaris */ #endif - +#ifdef __OS_solaris + #define _XOPEN_SOURCE_EXTENDED 1 +#endif #include <time.h> -#undef _XOPEN_SOURCE -#undef _XOPEN_SOURCE_EXTENDED - #include <string.h> #include <stdlib.h> #include <libxml/parser.h> diff --git a/modules/presence_dialoginfo/README b/modules/presence_dialoginfo/README index f62ebe33035..3db72e9ae03 100644 --- a/modules/presence_dialoginfo/README +++ b/modules/presence_dialoginfo/README @@ -38,12 +38,14 @@ Klaus Darilion 3. Parameters 3.1. force_single_dialog (int) + 3.2. force_dummy_dialog (int) 4. Functions List of Examples 1.1. Set parameter + 1.2. Set parameter Chapter 1. Admin Guide @@ -58,6 +60,7 @@ Chapter 1. Admin Guide 3. Parameters 3.1. force_single_dialog (int) + 3.2. force_dummy_dialog (int) 4. Functions @@ -189,6 +192,7 @@ alice@example server server bob@example watcher@example 3. Parameters 3.1. force_single_dialog (int) + 3.2. force_dummy_dialog (int) 3.1. force_single_dialog (int) @@ -212,6 +216,22 @@ alice@example server server bob@example watcher@example modparam("presence_dialoginfo", "force_single_dialog", 1) ... +3.2. force_dummy_dialog (int) + + By default the module returns null body if there are no bodies to + aggregate. some sip clients like Bria expect at least one dialog. you + can activate this parameter to send a dummy dialog. + + If this parameter is set and there are no dialog bodies to aggregate, + it will return a dummy dialog. + + Default value is “0”. + + Example 1.2. Set parameter +... +modparam("presence_dialoginfo", "force_dummy_dialog", 1) +... + 4. Functions None to be used in configuration file. diff --git a/modules/presence_dialoginfo/pidf.c b/modules/presence_dialoginfo/pidf.c index 23e6bd30ef0..51c845e5a6c 100644 --- a/modules/presence_dialoginfo/pidf.c +++ b/modules/presence_dialoginfo/pidf.c @@ -41,6 +41,7 @@ #define _BSD_SOURCE 1 /* needed on linux to "fix" the effect of the above define on features.h/unistd.h syscall() */ + #define _DEFAULT_SOURCE 1 /* _BSD_SOURCE is deprecated */ #elif defined __OS_solaris #define _XOPEN_SOURCE_EXTENDED 1 /* solaris */ #endif diff --git a/modules/presence_profile/README b/modules/presence_profile/README index 491fdcf32f7..c5f670e8ff7 100644 --- a/modules/presence_profile/README +++ b/modules/presence_profile/README @@ -1,12 +1,12 @@ Presence_Profile Module -Mihály Mészáros +Mihály Mészáros <misi@niif.hu> Edited by -Mészáros Mihály +Mészáros Mihály <misi@niif.hu> @@ -16,7 +16,7 @@ Alex Balashov <abalashov@evaristesys.com> - Copyright 2011 Mészáros Mihály + Copyright © 2011 Mészáros Mihály __________________________________________________________________ Table of Contents diff --git a/modules/presence_xml/README b/modules/presence_xml/README index 3844f034214..b5eaa361cfe 100644 --- a/modules/presence_xml/README +++ b/modules/presence_xml/README @@ -8,7 +8,7 @@ Edited by Anca-Maria Vamanu - Copyright 2007 Voice Sistem SRL + Copyright © 2007 Voice Sistem SRL __________________________________________________________________ Table of Contents @@ -148,7 +148,7 @@ Chapter 1. Admin Guide The database URL. - Default value is "mysql://kamailio:kamailiorw@localhost/kamailio". + Default value is “mysql://kamailio:kamailiorw@localhost/kamailio”. Example 1.1. Set db_url parameter ... @@ -159,7 +159,7 @@ modparam("presence_xml", "db_url", "dbdriver://username:password@dbhost/dbname") The name of the database table where XCAP documents are stored. - Default value is "xcap". + Default value is “xcap”. Example 1.2. Set xcap_table parameter ... @@ -170,7 +170,7 @@ modparam("presence_xml", "xcap_table", "xcaps") Set this parameter to disable the handling of the "presence" event. - Default value: "0". + Default value: “0”. Example 1.3. Set disable_presence parameter ... @@ -182,7 +182,7 @@ modparam("presence_xml", "disable_presence", 1) Set this parameter to disable the handling of the "presence.winfo" event. - Default value: "0". + Default value: “0”. Example 1.4. Set disable_winfo parameter ... @@ -193,7 +193,7 @@ modparam("presence_xml", "disable_winfo", 1) Set this parameter to disable the handling of the "dialog;sla" event. - Default value: "1" (0 - enabled, 1 - disabled). + Default value: “1” (0 - enabled, 1 - disabled). Example 1.5. Set disable_bla parameter ... @@ -213,7 +213,7 @@ modparam("presence_xml", "disable_bla", 1) Note: When switching from one value to another, the watchers table must be emptied. - Default value is "0". + Default value is “0”. Example 1.6. Set force_active parameter ... @@ -235,7 +235,7 @@ modparam("presence_xml", "force_active", 1) Otherwise, it uses xcap_client module to fetch documents from the XCAP servers with HTTP requests. - Default value is "0". + Default value is “0”. Example 1.7. Set integrated_xcap_server parameter ... @@ -261,7 +261,7 @@ modparam("presence_xml", "xcap_server", "xcap_server.ag.org") no connection to database. Useful when needing only to use $xml(...) pseudoc-variable. - Default value: "0" (0 - active mode, 1 - passive mode). + Default value: “0” (0 - active mode, 1 - passive mode). Example 1.9. Set passive_mode parameter ... @@ -278,7 +278,7 @@ modparam("presence_xml", "passive_mode", 1) ones defined by the RFC 3265, this parameter offers the possibility for the admin to decide which one he wishes to use. - Default value: "probation" . Since probation also accepts a retry-after + Default value: “probation” . Since probation also accepts a retry-after parameter to specify after at least how may seconds the client should reattempt to resubscribe, you can include this in the parameter also. @@ -293,7 +293,7 @@ modparam("presence_xml", "xcapauth_userdel_reason", "rejected") Set this parameter to enable simple body notify with status 'open' when presentity info is not available. - Default value: "0". + Default value: “0”. Example 1.11. Set force_dummy_presence parameter ... @@ -355,7 +355,7 @@ modparam("presence_xml", "force_dummy_presence", 1) 5. Installation - The module requires one table in Kamailio database: "xcap". The SQL + The module requires one table in Kamailio database: “xcap”. The SQL syntax to create it can be found in presence-create.sql script in the database directories in the kamailio/scripts folder. You can also find the complete database documentation on the project webpage, diff --git a/modules/presence_xml/pidf.c b/modules/presence_xml/pidf.c index fca87b3799b..7644f89687e 100644 --- a/modules/presence_xml/pidf.c +++ b/modules/presence_xml/pidf.c @@ -42,6 +42,7 @@ #define _BSD_SOURCE 1 /* needed on linux to "fix" the effect of the above define on features.h/unistd.h syscall() */ + #define _DEFAULT_SOURCE 1 /* _BSD_SOURCE is deprecated */ #define _DARWIN_C_SOURCE 1 #else #define _XOPEN_SOURCE_EXTENDED 1 /* solaris */ diff --git a/modules/print/README b/modules/print/README index 33279796f29..2ca12fd97fa 100644 --- a/modules/print/README +++ b/modules/print/README @@ -1,12 +1,11 @@ - Print Module Andrei Pelinescu-Onciul FhG FOKUS - Copyright 2003 FhG FOKUS - _________________________________________________________________ + Copyright © 2003 FhG FOKUS + __________________________________________________________________ Table of Contents @@ -20,7 +19,7 @@ Andrei Pelinescu-Onciul 3. Functions - 3.1. print(txt) + 3.1. print(txt) List of Examples @@ -40,12 +39,12 @@ Chapter 1. Admin Guide 3. Functions - 3.1. print(txt) + 3.1. print(txt) 1. Overview This is an example module. It implements only one function that prints - its string parameter to stdout (it won't work if ser is started in + its string parameter to stdout (it won't work if ser is started in daemon mode). It also shows how module parameters can be declared. 2. Parameters @@ -77,7 +76,7 @@ modparam("print", "int_param", 42) 3. Functions - 3.1. print(txt) + 3.1. print(txt) 3.1. print(txt) diff --git a/modules/print_lib/README b/modules/print_lib/README index 5d93909d4b8..973de71b7f0 100644 --- a/modules/print_lib/README +++ b/modules/print_lib/README @@ -1,12 +1,11 @@ - Print_lib Module Andrei Pelinescu-Onciul FhG FOKUS - Copyright 2003 FhG FOKUS - _________________________________________________________________ + Copyright © 2003 FhG FOKUS + __________________________________________________________________ Table of Contents @@ -15,7 +14,7 @@ Andrei Pelinescu-Onciul 1. Overview 2. Functions - 2.1. print_stderr(txt) + 2.1. print_stderr(txt) List of Examples @@ -28,18 +27,18 @@ Chapter 1. Admin Guide 1. Overview 2. Functions - 2.1. print_stderr(txt) + 2.1. print_stderr(txt) 1. Overview This is an example module. It implements only one function that prints - its string parameter to stderr (it won't work if server is started in - daemon mode). Its prupose is to show how to link to an internal - library (lib/print). + its string parameter to stderr (it won't work if server is started in + daemon mode). Its prupose is to show how to link to an internal library + (lib/print). 2. Functions - 2.1. print_stderr(txt) + 2.1. print_stderr(txt) 2.1. print_stderr(txt) diff --git a/modules/pua/README b/modules/pua/README index ed64a3bc0e9..59ff97fb384 100644 --- a/modules/pua/README +++ b/modules/pua/README @@ -8,7 +8,7 @@ Edited by Anca-Maria Vamanu - Copyright (c) 2006 Voice Sistem SRL + Copyright © 2006 Voice Sistem SRL __________________________________________________________________ Table of Contents @@ -33,8 +33,9 @@ Anca-Maria Vamanu 3.8. dlginfo_increase_version (int) 3.9. reginfo_increase_version (int) 3.10. db_mode (int) - 3.11. check_remote_contact (int) - 3.12. fetch_rows (integer) + 3.11. db_table_lock_write (integer) + 3.12. check_remote_contact (int) + 3.13. fetch_rows (integer) 4. Functions @@ -67,9 +68,10 @@ Anca-Maria Vamanu 1.8. Set dlginfo_increase_version parameter 1.9. Set reginfo_increase_version parameter 1.10. Set db_mode parameter - 1.11. Set check_remote_contact parameter - 1.12. Set fetch_rows parameter - 1.13. pua_update_contact usage + 1.11. Set db_table_lock_write parameter + 1.12. Set check_remote_contact parameter + 1.13. Set fetch_rows parameter + 1.14. pua_update_contact usage 2.1. pua_api structure 2.2. pua_is_dialog usage example 2.3. register_puacb usage example @@ -97,8 +99,9 @@ Chapter 1. Admin Guide 3.8. dlginfo_increase_version (int) 3.9. reginfo_increase_version (int) 3.10. db_mode (int) - 3.11. check_remote_contact (int) - 3.12. fetch_rows (integer) + 3.11. db_table_lock_write (integer) + 3.12. check_remote_contact (int) + 3.13. fetch_rows (integer) 4. Functions @@ -166,8 +169,9 @@ Chapter 1. Admin Guide 3.8. dlginfo_increase_version (int) 3.9. reginfo_increase_version (int) 3.10. db_mode (int) - 3.11. check_remote_contact (int) - 3.12. fetch_rows (integer) + 3.11. db_table_lock_write (integer) + 3.12. check_remote_contact (int) + 3.13. fetch_rows (integer) 3.1. hash_size (int) @@ -175,7 +179,7 @@ Chapter 1. Admin Guide information. This parameter will be used as the power of 2 when computing table size. - Default value is "9". + Default value is “9”. Example 1.1. Set hash_size parameter ... @@ -186,7 +190,7 @@ modparam("pua", "hash_size", 11) Database url. - Default value is ">mysql://kamailio:kamailiorw@localhost/kamailio". + Default value is “>mysql://kamailio:kamailiorw@localhost/kamailio”. Example 1.2. Set db_url parameter ... @@ -197,7 +201,7 @@ modparam("pua", "db_url" "dbdriver://username:password@dbhost/dbname") The name of the database table. - Default value is "pua". + Default value is “pua”. Example 1.3. Set db_table parameter ... @@ -208,7 +212,7 @@ modparam("pua", "db_table", "pua") The inferior expires limit for both Publish and Subscribe. - Default value is "0". + Default value is “0”. Example 1.4. Set min_expires parameter ... @@ -220,7 +224,7 @@ modparam("pua", "min_expires", 0) The default expires value used in case this information is not provisioned. - Default value is "3600". + Default value is “3600”. Example 1.5. Set default_expires parameter ... @@ -234,7 +238,7 @@ modparam("pua", "default_expires", 3600) expired messages. Setting a value less than or equal to zero, disables updates. - Default value is "100". + Default value is “100”. Example 1.6. Set update_period parameter ... @@ -264,7 +268,7 @@ modparam("pua", "outbound_proxy", "sip:outbound.example.com") presence_dialoginfo module) it makes no sense to waste CPU resources for parsing the XML body and the parameter should be set to 0. - Default value is "0". + Default value is “0”. Example 1.8. Set dlginfo_increase_version parameter ... @@ -282,7 +286,7 @@ modparam("pua", "dlginfo_increase_version", 1) presence_reginfo module) it makes no sense to waste CPU resources for parsing the XML body and the parameter should be set to 0. - Default value is "0". + Default value is “0”. Example 1.9. Set reginfo_increase_version parameter ... @@ -296,14 +300,27 @@ modparam("pua", "reginfo_increase_version", 1) in a database, allowing scalability at the expense of speed. Mode 1 is reserved. - Default value is "0". + Default value is “0”. Example 1.10. Set db_mode parameter ... modparam("pua", "db_mode", 0) ... -3.11. check_remote_contact (int) +3.11. db_table_lock_write (integer) + + Enable (=1) or disable (=0) the Locks for table during an transaction. + Locking only the "current" table causes problems with a MySQL-Databases + in "DB-Only" mode. + + Default value is 1 (Write Lock for the Tables). + + Example 1.11. Set db_table_lock_write parameter +... +modparam("pua", "db_table_lock_write", 0) +... + +3.12. check_remote_contact (int) When sending a SUBSCRIBE check that the remote contact matches the one in the stored dialog or not. If the remote contact is checked and does @@ -313,20 +330,20 @@ modparam("pua", "db_mode", 0) anyway. Set this parameter to 0 to disable checking of remote contact for SUBSCRIBE dialog matching. - Default value is "1". + Default value is “1”. - Example 1.11. Set check_remote_contact parameter + Example 1.12. Set check_remote_contact parameter ... modparam("pua", "check_remote_contact", 0) ... -3.12. fetch_rows (integer) +3.13. fetch_rows (integer) Number of rows to be loaded in one step from database. Default value is 500. - Example 1.12. Set fetch_rows parameter + Example 1.13. Set fetch_rows parameter ... modparam("pua", "fetch_rows", 1000) ... @@ -350,7 +367,7 @@ modparam("pua", "fetch_rows", 1000) * 1 - if success. * -1 - if error. - Example 1.13. pua_update_contact usage + Example 1.14. pua_update_contact usage ... if(method=="NOTIFY") pua_update_contact(); diff --git a/modules/pua/send_subscribe.c b/modules/pua/send_subscribe.c index 84b69f81bc0..00832ee9ec1 100644 --- a/modules/pua/send_subscribe.c +++ b/modules/pua/send_subscribe.c @@ -755,14 +755,14 @@ void subs_cback_func(struct cell *t, int cb_type, struct tmcb_params *ps) } ua_pres_t* subscribe_cbparam(subs_info_t* subs, int ua_flag) -{ +{ ua_pres_t* hentity= NULL; int size; size= sizeof(ua_pres_t)+ 2*sizeof(str)+(subs->pres_uri->len+ subs->watcher_uri->len+ subs->contact->len+ subs->id.len+ 1)* sizeof(char); - + if(subs->outbound_proxy && subs->outbound_proxy->len && subs->outbound_proxy->s ) size+= sizeof(str)+ subs->outbound_proxy->len* sizeof(char); @@ -811,7 +811,7 @@ ua_pres_t* subscribe_cbparam(subs_info_t* subs, int ua_flag) memcpy(hentity->outbound_proxy->s, subs->outbound_proxy->s, subs->outbound_proxy->len); hentity->outbound_proxy->len= subs->outbound_proxy->len; size+= subs->outbound_proxy->len; - } + } if(subs->expires< 0) hentity->desired_expires= 0; else @@ -833,21 +833,21 @@ ua_pres_t* subscribe_cbparam(subs_info_t* subs, int ua_flag) } hentity->flag= subs->source_flag; hentity->event= subs->event; - hentity->ua_flag= hentity->ua_flag; + hentity->ua_flag= ua_flag; hentity->cb_param= subs->cb_param; return hentity; -} +} ua_pres_t* subs_cbparam_indlg(ua_pres_t* subs, int expires, int ua_flag) -{ +{ ua_pres_t* hentity= NULL; int size; size= sizeof(ua_pres_t)+ 2*sizeof(str)+subs->pres_uri->len+ subs->watcher_uri->len+ subs->contact.len+ subs->id.len+ subs->to_tag.len+ subs->call_id.len+ subs->from_tag.len+ 1; - + if(subs->outbound_proxy && subs->outbound_proxy->len && subs->outbound_proxy->s ) size+= sizeof(str)+ subs->outbound_proxy->len; @@ -895,13 +895,13 @@ ua_pres_t* subs_cbparam_indlg(ua_pres_t* subs, int expires, int ua_flag) memcpy(hentity->outbound_proxy->s, subs->outbound_proxy->s, subs->outbound_proxy->len); hentity->outbound_proxy->len= subs->outbound_proxy->len; size+= subs->outbound_proxy->len; - } + } if(subs->id.s) { CONT_COPY(hentity, hentity->id, subs->id) } - + if(subs->remote_contact.s) { CONT_COPY(hentity, hentity->remote_contact, subs->remote_contact) @@ -918,11 +918,11 @@ ua_pres_t* subs_cbparam_indlg(ua_pres_t* subs, int expires, int ua_flag) size+= subs->extra_headers->len; } /* copy dialog information */ - + CONT_COPY(hentity, hentity->to_tag, subs->to_tag) CONT_COPY(hentity, hentity->from_tag, subs->from_tag) CONT_COPY(hentity, hentity->call_id, subs->call_id) - + if(expires< 0) hentity->desired_expires= 0; else @@ -930,12 +930,12 @@ ua_pres_t* subs_cbparam_indlg(ua_pres_t* subs, int expires, int ua_flag) hentity->flag= subs->flag; hentity->event= subs->event; - hentity->ua_flag= hentity->ua_flag; + hentity->ua_flag= ua_flag; hentity->cb_param= subs->cb_param; return hentity; -} +} /** diff --git a/modules/pua_dialoginfo/README b/modules/pua_dialoginfo/README index 9a674aa8341..1b7d0e48d0f 100644 --- a/modules/pua_dialoginfo/README +++ b/modules/pua_dialoginfo/README @@ -19,9 +19,13 @@ Klaus Darilion IPCom - Copyright 2006 Voice Sistem SRL +Edited by + +Phil Lavin + + Copyright © 2006 Voice Sistem SRL - Copyright 2008 Klaus Darilion IPCom + Copyright © 2008 Klaus Darilion IPCom __________________________________________________________________ Table of Contents @@ -49,6 +53,7 @@ Klaus Darilion 5.9. pubruri_callee_avp (int) 5.10. pubruri_caller_dlg_var (str) 5.11. pubruri_callee_dlg_var (int) + 5.12. callee_trying (int) 6. Functions @@ -65,6 +70,7 @@ Klaus Darilion 1.9. Set pubruri_callee_avp parameter 1.10. Set pubruri_caller_avp parameter 1.11. Set pubruri_callee_dlg_var parameter + 1.12. Set callee_trying parameter Chapter 1. Admin Guide @@ -91,6 +97,7 @@ Chapter 1. Admin Guide 5.9. pubruri_callee_avp (int) 5.10. pubruri_caller_dlg_var (str) 5.11. pubruri_callee_dlg_var (int) + 5.12. callee_trying (int) 6. Functions @@ -270,13 +277,14 @@ Chapter 1. Admin Guide 5.9. pubruri_callee_avp (int) 5.10. pubruri_caller_dlg_var (str) 5.11. pubruri_callee_dlg_var (int) + 5.12. callee_trying (int) 5.1. include_callid (int) If this parameter is set, the optional call-id will be put into the dialog element. This is needed for call-pickup features. - Default value is "1". + Default value is “1”. Example 1.1. Set include_callid parameter ... @@ -288,7 +296,7 @@ modparam("pua_dialoginfo", "include_callid", 0) If this parameter is set, the local and remote tag will be put into the dialog element. This is needed for call-pickup features. - Default value is "1". + Default value is “1”. Example 1.2. Set include_tags parameter ... @@ -301,7 +309,7 @@ modparam("pua_dialoginfo", "include_tags", 0) be put into the dialog element. This is needed for call-pickup features. - Default value is "1". + Default value is “1”. Example 1.3. Set include_localremote parameter ... @@ -317,7 +325,7 @@ modparam("pua_dialoginfo", "include_localremote", 0) dialog module. If used, the value should at least be a few seconds more than the fr_inv_timer of the tm module. - Default value is "0". + Default value is “0”. Example 1.4. Set override_lifetime parameter ... @@ -336,7 +344,7 @@ modparam("pua_dialoginfo", "override_lifetime", 300) the buggy Linksys SPA962 phones. SNOM phones work well with the default setting. - Default value is "0". + Default value is “0”. Example 1.5. Set caller_confirmed parameter ... @@ -349,7 +357,7 @@ modparam("pua_dialoginfo", "caller_confirmed", 1) not set, PUBLISH requests are sent out only if their R-URI is local (according to myself). - Default value is "-1". + Default value is “-1”. Example 1.6. Set send_publish_flag parameter ... @@ -361,7 +369,7 @@ modparam("pua_dialoginfo", "send_publish_flag", 8) Get Publish R-Uri from avps (see corresponding avp params), not from reqeust to/from uri. - Default value is "0". + Default value is “0”. Example 1.7. Set use_pubruri_avps parameter ... @@ -377,7 +385,7 @@ modparam("pua_dialoginfo", "use_pubruri_avps", 1) corresponding PUBLISH-request is generated. If no AVP with the specified name exists, no caller-related PUBLISH requests are sent. - Default value is "NULL". + Default value is “NULL”. Example 1.8. Set pubruri_caller_avp parameter ... @@ -393,7 +401,7 @@ modparam("pua_dialoginfo", "pubruri_caller_avp", "$avp(s:puburis_caller)") corresponding PUBLISH-request is generated. If no AVP with the specified name exists, no callee-related PUBLISH requests are sent. - Default value is "NULL". + Default value is “NULL”. Example 1.9. Set pubruri_callee_avp parameter ... @@ -407,7 +415,7 @@ modparam("pua_dialoginfo", "pubruri_callee_avp", "$avp(s:puburis_callee)") value after Kamailio restart. If not set, loaded dialogs at restart are no longer sending notifications. New dialogs are working fine. - Default value is "NULL". + Default value is “NULL”. Example 1.10. Set pubruri_caller_avp parameter ... @@ -421,11 +429,23 @@ modparam("pua_dialoginfo", "pubruri_caller_dlg_var", "pubruri_caller") value after Kamailio restart. If not set, loaded dialogs at restart are no longer sending notifications. New dialogs are working fine. - Default value is "NULL". + Default value is “NULL”. Example 1.11. Set pubruri_callee_dlg_var parameter ... modparam("pua_dialoginfo", "pubruri_callee_dlg_var", "pubruri_callee") ... +5.12. callee_trying (int) + + If this parameter is set, a "Trying" state will be sent for both the + caller and callee, rather than just the caller. + + Default value is “0”. + + Example 1.12. Set callee_trying parameter +... +modparam("pua_dialoginfo", "callee_trying", 1) +... + 6. Functions diff --git a/modules/pua_dialoginfo/dialog_publish.c b/modules/pua_dialoginfo/dialog_publish.c index 54655f6cfb9..6a738dc73b5 100644 --- a/modules/pua_dialoginfo/dialog_publish.c +++ b/modules/pua_dialoginfo/dialog_publish.c @@ -383,7 +383,7 @@ void dialog_publish_multi(char *state, struct str_list* ruris, str *entity, str str *localtarget, str *remotetarget, unsigned short do_pubruri_localcheck) { while(ruris) { - LM_INFO("CALLING dialog_publish for URI %.*s\n",ruris->s.len, ruris->s.s); + LM_DBG("CALLING dialog_publish for URI %.*s\n",ruris->s.len, ruris->s.s); dialog_publish(state,&(ruris->s),entity,peer,callid,initiator,lifetime,localtag,remotetag,localtarget,remotetarget,do_pubruri_localcheck); ruris=ruris->next; } diff --git a/modules/pua_dialoginfo/pua_dialoginfo.c b/modules/pua_dialoginfo/pua_dialoginfo.c index 2e050d38b5b..085d2654dea 100644 --- a/modules/pua_dialoginfo/pua_dialoginfo.c +++ b/modules/pua_dialoginfo/pua_dialoginfo.c @@ -254,10 +254,15 @@ __dialog_sendpublish(struct dlg_cell *dlg, int type, struct dlg_cb_params *_para str tag = {0,0}; str uri = {0,0}; str target = {0,0}; + struct dlginfo_cell *dlginfo = NULL; + dlginfo = (struct dlginfo_cell*)*_params->param; - struct dlginfo_cell *dlginfo = (struct dlginfo_cell*)*_params->param; - + if(dlg==NULL || dlginfo==NULL) { + LM_WARN("execution with null parameters - type %d, dlg %p, info %p\n", + type, dlg, dlginfo); + return; + } if(include_req_uri) { uri = dlginfo->req_uri; } else { diff --git a/modules/pua_mi/README b/modules/pua_mi/README index 6218ac4d821..997da88beaa 100644 --- a/modules/pua_mi/README +++ b/modules/pua_mi/README @@ -12,7 +12,7 @@ Edited by Juha Heinanen - Copyright (c) 2006 Voice Sistem SRL + Copyright © 2006 Voice Sistem SRL __________________________________________________________________ Table of Contents @@ -93,7 +93,7 @@ Chapter 1. Admin Guide If 1, pua_publish MI command has outbound proxy parameter. - Default value is "0". + Default value is “0”. Example 1.1. Set publish_with_ob_proxy parameter ... diff --git a/modules/pua_reginfo/README b/modules/pua_reginfo/README index 0b5709f6f2e..49a7fbcfed3 100644 --- a/modules/pua_reginfo/README +++ b/modules/pua_reginfo/README @@ -10,7 +10,7 @@ Carsten Bock <carsten@ng-voice.com> - Copyright 2011 Carsten Bock, carsten@ng-voice.com, + Copyright © 2011 Carsten Bock, carsten@ng-voice.com, http://www.ng-voice.com __________________________________________________________________ @@ -121,7 +121,7 @@ Chapter 1. Admin Guide The default domain for the registered users to be used when constructing the uri for the registrar callback. - Default value is "NULL". + Default value is “NULL”. Example 1.1. Set default_domain parameter ... @@ -132,7 +132,7 @@ modparam("pua_reginfo", "default_domain", "kamailio.org") Whether or not to generate PUBLISH requests. - Default value is "1" (enabled). + Default value is “1” (enabled). Example 1.2. Set publish_reginfo parameter ... @@ -143,7 +143,7 @@ modparam("pua_reginfo", "publish_reginfo", 0) The outbound_proxy uri to be used when sending Subscribe requests. - Default value is "NULL". + Default value is “NULL”. Example 1.3. Set outbound_proxy parameter ... @@ -164,7 +164,7 @@ modparam("pua_reginfo", "server_address", "sip:reginfo@160.34.23.12") 4.1. reginfo_handle_notify(uldomain) 4.2. reginfo_subscribe(uri[, expires]) -4.1. reginfo_handle_notify(uldomain) +4.1. reginfo_handle_notify(uldomain) This function processes received "NOTIFY"-requests and updates the local registry accordingly. @@ -188,7 +188,7 @@ if(is_method("NOTIFY")) send_reply("202", "Accepted"); ... -4.2. reginfo_subscribe(uri[, expires]) +4.2. reginfo_subscribe(uri[, expires]) This function will subscribe for reginfo-information at the given server URI. diff --git a/modules/pua_usrloc/README b/modules/pua_usrloc/README index 942f2dd6ab5..ae48c739095 100644 --- a/modules/pua_usrloc/README +++ b/modules/pua_usrloc/README @@ -8,7 +8,7 @@ Edited by Anca-Maria Vamanu - Copyright 2006 Voice Sistem SRL + Copyright © 2006 Voice Sistem SRL __________________________________________________________________ Table of Contents @@ -98,7 +98,7 @@ Chapter 1. Admin Guide The default domain to use when constructing the presentity URI if it is missing from stored AOR in the usrloc table (in memory or database). - Default value is "NULL". + Default value is “NULL”. Example 1.1. Set default_domain parameter ... @@ -110,7 +110,7 @@ modparam("pua_usrloc", "default_domain", "kamailio.org") The prefix used when constructing the entity attribute to be added to a presence node in the XML PIDF document. (ex: pres:user@domain ). - Default value is "NULL". + Default value is “NULL”. Example 1.2. Set presentity_prefix parameter ... @@ -122,7 +122,7 @@ modparam("pua_usrloc", "entity_prefix", "pres") Which branch flag to be used to select the contact addresses for which to generate PUBLISH. Valid values are 0 to 31. - Default value is "-1" (disabled). + Default value is “-1” (disabled). Example 1.3. Set branch_flag parameter ... diff --git a/modules/pua_xmpp/README b/modules/pua_xmpp/README index 357764b5c07..6517991a8b6 100644 --- a/modules/pua_xmpp/README +++ b/modules/pua_xmpp/README @@ -8,7 +8,7 @@ Edited by Anca-Maria Vamanu - Copyright 2007 Voice Sistem SRL + Copyright © 2007 Voice Sistem SRL __________________________________________________________________ Table of Contents @@ -106,7 +106,7 @@ modparam("pua_xmpp", "server_address", "sip:160.23.23.10") Functions exported to be used in configuration file. -4.1. pua_xmpp_notify() +4.1. pua_xmpp_notify() Function that handles Notify messages addressed to a user from an xmpp domain. It requires filtering after method and domain in configuration @@ -124,7 +124,7 @@ modparam("pua_xmpp", "server_address", "sip:160.23.23.10") } ... -4.2. pua_xmpp_req_winfo(request_uri, expires) +4.2. pua_xmpp_req_winfo(request_uri, expires) Function called when a Subscribe addressed to a user from a xmpp domain is received. It calls sending a Subscribe for winfo for the user, and diff --git a/modules/pua_xmpp/simple2xmpp.c b/modules/pua_xmpp/simple2xmpp.c index d2db121e24f..8822a7e66d8 100644 --- a/modules/pua_xmpp/simple2xmpp.c +++ b/modules/pua_xmpp/simple2xmpp.c @@ -17,8 +17,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * History: @@ -63,7 +63,7 @@ int Notify2Xmpp(struct sip_msg* msg, char* s1, char* s2) int event_flag= 0; memset(&dialog, 0, sizeof(ua_pres_t)); - + LM_DBG("start...\n\n"); if( parse_headers(msg,HDR_EOH_F, 0)==-1 ) @@ -91,7 +91,7 @@ int Notify2Xmpp(struct sip_msg* msg, char* s1, char* s2) else { parse_to(msg->to->body.s,msg->to->body.s + msg->to->body.len + 1, &TO); - if(TO.uri.len <= 0) + if(TO.uri.len <= 0) { LM_ERR("'To' header NOT parsed\n"); goto error; @@ -100,7 +100,7 @@ int Notify2Xmpp(struct sip_msg* msg, char* s1, char* s2) } dialog.watcher_uri= &pto->uri; - + uri=(char*)pkg_malloc(sizeof(char)*( pto->uri.len+1)); if(uri== NULL) { @@ -115,12 +115,12 @@ int Notify2Xmpp(struct sip_msg* msg, char* s1, char* s2) LM_ERR("while decoding sip uri in xmpp\n"); pkg_free(uri); goto error; - } + } to_uri.len= strlen(to_uri.s); pkg_free(uri); if (pto->tag_value.s==NULL || pto->tag_value.len==0 ) - { + { LM_ERR("to tag value not parsed\n"); goto error; } @@ -143,7 +143,7 @@ int Notify2Xmpp(struct sip_msg* msg, char* s1, char* s2) { LM_ERR("'From' header not parsed\n"); /* parsing from header */ - if ( parse_from_header( msg )<0 ) + if ( parse_from_header( msg )<0 ) { LM_ERR("ERROR cannot parse From header\n"); goto error; @@ -151,7 +151,7 @@ int Notify2Xmpp(struct sip_msg* msg, char* s1, char* s2) } pfrom = (struct to_body*)msg->from->parsed; dialog.pres_uri= &pfrom->uri; - + uri=(char*)pkg_malloc(sizeof(char)*( pfrom->uri.len+1)); if(uri== NULL) { @@ -160,17 +160,17 @@ int Notify2Xmpp(struct sip_msg* msg, char* s1, char* s2) } memcpy(uri, pfrom->uri.s, pfrom->uri.len); uri[pfrom->uri.len]= '\0'; - + from_uri.s= euri_sip_xmpp(uri); if(from_uri.s== NULL) { LM_ERR("while encoding sip uri in xmpp\n"); pkg_free(uri); goto error; - } + } from_uri.len= strlen(from_uri.s); pkg_free(uri); - + if( pfrom->tag_value.s ==NULL || pfrom->tag_value.len == 0) { LM_ERR("no from tag value present\n"); @@ -179,20 +179,20 @@ int Notify2Xmpp(struct sip_msg* msg, char* s1, char* s2) dialog.to_tag= pfrom->tag_value; dialog.flag|= XMPP_SUBSCRIBE; - if(msg->event->body.len== 8 && + if(msg->event->body.len== 8 && (strncmp(msg->event->body.s,"presence",8 )==0)) event_flag|= PRESENCE_EVENT; else - if(msg->event->body.len== 14 && - (strncmp(msg->event->body.s,"presence.winfo",14 )==0)) - event_flag|= PWINFO_EVENT; - else - { - LM_ERR("wrong event\n"); - goto error; - } + if(msg->event->body.len== 14 && + (strncmp(msg->event->body.s,"presence.winfo",14 )==0)) + event_flag|= PWINFO_EVENT; + else + { + LM_ERR("wrong event\n"); + goto error; + } dialog.event= event_flag; - + if(pua_is_dialog(&dialog)< 0) // verify if within a stored dialog { LM_ERR("Notify in a non existing dialog\n"); @@ -203,11 +203,11 @@ int Notify2Xmpp(struct sip_msg* msg, char* s1, char* s2) { body.s= NULL; body.len= 0; - } + } else { body.s=get_body(msg); - if (body.s== NULL) + if (body.s== NULL) { LM_ERR("cannot extract body from msg\n"); goto error; @@ -215,9 +215,9 @@ int Notify2Xmpp(struct sip_msg* msg, char* s1, char* s2) body.len = get_content_length( msg ); } - /* treat the two cases: event= presence & event=presence.winfo */ + /* treat the two cases: event= presence & event=presence.winfo */ if(event_flag & PRESENCE_EVENT) - { + { LM_DBG("PRESENCE\n"); hdr = msg->headers; while (hdr!= NULL) @@ -232,21 +232,21 @@ int Notify2Xmpp(struct sip_msg* msg, char* s1, char* s2) if(strncmp(hdr->body.s+11,"reason=timeout", 14)== 0) { LM_DBG("Received Notification with state" - "terminated; reason= timeout=> don't send notification\n"); + "terminated; reason= timeout=> don't send notification\n"); return 1; - } + } is_terminated= 1; } - + if(build_xmpp_content(&to_uri, &from_uri, &body, &id, is_terminated)< 0) { - LM_ERR("in function build_xmpp_content\n"); + LM_ERR("in function build_xmpp_content\n"); goto error; } - } + } else - { + { if(event_flag & PWINFO_EVENT) { LM_DBG("PRESENCE.WINFO\n"); @@ -259,8 +259,8 @@ int Notify2Xmpp(struct sip_msg* msg, char* s1, char* s2) } if(hdr && strncmp(hdr->body.s,"terminated", 10)== 0) { - LM_DBG("Notify for presence.winfo with" - " Subscription-State terminated- should not translate\n"); + LM_DBG("Notify for presence.winfo with" + " Subscription-State terminated- should not translate\n"); goto error; } if(winfo2xmpp(&to_uri, &body, &id)< 0) @@ -329,7 +329,7 @@ int build_xmpp_content(str* to_uri, str* from_uri, str* body, str* id, goto error; } if(is_terminated) - { + { attr= xmlNewProp(xmpp_root, BAD_CAST "type", BAD_CAST "unsubscribed"); if(attr== NULL) { @@ -362,7 +362,7 @@ int build_xmpp_content(str* to_uri, str* from_uri, str* body, str* id, LM_ERR("while extracting 'presence' node\n"); goto error; } - + node = XMLNodeGetNodeByName(sip_root, "basic", NULL); if(node== NULL) { @@ -402,11 +402,11 @@ int build_xmpp_content(str* to_uri, str* from_uri, str* body, str* id, } node= XMLNodeGetNodeByName(node, "note", NULL); if(node== NULL) - { + { LM_DBG("Person node has no note node\n"); goto done; - } - } + } + } note= (char*)xmlNodeGetContent(node); if(note== NULL) { @@ -423,7 +423,7 @@ int build_xmpp_content(str* to_uri, str* from_uri, str* body, str* id, { LM_ERR("while adding node show: away\n"); goto error; - } + } } else if(xmlStrcasecmp((unsigned char*)note, (unsigned char*)"busy")== 0) @@ -434,57 +434,36 @@ int build_xmpp_content(str* to_uri, str* from_uri, str* body, str* id, { LM_ERR("while adding node show: away\n"); goto error; - } - } - - /* - if(xmlStrcasecmp((unsigned char*)note, (unsigned char*)"on the phone")== 0) - { - new_node = xmlNewChild(xmpp_root, NULL, BAD_CAST "show", BAD_CAST "chat"); - if(new_node== NULL) - { - LM_ERR("while adding node show: chat\n"); - goto error; - } + } } - else - if(xmlStrcasecmp((unsigned char*)note, (unsigned char*)"idle")== 0) + else + if((xmlStrcasecmp((unsigned char*)note, + (unsigned char*)"dnd")== 0)|| + (xmlStrcasecmp((unsigned char*)note, + (unsigned char*)"do not disturb")== 0)|| + (xmlStrcasecmp((unsigned char*)note, + (unsigned char*)"Busy (DND)")== 0)) { - new_node = xmlNewChild(xmpp_root, NULL, BAD_CAST "show", BAD_CAST "idle"); + new_node = xmlNewChild(xmpp_root, NULL, BAD_CAST "show", + BAD_CAST "dnd"); if(new_node== NULL) { - LM_ERR("while adding node: idle\n"); + LM_ERR("while adding node show: dnd\n"); goto error; - } - }*/ - else - if((xmlStrcasecmp((unsigned char*)note, - (unsigned char*)"dnd")== 0)|| - (xmlStrcasecmp((unsigned char*)note, - (unsigned char*)"do not disturb")== 0)|| - (xmlStrcasecmp((unsigned char*)note, - (unsigned char*)"Busy (DND)")== 0)) - { - new_node = xmlNewChild(xmpp_root, NULL, BAD_CAST "show", - BAD_CAST "dnd"); - if(new_node== NULL) - { - LM_ERR("while adding node show: dnd\n"); - goto error; - } } - else - LM_DBG("Not Found Status\n"); + } + else + LM_DBG("Not Found Status\n"); + - /* adding status node */ new_node = xmlNewChild(xmpp_root, NULL, BAD_CAST "status", BAD_CAST note); if(new_node== NULL) { LM_ERR("while adding node status\n"); goto error; - } - + } + xmlFree(note); note= NULL; @@ -520,7 +499,7 @@ int build_xmpp_content(str* to_uri, str* from_uri, str* body, str* id, LM_ERR("while adding creating new buffer\n"); goto error; } - + xmpp_msg.len= xmlNodeDump(buffer, doc, xmpp_root, 1,1); if(xmpp_msg.len== -1) { @@ -533,7 +512,7 @@ int build_xmpp_content(str* to_uri, str* from_uri, str* body, str* id, LM_ERR("while extracting buffer content\n"); goto error; } - + LM_DBG("xmpp_msg: %.*s\n",xmpp_msg.len, xmpp_msg.s); if( xmpp_notify(from_uri, to_uri, &xmpp_msg, id)< 0) { @@ -592,15 +571,15 @@ int winfo2xmpp(str* to_uri, str* body, str* id) LM_ERR("while extracting 'presence' node\n"); goto error; } - + node = XMLNodeGetNodeByName(pidf_root, "watcher", NULL); for (; node!=NULL; node = node->next) - { + { if( xmlStrcasecmp(node->name,(unsigned char*)"watcher")) continue; - watcher= (char*)xmlNodeGetContent(node->children); + watcher= (char*)xmlNodeGetContent(node->children); if(watcher== NULL) { LM_ERR("while extracting watcher node content\n"); @@ -611,7 +590,7 @@ int winfo2xmpp(str* to_uri, str* body, str* id) { LM_ERR("while encoding sip uri in xmpp\n"); goto error; - } + } from_uri.len= strlen(from_uri.s); xmlFree(watcher); watcher= NULL; @@ -654,7 +633,7 @@ int winfo2xmpp(str* to_uri, str* body, str* id) LM_ERR("while adding creating new buffer\n"); goto error; } - + xmpp_msg.len= xmlNodeDump(buffer, doc, root_node, 1,1); if(xmpp_msg.len== -1) { @@ -667,9 +646,9 @@ int winfo2xmpp(str* to_uri, str* body, str* id) LM_ERR("while extracting buffer content\n"); goto error; } - + LM_DBG("xmpp_msg: %.*s\n",xmpp_msg.len, xmpp_msg.s); - + if( xmpp_subscribe(&from_uri, to_uri, &xmpp_msg, id)< 0) { LM_ERR("while sending xmpp_subscribe\n"); @@ -713,7 +692,7 @@ char* get_error_reason(int code, str* reason) LM_ERR("no more memory\n"); return NULL; } - + switch( code ) { case 300: { strcpy(err_cond, "redirect"); break;} @@ -761,10 +740,10 @@ char* get_error_reason(int code, str* reason) } return err_cond; -} +} -int Sipreply2Xmpp(ua_pres_t* hentity, struct sip_msg * msg) +int Sipreply2Xmpp(ua_pres_t* hentity, struct sip_msg * msg) { char* uri; /* named according to the direction of the message in xmpp*/ @@ -778,7 +757,7 @@ int Sipreply2Xmpp(ua_pres_t* hentity, struct sip_msg * msg) str reason; char* err_reason= NULL; xmlBufferPtr buffer= NULL; - + LM_DBG("start..\n"); uri=(char*)pkg_malloc(sizeof(char)*( hentity->watcher_uri->len+1)); if(uri== NULL) @@ -793,12 +772,12 @@ int Sipreply2Xmpp(ua_pres_t* hentity, struct sip_msg * msg) { LM_ERR("whil decoding sip uri in xmpp\n"); pkg_free(uri); - goto error; - } + goto error; + } to_uri.len= strlen(to_uri.s); pkg_free(uri); - + uri=(char*)pkg_malloc(sizeof(char)*( hentity->pres_uri->len+1)); if(uri== NULL) { @@ -822,7 +801,7 @@ int Sipreply2Xmpp(ua_pres_t* hentity, struct sip_msg * msg) if(doc==0) goto error; root_node = xmlNewNode(NULL, BAD_CAST "presence"); - + if(root_node==0) goto error; xmlDocSetRootElement(doc, root_node); @@ -864,7 +843,7 @@ int Sipreply2Xmpp(ua_pres_t* hentity, struct sip_msg * msg) LM_ERR("couldn't get response phrase\n"); goto error; } - + attr= xmlNewProp(root_node, BAD_CAST "type", BAD_CAST "error"); if(attr== NULL) { @@ -876,15 +855,15 @@ int Sipreply2Xmpp(ua_pres_t* hentity, struct sip_msg * msg) { LM_ERR("while adding new node\n"); goto error; - } + } node= xmlNewChild(node, 0, BAD_CAST err_reason, 0 ); if(node== NULL) { LM_ERR("while adding new node\n"); goto error; - } + } - attr= xmlNewProp(node, BAD_CAST "xmlns", + attr= xmlNewProp(node, BAD_CAST "xmlns", BAD_CAST "urn:ietf:params:xml:ns:xmpp-stanzas"); if(attr== NULL) { @@ -892,8 +871,7 @@ int Sipreply2Xmpp(ua_pres_t* hentity, struct sip_msg * msg) goto error; } - } - else + } else { if(code>=200 ) { LM_DBG(" 2xx code\n"); @@ -904,30 +882,31 @@ int Sipreply2Xmpp(ua_pres_t* hentity, struct sip_msg * msg) goto error; } } + } + + buffer= xmlBufferCreate(); + if(buffer== NULL) + { + LM_ERR("while adding creating new buffer\n"); + goto error; + } + + xmpp_msg.len= xmlNodeDump(buffer, doc, root_node, 1,1); + if(xmpp_msg.len== -1) + { + LM_ERR("while dumping node\n"); + goto error; + } + xmpp_msg.s= (char*)xmlBufferContent( buffer); + if(xmpp_msg.s== NULL) + { + LM_ERR("while extracting buffer content\n"); + goto error; + } - buffer= xmlBufferCreate(); - if(buffer== NULL) - { - LM_ERR("while adding creating new buffer\n"); - goto error; - } - - xmpp_msg.len= xmlNodeDump(buffer, doc, root_node, 1,1); - if(xmpp_msg.len== -1) - { - LM_ERR("while dumping node\n"); - goto error; - } - xmpp_msg.s= (char*)xmlBufferContent( buffer); - if(xmpp_msg.s== NULL) - { - LM_ERR("while extracting buffer content\n"); - goto error; - } - LM_DBG("xmpp_msg: %.*s\n",xmpp_msg.len, xmpp_msg.s); - + if(xmpp_packet(&from_uri, &to_uri, &xmpp_msg, &hentity->to_tag)< 0) { LM_ERR("while sending xmpp_reply_to_subscribe\n"); @@ -936,7 +915,7 @@ int Sipreply2Xmpp(ua_pres_t* hentity, struct sip_msg * msg) if(err_reason) pkg_free(err_reason); xmlFreeDoc(doc); - + return 0; error: diff --git a/modules/pua_xmpp/xmpp2simple.c b/modules/pua_xmpp/xmpp2simple.c index dffa2d03f34..d5d43f26828 100644 --- a/modules/pua_xmpp/xmpp2simple.c +++ b/modules/pua_xmpp/xmpp2simple.c @@ -374,7 +374,7 @@ int build_publish(xmlNodePtr pres_node, int expires) return -1; } strcpy(resource, slash+1); - slash= '\0'; + slash= NULL; } pres_uri= euri_xmpp_sip(uri); xmlFree(uri); diff --git a/modules/purple/README b/modules/purple/README index eea0de54e38..41c82304a36 100644 --- a/modules/purple/README +++ b/modules/purple/README @@ -77,6 +77,9 @@ Chapter 1. Admin Guide 1. Overview + Note: the module is not actively maintained and may be deprecated in + the near future. + Purple module is a multi-protocol instant-messaging gateway module which use libpurple, the library that Pidgin (ex-gaim) is based on. @@ -178,7 +181,7 @@ CREATE TABLE purplemap ( The URL to connect to database. - Default value is “mysql://openserro:openserro@localhost/openser”. + Default value is “mysql://kamailioro:kamailioro@localhost/kamailio”. Example 1.4. Set db_url parameter ... diff --git a/modules/purple/doc/purple_admin.xml b/modules/purple/doc/purple_admin.xml index 97209421713..be37a131478 100644 --- a/modules/purple/doc/purple_admin.xml +++ b/modules/purple/doc/purple_admin.xml @@ -10,14 +10,18 @@ <!-- Module User's Guide --> <chapter> - + <title>&adminguide; - +
Overview + + Note: the module is not actively maintained and may be deprecated + in the near future. + Purple module is a multi-protocol instant-messaging gateway module - which use libpurple, the library that Pidgin + which use libpurple, the library that Pidgin (ex-gaim) is based on. diff --git a/modules/purple/mapping.c b/modules/purple/mapping.c index e1aa00e1772..bbdb69f1db9 100644 --- a/modules/purple/mapping.c +++ b/modules/purple/mapping.c @@ -133,8 +133,11 @@ char *find_sip_user(char *extern_user) { if (result == NULL) return NULL; - if (result->n <= 0) + + if (result->n <= 0) { + pa_dbf.free_result(pa_db, result); return NULL; + } row = &result->rows[0]; row_vals = ROW_VALUES(row); @@ -208,6 +211,7 @@ extern_account_t *find_accounts(char* sip_user, int* count) { return NULL; } if (result->n <= 0) { + pa_dbf.free_result(pa_db, result); LM_ERR("result count = %d\n", result->n); return NULL; } @@ -290,8 +294,11 @@ extern_user_t *find_users(char *sip_user, int* count) { if (result == NULL) return NULL; - if (result->n <= 0) + + if (result->n <= 0) { + pa_dbf.free_result(pa_db, result); return NULL; + } users = (extern_user_t*) pkg_malloc(sizeof(extern_user_t)*result->n); diff --git a/modules/pv/README b/modules/pv/README index 7c78e962f03..91286c257f0 100644 --- a/modules/pv/README +++ b/modules/pv/README @@ -11,11 +11,11 @@ Daniel-Constantin Mierla - Copyright (c) 2008-2011 Daniel-Constantin Mierla (asipto.com) + Copyright © 2008-2011 Daniel-Constantin Mierla (asipto.com) - Copyright (c) 2011 Juha Heinanen + Copyright © 2011 Juha Heinanen - Copyright (c) 2013 Olle E. Johansson, Edvina AB + Copyright © 2013 Olle E. Johansson, Edvina AB __________________________________________________________________ Table of Contents @@ -157,11 +157,11 @@ Chapter 1. Admin Guide _value_ * _name_: shared variable name * _type_: type of the value - + "i": integer value - + "s": string value + + “i”: integer value + + “s”: string value * _value_: value to be set - Default value is "NULL". + Default value is “NULL”. Example 1.1. shvset parameter usage ... @@ -178,11 +178,11 @@ modparam("pv", "shvset", "pstngw=s:sip:10.10.10.10") _value_ * _name_: shared variable name * _type_: type of the value - + "i": integer value - + "s": string value + + “i”: integer value + + “s”: string value * _value_: value to be set - Default value is "NULL". + Default value is “NULL”. Example 1.2. varset parameter usage ... @@ -427,8 +427,8 @@ $var("foo") now is "foo indeed" Parameters: * _name_: shared variable name * _type_: type of the value - + "int": integer value - + "str": string value + + “int”: integer value + + “str”: string value * _value_: value to be set MI FIFO Command Format: @@ -474,8 +474,8 @@ $ kamctl fifo shv_get Parameters: * _name_: shared variable name * _type_: type of the value - + "int": integer value - + "str": string value + + “int”: integer value + + “str”: string value * _value_: value to be set 6.2. pv.shvGet diff --git a/modules/pv/pv.c b/modules/pv/pv.c index e8e717b827b..418392304ed 100644 --- a/modules/pv/pv.c +++ b/modules/pv/pv.c @@ -569,7 +569,7 @@ static int mod_init(void) { LM_ERR("failed to register RPC commands\n"); return -1; - } + } pv_init_sbranch(); return 0; @@ -612,7 +612,10 @@ static int pv_unset(struct sip_msg* msg, char* pvid, char *foo) pv_spec_t *sp; sp = (pv_spec_t*)pvid; - pv_set_spec_value(msg, sp, 0, NULL); + if(pv_set_spec_value(msg, sp, 0, NULL)<0) { + LM_ERR("faile to unset variable\n"); + return -1; + } return 1; } diff --git a/modules/pv/pv_core.c b/modules/pv/pv_core.c index 71e6ab37e34..425ec44a6b1 100644 --- a/modules/pv/pv_core.c +++ b/modules/pv/pv_core.c @@ -15,14 +15,14 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "../../qvalue.h" -#include "../../ut.h" +#include "../../ut.h" #include "../../route_struct.h" #include "../../dset.h" #include "../../flags.h" @@ -52,6 +52,7 @@ static str str_udp = { "UDP", 3 }; static str str_5060 = { "5060", 4 }; +static str str_5061 = { "5061", 4 }; static str pv_str_1 = { "1", 1 }; static str pv_uri_scheme[] = { { "none", 4 }, @@ -85,7 +86,7 @@ int pv_get_msgid(struct sip_msg *msg, pv_param_t *param, return pv_get_uintval(msg, param, res, msg->id); } -int pv_get_udp(struct sip_msg *msg, pv_param_t *param, +int pv_get_udp(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { return pv_get_strintval(msg, param, res, &str_udp, (int)PROTO_UDP); @@ -96,6 +97,11 @@ int pv_get_5060(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) return pv_get_strintval(msg, param, res, &str_5060, 5060); } +int pv_get_5061(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) +{ + return pv_get_strintval(msg, param, res, &str_5061, 5061); +} + int pv_get_true(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { @@ -132,14 +138,14 @@ int pv_get_method(struct sip_msg *msg, pv_param_t *param, &msg->first_line.u.request.method, (int)msg->first_line.u.request.method_value); } - - if(msg->cseq==NULL && ((parse_headers(msg, HDR_CSEQ_F, 0)==-1) || + + if(msg->cseq==NULL && ((parse_headers(msg, HDR_CSEQ_F, 0)==-1) || (msg->cseq==NULL))) { LM_ERR("no CSEQ header\n"); return pv_get_null(msg, param, res); } - + return pv_get_strintval(msg, param, res, &get_cseq(msg)->method, get_cseq(msg)->method_id); @@ -222,7 +228,7 @@ int pv_get_reason(struct sip_msg *msg, pv_param_t *param, if(msg->first_line.type != SIP_REPLY) return pv_get_null(msg, param, res); - + return pv_get_strval(msg, param, res, &msg->first_line.u.reply.reason); } @@ -241,7 +247,7 @@ int pv_get_ruri(struct sip_msg *msg, pv_param_t *param, LM_ERR("failed to parse the R-URI\n"); return pv_get_null(msg, param, res); } - + if (msg->new_uri.s!=NULL) return pv_get_strval(msg, param, res, &msg->new_uri); return pv_get_strval(msg, param, res, &msg->first_line.u.request.uri); @@ -278,8 +284,13 @@ int pv_get_xuri_attr(struct sip_msg *msg, struct sip_uri *parsed_uri, return pv_get_null(msg, param, res); return pv_get_strval(msg, param, res, &parsed_uri->host); } else if(param->pvn.u.isname.name.n==3) /* port */ { - if(parsed_uri->port.s==NULL) - return pv_get_5060(msg, param, res); + if(parsed_uri->port.s==NULL) { + if(parsed_uri->proto==PROTO_TLS) { + return pv_get_5061(msg, param, res); + } else { + return pv_get_5060(msg, param, res); + } + } return pv_get_strintval(msg, param, res, &parsed_uri->port, (int)parsed_uri->port_no); } else if(param->pvn.u.isname.name.n==4) /* protocol */ { @@ -310,7 +321,7 @@ int pv_get_ruri_attr(struct sip_msg *msg, pv_param_t *param, return pv_get_null(msg, param, res); } return pv_get_xuri_attr(msg, &(msg->parsed_uri), param, res); -} +} int pv_get_ouri_attr(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) @@ -342,18 +353,18 @@ int pv_get_contact(struct sip_msg *msg, pv_param_t *param, if(msg==NULL) return -1; - if(msg->contact==NULL && parse_headers(msg, HDR_CONTACT_F, 0)==-1) + if(msg->contact==NULL && parse_headers(msg, HDR_CONTACT_F, 0)==-1) { LM_DBG("no contact header\n"); return pv_get_null(msg, param, res); } - + if(!msg->contact || !msg->contact->body.s || msg->contact->body.len<=0) - { + { LM_DBG("no contact header!\n"); return pv_get_null(msg, param, res); } - + // res->s = ((struct to_body*)msg->contact->parsed)->uri.s; // res->len = ((struct to_body*)msg->contact->parsed)->uri.len; return pv_get_strval(msg, param, res, &msg->contact->body); @@ -368,13 +379,13 @@ int pv_get_xto_attr(struct sip_msg *msg, pv_param_t *param, if(param->pvn.u.isname.name.n==1) /* uri */ return pv_get_strval(msg, param, res, &xto->uri); - + if(param->pvn.u.isname.name.n==4) /* tag */ { if (xto->tag_value.s==NULL || xto->tag_value.len<=0) { - LM_DBG("no Tag parameter\n"); - return pv_get_null(msg, param, res); + LM_DBG("no Tag parameter\n"); + return pv_get_null(msg, param, res); } return pv_get_strval(msg, param, res, &xto->tag_value); } @@ -406,16 +417,16 @@ int pv_get_xto_attr(struct sip_msg *msg, pv_param_t *param, if(param->pvn.u.isname.name.n==2) /* username */ { - if(uri->user.s==NULL || uri->user.len<=0) + if(uri->user.s==NULL || uri->user.len<=0) { - LM_DBG("no username\n"); + LM_DBG("no username\n"); return pv_get_null(msg, param, res); } return pv_get_strval(msg, param, res, &uri->user); } else if(param->pvn.u.isname.name.n==3) /* domain */ { - if(uri->host.s==NULL || uri->host.len<=0) + if(uri->host.s==NULL || uri->host.len<=0) { - LM_DBG("no domain\n"); + LM_DBG("no domain\n"); return pv_get_null(msg, param, res); } return pv_get_strval(msg, param, res, &uri->host); @@ -454,7 +465,7 @@ int pv_get_from_attr(struct sip_msg *msg, pv_param_t *param, LM_ERR("cannot parse From header\n"); return pv_get_null(msg, param, res); } - + if(msg->from==NULL || get_from(msg)==NULL) { LM_DBG("no From header\n"); return pv_get_null(msg, param, res); @@ -467,7 +478,7 @@ int pv_get_cseq(struct sip_msg *msg, pv_param_t *param, { if(msg==NULL) return -1; - + if(msg->cseq==NULL && ((parse_headers(msg, HDR_CSEQ_F, 0)==-1) || (msg->cseq==NULL)) ) { @@ -483,7 +494,7 @@ int pv_get_msg_buf(struct sip_msg *msg, pv_param_t *param, str s; if(msg==NULL) return -1; - + s.s = msg->buf; s.len = msg->len; return pv_get_strval(msg, param, res, &s); @@ -494,7 +505,7 @@ int pv_get_msg_len(struct sip_msg *msg, pv_param_t *param, { if(msg==NULL) return -1; - + return pv_get_uintval(msg, param, res, msg->len); } @@ -515,7 +526,7 @@ int pv_get_flag(struct sip_msg *msg, pv_param_t *param, if (param->pvn.type != PV_NAME_INTSTR) return -1; - + return pv_get_uintval(msg, param, res, (msg->flags & (1<pvn.u.isname.name.n)) ? 1 : 0); } @@ -524,7 +535,7 @@ static inline char* int_to_8hex(int val) unsigned short digit; int i; static char outbuf[9]; - + outbuf[8] = '\0'; for(i=0; i<8; i++) { @@ -628,7 +639,7 @@ int pv_get_callid(struct sip_msg *msg, pv_param_t *param, { if(msg==NULL) return -1; - + if(msg->callid==NULL && ((parse_headers(msg, HDR_CALLID_F, 0)==-1) || (msg->callid==NULL)) ) { @@ -702,11 +713,11 @@ int pv_get_rcvip(struct sip_msg *msg, pv_param_t *param, { if(msg==NULL) return -1; - - if(msg->rcv.bind_address==NULL + + if(msg->rcv.bind_address==NULL || msg->rcv.bind_address->address_str.s==NULL) return pv_get_null(msg, param, res); - + return pv_get_strval(msg, param, res, &msg->rcv.bind_address->address_str); } @@ -715,11 +726,11 @@ int pv_get_rcvport(struct sip_msg *msg, pv_param_t *param, { if(msg==NULL) return -1; - - if(msg->rcv.bind_address==NULL + + if(msg->rcv.bind_address==NULL || msg->rcv.bind_address->port_no_str.s==NULL) return pv_get_null(msg, param, res); - + return pv_get_intstrval(msg, param, res, (int)msg->rcv.bind_address->port_no, &msg->rcv.bind_address->port_no_str); @@ -782,7 +793,7 @@ int pv_get_force_sock(struct sip_msg *msg, pv_param_t *param, { if(msg==NULL) return -1; - + if (msg->force_send_socket==0) return pv_get_null(msg, param, res); @@ -792,15 +803,15 @@ int pv_get_force_sock(struct sip_msg *msg, pv_param_t *param, int pv_get_useragent(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { - if(msg==NULL) + if(msg==NULL) return -1; if(msg->user_agent==NULL && ((parse_headers(msg, HDR_USERAGENT_F, 0)==-1) - || (msg->user_agent==NULL))) + || (msg->user_agent==NULL))) { LM_DBG("no User-Agent header\n"); return pv_get_null(msg, param, res); } - + return pv_get_strval(msg, param, res, &msg->user_agent->body); } @@ -815,7 +826,7 @@ int pv_get_refer_to(struct sip_msg *msg, pv_param_t *param, LM_DBG("no Refer-To header\n"); return pv_get_null(msg, param, res); } - + if(msg->refer_to==NULL || get_refer_to(msg)==NULL) return pv_get_null(msg, param, res); @@ -836,7 +847,7 @@ int pv_get_diversion(struct sip_msg *msg, pv_param_t *param, LM_DBG("no Diversion header\n"); return pv_get_null(msg, param, res); } - + if(msg->diversion == NULL || get_diversion(msg) == NULL) { LM_DBG("no Diversion header\n"); @@ -848,36 +859,36 @@ int pv_get_diversion(struct sip_msg *msg, pv_param_t *param, } if(param->pvn.u.isname.name.n == 2) { /* reason param */ - name.s = "reason"; - name.len = 6; - val = get_diversion_param(msg, &name); - if (val) { + name.s = "reason"; + name.len = 6; + val = get_diversion_param(msg, &name); + if (val) { return pv_get_strval(msg, param, res, val); - } else { + } else { return pv_get_null(msg, param, res); - } + } } if(param->pvn.u.isname.name.n == 3) { /* privacy param */ - name.s = "privacy"; - name.len = 7; - val = get_diversion_param(msg, &name); - if (val) { + name.s = "privacy"; + name.len = 7; + val = get_diversion_param(msg, &name); + if (val) { return pv_get_strval(msg, param, res, val); - } else { + } else { return pv_get_null(msg, param, res); - } + } } if(param->pvn.u.isname.name.n == 4) { /* counter param */ - name.s = "counter"; - name.len = 7; - val = get_diversion_param(msg, &name); - if (val) { + name.s = "counter"; + name.len = 7; + val = get_diversion_param(msg, &name); + if (val) { return pv_get_strval(msg, param, res, val); - } else { + } else { return pv_get_null(msg, param, res); - } + } } LM_ERR("unknown diversion specifier\n"); @@ -895,7 +906,7 @@ int pv_get_rpid(struct sip_msg *msg, pv_param_t *param, LM_DBG("no RPID header\n"); return pv_get_null(msg, param, res); } - + if(msg->rpid==NULL || get_rpid(msg)==NULL) return pv_get_null(msg, param, res); @@ -905,29 +916,29 @@ int pv_get_rpid(struct sip_msg *msg, pv_param_t *param, int pv_get_ppi_attr(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { - int idxf; - int idx; - struct sip_uri *uri; - p_id_body_t *ppi_body = NULL; + int idxf; + int idx; + struct sip_uri *uri; + p_id_body_t *ppi_body = NULL; to_body_t *ppi_uri = NULL; int i, cur_id; - if(msg==NULL) + if(msg==NULL) return -1; - + if(parse_ppi_header(msg) < 0) - { + { LM_DBG("no P-Preferred-Identity header\n"); return pv_get_null(msg, param, res); - } + } - if (pv_get_spec_index(msg, param, &idx, &idxf) != 0) - { - LM_ERR("Invalid index\n"); + if (pv_get_spec_index(msg, param, &idx, &idxf) != 0) + { + LM_ERR("Invalid index\n"); return -1; - } + } - if (idxf == PV_IDX_ALL) + if (idxf == PV_IDX_ALL) { LM_ERR("Unable to return 'all' PPI values\n"); return -1; @@ -961,18 +972,18 @@ int pv_get_ppi_attr(struct sip_msg *msg, pv_param_t *param, } /* Found the ID at index 'idx' */ - if(param->pvn.u.isname.name.n == 1) { /* uri */ + if(param->pvn.u.isname.name.n == 1) { /* uri */ return pv_get_strval(msg, param, res, &(ppi_uri->uri)); - } - - if(param->pvn.u.isname.name.n==4) { /* display name */ + } + + if(param->pvn.u.isname.name.n==4) { /* display name */ if(ppi_uri->display.s == NULL || ppi_uri->display.len <= 0) { - LM_DBG("no P-Preferred-Identity display name\n"); + LM_DBG("no P-Preferred-Identity display name\n"); return pv_get_null(msg, param, res); } return pv_get_strval(msg, param, res, &(ppi_uri->display)); - } + } uri = &ppi_uri->parsed_uri; if (uri->host.s == NULL && uri->user.s == NULL) @@ -984,19 +995,19 @@ int pv_get_ppi_attr(struct sip_msg *msg, pv_param_t *param, } } - if(param->pvn.u.isname.name.n==2) { /* username */ + if(param->pvn.u.isname.name.n==2) { /* username */ if(uri->user.s==NULL || uri->user.len<=0) { - LM_DBG("no P-Preferred-Identity username\n"); - return pv_get_null(msg, param, res); + LM_DBG("no P-Preferred-Identity username\n"); + return pv_get_null(msg, param, res); } return pv_get_strval(msg, param, res, &uri->user); - } else if(param->pvn.u.isname.name.n==3) { /* domain */ + } else if(param->pvn.u.isname.name.n==3) { /* domain */ if(uri->host.s==NULL || uri->host.len<=0) { LM_DBG("no P-Preferred-Identity domain\n"); return pv_get_null(msg, param, res); } return pv_get_strval(msg, param, res, &uri->host); - } + } LM_ERR("unknown specifier\n"); return pv_get_null(msg, param, res); @@ -1006,28 +1017,28 @@ int pv_get_ppi_attr(struct sip_msg *msg, pv_param_t *param, int pv_get_pai(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { - int idxf; - int idx; - p_id_body_t *pai_body = NULL; + int idxf; + int idx; + p_id_body_t *pai_body = NULL; to_body_t *pai_uri = NULL; int i, cur_id; - if(msg==NULL) + if(msg==NULL) return -1; - + if(parse_pai_header(msg) < 0) - { + { LM_DBG("no P-Asserted-Identity header\n"); return pv_get_null(msg, param, res); - } + } - if (pv_get_spec_index(msg, param, &idx, &idxf) != 0) - { - LM_ERR("Invalid index\n"); + if (pv_get_spec_index(msg, param, &idx, &idxf) != 0) + { + LM_ERR("Invalid index\n"); return -1; - } + } - if (idxf == PV_IDX_ALL) + if (idxf == PV_IDX_ALL) { LM_ERR("Unable to return 'all' PAI values\n"); return -1; @@ -1090,26 +1101,26 @@ int pv_get_dset(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { str s; - if(msg==NULL) + if(msg==NULL) return -1; - - s.s = print_dset(msg, &s.len); - if (s.s == NULL) + + s.s = print_dset(msg, &s.len); + if (s.s == NULL) return pv_get_null(msg, param, res); - s.len -= CRLF_LEN; + s.len -= CRLF_LEN; return pv_get_strval(msg, param, res, &s); } int pv_get_dsturi(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { - if(msg==NULL) + if(msg==NULL) return -1; - - if (msg->dst_uri.s == NULL) { + + if (msg->dst_uri.s == NULL) { LM_DBG("no destination URI\n"); return pv_get_null(msg, param, res); - } + } return pv_get_strval(msg, param, res, &msg->dst_uri); } @@ -1121,7 +1132,7 @@ int pv_get_dsturi_attr(struct sip_msg *msg, pv_param_t *param, if(msg==NULL) return -1; - + if (msg->dst_uri.s == NULL) { LM_DBG("no destination URI\n"); return pv_get_null(msg, param, res); @@ -1132,15 +1143,20 @@ int pv_get_dsturi_attr(struct sip_msg *msg, pv_param_t *param, LM_ERR("failed to parse dst uri\n"); return pv_get_null(msg, param, res); } - + if(param->pvn.u.isname.name.n==1) /* domain */ { if(uri.host.s==NULL || uri.host.len<=0) return pv_get_null(msg, param, res); return pv_get_strval(msg, param, res, &uri.host); } else if(param->pvn.u.isname.name.n==2) /* port */ { - if(uri.port.s==NULL) - return pv_get_5060(msg, param, res); + if(uri.port.s==NULL || uri.port.len<=0) { + if(uri.proto==PROTO_TLS) { + return pv_get_5061(msg, param, res); + } else { + return pv_get_5060(msg, param, res); + } + } return pv_get_strintval(msg, param, res, &uri.port, (int)uri.port_no); } else if(param->pvn.u.isname.name.n==3) /* proto */ { if(uri.transport_val.s==NULL) @@ -1156,17 +1172,17 @@ int pv_get_dsturi_attr(struct sip_msg *msg, pv_param_t *param, int pv_get_content_type(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { - if(msg==NULL) + if(msg==NULL) return -1; if(msg->content_type==NULL && ((parse_headers(msg, HDR_CONTENTTYPE_F, 0)==-1) - || (msg->content_type==NULL))) + || (msg->content_type==NULL))) { LM_DBG("no Content-Type header\n"); return pv_get_null(msg, param, res); } - + return pv_get_strval(msg, param, res, &msg->content_type->body); } @@ -1174,16 +1190,16 @@ int pv_get_content_type(struct sip_msg *msg, pv_param_t *param, int pv_get_content_length(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { - if(msg==NULL) + if(msg==NULL) return -1; if(msg->content_length==NULL && ((parse_headers(msg, HDR_CONTENTLENGTH_F, 0)==-1) - || (msg->content_length==NULL))) + || (msg->content_length==NULL))) { LM_DBG("no Content-Length header\n"); return pv_get_null(msg, param, res); } - + return pv_get_intstrval(msg, param, res, (int)(long)msg->content_length->parsed, &msg->content_length->body); @@ -1202,7 +1218,7 @@ int pv_get_msg_body(struct sip_msg *msg, pv_param_t *param, { LM_DBG("no message body\n"); return pv_get_null(msg, param, res); - } + } s.len = msg->buf + msg->len - s.s; return pv_get_strval(msg, param, res, &s); @@ -1213,9 +1229,9 @@ int pv_get_body_size(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { str s; - if(msg==NULL) + if(msg==NULL) return -1; - + s.s = get_body( msg ); s.len = 0; @@ -1229,11 +1245,11 @@ int pv_get_authattr(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { struct hdr_field *hdr; - - if(msg==NULL) + + if(msg==NULL) return -1; - - if ((msg->REQ_METHOD == METHOD_ACK) || + + if ((msg->REQ_METHOD == METHOD_ACK) || (msg->REQ_METHOD == METHOD_CANCEL)) { LM_DBG("no [Proxy-]Authorization header\n"); return pv_get_null(msg, param, res); @@ -1247,9 +1263,9 @@ int pv_get_authattr(struct sip_msg *msg, pv_param_t *param, } hdr = (msg->proxy_auth==0)?msg->authorization:msg->proxy_auth; - + if(parse_credentials(hdr)!=0) { - LM_ERR("failed to parse credentials\n"); + LM_ERR("failed to parse credentials\n"); return pv_get_null(msg, param, res); } switch(param->pvn.u.isname.name.n) @@ -1289,7 +1305,7 @@ int pv_get_authattr(struct sip_msg *msg, pv_param_t *param, default: return pv_get_strval(msg, param, res, &((auth_body_t*)(hdr->parsed))->digest.username.whole); - } + } } static inline str *cred_user(struct sip_msg *rq) @@ -1301,7 +1317,7 @@ static inline str *cred_user(struct sip_msg *rq) if (!h) get_authorized_cred(rq->authorization, &h); if (!h) return 0; cred=(auth_body_t*)(h->parsed); - if (!cred || !cred->digest.username.user.len) + if (!cred || !cred->digest.username.user.len) return 0; return &cred->digest.username.user; } @@ -1353,7 +1369,7 @@ int pv_get_acc_username(struct sip_msg *msg, pv_param_t *param, } return pv_get_strval(msg, param, res, user); } - + /* from from uri */ if(parse_from_header(msg)<0) { @@ -1398,7 +1414,7 @@ int pv_get_branch(struct sip_msg *msg, pv_param_t *param, if (!branch.s) { return pv_get_null(msg, param, res); } - + return pv_get_strval(msg, param, res, &branch); } @@ -1420,7 +1436,7 @@ int pv_get_branches(struct sip_msg *msg, pv_param_t *param, if(msg->first_line.type == SIP_REPLY) return pv_get_null(msg, param, res); - + cnt = s.len = 0; while ((uri.s = get_branch(cnt, &uri.len, &q, 0, 0, 0, 0, 0, 0, 0))) @@ -1434,7 +1450,7 @@ int pv_get_branches(struct sip_msg *msg, pv_param_t *param, } if (cnt == 0) - return pv_get_null(msg, param, res); + return pv_get_null(msg, param, res); s.len += (cnt - 1) * PV_FIELD_DELIM_LEN; if (s.len + 1 > pv_get_buffer_size()) @@ -1508,7 +1524,7 @@ int pv_get_avp(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) LM_ERR("invalid index\n"); return -1; } - + memset(&state, 0, sizeof(struct search_state)); if ((avp=search_first_avp(name_type, avp_name, &avp_value, &state))==0) return pv_get_null(msg, param, res); @@ -1519,7 +1535,7 @@ int pv_get_avp(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { res->rs = avp_value.s; } else { - res->rs.s = int2str(avp_value.n, &res->rs.len); + res->rs.s = sint2str(avp_value.n, &res->rs.len); res->ri = avp_value.n; res->flags |= PV_VAL_INT|PV_TYPE_INT; } @@ -1545,9 +1561,9 @@ int pv_get_avp(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { res->rs = avp_value.s; } else { - res->rs.s = int2str(avp_value.n, &res->rs.len); + res->rs.s = sint2str(avp_value.n, &res->rs.len); } - + if(p-p_ini+res->rs.len+1>p_size) { LM_ERR("local buffer length exceeded!\n"); @@ -1580,7 +1596,7 @@ int pv_get_avp(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { res->rs = avp_value.s; } else { - res->rs.s = int2str(avp_value.n, &res->rs.len); + res->rs.s = sint2str(avp_value.n, &res->rs.len); res->ri = avp_value.n; res->flags |= PV_VAL_INT|PV_TYPE_INT; } @@ -1588,8 +1604,8 @@ int pv_get_avp(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) } } n=0; - while(nrs = avp_value.s; } else { - res->rs.s = int2str(avp_value.n, &res->rs.len); + res->rs.s = sint2str(avp_value.n, &res->rs.len); res->ri = avp_value.n; res->flags |= PV_VAL_INT|PV_TYPE_INT; } @@ -1784,13 +1800,13 @@ int pv_get_scriptvar(struct sip_msg *msg, pv_param_t *param, int ival = 0; char *sval = NULL; script_var_t *sv=NULL; - + if(msg==NULL || res==NULL) return -1; if(param==NULL || param->pvn.u.dname==0) return pv_get_null(msg, param, res); - + sv= (script_var_t*)param->pvn.u.dname; if((sv->v.flags&VAR_TYPE_NULL) && (sv->v.flags&VAR_VAL_NULL)) @@ -1840,7 +1856,7 @@ int pv_get_cnt(struct sip_msg *msg, pv_param_t *param, avp=search_first_avp(avp_type, avp_name, NULL, &state); while(avp) { n++; - avp=search_next_avp(&state, NULL); + avp=search_next_avp(&state, NULL); } return pv_get_uintval(msg, param, res, n); @@ -1855,12 +1871,12 @@ int pv_get_ruid(struct sip_msg *msg, pv_param_t *param, if(msg->first_line.type == SIP_REPLY) return pv_get_null(msg, param, res); - if(msg->ruid.len==0) + if(msg->ruid.len==0) { LM_DBG("no ruid\n"); return pv_get_null(msg, param, res); } - + return pv_get_strval(msg, param, res, &msg->ruid); } @@ -1873,12 +1889,12 @@ int pv_get_location_ua(struct sip_msg *msg, pv_param_t *param, if(msg->first_line.type == SIP_REPLY) return pv_get_null(msg, param, res); - if(msg->location_ua.len==0) + if(msg->location_ua.len==0) { LM_DBG("no location_ua\n"); return pv_get_null(msg, param, res); } - + return pv_get_strval(msg, param, res, &msg->location_ua); } @@ -1913,7 +1929,7 @@ int pv_set_avp(struct sip_msg* msg, pv_param_t *param, unsigned short name_type; int idxf; int idx; - + if(param==NULL) { LM_ERR("bad parameters\n"); @@ -2017,7 +2033,7 @@ int pv_set_dsturi(struct sip_msg* msg, pv_param_t *param, LM_ERR("bad parameters\n"); return -1; } - + if((val==NULL) || (val->flags&PV_VAL_NULL)) { reset_dst_uri(msg); @@ -2028,7 +2044,7 @@ int pv_set_dsturi(struct sip_msg* msg, pv_param_t *param, LM_ERR("error - str value required to set dst uri\n"); goto error; } - + if(set_dst_uri(msg, &val->rs)!=0) goto error; /* dst_uri changed, so it makes sense to re-use the current uri for @@ -2058,7 +2074,7 @@ int pv_set_ruri(struct sip_msg* msg, pv_param_t *param, LM_ERR("str value required to set R-URI\n"); goto error; } - + memset(&act, 0, sizeof(act)); act.val[0].type = STRING_ST; act.val[0].u.string = val->rs.s; @@ -2091,7 +2107,7 @@ int pv_set_ruri_user(struct sip_msg* msg, pv_param_t *param, LM_ERR("bad parameters\n"); return -1; } - + if((val==NULL) || (val->flags&PV_VAL_NULL) || ((val->flags&PV_VAL_STR) && val->rs.len<=0)) { @@ -2113,7 +2129,7 @@ int pv_set_ruri_user(struct sip_msg* msg, pv_param_t *param, LM_ERR("str value required to set R-URI user\n"); goto error; } - + memset(&act, 0, sizeof(act)); act.val[0].type = STRING_ST; act.val[0].u.string = val->rs.s; @@ -2152,7 +2168,7 @@ int pv_set_ruri_host(struct sip_msg* msg, pv_param_t *param, LM_ERR("str value required to set R-URI hostname\n"); goto error; } - + memset(&act, 0, sizeof(act)); act.val[0].type = STRING_ST; act.val[0].u.string = val->rs.s; @@ -2185,7 +2201,7 @@ int pv_set_ruri_port(struct sip_msg* msg, pv_param_t *param, LM_ERR("bad parameters\n"); return -1; } - + if(val == NULL || (val->flags&PV_VAL_NULL)) { memset(&act, 0, sizeof(act)); @@ -2206,7 +2222,7 @@ int pv_set_ruri_port(struct sip_msg* msg, pv_param_t *param, val->rs.s = int2str(val->ri, &val->rs.len); val->flags |= PV_VAL_STR; } - + memset(&act, 0, sizeof(act)); act.val[0].type = STRING_ST; act.val[0].u.string = val->rs.s; @@ -2241,7 +2257,7 @@ int pv_set_branch(struct sip_msg* msg, pv_param_t *param, LM_ERR("str value required to set the branch\n"); goto error; } - + if (km_append_branch( msg, &val->rs, 0, 0, Q_UNSPECIFIED, 0, msg->force_send_socket)!=1 ) { @@ -2261,7 +2277,7 @@ int pv_set_force_sock(struct sip_msg* msg, pv_param_t *param, int port, proto; str host; char backup; - + if(msg==NULL || param==NULL) { LM_ERR("bad parameters\n"); @@ -2279,7 +2295,7 @@ int pv_set_force_sock(struct sip_msg* msg, pv_param_t *param, LM_ERR("str value required to set the force send sock\n"); goto error; } - + backup = val->rs.s[val->rs.len]; val->rs.s[val->rs.len] = '\0'; if (parse_phostport(val->rs.s, &host.s, &host.len, &port, &proto) < 0) @@ -2311,7 +2327,7 @@ int pv_set_mflags(struct sip_msg* msg, pv_param_t *param, LM_ERR("bad parameters\n"); return -1; } - + if(val == NULL || (val->flags&PV_VAL_NULL)) { msg->flags = 0; @@ -2323,7 +2339,7 @@ int pv_set_mflags(struct sip_msg* msg, pv_param_t *param, LM_ERR("assigning non-int value to msg flags\n"); return -1; } - + msg->flags = val->ri; return 0; @@ -2356,7 +2372,7 @@ int pv_set_mflag(struct sip_msg* msg, pv_param_t *param, return -1; } - if (val->ri) + if (val->ri) setflag(msg, param->pvn.u.isname.name.n); else resetflag(msg, param->pvn.u.isname.name.n); @@ -2372,7 +2388,7 @@ int pv_set_sflags(struct sip_msg* msg, pv_param_t *param, LM_ERR("bad parameters\n"); return -1; } - + if(val == NULL || (val->flags&PV_VAL_NULL)) { setsflagsval(0); @@ -2384,7 +2400,7 @@ int pv_set_sflags(struct sip_msg* msg, pv_param_t *param, LM_ERR("assigning non-int value to script flags\n"); return -1; } - + setsflagsval((unsigned int)val->ri); return 0; @@ -2398,7 +2414,7 @@ int pv_set_sflag(struct sip_msg* msg, pv_param_t *param, LM_ERR("bad parameters\n"); return -1; } - + if(val == NULL || (val->flags&PV_VAL_NULL)) { setsflagsval(0); @@ -2410,14 +2426,14 @@ int pv_set_sflag(struct sip_msg* msg, pv_param_t *param, LM_ERR("assigning non-int value to script flags\n"); return -1; } - + if (param->pvn.type != PV_NAME_INTSTR) { LM_ERR("missing flag number\n"); return -1; } - if (val->ri) + if (val->ri) setsflag(param->pvn.u.isname.name.n); else resetsflag(param->pvn.u.isname.name.n); @@ -2434,7 +2450,7 @@ int pv_set_bflags(struct sip_msg* msg, pv_param_t *param, LM_ERR("bad parameters\n"); return -1; } - + if(val == NULL || (val->flags&PV_VAL_NULL)) { setbflagsval(0, 0); @@ -2446,7 +2462,7 @@ int pv_set_bflags(struct sip_msg* msg, pv_param_t *param, LM_ERR("assigning non-int value to branch 0 flags\n"); return -1; } - + setbflagsval(0, (flag_t)val->ri); return 0; @@ -2460,7 +2476,7 @@ int pv_set_bflag(struct sip_msg* msg, pv_param_t *param, LM_ERR("bad parameters\n"); return -1; } - + if(val == NULL || (val->flags&PV_VAL_NULL)) { setbflagsval(0, 0); @@ -2472,14 +2488,14 @@ int pv_set_bflag(struct sip_msg* msg, pv_param_t *param, LM_ERR("assigning non-int value to branch 0 flags\n"); return -1; } - + if (param->pvn.type != PV_NAME_INTSTR) { LM_ERR("missing flag number\n"); return -1; } - if (val->ri) + if (val->ri) setbflag(0, param->pvn.u.isname.name.n); else resetbflag(0, param->pvn.u.isname.name.n); @@ -2500,7 +2516,7 @@ int pv_set_xto_attr(struct sip_msg* msg, pv_param_t *param, LM_ERR("bad parameters\n"); return -1; } - + switch(type) { case 0: /* uri */ @@ -2785,7 +2801,7 @@ int pv_parse_hdr_name(pv_spec_p sp, str *in) if(in==NULL || in->s==NULL || sp==NULL) return -1; - + p = in->s; if(*p==PV_MARKER) { diff --git a/modules/pv/pv_shv.c b/modules/pv/pv_shv.c index 67f03acbc38..499cff53828 100644 --- a/modules/pv/pv_shv.c +++ b/modules/pv/pv_shv.c @@ -14,8 +14,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -324,7 +324,7 @@ int pv_parse_shvar_name(pv_spec_p sp, str *in) { if(in==NULL || in->s==NULL || sp==NULL) return -1; - + sp->pvp.pvn.type = PV_NAME_PVAR; sp->pvp.pvn.u.dname = (void*)add_shvar(in); @@ -343,13 +343,13 @@ int pv_get_shvar(struct sip_msg *msg, pv_param_t *param, int len = 0; char *sval = NULL; sh_var_t *shv=NULL; - + if(msg==NULL || res==NULL) return -1; if(param==NULL || param->pvn.u.dname==0) return pv_get_null(msg, param, res); - + shv= (sh_var_t*)param->pvn.u.dname; lock_shvar(shv); @@ -369,16 +369,16 @@ int pv_get_shvar(struct sip_msg *msg, pv_param_t *param, } strncpy(shv_cpy.s, shv->v.value.s.s, shv->v.value.s.len); shv_cpy.len = shv->v.value.s.len; - + unlock_shvar(shv); - + res->rs = shv_cpy; res->flags = PV_VAL_STR; } else { res->ri = shv->v.value.n; - + unlock_shvar(shv); - + sval = sint2str(res->ri, &len); res->rs.s = sval; res->rs.len = len; @@ -522,15 +522,15 @@ struct mi_root* mi_shvar_get(struct mi_root* cmd_tree, void* param) shv = get_shvar_by_name(&name); if(shv==NULL) return init_mi_tree(404, MI_SSTR("Not found")); - + rpl_tree = init_mi_tree(200, MI_OK_S, MI_OK_LEN); if (rpl_tree==NULL) return NULL; node = add_mi_node_child(&rpl_tree->node, MI_DUP_VALUE, "VAR",3, name.s, name.len); - if(node == NULL) - goto error; + if(node == NULL) + goto error; lock_shvar(shv); if(shv->v.flags&VAR_VAL_STR) { @@ -542,7 +542,7 @@ struct mi_root* mi_shvar_get(struct mi_root* cmd_tree, void* param) } attr = add_mi_attr (node, MI_DUP_VALUE, "value", 5, shv->v.value.s.s, shv->v.value.s.len); - if(attr == 0) + if(attr == 0) { unlock_shvar(shv); goto error; @@ -557,7 +557,7 @@ struct mi_root* mi_shvar_get(struct mi_root* cmd_tree, void* param) name.s = sint2str(ival, &name.len); attr = add_mi_attr (node, MI_DUP_VALUE, "value",5, name.s, name.len); - if(attr == 0) + if(attr == 0) goto error; } @@ -572,8 +572,8 @@ struct mi_root* mi_shvar_get(struct mi_root* cmd_tree, void* param) { node = add_mi_node_child(&rpl_tree->node, MI_DUP_VALUE, "VAR", 3, shv->name.s, shv->name.len); - if(node == NULL) - goto error; + if(node == NULL) + goto error; lock_shvar(shv); if(shv->v.flags&VAR_VAL_STR) @@ -586,7 +586,7 @@ struct mi_root* mi_shvar_get(struct mi_root* cmd_tree, void* param) } attr = add_mi_attr (node, MI_DUP_VALUE, "value", 5, shv->v.value.s.s, shv->v.value.s.len); - if(attr == 0) + if(attr == 0) { unlock_shvar(shv); goto error; @@ -601,7 +601,7 @@ struct mi_root* mi_shvar_get(struct mi_root* cmd_tree, void* param) name.s = sint2str(ival, &name.len); attr = add_mi_attr (node, MI_DUP_VALUE, "value",5, name.s, name.len); - if(attr == 0) + if(attr == 0) goto error; } } @@ -621,12 +621,12 @@ void rpc_shv_get(rpc_t* rpc, void* c) int allvars = 0; sh_var_t *shv = NULL; void* th; - void* ih; - void* vh; + void* ih; + void* vh; if (rpc->scan(c, "S", &varname) != 1) { allvars = 1; - } + } if (!allvars) { /* Get one variable value */ @@ -636,11 +636,11 @@ void rpc_shv_get(rpc_t* rpc, void* c) return; } if (rpc->add(c, "{", &ih) < 0) - { - rpc->fault(c, 500, "Internal error creating rpc"); - return; - } - + { + rpc->fault(c, 500, "Internal error creating rpc"); + return; + } + lock_shvar(shv); if(shv->v.flags&VAR_VAL_STR) { @@ -663,25 +663,25 @@ void rpc_shv_get(rpc_t* rpc, void* c) return; } if (rpc->add(c, "{", &th) < 0) - { - rpc->fault(c, 500, "Internal error creating rpc"); - return; - } + { + rpc->fault(c, 500, "Internal error creating rpc"); + return; + } if(rpc->struct_add(th, "{", "items", &ih) < 0) - { - rpc->fault(c, 500, "Internal error creating rpc th"); - return; - } + { + rpc->fault(c, 500, "Internal error creating rpc th"); + return; + } for(shv=sh_vars; shv; shv=shv->next) { lock_shvar(shv); if(rpc->struct_add(ih, "{", "shv", &vh) < 0) - { - rpc->fault(c, 500, "Internal error creating rpc th"); - return; - } + { + rpc->fault(c, 500, "Internal error creating rpc th"); + return; + } if(shv->v.flags&VAR_VAL_STR) { if(rpc->struct_add(vh, "sss", "name", shv->name.s, "type", "string", "value", shv->v.value.s.s) < 0) @@ -716,24 +716,24 @@ void rpc_shv_set(rpc_t* rpc, void* c) if (rpc->scan(c, "S", &varname) != 1) { rpc->fault(c, 500, "Missing parameter varname (Parameters: varname type value)"); return; - } + } LM_DBG("SHV_set Varname %.*s \n", varname.len, varname.s); if (rpc->scan(c, "S", &type) != 1) { rpc->fault(c, 500, "Missing parameter type (Parameters: varname type value)"); return; - } + } if (strcasecmp(type.s, "int") == 0 ) { if (rpc->scan(c, "d", &ival) != 1) { rpc->fault(c, 500, "Missing integer parameter value (Parameters: varname type value)"); return; - } + } isv.n = ival; } else if (strcasecmp(type.s, "str") == 0 ) { /* String value */ if (rpc->scan(c, "S", &value) != 1) { rpc->fault(c, 500, "Missing parameter value (Parameters: varname type value)"); return; - } + } isv.s = value; flags = VAR_VAL_STR; } else { @@ -746,7 +746,7 @@ void rpc_shv_set(rpc_t* rpc, void* c) rpc->fault(c, 404, "Variable not found"); return; } - + lock_shvar(shv); if(set_shvar_value(shv, &isv, flags)==NULL) { @@ -770,7 +770,7 @@ int param_set_xvar( modparam_t type, void* val, int mode) script_var_t *pkv; sh_var_t *shv; - if(!shm_initialized()!=0) + if(!shm_initialized()) { LM_ERR("shm not initialized - cannot set value for PVs\n"); return -1; @@ -785,7 +785,7 @@ int param_set_xvar( modparam_t type, void* val, int mode) if(*p!='=') goto error; - + s.len = p - s.s; if(s.len == 0) goto error; @@ -820,7 +820,7 @@ int param_set_xvar( modparam_t type, void* val, int mode) if(set_shvar_value(shv, &isv, flags)==NULL) goto error; } - + return 0; error: LM_ERR("unable to set shv parame [%s]\n", s.s); diff --git a/modules/pv/pv_svar.c b/modules/pv/pv_svar.c index 3b4c7100c2d..ae22db1397c 100644 --- a/modules/pv/pv_svar.c +++ b/modules/pv/pv_svar.c @@ -70,7 +70,7 @@ script_var_t* add_var(str *name, int vtype) return 0; } it->name.len = name->len; - strncpy(it->name.s, name->s, name->len); + memcpy(it->name.s, name->s, name->len); it->name.s[it->name.len] = '\0'; if(vtype==VAR_TYPE_NULL) { @@ -133,7 +133,7 @@ script_var_t* set_var_value(script_var_t* var, int_str *value, int flags) } var->v.flags |= VAR_VAL_STR; } - strncpy(var->v.value.s.s, value->s.s, value->s.len); + memcpy(var->v.value.s.s, value->s.s, value->s.len); var->v.value.s.len = value->s.len; var->v.value.s.s[value->s.len] = '\0'; } else { diff --git a/modules/pv/pv_svar.h b/modules/pv/pv_svar.h index c955e06fdc3..f31839fbb2b 100644 --- a/modules/pv/pv_svar.h +++ b/modules/pv/pv_svar.h @@ -13,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ diff --git a/modules/pv/pv_trans.c b/modules/pv/pv_trans.c index 17ad35d48b1..942803db14e 100644 --- a/modules/pv/pv_trans.c +++ b/modules/pv/pv_trans.c @@ -14,8 +14,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -33,8 +33,8 @@ #include "../../dprint.h" #include "../../mem/mem.h" -#include "../../ut.h" -#include "../../trim.h" +#include "../../ut.h" +#include "../../trim.h" #include "../../pvapi.h" #include "../../dset.h" #include "../../basex.h" @@ -198,7 +198,7 @@ static int pdu_7bit_encode(str sin) { sin.s++; i++; nleft = 1; - } + } sin.s++; } _tr_buffer[j] = '\0'; @@ -230,11 +230,11 @@ static int pdu_7bit_decode(str sin) { } } _tr_buffer[j] = '\0'; - return j; + return j; } /* Get only the numeric part of string, e.g. - 040/123-456 => 040123456 */ + * 040/123-456 => 040123456 */ static int getNumericValue(str sin) { int i, j = 0; for(i = 0; i < sin.len; i ++) { @@ -285,7 +285,7 @@ int tr_eval_string(struct sip_msg *msg, tr_param_t *tp, int subtype, { if(str2sint(&val->rs, &val->ri)!=0) return -1; - } else { + } else { if(!(val->flags&PV_VAL_STR)) val->rs.s = int2str(val->ri, &val->rs.len); } @@ -676,7 +676,7 @@ int tr_eval_string(struct sip_msg *msg, tr_param_t *tp, int subtype, st.len = val->rs.len; for (i=0; irs.s[i]>='A' && val->rs.s[i]<='Z') - ?('a' + val->rs.s[i] -'A'):val->rs.s[i]; + ?('a' + val->rs.s[i] -'A'):val->rs.s[i]; memset(val, 0, sizeof(pv_value_t)); val->flags = PV_VAL_STR; val->rs = st; @@ -695,7 +695,7 @@ int tr_eval_string(struct sip_msg *msg, tr_param_t *tp, int subtype, st.len = val->rs.len; for (i=0; irs.s[i]>='a' && val->rs.s[i]<='z') - ?('A' + val->rs.s[i] -'a'):val->rs.s[i]; + ?('A' + val->rs.s[i] -'a'):val->rs.s[i]; memset(val, 0, sizeof(pv_value_t)); val->flags = PV_VAL_STR; val->rs = st; @@ -860,7 +860,7 @@ int tr_eval_string(struct sip_msg *msg, tr_param_t *tp, int subtype, } st2 = w.rs; } - + val->flags = PV_VAL_STR; val->ri = 0; @@ -915,7 +915,7 @@ int tr_eval_string(struct sip_msg *msg, tr_param_t *tp, int subtype, s[st.len] = '\0'; t = val->ri; val->rs.len = strftime(_tr_buffer, TR_BUFFER_SIZE-1, s, - localtime(&t)); + localtime(&t)); pkg_free(s); val->flags = PV_VAL_STR; val->rs.s = _tr_buffer; @@ -980,16 +980,16 @@ int tr_eval_string(struct sip_msg *msg, tr_param_t *tp, int subtype, switch(st.s[i+1]) { case 'n': p[j++] = '\n'; - break; + break; case 'r': p[j++] = '\r'; - break; + break; case 't': p[j++] = '\t'; - break; + break; case '\\': p[j++] = '\\'; - break; + break; default: p[j++] = st.s[i+1]; } @@ -1203,7 +1203,7 @@ int tr_eval_uri(struct sip_msg *msg, tr_param_t *tp, int subtype, break; case TR_URI_HEADERS: val->rs = (_tr_parsed_uri.headers.s)?_tr_parsed_uri.headers: - _tr_empty; + _tr_empty; break; case TR_URI_TRANSPORT: val->rs = (_tr_parsed_uri.transport_val.s)? @@ -1275,7 +1275,7 @@ int tr_eval_paramlist(struct sip_msg *msg, tr_param_t *tp, int subtype, if(tp->type != TR_PARAM_STRING || tp->v.s.len != 1) return -1; - separator = tp->v.s.s[0]; + separator = tp->v.s.s[0]; } else if (tp->next != NULL) { @@ -1312,21 +1312,21 @@ int tr_eval_paramlist(struct sip_msg *msg, tr_param_t *tp, int subtype, _tr_params_str.len = val->rs.len; memcpy(_tr_params_str.s, val->rs.s, val->rs.len); _tr_params_str.s[_tr_params_str.len] = '\0'; - + /* reset old values */ if(_tr_params_list != NULL) { free_params(_tr_params_list); _tr_params_list = 0; } - + /* parse params */ sv = _tr_params_str; if (parse_params2(&sv, CLASS_ANY, &phooks, &_tr_params_list, _tr_params_separator)<0) return -1; } - + if(_tr_params_list==NULL) return -1; @@ -1354,7 +1354,7 @@ int tr_eval_paramlist(struct sip_msg *msg, tr_param_t *tp, int subtype, } sv = v.rs; } - + for (pit = _tr_params_list; pit; pit=pit->next) { if (pit->name.len==sv.len @@ -1400,7 +1400,7 @@ int tr_eval_paramlist(struct sip_msg *msg, tr_param_t *tp, int subtype, n--; } } else { - /* ugly hack -- params are in reverse order + /* ugly hack -- params are in reverse order * - first count then find */ i = 0; for (pit = _tr_params_list; pit; pit=pit->next) @@ -1455,7 +1455,7 @@ int tr_eval_paramlist(struct sip_msg *msg, tr_param_t *tp, int subtype, n--; } } else { - /* ugly hack -- params are in reverse order + /* ugly hack -- params are in reverse order * - first count then find */ i = 0; for (pit = _tr_params_list; pit; pit=pit->next) @@ -1535,10 +1535,10 @@ int tr_eval_nameaddr(struct sip_msg *msg, tr_param_t *tp, int subtype, _tr_nameaddr_str.len = val->rs.len; memcpy(_tr_nameaddr_str.s, val->rs.s, val->rs.len); _tr_nameaddr_str.s[_tr_nameaddr_str.len] = '\0'; - + /* reset old values */ memset(&_tr_nameaddr, 0, sizeof(name_addr_t)); - + /* parse params */ sv = _tr_nameaddr_str; ret = parse_nameaddr(&sv, &_tr_nameaddr); @@ -1550,7 +1550,7 @@ int tr_eval_nameaddr(struct sip_msg *msg, tr_param_t *tp, int subtype, _tr_nameaddr.len = _tr_nameaddr_str.len; } } - + memset(val, 0, sizeof(pv_value_t)); val->flags = PV_VAL_STR; @@ -1618,11 +1618,11 @@ int tr_eval_tobody(struct sip_msg *msg, tr_param_t *tp, int subtype, _tr_tobody_str.s[_tr_tobody_str.len] = '\r'; _tr_tobody_str.s[_tr_tobody_str.len+1] = '\n'; _tr_tobody_str.s[_tr_tobody_str.len+2] = '\0'; - + /* reset old values */ free_to_params(&_tr_tobody); memset(&_tr_tobody, 0, sizeof(struct to_body)); - + /* parse params */ sv = _tr_tobody_str; parse_to(sv.s, sv.s + sv.len + 2, &_tr_tobody); @@ -1635,7 +1635,7 @@ int tr_eval_tobody(struct sip_msg *msg, tr_param_t *tp, int subtype, return -1; } if (parse_uri(_tr_tobody.uri.s, _tr_tobody.uri.len, - &_tr_tobody.parsed_uri)<0) + &_tr_tobody.parsed_uri)<0) { free_to_params(&_tr_tobody); memset(&_tr_tobody, 0, sizeof(struct to_body)); @@ -1644,7 +1644,7 @@ int tr_eval_tobody(struct sip_msg *msg, tr_param_t *tp, int subtype, return -1; } } - + memset(val, 0, sizeof(pv_value_t)); val->flags = PV_VAL_STR; @@ -1661,18 +1661,18 @@ int tr_eval_tobody(struct sip_msg *msg, tr_param_t *tp, int subtype, break; case TR_TOBODY_URI_USER: val->rs = (_tr_tobody.parsed_uri.user.s) - ?_tr_tobody.parsed_uri.user:_tr_empty; + ?_tr_tobody.parsed_uri.user:_tr_empty; break; case TR_TOBODY_URI_HOST: val->rs = (_tr_tobody.parsed_uri.host.s) - ?_tr_tobody.parsed_uri.host:_tr_empty; + ?_tr_tobody.parsed_uri.host:_tr_empty; break; case TR_TOBODY_PARAMS: if(_tr_tobody.param_lst!=NULL) { val->rs.s = _tr_tobody.param_lst->name.s; val->rs.len = _tr_tobody_str.s + _tr_tobody_str.len - - val->rs.s; + - val->rs.s; } else val->rs = _tr_empty; break; @@ -1895,7 +1895,7 @@ int tr_eval_line(struct sip_msg *msg, tr_param_t *tp, int subtype, if(_p0==NULL) \ { \ LM_ERR("invalid spec in substr transformation: %.*s!\n", \ - _in->len, _in->s); \ + _in->len, _in->s); \ goto error; \ } \ _p = _p0; \ @@ -1918,7 +1918,7 @@ int tr_eval_line(struct sip_msg *msg, tr_param_t *tp, int subtype, } else if(*_p=='+') _p++; \ _n = 0; \ while(is_in_str(_p, _in) && (*_p==' ' || *_p=='\t' || *_p=='\n')) \ - _p++; \ + _p++; \ while(is_in_str(_p, _in) && *_p>='0' && *_p<='9') \ { \ _n = _n*10 + *_p - '0'; \ @@ -1935,7 +1935,7 @@ int tr_eval_line(struct sip_msg *msg, tr_param_t *tp, int subtype, _tp->v.n = sign*n; \ } else { \ LM_ERR("tinvalid param in transformation: %.*s!!\n", \ - _in->len, _in->s); \ + _in->len, _in->s); \ goto error; \ } \ } @@ -1955,7 +1955,7 @@ int tr_eval_line(struct sip_msg *msg, tr_param_t *tp, int subtype, if(_p0==NULL) \ { \ LM_ERR("invalid spec in substr transformation: %.*s!\n", \ - _in->len, _in->s); \ + _in->len, _in->s); \ goto error; \ } \ _p = _p0; \ @@ -1972,11 +1972,11 @@ int tr_eval_line(struct sip_msg *msg, tr_param_t *tp, int subtype, _ps = _p; \ while(is_in_str(_p, _in) && *_p!='\t' && *_p!='\n' \ && *_p!=TR_PARAM_MARKER && *_p!=TR_RBRACKET) \ - _p++; \ + _p++; \ if(*_p=='\0') \ { \ LM_ERR("invalid param in transformation: %.*s!!\n", \ - _in->len, _in->s); \ + _in->len, _in->s); \ goto error; \ } \ _tp = (tr_param_t*)pkg_malloc(sizeof(tr_param_t)); \ @@ -2105,7 +2105,7 @@ char* tr_parse_string(str* in, trans_t *t) if(*p!=TR_RBRACKET) { LM_ERR("invalid prefixes transformation: %.*s!!\n", - in->len, in->s); + in->len, in->s); goto error; } goto done; @@ -2121,7 +2121,7 @@ char* tr_parse_string(str* in, trans_t *t) if(*p!=TR_RBRACKET) { LM_ERR("invalid prefixes transformation: %.*s!!\n", - in->len, in->s); + in->len, in->s); goto error; } goto done; @@ -2140,7 +2140,7 @@ char* tr_parse_string(str* in, trans_t *t) if(*p!=TR_PARAM_MARKER) { LM_ERR("invalid substr transformation: %.*s!\n", - in->len, in->s); + in->len, in->s); goto error; } p++; @@ -2156,7 +2156,7 @@ char* tr_parse_string(str* in, trans_t *t) if(*p!=TR_RBRACKET) { LM_ERR("invalid substr transformation: %.*s!!\n", - in->len, in->s); + in->len, in->s); goto error; } goto done; @@ -2196,7 +2196,7 @@ char* tr_parse_string(str* in, trans_t *t) if(*p!=TR_RBRACKET) { LM_ERR("invalid select transformation: %.*s!!\n", - in->len, in->s); + in->len, in->s); goto error; } goto done; @@ -2216,7 +2216,7 @@ char* tr_parse_string(str* in, trans_t *t) if(*p!=TR_RBRACKET) { LM_ERR("invalid strip transformation: %.*s!!\n", - in->len, in->s); + in->len, in->s); goto error; } goto done; @@ -2236,7 +2236,7 @@ char* tr_parse_string(str* in, trans_t *t) if(*p!=TR_RBRACKET) { LM_ERR("invalid striptail transformation: %.*s!!\n", - in->len, in->s); + in->len, in->s); goto error; } goto done; @@ -2256,7 +2256,7 @@ char* tr_parse_string(str* in, trans_t *t) if(*p!=TR_RBRACKET) { LM_ERR("invalid strip transformation: %.*s!!\n", - in->len, in->s); + in->len, in->s); goto error; } goto done; @@ -2276,7 +2276,7 @@ char* tr_parse_string(str* in, trans_t *t) if(*p!=TR_RBRACKET) { LM_ERR("invalid ftime transformation: %.*s!!\n", - in->len, in->s); + in->len, in->s); goto error; } goto done; @@ -2295,7 +2295,7 @@ char* tr_parse_string(str* in, trans_t *t) if(*p!=TR_PARAM_MARKER) { LM_ERR("invalid replace transformation: %.*s!\n", - in->len, in->s); + in->len, in->s); goto error; } p++; @@ -2306,7 +2306,7 @@ char* tr_parse_string(str* in, trans_t *t) if(*p!=TR_RBRACKET) { LM_ERR("invalid replace transformation: %.*s!!\n", - in->len, in->s); + in->len, in->s); goto error; } goto done; @@ -2335,7 +2335,7 @@ char* tr_parse_string(str* in, trans_t *t) if(*p!=TR_RBRACKET) { LM_ERR("invalid ftime transformation: %.*s!!\n", - in->len, in->s); + in->len, in->s); goto error; } goto done; @@ -2532,7 +2532,7 @@ char* tr_parse_paramlist(str* in, trans_t *t) if (p - start_pos != 1) { LM_ERR("invalid separator in transformation: " - "%.*s\n", in->len, in->s); + "%.*s\n", in->len, in->s); goto error; } while(*p && (*p==' ' || *p=='\t' || *p=='\n')) p++; @@ -2555,7 +2555,7 @@ char* tr_parse_paramlist(str* in, trans_t *t) } p++; _tr_parse_nparam(p, p0, tp, spec, n, sign, in, s) - t->params = tp; + t->params = tp; tp = 0; while(is_in_str(p, in) && (*p==' ' || *p=='\t' || *p=='\n')) p++; @@ -2568,7 +2568,7 @@ char* tr_parse_paramlist(str* in, trans_t *t) if (p - start_pos != 1) { LM_ERR("invalid separator in transformation: " - "%.*s\n", in->len, in->s); + "%.*s\n", in->len, in->s); goto error; } while(*p && (*p==' ' || *p=='\t' || *p=='\n')) p++; @@ -2591,7 +2591,7 @@ char* tr_parse_paramlist(str* in, trans_t *t) } p++; _tr_parse_nparam(p, p0, tp, spec, n, sign, in, s) - t->params = tp; + t->params = tp; tp = 0; while(is_in_str(p, in) && (*p==' ' || *p=='\t' || *p=='\n')) p++; @@ -2604,7 +2604,7 @@ char* tr_parse_paramlist(str* in, trans_t *t) if (p - start_pos != 1) { LM_ERR("invalid separator in transformation: " - "%.*s\n", in->len, in->s); + "%.*s\n", in->len, in->s); goto error; } while(*p && (*p==' ' || *p=='\t' || *p=='\n')) p++; @@ -2628,7 +2628,7 @@ char* tr_parse_paramlist(str* in, trans_t *t) if (p - start_pos != 1) { LM_ERR("invalid separator in transformation: " - "%.*s\n", in->len, in->s); + "%.*s\n", in->len, in->s); goto error; } @@ -2636,7 +2636,7 @@ char* tr_parse_paramlist(str* in, trans_t *t) if(*p!=TR_RBRACKET) { LM_ERR("invalid name transformation: %.*s!\n", - in->len, in->s); + in->len, in->s); goto error; } } @@ -2821,7 +2821,7 @@ char* tr_parse_line(str* in, trans_t *t) } p++; _tr_parse_nparam(p, p0, tp, spec, n, sign, in, s) - t->params = tp; + t->params = tp; tp = 0; while(is_in_str(p, in) && (*p==' ' || *p=='\t' || *p=='\n')) p++; if(*p!=TR_RBRACKET) diff --git a/modules/pv/pv_xavp.c b/modules/pv/pv_xavp.c index 67ffd45d9e2..28bb06ed267 100644 --- a/modules/pv/pv_xavp.c +++ b/modules/pv/pv_xavp.c @@ -506,8 +506,10 @@ int pv_parse_xavp_name(pv_spec_p sp, str *in) return -1; xname = (pv_xavp_name_t*)pkg_malloc(sizeof(pv_xavp_name_t)); - if(xname==NULL) + if(xname==NULL) { + LM_ERR("not enough pkg mem\n"); return -1; + } memset(xname, 0, sizeof(pv_xavp_name_t)); @@ -530,9 +532,10 @@ int pv_parse_xavp_name(pv_spec_p sp, str *in) xname->name.s, s.len, s.s); xname->next = (pv_xavp_name_t*)pkg_malloc(sizeof(pv_xavp_name_t)); - if(xname->next==NULL) + if(xname->next==NULL) { + LM_ERR("not enough pkg mem\n"); goto error; - + } memset(xname->next, 0, sizeof(pv_xavp_name_t)); p = pv_xavp_fill_ni(&s, xname->next); @@ -631,7 +634,7 @@ int pv_var_to_xavp(str *varname, str *xname) if(varname->len==1 && varname->s[0] == '*') { for(it=get_var_all(); it; it=it->next) { memset(&xval, 0, sizeof(sr_xval_t)); - if(it->v.flags&VAR_VAL_INT) + if(it->v.flags==VAR_VAL_INT) { xval.type = SR_XTYPE_INT; xval.v.i = it->v.value.n; @@ -655,7 +658,7 @@ int pv_var_to_xavp(str *varname, str *xname) return -1; } memset(&xval, 0, sizeof(sr_xval_t)); - if(it->v.flags&VAR_VAL_INT) + if(it->v.flags==VAR_VAL_INT) { xval.type = SR_XTYPE_INT; xval.v.i = it->v.value.n; diff --git a/modules/qos/README b/modules/qos/README index 563edd73e19..96fc6183fe5 100644 --- a/modules/qos/README +++ b/modules/qos/README @@ -8,7 +8,7 @@ Edited by Ovidiu Sas - Copyright 2008 SOMA Networks, Inc. + Copyright © 2008 SOMA Networks, Inc. __________________________________________________________________ Table of Contents @@ -127,7 +127,7 @@ Chapter 1. Admin Guide This parameter must be set or the module will not load. - Default value is "Not set!". + Default value is “Not set!”. Example 1.1. Set qos_flag parameter ... @@ -176,7 +176,7 @@ Chapter 2. Developer Guide 1.1. register_qoscb (qos, type, cb, param) -1.1. register_qoscb (qos, type, cb, param) +1.1. register_qoscb (qos, type, cb, param) Register a new callback to the qos. @@ -195,7 +195,7 @@ Chapter 2. Developer Guide + QOSCB_REMOVE_SDP - called when an existing SDP is removed - it's a per qos type. + QOSCB_TERMINATED - called when the qos is terminated. - * qos_cb cb - callback function to be called. Prototype is: "void + * qos_cb cb - callback function to be called. Prototype is: “void (qos_cb) (struct qos_ctx_st *qos, int type, struct qos_cb_params - *params); " + *params); ” * void *param - parameter to be passed to the callback function. diff --git a/modules/ratelimit/README b/modules/ratelimit/README index fe4ee88657d..8a3e10d109f 100644 --- a/modules/ratelimit/README +++ b/modules/ratelimit/README @@ -18,9 +18,9 @@ Edited by Hendrik Scholz - Copyright 2006 Freenet Cityline GmbH + Copyright © 2006 Freenet Cityline GmbH - Copyright 2008-2010 VoIP Embedded Inc. + Copyright © 2008-2010 VoIP Embedded Inc. __________________________________________________________________ Table of Contents @@ -131,7 +131,7 @@ Chapter 1. Admin Guide associated with its own queue and a number of queues are connected to a certain pipe (see the queue and pipe params). - Please also take a look at the "pipelimit" module, that implements the + Please also take a look at the “pipelimit” module, that implements the pipe policy with database support. Note that it doesn't implement the queues that exist in this module. @@ -280,7 +280,7 @@ modparam("ratelimit", "timer_interval", 5) The format of the queue parameter is "pipe_no:method". For each defined method, the algorithm defined by pipe number "pipe_no" will be used. - To specify a queue that accepts all methods, use "*" instead of METHOD. + To specify a queue that accepts all methods, use “*” instead of METHOD. As queues are matched against request methods, you will usually want to have this as the last queue added or other queues with specific methods will never match. At this time, glob or regexp patterns are not @@ -327,7 +327,7 @@ modparam("ratelimit", "pipe", "4:NETWORK:10000") 6.1. rl_check([pvar]) 6.2. rl_check_pipe([pipe_no]) -6.1. rl_check([pvar]) +6.1. rl_check([pvar]) Check the current request against the matched ratelimit algorithm. If no parameter is provided, the queue will be matched based on method @@ -374,7 +374,7 @@ modparam("ratelimit", "pipe", "4:NETWORK:10000") }; ... -6.2. rl_check_pipe([pipe_no]) +6.2. rl_check_pipe([pipe_no]) Check the current request against the matched ratelimit algorithm. If no parameter is provided, the queue will be matched based on method @@ -419,7 +419,7 @@ modparam("ratelimit", "pipe", "4:NETWORK:10000") 7.8. rl.push_load 7.9. rl.set_dbg -7.1. rl.stats +7.1. rl.stats Lists the parameters and variables in the ratelimit module. @@ -430,7 +430,7 @@ modparam("ratelimit", "pipe", "4:NETWORK:10000") RPC Command Format: kamcmd rl.stats -7.2. rl.set_pipe +7.2. rl.set_pipe Sets the pipe parameters for the given pipe id. @@ -444,7 +444,7 @@ modparam("ratelimit", "pipe", "4:NETWORK:10000") RPC Command Format: kamcmd rl.set_pipe 2 RED 10 -7.3. rl.get_pipes +7.3. rl.get_pipes Gets the list of in use pipes. @@ -455,7 +455,7 @@ modparam("ratelimit", "pipe", "4:NETWORK:10000") RPC Command Format: kamcmd rl.get_pipes -7.4. rl.set_queue +7.4. rl.set_queue Sets the queue parameters for the given queue id. @@ -469,7 +469,7 @@ modparam("ratelimit", "pipe", "4:NETWORK:10000") RPC Command Format: kamcmd rl.set_queue 3 INVITE 2 -7.5. rl.get_queues +7.5. rl.get_queues Gets the list of in use queues. @@ -480,7 +480,7 @@ modparam("ratelimit", "pipe", "4:NETWORK:10000") RPC Command Format: kamcmd rl.get_queues -7.6. rl.set_pid +7.6. rl.set_pid Sets the PID Controller parameters for the Feedback Algorithm. @@ -494,7 +494,7 @@ modparam("ratelimit", "pipe", "4:NETWORK:10000") RPC Command Format: kamcmd rl.set_pid 0.5 0.5 0.5 -7.7. rl.get_pid +7.7. rl.get_pid Gets the list of in use PID Controller parameters. @@ -505,7 +505,7 @@ modparam("ratelimit", "pipe", "4:NETWORK:10000") RPC Command Format: kamcmd rl.get_pid -7.8. rl.push_load +7.8. rl.push_load Force the value of the load parameter. This method is useful for testing the Feedback algorithm. @@ -519,7 +519,7 @@ modparam("ratelimit", "pipe", "4:NETWORK:10000") RPC Command Format: kamcmd rl.push_load 0.85 -7.9. rl.set_dbg +7.9. rl.set_dbg This function will enable/disable a WARNING debug log exposing the internal counters for each pipe (useful in monitoring the ratelimit diff --git a/modules/ratelimit/ratelimit.c b/modules/ratelimit/ratelimit.c index dc5748fd455..69fcd74fa1f 100644 --- a/modules/ratelimit/ratelimit.c +++ b/modules/ratelimit/ratelimit.c @@ -338,6 +338,7 @@ static int get_cpuload(double * load) if (fscanf(f, "cpu %lld%lld%lld%lld%lld%lld%lld%lld", &n_user, &n_nice, &n_sys, &n_idle, &n_iow, &n_irq, &n_sirq, &n_stl) < 0) { LM_ERR("could not parse load information\n"); + fclose(f); return -1; } fclose(f); diff --git a/modules/regex/README b/modules/regex/README index 941b432386c..049499ce02b 100644 --- a/modules/regex/README +++ b/modules/regex/README @@ -1,16 +1,16 @@ Regex Module -Iaki Baz Castillo +Iñaki Baz Castillo Edited by -Iaki Baz Castillo +Iñaki Baz Castillo - Copyright 2009 Iaki Baz Castillo + Copyright © 2009 Iñaki Baz Castillo __________________________________________________________________ Table of Contents @@ -142,7 +142,7 @@ Chapter 1. Admin Guide Text file containing the regular expression groups. It must be set in order to enable the group matching function. - Default value is "NULL". + Default value is “NULL”. Example 1.1. Set file parameter ... @@ -153,7 +153,7 @@ modparam("regex", "file", "/etc/kamailio/regex_groups") Max number of regular expression groups in the text file. - Default value is "20". + Default value is “20”. Example 1.2. Set max_groups parameter ... @@ -164,7 +164,7 @@ modparam("regex", "max_groups", 40) Max content size of a group in the text file. - Default value is "8192". + Default value is “8192”. Example 1.3. Set group_max_size parameter ... @@ -177,7 +177,7 @@ modparam("regex", "group_max_size", 16384) Perl's /i option, and it can be changed within a pattern by a (?i) or (?-i) option setting. - Default value is "0". + Default value is “0”. Example 1.4. Set pcre_caseless parameter ... @@ -200,7 +200,7 @@ modparam("regex", "pcre_caseless", 1) are no newlines in a subject string, or no occurrences of ^ or $ in a pattern, setting this option has no effect. - Default value is "0". + Default value is “0”. Example 1.5. Set pcre_multiline parameter ... @@ -215,7 +215,7 @@ modparam("regex", "pcre_multiline", 1) is equivalent to Perl's /s option, and it can be changed within a pattern by a (?s) or (?-s) option setting. - Default value is "0". + Default value is “0”. Example 1.6. Set pcre_dotall parameter ... @@ -232,7 +232,7 @@ modparam("regex", "pcre_dotall", 1) /x option, and it can be changed within a pattern by a (?x) or (?-x) option setting. - Default value is "0". + Default value is “0”. Example 1.7. Set pcre_extended parameter ... @@ -244,7 +244,7 @@ modparam("regex", "pcre_extended", 1) 4.1. pcre_match (string, pcre_regex) 4.2. pcre_match_group (string [, group]) -4.1. pcre_match (string, pcre_regex) +4.1. pcre_match (string, pcre_regex) Matches the given string parameter against the regular expression pcre_regex, which is compiled in runtime into a PCRE object. Returns @@ -261,24 +261,24 @@ modparam("regex", "pcre_extended", 1) This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE and LOCAL_ROUTE. - Example 1.8. pcre_match usage (forcing case insensitive) + Example 1.8. pcre_match usage (forcing case insensitive) ... if (pcre_match("$ua", "(?i)^twinkle")) { xlog("L_INFO", "User-Agent matches\n"); } ... - Example 1.9. pcre_match usage (using "end of line" symbol) + Example 1.9. pcre_match usage (using "end of line" symbol) ... if (pcre_match("$rU", "^user[1234]$$")) { # Will be converted to "^user[1234]$" xlog("L_INFO", "RURI username matches\n"); } ... -4.2. pcre_match_group (string [, group]) +4.2. pcre_match_group (string [, group]) Tries to match the given string against a specific group in the text - file (see Section 6.1, "File format"). Returns TRUE if it matches, + file (see Section 6.1, “File format”). Returns TRUE if it matches, FALSE otherwise. Meaning of the parameters is as follows: @@ -290,14 +290,15 @@ if (pcre_match("$rU", "^user[1234]$$")) { # Will be converted to "^user[1234]$" This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE and LOCAL_ROUTE. - Example 1.10. pcre_match_group usage + Example 1.10. pcre_match_group usage ... if (pcre_match_group("$rU", "2")) { xlog("L_INFO", "RURI username matches group 2\n"); } ... - Example 1.11. pcre_match_group usage (using a pseudo-variable as group) + Example 1.11. pcre_match_group usage (using a pseudo-variable as + group) ... $avp(i:10) = 5; # Maybe got from a DB query. if (pcre_match_group("$ua", "$avp(i:10)")) { @@ -309,7 +310,7 @@ if (pcre_match_group("$ua", "$avp(i:10)")) { 5.1. regex_reload -5.1. regex_reload +5.1. regex_reload Causes regex module to re-read the content of the text file and re-compile the regular expressions. The number of groups in the file diff --git a/modules/registrar/README b/modules/registrar/README index 3023d399a8b..49df0f8cffd 100644 --- a/modules/registrar/README +++ b/modules/registrar/README @@ -20,7 +20,7 @@ Edited by Bogdan-Andre Iancu - Copyright (c) 2003 FhG FOKUS + Copyright © 2003 FhG FOKUS __________________________________________________________________ Table of Contents @@ -231,8 +231,8 @@ Chapter 1. Admin Guide * off - stores the value of the Path headers into usrloc without passing it back to the UAC in the reply. * lazy - stores the Path header and passes it back to the UAC if - Path-support is indicated by the "path" param in the Supported HF. - * strict - rejects the registration with "420 Bad Extension" if + Path-support is indicated by the “path” param in the Supported HF. + * strict - rejects the registration with “420 Bad Extension” if there's a Path header but no support for it is indicated by the UAC. Otherwise it's stored and passed back to the UAC. @@ -244,8 +244,8 @@ Chapter 1. Admin Guide client's NAT). The whole process is transparent to the user, so no config changes are - required beside setting the registrar-parameters "use_path" and - "path_mode". + required beside setting the registrar-parameters “use_path” and + “path_mode”. 1.2. GRUU Support @@ -312,7 +312,7 @@ Chapter 1. Admin Guide contact parameters, this value will be used for newly created usrloc records. The parameter contains number of second to expire (for example use 3600 for one hour). If it is set to a lower value than the - "min_expires" parameter then it will be ignored. This parameter can be + “min_expires” parameter then it will be ignored. This parameter can be modified via ser config framework. A random value in a specific interval can be selected by using the default_expires_range parameter @@ -327,7 +327,7 @@ modparam("registrar", "default_expires", 1800) This parameter specifies that the expiry used for newly created usrloc records are not fixed, but a random value in the interval - "[default_expires-default_expires_range%, default_expires]". The value + “[default_expires-default_expires_range%, default_expires]”. The value is between 0 and 100 and represent the maximim percentage from expires that will be substracted when computing the value. Default is 0, meaning default_expires is left unmodified. This parameter can be @@ -356,7 +356,7 @@ res] 3.4. min_expires (integer) - The minimum expires value of a "Contact". Values lower than this + The minimum expires value of a “Contact”. Values lower than this minimum will be automatically set to the minimum. Value 0 disables the checking. This parameter can be modified via the Kamailio config framework. @@ -370,7 +370,7 @@ modparam("registrar", "min_expires", 60) 3.5. max_expires (integer) - The maximum accepted expires value of a "Contact", values higher than + The maximum accepted expires value of a “Contact”, values higher than this maximum will be automatically set to the maximum. Value 0 disables the checking. This parameter can be modified via the Kamailio config framework. @@ -384,7 +384,7 @@ modparam("registrar", "max_expires", 120) 3.6. default_q (integer) - The parameter represents default "q" value for new contacts. Because + The parameter represents default “q” value for new contacts. Because Kamailio doesn't support float parameter types, the value in the parameter is divided by 1000 and stored as float. For example, if you want default_q to be 0.38, use value 380 here. This parameter can be @@ -474,7 +474,7 @@ modparam("registrar", "received_avp", "$avp(s:rcv)") 3.12. received_param (string) The name of the parameter that will be appended to Contact URI's of 200 - OK when the received URI was set by the "nathelper" module. If the + OK when the received URI was set by the “nathelper” module. If the value is an empty string, then the parameter is not appended anymore. Default value is "received". @@ -557,7 +557,7 @@ modparam("registrar", "sock_hdr_name", "Sock-Info") Tells if the contact filtering based on supported methods should be performed during lookup. It's enabled only if it has a non zero value. - Supported methods are listed in the "Allow:" header in the REGISTER + Supported methods are listed in the “Allow:” header in the REGISTER message and stored in the location database. Default value is 0 (disabled). @@ -569,9 +569,9 @@ modparam("registrar", "method_filtering", 1) 3.18. use_path (integer) - If set to 1, the "Path:" header is handled according to the parameter + If set to 1, the “Path:” header is handled according to the parameter This parameter can be modified via Kamailio config framework. - "path_mode". + “path_mode”. Default value is 0 (disabled). @@ -588,12 +588,12 @@ modparam("registrar", "use_path", 1) the reply. * 1 - The Path header is saved into usrloc, but is only included in the reply if path support is indicated in the registration request - by the "path" option in the "Supported:" header. + by the “path” option in the “Supported:” header. * 2 - The path header is only saved into usrloc, if path support is - indicated in the registration request by the "path" option of the - "Supported" header. If no path support is indicated, the request is - rejected with "420 - Bad Extension" and the header "Unsupported: - path" is included in the reply along with the received "Path" + indicated in the registration request by the “path” option of the + “Supported” header. If no path support is indicated, the request is + rejected with “420 - Bad Extension” and the header “Unsupported: + path” is included in the reply along with the received “Path” header. This mode is the one recommended by RFC-3327. Default value is 2. @@ -605,10 +605,10 @@ modparam("registrar", "path_mode", 0) 3.20. path_use_received (integer) - If set to 1, the "received" parameter of the first Path URI of a + If set to 1, the “received” parameter of the first Path URI of a registration is set as received-uri and the NAT branch flag is set for this contact. This is useful if the registrar is placed behind a SIP - loadbalancer, which passes the nat'ed UAC address as "received" + loadbalancer, which passes the nat'ed UAC address as “received” parameter in it's Path uri. Default value is 0 (disabled). @@ -621,7 +621,7 @@ modparam("registrar", "path_use_received", 1) 3.21. path_check_local (integer) If set to 1, when performing a lookup the Path (if present) is - evaluated and if the first hop is local (according to "myself" test), + evaluated and if the first hop is local (according to “myself” test), we skip it to avoid unnecessary looping. This is useful if multiple servers are sharing a common location @@ -696,7 +696,7 @@ modparam("registrar", "xavp_rcd", "ulrcd") 3.25. gruu_enabled (integer) - If set to 1 and the "+sip.instance" parameter to Contact header of + If set to 1 and the “+sip.instance” parameter to Contact header of REGISTER is present, then the value of the parameter is saved to location and pub-gruu and temp-gruu addresses are generated. @@ -712,21 +712,21 @@ modparam("registrar", "gruu_enabled", 0) 3.26. outbound_mode (integer) If set to 0 this module will accept REGISTER requests that do not - contain a "Supported:" header with the outbound options-tag. The 200 OK + contain a “Supported:” header with the outbound options-tag. The 200 OK response to REGISTER requests that this module generates will not - contain "Require:" or "Supported:" headers with the outbound - options-tag. If the client has a "Require:" header with the outbound - options tag the REGISTER will be rejected with a "420 Bad Extension" + contain “Require:” or “Supported:” headers with the outbound + options-tag. If the client has a “Require:” header with the outbound + options tag the REGISTER will be rejected with a “420 Bad Extension” response. If set to 1 this module will accept REGISTER requests that do not - contain a "Supported:" header with the outbound options-tag and + contain a “Supported:” header with the outbound options-tag and REGISTER requests that do contain a Supported: or Requires: header with the outbound options-tag. When the client supports outbound the appropriate RFC5626 procedures will be followed. If set to 2 this module will reject REGISTER requests that do not - contain a "Supported:" header with the outbound options-tag. When the + contain a “Supported:” header with the outbound options-tag. When the client supports outbound the appropriate RFC5626 procedures will be followed. @@ -739,11 +739,11 @@ modparam("registrar", "outbound_mode", 2) 3.27. regid_mode (integer) - If set to 0 this module will ignore the "regid" contact param when + If set to 0 this module will ignore the “regid” contact param when saving REGISTER request if the request does not indicate support for outbound. - If set to 1 this module will use "regid" contact param (if present) + If set to 1 this module will use “regid” contact param (if present) when saving REGISTER request even if REGISTER request does not indicate support for outbound. @@ -756,10 +756,10 @@ modparam("registrar", "regid_mode", 1) 3.28. flow_timer (integer) - If set to 0 then this module will not add a "Flow-Timer:" header to 200 + If set to 0 then this module will not add a “Flow-Timer:” header to 200 OK responses to REGISTER requests. - If set to > 0 then this module will add a "Flow-Timer:" header + If set to > 0 then this module will add a “Flow-Timer:” header containing this value to 200 OK responses to REGISTER requests. This parameter may only be set to a value > 0 when outbound_mode is set to 1 or 2. @@ -771,7 +771,7 @@ modparam("registrar", "regid_mode", 1) useful when you have a single edge proxy/registrar or if you have an edge proxy that cannot modify responses. If you are using a separate edge proxy you should consider leaving this parameter set to 0 and - adding the "Flow-Timer:" header on the edge proxy as this allows you to + adding the “Flow-Timer:” header on the edge proxy as this allows you to keep all of the timer values for a specific flow in one configuration. Default value is 0. @@ -797,7 +797,7 @@ modparam("registrar", "flow_timer", 25) The function processes a REGISTER message. It can add, remove or modify location records (in usrloc) depending on Contact and Expires HFs in the REGISTER message. On success and when called from the - REQUEST_ROUTE, "200 OK" will be returned listing all contacts that are + REQUEST_ROUTE, “200 OK” will be returned listing all contacts that are currently in the location database. On an error, an error message will be sent with a short description in reason phrase. @@ -935,7 +935,7 @@ if (registered("location","$rz:$Au", 2)) { 4.5. add_sock_hdr(hdr_name) - Adds a new header to the current REGISTER request with "hdr_name" which + Adds a new header to the current REGISTER request with “hdr_name” which contains the description of the received socket (proto:ip:port) This makes sense only in multiple replicated servers scenarios. @@ -955,7 +955,7 @@ add_sock_hdr("Sock-Info"); The function removes contacts associated with 'uri' from the location database. If 'ruid' is provided a specific contact is removed, if 'ruid' is not provided all the current contacts are removed. If 'ruid' - is provided and the "usrloc" module is using "db_mode=3", 'uri' does + is provided and the “usrloc” module is using “db_mode=3”, 'uri' does not need to be given and can be empty string. Meaning of the parameters is as follows: @@ -1068,12 +1068,12 @@ event_route[usrloc:contact-expired] { 7.1. $ulc(profile=>attr) Access the attributes of contact addresses stored in 'profile'. It must - be used after a call of "reg_fetch_contacts()". + be used after a call of “reg_fetch_contacts()”. - The "profile" has to be one of the values used with - "reg_fetch_contacts()". + The “profile” has to be one of the values used with + “reg_fetch_contacts()”. - The "attr" can be: + The “attr” can be: * aor - address of record * domain - use location domain name * aorhash - hash id for the record @@ -1131,9 +1131,9 @@ if(reg_fetch_contacts("location", "$fu", "caller")) Chapter 2. Frequently Asked Questions - 2.1. What happend with the old "nat_flag" module parameter? - 2.2. What happend with the old "use_domain" module parameter? - 2.3. What happened with the old "save_noreply" and "save_memory" + 2.1. What happend with the old “nat_flag” module parameter? + 2.2. What happend with the old “use_domain” module parameter? + 2.3. What happened with the old “save_noreply” and “save_memory” functions? 2.4. Where can I find more about Kamailio? @@ -1143,60 +1143,60 @@ Chapter 2. Frequently Asked Questions 2.1. - What happend with the old "nat_flag" module parameter? + What happend with the old “nat_flag” module parameter? - In was removed, as the module internally loads this value from the - "USRLOC" module (see the "nat_bflag" USRLOC parameter). + In was removed, as the module internally loads this value from the + “USRLOC” module (see the “nat_bflag” USRLOC parameter). 2.2. - What happend with the old "use_domain" module parameter? + What happend with the old “use_domain” module parameter? - In was removed, as the module internally loads this option from the - "USRLOC" module. This was done in order to simplify the configuration. + In was removed, as the module internally loads this option from the + “USRLOC” module. This was done in order to simplify the configuration. 2.3. - What happened with the old "save_noreply" and "save_memory" functions? + What happened with the old “save_noreply” and “save_memory” functions? - There functions were merged into the new "save(domain,flags)" - functions. If a reply should be sent or if the DB should be updated - also is controlled via the flags. + There functions were merged into the new “save(domain,flags)” + functions. If a reply should be sent or if the DB should be updated + also is controlled via the flags. 2.4. - Where can I find more about Kamailio? + Where can I find more about Kamailio? - Take a look at http://www.kamailio.org/. + Take a look at http://www.kamailio.org/. 2.5. - Where can I post a question about this module? + Where can I post a question about this module? - First at all check if your question was already answered on one of our - mailing lists: - * User Mailing List - - http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users - * Developer Mailing List - - http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev + First at all check if your question was already answered on one of our + mailing lists: + * User Mailing List - + http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users + * Developer Mailing List - + http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev - E-mails regarding any stable Kamailio release should be sent to - and e-mails regarding development - versions should be sent to . + E-mails regarding any stable Kamailio release should be sent to + and e-mails regarding development + versions should be sent to . - If you want to keep the mail private, send it to - . + If you want to keep the mail private, send it to + . 2.6. - How can I report a bug? + How can I report a bug? - Please follow the guidelines provided at: - http://sip-router.org/tracker. + Please follow the guidelines provided at: + https://github.com/kamailio/kamailio/issues. 2.7. - What happened to the desc_time_order parameter? + What happened to the desc_time_order parameter? - It was removed, as its functionality was migrated into usrloc module, - were there is a parameter with the same name. + It was removed, as its functionality was migrated into usrloc module, + were there is a parameter with the same name. diff --git a/modules/registrar/api.c b/modules/registrar/api.c index cf8f37adfbe..568ec807783 100644 --- a/modules/registrar/api.c +++ b/modules/registrar/api.c @@ -1,5 +1,5 @@ /* - * Functions that process REGISTER message + * Functions that process REGISTER message * and store data in usrloc * * Copyright (C) 2010 Daniel-Constantin Mierla (asipto.com) @@ -16,8 +16,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ diff --git a/modules/registrar/api.h b/modules/registrar/api.h index 0fabb3a1a3a..e93955165bb 100644 --- a/modules/registrar/api.h +++ b/modules/registrar/api.h @@ -1,5 +1,5 @@ /* - * Functions that process REGISTER message + * Functions that process REGISTER message * and store data in usrloc * * Copyright (C) 2010 Daniel-Constantin Mierla (asipto.com) @@ -16,8 +16,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ diff --git a/modules/registrar/common.c b/modules/registrar/common.c index 53d8cc12d98..ed734f4c9d0 100644 --- a/modules/registrar/common.c +++ b/modules/registrar/common.c @@ -15,10 +15,10 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * */ /*! @@ -27,7 +27,7 @@ * \ingroup registrar */ -#include +#include #include "../../dprint.h" #include "rerrno.h" #include "reg_mod.h" @@ -48,7 +48,7 @@ int extract_aor(str* _uri, str* _a, sip_uri_t *_pu) int user_len; str *uri; str realm_prefix = {0}; - + memset(aor_buf, 0, MAX_AOR_LEN); uri=_uri; @@ -62,7 +62,7 @@ int extract_aor(str* _uri, str* _a, sip_uri_t *_pu) LM_ERR("failed to parse AoR [%.*s]\n", uri->len, uri->s); return -1; } - + if ( (puri->user.len + puri->host.len + 1) > MAX_AOR_LEN || puri->user.len > USERNAME_MAX_SIZE || puri->host.len > DOMAIN_MAX_SIZE ) { @@ -86,7 +86,7 @@ int extract_aor(str* _uri, str* _a, sip_uri_t *_pu) if (user_len) aor_buf[_a->len++] = '@'; /* strip prefix (if defined) */ - realm_prefix.len = cfg_get(registrar, registrar_cfg, realm_pref).len; + realm_prefix.len = cfg_get(registrar, registrar_cfg, realm_pref).len; if(realm_prefix.len>0) { realm_prefix.s = cfg_get(registrar, registrar_cfg, realm_pref).s; LM_DBG("realm prefix is [%.*s]\n", realm_prefix.len, diff --git a/modules/registrar/common.h b/modules/registrar/common.h index 5f3f66db882..22f43d37e72 100644 --- a/modules/registrar/common.h +++ b/modules/registrar/common.h @@ -15,16 +15,16 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /*! * \file * \brief SIP registrar module - common stuff - * \ingroup registrar - */ + * \ingroup registrar + */ #ifndef COMMON_H diff --git a/modules/registrar/config.c b/modules/registrar/config.c index 0f628dc30ce..4008da60230 100644 --- a/modules/registrar/config.c +++ b/modules/registrar/config.c @@ -18,7 +18,7 @@ */ /*! - * \file + * \file * \brief Registrar :: Configuration * \ingroup Registrar */ @@ -41,7 +41,7 @@ struct cfg_group_registrar default_registrar_cfg = { 0, /* case_sensitive */ Q_UNSPECIFIED, /* default_q */ 1 /* append_branches */ - }; + }; void *registrar_cfg = &default_registrar_cfg; diff --git a/modules/registrar/config.h b/modules/registrar/config.h index f82ba63dc6d..b9481ae8c26 100644 --- a/modules/registrar/config.h +++ b/modules/registrar/config.h @@ -4,13 +4,13 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /*! - * \file + * \file * \brief Registrar :: Configuration * \ingroup registrar */ diff --git a/modules/registrar/lookup.c b/modules/registrar/lookup.c index b8cf92a84c3..50da15d622a 100644 --- a/modules/registrar/lookup.c +++ b/modules/registrar/lookup.c @@ -15,16 +15,16 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ /*! * \file * \brief SIP registrar module - lookup contacts in usrloc - * \ingroup registrar - */ + * \ingroup registrar + */ #include @@ -82,14 +82,14 @@ int reg_cmp_instances(str *i1, str *i2) * Lookup a contact in usrloc and rewrite R-URI if found */ int lookup(struct sip_msg* _m, udomain_t* _d, str* _uri) { - return lookup_helper(_m, _d, _uri, 0); + return lookup_helper(_m, _d, _uri, 0); } /*! \brief * Lookup a contact in usrloc and add the records to the dset structure */ int lookup_to_dset(struct sip_msg* _m, udomain_t* _d, str* _uri) { - return lookup_helper(_m, _d, _uri, 1); + return lookup_helper(_m, _d, _uri, 1); } /*! \brief @@ -168,7 +168,7 @@ int lookup_helper(struct sip_msg* _m, udomain_t* _d, str* _uri, int _mode) if (_m->new_uri.s) uri = _m->new_uri; else uri = _m->first_line.u.request.uri; - + if (extract_aor((_uri)?_uri:&uri, &aor, &puri) < 0) { LM_ERR("failed to extract address of record\n"); return -3; @@ -340,26 +340,26 @@ int lookup_helper(struct sip_msg* _m, udomain_t* _d, str* _uri, int _mode) } if (ptr->instance.len) { - if (set_instance(_m, &(ptr->instance)) < 0) { + if (set_instance(_m, &(ptr->instance)) < 0) { ret = -3; goto done; - } + } } - + _m->reg_id = ptr->reg_id; if (ptr->ruid.len) { - if (set_ruid(_m, &(ptr->ruid)) < 0) { + if (set_ruid(_m, &(ptr->ruid)) < 0) { ret = -3; goto done; - } + } } if (ptr->user_agent.len) { - if (set_ua(_m, &(ptr->user_agent)) < 0) { + if (set_ua(_m, &(ptr->user_agent)) < 0) { ret = -3; goto done; - } + } } set_ruri_q(ptr->q); @@ -422,18 +422,18 @@ int lookup_helper(struct sip_msg* _m, udomain_t* _d, str* _uri, int _mode) path_dst.len = 0; } - /* The same as for the first contact applies for branches + /* The same as for the first contact applies for branches * regarding path vs. received. */ LM_DBG("instance is %.*s\n", - ptr->instance.len, ptr->instance.s); + ptr->instance.len, ptr->instance.s); if (append_branch(_m, &ptr->c, - path_dst.len?&path_dst:&ptr->received, - path_dst.len?&path_str:0, ptr->q, ptr->cflags, - ptr->sock, - ptr->instance.len?&(ptr->instance):0, - ptr->instance.len?ptr->reg_id:0, - &ptr->ruid, &ptr->user_agent) - == -1) { + path_dst.len?&path_dst:&ptr->received, + path_dst.len?&path_str:0, ptr->q, ptr->cflags, + ptr->sock, + ptr->instance.len?&(ptr->instance):0, + ptr->instance.len?ptr->reg_id:0, + &ptr->ruid, &ptr->user_agent) + == -1) { LM_ERR("failed to append a branch\n"); /* Also give a chance to the next branches*/ continue; @@ -484,19 +484,19 @@ int clear_ruri_branch(sip_msg_t *msg) */ int reset_ruri_branch(sip_msg_t *msg) { - if(msg==NULL) - return -1; - - reset_dst_uri(msg); - reset_path_vector(msg); - set_ruri_q(Q_UNSPECIFIED); - reset_force_socket(msg); - setbflagsval(0, 0); - reset_instance(msg); - msg->reg_id = 0; - reset_ruid(msg); - reset_ua(msg); - return 0; + if(msg==NULL) + return -1; + + reset_dst_uri(msg); + reset_path_vector(msg); + set_ruri_q(Q_UNSPECIFIED); + reset_force_socket(msg); + setbflagsval(0, 0); + reset_instance(msg); + msg->reg_id = 0; + reset_ruid(msg); + reset_ua(msg); + return 0; } /*! \brief @@ -681,12 +681,12 @@ int registered4(struct sip_msg* _m, udomain_t* _d, str* _uri, int match_flag, in else uri = _m->first_line.u.request.uri; } } - + if (extract_aor(&uri, &aor, NULL) < 0) { LM_ERR("failed to extract address of record\n"); return -1; } - + ul.lock_udomain(_d, &aor); res = ul.get_urecord(_d, &aor, &r); @@ -726,17 +726,17 @@ int registered4(struct sip_msg* _m, udomain_t* _d, str* _uri, int match_flag, in if(!VALID_CONTACT(ptr, act_time)) continue; if (match_callid.s && /* optionally enforce tighter matching w/ Call-ID */ match_callid.len > 0 && - (match_callid.len != ptr->callid.len || + (match_callid.len != ptr->callid.len || memcmp(match_callid.s, ptr->callid.s, match_callid.len))) continue; if (match_received.s && /* optionally enforce tighter matching w/ ip:port */ match_received.len > 0 && - (match_received.len != ptr->received.len || + (match_received.len != ptr->received.len || memcmp(match_received.s, ptr->received.s, match_received.len))) continue; if (match_contact.s && /* optionally enforce tighter matching w/ Contact */ match_contact.len > 0 && - (match_contact.len != ptr->c.len || + (match_contact.len != ptr->c.len || memcmp(match_contact.s, ptr->c.s, match_contact.len))) continue; diff --git a/modules/registrar/lookup.h b/modules/registrar/lookup.h index 035b8180b46..6ffc8c86f5e 100644 --- a/modules/registrar/lookup.h +++ b/modules/registrar/lookup.h @@ -15,16 +15,16 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /*! * \file * \brief SIP registrar module - lookup contacts in usrloc - * \ingroup registrar - */ + * \ingroup registrar + */ #ifndef LOOKUP_H diff --git a/modules/registrar/path.c b/modules/registrar/path.c index 8571eeada95..6a73b20cb30 100644 --- a/modules/registrar/path.c +++ b/modules/registrar/path.c @@ -15,16 +15,16 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ /*! * \file * \brief SIP registrar module - Helper functions for Path support - * \ingroup registrar - */ + * \ingroup registrar + */ #include "../../data_lump.h" @@ -98,11 +98,11 @@ int build_path_vector(struct sip_msg *_m, str *path, str *received) free_params(params); if (hooks.contact.received) { - uri_str.s = uri_buf; + uri_str.s = uri_buf; uri_str.len = MAX_URI_SIZE; - if (unescape_user(&(hooks.contact.received->body), &uri_str) < 0) { - LM_ERR("unescaping received failed\n"); - goto error; + if (unescape_user(&(hooks.contact.received->body), &uri_str) < 0) { + LM_ERR("unescaping received failed\n"); + goto error; } *received = uri_str; LM_DBG("received is <%.*s>\n", received->len, received->s); diff --git a/modules/registrar/path.h b/modules/registrar/path.h index 1914bf40b90..89aaf9c4c83 100644 --- a/modules/registrar/path.h +++ b/modules/registrar/path.h @@ -23,8 +23,8 @@ /*! * \file * \brief SIP registrar module - helper functions for Path support - * \ingroup registrar - */ + * \ingroup registrar + */ #ifndef REG_PATH_H #define REG_PATH_H diff --git a/modules/registrar/reg_mod.c b/modules/registrar/reg_mod.c index f859db4df6c..b340093982a 100644 --- a/modules/registrar/reg_mod.c +++ b/modules/registrar/reg_mod.c @@ -15,8 +15,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -24,15 +24,15 @@ /*! * \defgroup registrar Registrar :: SIP Registrar support * The module contains REGISTER processing logic. - */ + */ /*! * \file * \brief SIP registrar module - interface - * \ingroup registrar + * \ingroup registrar * * - Module: \ref registrar - */ + */ #include #include "../../sr_module.h" @@ -89,12 +89,12 @@ int tcp_persistent_flag = -1; /*!< if the TCP connection should be kept open * int method_filtering = 0; /*!< if the looked up contacts should be filtered based on supported methods */ int path_enabled = 0; /*!< if the Path HF should be handled */ int path_mode = PATH_MODE_STRICT; /*!< if the Path HF should be inserted in the reply. - * - STRICT (2): always insert, error if no support indicated in request - * - LAZY (1): insert only if support indicated in request - * - OFF (0): never insert */ + * - STRICT (2): always insert, error if no support indicated in request + * - LAZY (1): insert only if support indicated in request + * - OFF (0): never insert */ int path_use_params = 0; /*!< if the received- and nat-parameters of last Path uri should be used - * to determine if UAC is nat'ed */ + * to determine if UAC is nat'ed */ int path_check_local = 0; /* sruid to get internal uid */ @@ -179,7 +179,7 @@ static cmd_export_t cmds[] = { REQUEST_ROUTE| FAILURE_ROUTE }, {"unregister", (cmd_function)w_unregister2, 3, unreg_fixup, 0, REQUEST_ROUTE| FAILURE_ROUTE }, - {"reg_fetch_contacts", (cmd_function)pv_fetch_contacts, 3, + {"reg_fetch_contacts", (cmd_function)pv_fetch_contacts, 3, fetchc_fixup, 0, REQUEST_ROUTE| FAILURE_ROUTE }, {"reg_free_contacts", (cmd_function)pv_free_contacts, 1, @@ -246,7 +246,7 @@ stat_export_t mod_stats[] = { * Module exports structure */ struct module_exports exports = { - "registrar", + "registrar", DEFAULT_DLFLAGS, /* dlopen flags */ cmds, /* Exported functions */ params, /* Exported parameters */ @@ -288,13 +288,11 @@ static int mod_init(void) LM_ERR("cannot bind to SL API\n"); return -1; } - + if(cfg_declare("registrar", registrar_cfg_def, &default_registrar_cfg, cfg_sizeof(registrar), ®istrar_cfg)){ LM_ERR("Fail to declare the configuration\n"); - return -1; + return -1; } - - if (rcv_avp_param && *rcv_avp_param) { s.s = rcv_avp_param; s.len = strlen(s.s); @@ -539,11 +537,11 @@ static int w_unregister(struct sip_msg* _m, char* _d, char* _uri) static int w_unregister2(struct sip_msg* _m, char* _d, char* _uri, char *_ruid) { - str uri = {0, 0}; + str uri = {0, 0}; str ruid = {0}; if(fixup_get_svalue(_m, (gparam_p)_uri, &uri)!=0) { - LM_ERR("invalid uri parameter\n"); + LM_ERR("invalid uri parameter\n"); return -1; } if(fixup_get_svalue(_m, (gparam_p)_ruid, &ruid)!=0 || ruid.len<=0) diff --git a/modules/registrar/reg_mod.h b/modules/registrar/reg_mod.h index 8fd0ccb2454..51cb864e1e1 100644 --- a/modules/registrar/reg_mod.h +++ b/modules/registrar/reg_mod.h @@ -1,4 +1,4 @@ -/* +/* * registrar module interface * * Copyright (C) 2001-2003 FhG Fokus @@ -15,8 +15,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -24,8 +24,8 @@ /*! * \file * \brief SIP registrar module - interface - * \ingroup registrar - */ + * \ingroup registrar + */ #ifndef REG_MOD_H @@ -37,7 +37,7 @@ #include "../usrloc/usrloc.h" #include "../../modules/sl/sl.h" -/* if DB support is used, this values must not exceed the +/* if DB support is used, this values must not exceed the * storage capacity of the DB columns! See db/schema/entities.xml */ #define CONTACT_MAX_SIZE 255 #define RECEIVED_MAX_SIZE 255 @@ -62,8 +62,8 @@ #define REG_REGID_ALWAYS 1 /* Maximum of 999 to keep flow-timer to 3 digits - - make sure to update reply.c:add_flow_timer() if the number of digits - increases! */ + * - make sure to update reply.c:add_flow_timer() if the number of digits + * increases! */ #define REG_FLOW_TIMER_MAX 999 extern int nat_flag; diff --git a/modules/registrar/regpv.c b/modules/registrar/regpv.c index daf304ee9f8..3f5886418e8 100644 --- a/modules/registrar/regpv.c +++ b/modules/registrar/regpv.c @@ -15,16 +15,16 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /*! * \file * \brief SIP registrar module - export contacts as PV - * \ingroup registrar - */ + * \ingroup registrar + */ #include @@ -301,7 +301,7 @@ int pv_parse_ulc_name(pv_spec_p sp, str *in) break; pa.s++; } - + if(pa.s >= in->s + in->len - 2) { LM_ERR("invalid contact pv name %.*s\n", in->len, in->s); @@ -339,17 +339,17 @@ int pv_parse_ulc_name(pv_spec_p sp, str *in) switch(pa.len) { - case 1: + case 1: if(strncmp(pa.s, "q", 1)==0) rp->attr = 8; else goto error; break; - case 3: + case 3: if(strncmp(pa.s, "aor", 3)==0) rp->attr = 0; else goto error; break; - case 4: + case 4: if(strncmp(pa.s, "addr", 4)==0) rp->attr = 3; else if(strncmp(pa.s, "path", 4)==0) @@ -360,7 +360,7 @@ int pv_parse_ulc_name(pv_spec_p sp, str *in) rp->attr = 18; else goto error; break; - case 5: + case 5: if(strncmp(pa.s, "flags", 5)==0) rp->attr = 10; else if(strncmp(pa.s, "count", 5)==0) @@ -371,7 +371,7 @@ int pv_parse_ulc_name(pv_spec_p sp, str *in) rp->attr = 21; else goto error; break; - case 6: + case 6: if(strncmp(pa.s, "domain", 6)==0) rp->attr = 1; else if(strncmp(pa.s, "callid", 6)==0) @@ -382,7 +382,7 @@ int pv_parse_ulc_name(pv_spec_p sp, str *in) rp->attr = 14; else goto error; break; - case 7: + case 7: if(strncmp(pa.s, "aorhash", 7)==0) rp->attr = 2; else if(strncmp(pa.s, "expires", 7)==0) @@ -391,7 +391,7 @@ int pv_parse_ulc_name(pv_spec_p sp, str *in) rp->attr = 16; else goto error; break; - case 8: + case 8: if(strncmp(pa.s, "received", 8)==0) rp->attr = 5; else if(strncmp(pa.s, "modified", 8)==0) @@ -400,7 +400,7 @@ int pv_parse_ulc_name(pv_spec_p sp, str *in) rp->attr = 20; else goto error; break; - case 10: + case 10: if(strncmp(pa.s, "user_agent", 10)==0) rp->attr = 12; else goto error; @@ -504,7 +504,7 @@ int pv_fetch_contacts(struct sip_msg* msg, char* table, char* uri, memcpy(c0->c.s, ptr->c.s, ptr->c.len); c0->c.len = ptr->c.len; p = c0->c.s + c0->c.len; - + if(ptr->received.s!=NULL) { c0->received.s = p; diff --git a/modules/registrar/regpv.h b/modules/registrar/regpv.h index 1926d640305..a4ebdce7799 100644 --- a/modules/registrar/regpv.h +++ b/modules/registrar/regpv.h @@ -15,16 +15,16 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /*! * \file * \brief SIP registrar module - export contacts as PV - * \ingroup registrar - */ + * \ingroup registrar + */ #ifndef _REGPV_H_ diff --git a/modules/registrar/regtime.c b/modules/registrar/regtime.c index 2e9ed87dcf3..46c10de92f2 100644 --- a/modules/registrar/regtime.c +++ b/modules/registrar/regtime.c @@ -15,8 +15,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/modules/registrar/regtime.h b/modules/registrar/regtime.h index 0815da51d02..095cedfa518 100644 --- a/modules/registrar/regtime.h +++ b/modules/registrar/regtime.h @@ -15,16 +15,16 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /*! * \file * \brief SIP registrar module - time related functions - * \ingroup registrar - */ + * \ingroup registrar + */ #ifndef REGTIME_H diff --git a/modules/registrar/reply.h b/modules/registrar/reply.h index f10840e5b9b..d796c07fbd0 100644 --- a/modules/registrar/reply.h +++ b/modules/registrar/reply.h @@ -15,16 +15,16 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /*! * \file * \brief SIP registrar module - send a reply - * \ingroup registrar - */ + * \ingroup registrar + */ #ifndef REPLY_H diff --git a/modules/registrar/rerrno.c b/modules/registrar/rerrno.c index 8650fcea2c3..120ae8ec648 100644 --- a/modules/registrar/rerrno.c +++ b/modules/registrar/rerrno.c @@ -15,16 +15,16 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /*! * \file * \brief SIP registrar module - registrar errno - * \ingroup registrar - */ + * \ingroup registrar + */ #include "rerrno.h" diff --git a/modules/registrar/save.h b/modules/registrar/save.h index f8fc0944443..b4cf7211fad 100644 --- a/modules/registrar/save.h +++ b/modules/registrar/save.h @@ -1,5 +1,5 @@ /* - * Functions that process REGISTER message + * Functions that process REGISTER message * and store data in usrloc * * Copyright (C) 2001-2003 FhG Fokus @@ -16,16 +16,16 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ /*! * \file * \brief SIP registrar module - process REGISTER message - * \ingroup registrar - */ + * \ingroup registrar + */ #ifndef SAVE_H diff --git a/modules/registrar/sip_msg.c b/modules/registrar/sip_msg.c index 5ca83ebcf5d..c508f2d3be2 100644 --- a/modules/registrar/sip_msg.c +++ b/modules/registrar/sip_msg.c @@ -15,22 +15,22 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /*! * \file * \brief SIP registrar module - SIP message related functions - * \ingroup registrar - */ + * \ingroup registrar + */ #include "../../parser/hf.h" #include "../../dprint.h" -#include "../../parser/parse_expires.h" +#include "../../parser/parse_expires.h" #include "../../ut.h" #include "../../qvalue.h" #include "reg_mod.h" /* Module parameters */ @@ -150,12 +150,14 @@ int check_contacts(struct sip_msg* _m, int* _s) /* The first Contact HF is star */ /* Expires must be zero */ if (get_expires_hf(_m) != 0) { + LM_WARN("expires must be 0 for star contact\n"); rerrno = R_STAR_EXP; return 1; } /* Message must contain no contacts */ if (((contact_body_t*)_m->contact->parsed)->contacts) { + LM_WARN("star contact cannot be mixed with other contacts\n"); rerrno = R_STAR_CONT; return 1; } @@ -164,6 +166,7 @@ int check_contacts(struct sip_msg* _m, int* _s) p = _m->contact->next; while(p) { if (p->type == HDR_CONTACT_T) { + LM_WARN("star contact cannot be mixed with other contacts\n"); rerrno = R_STAR_CONT; return 1; } @@ -172,18 +175,24 @@ int check_contacts(struct sip_msg* _m, int* _s) *_s = 1; } else { /* The first Contact HF is not star */ - /* Message must contain no star Contact HF */ - p = _m->contact->next; + p = _m->contact; while(p) { if (p->type == HDR_CONTACT_T) { + /* Message must contain no star Contact HF */ if (((contact_body_t*)p->parsed)->star == 1) { + LM_WARN("star contact cannot be mixed with other contacts\n"); rerrno = R_STAR_CONT; return 1; } - /* check also the lenght of all contacts */ + /* check also the length of all contacts */ for(c=((contact_body_t*)p->parsed)->contacts ; c ; c=c->next) { - if (c->uri.len > CONTACT_MAX_SIZE - || (c->received && c->received->len>RECEIVED_MAX_SIZE) ) { + if (c->uri.len > CONTACT_MAX_SIZE) { + LM_WARN("contact uri is too long: [%.*s]\n", c->uri.len, c->uri.s); + rerrno = R_CONTACT_LEN; + return 1; + } + if (c->received && c->received->len>RECEIVED_MAX_SIZE) { + LM_WARN("received attribute of contact is too long\n"); rerrno = R_CONTACT_LEN; return 1; } diff --git a/modules/registrar/sip_msg.h b/modules/registrar/sip_msg.h index c405b9fa44e..3a81858411d 100644 --- a/modules/registrar/sip_msg.h +++ b/modules/registrar/sip_msg.h @@ -15,15 +15,15 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /*! * \file * \brief SIP registrar module - SIP message related functions - * \ingroup registrar - */ + * \ingroup registrar + */ #ifndef SIP_MSG_H diff --git a/modules/rls/README b/modules/rls/README index 62c9f96755c..a90a2cdaa7f 100644 --- a/modules/rls/README +++ b/modules/rls/README @@ -223,7 +223,7 @@ Chapter 1. Admin Guide The database url. - Default value is “mysql://openser:openserrw@localhost/openser”. + Default value is “mysql://kamailio:kamailiorw@localhost/kamailio”. Example 1.1. Set db_url parameter ... diff --git a/modules/rr/README b/modules/rr/README index 7437b0a1f75..6c01c9707b0 100644 --- a/modules/rr/README +++ b/modules/rr/README @@ -20,11 +20,11 @@ Edited by Bogdan-Andrei Iancu - Copyright 2003 FhG FOKUS + Copyright © 2003 FhG FOKUS - Copyright 2005 Voice Sistem SRL + Copyright © 2005 Voice Sistem SRL - Copyright 2011 Carsten Bock, carsten@ng-voice.com + Copyright © 2011 Carsten Bock, carsten@ng-voice.com __________________________________________________________________ Table of Contents @@ -166,8 +166,8 @@ Chapter 1. Admin Guide 3261 (see 12.1.1 UAS behavior). For this purpose, the modules offers the following functions: - * add_rr_param() - see Section 5.6, "add_rr_param(param)" - * check_route_param() - see Section 5.7, "check_route_param(re)" + * add_rr_param() - see Section 5.6, “add_rr_param(param)” + * check_route_param() - see Section 5.7, “check_route_param(re)” Example 1.1. Dialog support in RR module UAC Kamailio PROXY UAS @@ -212,9 +212,9 @@ UAC Kamailio PROXY UAS 4.1. enable_full_lr (integer) - If set to 1 then ";lr=on" instead of just ";lr" will be used. This is - to overcome problems with broken UAs which strip ";lr" parameter when - generating Route header fields from Record-Route (";lr=on" seems to + If set to 1 then “;lr=on” instead of just “;lr” will be used. This is + to overcome problems with broken UAs which strip “;lr” parameter when + generating Route header fields from Record-Route (“;lr=on” seems to help). Default value is 0 (no). @@ -277,7 +277,7 @@ modparam("rr", "enable_double_rr", 2) If set to a non 0 value (which means yes), the username part will be also added in the Record-Route URI. - This option cannot be set when the "outbound" module is loaded before + This option cannot be set when the “outbound” module is loaded before this module as outbound uses the username part of Record-Route URIs to store flow-tokens. @@ -339,11 +339,11 @@ record_route(); The function performs routing of SIP requests which contain a route set. The name is a little bit confusing, as this function also routes - requests which are in the "strict router" format. + requests which are in the “strict router” format. This function is usually used to route in-dialog requests (like ACK, BYE, reINVITE). Nevertheless also out-of-dialog requests can have a - "pre-loaded route set" and my be routed with loose_route. It also takes + “pre-loaded route set” and my be routed with loose_route. It also takes care of translating between strict-routers and loose-router. The loose_route function analyzes the Route: headers in the requests. @@ -355,7 +355,7 @@ record_route(); indicating the local proxy, then the Route: header is removed and the function returns FALSE. - When the "outbound" module was loaded before this module and the Route: + When the “outbound” module was loaded before this module and the Route: header contains a username part this function will attempt to use the username part as a flow-token for routing. If route calculation based on flow-token succeeds, function returns TRUE even if there is only one @@ -365,7 +365,7 @@ record_route(); bypass proxy authorization. The loose_routing topic is very complex. See the RFC3261 for more - details (grep for "route set" is a good starting point in this + details (grep for “route set” is a good starting point in this comprehensive RFC). Return codes: @@ -389,9 +389,9 @@ loose_route(); If any string is passed as parameter, it will be appended as URI parameter to the Record-Route header. The string must follow the - ";name=value" scheme and it may contain pseudo-variables. + “;name=value” scheme and it may contain pseudo-variables. - When the "outbound" module was loaded before this module this function + When the “outbound” module was loaded before this module this function will determine whether outbound is required for the request and generate and add a flow-token as the username part of the Record-Route-URI. @@ -433,7 +433,7 @@ remove_record_route(); the outbound interface and the 'string2' param is pointing to the inbound interface. - When the "outbound" module was loaded before this module this function + When the “outbound” module was loaded before this module this function will determine whether outbound is required for the request and generate and add a flow-token as the username part of the Record-Route-URI. @@ -452,7 +452,7 @@ record_route_preset("1.2.3.4:5090"); given. The header field will be inserted in the message before any other Record-Route header fields. - When the "outbound" module was loaded before this module this function + When the “outbound” module was loaded before this module this function will determine whether outbound is required for the request and generate and add a flow-token as the username part of the Record-Route-URI. @@ -476,14 +476,14 @@ record_route_advertised_address("1.2.3.4:5080"); 5.6. add_rr_param(param) Adds a parameter to the Record-Route URI (param must be in - ";name=value" format. The function may be called also before or after + “;name=value” format. The function may be called also before or after the record_route() or record_route_advertised_address() calls (see - Section 5.2, "record_route() and record_route(string)" or Section 5.5, - "record_route_advertised_address(address)")). + Section 5.2, “record_route() and record_route(string)” or Section 5.5, + “record_route_advertised_address(address)”)). Meaning of the parameters is as follows: * param - String containing the URI parameter to be added. It must - follow the ";name=value" scheme; it may contain pseudo-variables. + follow the “;name=value” scheme; it may contain pseudo-variables. This function can be used from REQUEST_ROUTE, BRANCH_ROUTE and FAILURE_ROUTE. @@ -498,7 +498,7 @@ add_rr_param(";nat=yes"); The function checks if the URI parameters of the local Route header (corresponding to the local server) matches the given regular expression. It must be call after loose_route() (see Section 5.1, - "loose_route()"). + “loose_route()”). Meaning of the parameters is as follows: * re - regular expression to check against the Route URI parameters. @@ -515,20 +515,20 @@ if (check_route_param("nat=yes")) { 5.8. is_direction(dir) The function checks the flow direction of in-dialog requests. This - function uses the "ftag" prameter from the Route header, therefore the - append_fromtag (see Section 4.2, "append_fromtag (integer)" module + function uses the “ftag” prameter from the Route header, therefore the + append_fromtag (see Section 4.2, “append_fromtag (integer)” module parameter must be enabled. Also this must be called only after - loose_route() (see Section 5.1, "loose_route()"). + loose_route() (see Section 5.1, “loose_route()”). - The function returns true if the "dir" is the same with the request's + The function returns true if the “dir” is the same with the request's flow direction. - The "downstream" direction means that the request is in the same + The “downstream” direction means that the request is in the same direction as the initial request that created the dialog. Meaning of the parameters is as follows: * dir - string containing the direction to be checked. It may be - "upstream" (from callee to caller) or "downstream" (caller to + “upstream” (from callee to caller) or “downstream” (caller to callee). This function can be used from REQUEST_ROUTE. @@ -574,7 +574,7 @@ Chapter 2. Developer Guide The RR module provides an internal API to be used by other Kamailio modules. The API offers support for SIP dialog based functionalities - for more about the dialog support offered by RR module, see Section 2, - "Dialog support". + “Dialog support”. For internal(non-script) usage, the RR module offers to other module the possibility to register callback functions to be executed each time @@ -592,7 +592,7 @@ Chapter 2. Developer Guide 1.6. get_route_param( msg, name, val) 1.7. register_rrcb( callback, param) -1.1. record_route(string) +1.1. record_route(string) The function adds a new Record-Route header field. The header field will be inserted in the message before any other Record-Route header @@ -600,7 +600,7 @@ Chapter 2. Developer Guide If any string is passed as parameter, it will be appended as URI parameter to the Record-Route header. The string must follow the - ";name=value" scheme and it may contain pseudo-variables. + “;name=value” scheme and it may contain pseudo-variables. This function can be used from REQUEST_ROUTE, BRANCH_ROUTE and FAILURE_ROUTE. @@ -610,7 +610,7 @@ Chapter 2. Developer Guide record_route(); ... -1.2. record_route_advertised_address(string) +1.2. record_route_advertised_address(string) This function will add the string into a new Record-Route header field. Don't use unless you know what you are doing. The header field will be @@ -628,24 +628,24 @@ record_route(); record_route_advertised_address("1.2.3.4:5090"); ... -1.3. add_rr_param( msg, param) +1.3. add_rr_param( msg, param) Adds a parameter to the requests's Record-Route URI (param must be in - ";name=value" format). + “;name=value” format). The function returns 0 on success. Otherwise, -1 is returned. Meaning of the parameters is as follows: - * struct sip_msg* msg - request that will has the parameter "param" + * struct sip_msg* msg - request that will has the parameter “param” added to its Record-Route header. * str* param - parameter to be added to the Record-Route header - it - must be in ";name=value" format. + must be in “;name=value” format. -1.4. check_route_param( msg, re) +1.4. check_route_param( msg, re) - The function checks for the request "msg" if the URI parameters of the + The function checks for the request “msg” if the URI parameters of the local Route header (corresponding to the local server) matches the - given regular expression "re". It must be call after the loose_route + given regular expression “re”. It must be call after the loose_route was done. The function returns 0 on success. Otherwise, -1 is returned. @@ -656,26 +656,26 @@ record_route_advertised_address("1.2.3.4:5090"); * regex_t* param - compiled regular expression to be checked against the Route header parameters. -1.5. is_direction( msg, dir) +1.5. is_direction( msg, dir) - The function checks the flow direction of the request "msg". As for - checking it's used the "ftag" Route header parameter, the - append_fromtag (see Section 4.2, "append_fromtag (integer)" module + The function checks the flow direction of the request “msg”. As for + checking it's used the “ftag” Route header parameter, the + append_fromtag (see Section 4.2, “append_fromtag (integer)” module parameter must be enables. Also this must be call only after the loose_route is done. - The function returns 0 if the "dir" is the same with the request's flow + The function returns 0 if the “dir” is the same with the request's flow direction. Otherwise, -1 is returned. Meaning of the parameters is as follows: * struct sip_msg* msg - request that will have the direction checked. * int dir - direction to be checked against. It may be - "RR_FLOW_UPSTREAM" or "RR_FLOW_DOWNSTREAM". + “RR_FLOW_UPSTREAM” or “RR_FLOW_DOWNSTREAM”. -1.6. get_route_param( msg, name, val) +1.6. get_route_param( msg, name, val) - The function search in to the "msg"'s Route header parameters the - parameter called "name" and returns its value into "val". It must be + The function search in to the “msg”'s Route header parameters the + parameter called “name” and returns its value into “val”. It must be call only after the loose_route is done. The function returns 0 if parameter was found (even if it has no @@ -688,7 +688,7 @@ record_route_advertised_address("1.2.3.4:5090"); * str *val - returns the value of the searched Route header parameter if found. It might be empty string if the parameter had no value. -1.7. register_rrcb( callback, param) +1.7. register_rrcb( callback, param) The function register a new callback (along with its parameter). The callback will be called when a loose route will be performed for the diff --git a/modules/rr/loose.c b/modules/rr/loose.c index 76204c97888..4248a2ea1b7 100644 --- a/modules/rr/loose.c +++ b/modules/rr/loose.c @@ -43,7 +43,7 @@ #include "rr_mod.h" -#define RR_ERROR -1 /*!< An error occured while processing route set */ +#define RR_ERROR -1 /*!< An error occurred while processing route set */ #define RR_DRIVEN 1 /*!< The next hop is determined from the route set */ #define RR_OB_DRIVEN 2 /*!< The next hop is determined from the route set based on flow-token */ #define NOT_RR_DRIVEN -1 /*!< The next hop is not determined from the route set */ @@ -56,7 +56,8 @@ #define ROUTE_SUFFIX_LEN (sizeof(ROUTE_SUFFIX)-1) /*! variables used to hook the param part of the local route */ -static unsigned int routed_msg_id; +static unsigned int routed_msg_id = 0; +static int routed_msg_pid = 0; static str routed_params = {0,0}; @@ -124,7 +125,7 @@ static inline int find_first_route(struct sip_msg* _m) static inline int is_myself(sip_uri_t *_puri) { int ret; - + ret = check_self(&_puri->host, _puri->port_no?_puri->port_no:SIP_PORT, 0);/* match all protos*/ if (ret < 0) return 0; @@ -137,7 +138,7 @@ static inline int is_myself(sip_uri_t *_puri) return 0; } #endif - + if(ret==1) { /* match on host:port, but if gruu, then fail */ if(_puri->gr.s!=NULL) @@ -583,6 +584,7 @@ static inline int after_strict(struct sip_msg* _m) /* reset rr handling static vars for safety in error case */ routed_msg_id = 0; + routed_msg_pid = 0; routed_params.s = NULL; routed_params.len = 0; @@ -634,6 +636,7 @@ static inline int after_strict(struct sip_msg* _m) * important note: RURI is already parsed by the above function, so * we just used it without any checking */ routed_msg_id = _m->id; + routed_msg_pid = _m->pid; routed_params = _m->parsed_uri.params; if (is_strict(&puri.params)) { @@ -759,6 +762,7 @@ static inline int after_loose(struct sip_msg* _m, int preloaded) struct socket_info *si; int uri_is_myself; int use_ob = 0; + str rparams; hdr = _m->route; rt = (rr_t*)hdr->parsed; @@ -766,6 +770,7 @@ static inline int after_loose(struct sip_msg* _m, int preloaded) /* reset rr handling static vars for safety in error case */ routed_msg_id = 0; + routed_msg_pid = 0; if (parse_uri(uri.s, uri.len, &puri) < 0) { LM_ERR("failed to parse the first route URI (%.*s)\n", @@ -783,6 +788,7 @@ static inline int after_loose(struct sip_msg* _m, int preloaded) uri.len, ZSW(uri.s)); /* set the hooks for the params */ routed_msg_id = _m->id; + routed_msg_pid = _m->pid; if ((use_ob = process_outbound(_m, puri.user)) < 0) { LM_INFO("failed to process outbound flow-token\n"); @@ -821,12 +827,19 @@ static inline int after_loose(struct sip_msg* _m, int preloaded) } if (!use_ob) { - si = grep_sock_info( &puri.host, puri.port_no, puri.proto); - if (si) { + if ((si = grep_sock_info( &puri.host, puri.port_no?puri.port_no:proto_default_port(puri.proto), puri.proto)) != 0) { + set_force_socket(_m, si); + } else if ((si = grep_sock_info( &puri.host, puri.port_no, puri.proto)) != 0) { set_force_socket(_m, si); } else { - if (enable_socket_mismatch_warning) - LM_WARN("no socket found for match second RR\n"); + if (enable_socket_mismatch_warning) { + LM_WARN("no socket found to match second RR (%.*s)\n", + rt->nameaddr.uri.len, ZSW(rt->nameaddr.uri.s)); + if(!is_myself(&puri)) { + LM_WARN("second RR uri is not myself (%.*s)\n", + rt->nameaddr.uri.len, ZSW(rt->nameaddr.uri.s)); + } + } } } @@ -850,7 +863,7 @@ static inline int after_loose(struct sip_msg* _m, int preloaded) rt = (rr_t*)hdr->parsed; } else rt = rt->next; } - + uri = rt->nameaddr.uri; if (parse_uri(uri.s, uri.len, &puri) < 0) { LM_ERR("failed to parse the next route URI (%.*s)\n", @@ -884,7 +897,7 @@ static inline int after_loose(struct sip_msg* _m, int preloaded) LM_ERR("checking maddr failed\n"); return RR_ERROR; } - + if (set_dst_uri(_m, &uri) < 0) { LM_ERR("failed to set dst_uri\n"); return RR_ERROR; @@ -897,7 +910,7 @@ static inline int after_loose(struct sip_msg* _m, int preloaded) /* There is a previous route uri which was 2nd uri of mine * and must be removed here */ if (rt != hdr->parsed) { - if (!del_lump(_m, hdr->body.s - _m->buf, + if (!del_lump(_m, hdr->body.s - _m->buf, rt->nameaddr.name.s - hdr->body.s, 0)) { LM_ERR("failed to remove Route HF\n"); return RR_ERROR; @@ -910,8 +923,10 @@ static inline int after_loose(struct sip_msg* _m, int preloaded) status = RR_OB_DRIVEN; /* run RR callbacks only if we have Route URI parameters */ - if(routed_params.len > 0) - run_rr_callbacks( _m, &routed_params ); + if(routed_params.len > 0) { + rparams = routed_params; + run_rr_callbacks( _m, &rparams ); + } return status; } @@ -929,7 +944,7 @@ int loose_route(struct sip_msg* _m) LM_DBG("There is no Route HF\n"); return -1; } - + if (parse_sip_msg_uri(_m)<0) { LM_ERR("failed to parse Request URI\n"); return -1; @@ -949,6 +964,70 @@ int loose_route(struct sip_msg* _m) } } +/** + * + */ +int redo_route_params(sip_msg_t *msg) +{ + hdr_field_t *hdr; + sip_uri_t puri; + rr_t* rt; + str uri; + int uri_is_myself; + + int redo = 0; + + if(msg->first_line.type != SIP_REQUEST) { + return -1; + } + + if(msg->route==NULL || msg->route->parsed==NULL) { + return -1; + } + + /* check if the hooked params belong to the same message */ + if (routed_msg_id != msg->id || routed_msg_pid != msg->pid) { + redo = 1; + } + if((redo==0) && (routed_params.s==NULL || routed_params.len<=0)) { + redo = 1; + } + if((redo==0) && (routed_params.sbuf + || routed_params.s>msg->buf+msg->len)) { + redo = 1; + } + if(redo==1) { + hdr = msg->route; + rt = (rr_t*)hdr->parsed; + uri = rt->nameaddr.uri; + + /* reset rr handling static vars for safety in error case */ + routed_msg_id = 0; + routed_msg_pid = 0; + + if (parse_uri(uri.s, uri.len, &puri) < 0) { + LM_ERR("failed to parse the first route URI (%.*s)\n", + uri.len, ZSW(uri.s)); + return -1; + } + + uri_is_myself = is_myself(&puri); + + /* if the URI was added by me, remove it */ + if (uri_is_myself>0) { + LM_DBG("Topmost route URI: '%.*s' is me\n", + uri.len, ZSW(uri.s)); + /* set the hooks for the params */ + routed_msg_id = msg->id; + routed_msg_pid = msg->pid; + routed_params = puri.params; + return 0; + } else { + return -1; + } + } + return 0; +} /*! * \brief Check if the route hdr has the required parameter @@ -962,22 +1041,31 @@ int loose_route(struct sip_msg* _m) * \param re compiled regular expression to be checked against the Route header parameters * \return -1 on failure, 1 on success */ -int check_route_param(struct sip_msg * msg, regex_t* re) +int check_route_param(sip_msg_t * msg, regex_t* re) { regmatch_t pmatch; char bk; str params; + str rruri; /* check if the hooked params belong to the same message */ - if (routed_msg_id != msg->id) + if(redo_route_params(msg)<0) { return -1; + } /* check if params are present */ - if ( !routed_params.s || !routed_params.len ) + if ( !routed_params.s || routed_params.len<=0 ) { return -1; + } + rruri = ((rr_t*)(msg->route->parsed))->nameaddr.uri; /* include also the first ';' */ - for( params=routed_params ; params.s[0]!=';' ; params.s--,params.len++ ); + for( params=routed_params ; + params.s>rruri.s && params.s[0]!=';' ; + params.s--,params.len++ ); + + LM_DBG("route params checking against [%.*s] (orig: [%.*s])\n", + params.len, params.s, routed_params.len, routed_params.s); /* do the well-known trick to convert to null terminted */ bk = params.s[params.len]; @@ -1006,7 +1094,7 @@ int check_route_param(struct sip_msg * msg, regex_t* re) * It might be an empty string if the parameter had no value. * \return 0 if parameter was found (even if it has no value), -1 otherwise */ -int get_route_param( struct sip_msg *msg, str *name, str *val) +int get_route_param(sip_msg_t *msg, str *name, str *val) { char *p; char *end; @@ -1014,11 +1102,12 @@ int get_route_param( struct sip_msg *msg, str *name, str *val) int quoted; /* check if the hooked params belong to the same message */ - if (routed_msg_id != msg->id) + if(redo_route_params(msg)<0) { goto notfound; + } /* check if params are present */ - if ( !routed_params.s || !routed_params.len ) + if ( !routed_params.s || routed_params.len<=0 ) goto notfound; end = routed_params.s + routed_params.len; diff --git a/modules/rr/record.c b/modules/rr/record.c index b8f526e17bd..2f93adf6f6e 100644 --- a/modules/rr/record.c +++ b/modules/rr/record.c @@ -492,7 +492,7 @@ int record_route(struct sip_msg* _m, str *params) int record_route_preset(struct sip_msg* _m, str* _data) { str user = {NULL, 0}; - struct to_body* from; + struct to_body* from = NULL; struct lump* l; char* hdr, *p; int hdr_len; @@ -511,10 +511,6 @@ int record_route_preset(struct sip_msg* _m, str* _data) rr_prefix_len = RR_PREFIX_SIPS_LEN; } - from = 0; - user.len = 0; - user.s = 0; - if (add_username) { if (get_username(_m, &user) < 0) { LM_ERR("failed to extract username\n"); @@ -690,7 +686,6 @@ static inline int build_advertised_rr(struct lump* _l, struct lump* _l2, str *_d } memcpy(p, _data->s, _data->len); - p += _data->len; p = suffix; if (tag && tag->len) { diff --git a/modules/rtimer/README b/modules/rtimer/README index ce5dc3de5c7..cafd917de15 100644 --- a/modules/rtimer/README +++ b/modules/rtimer/README @@ -11,7 +11,7 @@ Daniel-Constantin Mierla - Copyright 2009 http://www.asipto.com + Copyright © 2009 http://www.asipto.com __________________________________________________________________ Table of Contents diff --git a/modules/rtimer/rtimer_mod.c b/modules/rtimer/rtimer_mod.c index c0cacf8d0ec..a15a08c23df 100644 --- a/modules/rtimer/rtimer_mod.c +++ b/modules/rtimer/rtimer_mod.c @@ -224,8 +224,12 @@ int stm_t_param(modparam_t type, void *val) tmp.name = pit->body; } else if(pit->name.len==4 && strncasecmp(pit->name.s, "mode", 4)==0) { - if(tmp.mode==0) - str2int(&pit->body, &tmp.mode); + if(tmp.mode==0) { + if (str2int(&pit->body, &tmp.mode) < 0) { + LM_ERR("invalid mode: %.*s\n", pit->body.len, pit->body.s); + return -1; + } + } } else if(pit->name.len==8 && strncasecmp(pit->name.s, "interval", 8)==0) { if(pit->body.s[pit->body.len-1]=='u' @@ -234,7 +238,10 @@ int stm_t_param(modparam_t type, void *val) tmp.flags |= RTIMER_INTERVAL_USEC; tmp.mode = 1; } - str2int(&pit->body, &tmp.interval); + if (str2int(&pit->body, &tmp.interval) < 0) { + LM_ERR("invalid interval: %.*s\n", pit->body.len, pit->body.s); + return -1; + } } } if(tmp.name.s==NULL) diff --git a/modules/rtjson/rtjson_routing.c b/modules/rtjson/rtjson_routing.c index bb59da51f6c..5542e63e1d9 100644 --- a/modules/rtjson/rtjson_routing.c +++ b/modules/rtjson/rtjson_routing.c @@ -371,8 +371,8 @@ int rtjson_init_serial(sip_msg_t *msg, srjson_doc_t *jdoc, sr_xavp_t *iavp) } rj = srjson_GetObjectItem(jdoc, nj, "branch_flags"); - if(rj!=NULL && rj->type==srjson_Number && rj->valueint!=0) { - bflags = rj->valueint; + if(rj!=NULL && rj->type==srjson_Number && SRJSON_GET_UINT(rj)!=0) { + bflags = SRJSON_GET_UINT(rj); old_bflags = 0; getbflagsval(0, &old_bflags); @@ -406,12 +406,12 @@ int rtjson_prepare_branch(sip_msg_t *msg, srjson_doc_t *jdoc, srjson_t *nj) if(tmb.set_fr!=NULL) { rj = srjson_GetObjectItem(jdoc, nj, "fr_timer"); - if(rj!=NULL && rj->type==srjson_Number && rj->valueint!=0) { - fr = rj->valueint; + if(rj!=NULL && rj->type==srjson_Number && SRJSON_GET_UINT(rj)!=0) { + fr = SRJSON_GET_UINT(rj); } rj = srjson_GetObjectItem(jdoc, nj, "fr_inv_timer"); - if(rj!=NULL && rj->type==srjson_Number && rj->valueint!=0) { - fr_inv = rj->valueint; + if(rj!=NULL && rj->type==srjson_Number && SRJSON_GET_UINT(rj)!=0) { + fr_inv = SRJSON_GET_UINT(rj); } if(fr || fr_inv) tmb.set_fr(msg, fr_inv, fr); } diff --git a/modules/rtpengine/README b/modules/rtpengine/README index 00b26f28609..df6d7ff730e 100644 --- a/modules/rtpengine/README +++ b/modules/rtpengine/README @@ -36,15 +36,15 @@ Richard Fuchs Sipwise GmbH - Copyright 2003-2008 Sippy Software, Inc. + Copyright © 2003-2008 Sippy Software, Inc. - Copyright 2005 Voice Sistem SRL + Copyright © 2005 Voice Sistem SRL - Copyright 2009-2014 TuTPro Inc. + Copyright © 2009-2014 TuTPro Inc. - Copyright 2010 VoIPEmbedded Inc. + Copyright © 2010 VoIPEmbedded Inc. - Copyright 2013-2015 Sipwise GmbH + Copyright © 2013-2015 Sipwise GmbH __________________________________________________________________ Table of Contents @@ -63,13 +63,24 @@ Richard Fuchs 4.1. rtpengine_sock (string) 4.2. rtpengine_disable_tout (integer) 4.3. rtpengine_tout_ms (integer) - 4.4. queried_nodes_limit (integer) - 4.5. rtpengine_retr (integer) - 4.6. extra_id_pv (string) - 4.7. setid_avp (string) - 4.8. force_send_interface (string) - 4.9. write_sdp_pv (string) - 4.10. rtp_inst_pvar (string) + 4.4. rtpengine_allow_op (integer) + 4.5. queried_nodes_limit (integer) + 4.6. rtpengine_retr (integer) + 4.7. extra_id_pv (string) + 4.8. setid_avp (string) + 4.9. force_send_interface (string) + 4.10. read_sdp_pv (string) + 4.11. write_sdp_pv (string) + 4.12. rtp_inst_pvar (string) + 4.13. hash_table_size (integer) + 4.14. hash_table_tout (integer) + 4.15. db_url (string) + 4.16. table_name (string) + 4.17. setid_col (string) + 4.18. url_col (string) + 4.19. weight_col (string) + 4.20. disabled_col (string) + 4.21. setid_default (string) 5. Functions @@ -89,6 +100,8 @@ Richard Fuchs 7.1. nh_enable_rtpp proxy_url/all 0/1 7.2. nh_show_rtpp proxy_url/all 7.3. nh_ping_rtpp proxy_url/all + 7.4. nh_reload_rtpp + 7.5. nh_show_hash_total 2. Frequently Asked Questions @@ -97,23 +110,37 @@ Richard Fuchs 1.1. Set rtpengine_sock parameter 1.2. Set rtpengine_disable_tout parameter 1.3. Set rtpengine_tout_ms parameter - 1.4. Set queried_nodes_limit parameter - 1.5. Set rtpengine_retr parameter - 1.6. Set extra_id_pv parameter - 1.7. Set setid_avp parameter - 1.8. Set force_send_interface parameter - 1.9. Set write_sdp_pv parameter - 1.10. Set rtp_inst_pvar parameter - 1.11. set_rtpengine_set usage - 1.12. rtpengine_offer usage - 1.13. rtpengine_answer usage - 1.14. rtpengine_delete usage - 1.15. rtpengine_manage usage - 1.16. start_recording usage - 1.17. $rtpstat Usage - 1.18. nh_enable_rtpp usage - 1.19. nh_show_rtpp usage - 1.20. nh_ping_rtpp usage + 1.4. Set rtpengine_allow_op parameter + 1.5. Set queried_nodes_limit parameter + 1.6. Set rtpengine_retr parameter + 1.7. Set extra_id_pv parameter + 1.8. Set setid_avp parameter + 1.9. Set force_send_interface parameter + 1.10. Set read_sdp_pv parameter + 1.11. Set write_sdp_pv parameter + 1.12. Set rtp_inst_pvar parameter + 1.13. Set hash_table_size parameter + 1.14. Set hash_table_tout parameter + 1.15. Set db_url parameter + 1.16. Set table_name parameter + 1.17. Setup rtpengine table + 1.18. Set setid_col parameter + 1.19. Set url_col parameter + 1.20. Set weight_col parameter + 1.21. Set disabled_col parameter + 1.22. Set setid_default parameter + 1.23. set_rtpengine_set usage + 1.24. rtpengine_offer usage + 1.25. rtpengine_answer usage + 1.26. rtpengine_delete usage + 1.27. rtpengine_manage usage + 1.28. start_recording usage + 1.29. $rtpstat Usage + 1.30. nh_enable_rtpp usage + 1.31. nh_show_rtpp usage + 1.32. nh_ping_rtpp usage + 1.33. nh_reload_rtpp usage + 1.34. nh_show_hash_total usage Chapter 1. Admin Guide @@ -131,13 +158,24 @@ Chapter 1. Admin Guide 4.1. rtpengine_sock (string) 4.2. rtpengine_disable_tout (integer) 4.3. rtpengine_tout_ms (integer) - 4.4. queried_nodes_limit (integer) - 4.5. rtpengine_retr (integer) - 4.6. extra_id_pv (string) - 4.7. setid_avp (string) - 4.8. force_send_interface (string) - 4.9. write_sdp_pv (string) - 4.10. rtp_inst_pvar (string) + 4.4. rtpengine_allow_op (integer) + 4.5. queried_nodes_limit (integer) + 4.6. rtpengine_retr (integer) + 4.7. extra_id_pv (string) + 4.8. setid_avp (string) + 4.9. force_send_interface (string) + 4.10. read_sdp_pv (string) + 4.11. write_sdp_pv (string) + 4.12. rtp_inst_pvar (string) + 4.13. hash_table_size (integer) + 4.14. hash_table_tout (integer) + 4.15. db_url (string) + 4.16. table_name (string) + 4.17. setid_col (string) + 4.18. url_col (string) + 4.19. weight_col (string) + 4.20. disabled_col (string) + 4.21. setid_default (string) 5. Functions @@ -157,6 +195,8 @@ Chapter 1. Admin Guide 7.1. nh_enable_rtpp proxy_url/all 0/1 7.2. nh_show_rtpp proxy_url/all 7.3. nh_ping_rtpp proxy_url/all + 7.4. nh_reload_rtpp + 7.5. nh_show_hash_total 1. Overview @@ -177,7 +217,7 @@ Chapter 1. Admin Guide The module allows definition of several sets of rtpproxies. Load-balancing will be performed over a set and the admin has the ability to choose what set should be used. The set is selected via its - id - the id being defined with the set. Refer to the "rtpengine_sock" + id - the id being defined with the set. Refer to the “rtpengine_sock” module parameter definition for syntax description. The balancing inside a set is done automatically by the module based on @@ -202,6 +242,31 @@ Chapter 1. Admin Guide the set was selected using setid_avp, the avp needs to be set only once before rtpengine_offer() or rtpengine_manage() call. + From the current implementation point of view, the sets of rtpproxy + nodes are shared memory(shm), so all processes can see a common list of + nodes. There is no locking when setting the nodes enabled/disabled (to + keep the memory access as fast as possible). Thus, problems related to + node state might appear for concurent processes that might set the + nodes enabled/disabled(e.g. by fifo command). This robustness problems + are overcomed as follows. + + If the current process sees the selected node as disabled, the node is + force tested before the current process actually takes the disabled + decision. If the test succeeds, the process will set the node as + enabled (but other concurrent process might still see it as disabled). + . + + If the current process sees the selected node as enabled, it does no + additional checks and sends the command which will fail in case the + machine is actually broken. The process will set the node as disabled + (but other concurrent process might still see it as enabled). + + The 'kamctl fifo' commands (including rtpengin ones) are executed by an + exclusive process which operate on the same shared memory node list. + + All the nodes are pinged in the beginning by all the processes, even if + the node list is shared memory. + 3. Dependencies 3.1. Kamailio Modules @@ -224,20 +289,31 @@ Chapter 1. Admin Guide 4.1. rtpengine_sock (string) 4.2. rtpengine_disable_tout (integer) 4.3. rtpengine_tout_ms (integer) - 4.4. queried_nodes_limit (integer) - 4.5. rtpengine_retr (integer) - 4.6. extra_id_pv (string) - 4.7. setid_avp (string) - 4.8. force_send_interface (string) - 4.9. write_sdp_pv (string) - 4.10. rtp_inst_pvar (string) + 4.4. rtpengine_allow_op (integer) + 4.5. queried_nodes_limit (integer) + 4.6. rtpengine_retr (integer) + 4.7. extra_id_pv (string) + 4.8. setid_avp (string) + 4.9. force_send_interface (string) + 4.10. read_sdp_pv (string) + 4.11. write_sdp_pv (string) + 4.12. rtp_inst_pvar (string) + 4.13. hash_table_size (integer) + 4.14. hash_table_tout (integer) + 4.15. db_url (string) + 4.16. table_name (string) + 4.17. setid_col (string) + 4.18. url_col (string) + 4.19. weight_col (string) + 4.20. disabled_col (string) + 4.21. setid_default (string) 4.1. rtpengine_sock (string) Definition of socket(s) used to connect to (a set) RTP proxy. It may specify a UNIX socket or an IPv4/IPv6 UDP socket. - Default value is "NONE" (disabled). + Default value is “NONE” (disabled). Example 1.1. Set rtpengine_sock parameter ... @@ -259,7 +335,7 @@ modparam("rtpengine", "rtpengine_sock", rtpengine module will not attempt to establish communication to that RTP proxy for rtpengine_disable_tout seconds. - Default value is "60". + Default value is “60”. Example 1.2. Set rtpengine_disable_tout parameter ... @@ -271,14 +347,37 @@ modparam("rtpengine", "rtpengine_disable_tout", 20) Timeout value expressed in milliseconds in waiting for reply from RTP proxy. - Default value is "1000". + Default value is “1000”. Example 1.3. Set rtpengine_tout_ms parameter ... modparam("rtpengine", "rtpengine_tout_ms", 2000) ... -4.4. queried_nodes_limit (integer) +4.4. rtpengine_allow_op (integer) + + Enable this to allow finishing the current sessions while denying new + sessions for the manually deactivated nodes via kamctl command i.e. + "disabled(permanent)" nodes. Probably the manually deactivated machine + is still running(did not crash). + + This is useful when deactivating a node for maintanance and reject new + sessions but allow current ones to finish. + + The behaviour is the same for a rtpengine deleted table node. When the + node is deleted from the table and the table reloaded (see + nh_reload_rtpp) the node actually is disabled(permanent) and hidden for + display. Next time the same node will be added in the table, and the + content reloaded, it will be updated and re-displayed. + + Default value is “0” to keep the current behaviour. + + Example 1.4. Set rtpengine_allow_op parameter +... +modparam("rtpengine", "rtpengine_allow_op", 1) +... + +4.5. queried_nodes_limit (integer) The total number of nodes inside a set (sets are configurable via rtpengine_sock function) to be queried before giving up establishing a @@ -288,37 +387,37 @@ modparam("rtpengine", "rtpengine_tout_ms", 2000) By default all nodes in a set are tried before giving up communicating with the rtpengines. - Example 1.4. Set queried_nodes_limit parameter + Example 1.5. Set queried_nodes_limit parameter ... modparam("rtpengine", "queried_nodes_limit", 5) ... -4.5. rtpengine_retr (integer) +4.6. rtpengine_retr (integer) How many times the module should retry to send and receive after timeout was generated. - Default value is "5". + Default value is “5”. - Example 1.5. Set rtpengine_retr parameter + Example 1.6. Set rtpengine_retr parameter ... modparam("rtpengine", "rtpengine_retr", 2) ... -4.6. extra_id_pv (string) +4.7. extra_id_pv (string) - The parameter sets the PV defination to use when the "b" parameter is + The parameter sets the PV defination to use when the “b” parameter is used on rtpengine_delete(), rtpengine_offer(), rtpengine_answer() or rtpengine_manage() command. - Default is empty, the "b" parameter may not be used then. + Default is empty, the “b” parameter may not be used then. - Example 1.6. Set extra_id_pv parameter + Example 1.7. Set extra_id_pv parameter ... modparam("rtpengine", "extra_id_pv", "$avp(extra_id)") ... -4.7. setid_avp (string) +4.8. setid_avp (string) The parameter defines an AVP that, if set, determines which RTP proxy set rtpengine_offer(), rtpengine_answer(), rtpengine_delete(), and @@ -326,12 +425,12 @@ modparam("rtpengine", "extra_id_pv", "$avp(extra_id)") There is no default value. - Example 1.7. Set setid_avp parameter + Example 1.8. Set setid_avp parameter ... modparam("rtpengine", "setid_avp", "$avp(setid)") ... -4.8. force_send_interface (string) +4.9. force_send_interface (string) Forces all control messages between the SIP proxy and the RTP proxy to be sent from the specified local interface. Both IPv4 and IPv6 @@ -345,14 +444,32 @@ modparam("rtpengine", "setid_avp", "$avp(setid)") There is no default value. - Example 1.8. Set force_send_interface parameter + Example 1.9. Set force_send_interface parameter ... modparam("rtpengine", "force_send_interface", "10.3.7.123") modparam("rtpengine", "force_send_interface", "2001:8d8:1ff:10c0:9a90:96ff:fea8: fd99") ... -4.9. write_sdp_pv (string) +4.10. read_sdp_pv (string) + + If this parameter is set to a valid AVP or script var specifier, + rtpengine will take the input SDP from this pv instead of the message + body. + + There is no default value. + + Example 1.10. Set read_sdp_pv parameter +... +modparam("rtpengine", "read_sdp_pv", "$var(sdp)") +... +route { + ... + $var(sdp) = $rb + "a=foo:bar\r\n"; + rtpengine_manage(); +} + +4.11. write_sdp_pv (string) If this parameter is set to a valid AVP or script var specifier, the SDP returned by rtpengine in the offer/answer operations is returned in @@ -360,14 +477,17 @@ fd99") There is no default value. - Example 1.9. Set write_sdp_pv parameter + Example 1.11. Set write_sdp_pv parameter ... modparam("rtpengine", "write_sdp_pv", "$avp(sdp)") - ... or -modparam("rtpengine", "write_sdp_pv", "$pv(sdp)") ... +route { + ... + rtpengine_manage(); + set_body("$avp(sdp)a=baz123\r\n", "application/sdp"); +} -4.10. rtp_inst_pvar (string) +4.12. rtp_inst_pvar (string) A pseudo variable to store the chosen RTP Engine IP address. If this parameter is set, the IP address and port of the instance chosen will @@ -375,9 +495,164 @@ modparam("rtpengine", "write_sdp_pv", "$pv(sdp)") By default, this parameter is not set. - Example 1.10. Set rtp_inst_pvar parameter + Example 1.12. Set rtp_inst_pvar parameter +... +modparam("rtpengine", "rtp_inst_pvar", "$avp(RTP_INSTANCE)") +... + +4.13. hash_table_size (integer) + + Size of the hash table. Default value is 256. + + NOTE: If configured size is less than 1, the size will be defaulted to + 1. + + Example 1.13. Set hash_table_size parameter +... +modparam("rtpengine", "hash_table_size", "123") +... + +4.14. hash_table_tout (integer) + + Number of seconds after an rtpengine hash table entry is marked for + deletion. By default, this parameter is set to 3600 (seconds). + + To maintain information about a selected rtp machine node, for a given + call, entries are added in a hashtable of (callid, node) pairs. When + command comes, lookup callid. If found, return chosen node. If not + found, choose a new node, insert it in the hastable and return the + chosen node. + + NOTE: In the current implementation, the actual deletion happens on the + fly, while insert/remove/lookup the hastable, only for the entries in + the insert/remove/lookup path. + + NOTE: When configuring this parameter, one should consider maximum call + time VS share memory for unfinished calls. + + Example 1.14. Set hash_table_tout parameter +... +modparam("rtpengine", "hash_table_tout", "300") +... + +4.15. db_url (string) + + The rtpengine datablase url. If present and valid, it activates + database mode. Node information is read from database, not from config. + + By default, the datablase url is NULL (not set). + + Example 1.15. Set db_url parameter +... +modparam("rtpengine", "db_url", "mysql://pass@localhost/db") +... + +4.16. table_name (string) + + The rtpengine table name. If database mode is activated (i.e. valid + db_url), set the name of rtpengine table, on startup. + + By default, the rtpengine table name is "rtpengine". + + NOTE: One needs to add the version of the rtpengine table in the + version table. The current version is version 1. + + Example 1.16. Set table_name parameter ... -modparam("rtpproxy", "rtp_inst_pvar", "$avp(RTP_INSTANCE)") +modparam("rtpengine", "table_name", "rtpengine_table_name") +... + + Example 1.17. Setup rtpengine table +mysql> describe rtpengine; ++----------+------------------+------+-----+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++----------+------------------+------+-----+---------+-------+ +| setid | int(10) unsigned | NO | | NULL | | +| url | varchar(256) | NO | | NULL | | +| weight | int(10) unsigned | NO | | NULL | | +| disabled | int(11) | NO | | NULL | | ++----------+------------------+------+-----+---------+-------+ + +mysql> select * from rtpengine; ++-------+---------------------------+--------+----------+ +| setid | url | weight | disabled | ++-------+---------------------------+--------+----------+ +| 0 | udp:rtpproxy1.domain:8800 | 100 | 0 | +| 0 | udp:rtpproxy2.domain:8800 | 200 | 1 | ++-------+---------------------------+--------+----------+ + +mysql> select * from version; ++---------------------------+---------------+ +| table_name | table_version | ++---------------------------+---------------+ +| rtpengine | 1 | ++---------------------------+---------------+ + +4.17. setid_col (string) + + Column name in the rtpengine table. If database mode is activated (i.e. + valid db_url), set the setid of rtp nodes according to this column, on + startup. The MySQL value for this column should be INT UNSIGNED. + + By default, the column name is "setid". + + Example 1.18. Set setid_col parameter +... +modparam("rtpengine", "setid_col", "setid_column_name") +... + +4.18. url_col (string) + + Column name in the rtpengine table. If database mode is activated (i.e. + valid db_url), set the url of rtp nodes according to this column, on + startup. The MySQL value for this column should be VARCHAR. + + By default, the column name is "url". + + Example 1.19. Set url_col parameter +... +modparam("rtpengine", "url_col", "url_column_name") +... + +4.19. weight_col (string) + + Column name in the rtpengine table. If database mode is activated (i.e. + valid db_url), set the weight of rtp nodes according to this column, on + startup. The column value has priority over the URL weight. The MySQL + value for this column should be INT UNSIGNED. + + By default, the column name is "weight". + + Example 1.20. Set weight_col parameter +... +modparam("rtpengine", "weight_col", "weight_column_name") +... + +4.20. disabled_col (string) + + Column name in the rtpengine table. If database mode is activated (i.e. + valid db_url), set the state of rtp nodes according to this column, on + startup. The MySQL value for this column should be INT. + + By default, the column name is "disabled". + + Example 1.21. Set disabled_col parameter +... +modparam("rtpengine", "disabled_col", "disabled_column_name") +... + +4.21. setid_default (string) + + The default set of nodes to be used. + + By default, the setid is 0. + + NOTE that if setid_avp is configured, this value will be ignored and + the active set will be chosen according to the setid_avp. + + Example 1.22. Set setid_default parameter +... +modparam("rtpengine", "setid_default", 11) ... 5. Functions @@ -389,7 +664,7 @@ modparam("rtpproxy", "rtp_inst_pvar", "$avp(RTP_INSTANCE)") 5.5. rtpengine_manage([flags]) 5.6. start_recording() -5.1. set_rtpengine_set(setid[, setid]) +5.1. set_rtpengine_set(setid[, setid]) Sets the ID of the RTP proxy set to be used for the next rtpengine_delete(), rtpengine_offer(), rtpengine_answer() or @@ -411,13 +686,13 @@ modparam("rtpproxy", "rtp_inst_pvar", "$avp(RTP_INSTANCE)") This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE. - Example 1.11. set_rtpengine_set usage + Example 1.23. set_rtpengine_set usage ... set_rtpengine_set("2"); rtpengine_offer(); ... -5.2. rtpengine_offer([flags]) +5.2. rtpengine_offer([flags]) Rewrites SDP body to ensure that media is passed through an RTP proxy. To be invoked on INVITE for the cases the SDP bodies are in INVITE and @@ -425,31 +700,31 @@ rtpengine_offer(); Meaning of the parameters is as follows: * flags - flags to turn on some features. - The "flags" string is a list of space-separated items. Each item is - either an individual token, or a token in "key=value" format. The + The “flags” string is a list of space-separated items. Each item is + either an individual token, or a token in “key=value” format. The possible tokens are described below. - + via-branch=... - Include the "branch" value of one of the - "Via" headers in the request to the RTP proxy. Possible values - are: "1" - use the first "Via" header; "2" - use the second - "Via" header; "auto" - use the first "Via" header if this is a - request, or the second one if this is a reply; "extra" - don't + + via-branch=... - Include the “branch” value of one of the + “Via” headers in the request to the RTP proxy. Possible values + are: “1” - use the first “Via” header; “2” - use the second + “Via” header; “auto” - use the first “Via” header if this is a + request, or the second one if this is a reply; “extra” - don't take the value from a header, but instead use the value of the - "extra_id_pv" variable. This can be used to create one media + “extra_id_pv” variable. This can be used to create one media session per branch on the RTP proxy. When sending a subsequent - "delete" command to the RTP proxy, you can then stop just the + “delete” command to the RTP proxy, you can then stop just the session for a specific branch when passing the flag '1' or '2' - in the "rtpengine_delete", or stop all sessions for a call + in the “rtpengine_delete”, or stop all sessions for a call when not passing one of those two flags there. This is especially useful if you have serially forked call scenarios - where the RTP proxy gets an "offer" command for a new branch, - and then a "delete" command for the previous branch, which + where the RTP proxy gets an “offer” command for a new branch, + and then a “delete” command for the previous branch, which would otherwise delete the full call, breaking the subsequent - "answer" for the new branch. This flag is only supported by + “answer” for the new branch. This flag is only supported by the Sipwise rtpengine RTP proxy at the moment! + asymmetric - flags that UA from which message is received doesn't support symmetric RTP. Disables learning of endpoint addresses in the Sipwise rtpengine proxy. - + force-answer - force "answer", that is, only rewrite SDP when + + force-answer - force “answer”, that is, only rewrite SDP when corresponding session already exists in the RTP proxy. By default is on when the session is to be completed. + direction=... - this option specifies a logical network @@ -461,17 +736,17 @@ rtpengine_offer(); interface that the target should be using. For example, if the SIP message was sent by an endpoint on a private network and will be sent to an endpoint on the public internet, you would - use "direction=priv direction=pub" if those two logical - network interfaces were called "priv" and "pub" in your RTP + use “direction=priv direction=pub” if those two logical + network interfaces were called “priv” and “pub” in your RTP proxy's configuration respectively. The direction must only be specified in for initial SDP offer; answers or subsequent offers can omit this option. - + internal, external - shorthand for "direction=internal" and - "direction=external" respectively. Useful for brevity or as + + internal, external - shorthand for “direction=internal” and + “direction=external” respectively. Useful for brevity or as legacy option if the RTP proxy only supports two network interfaces instead of multiple, arbitrarily named ones. - + auto-bridge - this flag an alternative to the "internal" and - "external" flags in order to do automatic bridging between + + auto-bridge - this flag an alternative to the “internal” and + “external” flags in order to do automatic bridging between IPv4 on the "internal network" and IPv6 on the "external network". Instead of explicitly instructing the RTP proxy to select a particular address family, the distinction is done by @@ -479,14 +754,14 @@ rtpengine_offer(); supported by Sipwise rtpengine. + address-family=... - instructs the RTP proxy that the recipient of this SDP body expects to see addresses of a - particular family. Possible values are "IP4" and "IP6". For + particular family. Possible values are “IP4” and “IP6”. For example, if the SDP body contains IPv4 addresses but the - recipient only speaks IPv6, you would use "address-family=IP6" + recipient only speaks IPv6, you would use “address-family=IP6” to bridge between the two address families. Sipwise rtpengine remembers the address family preference of each party after it has seen an SDP body from them. This means that normally it is only necessary to explicitly specify the - address family in the "offer", but not in the "answer". + address family in the “offer”, but not in the “answer”. Note: Please note, that this will only work properly with non-dual-stack user-agents or with dual-stack clients according to RFC6157 (which suggest ICE for Dual-Stack @@ -527,15 +802,15 @@ rtpengine_offer(); G.729 going from 10ms to 100ms saves two thirds of the network bandwith. Not supported by Sipwise rtpengine. + ICE=... - controls the RTP proxy's behaviour regarding ICE - attributes within the SDP body. Possible values are: "force" - + attributes within the SDP body. Possible values are: “force” - discard any ICE attributes already present in the SDP body and then generate and insert new ICE data, leaving itself as the - only ICE candidates; "force-relay" - discard any "relay" type + only ICE candidates; “force-relay” - discard any “relay” type ICE attributes already present in the SDP body and then - generate and insert itself as the only ICE "relay" candidates; - "remove" instructs the RTP proxy to discard any ICE attributes + generate and insert itself as the only ICE “relay” candidates; + “remove” instructs the RTP proxy to discard any ICE attributes and not insert any new ones into the SDP. The default (if no - "ICE=..." is given at all), new ICE data will only be + “ICE=...” is given at all), new ICE data will only be generated if no ICE was present in the SDP originally; otherwise the RTP proxy will only insert itself as additional ICE candidate. Other SDP substitutions (c=, m=, etc) are @@ -543,20 +818,20 @@ rtpengine_offer(); + RTP, SRTP, AVP, AVPF - These flags control the RTP transport protocol that should be used towards the recipient of the SDP. If none of them are specified, the protocol given in the SDP - is left untouched. Otherwise, the "SRTP" flag indicates that - SRTP should be used, while "RTP" indicates that SRTP should - not be used. "AVPF" indicates that the advanced RTCP profile - with feedback messages should be used, and "AVP" indicates + is left untouched. Otherwise, the “SRTP” flag indicates that + SRTP should be used, while “RTP” indicates that SRTP should + not be used. “AVPF” indicates that the advanced RTCP profile + with feedback messages should be used, and “AVP” indicates that the regular RTCP profile should be used. See also the next set of flags below. + RTP/AVP, RTP/SAVP, RTP/AVPF, RTP/SAVPF - these serve as an alternative, more explicit way to select between the different RTP protocols and profiles supported by the RTP proxy. For - example, giving the flag "RTP/SAVPF" has the same effect as - giving the two flags "SRTP AVPF". - + to-tag - force inclusion of the "To" tag. Normally, the "To" - tag is always included when present, except for "delete" - messages. Including the "To" tag in a "delete" messages allows + example, giving the flag “RTP/SAVPF” has the same effect as + giving the two flags “SRTP AVPF”. + + to-tag - force inclusion of the “To” tag. Normally, the “To” + tag is always included when present, except for “delete” + messages. Including the “To” tag in a “delete” messages allows you to be more selective about which dialogues within a call are being torn down. + rtcp-mux-demux - if rtcp-mux (RFC 5761) was offered, make the @@ -564,20 +839,20 @@ rtpengine_offer(); of this message. + rtcp-mux-reject - if rtcp-mux was offered, make the RTP proxy reject the offer, but still offer it to the recipient. Can be - combined with "rtcp-mux-offer" to always offer it. + combined with “rtcp-mux-offer” to always offer it. + rtcp-mux-offer - make the RTP proxy offer rtcp-mux to the recipient of this message, regardless of whether it was offered originally or not. + rtcp-mux-accept - if rtcp-mux was offered, make the RTP proxy accept the offer and also offer it to the recipient of this - message. Can be combined with "rtcp-mux-offer" to always offer + message. Can be combined with “rtcp-mux-offer” to always offer it. + media-address=... - force a particular media address to be used in the SDP body. Address family is detected automatically. + TOS=... - change the IP TOS value for all outgoing RTP packets within the entire call in both directions. Only honoured in an - "offer", ignored for an "answer". Valid values are 0 through + “offer”, ignored for an “answer”. Valid values are 0 through 255, given in decimal. If this option is not specified, the TOS value will revert to the default TOS (normally 184). A value of -1 may be used to leave the currently used TOS @@ -596,8 +871,8 @@ rtpengine_offer(); recommended as it allows media streams to be hijacked by an attacker. + DTLS=... - influence the behaviour of DTLS-SRTP. Possible - values are "no" or "off" to suppress offering or accepting - DTLS-SRTP, and "passive" to prefer participating in DTLS-SRTP + values are “no” or “off” to suppress offering or accepting + DTLS-SRTP, and “passive” to prefer participating in DTLS-SRTP in a passive role. + SDES-off - don't offer SDES when it normally would. In an SRTP context, this leaves DTLS-SRTP as the only other option. @@ -612,7 +887,7 @@ rtpengine_offer(); This function can be used from ANY_ROUTE. - Example 1.12. rtpengine_offer usage + Example 1.24. rtpengine_offer usage route { ... if (is_method("INVITE")) { @@ -644,7 +919,7 @@ onreply_route[2] ... } -5.3. rtpengine_answer([flags]) +5.3. rtpengine_answer([flags]) Rewrites SDP body to ensure that media is passed through an RTP proxy. To be invoked on 200 OK for the cases the SDP bodies are in INVITE and @@ -656,25 +931,25 @@ onreply_route[2] This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE, FAILURE_ROUTE, BRANCH_ROUTE. - Example 1.13. rtpengine_answer usage + Example 1.25. rtpengine_answer usage See rtpengine_offer() function example above for example. -5.4. rtpengine_delete([flags]) +5.4. rtpengine_delete([flags]) Tears down the RTPProxy session for the current call. See rtpengine_offer() function description above for the meaning of the - parameters. Note that not all flags make sense for a "delete". + parameters. Note that not all flags make sense for a “delete”. This function can be used from ANY_ROUTE. - Example 1.14. rtpengine_delete usage + Example 1.26. rtpengine_delete usage ... rtpengine_delete(); ... -5.5. rtpengine_manage([flags]) +5.5. rtpengine_manage([flags]) Manage the RTPProxy session - it combines the functionality of rtpengine_offer(), rtpengine_answer() and rtpengine_delete(), detecting @@ -699,12 +974,12 @@ rtpengine_delete(); This function can be used from ANY_ROUTE. - Example 1.15. rtpengine_manage usage + Example 1.27. rtpengine_manage usage ... rtpengine_manage(); ... -5.6. start_recording() +5.6. start_recording() This function will send a signal to the RTP proxy to record the RTP stream on the RTP proxy. This function is not supported by Sipwise @@ -712,7 +987,7 @@ rtpengine_manage(); This function can be used from REQUEST_ROUTE and ONREPLY_ROUTE. - Example 1.16. start_recording usage + Example 1.28. start_recording usage ... start_recording(); ... @@ -728,7 +1003,7 @@ start_recording(); packet counters. The statistics must be retrieved before the session is deleted (before rtpengine_delete()). - Example 1.17. $rtpstat Usage + Example 1.29. $rtpstat Usage ... append_hf("X-RTP-Statistics: $rtpstat\r\n"); ... @@ -738,6 +1013,8 @@ start_recording(); 7.1. nh_enable_rtpp proxy_url/all 0/1 7.2. nh_show_rtpp proxy_url/all 7.3. nh_ping_rtpp proxy_url/all + 7.4. nh_reload_rtpp + 7.5. nh_show_hash_total 7.1. nh_enable_rtpp proxy_url/all 0/1 @@ -765,7 +1042,7 @@ start_recording(); NOTE: When specify the IPv6 RTP proxy url one must prefix it with :: to escape the :: from the IPv6 address. See the example below. - Example 1.18. nh_enable_rtpp usage + Example 1.30. nh_enable_rtpp usage ... $ kamctl fifo nh_enable_rtpp udp:192.168.2.133:8081 0 $ kamctl fifo nh_enable_rtpp ::udp6:fe80::9a90:96ff:fea8:fd99:9999 1 @@ -788,7 +1065,7 @@ $ kamctl fifo nh_enable_rtpp all 1 NOTE: When specify the IPv6 RTP proxy url one must prefix it with :: to escape the :: from the IPv6 address. See the example below. - Example 1.19. nh_show_rtpp usage + Example 1.31. nh_show_rtpp usage ... $ kamctl fifo nh_show_rtpp udp:192.168.2.133:8081 $ kamctl fifo nh_show_rtpp ::udp6:fe80::9a90:96ff:fea8:fd99:9999 @@ -808,45 +1085,70 @@ $ kamctl fifo nh_show_rtpp all NOTE: When specify the IPv6 RTP proxy url one must prefix it with :: to escape the :: from the IPv6 address. See the example below. - Example 1.20. nh_ping_rtpp usage + Example 1.32. nh_ping_rtpp usage ... $ kamctl fifo nh_ping_rtpp udp:192.168.2.133:8081 $ kamctl fifo nh_ping_rtpp ::udp6:fe80::9a90:96ff:fea8:fd99:9999 $ kamctl fifo nh_ping_rtpp all ... +7.4. nh_reload_rtpp + + Reloads the database node table content if configured. Returns specific + message related to success, failure and no db_url configured. + + NOTE: The current behaviour updates the nodes state or creates new ones + or hides old ones, based on the database content. If allow_op modparam + is enabled, the sessions are still allowed to finish for the hidden old + nodes. + + Example 1.33. nh_reload_rtpp usage +... +$ kamctl fifo nh_reload_rtpp +... + +7.5. nh_show_hash_total + + Print the total number of hash entries in the hash table at a given + moment. + + Example 1.34. nh_show_hash_total usage +... +$ kamctl fifo nh_show_hash_total +... + Chapter 2. Frequently Asked Questions - 2.1. How do I migrate from "rtpproxy" or "rtpproxy-ng" to "rtpengine"? + 2.1. How do I migrate from “rtpproxy” or “rtpproxy-ng” to “rtpengine”? 2.2. Where can I find more about Kamailio? 2.3. Where can I post a question about this module? 2.4. How can I report a bug? 2.1. - How do I migrate from "rtpproxy" or "rtpproxy-ng" to "rtpengine"? + How do I migrate from “rtpproxy” or “rtpproxy-ng” to “rtpengine”? For the most part, only the names of the functions have changed, with - "rtpproxy" in each name replaced with "rtpengine". For example, - "rtpproxy_manage()" has become "rtpengine_manage()". A few name + “rtpproxy” in each name replaced with “rtpengine”. For example, + “rtpproxy_manage()” has become “rtpengine_manage()”. A few name duplications have also been resolved, for example there is now a single - "rtpengine_delete()" instead of "unforce_rtp_proxy()" and the identical - "rtpproxy_destroy()". + “rtpengine_delete()” instead of “unforce_rtp_proxy()” and the identical + “rtpproxy_destroy()”. The largest difference to the old module is how flags are passed to - "rtpengine_offer()", "rtpengine_answer()", "rtpengine_manage()" and - "rtpengine_delete()". Instead of having a string of single-letter + “rtpengine_offer()”, “rtpengine_answer()”, “rtpengine_manage()” and + “rtpengine_delete()”. Instead of having a string of single-letter flags, they now take a string of space-separated items, with each item - being either a single token (word) or a "key=value" pair. + being either a single token (word) or a “key=value” pair. - For example, if you had a call "rtpproxy_offer("FRWOC+PS");", this + For example, if you had a call “rtpproxy_offer("FRWOC+PS");”, this would then become: rtpengine_offer("force trust-address symmetric replace-origin replace-session-co nnection ICE=force RTP/SAVPF"); Finally, if you were using the second paramater (explicit media address) to any of these functions, this has been replaced by the - "media-address=..." option within the first string of flags. + “media-address=...” option within the first string of flags. 2.2. @@ -877,4 +1179,4 @@ nnection ICE=force RTP/SAVPF"); How can I report a bug? Please follow the guidelines provided at: - http://sip-router.org/tracker. + https://github.com/kamailio/kamailio/issues. diff --git a/modules/rtpengine/rtpengine.c b/modules/rtpengine/rtpengine.c index 5481f4962d9..6b460743e90 100644 --- a/modules/rtpengine/rtpengine.c +++ b/modules/rtpengine/rtpengine.c @@ -97,6 +97,8 @@ MODULE_VERSION #define NAT_UAC_TEST_S_1918 0x08 #define NAT_UAC_TEST_RPORT 0x10 +#define COOKIE_SIZE 128 +#define HOSTNAME_SIZE 100 #define DEFAULT_RTPP_SET_ID 0 #define MAX_RTPP_TRIED_NODES 50 @@ -463,6 +465,7 @@ static int get_ip_type(char *str_addr) LM_DBG("%s is an ipv6 addinfos\n", str_addr); } else { LM_DBG("%s is an unknown addinfos format AF=%d\n",str_addr, info->ai_family); + freeaddrinfo(info); return -1; } @@ -590,8 +593,7 @@ static inline int str_eq(const str *p, const char *q) { } static inline str str_prefix(const str *p, const char *q) { - str ret; - ret.s = NULL; + str ret = STR_NULL; int l = strlen(q); if (p->len < l) return ret; @@ -1807,6 +1809,7 @@ static int build_rtpp_socks(unsigned int current_rtpp_no) { for (i = 0; i < rtpp_socks_size; i++) { if (rtpp_socks[i] >= 0) { close(rtpp_socks[i]); + rtpp_socks[i] = -1; } } @@ -1816,6 +1819,7 @@ static int build_rtpp_socks(unsigned int current_rtpp_no) { LM_ERR("no more pkg memory for rtpp_socks\n"); return -1; } + memset(rtpp_socks, -1, sizeof(int)*(rtpp_socks_size)); lock_get(rtpp_set_list->rset_head_lock); for (rtpp_list = rtpp_set_list->rset_first; rtpp_list != 0; @@ -1909,6 +1913,11 @@ child_init(int rank) if(!rtpp_set_list) return 0; + /* do not init sockets for PROC_INIT and main process when fork=yes */ + if(rank==PROC_INIT || (rank==PROC_MAIN && dont_fork==0)) { + return 0; + } + mypid = getpid(); lock_get(rtpp_no_lock); @@ -1919,6 +1928,7 @@ child_init(int rank) if (!rtpp_socks) { return -1; } + memset(rtpp_socks, -1, sizeof(int)*(rtpp_socks_size)); // vector of pointers to queried nodes queried_nodes_ptr = (struct rtpp_node**)pkg_malloc(queried_nodes_limit * sizeof(struct rtpp_node*)); @@ -2016,12 +2026,11 @@ static void mod_destroy(void) } - static char * gencookie(void) { static char cook[34]; - sprintf(cook, "%d_%u ", (int)mypid, myseqn); + snprintf(cook, 34, "%d_%d_%u ", server_id, (int)mypid, myseqn); myseqn++; return cook; } diff --git a/modules/rtpproxy/README b/modules/rtpproxy/README index e8a2094ec26..ff027f399cf 100644 --- a/modules/rtpproxy/README +++ b/modules/rtpproxy/README @@ -1,4 +1,3 @@ - rtpproxy Module Maxim Sobolev @@ -31,14 +30,14 @@ Carsten Bock ng-voice GmbH - Copyright 2003-2008 Sippy Software, Inc. + Copyright © 2003-2008 Sippy Software, Inc. - Copyright 2005 Voice Sistem SRL + Copyright © 2005 Voice Sistem SRL - Copyright 2009-2012 TuTPro Inc. + Copyright © 2009-2012 TuTPro Inc. - Copyright 2010 VoIPEmbedded Inc. - _________________________________________________________________ + Copyright © 2010 VoIPEmbedded Inc. + __________________________________________________________________ Table of Contents @@ -67,17 +66,17 @@ Carsten Bock 5. Functions - 5.1. set_rtp_proxy_set(setid) - 5.2. rtpproxy_offer([flags [, ip_address]]) - 5.3. rtpproxy_answer([flags [, ip_address]]) - 5.4. rtpproxy_destroy([flags]) - 5.5. unforce_rtp_proxy() - 5.6. rtpproxy_manage([flags [, ip_address]]) - 5.7. rtpproxy_stream2uac(prompt_name, count), - 5.8. rtpproxy_stream2uas(prompt_name, count) - 5.9. rtpproxy_stop_stream2uac(), - 5.10. start_recording() - 5.11. rtpproxy_stop_stream2uas(prompt_name, count) + 5.1. set_rtp_proxy_set(setid) + 5.2. rtpproxy_offer([flags [, ip_address]]) + 5.3. rtpproxy_answer([flags [, ip_address]]) + 5.4. rtpproxy_destroy([flags]) + 5.5. unforce_rtp_proxy() + 5.6. rtpproxy_manage([flags [, ip_address]]) + 5.7. rtpproxy_stream2uac(prompt_name, count), + 5.8. rtpproxy_stream2uas(prompt_name, count) + 5.9. rtpproxy_stop_stream2uac(), + 5.10. start_recording() + 5.11. rtpproxy_stop_stream2uas(prompt_name, count) 6. Exported Pseudo Variables @@ -142,17 +141,17 @@ Chapter 1. Admin Guide 5. Functions - 5.1. set_rtp_proxy_set(setid) - 5.2. rtpproxy_offer([flags [, ip_address]]) - 5.3. rtpproxy_answer([flags [, ip_address]]) - 5.4. rtpproxy_destroy([flags]) - 5.5. unforce_rtp_proxy() - 5.6. rtpproxy_manage([flags [, ip_address]]) - 5.7. rtpproxy_stream2uac(prompt_name, count), - 5.8. rtpproxy_stream2uas(prompt_name, count) - 5.9. rtpproxy_stop_stream2uac(), - 5.10. start_recording() - 5.11. rtpproxy_stop_stream2uas(prompt_name, count) + 5.1. set_rtp_proxy_set(setid) + 5.2. rtpproxy_offer([flags [, ip_address]]) + 5.3. rtpproxy_answer([flags [, ip_address]]) + 5.4. rtpproxy_destroy([flags]) + 5.5. unforce_rtp_proxy() + 5.6. rtpproxy_manage([flags [, ip_address]]) + 5.7. rtpproxy_stream2uac(prompt_name, count), + 5.8. rtpproxy_stream2uas(prompt_name, count) + 5.9. rtpproxy_stop_stream2uac(), + 5.10. start_recording() + 5.11. rtpproxy_stop_stream2uas(prompt_name, count) 6. Exported Pseudo Variables @@ -165,37 +164,37 @@ Chapter 1. Admin Guide 1. Overview - This is a module that enables media streams to be proxied via an - rtpproxy. Rtpproxies know to work with this module are Sippy RTPproxy + This is a module that enables media streams to be proxied via an + rtpproxy. Rtpproxies know to work with this module are Sippy RTPproxy http://www.rtpproxy.org and ngcp-rtpproxy-ng - http://deb.sipwise.com/spce/2.6/pool/main/n/ngcp-mediaproxy-ng. Some - features of the rtpproxy module apply only to one of the two + http://deb.sipwise.com/spce/2.6/pool/main/n/ngcp-mediaproxy-ng. Some + features of the rtpproxy module apply only to one of the two rtpproxies. 2. Multiple RTPProxy usage - The rtpproxy module can support multiple rtpproxies for + The rtpproxy module can support multiple rtpproxies for balancing/distribution and control/selection purposes. - The module allows definition of several sets of rtpproxies. - Load-balancing will be performed over a set and the admin has the + The module allows definition of several sets of rtpproxies. + Load-balancing will be performed over a set and the admin has the ability to choose what set should be used. The set is selected via its - id - the id being defined with the set. Refer to the "rtpproxy_sock" + id - the id being defined with the set. Refer to the “rtpproxy_sock” module parameter definition for syntax description. - The balancing inside a set is done automatically by the module based - on the weight of each rtpproxy from the set. + The balancing inside a set is done automatically by the module based on + the weight of each rtpproxy from the set. - The selection of the set is done from script prior using + The selection of the set is done from script prior using unforce_rtp_proxy(), rtpproxy_offer() or rtpproxy_answer() functions - see the set_rtp_proxy_set() function. - For backward compatibility reasons, a set with no id take by default + For backward compatibility reasons, a set with no id take by default the id 0. Also if no set is explicitly set before unforce_rtp_proxy(), rtpproxy_offer() or rtpproxy_answer() the 0 id set will be used. - IMPORTANT: if you use multiple sets, take care and use the same set - for both rtpproxy_offer()/rtpproxy_answer() and unforce_rtpproxy()!! + IMPORTANT: if you use multiple sets, take care and use the same set for + both rtpproxy_offer()/rtpproxy_answer() and unforce_rtpproxy()!! 3. Dependencies @@ -210,7 +209,7 @@ Chapter 1. Admin Guide 3.2. External Libraries or Applications - The following libraries or applications must be installed before + The following libraries or applications must be installed before running Kamailio with this module loaded: * None. @@ -231,15 +230,15 @@ Chapter 1. Admin Guide 4.1. rtpproxy_sock (string) Used to define the list of RTPPRoxy instances to connect to. These can - be UNIX sockets or IPv4/IPv6 UDP sockets. Each modparam entry will - insert sockets into a single set. If no set ID is given, the default + be UNIX sockets or IPv4/IPv6 UDP sockets. Each modparam entry will + insert sockets into a single set. If no set ID is given, the default set ID '0' will be used. To define multiple sets add the set number at - the beginning of each parameter followed by '=='. Sockets can be - weighted by adding '=#' to a socket where # is an integer. A socket - with a weight of 2 will be chosen twice as often as one with a weight + the beginning of each parameter followed by '=='. Sockets can be + weighted by adding '=#' to a socket where # is an integer. A socket + with a weight of 2 will be chosen twice as often as one with a weight of 1. - Default value is "NONE" (disabled). + Default value is “NONE” (disabled). Example 1.1. Set rtpproxy_sock parameter ... @@ -259,11 +258,11 @@ modparam("rtpproxy", "rtpproxy_sock", 4.2. rtpproxy_disable_tout (integer) - Once RTPProxy was found unreachable and marked as disabled, the - rtpproxy module will not attempt to establish communication to - RTPProxy for rtpproxy_disable_tout seconds. + Once RTPProxy was found unreachable and marked as disabled, the + rtpproxy module will not attempt to establish communication to RTPProxy + for rtpproxy_disable_tout seconds. - Default value is "60". + Default value is “60”. Example 1.2. Set rtpproxy_disable_tout parameter ... @@ -274,7 +273,7 @@ modparam("rtpproxy", "rtpproxy_disable_tout", 20) Timeout value in waiting for reply from RTPProxy. - Default value is "1". + Default value is “1”. Example 1.3. Set rtpproxy_tout parameter ... @@ -283,10 +282,10 @@ modparam("rtpproxy", "rtpproxy_tout", 2) 4.4. rtpproxy_retr (integer) - How many times the module should retry to send and receive after + How many times the module should retry to send and receive after timeout was generated. - Default value is "5". + Default value is “5”. Example 1.4. Set rtpproxy_retr parameter ... @@ -295,8 +294,8 @@ modparam("rtpproxy", "rtpproxy_retr", 2) 4.5. nortpproxy_str (string) - This parameter sets the SDP attribute used by rtpproxy to mark the - message's SDP attachemnt with information that it have already been + This parameter sets the SDP attribute used by rtpproxy to mark the + message's SDP attachemnt with information that it have already been changed. If empty string, no marker will be added or checked. @@ -305,7 +304,7 @@ Note The string must be a complete SDP line, including the EOH (\r\n). - Default value is "a=nortpproxy:yes\r\n". + Default value is “a=nortpproxy:yes\r\n”. Example 1.5. Set nortpproxy_str parameter ... @@ -315,13 +314,13 @@ modparam("rtpproxy", "nortpproxy_str", "a=sdpmangled:yes\r\n") 4.6. timeout_socket (string) The parameter sets the RTP timeout socket, which is transmitted to the - RTP-Proxy. It will be used by the RTP proxy to signal back that a - media stream timed out. + RTP-Proxy. It will be used by the RTP proxy to signal back that a media + stream timed out. If it is an empty string, no timeout socket will be transmitted to the RTP-Proxy. - Default value is "" (nothing). + Default value is “” (nothing). Example 1.6. Set timeout_socket parameter ... @@ -330,15 +329,15 @@ modparam("rtpproxy", "timeout_socket", "xmlrpc:http://127.0.0.1:8000/RPC2") 4.7. ice_candidate_priority_avp (string) - If specified and if value of the avp value is not 0, rtpproxy_manage - function adds ICE relay candidate attributes to sdp stream(s) + If specified and if value of the avp value is not 0, rtpproxy_manage + function adds ICE relay candidate attributes to sdp stream(s) containing ICE candidate attributes. - If value of the avp is 1, added candidates have high priority. If - value of the avp is 2 (default), added candidates have low priority. + If value of the avp is 1, added candidates have high priority. If value + of the avp is 2 (default), added candidates have low priority. - There is no default value meaning that no ICE relay candidates are - added in any circumstance. + There is no default value meaning that no ICE relay candidates are + added in any circumstance. Example 1.7. Set ice_candidate_priority_avp parameter ... @@ -347,11 +346,11 @@ modparam("rtpproxy", "ice_candidate_priority_avp", "$avp(ice_priority)") 4.8. extra_id_pv (string) - The parameter sets the PV defination to use when the "b" parameter is - used on unforce_rtp_proxy(), rtpproxy_offer(), rtpproxy_answer() or + The parameter sets the PV defination to use when the “b” parameter is + used on unforce_rtp_proxy(), rtpproxy_offer(), rtpproxy_answer() or rtpproxy_manage() command. - Default is empty, the "b" parameter may not be used then. + Default is empty, the “b” parameter may not be used then. Example 1.8. Set extra_id_pv parameter ... @@ -360,9 +359,9 @@ modparam("rtpproxy", "extra_id_pv", "$avp(extra_id)") 4.9. db_url (string) - The database URL to load rtp_proxy sets from. If this parameter is - set, the module will attempt to load the rtpproxy sets from the - specified database and will ignore any 'rtpproxy_sock' modparams. + The database URL to load rtp_proxy sets from. If this parameter is set, + the module will attempt to load the rtpproxy sets from the specified + database and will ignore any 'rtpproxy_sock' modparams. Default is empty, a database will not be used. @@ -375,7 +374,7 @@ modparam("rtpproxy", "db_url", "mysql://user:passwb@localhost/database") The name of the table containing the rtpproxy sets. - Default value is "rtpproxy". + Default value is “rtpproxy”. Example 1.10. Set table_name parameter ... @@ -384,8 +383,8 @@ modparam("rtpproxy", "table_name", "my_rtpp_sets") 4.11. rtp_inst_pvar (string) - A pseudo variable to store the chosen RTPProxy address. If this - parameter is set, the instance URL will be stored in the given + A pseudo variable to store the chosen RTPProxy address. If this + parameter is set, the instance URL will be stored in the given variable. By default, this parameter is not set. @@ -407,26 +406,26 @@ xlog("L_INFO", "Chose rtpp instance $var(RTP_INSTANCE)\n"); 5. Functions - 5.1. set_rtp_proxy_set(setid) - 5.2. rtpproxy_offer([flags [, ip_address]]) - 5.3. rtpproxy_answer([flags [, ip_address]]) - 5.4. rtpproxy_destroy([flags]) - 5.5. unforce_rtp_proxy() - 5.6. rtpproxy_manage([flags [, ip_address]]) - 5.7. rtpproxy_stream2uac(prompt_name, count), - 5.8. rtpproxy_stream2uas(prompt_name, count) - 5.9. rtpproxy_stop_stream2uac(), - 5.10. start_recording() - 5.11. rtpproxy_stop_stream2uas(prompt_name, count) + 5.1. set_rtp_proxy_set(setid) + 5.2. rtpproxy_offer([flags [, ip_address]]) + 5.3. rtpproxy_answer([flags [, ip_address]]) + 5.4. rtpproxy_destroy([flags]) + 5.5. unforce_rtp_proxy() + 5.6. rtpproxy_manage([flags [, ip_address]]) + 5.7. rtpproxy_stream2uac(prompt_name, count), + 5.8. rtpproxy_stream2uas(prompt_name, count) + 5.9. rtpproxy_stop_stream2uac(), + 5.10. start_recording() + 5.11. rtpproxy_stop_stream2uas(prompt_name, count) 5.1. set_rtp_proxy_set(setid) - Sets the Id of the rtpproxy set to be used for the next - unforce_rtp_proxy(), rtpproxy_offer(), rtpproxy_answer() or + Sets the Id of the rtpproxy set to be used for the next + unforce_rtp_proxy(), rtpproxy_offer(), rtpproxy_answer() or rtpproxy_manage() command. The parameter can be an integer or a config variable holding an integer. - This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE, + This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE. Example 1.13. set_rtp_proxy_set usage @@ -438,99 +437,99 @@ rtpproxy_offer(); 5.2. rtpproxy_offer([flags [, ip_address]]) Rewrites SDP body to ensure that media is passed through an RTP proxy. - To be invoked on INVITE for the cases the SDPs are in INVITE and 200 - OK and on 200 OK when SDPs are in 200 OK and ACK. + To be invoked on INVITE for the cases the SDPs are in INVITE and 200 OK + and on 200 OK when SDPs are in 200 OK and ACK. Meaning of the parameters is as follows: * flags - flags to turn on some features. - + 1 - append first Via branch to Call-ID when sending command - to rtpproxy. This can be used to create one media session per - branch on the rtpproxy. When sending a subsequent "delete" - command to the rtpproxy, you can then stop just the session + + 1 - append first Via branch to Call-ID when sending command to + rtpproxy. This can be used to create one media session per + branch on the rtpproxy. When sending a subsequent “delete” + command to the rtpproxy, you can then stop just the session for a specific branch when passing the flag '1' or '2' in the - "unforce_rtpproxy", or stop all sessions for a call when not - passing one of those two flags there. This is especially - useful if you have serially forked call scenarios where - rtpproxy gets an "update" command for a new branch, and then - a "delete" command for the previous branch, which would - otherwise delete the full call, breaking the subsequent - "lookup" for the new branch. This flag is only supported by - the ngcp-mediaproxy-ng rtpproxy at the moment! - + 2 - append second Via branch to Call-ID when sending command + “unforce_rtpproxy”, or stop all sessions for a call when not + passing one of those two flags there. This is especially + useful if you have serially forked call scenarios where + rtpproxy gets an “update” command for a new branch, and then a + “delete” command for the previous branch, which would + otherwise delete the full call, breaking the subsequent + “lookup” for the new branch. This flag is only supported by + the ngcp-mediaproxy-ng rtpproxy (now named rtpengine) at the + moment! + + 2 - append second Via branch to Call-ID when sending command to rtpproxy. See flag '1' for its meaning. - + 3 - behave like flag 1 is set for a request and like flag 2 - is set for a reply. - + a - flags that UA from which message is received doesn't + + 3 - behave like flag 1 is set for a request and like flag 2 is + set for a reply. + + a - flags that UA from which message is received doesn't support symmetric RTP. (automatically sets the 'r' flag) - + b - append branch specific variable to Call-ID when sending - command to rtpproxy. This creates one rtpproxy session per - unique variable. Works similar to the 1, 2 and 3 parameter, - but is usefull when forking to multiple destinations on - different address families or network segments, requiring - different rtpproxy parameters. The variable value is taken - from the "extra_id_pv". When used, it must be used in every - call to rtpproxy_manage(), rtpproxy_offer(), - rtpproxy_answer() and rtpproxy_destroy() with the same - contents of the PV. The b parameter may not be used in - conjunction with the 1, 2 or 3 parameter to use the Via - branch in the Call-ID. - + l - force "lookup", that is, only rewrite SDP when - corresponding session already exists in the RTP proxy. By + + b - append branch specific variable to Call-ID when sending + command to rtpproxy. This creates one rtpproxy session per + unique variable. Works similar to the 1, 2 and 3 parameter, + but is usefull when forking to multiple destinations on + different address families or network segments, requiring + different rtpproxy parameters. The variable value is taken + from the “extra_id_pv”. When used, it must be used in every + call to rtpproxy_manage(), rtpproxy_offer(), rtpproxy_answer() + and rtpproxy_destroy() with the same contents of the PV. The b + parameter may not be used in conjunction with the 1, 2 or 3 + parameter to use the Via branch in the Call-ID. + + l - force “lookup”, that is, only rewrite SDP when + corresponding session already exists in the RTP proxy. By default is on when the session is to be completed. - + i, e - these flags specify the direction of the SIP message. - These flags only make sense when rtpproxy is running in - bridge mode. 'i' means internal network (LAN), 'e' means - external network (WAN). 'i' corresponds to rtpproxy's first - interface, 'e' corresponds to rtpproxy's second interface. - You always have to specify two flags to define the incoming - network and the outgoing network. For example, 'ie' should be - used for SIP message received from the local interface and - sent out on the external interface, and 'ei' vice versa. - Other options are 'ii' and 'ee'. So, for example if a SIP - requests is processed with 'ie' flags, the corresponding - response must be processed with 'ie' flags. - Note: As rtpproxy in bridge mode s per default asymmetric, - you have to specify the 'w' flag for clients behind NAT! See - also above notes! - + x - this flag a shortcut for using the "ie" or "ei"-flags of - RTP-Proxy, in order to do automatic bridging between IPv4 on - the "internal network" and IPv6 on the "external network". - The distinction is done by the given IP in the SDP, e.g. a - IPv4 Address will always call "ie" to the RTPProxy (IPv4(i) - to IPv6(e)) and an IPv6Address will always call "ei" to the + + i, e - these flags specify the direction of the SIP message. + These flags only make sense when rtpproxy is running in bridge + mode. 'i' means internal network (LAN), 'e' means external + network (WAN). 'i' corresponds to rtpproxy's first interface, + 'e' corresponds to rtpproxy's second interface. You always + have to specify two flags to define the incoming network and + the outgoing network. For example, 'ie' should be used for SIP + message received from the local interface and sent out on the + external interface, and 'ei' vice versa. Other options are + 'ii' and 'ee'. So, for example if a SIP requests is processed + with 'ie' flags, the corresponding response must be processed + with 'ie' flags. + Note: As rtpproxy in bridge mode s per default asymmetric, you + have to specify the 'w' flag for clients behind NAT! See also + above notes! + + x - this flag a shortcut for using the "ie" or "ei"-flags of + RTP-Proxy, in order to do automatic bridging between IPv4 on + the "internal network" and IPv6 on the "external network". The + distinction is done by the given IP in the SDP, e.g. a IPv4 + Address will always call "ie" to the RTPProxy (IPv4(i) to + IPv6(e)) and an IPv6Address will always call "ei" to the RTPProxy (IPv6(e) to IPv4(i)). - Note: Please note, that this will only work properly with - non-dual-stack user-agents or with dual-stack clients - according to RFC6157 (which suggest ICE for Dual-Stack - implementations). This short-cut will not work properly with - RFC4091 (ANAT) compatible clients, which suggests having - different m-lines with different IP-protocols grouped + Note: Please note, that this will only work properly with + non-dual-stack user-agents or with dual-stack clients + according to RFC6157 (which suggest ICE for Dual-Stack + implementations). This short-cut will not work properly with + RFC4091 (ANAT) compatible clients, which suggests having + different m-lines with different IP-protocols grouped together. - + f - instructs rtpproxy to ignore marks inserted by another - rtpproxy in transit to indicate that the session is already - goes through another proxy. Allows creating a chain of + + f - instructs rtpproxy to ignore marks inserted by another + rtpproxy in transit to indicate that the session is already + goes through another proxy. Allows creating a chain of proxies. - + r - flags that IP address in SDP should be trusted. Without - this flag, rtpproxy ignores address in the SDP and uses - source address of the SIP message as media address which is - passed to the RTP proxy. - + o - flags that IP from the origin description (o=) should be + + r - flags that IP address in SDP should be trusted. Without + this flag, rtpproxy ignores address in the SDP and uses source + address of the SIP message as media address which is passed to + the RTP proxy. + + o - flags that IP from the origin description (o=) should be also changed. - + c - flags to change the session-level SDP connection (c=) IP + + c - flags to change the session-level SDP connection (c=) IP if media-description also includes connection information. - + w - flags that for the UA from which message is received, + + w - flags that for the UA from which message is received, support symmetric RTP must be forced. - + zNN - requests the RTPproxy to perform re-packetization of - RTP traffic coming from the UA which has sent the current - message to increase or decrease payload size per each RTP - packet forwarded if possible. The NN is the target payload - size in ms, for the most codecs its value should be in 10ms - increments, however for some codecs the increment could - differ (e.g. 30ms for GSM or 20ms for G.723). The RTPproxy - would select the closest value supported by the codec. This - feature could be used for significantly reducing bandwith - overhead for low bitrate codecs, for example with G.729 going - from 10ms to 100ms saves two thirds of the network bandwith. + + zNN - requests the RTPproxy to perform re-packetization of RTP + traffic coming from the UA which has sent the current message + to increase or decrease payload size per each RTP packet + forwarded if possible. The NN is the target payload size in + ms, for the most codecs its value should be in 10ms + increments, however for some codecs the increment could differ + (e.g. 30ms for GSM or 20ms for G.723). The RTPproxy would + select the closest value supported by the codec. This feature + could be used for significantly reducing bandwith overhead for + low bitrate codecs, for example with G.729 going from 10ms to + 100ms saves two thirds of the network bandwith. * ip_address - new SDP IP address. This function can be used from ANY_ROUTE. @@ -570,13 +569,13 @@ onreply_route[2] 5.3. rtpproxy_answer([flags [, ip_address]]) Rewrites SDP body to ensure that media is passed through an RTP proxy. - To be invoked on 200 OK for the cases the SDPs are in INVITE and 200 - OK and on ACK when SDPs are in 200 OK and ACK. + To be invoked on 200 OK for the cases the SDPs are in INVITE and 200 OK + and on ACK when SDPs are in 200 OK and ACK. - See rtpproxy_answer() function description above for the meaning of - the parameters. + See rtpproxy_answer() function description above for the meaning of the + parameters. - This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE, + This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE, FAILURE_ROUTE, BRANCH_ROUTE. Example 1.15. rtpproxy_answer usage @@ -591,29 +590,30 @@ onreply_route[2] Meaning of the parameters is as follows: * flags - flags to turn on some features. - + 1 - append first Via branch to Call-ID when sending command - to rtpproxy. This can be used to create one media session per - branch on the rtpproxy. When sending a subsequent "delete" - command to the rtpproxy, you can then stop just the session + + 1 - append first Via branch to Call-ID when sending command to + rtpproxy. This can be used to create one media session per + branch on the rtpproxy. When sending a subsequent “delete” + command to the rtpproxy, you can then stop just the session for a specific branch when passing the flag '1' or '2' in the - "unforce_rtpproxy", or stop all sessions for a call when not - passing one of those two flags there. This is especially - useful if you have serially forked call scenarios where - rtpproxy gets an "update" command for a new branch, and then - a "delete" command for the previous branch, which would - otherwise delete the full call, breaking the subsequent - "lookup" for the new branch. This flag is only supported by - the ngcp-mediaproxy-ng rtpproxy at the moment! - + 2 - append second Via branch to Call-ID when sending command + “unforce_rtpproxy”, or stop all sessions for a call when not + passing one of those two flags there. This is especially + useful if you have serially forked call scenarios where + rtpproxy gets an “update” command for a new branch, and then a + “delete” command for the previous branch, which would + otherwise delete the full call, breaking the subsequent + “lookup” for the new branch. This flag is only supported by + the ngcp-mediaproxy-ng rtpproxy (now named rtpengine) at the + moment! + + 2 - append second Via branch to Call-ID when sending command to rtpproxy. See flag '1' for its meaning. - + b - append branch specific variable to Call-ID when sending - command to rtpproxy. See rtpproxy_offer() for details. + + b - append branch specific variable to Call-ID when sending + command to rtpproxy. See rtpproxy_offer() for details. - t - do not include To tag to "delete" command to rtpproxy - thus causing full call to be deleted. Useful for deleting - unused rtpproxy call when 200 OK is received on a branch, - where rtpproxy is not needed. + t - do not include To tag to “delete” command to rtpproxy thus + causing full call to be deleted. Useful for deleting unused + rtpproxy call when 200 OK is received on a branch, where + rtpproxy is not needed. Example 1.16. rtpproxy_destroy usage ... @@ -626,25 +626,25 @@ rtpproxy_destroy(); 5.6. rtpproxy_manage([flags [, ip_address]]) - Manage the RTPProxy session - it combines the functionality of - rtpproxy_offer(), rtpproxy_answer() and unforce_rtpproxy(), detecting + Manage the RTPProxy session - it combines the functionality of + rtpproxy_offer(), rtpproxy_answer() and unforce_rtpproxy(), detecting internally based on message type and method which one to execute. - It can take the same parameters as rtpproxy_offer(). The flags - parameter to rtpproxy_manage() can be a configuration variable + It can take the same parameters as rtpproxy_offer(). The flags + parameter to rtpproxy_manage() can be a configuration variable containing the flags as a string. Functionality: * If INVITE with SDP, then do rtpproxy_offer() * If INVITE with SDP, when the tm module is loaded, mark transaction - with internal flag FL_SDP_BODY to know that the 1xx and 2xx are - for rtpproxy_answer() + with internal flag FL_SDP_BODY to know that the 1xx and 2xx are for + rtpproxy_answer() * If ACK with SDP, then do rtpproxy_answer() - * If BYE or CANCEL, or called within a FAILURE_ROUTE[], then do + * If BYE or CANCEL, or called within a FAILURE_ROUTE[], then do unforce_rtpproxy() * If reply to INVITE with code >= 300 do unforce_rtpproxy() - * If reply with SDP to INVITE having code 1xx and 2xx, then do - rtpproxy_answer() if the request had SDP or tm is not loaded, + * If reply with SDP to INVITE having code 1xx and 2xx, then do + rtpproxy_answer() if the request had SDP or tm is not loaded, otherwise do rtpproxy_offer() This function can be used from ANY_ROUTE. @@ -656,33 +656,33 @@ rtpproxy_manage(); 5.7. rtpproxy_stream2uac(prompt_name, count), - Instruct the RTPproxy to stream prompt/announcement pre-encoded with + Instruct the RTPproxy to stream prompt/announcement pre-encoded with the makeann command from the RTPproxy distribution. The uac/uas suffix - selects who will hear the announcement relatively to the current + selects who will hear the announcement relatively to the current transaction - UAC or UAS. For example invoking the rtpproxy_stream2uac - in the request processing block on ACK transaction will play the - prompt to the UA that has generated original INVITE and ACK while - rtpproxy_stop_stream2uas on 183 in reply processing block will play - the prompt to the UA that has generated 183. - - Apart from generating announcements, another possible application of - this function is implementing music on hold (MOH) functionality. When - count is -1, the streaming will be in loop indefinitely until the + in the request processing block on ACK transaction will play the prompt + to the UA that has generated original INVITE and ACK while + rtpproxy_stop_stream2uas on 183 in reply processing block will play the + prompt to the UA that has generated 183. + + Apart from generating announcements, another possible application of + this function is implementing music on hold (MOH) functionality. When + count is -1, the streaming will be in loop indefinitely until the appropriate rtpproxy_stop_stream2xxx is issued. - In order to work correctly, these functions require that a session in + In order to work correctly, these functions require that a session in the RTPproxy already exists. Also those functions don't alter the SDP, - so that they are not a substitute for calling rtpproxy_offer or + so that they are not a substitute for calling rtpproxy_offer or rtpproxy_answer. This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE. Meaning of the parameters is as follows: - * prompt_name - name of the prompt to stream. Should be either - absolute pathname or pathname relative to the directory where + * prompt_name - name of the prompt to stream. Should be either + absolute pathname or pathname relative to the directory where RTPproxy runs. - * count - number of times the prompt should be repeated. A value of - -1 means that it will be streaming in a loop indefinitely, until + * count - number of times the prompt should be repeated. A value of + -1 means that it will be streaming in a loop indefinitely, until the appropriate rtpproxy_stop_stream2xxx is issued. Example 1.18. rtpproxy_stream2xxx usage @@ -703,8 +703,8 @@ rtpproxy_manage(); 5.9. rtpproxy_stop_stream2uac(), - Stop streaming of announcement/prompt/MOH started previously by the - respective rtpproxy_stream2xxx. The uac/uas suffix selects whose + Stop streaming of announcement/prompt/MOH started previously by the + respective rtpproxy_stream2xxx. The uac/uas suffix selects whose announcement relatively to tha current transaction should be stopped - UAC or UAS. @@ -712,8 +712,8 @@ rtpproxy_manage(); 5.10. start_recording() - This function will send a signal to the RTP-Proxy to record the RTP - stream on the RTP-Proxy. This function is only supported by Sippy + This function will send a signal to the RTP-Proxy to record the RTP + stream on the RTP-Proxy. This function is only supported by Sippy RTPproxy at the moment! This function can be used from REQUEST_ROUTE and ONREPLY_ROUTE. @@ -734,9 +734,9 @@ start_recording(); 6.1. $rtpstat Returns the RTP-Statistics from the RTP-Proxy. The RTP-Statistics from - the RTP-Proxy are provided as a string and it does contain several - packet-counters. The statistics must be retrieved before the session - is deleted (before unforce_rtpproxy()). + the RTP-Proxy are provided as a string and it does contain several + packet-counters. The statistics must be retrieved before the session is + deleted (before unforce_rtpproxy()). Example 1.20. $rtpstat-Usage ... @@ -750,16 +750,16 @@ start_recording(); 7.1. nh_enable_rtpp - Enables a rtp proxy if parameter value is greater than 0. Disables it + Enables a rtp proxy if parameter value is greater than 0. Disables it if a zero value is given. - The first parameter is the rtp proxy url (exactly as defined in the + The first parameter is the rtp proxy url (exactly as defined in the config file). The second parameter value must be a number in decimal. - NOTE: if a rtpproxy is defined multiple times (in the same or - different sets), all of its instances will be enabled/disabled. + NOTE: if a rtpproxy is defined multiple times (in the same or different + sets), all of its instances will be enabled/disabled. Example 1.21. nh_enable_rtpp usage ... @@ -768,7 +768,7 @@ $ kamctl fifo nh_enable_rtpp udp:192.168.2.133:8081 0 7.2. nh_show_rtpp - Displays all the rtp proxies and their information: set and status + Displays all the rtp proxies and their information: set and status (disabled or not, weight and recheck_ticks). No parameter. @@ -780,45 +780,45 @@ $ kamctl fifo nh_show_rtpp Chapter 2. Frequently Asked Questions - 2.1. What happend with "rtpproxy_disable" parameter? + 2.1. What happend with “rtpproxy_disable” parameter? 2.2. Where can I find more about Kamailio? 2.3. Where can I post a question about this module? 2.4. How can I report a bug? 2.1. - What happend with "rtpproxy_disable" parameter? + What happend with “rtpproxy_disable” parameter? - It was removed as it became obsolete - now "rtpproxy_sock" can take - empty value to disable the rtpproxy functionality. + It was removed as it became obsolete - now “rtpproxy_sock” can take + empty value to disable the rtpproxy functionality. 2.2. - Where can I find more about Kamailio? + Where can I find more about Kamailio? - Take a look at http://www.kamailio.org/. + Take a look at http://www.kamailio.org/. 2.3. - Where can I post a question about this module? + Where can I post a question about this module? - First at all check if your question was already answered on one of our - mailing lists: - * User Mailing List - - http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users - * Developer Mailing List - - http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev + First at all check if your question was already answered on one of our + mailing lists: + * User Mailing List - + http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users + * Developer Mailing List - + http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev - E-mails regarding any stable Kamailio release should be sent to - and e-mails regarding development - versions should be sent to . + E-mails regarding any stable Kamailio release should be sent to + and e-mails regarding development + versions should be sent to . - If you want to keep the mail private, send it to - . + If you want to keep the mail private, send it to + . 2.4. - How can I report a bug? + How can I report a bug? - Please follow the guidelines provided at: - http://sip-router.org/tracker. + Please follow the guidelines provided at: + https://github.com/kamailio/kamailio/issues. diff --git a/modules/rtpproxy/doc/rtpproxy_admin.xml b/modules/rtpproxy/doc/rtpproxy_admin.xml index a1939c99c3c..49edff78625 100644 --- a/modules/rtpproxy/doc/rtpproxy_admin.xml +++ b/modules/rtpproxy/doc/rtpproxy_admin.xml @@ -11,16 +11,16 @@ - + &adminguide; - +
Overview This is a module that enables media streams to be proxied via an rtpproxy. Rtpproxies know to work with this module are Sippy RTPproxy - and ngcp-rtpproxy-ng + and ngcp-rtpproxy-ng . Some features of the rtpproxy module apply only to one of the two rtpproxies. @@ -95,7 +95,7 @@
Parameters -
+
<varname>rtpproxy_sock</varname> (string) Used to define the list of RTPPRoxy instances to connect to. @@ -129,7 +129,7 @@ modparam("rtpproxy", "rtpproxy_sock",
-
+
<varname>rtpproxy_disable_tout</varname> (integer) Once RTPProxy was found unreachable and marked as disabled, the rtpproxy @@ -150,7 +150,7 @@ modparam("rtpproxy", "rtpproxy_disable_tout", 20)
-
+
<varname>rtpproxy_tout</varname> (integer) Timeout value in waiting for reply from RTPProxy. @@ -169,7 +169,7 @@ modparam("rtpproxy", "rtpproxy_tout", 2)
-
+
<varname>rtpproxy_retr</varname> (integer) How many times the module should retry to send and receive after @@ -189,11 +189,11 @@ modparam("rtpproxy", "rtpproxy_retr", 2)
-
+
<varname>nortpproxy_str</varname> (string) This parameter sets the SDP attribute used by rtpproxy to mark - the message's SDP attachemnt with information that it have + the message's SDP attachemnt with information that it have already been changed. @@ -216,7 +216,7 @@ modparam("rtpproxy", "nortpproxy_str", "a=sdpmangled:yes\r\n")
-
+
<varname>timeout_socket</varname> (string) The parameter sets the RTP timeout socket, which is transmitted to the RTP-Proxy. @@ -240,7 +240,7 @@ modparam("rtpproxy", "timeout_socket", "xmlrpc:http://127.0.0.1:8000/RPC2")
-
+
<varname>ice_candidate_priority_avp</varname> (string) If specified and if value of the avp value is not 0, @@ -268,7 +268,7 @@ modparam("rtpproxy", "ice_candidate_priority_avp", "$avp(ice_priority)")
-
+
<varname>extra_id_pv</varname> (string) The parameter sets the PV defination to use when the b @@ -286,7 +286,7 @@ modparam("rtpproxy", "extra_id_pv", "$avp(extra_id)")
-
+
<varname>db_url</varname> (string) The database URL to load rtp_proxy sets from. @@ -304,7 +304,7 @@ modparam("rtpproxy", "db_url", "mysql://user:passwb@localhost/database")
-
+
<varname>table_name</varname> (string) The name of the table containing the rtpproxy sets. @@ -321,7 +321,7 @@ modparam("rtpproxy", "table_name", "my_rtpp_sets")
-
+
<varname>rtp_inst_pvar</varname> (string) A pseudo variable to store the chosen RTPProxy address. @@ -356,7 +356,7 @@ xlog("L_INFO", "Chose rtpp instance $var(RTP_INSTANCE)\n");
Functions -
+
<function moreinfo="none">set_rtp_proxy_set(setid)</function> @@ -380,7 +380,7 @@ rtpproxy_offer();
-
+
<function moreinfo="none">rtpproxy_offer([flags [, ip_address]])</function> @@ -405,11 +405,11 @@ rtpproxy_offer(); passing the flag '1' or '2' in the unforce_rtpproxy, or stop all sessions for a call when not passing one of those two flags there. This is especially useful if you have serially forked call scenarios where rtpproxy - gets an update command for a new branch, and then a + gets an update command for a new branch, and then a delete command for the previous branch, which would otherwise delete the full call, breaking the subsequent lookup for the - new branch. This flag is only supported by the ngcp-mediaproxy-ng - rtpproxy at the moment! + new branch. This flag is only supported by the ngcp-mediaproxy-ng + rtpproxy (now named rtpengine) at the moment! 2 - append second Via branch to Call-ID when sending @@ -555,7 +555,7 @@ onreply_route[2]
-
+
<function moreinfo="none">rtpproxy_answer([flags [, ip_address]])</function> @@ -580,7 +580,7 @@ onreply_route[2]
-
+
<function moreinfo="none">rtpproxy_destroy([flags])</function> @@ -605,11 +605,11 @@ onreply_route[2] passing the flag '1' or '2' in the unforce_rtpproxy, or stop all sessions for a call when not passing one of those two flags there. This is especially useful if you have serially forked call scenarios where rtpproxy - gets an update command for a new branch, and then a + gets an update command for a new branch, and then a delete command for the previous branch, which would otherwise delete the full call, breaking the subsequent lookup for the - new branch. This flag is only supported by the ngcp-mediaproxy-ng - rtpproxy at the moment! + new branch. This flag is only supported by the ngcp-mediaproxy-ng + rtpproxy (now named rtpengine) at the moment! 2 - append second Via branch to Call-ID when sending @@ -634,7 +634,7 @@ rtpproxy_destroy();
-
+
<function moreinfo="none">unforce_rtp_proxy()</function> @@ -643,7 +643,7 @@ rtpproxy_destroy();
-
+
<function moreinfo="none">rtpproxy_manage([flags [, ip_address]])</function> @@ -710,7 +710,7 @@ rtpproxy_manage();
-
+
<function>rtpproxy_stream2uac(prompt_name, count)</function>, @@ -774,7 +774,7 @@ rtpproxy_manage();
-
+
<function>rtpproxy_stream2uas(prompt_name, count)</function> @@ -782,7 +782,7 @@ rtpproxy_manage(); See function rtpproxy_stream2uac(prompt_name, count).
-
+
<function>rtpproxy_stop_stream2uac()</function>, @@ -796,13 +796,13 @@ rtpproxy_manage(); These functions can be used from REQUEST_ROUTE, ONREPLY_ROUTE.
-
+
<function moreinfo="none">start_recording()</function> This function will send a signal to the RTP-Proxy to record - the RTP stream on the RTP-Proxy. + the RTP stream on the RTP-Proxy. This function is only supported by Sippy RTPproxy at the moment! @@ -817,7 +817,7 @@ start_recording();
-
+
<function>rtpproxy_stop_stream2uas(prompt_name, count)</function> @@ -831,7 +831,7 @@ start_recording();
Exported Pseudo Variables -
+
<function moreinfo="none">$rtpstat</function> Returns the RTP-Statistics from the RTP-Proxy. The RTP-Statistics from the RTP-Proxy @@ -880,7 +880,7 @@ $ &ctltool; fifo nh_enable_rtpp udp:192.168.2.133:8081 0
- +
<function moreinfo="none">nh_show_rtpp</function> diff --git a/modules/rtpproxy/rtpproxy.c b/modules/rtpproxy/rtpproxy.c index bb644de478f..c3f39ec964e 100644 --- a/modules/rtpproxy/rtpproxy.c +++ b/modules/rtpproxy/rtpproxy.c @@ -1007,6 +1007,11 @@ child_init(int rank) if(rtpp_set_list==NULL ) return 0; + /* do not init sockets for PROC_INIT and main process when fork=yes */ + if(rank==PROC_INIT || (rank==PROC_MAIN && dont_fork==0)) { + return 0; + } + /* Iterate known RTP proxies - create sockets */ mypid = getpid(); @@ -1015,6 +1020,7 @@ child_init(int rank) LM_ERR("no more pkg memory\n"); return -1; } + memset(rtpp_socks, -1, sizeof(int)*rtpp_no); for(rtpp_list = rtpp_set_list->rset_first; rtpp_list != 0; rtpp_list = rtpp_list->rset_next){ diff --git a/modules/sanity/README b/modules/sanity/README index aeb05bfdc4b..90ea8789c11 100644 --- a/modules/sanity/README +++ b/modules/sanity/README @@ -4,7 +4,7 @@ Nils Ohlmeier iptelorg GmbH - Copyright 2006 iptelorg GmbH + Copyright © 2006 iptelorg GmbH __________________________________________________________________ Table of Contents @@ -113,7 +113,7 @@ Chapter 1. Admin Guide of the sanity_check function. The integer value is the sum of the check numbers which should be executed by default. - Default value is "999". This resolves to the following list of checks: + Default value is “999”. This resolves to the following list of checks: ruri_sip_version (1), ruri_scheme (2), required_headers (4), cseq_method (32), cseq_value (64), cotent_length (128), expires_value (256), proxy_require (512). @@ -129,7 +129,7 @@ modparam("sanity", "default_checks", 1) 'parse uri' will be executed. Default value is 7. This resolves to the following list of parsed URIs: - Request RUI (1), From URI (2) and To URI (4). + Request URI (1), From URI (2) and To URI (4). Example 1.2. Set uri_checks parameter ... @@ -154,7 +154,7 @@ modparam("sanity", "proxy_require", "foo, bar") automatically if the sanity checks fail. Default value is 1 (auto drop). If set to 0, sanity_check() function will return -1 (false) to configuration file, allowing to write log messages for example - be - sure you "exit" execution of config without sending a SIP reply because + sure you “exit” execution of config without sending a SIP reply because it is sent by module itself. Example 1.4. Set autodrop parameter @@ -166,7 +166,7 @@ modparam("sanity", "autodrop", 1) 4.1. sanity_check([msg_checks [, uri_checks]]) -4.1. sanity_check([msg_checks [, uri_checks]]) +4.1. sanity_check([msg_checks [, uri_checks]]) This function makes a row of sanity checks over the given SIP request. The behavior of the function is also controlled by autodrop parameter. diff --git a/modules/sanity/doc/sanity_admin.xml b/modules/sanity/doc/sanity_admin.xml index d1ddb2b6a0c..687a8cd22f4 100644 --- a/modules/sanity/doc/sanity_admin.xml +++ b/modules/sanity/doc/sanity_admin.xml @@ -160,7 +160,7 @@ modparam("sanity", "default_checks", 1) Default value is 7. This resolves to the following list of - parsed URIs: Request RUI (1), From URI (2) and To URI (4). + parsed URIs: Request URI (1), From URI (2) and To URI (4). Set <varname>uri_checks</varname> parameter diff --git a/modules/sca/README b/modules/sca/README index 7ca1b4c4ccd..bd813387fdc 100644 --- a/modules/sca/README +++ b/modules/sca/README @@ -4,7 +4,7 @@ Andrew Mortensen University of Pennsylvania - Copyright 2012 Andrew Mortensen, admorten@isc.upenn.edu + Copyright © 2012 Andrew Mortensen, admorten@isc.upenn.edu __________________________________________________________________ Table of Contents @@ -29,7 +29,7 @@ Andrew Mortensen 4. Functions 4.1. sca_handle_subscribe() - 4.2. sca_call_info_update() + 4.2. sca_call_info_update([mask]) 5. Exported RPC Commands @@ -76,7 +76,7 @@ Chapter 1. Admin Guide 4. Functions 4.1. sca_handle_subscribe() - 4.2. sca_call_info_update() + 4.2. sca_call_info_update([mask]) 5. Exported RPC Commands @@ -232,7 +232,7 @@ modparam( "sca", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio" ) Name of the database table where call-info subscriptions are written. - Default value is "sca_subscriptions". + Default value is “sca_subscriptions”. Example 1.6. Set subs_table parameter: ... @@ -254,7 +254,7 @@ modparam( "sca", "db_update_interval", 120 ) 4. Functions 4.1. sca_handle_subscribe() - 4.2. sca_call_info_update() + 4.2. sca_call_info_update([mask]) 4.1. sca_handle_subscribe() @@ -277,14 +277,20 @@ modparam( "sca", "db_update_interval", 120 ) Example 1.8. sca_handle_subscribe usage: ... if ( is_method( "SUBSCRIBE" )) { - if ( $hdr(Event) == "call-info" || $hdr(Event) == "line-seize" ) { + if ( $hdr(Event) == "call-info" || $hdr(Event) == "line-seize" ) { sca_handle_subscribe(); exit; - } + } } ... -4.2. sca_call_info_update() +4.2. sca_call_info_update([mask]) + + * mask - integer (optional) + controls what to check as shared line (BOTH, CALLER, CALLEE) + + 0 - SCA_CALL_INFO_SHARED_NONE (default) check both + + 1 - SCA_CALL_INFO_SHARED_CALLER + + 2 - SCA_CALL_INFO_SHARED_CALLEE The sca_call_info_update function updates call state for SCA appearances. If a request or response packet contains a Call-Info @@ -311,28 +317,28 @@ if ( is_method( "SUBSCRIBE" )) { route { ... - sca_call_info_update(); + sca_call_info_update(); ... } onreply_route[REPLY_ROUTE] { ... - if ( status =~ "[456][0-9][0-9]" ) { + if ( status =~ "[456][0-9][0-9]" ) { # don't update SCA state here, since there may be # failure route processing (e.g., call forwarding). # update state in failure route instead. break; - } + } - sca_call_info_update(); + sca_call_info_update(); ... } failure_route[FAILURE_ROUTE] { ... - sca_call_info_update(); + sca_call_info_update(); ... } ... @@ -354,7 +360,7 @@ failure_route[FAILURE_ROUTE] Parameters: none Example: - kamcmd sca.all_subscriptions + kamcmd sca.all_subscriptions 5.2. sca.all_appearances @@ -365,7 +371,7 @@ failure_route[FAILURE_ROUTE] Parameters: none Example: - kamcmd sca.all_appearances + kamcmd sca.all_appearances 5.3. sca.seize_appearance @@ -380,10 +386,10 @@ failure_route[FAILURE_ROUTE] * SCA Contact URI Example: - # seize next available appearance of sip:215@voice.example.com - # for contact sip:215@10.0.1.2 - kamcmd sca.seize_appearance sip:215@voice.example.com sip:215@10.0.1 -.2 + # seize next available appearance of sip:215@voice.example.com + # for contact sip:215@10.0.1.2 + kamcmd sca.seize_appearance sip:215@voice.example.com si +p:215@10.0.1.2 5.4. sca.update_appearance @@ -400,9 +406,10 @@ failure_route[FAILURE_ROUTE] * Appearance Display Info (Optional) Example: - # update in-use appearance index 3 of sip:215@voice.example.com - # state held. - kamcmd sca.update_appearance sip:215@voice.example.com 3 held + # update in-use appearance index 3 of sip:215@voice.example.com + # state held. + kamcmd sca.update_appearance sip:215@voice.example.com 3 + held 5.5. sca.release_appearance @@ -416,9 +423,10 @@ failure_route[FAILURE_ROUTE] * Appearance Index Example: - # release appearance of sip:215@voice.example.com with - # appearance index 3 - kamcmd sca.release_appearance sip:215@voice.example.com 3 + # release appearance of sip:215@voice.example.com with + # appearance index 3 + kamcmd sca.release_appearance sip:215@voice.example.com +3 6. Sample kamailio.cfg with SCA diff --git a/modules/sca/doc/sca_admin.xml b/modules/sca/doc/sca_admin.xml index bbfe7ac78d2..85911cea878 100644 --- a/modules/sca/doc/sca_admin.xml +++ b/modules/sca/doc/sca_admin.xml @@ -10,9 +10,9 @@ - &adminguide; + &adminguide; -
+
Overview The sca module implements Shared Call Appearances. It handles @@ -71,52 +71,52 @@ To date, this module has only been tested with Polycom Soundpoint 550s and 650s running Polycom SIP 3.3.4. -
+
-
+
Dependencies
- Modules - + Modules + The following modules must be loaded before this module: - - + + a database module - - - - + + + + sl - - - - + + + + tm - - + + - + +
-
-
- Parameters
- <varname>hash_table_size</varname> (integer) - + Parameters +
+ <varname>hash_table_size</varname> (integer) + Size, as a power of two, of the shared memory hash table containing the call-info subscriptions and the appearance state. A larger power of two means better performance (fewer collisions, making for fewer subscriber URI comparisons) at the expense of increased shared memory use. - - + + - Default value is 9 (2 ^ 9 == 512). + Default value is 9 (2 ^ 9 == 512). - - + + Set <varname>hash_table_size</varname>: ... @@ -124,205 +124,218 @@ modparam( "sca", "hash_table_size", 8 ) ... - +
-
- <varname>call_info_max_expires</varname> (integer) - +
+ <varname>call_info_max_expires</varname> (integer) + The maximum allowed call-info subscription time in seconds. - - + + - Default value is 3600 (1 hour). + Default value is 3600 (1 hour). - - + + Set <varname>call_info_max_expires</varname>: ... modparam( "sca", "call_info_max_expires", 1800 ) ... - +
-
- <varname>line_seize_max_expires</varname> (integer) - +
+ <varname>line_seize_max_expires</varname> (integer) + The maximum allowed line-seize subscription time in seconds. - - - - Default value is 15 (15 seconds). - - - + + + + Default value is 15 (15 seconds). + + + A maximum line-seize subscription time of 15 seconds is recommended in the SIP Access Side Extensions document. This interval is purposely short to prevent a client from seizing an appearance without making a call for extended periods of time. - - - Set <varname>line_seize_max_expires</varname>: - -... + + + Set <varname>line_seize_max_expires</varname>: + +... modparam( "sca", "line_seize_max_expires", 30 ) ... - - -
+ + +
-
- <varname>purge_expired_interval</varname> (integer) - +
+ <varname>purge_expired_interval</varname> (integer) + The period of time in seconds between purges of expired call-info and line-seize subscriptions. - - - - Default value is 120 (2 minutes). - - - + + + + Default value is 120 (2 minutes). + + + On finding an expired subscription, the module removes the subscription from the shared memory hash table, and sends a NOTIFY with Subscription-State "terminated;expired" header value to the subscriber. It also NOTIFYs other members of the group, in the event that the expired subscription was a line-seize. - - - Set <varname>purge_expired_interval</varname>: - -... + + + Set <varname>purge_expired_interval</varname>: + +... modparam( "sca", "purge_expired_interval", 60 ) ... - - -
+ + +
-
- <varname>db_url</varname> (str) - +
+ <varname>db_url</varname> (str) + URL of database to which subscribers will be written. - - + + Default value is &defaultdb; - - + + Set <varname>db_url</varname> parameter: ... modparam( "sca", "db_url", "&defaultdb;" ) ... - +
-
- <varname>subs_table</varname> (str) - +
+ <varname>subs_table</varname> (str) + Name of the database table where call-info subscriptions are written. - - - - Default value is sca_subscriptions. - - - - Set <varname>subs_table</varname> parameter: - -... + + + + Default value is sca_subscriptions. + + + + Set <varname>subs_table</varname> parameter: + +... modparam( "sca", "subs_table", "call_info_subscriptions" ) ... - - -
+ + +
-
- <varname>db_update_interval</varname> (integer) - +
+ <varname>db_update_interval</varname> (integer) + Period in seconds between writes of call-info subscriber - information to the database. - - + information to the database. + + - Default value is 300 (5 minutes). + Default value is 300 (5 minutes). - - + + Set <varname>db_update_interval</varname>: ... modparam( "sca", "db_update_interval", 120 ) ... - + +
-
-
- Functions
- + <title>Functions +
+ <function moreinfo="none">sca_handle_subscribe()</function> - - + + The function handling call-info and line-seize SUBSCRIBE requests. It stores or updates the subscriptions in shared memory, and sends NOTIFYs to the subscriber and other members of the group as needed. - - + + For example, a line-seize SUBSCRIBE will cause the module to reserve an appearance index for the subscriber; send a line-seize NOTIFY to the subscriber indicating which appearance index it must use; and send call-info NOTIFYs to other subscribers to the address-of-record letting them know the appearance is off hook. - - + + This function can be used from the REQUEST_ROUTE. - - + + Return code: - - + + 1 - successful - - + + - - + + -1 - failed, error logged - - + + - - + + <function>sca_handle_subscribe</function> usage: ... if ( is_method( "SUBSCRIBE" )) { - if ( $hdr(Event) == "call-info" || $hdr(Event) == "line-seize" ) { + if ( $hdr(Event) == "call-info" || $hdr(Event) == "line-seize" ) { sca_handle_subscribe(); exit; - } + } } ... - +
-
- - <function moreinfo="none">sca_call_info_update()</function> - - +
+ + <function moreinfo="none">sca_call_info_update([mask])</function> + + + + + mask - integer (optional) + controls what to check as shared line (BOTH, CALLER, CALLEE) + + 0 - SCA_CALL_INFO_SHARED_NONE (default) check both + 1 - SCA_CALL_INFO_SHARED_CALLER + 2 - SCA_CALL_INFO_SHARED_CALLEE + + + + + The sca_call_info_update function updates call state for SCA appearances. If a request or response packet contains a Call-Info header, the function extracts call state from @@ -333,238 +346,238 @@ if ( is_method( "SUBSCRIBE" )) { AoRs, the function looks up the appearance by dialog and updates call state as needed, sending NOTIFYs to members of the group if the call state has changed. - - + + The sca_call_info_update function updates call state for INVITE, CANCEL, BYE, PRACK and REFER requests and responses. - - - This function can be used from the REQUEST_ROUTE, REPLY_ROUTE, + + + This function can be used from the REQUEST_ROUTE, REPLY_ROUTE, and FAILURE_ROUTE. - - - Return code: - - - - 1 - successful - - - - - - -1 - failed, error logged - - - - - - <function>sca_call_info_update</function> usage: - -... + + + Return code: + + + + 1 - successful + + + + + + -1 - failed, error logged + + + + + + <function>sca_call_info_update</function> usage: + +... route { ... - sca_call_info_update(); + sca_call_info_update(); ... } onreply_route[REPLY_ROUTE] { ... - if ( status =~ "[456][0-9][0-9]" ) { + if ( status =~ "[456][0-9][0-9]" ) { # don't update SCA state here, since there may be # failure route processing (e.g., call forwarding). # update state in failure route instead. break; - } + } - sca_call_info_update(); + sca_call_info_update(); ... } failure_route[FAILURE_ROUTE] { ... - sca_call_info_update(); + sca_call_info_update(); ... } -... - - -
-
+... + + +
+
-
+
Exported RPC Commands -
- <varname>sca.all_subscriptions</varname> - +
+ <varname>sca.all_subscriptions</varname> + List all current call-info and line-seize subscriptions. - - + + Name: sca.all_subscriptions - - + + Parameters: none - - + + Example: - - - &sercmd; sca.all_subscriptions - + + + &sercmd; sca.all_subscriptions +
-
- <varname>sca.all_appearances</varname> - +
+ <varname>sca.all_appearances</varname> + List all SCA appearances with non-idle state. - - - Name: sca.all_appearances - - - Parameters: none - - - Example: - - - &sercmd; sca.all_appearances - -
+
+ + Name: sca.all_appearances + + + Parameters: none + + + Example: + + + &sercmd; sca.all_appearances + +
-
- <varname>sca.seize_appearance</varname> - +
+ <varname>sca.seize_appearance</varname> + Seize an appearance index for a specific contact within an SCA group, and notify other members of the group that the appearance is off hook. Useful for testing SCA signaling. - - - Name: sca.seize_appearance - - - Parameters: 2 - - + + + Name: sca.seize_appearance + + + Parameters: 2 + + - SCA Address-of-Record + SCA Address-of-Record - SCA Contact URI + SCA Contact URI - - - Example: - - - # seize next available appearance of sip:215@voice.example.com - # for contact sip:215@10.0.1.2 - &sercmd; sca.seize_appearance sip:215@voice.example.com sip:215@10.0.1.2 - -
+ + + Example: + + + # seize next available appearance of sip:215@voice.example.com + # for contact sip:215@10.0.1.2 + &sercmd; sca.seize_appearance sip:215@voice.example.com sip:215@10.0.1.2 + +
-
- <varname>sca.update_appearance</varname> - +
+ <varname>sca.update_appearance</varname> + Update the state of an in-use appearance index, and notify other members of the group. Useful for testing SCA signaling. - - - Name: sca.update_appearance - - - Parameters: 3 or 4 - - + + + Name: sca.update_appearance + + + Parameters: 3 or 4 + + - SCA Address-of-Record + SCA Address-of-Record - Index of In-Use Appearance + Index of In-Use Appearance - Appearance State - (seized, ringing, progressing, active, held, held-private) + Appearance State + (seized, ringing, progressing, active, held, held-private) - Appearance Display Info (Optional) + Appearance Display Info (Optional) - - - Example: - - - # update in-use appearance index 3 of sip:215@voice.example.com - # state held. - &sercmd; sca.update_appearance sip:215@voice.example.com 3 held - -
+ + + Example: + + + # update in-use appearance index 3 of sip:215@voice.example.com + # state held. + &sercmd; sca.update_appearance sip:215@voice.example.com 3 held + +
-
- <varname>sca.release_appearance</varname> - +
+ <varname>sca.release_appearance</varname> + Set a non-idle appearance index to idle and NOTIFY members of the group. - - - Name: sca.release_appearance - - - Parameters: 2 - - + + + Name: sca.release_appearance + + + Parameters: 2 + + - SCA Address-of-Record + SCA Address-of-Record - Appearance Index + Appearance Index - - - Example: - - - # release appearance of sip:215@voice.example.com with - # appearance index 3 - &sercmd; sca.release_appearance sip:215@voice.example.com 3 - -
-
+ + + Example: + + + # release appearance of sip:215@voice.example.com with + # appearance index 3 + &sercmd; sca.release_appearance sip:215@voice.example.com 3 + +
+
-
+
Sample &kamailioconfig; with SCA - The following is a basic &kamailioconfig; providing Shared Call - Appearances to local subscribers. It has been tested with - Polycom handsets. + The following is a basic &kamailioconfig; providing Shared Call + Appearances to local subscribers. It has been tested with + Polycom handsets. - &kamailioconfig; - + &kamailioconfig; + ## - + -
+
diff --git a/modules/sdpops/api.h b/modules/sdpops/api.h index a1809ec2f17..0528d3fcd0c 100644 --- a/modules/sdpops/api.h +++ b/modules/sdpops/api.h @@ -1,3 +1,24 @@ +/* + * Copyright (C) 2011 Daniel-Constantin Mierla (asipto.com) + * + * This file is part of Kamailio, a free SIP server. + * + * Kamailio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version + * + * Kamailio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + #ifndef SDPOPS_API_H #define SDPOPS_API_H #include "../../str.h" diff --git a/modules/sdpops/sdpops_data.c b/modules/sdpops/sdpops_data.c index a9ce3a4f522..040cfb1fafa 100644 --- a/modules/sdpops/sdpops_data.c +++ b/modules/sdpops/sdpops_data.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2011 Daniel-Constantin Mierla (asipto.com) * * This file is part of Kamailio, a free SIP server. @@ -15,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -47,7 +45,7 @@ list maintains and extends that list. PT encoding name audio/video (A/V) clock rate (Hz) channels (audio) Reference -------- -------------- ----------------- --------------- ---------------- --------- 0 PCMU A 8000 1 [RFC3551] -1 Reserved +1 Reserved 2 Reserved 3 GSM A 8000 1 [RFC3551] 4 G723 A 8000 1 [Kumar][RFC3551] @@ -84,7 +82,7 @@ PT encoding name audio/video (A/V) clock rate (Hz) channels (audio) 35-71 Unassigned ? 72-76 Reserved for RTCP conflict avoidance [RFC3551] 77-95 Unassigned ? -96-127 dynamic ? [RFC3551] +96-127 dynamic ? [RFC3551] Registry Name: RTP Payload Format media types @@ -271,8 +269,8 @@ int str_find_token(str *text, str *result, char delim) return -1; if(text->s[0] == delim) { - text->s += 1; - text->len -= 1; + text->s += 1; + text->len -= 1; } trim_leading(text); result->s = text->s; diff --git a/modules/sdpops/sdpops_data.h b/modules/sdpops/sdpops_data.h index a51409b9989..23b7a6d4f68 100644 --- a/modules/sdpops/sdpops_data.h +++ b/modules/sdpops/sdpops_data.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2011 Daniel-Constantin Mierla (asipto.com) * * This file is part of Kamailio, a free SIP server. @@ -15,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ diff --git a/modules/sdpops/sdpops_mod.c b/modules/sdpops/sdpops_mod.c index 9cbd8d6d9f2..d25634f01ee 100644 --- a/modules/sdpops/sdpops_mod.c +++ b/modules/sdpops/sdpops_mod.c @@ -1,7 +1,5 @@ /* - * $Id$ - * - * Copyright (C) 2011 Daniel-Constantin Mierla (asipto.com) + * Copyright (C) 2011-2016 Daniel-Constantin Mierla (asipto.com) * * This file is part of Kamailio, a free SIP server. * @@ -15,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -147,8 +145,8 @@ struct module_exports exports= { 0 /* per-child init function */ }; -/** - * +/** + * */ static int mod_init(void) { @@ -354,7 +352,7 @@ int sdp_remove_codecs_by_id(sip_msg_t* msg, str* codecs) if(!sdp_stream) break; LM_DBG("stream %d of %d - payloads [%.*s]\n", - sdp_stream_num, sdp_session_num, + sdp_stream_num, sdp_session_num, sdp_stream->payloads.len, sdp_stream->payloads.s); sdp_codecs = sdp_stream->payloads; tmp_codecs = *codecs; @@ -756,7 +754,7 @@ static int w_sdp_keep_codecs_by_name(sip_msg_t* msg, char* codecs, char* media) return 1; } -/** +/** * @brief check 'media' matches the value of any 'm=value ...' lines * @return -1 - error; 0 - not found; 1 - found */ @@ -1006,7 +1004,7 @@ static int w_sdp_remove_media(sip_msg_t* msg, char* media, char *bar) } -/** +/** * @brief check 'media' matches the value of any 'm=media port value ...' lines * @return -1 - error; 0 - not found; 1 - found */ @@ -1040,13 +1038,13 @@ static int sdp_with_transport(sip_msg_t *msg, str *transport, int like) sdp_stream_num, sdp_session_num, sdp_stream->transport.len, sdp_stream->transport.s); if (like == 0) { - if(transport->len==sdp_stream->transport.len - && strncasecmp(sdp_stream->transport.s, transport->s, - transport->len)==0) + if(transport->len==sdp_stream->transport.len + && strncasecmp(sdp_stream->transport.s, transport->s, + transport->len)==0) return 1; } else { - if (ser_memmem(sdp_stream->transport.s, transport->s, - sdp_stream->transport.len, transport->len)!=NULL) + if (ser_memmem(sdp_stream->transport.s, transport->s, + sdp_stream->transport.len, transport->len)!=NULL) return 1; } sdp_stream_num++; @@ -1057,83 +1055,83 @@ static int sdp_with_transport(sip_msg_t *msg, str *transport, int like) return 0; } -/** +/** * @brief assigns common media transport (if any) of 'm' lines to pv argument * @return -1 - error; 0 - not found; 1 - found */ static int w_sdp_transport(sip_msg_t* msg, char *avp) { - int_str avp_val; - int_str avp_name; - static unsigned short avp_type = 0; - str s; - pv_spec_t *avp_spec = NULL; - int sdp_session_num; - int sdp_stream_num; - sdp_session_cell_t* sdp_session; - sdp_stream_cell_t* sdp_stream; - str *transport; - - s.s = avp; s.len = strlen(s.s); - if (pv_locate_name(&s) != s.len) { - LM_ERR("invalid avp parameter %s\n", avp); - return -1; - } - if (((avp_spec = pv_cache_get(&s)) == NULL) - || avp_spec->type!=PVT_AVP) { - LM_ERR("malformed or non AVP %s\n", avp); - return -1; - } - if (pv_get_avp_name(0, &avp_spec->pvp, &avp_name, &avp_type) != 0) { - LM_ERR("invalid AVP definition %s\n", avp); - return -1; - } + int_str avp_val; + int_str avp_name; + static unsigned short avp_type = 0; + str s; + pv_spec_t *avp_spec = NULL; + int sdp_session_num; + int sdp_stream_num; + sdp_session_cell_t* sdp_session; + sdp_stream_cell_t* sdp_stream; + str *transport; - if(parse_sdp(msg) < 0) { - LM_ERR("unable to parse sdp\n"); - return -1; - } + s.s = avp; s.len = strlen(s.s); + if (pv_locate_name(&s) != s.len) { + LM_ERR("invalid avp parameter %s\n", avp); + return -1; + } + if (((avp_spec = pv_cache_get(&s)) == NULL) + || avp_spec->type!=PVT_AVP) { + LM_ERR("malformed or non AVP %s\n", avp); + return -1; + } + if (pv_get_avp_name(0, &avp_spec->pvp, &avp_name, &avp_type) != 0) { + LM_ERR("invalid AVP definition %s\n", avp); + return -1; + } + + if(parse_sdp(msg) < 0) { + LM_ERR("unable to parse sdp\n"); + return -1; + } - sdp_session_num = 0; - transport = (str *)NULL; + sdp_session_num = 0; + transport = (str *)NULL; - for (;;) { - sdp_session = get_sdp_session(msg, sdp_session_num); - if (!sdp_session) break; - sdp_stream_num = 0; for (;;) { - sdp_stream = get_sdp_stream(msg, sdp_session_num, + sdp_session = get_sdp_session(msg, sdp_session_num); + if (!sdp_session) break; + sdp_stream_num = 0; + for (;;) { + sdp_stream = get_sdp_stream(msg, sdp_session_num, sdp_stream_num); - if (!sdp_stream) break; - LM_DBG("stream %d of %d - transport [%.*s]\n", - sdp_stream_num, sdp_session_num, - sdp_stream->transport.len, sdp_stream->transport.s); - if (transport) { - if (transport->len != sdp_stream->transport.len - || strncasecmp(sdp_stream->transport.s, transport->s, - transport->len) != 0) { - LM_DBG("no common transport\n"); - return -2; + if (!sdp_stream) break; + LM_DBG("stream %d of %d - transport [%.*s]\n", + sdp_stream_num, sdp_session_num, + sdp_stream->transport.len, sdp_stream->transport.s); + if (transport) { + if (transport->len != sdp_stream->transport.len + || strncasecmp(sdp_stream->transport.s, transport->s, + transport->len) != 0) { + LM_DBG("no common transport\n"); + return -2; + } + } else { + transport = &sdp_stream->transport; + } + sdp_stream_num++; } - } else { - transport = &sdp_stream->transport; - } - sdp_stream_num++; - } - sdp_session_num++; - } - if (transport) { - avp_val.s.s = transport->s; - avp_val.s.len = transport->len; - LM_DBG("found common transport '%.*s'\n", - transport->len, transport->s); - if (add_avp(AVP_VAL_STR | avp_type, avp_name, avp_val) != 0) { - LM_ERR("failed to add transport avp"); - return -1; - } - } - - return 1; + sdp_session_num++; + } + if (transport) { + avp_val.s.s = transport->s; + avp_val.s.len = transport->len; + LM_DBG("found common transport '%.*s'\n", + transport->len, transport->s); + if (add_avp(AVP_VAL_STR | avp_type, avp_name, avp_val) != 0) { + LM_ERR("failed to add transport avp"); + return -1; + } + } + + return 1; } @@ -1502,14 +1500,15 @@ static int w_sdp_get(sip_msg_t* msg, char *avp) } sdp = (sdp_info_t*)msg->body; - if (sdp_missing) { + if (sdp==NULL) { LM_DBG("No SDP\n"); return -2; - } else { - avp_val.s.s = sdp->raw_sdp.s; - avp_val.s.len = sdp->raw_sdp.len; - LM_DBG("Found SDP %.*s\n", sdp->raw_sdp.len, sdp->raw_sdp.s); } + + avp_val.s.s = sdp->raw_sdp.s; + avp_val.s.len = sdp->raw_sdp.len; + LM_DBG("Found SDP %.*s\n", sdp->raw_sdp.len, sdp->raw_sdp.s); + if (add_avp(AVP_VAL_STR | avp_type, avp_name, avp_val) != 0) { LM_ERR("Failed to add SDP avp"); @@ -1529,31 +1528,6 @@ static int w_sdp_content(sip_msg_t* msg, char* foo, char *bar) return -1; } -/* - * Find the first case insensitive occurrence of find in s, where the - * search is limited to the first slen characters of s. - * Based on FreeBSD strnstr. - */ -char* strnistr(const char *s, const char *find, size_t slen) -{ - char c, sc; - size_t len; - - if ((c = *find++) != '\0') { - len = strlen(find); - do { - do { - if ((sc = *s++) == '\0' || slen-- < 1) - return (NULL); - } while (sc != c); - if (len > slen) - return (NULL); - } while (strncasecmp(s, find, len) != 0); - s--; - } - return ((char *)s); -} - /** * */ @@ -1576,7 +1550,7 @@ static int w_sdp_content_sloppy(sip_msg_t* msg, char* foo, char *bar) if ((mime & 0x00ff) == SUBTYPE_SDP) return 1; else return -1; case TYPE_MULTIPART: if ((mime & 0x00ff) == SUBTYPE_MIXED) { - if (strnistr(body.s, "application/sdp", body.len) == NULL) { + if (_strnistr(body.s, "application/sdp", body.len) == NULL) { return -1; } else { return 1; @@ -1594,30 +1568,30 @@ static int w_sdp_content_sloppy(sip_msg_t* msg, char* foo, char *bar) */ int sdp_with_ice(sip_msg_t* msg) { - str ice, body; + str ice, body; - ice.s = "a=candidate"; - ice.len = 11; + ice.s = "a=candidate"; + ice.len = 11; - body.s = get_body(msg); - if (body.s == NULL) { - LM_DBG("failed to get the message body\n"); - return -1; - } + body.s = get_body(msg); + if (body.s == NULL) { + LM_DBG("failed to get the message body\n"); + return -1; + } - body.len = msg->len -(int)(body.s - msg->buf); - if (body.len == 0) { - LM_DBG("message body has length zero\n"); - return -1; - } + body.len = msg->len -(int)(body.s - msg->buf); + if (body.len == 0) { + LM_DBG("message body has length zero\n"); + return -1; + } - if (ser_memmem(body.s, ice.s, body.len, ice.len) != NULL) { - LM_DBG("found ice attribute\n"); - return 1; - } else { - LM_DBG("didn't find ice attribute\n"); - return -1; - } + if (ser_memmem(body.s, ice.s, body.len, ice.len) != NULL) { + LM_DBG("found ice attribute\n"); + return 1; + } else { + LM_DBG("didn't find ice attribute\n"); + return -1; + } } /** @@ -1625,7 +1599,7 @@ int sdp_with_ice(sip_msg_t* msg) */ static int w_sdp_with_ice(sip_msg_t* msg, char* foo, char *bar) { - return sdp_with_ice(msg); + return sdp_with_ice(msg); } /** diff --git a/modules/seas/encode_msg.c b/modules/seas/encode_msg.c index e56b5fba893..8f84ca62a84 100644 --- a/modules/seas/encode_msg.c +++ b/modules/seas/encode_msg.c @@ -148,7 +148,7 @@ char get_header_code(struct hdr_field *hf) */ int encode_msg(struct sip_msg *msg,char *payload,int len) { - int i,j,k,u,request; + int i,j=0,k,u,request; unsigned short int h; struct hdr_field* hf; struct msg_start* ms; diff --git a/modules/sipcapture/README b/modules/sipcapture/README index 949467c053c..5b50d4632bc 100644 --- a/modules/sipcapture/README +++ b/modules/sipcapture/README @@ -10,9 +10,11 @@ Alexandr Dubovikov - Copyright 2011 QSC AG + Copyright © 2011-15 SIPCAPTURE ORG - Copyright 2011 http://www.qsc.de + Copyright © 2011 QSC AG + + Copyright © 2011 http://www.qsc.de __________________________________________________________________ Table of Contents @@ -87,7 +89,7 @@ Alexandr Dubovikov 1.19. Set callid_aleg_header parameter 1.20. Set topoh_unmask parameter 1.21. sip_capture() usage - 1.22. sip_capture() usage + 1.22. report_capture() usage Chapter 1. Admin Guide @@ -209,7 +211,8 @@ modparam("sipcapture", "db_url", "mysql://user:passwd@host/dbname") Name of the table's name used to store the SIP messages. Can contain multiple tables, separated by "|". - Default value is "sip_capture". + Default value is "sip_capture". Only for Homer 3. For Homer 5, please + use an argument for the sip_capture function. Example 1.2. Set sip_capture parameter ... @@ -466,13 +469,17 @@ modparam("sipcapture", "topoh_unmask", 1) 4.1. sip_capture([table]) 4.2. report_capture([table],[data]) -4.1. sip_capture([table]) +4.1. sip_capture([table]) Store the current processed HEP/IPIP SIP message in database. It is stored in the form prior applying changes made to it. Meaning of the parameters is as follows: - * table - The table where HEP SIP message will be stored. + * table - The table where HEP SIP message will be stored. Homer 5 use + now tables with datestamp. To generate an automatic table's name + please use strftime parameters. I.e. $var(table) = + "sip_capture_call_%Y%m%d" and set the variable as an argument of + the sip_capture function. This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE. @@ -485,7 +492,7 @@ sip_capture(); sip_capture("sip_capture_call_20160124"); ... -4.2. report_capture([table],[data]) +4.2. report_capture([table],[data]) Store the current processed HEP REPORT message in database. @@ -497,7 +504,7 @@ sip_capture("sip_capture_call_20160124"); ONREPLY_ROUTE, BRANCH_ROUTE. Default value is "NULL". - Example 1.22. sip_capture() usage + Example 1.22. report_capture() usage ... report_capture(); ... @@ -510,7 +517,7 @@ report_capture("report_data", "{\"MOS\":4.1,\"PACKET_LOST\":100"}); 5.1. sip_capture -5.1. sip_capture +5.1. sip_capture Name: sip_capture @@ -520,7 +527,7 @@ report_capture("report_data", "{\"MOS\":4.1,\"PACKET_LOST\":100"}); + on + off The parameter is optional - if missing, the command will return the - status of the SIP message capturing (as string "on" or "off" ) + status of the SIP message capturing (as string “on” or “off” ) without changing anything. MI FIFO Command Format: @@ -532,7 +539,7 @@ report_capture("report_data", "{\"MOS\":4.1,\"PACKET_LOST\":100"}); 6.1. sipcapture.status param -6.1. sipcapture.status param +6.1. sipcapture.status param Name: sipcapture.status @@ -540,7 +547,7 @@ report_capture("report_data", "{\"MOS\":4.1,\"PACKET_LOST\":100"}); * on or off: turns on/off SIP message capturing. Possible values are: + on + off - * "check" does not change sipcapture status, just reports the current + * “check” does not change sipcapture status, just reports the current status. 7. Database setup @@ -548,13 +555,14 @@ report_capture("report_data", "{\"MOS\":4.1,\"PACKET_LOST\":100"}); Before running Kamailio with the sipcapture module, you have to setup the database tables where the module will store the data. For that, if the table were not created by the installation script or you choose to - install everything by yourself you can use the sipcapture_create.sql, - SQL script in the sql folder of sipcapture module as template. You can - also find the complete database documentation on the project webpage, + install everything by yourself you can use the homer_databases.sql, SQL + script in the sql folder of sipcapture module as template. You can also + find the complete database documentation on the project webpage, http://www.kamailio.org/docs/db-tables/kamailio-db-devel.html. 8. Limitations * 1. Only one capturing mode on RAW socket is supported: IPIP or monitoring/mirroring port. Don't activate both at the same time. + Obsolete. Please use HEP mirroring now. * 2. Mirroring port capturing works only on Linux. diff --git a/modules/sipcapture/doc/sipcapture.xml b/modules/sipcapture/doc/sipcapture.xml index e5b10757f3f..46f12f30744 100644 --- a/modules/sipcapture/doc/sipcapture.xml +++ b/modules/sipcapture/doc/sipcapture.xml @@ -24,6 +24,10 @@ alexandr.dubovikov@gmail.com + + 2011-15 + SIPCAPTURE ORG + 2011 QSC AG diff --git a/modules/sipcapture/doc/sipcapture_admin.xml b/modules/sipcapture/doc/sipcapture_admin.xml index bb1e114363c..b47a102b954 100644 --- a/modules/sipcapture/doc/sipcapture_admin.xml +++ b/modules/sipcapture/doc/sipcapture_admin.xml @@ -108,7 +108,7 @@ modparam("sipcapture", "db_url", "mysql://user:passwd@host/dbname") - Default value is "sip_capture". + Default value is "sip_capture". Only for Homer 3. For Homer 5, please use an argument for the sip_capture function. @@ -507,7 +507,9 @@ modparam("sipcapture", "topoh_unmask", 1) Meaning of the parameters is as follows: - table - The table where HEP SIP message will be stored. + table - The table where HEP SIP message will be stored. Homer 5 use now tables with datestamp. + To generate an automatic table's name please use strftime parameters. I.e. $var(table) = "sip_capture_call_%Y%m%d" and set the variable + as an argument of the sip_capture function. @@ -553,7 +555,7 @@ sip_capture("sip_capture_call_20160124"); Default value is "NULL". - <function>sip_capture()</function> usage + <function>report_capture()</function> usage ... report_capture(); @@ -641,7 +643,7 @@ report_capture("report_data", "{\"MOS\":4.1,\"PACKET_LOST\":100"}); Before running &kamailio; with the sipcapture module, you have to setup the database tables where the module will store the data. For that, if the table were not created by the installation script or you choose to install everything by - yourself you can use the sipcapture_create.sql, SQL script + yourself you can use the homer_databases.sql, SQL script in the sql folder of sipcapture module as template. You can also find the complete database documentation on the project webpage, &kamailiodbdocslink;. @@ -651,7 +653,7 @@ report_capture("report_data", "{\"MOS\":4.1,\"PACKET_LOST\":100"}); 1. Only one capturing mode on RAW socket is supported: IPIP or monitoring/mirroring port. - Don't activate both at the same time. + Don't activate both at the same time. Obsolete. Please use HEP mirroring now. 2. Mirroring port capturing works only on Linux. diff --git a/modules/sipcapture/examples/kamailio.cfg b/modules/sipcapture/examples/kamailio.cfg index 56fd2888cea..0c4df4ae2d1 100644 --- a/modules/sipcapture/examples/kamailio.cfg +++ b/modules/sipcapture/examples/kamailio.cfg @@ -2,6 +2,24 @@ # # Example configuration file for a sipcapture node # + +####### Global Parameters definitions ######### +# +# Please, make all your configuration changes here +# +# *** To enable extra stats +# - define WITH_STATISTIC_METHOD_EXTRA +# - define WITH_STATISTIC_INVITE_1XX + + + +#!substdef "!HOMER_DB_USER!homer_user!g" +#!substdef "!HOMER_DB_PASSWORD!homer_password!g" +#!substdef "!HOMER_LISTEN_PROTO!udp!g" +#!substdef "!HOMER_LISTEN_IF!0.0.0.0!g" +#!substdef "!HOMER_LISTEN_PORT!9060!g" +#!substdef "!HOMER_STATS_SERVER!tcp:HOMER_LISTEN_IF:8888!g" + ####### Global Parameters ######### debug=1 @@ -10,7 +28,11 @@ log_stderror=no memdbg=5 memlog=5 -log_facility=LOG_LOCAL0 +##!define KAMAILIO_4_3 +##!define WITH_HOMER_GEO +##!define WITH_HOMER_CUSTOM_STATS #enable it for HTTP custom stats + +log_facility=LOG_LOCAL1 fork=yes children=5 @@ -19,13 +41,15 @@ children=5 disable_tcp=yes /* IP and port for HEP capturing) */ -listen=udp:10.0.1.77:9060 +listen=HOMER_LISTEN_PROTO:HOMER_LISTEN_IF:HOMER_LISTEN_PORT + +#!ifdef WITH_HOMER_CUSTOM_STATS +listen=HOMER_STATS_SERVER +#!endif #Max loops max_while_loops=100 -mpath="/usr/local/lib64/kamailio/modules" - loadmodule "pv.so" loadmodule "db_mysql.so" loadmodule "sipcapture.so" @@ -34,396 +58,511 @@ loadmodule "rtimer.so" loadmodule "xlog.so" loadmodule "sqlops.so" loadmodule "htable.so" +loadmodule "tm.so" loadmodule "sl.so" loadmodule "siputils.so" +loadmodule "exec.so" + +#!ifdef WITH_HOMER_GEO +loadmodule "geoip.so" +#!endif + +#!ifdef WITH_HOMER_CUSTOM_STATS +loadmodule "xhttp.so" +loadmodule "jansson.so" +loadmodule "avpops.so" +#!endif modparam("htable", "htable", "a=>size=8;autoexpire=400") modparam("htable", "htable", "b=>size=8;autoexpire=31") +# TODO: tune autoexpire setting for htable "c" +modparam("htable", "htable", "c=>size=8;autoexpire=31") + +#!ifdef WITH_HOMER_CUSTOM_STATS +modparam("htable", "htable", "d=>size=8;autoexpire=400") +modparam("xhttp", "url_match", "^/api/v1/stat") +#!endif modparam("rtimer", "timer", "name=ta;interval=60;mode=1;") modparam("rtimer", "exec", "timer=ta;route=TIMER_STATS") -modparam("sqlops","sqlcon","cb=>mysql://homer_user:123456@127.0.0.1/homer_db") +modparam("sqlops","sqlcon","cb=>mysql://HOMER_DB_USER:HOMER_DB_PASSWORD@127.0.0.1/homer_statistic") # ----- mi_fifo params ----- ####### Routing Logic ######## -modparam("sipcapture", "db_url", "mysql://homer_user:123456@localhost/homer_db") +modparam("sipcapture", "db_url", "mysql://HOMER_DB_USER:HOMER_DB_PASSWORD@127.0.0.1/homer_data") modparam("sipcapture", "capture_on", 1) -/* activate HEP capturing */ modparam("sipcapture", "hep_capture_on", 1) -/* IP to listen. Port/Portrange apply only on mirroring port capturing */ -#modparam("sipcapture", "raw_socket_listen", "192.168.0.1:5060") -/* Name of interface to bind on raw socket */ -modparam("sipcapture", "raw_interface", "eth0") -/* activate IPIP capturing */ -modparam("sipcapture", "raw_ipip_capture_on", 1) -/* My table name*/ -modparam("sipcapture", "table_name", "sip_capture") -/* children for raw socket */ -modparam("sipcapture", "raw_sock_children", 4) -/* insert delayed */ -#modparam("sipcapture", "db_insert_mode", 1) -/* activate monitoring/mirroring port capturing. Linux only */ -modparam("sipcapture", "raw_moni_capture_on", 0) -/* Promiscious mode RAW socket. Mirroring port. Linux only */ -#modparam("sipcapture", "promiscious_on", 1) -/* activate Linux Socket Filter (LSF/BPF) on mirroring interface. Linux only */ -#modparam("sipcapture", "raw_moni_bpf_on", 1) - -# Main SIP request routing logic -# - processing of any incoming SIP request starts with this route - -route { - - if($sht(a=>method::all) == $null) $sht(a=>method::all) = 0; - $sht(a=>method::all) = $sht(a=>method::all) + 1; - - if($sht(b=>$rm::$cs::$ci) != $null) { - $var(a) = "sip_capture_call" + "_%Y%m%d"; - sip_capture("$var(a)"); - drop; - } - - $sht(b=>$rm::$cs::$ci) = 1; - - if (is_method("INVITE|REGISTER")) { - - if($ua =~ "(friendly-scanner|sipvicious)") { - sql_query("cb", "INSERT INTO alarm_data_mem (create_date, type, total, source_ip, description) VALUES(NOW(), 'scanner', 1, '$si', 'Friendly scanner alarm!') ON DUPLICATE KEY UPDATE total=total+1"); - } - - #IP Method - sql_query("cb", "INSERT INTO stats_ip_mem ( method, source_ip, total) VALUES('$rm', '$si', 1) ON DUPLICATE KEY UPDATE total=total+1"); - - if($au != $null) $var(anumber) = $au; - else $var(anumber) = $fU; - - #hostname in contact - if($sel(contact.uri.host) =~ "^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$") { - if($sht(a=>alarm::dns) == $null) $sht(a=>alarm::dns) = 0; - $sht(a=>alarm::dns) = $sht(a=>alarm::dns) + 1; - } - - if($sel(contact.uri.host) != $si) { - if($sht(a=>alarm::spoofing) == $null) $sht(a=>alarm::spoofing) = 0; - $sht(a=>alarm::spoofing) = $sht(a=>alarm::spoofing) + 1; - } - - if($au =~ "(\=)|(\-\-)|(\')|(\#)|(\%27)|(\%24)") { - if($sht(a=>alarm::sqlinjection) == $null) $sht(a=>alarm::sqlinjection) = 0; - $sht(a=>alarm::sqlinjection) = $sht(a=>alarm::sqlijnection) + 1; - } - - if($(hdr(Record-Route)[0]{nameaddr.uri}) != $si) { - if($sht(a=>alarm::spoofing) == $null) $sht(a=>alarm::spoofing) = 0; - $sht(a=>alarm::spoofing) = $sht(a=>alarm::spoofing) + 1; - } - +modparam("sipcapture", "insert_retries", 5) +modparam("sipcapture", "insert_retry_timeout", 10) +#modparam("sipcapture", "capture_node", "homer01") - if (is_method("INVITE")) { +#!ifdef WITH_HOMER_GEO +modparam("geoip", "path", "/usr/share/GeoIP/GeoIP.dat") +#!endif - if (has_totag()) { - if($sht(a=>method::reinvite) == $null) $sht(a=>method::reinvite) = 0; - $sht(a=>method::reinvite) = $sht(a=>method::reinvite) + 1; - } - else { - if($sht(a=>method::invite) == $null) $sht(a=>method::invite) = 0; - $sht(a=>method::invite) = $sht(a=>method::invite) + 1; - - if($adu != $null) { - if($sht(a=>method::invite::auth) == $null) $sht(a=>method::invite::auth) = 0; - $sht(a=>method::invite::auth) = $sht(a=>method::invite::auth) + 1; - } +#Stats time +stats.min = 5 desc "My stats TIME min" - if($ua != $null) { - sql_query("cb", "INSERT INTO stats_useragent_mem (useragent, method, total) VALUES('$ua', 'INVITE', 1) ON DUPLICATE KEY UPDATE total=total+1"); - } - - } - } - else { - if($sht(a=>method::register) == $null) $sht(a=>method::register) = 0; - $sht(a=>method::register) = $sht(a=>method::register) + 1; - if($adu != $null) { - if($sht(a=>method::register::auth) == $null) $sht(a=>method::register::auth) = 0; - $sht(a=>method::register::auth) = $sht(a=>method::register::auth) + 1; - } +# Main SIP request routing logic +# - processing of any incoming SIP request starts with this route +route { - if($ua != $null) { - sql_query("cb", "INSERT INTO stats_useragent_mem (useragent, method, total) VALUES('$ua', 'REGISTER', 1) ON DUPLICATE KEY UPDATE total=total+1"); - } + if($sht(a=>method::total) == $null) $sht(a=>method::total) = 0; + $sht(a=>method::total) = $sht(a=>method::total) + 1; + if($sht(a=>packet::count) == $null) $sht(a=>packet::count) = 0; + if($sht(a=>packet::size) == $null) $sht(a=>packet::size) = 0; + + #Packets + $sht(a=>packet::count) = $sht(a=>packet::count) + 1; + $sht(a=>packet::size) = $sht(a=>packet::size) + $ml; + + + if($sht(b=>$rm::$cs::$ci) != $null) { + #$var(a) = "sip_capture_call" + "_%Y%m%d"; + #Store + route(STORE); + drop; + } + + $sht(b=>$rm::$cs::$ci) = 1; + if($sht(a=>method::all) == $null) $sht(a=>method::all) = 0; + $sht(a=>method::all) = $sht(a=>method::all) + 1; + + if (is_method("INVITE|REGISTER")) { + + if($ua =~ "(friendly-scanner|sipvicious|sipcli)") { + sql_query("cb", "INSERT INTO alarm_data_mem (create_date, type, total, source_ip, description) VALUES(NOW(), 'scanner', 1, '$si', 'Friendly scanner alarm!') ON DUPLICATE KEY UPDATE total=total+1"); + route(KILL_VICIOUS); + } + + #IP Method + sql_query("cb", "INSERT INTO stats_ip_mem ( method, source_ip, total) VALUES('$rm', '$si', 1) ON DUPLICATE KEY UPDATE total=total+1"); + +#!ifdef WITH_HOMER_GEO + if(geoip_match("$si", "src")) { + xlog("REGISTER|INVITE SIP message [$si] from: $gip(src=>cc)\n"); + sql_query("cb", "INSERT INTO stats_geo_mem ( method, country, lat, lon, total) VALUES('$rm', '$gip(src=>cc)', '$gip(src=>lat)', '$gip(src=>lon)', 1) ON DUPLICATE KEY UPDATE total=total+1"); } - - } - else if(is_method("BYE")) { - if($sht(a=>method::bye) == $null) $sht(a=>method::bye) = 0; - $sht(a=>method::bye) = $sht(a=>method::bye) + 1; - if(is_present_hf("Reason")) { +#!endif + + + if($au != $null) $var(anumber) = $au; + else $var(anumber) = $fU; + + if($(var(anumber){s.substr,0,5}) == "+204231") { + if($sht(a=>alarm::scam) == $null) $sht(a=>alarm::scam) = 0; + $sht(a=>alarm::scam) = $sht(a=>alarm::scam) + 1; + } + + if($(rU{s.substr,0,5}) == "+204231") { + if($sht(a=>alarm::scam) == $null) $sht(a=>alarm::scam) = 0; + $sht(a=>alarm::scam) = $sht(a=>alarm::scam) + 1; + } + + + #if($sel(contact.uri.host) =~ "^([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))$") { + if($sel(contact.uri.host) =~ "^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$") { + if($sht(a=>alarm::dns) == $null) $sht(a=>alarm::dns) = 0; + $sht(a=>alarm::dns) = $sht(a=>alarm::dns) + 1; + } + + + if($sel(contact.uri.host) != $si) { + if($sht(a=>alarm::spoofing) == $null) $sht(a=>alarm::spoofing) = 0; + $sht(a=>alarm::spoofing) = $sht(a=>alarm::spoofing) + 1; + } + + if($au =~ "(\=)|(\-\-)|(\')|(\#)|(\%27)|(\%24)") { + if($sht(a=>alarm::sqlinjection) == $null) $sht(a=>alarm::sqlinjection) = 0; + $sht(a=>alarm::sqlinjection) = $sht(a=>alarm::sqlinjection) + 1; + } + + if($(hdr(Record-Route)[0]{nameaddr.uri}) != $si) { + if($sht(a=>alarm::spoofing) == $null) $sht(a=>alarm::spoofing) = 0; + $sht(a=>alarm::spoofing) = $sht(a=>alarm::spoofing) + 1; + } + + + if (is_method("INVITE")) { + + if (has_totag()) { + if($sht(a=>method::reinvite) == $null) $sht(a=>method::reinvite) = 0; + $sht(a=>method::reinvite) = $sht(a=>method::reinvite) + 1; + } + else { + if($sht(a=>method::invite) == $null) $sht(a=>method::invite) = 0; + $sht(a=>method::invite) = $sht(a=>method::invite) + 1; + if($adu != $null) { + if($sht(a=>method::invite::auth) == $null) $sht(a=>method::invite::auth) = 0; + $sht(a=>method::invite::auth) = $sht(a=>method::invite::auth) + 1; + } + + if($ua != $null) { + sql_query("cb", "INSERT INTO stats_useragent_mem (useragent, method, total) VALUES('$ua', 'INVITE', 1) ON DUPLICATE KEY UPDATE total=total+1"); + } + + } + } + else { + if($sht(a=>method::register) == $null) $sht(a=>method::register) = 0; + $sht(a=>method::register) = $sht(a=>method::register) + 1; + + if($adu != $null) { + if($sht(a=>method::register::auth) == $null) $sht(a=>method::register::auth) = 0; + $sht(a=>method::register::auth) = $sht(a=>method::register::auth) + 1; + } + + if($ua != $null) { + sql_query("cb", "INSERT INTO stats_useragent_mem (useragent, method, total) VALUES('$ua', 'REGISTER', 1) ON DUPLICATE KEY UPDATE total=total+1"); + } + } + + } + else if(is_method("BYE")) { + if($sht(a=>method::bye) == $null) $sht(a=>method::bye) = 0; + $sht(a=>method::bye) = $sht(a=>method::bye) + 1; + if(is_present_hf("Reason")) { $var(cause) = $(hdr(Reason){param.value,cause}{s.int}); if($var(cause) != 16 && $var(cause) !=17) { - if($sht(a=>stats::sdf) == $null) $sht(a=>stats::sdf) = 0; - $sht(a=>stats::sdf) = $sht(a=>stats::sdf) + 1; - } - } - - } - else if(is_method("CANCEL")) { - if($sht(a=>method::cancel) == $null) $sht(a=>method::cancel) = 0; - $sht(a=>method::cancel) = $sht(a=>method::cancel) + 1; - - } - else if(is_method("OPTIONS")) { - if($sht(a=>method::options) == $null) $sht(a=>method::options) = 0; - $sht(a=>method::options) = $sht(a=>method::options) + 1; - - } - else if(is_method("REFER")) { - if($sht(a=>method::refer) == $null) $sht(a=>method::refer) = 0; - $sht(a=>method::refer) = $sht(a=>method::refer) + 1; - - } - else if(is_method("UPDATE")) { - if($sht(a=>method::update) == $null) $sht(a=>method::update) = 0; - $sht(a=>method::update) = $sht(a=>method::update) + 1; - } - - - #Sharding - if(is_method("REGISTER")) { - $var(table) = "sip_capture_registration"; - } - else if(is_method("INVITE|BYE|CANCEL|UPDATE|ACK|PRACK|REFER")) - { - $var(table) = "sip_capture_call"; - } - else if(is_method("INFO")) + if($sht(a=>stats::sdf) == $null) $sht(a=>stats::sdf) = 0; + $sht(a=>stats::sdf) = $sht(a=>stats::sdf) + 1; + } + } + +# if($si != $sht(a=>ipinit::aleg::$ci) && $si != $sht(a=>ipinit::bleg::$ci)) { +# if($sht(a=>alarm::sessiontd) == $null) $sht(a=>alarm::sessiontd) = 0; +# $sht(a=>alarm::sessiontd) = $sht(a=>alarm::sessiontd) + 1; +# } + + } + else if(is_method("CANCEL")) { + if($sht(a=>method::cancel) == $null) $sht(a=>method::cancel) = 0; + $sht(a=>method::cancel) = $sht(a=>method::cancel) + 1; + + } + else if(is_method("OPTIONS")) { + if($sht(a=>method::options) == $null) $sht(a=>method::options) = 0; + $sht(a=>method::options) = $sht(a=>method::options) + 1; + #xlog("OPTIONS COUNTING.... $sht(a=>method::options)\n"); + + } + else if(is_method("REFER")) { + if($sht(a=>method::refer) == $null) $sht(a=>method::refer) = 0; + $sht(a=>method::refer) = $sht(a=>method::refer) + 1; + + } + else if(is_method("UPDATE")) { + if($sht(a=>method::update) == $null) $sht(a=>method::update) = 0; + $sht(a=>method::update) = $sht(a=>method::update) + 1; + } + + else if(is_method("PUBLISH")) { - $var(table) = "sip_capture_call"; + if(has_body("application/vq-rtcpxr") && $(rb{s.substr,0,1}) != "x") { + $var(table) = "report_capture"; + $var(callid) = $(rb{re.subst,/.*CallID:([0-9A-Za-z@-_\.]{5,120}).*$/\1/s}); + + #Local IP. Only for stats + #$var(localaddress) = $(rb{re.subst,/.*LocalAddr:IP=([^\S]+).*$/\1/s}); + + #xlog("CALLID: $var(callid)"); +#!ifdef KAMAILIO_4_3 + xlog("report_capture is not in < 4.3"); +#!else + report_capture("$var(table)", "$var(callid)"); +#!endif + drop; + } } - else if(is_method("OPTIONS|PUBLISH")) - { - $var(table) = "sip_capture_rest"; + +#!ifdef WITH_STATISTIC_METHOD_EXTRA + else if(is_method("ACK")) { + if($sht(a=>method::ack) == $null) $sht(a=>method::ack) = 0; + $sht(a=>method::ack) = $sht(a=>method::ack) + 1; } else { - $var(table) = "sip_capture_rest"; - } - - $var(a) = $var(table) + "_%Y%m%d"; - sip_capture("$var(a)"); - - drop; + if($sht(a=>method::unknown) == $null) $sht(a=>method::unknown) = 0; + $sht(a=>method::unknown) = $sht(a=>method::uknown) + 1; + } +#!endif + + #Store + route(STORE); + drop; } onreply_route { - if($sht(a=>method::all) == $null) $sht(a=>method::all) = 0; - $sht(a=>method::all) = $sht(a=>method::all) + 1; - - if($sht(b=>$rs::$cs::$rm::$ci) != $null) { - $var(a) = "sip_capture"; - sip_capture("$var(a)"); - drop; - } - - $sht(b=>$rs::$cs::$rm::$ci) = 1; - - #413 Too large - if(status == "413") { - - if($sht(a=>alarm::413) == $null) $sht(a=>alarm::413) = 0; - $sht(a=>alarm::413) = $sht(a=>alarm::413) + 1; - } - # Too many hops - else if(status == "483") { - if($sht(a=>alarm::483) == $null) $sht(a=>alarm::483) = 0; - $sht(a=>alarm::483) = $sht(a=>alarm::483) + 1; - - } - # loops - else if(status == "482") { - if($sht(a=>alarm::482) == $null) $sht(a=>alarm::482) = 0; - $sht(a=>alarm::482) = $sht(a=>alarm::482) + 1; - - } - # 400 - else if(status == "400") { - if($sht(a=>alarm::400) == $null) $sht(a=>alarm::400) = 0; - $sht(a=>alarm::400) = $sht(a=>alarm::400) + 1; - - } - - # 500 - else if(status == "500") { - if($sht(a=>alarm::500) == $null) $sht(a=>alarm::500) = 0; - $sht(a=>alarm::500) = $sht(a=>alarm::500) + 1; - } - # 503 - else if(status == "503") { - if($sht(a=>alarm::503) == $null) $sht(a=>alarm::503) = 0; - $sht(a=>alarm::503) = $sht(a=>alarm::503) + 1; - } - # 403 + if($sht(a=>method::total) == $null) $sht(a=>method::total) = 0; + $sht(a=>method::total) = $sht(a=>method::total) + 1; + + if($sht(b=>$rs::$cs::$rm::$ci) != $null) { + #Store + route(STORE); + drop; + } + + $sht(b=>$rs::$cs::$rm::$ci) = 1; + + if($sht(a=>method::all) == $null) $sht(a=>method::all) = 0; + $sht(a=>method::all) = $sht(a=>method::all) + 1; + + #413 Too large + if(status == "413") { + if($sht(a=>response::413) == $null) $sht(a=>response::413) = 0; + $sht(a=>response::413) = $sht(a=>response::413) + 1; + + if($sht(a=>alarm::413) == $null) $sht(a=>alarm::413) = 0; + $sht(a=>alarm::413) = $sht(a=>alarm::413) + 1; + } + #403 Unauthorize else if(status == "403") { - if($sht(a=>alarm::403) == $null) $sht(a=>alarm::403) = 0; - $sht(a=>alarm::403) = $sht(a=>alarm::403) + 1; - } - # MOVED - else if(status =~ "^(30[012])$") { - if($sht(a=>response::300) == $null) $sht(a=>response::300) = 0; - $sht(a=>response::300) = $sht(a=>response::300) + 1; - } + if($sht(a=>response::403) == $null) $sht(a=>response::403) = 0; + $sht(a=>response::403) = $sht(a=>response::403) + 1; - if($rm == "INVITE") { - #ISA - if(status =~ "^(408|50[03])$") { - if($sht(a=>stats::isa) == $null) $sht(a=>stats::isa) = 0; - $sht(a=>stats::isa) = $sht(a=>stats::isa) + 1; + if($sht(a=>alarm::403) == $null) $sht(a=>alarm::403) = 0; + $sht(a=>alarm::403) = $sht(a=>alarm::403) + 1; + } + # Too many hops + else if(status == "483") { + if($sht(a=>response::483) == $null) $sht(a=>response::483) = 0; + $sht(a=>response::483) = $sht(a=>response::483) + 1; + + if($sht(a=>alarm::483) == $null) $sht(a=>alarm::483) = 0; + $sht(a=>alarm::483) = $sht(a=>alarm::483) + 1; + + } + # loops + else if(status == "482") { + if($sht(a=>response::482) == $null) $sht(a=>response::482) = 0; + $sht(a=>response::482) = $sht(a=>response::482) + 1; + + if($sht(a=>alarm::482) == $null) $sht(a=>alarm::482) = 0; + $sht(a=>alarm::482) = $sht(a=>alarm::482) + 1; + + } + # Call Transaction Does not exist + else if(status == "481") { + if($sht(a=>alarm::481) == $null) $sht(a=>alarm::481) = 0; + $sht(a=>alarm::481) = $sht(a=>alarm::481) + 1; + } + # 408 Timeout + else if(status == "408") { + if($sht(a=>alarm::408) == $null) $sht(a=>alarm::408) = 0; + $sht(a=>alarm::408) = $sht(a=>alarm::408) + 1; + } + # 400 + else if(status == "400") { + + if($sht(a=>alarm::400) == $null) $sht(a=>alarm::400) = 0; + $sht(a=>alarm::400) = $sht(a=>alarm::400) + 1; + + } + # MOVED + else if(status =~ "^(30[012])$") { + if($sht(a=>response::300) == $null) $sht(a=>response::300) = 0; + $sht(a=>response::300) = $sht(a=>response::300) + 1; + } + + if($rm == "INVITE") { + #ISA + if(status =~ "^(408|50[03])$") { + if($sht(a=>stats::isa) == $null) $sht(a=>stats::isa) = 0; + $sht(a=>stats::isa) = $sht(a=>stats::isa) + 1; + } + #Bad486 + if(status =~ "^(486|487|603)$") { + if($sht(a=>stats::bad::invite) == $null) $sht(a=>stats::bad::invite) = 0; + $sht(a=>stats::bad::invite) = $sht(a=>stats::bad::invite) + 1; + } + + #SD + if(status =~ "^(50[034])$") { + if($sht(a=>stats::sd) == $null) $sht(a=>stats::sd) = 0; + $sht(a=>stats::sd) = $sht(a=>stats::sd) + 1; + } + + if(status == "407") { + if($sht(a=>response::407::invite) == $null) $sht(a=>response::407::invite)= 0; + $sht(a=>response::407::invite) = $sht(a=>response::407::invite) + 1; + } + else if(status == "401") { + if($sht(a=>response::401::invite) == $null) $sht(a=>response::401::invite)= 0; + $sht(a=>response::401::invite) = $sht(a=>response::401::invite) + 1; + } + else if(status == "200") { + if($sht(a=>response::200::invite) == $null) $sht(a=>response::200::invite)= 0; + $sht(a=>response::200::invite) = $sht(a=>response::200::invite) + 1; + } + #Aditional stats +#!ifdef WITH_STATISTIC_INVITE_1XX + else if(status == "100") { + if($sht(a=>response::100::invite) == $null) $sht(a=>response::100::invite)= 0; + $sht(a=>response::100::invite) = $sht(a=>response::100::invite) + 1; } - #Bad486 - if(status =~ "^(486|487|603)$") { - if($sht(a=>stats::bad::invite) == $null) $sht(a=>stats::bad::invite) = 0; - $sht(a=>stats::bad::invite) = $sht(a=>stats::bad::invite) + 1; + else if(status == "180") { + if($sht(a=>response::180::invite) == $null) $sht(a=>response::180::invite)= 0; + $sht(a=>response::180::invite) = $sht(a=>response::180::invite) + 1; + } + else if(status == "183") { + if($sht(a=>response::183::invite) == $null) $sht(a=>response::183::invite)= 0; + $sht(a=>response::183::invite) = $sht(a=>response::183::invite) + 1; } +#!endif + } + else if($rm == "BYE") { + + if(status == "407") { + if($sht(a=>response::407::bye) == $null) $sht(a=>response::407::bye) = 0; + $sht(a=>response::407::bye) = $sht(a=>response::407::bye) + 1; + } + else if(status == "401") { + if($sht(a=>response::401::bye) == $null) $sht(a=>response::401::bye) = 0; + $sht(a=>response::401::bye) = $sht(a=>response::401::bye) + 1; + } + else if(status == "200") { + if($sht(a=>response::200::bye) == $null) $sht(a=>response::200::bye) = 0; + $sht(a=>response::200::bye) = $sht(a=>response::200::bye) + 1; + } + } + + #Store + route(STORE); + drop; +} - #SD - if(status =~ "^(50[034])$") { - if($sht(a=>stats::sd) == $null) $sht(a=>stats::sd) = 0; - $sht(a=>stats::sd) = $sht(a=>stats::sd) + 1; - } +route[KILL_VICIOUS] { + xlog("Kill-Vicious ! si : $si ru : $ru ua : $ua\n"); + return; +} - if(status == "407") { - if($sht(a=>response::407::invite) == $null) $sht(a=>response::407::invite)= 0; - $sht(a=>response::407::invite) = $sht(a=>response::407::invite) + 1; - } - else if(status == "401") { - if($sht(a=>response::401::invite) == $null) $sht(a=>response::401::invite)= 0; - $sht(a=>response::401::invite) = $sht(a=>response::401::invite) + 1; - } - else if(status == "200") { - if($sht(a=>response::200::invite) == $null) $sht(a=>response::200::invite)= 0; - $sht(a=>response::200::invite) = $sht(a=>response::200::invite) + 1; - } - } - else if($rm == "BYE") { +route[STATS_BY_IP] { + if($sht(c=>$rs::$sel(via[1].host)) == $null) $sht(c=>$rs::$sel(via[1].host)) = 0; + $sht(c=>$rs::$sel(via[1].host)) = $sht(c=>$rs::$sel(via[1].host)) + 1; +} - if(status == "407") { - if($sht(a=>response::407::bye) == $null) $sht(a=>response::407::bye) = 0; - $sht(a=>response::407::bye) = $sht(a=>response::407::bye) + 1; - } - else if(status == "401") { - if($sht(a=>response::401::bye) == $null) $sht(a=>response::401::bye) = 0; - $sht(a=>response::401::bye) = $sht(a=>response::401::bye) + 1; - } - else if(status == "200") { - if($sht(a=>response::200::bye) == $null) $sht(a=>response::200::bye) = 0; - $sht(a=>response::200::bye) = $sht(a=>response::200::bye) + 1; +route[PARSE_STATS_IP] { + sht_iterator_start("i1", "c"); + while(sht_iterator_next("i1")) { + $var(sipcode) = $(shtitkey(i1){s.select,0,:}); + $var(ip) = $(shtitkey(i1){s.select,2,:}); + + if($shtitval(i1) > $avp($var(sipcode))) { + sql_query("cb", "INSERT INTO alarm_data (create_date, type, total, source_ip, description) VALUES(NOW(), 'Too Many $var(sipcode)', $shtitval(i1), '$var(ip)', 'Too Many $var(sipcode)')"); } } + sht_iterator_end("i1"); + sht_rm_name_re("c=>.*"); +} - #sharding - if($rm == "REGISTER") { - $var(table) = "sip_capture_registration"; - } - else if($rm =~ "(INVITE|UPDATE|BYE|ACK|PRACK|REFER)$") - { - $var(table) = "sip_capture_call"; - } - else if($rm =~ "(INFO)$") - { - $var(table) = "sip_capture_call"; - } - else if($rm =~ "(OPTIONS|PUBLISH)$" ) - { - $var(table) = "sip_capture_rest"; - } - else { - $var(table) = "sip_capture_rest"; - } +route[TIMER_STATS] { - $var(a) = $var(table) + "_%Y%m%d"; + #xlog("timer routine: time is $TS\n"); - sip_capture("$var(a)"); + route(CHECK_ALARM); + #Check statistics + route(CHECK_STATS); - drop; } -route[TIMER_STATS] { - - #ALARM SCANNERS - sql_query("cb", "INSERT INTO alarm_data (create_date, type, total, source_ip, description) SELECT create_date, type, total, source_ip, description FROM alarm_data_mem;"); - sql_query("cb", "TRUNCATE TABLE alarm_data_mem"); - - #413 - if($sht(a=>alarm::413) > 0) { - sql_query("cb", "INSERT INTO alarm_data (create_date, type, total, description) VALUES(NOW(), 'Too Many 413', $sht(a=>alarm::413), 'Too many big messages')"); - } +route[SEND_ALARM] { + exec_msg('echo "Value: $var(thvalue), Type: $var(atype), Desc: $var(aname)" | mail -s "Homer Alarm $var(atype) - $var(thvalue)" $var(aemail) ') ; +} - $sht(a=>alarm::413) = 0; +route[CHECK_ALARM] +{ - #483 - if($sht(a=>alarm::483) > 0) { - sql_query("cb", "INSERT INTO alarm_data (create_date, type, total, description) VALUES(NOW(), 'Too Many 483', $sht(a=>alarm::483), 'Too many hops messages')"); - } + #POPULATE ALARM THRESHOLDS + #Homer 5 sql schema + sql_query("cb", "SELECT type,value,name,notify,email FROM alarm_config WHERE NOW() between startdate AND stopdate AND active = 1", "ra"); + if($dbr(ra=>rows)>0) + { + $var(i) = 0; + while($var(i)<$dbr(ra=>rows)) + { + $var(atype) = $dbr(ra=>[$var(i),0]); + $var(avalue) = $dbr(ra=>[$var(i),1]); + $var(aname) = $dbr(ra=>[$var(i),2]); + $var(anotify) = $(dbr(ra=>[$var(i),3]){s.int}); + $var(aemail) = $dbr(ra=>[$var(i),4]); + $avp($var(atype)) = $var(avalue); + + if($sht(a=>alarm::$var(atype)) != $null) { + $var(thvalue) = $sht(a=>alarm::$var(atype)); + } - $sht(a=>alarm::483) = 0; + #If Alarm - go here + if($var(thvalue) > $var(avalue)) { + + sql_query("cb", "INSERT INTO alarm_data (create_date, type, total, description) VALUES(NOW(), '$var(aname)', $var(thvalue), '$var(aname) - $var(atype)');"); + #Notify + if($var(anotify) == 1) { + route(SEND_ALARM); + } + } - #482 - if($sht(a=>alarm::482) > 0) { - sql_query("cb", "INSERT INTO alarm_data (create_date, type, total, description) VALUES(NOW(), 'Too Many 482', $sht(a=>alarm::482), 'Too many loops messages')"); - } + #Alarm for Scanner; + if($var(atype) == "scanner") { + sql_query("cb", "DELETE FROM alarm_data_mem WHERE type='scanner' AND total < $var(avalue)"); + if($var(anotify) == 1) + { + sql_query("cb", "SELECT * FROM alarm_data_mem WHERE type='scanner' AND total >= $var(avalue) LIMIT 2", "rd"); + if($dbr(rd=>rows) > 0) { + route(SEND_ALARM); + } - $sht(a=>alarm::482) = 0; + sql_result_free("rd"); + } + } + + $sht(a=>alarm::$var(atype)) = 0; + $var(i) = $var(i) + 1; + } - #403 - if($sht(a=>alarm::403) > 0) { - sql_query("cb", "INSERT INTO alarm_data (create_date, type, total, description) VALUES(NOW(), 'Too Many 403', $sht(a=>alarm::403), 'fraud alarm')"); } - $sht(a=>alarm::403) = 0; - #503 - if($sht(a=>alarm::503) > 0) { - sql_query("cb", "INSERT INTO alarm_data (create_date, type, total, description) VALUES(NOW(), 'Too Many 503', $sht(a=>alarm::503), 'service unavailable')"); - } - $sht(a=>alarm::503) = 0; - #500 - if($sht(a=>alarm::500) > 0) { - sql_query("cb", "INSERT INTO alarm_data (create_date, type, total, description) VALUES(NOW(), 'Too Many 500', $sht(a=>alarm::500), 'server errors')"); - } - $sht(a=>alarm::500) = 0; + sql_result_free("ra"); - #408 - if($sht(a=>alarm::408) > 0) { - sql_query("cb", "INSERT INTO alarm_data (create_date, type, total, description) VALUES(NOW(), 'Too Many 408', $sht(a=>alarm::408), 'Timeout')"); - } - $sht(a=>alarm::408) = 0; + #if(sql_xquery("cb", "select type,value,name,notify,email from alarm_config WHERE startdate > NOW() AND stopdate < NOW() AND active = 1", "trigger") == 1) { + # $var(i) = 0; + # while($xavp(trigger[$var(i)]) != $null) { + # $avp($xavp(trigger[$var(i)]=>type)) = $xavp(trigger[$var(i)]=>value); + # $avp($xavp(trigger[$var(i)]=>type)+"_notify") = $xavp(trigger[$var(i)]=>notify); + # $avp($xavp(trigger[$var(i)]=>type)+"_email") = $xavp(trigger[$var(i)]=>email); + # $var(i) = $var(i) + 1; + # } + #} - #400 - if($sht(a=>alarm::400) > 0) { - sql_query("cb", "INSERT INTO alarm_data (create_date, type, total, description) VALUES(NOW(), 'Too Many 400', $sht(a=>alarm::400), 'Too many bad request')"); - } - $sht(a=>alarm::400) = 0; + route(PARSE_STATS_IP); #delete old alarms sql_query("cb", "DELETE FROM alarm_data WHERE create_date < DATE_SUB(NOW(), INTERVAL 5 DAY)"); +} - #SQL STATS - $var(tm) = ($time(min) mod 10); +route[CHECK_STATS] { - if($var(tm) != 0 && $var(tm) != 5) return; + #SQL STATS + $var(tm) = ($time(min) mod 10); + if($var(tm) != 0 && $var(tm) != $sel(cfg_get.stats.min)) return; $var(t1) = $TS; - $var(t2) = $var(t1) - 300; + $var(t2) = $var(t1) - ($sel(cfg_get.stats.min)*60); $var(t_date) = "FROM_UNIXTIME(" + $var(t1) + ", '%Y-%m-%d %H:%i:00')"; $var(f_date) = "FROM_UNIXTIME(" + $var(t2) + ", '%Y-%m-%d %H:%i:00')"; + #ALARM SCANNERS + sql_query("cb", "INSERT INTO alarm_data (create_date, type, total, source_ip, description) SELECT create_date, type, total, source_ip, description FROM alarm_data_mem;"); + sql_query("cb", "TRUNCATE TABLE alarm_data_mem"); + #STATS Useragent sql_query("cb", "INSERT INTO stats_useragent (from_date, to_date, useragent, method, total) SELECT $var(f_date) as from_date, $var(t_date) as to_date, useragent, method, total FROM stats_useragent_mem;"); sql_query("cb", "TRUNCATE TABLE stats_useragent_mem"); @@ -432,28 +571,43 @@ route[TIMER_STATS] { sql_query("cb", "INSERT INTO stats_ip (from_date, to_date, method, source_ip, total) SELECT $var(f_date) as from_date, $var(t_date) as to_date, method, source_ip, total FROM stats_ip_mem;"); sql_query("cb", "TRUNCATE TABLE stats_ip_mem"); +#!ifdef WITH_HOMER_GEO + sql_query("cb", "INSERT INTO stats_geo (from_date, to_date, method, country, lat, lon, total) SELECT $var(f_date) as from_date, $var(t_date) as to_date, method, country, lat, lon, total FROM stats_geo_mem;"); + sql_query("cb", "TRUNCATE TABLE stats_geo_mem"); +#!endif + #INSERT SQL STATS + #Packet HEP stats + if($sht(a=>packet::count) != $null && $sht(a=>packet::count) > 0) { + sql_query("cb", "INSERT INTO stats_data (from_date, to_date, type, total) VALUES($var(f_date), $var(t_date), 'packet_count', $sht(a=>packet::count)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>packet::count)"); + $sht(a=>packet::count) = 0; + } + if($sht(a=>packet::size) != $null && $sht(a=>packet::size) > 0) { + sql_query("cb", "INSERT INTO stats_data (from_date, to_date, type, total) VALUES($var(f_date), $var(t_date), 'packet_size', $sht(a=>packet::size)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>packet::size)"); + $sht(a=>packet::size) = 0; + } + #SDF if($sht(a=>stats::sdf) != $null && $sht(a=>stats::sdf) > 0) { - sql_query("cb", "INSERT INTO stats_data (from_date, to_date, type, total) VALUES($var(f_date), $var(t_date), 'sdf', $sht(a=>stats::sdf))"); + sql_query("cb", "INSERT INTO stats_data (from_date, to_date, type, total) VALUES($var(f_date), $var(t_date), 'sdf', $sht(a=>stats::sdf)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>stats::sdf)"); $sht(a=>stats::sdf) = 0; } #ISA if($sht(a=>stats::isa) != $null && $sht(a=>stats::isa) > 0) { - sql_query("cb", "INSERT INTO stats_data (from_date, to_date, type, total) VALUES($var(f_date), $var(t_date), 'isa', $sht(a=>stats::isa))"); + sql_query("cb", "INSERT INTO stats_data (from_date, to_date, type, total) VALUES($var(f_date), $var(t_date), 'isa', $sht(a=>stats::isa)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>stats::isa)"); $sht(a=>stats::isa) = 0; } #SD if($sht(a=>stats::sd) != $null && $sht(a=>stats::sd) > 0) { - sql_query("cb", "INSERT INTO stats_data (from_date, to_date, type, total) VALUES($var(f_date), $var(t_date), 'isa', $sht(a=>stats::sd))"); + sql_query("cb", "INSERT INTO stats_data (from_date, to_date, type, total) VALUES($var(f_date), $var(t_date), 'isa', $sht(a=>stats::sd)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>stats::sd)"); $sht(a=>stats::sd) = 0; } #SSR if($sht(a=>stats::ssr) != $null && $sht(a=>stats::ssr) > 0) { - sql_query("cb", "INSERT INTO stats_data (from_date, to_date, type, total) VALUES($var(f_date), $var(t_date), 'ssr', $sht(a=>stats::ssr))"); + sql_query("cb", "INSERT INTO stats_data (from_date, to_date, type, total) VALUES($var(f_date), $var(t_date), 'ssr', $sht(a=>stats::ssr)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>stats::ssr)"); $sht(a=>stats::ssr) = 0; } @@ -465,13 +619,13 @@ route[TIMER_STATS] { if($sht(a=>response::200::invite) == $null) $sht(a=>response::200::invite) = 0; $var(d) = $sht(a=>method::invite) - $sht(a=>response::407::invite); if($var(d) > 0) { - $var(asr) = $sht(a=>response::200::invite) / $var(d) * 100; + $var(asr) = $sht(a=>response::200::invite) * 100 / $var(d); if($var(asr) > 100) $var(asr) = 100; } } #Stats DATA - sql_query("cb", "INSERT INTO stats_data (from_date, to_date, type, total) VALUES($var(f_date), $var(t_date), 'asr', $var(asr))"); + sql_query("cb", "INSERT INTO stats_data (from_date, to_date, type, total) VALUES($var(f_date), $var(t_date), 'asr', $var(asr)) ON DUPLICATE KEY UPDATE total=(total+$var(asr))/2"); #NER @@ -486,70 +640,84 @@ route[TIMER_STATS] { $var(d) = $sht(a=>method::invite) - $sht(a=>response::407::invite); if($var(d) > 0) { - $var(ner) = ($sht(a=>response::200::invite) + $sht(a=>stats::bad::invite)) / $var(d) * 100; + $var(ner) = ($sht(a=>response::200::invite) + $sht(a=>stats::bad::invite)) * 100 / $var(d); if($var(ner) > 100) $var(ner) = 100; } } - sql_query("cb", "INSERT INTO stats_data (from_date, to_date, type, total) VALUES($var(f_date), $var(t_date), 'ner', $var(ner))"); + sql_query("cb", "INSERT INTO stats_data (from_date, to_date, type, total) VALUES($var(f_date), $var(t_date), 'ner', $var(ner)) ON DUPLICATE KEY UPDATE total=(total+$var(ner))/2"); #INVITE if($sht(a=>method::reinvite) > 0) { - sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, totag, total) VALUES($var(f_date), $var(t_date),'INVITE', 1, $sht(a=>method::reinvite))"); + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, totag, total) VALUES($var(f_date), $var(t_date),'INVITE', 1, $sht(a=>method::reinvite)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>method::reinvite)"); $sht(a=>method::reinvite) = 0; } #INVITE if($sht(a=>method::invite) > 0) { - sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), 'INVITE', $sht(a=>method::invite))"); + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), 'INVITE', $sht(a=>method::invite)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>method::invite)"); $sht(a=>method::invite) = 0; } #INVITE AUTH if($sht(a=>method::invite::auth) > 0) { - sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, auth, total) VALUES($var(f_date), $var(t_date), 'INVITE', 1, $sht(a=>method::invite::auth))"); + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, auth, total) VALUES($var(f_date), $var(t_date), 'INVITE', 1, $sht(a=>method::invite::auth)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>method::invite::auth)"); $sht(a=>method::invite::auth) = 0; } #REGISTER if($sht(a=>method::register) > 0) { - sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), 'REGISTER', $sht(a=>method::register))"); + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), 'REGISTER', $sht(a=>method::register)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>method::register)"); $sht(a=>method::register) = 0; } #REGISTER AUTH if($sht(a=>method::register::auth) > 0) { - sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, auth, total) VALUES($var(f_date), $var(t_date), 'REGISTER', 1, $sht(a=>method::register::auth))"); + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, auth, total) VALUES($var(f_date), $var(t_date), 'REGISTER', 1, $sht(a=>method::register::auth)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>method::register::auth)"); $sht(a=>method::register::auth) = 0; } #BYE if($sht(a=>method::bye) > 0) { - sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), 'BYE', $sht(a=>method::bye))"); + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), 'BYE', $sht(a=>method::bye)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>method::bye)"); $sht(a=>method::bye) = 0; } #CANCEL if($sht(a=>method::cancel) > 0) { - sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), 'CANCEL', $sht(a=>method::cancel))"); + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), 'CANCEL', $sht(a=>method::cancel)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>method::cancel)"); $sht(a=>method::cancel) = 0; } #OPTIONS if($sht(a=>method::options) > 0) { - sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), 'OPTIONS', $sht(a=>method::options))"); + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), 'OPTIONS', $sht(a=>method::options)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>method::options)"); $sht(a=>method::options) = 0; } +#!ifdef WITH_STATISTIC_METHOD_EXTRA + #UNKNOWN + if($sht(a=>method::unknown) > 0) { + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), 'UNKNOWN', $sht(a=>method::unknown)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>method::unknown)"); + $sht(a=>method::unknown) = 0; + } + + #ACK + if($sht(a=>method::ack) > 0) { + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), 'ACK', $sht(a=>method::ack)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>method::ack)"); + $sht(a=>method::ack) = 0; + } +#!endif + #REFER if($sht(a=>method::refer) > 0) { - sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), 'REFER', $sht(a=>method::refer))"); + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), 'REFER', $sht(a=>method::refer)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>method::refer)"); $sht(a=>method::refer) = 0; } #UPDATE if($sht(a=>method::update) > 0) { - sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), 'UPDATE', $sht(a=>method::update))"); + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), 'UPDATE', $sht(a=>method::update)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>method::update)"); $sht(a=>method::update) = 0; } @@ -557,50 +725,180 @@ route[TIMER_STATS] { #300 if($sht(a=>response::300) > 0) { - sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), '300', $sht(a=>response::300))"); + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), '300', $sht(a=>response::300)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>response::300)"); $sht(a=>response::300) = 0; } #407 INVITE if($sht(a=>response::407::invite) > 0) { - sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, cseq, total) VALUES($var(f_date), $var(t_date), '407', 'INVITE', $sht(a=>response::407::invite))"); + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, cseq, total) VALUES($var(f_date), $var(t_date), '407', 'INVITE', $sht(a=>response::407::invite)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>response::407::invite)"); $sht(a=>response::407::invite) = 0; } #401 INVITE if($sht(a=>response::401::invite) > 0) { - sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, cseq, total) VALUES($var(f_date), $var(t_date), '401', 'INVITE', $sht(a=>response::401::invite))"); + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, cseq, total) VALUES($var(f_date), $var(t_date), '401', 'INVITE', $sht(a=>response::401::invite)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>response::401::invite)"); $sht(a=>response::401::invite) = 0; } +#!ifdef WITH_STATISTIC_INVITE_1XX + #100 INVITE + if($sht(a=>response::100::invite) > 0) { + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, cseq, total) VALUES($var(f_date), $var(t_date), '100', 'INVITE', $sht(a=>response::100::invite)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>response::100::invite)"); + $sht(a=>response::100::invite) = 0; + } + + #180 INVITE + if($sht(a=>response::180::invite) > 0) { + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, cseq, total) VALUES($var(f_date), $var(t_date), '180', 'INVITE', $sht(a=>response::180::invite)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>response::180::invite)"); + $sht(a=>response::180::invite) = 0; + } + + #183 INVITE + if($sht(a=>response::183::invite) > 0) { + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, cseq, total) VALUES($var(f_date), $var(t_date), '183', 'INVITE', $sht(a=>response::183::invite)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>response::183::invite)"); + $sht(a=>response::183::invite) = 0; + } + +#!endif + #200 INVITE if($sht(a=>response::200::invite) > 0) { - sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, cseq, total) VALUES($var(f_date), $var(t_date), '200', 'INVITE', $sht(a=>response::200::invite))"); + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, cseq, total) VALUES($var(f_date), $var(t_date), '200', 'INVITE', $sht(a=>response::200::invite)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>response::200::invite)"); $sht(a=>response::200::invite) = 0; } #407 BYE if($sht(a=>response::407::bye) > 0) { - sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, cseq, total) VALUES($var(f_date), $var(t_date), '407', 'BYE', $sht(a=>response::407::bye))"); + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, cseq, total) VALUES($var(f_date), $var(t_date), '407', 'BYE', $sht(a=>response::407::bye)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>response::407::bye)"); $sht(a=>response::407::bye) = 0; } #401 BYE if($sht(a=>response::401::bye) > 0) { - sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, cseq, total) VALUES($var(f_date), $var(t_date), '401', 'BYE', $sht(a=>response::401::bye))"); + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, cseq, total) VALUES($var(f_date), $var(t_date), '401', 'BYE', $sht(a=>response::401::bye)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>response::401::bye)"); $sht(a=>response::401::bye) = 0; } #200 BYE if($sht(a=>response::200::bye) > 0) { - sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, cseq, total) VALUES($var(f_date), $var(t_date), '200', 'BYE', $sht(a=>response::200::bye))"); + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, cseq, total) VALUES($var(f_date), $var(t_date), '200', 'BYE', $sht(a=>response::200::bye)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>response::200::bye)"); $sht(a=>response::200::bye) = 0; } - #ALL MESSAGES + #ALL TRANSACTIONS MESSAGES if($sht(a=>method::all) > 0) { - sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), 'ALL', $sht(a=>method::all))"); + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), 'ALL', $sht(a=>method::all)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>method::all)"); $sht(a=>method::all) = 0; } + + #ALL MESSAGES ON INTERFACE + if($sht(a=>method::total) > 0) { + sql_query("cb", "INSERT INTO stats_method (from_date, to_date, method, total) VALUES($var(f_date), $var(t_date), 'TOTAL', $sht(a=>method::total)) ON DUPLICATE KEY UPDATE total=total+$sht(a=>method::total)"); + $sht(a=>method::total) = 0; + } + +#!ifdef WITH_HOMER_CUSTOM_STATS + #Generic stats + sht_iterator_start("i1", "d"); + while(sht_iterator_next("i1")) { + $var(key) = $(shtitkey(i1){s.select,2,:}); + sql_query("cb", "INSERT INTO stats_generic (from_date, to_date, type, total) VALUES($var(f_date), $var(t_date), '$var(key)', $shtitval(i1)) ON DUPLICATE KEY UPDATE total=(total+$shtitval(i1))/2"); + } + sht_iterator_end("i1"); + sht_rm_name_re("d=>.*"); +#!endif + } + +route[STORE] { + + if($rm == "REGISTER") { + $var(table) = "sip_capture_registration"; + } + else if($rm =~ "(INVITE|UPDATE|BYE|ACK|PRACK|REFER|CANCEL)$") + { + $var(table) = "sip_capture_call"; + } + else if($rm =~ "(NOTIFY)$" && is_present_hf("Event") && $hdr(Event)=~"refer;") + { + $var(table) = "sip_capture_call"; + } + else if($rm =~ "(INFO)$") + { + $var(table) = "sip_capture_call"; + } + else if($rm =~ "(OPTIONS)$" ) + { + $var(table) = "sip_capture_rest"; + } + else { + $var(table) = "sip_capture_rest"; + } + + +#!ifdef KAMAILIO_4_3 + #For old models. Not accurate insert time. System vs capture time. + #$var(utc) = $timef(%Y%m%d); + #as workaround for kamailio < 4.4 + sql_query("cb", "SELECT UTC_DATE()+0;", "ra"); + if($dbr(ra=>rows)>0) { + $var(utc) = $dbr(ra=>[0,0]); + } + sql_result_free("ra"); +#!else + #for Kamailio >=4.4 please uncomment this parameters: + # New utimef can fix the timediff issue. But unfortunately only kamailio 4.4 + $var(utc) = $utimef(%Y%m%d); + # or sipcapture style + #$var(utc) = "%Y%m%d"; +#!endif + + $var(a) = $var(table) + "_" + $var(utc); + sip_capture("$var(a)"); +} + +event_route[sipcapture:request] { + xlog("received sipcapture request from $si:$sp\r\n"); +} + +#!ifdef WITH_HOMER_CUSTOM_STATS +event_route[xhttp:request] { + set_reply_close(); + set_reply_no_connect(); + xlog("L_WARN", "HTTP request received on $Rp, $hu\n"); + if($hu =~ "/api/v1/stats/push") { + #Json is our body + $var(json) = $rb; + jansson_get("type", $var(json), "$var(n)"); + xlog("L_WARN","Type is $var(n)"); + if($var(n) == "rtp_stat") { + $var(i) = 0; + $(avp(x)[0]) = 'interval'; + $(avp(x)[1]) = 'streams'; + $(avp(x)[2]) = 'packets'; + $(avp(x)[3]) = 'lost'; + $(avp(x)[4]) = 'late'; + $(avp(x)[5]) = 'lost_perc'; + $(avp(x)[6]) = 'late_perc'; + $(avp(x)[7]) = 'out_of_seq'; + $(avp(x)[8]) = 'delay_min'; + $(avp(x)[9]) = 'delay_max'; + while(is_avp_set("$(avp(x)[$var(i)])")) { + xlog("L_INFO", "Array value [$var(i)]: $(avp(x)[$var(i)])\n"); + jansson_get("$(avp(x)[$var(i)])", $var(json), "$var(d)"); + $var(n) = $(var(d){s.int}); + if($sht(d=>generic::$(avp(x)[$var(i)])) == $null) $sht(d=>generic::$(avp(x)[$var(i)])) = $var(n); + else $sht(d=>generic::$(avp(x)[$var(i)])) = ($sht(d=>generic::$(avp(x)[$var(i)])) + $var(n))/2; + $var(i) = $var(i) + 1; + } + } + xhttp_reply("200", "Ok", "done", ""); + exit; + } + + xhttp_reply("403", "Forbidden", "", ""); + exit; +} +#!endif diff --git a/modules/sipcapture/hep.c b/modules/sipcapture/hep.c index 6c934dcd324..bbafa5a4b6a 100644 --- a/modules/sipcapture/hep.c +++ b/modules/sipcapture/hep.c @@ -66,6 +66,9 @@ int hep_msg_received(void *data) len = (unsigned *)srevp[1]; ri = (struct receive_info *)srevp[2]; + correlation_id = NULL; + authkey = NULL; + count++; struct hep_hdr *heph; /* hep_hdr */ @@ -100,6 +103,9 @@ int hepv2_received(char *buf, unsigned int len, struct receive_info *ri){ memset(heptime, 0, sizeof(struct hep_timehdr)); struct hep_ip6hdr *hepip6h = NULL; + + correlation_id = NULL; + authkey = NULL; hep_offset = 0; diff --git a/modules/sipcapture/sipcapture.c b/modules/sipcapture/sipcapture.c index 41d153e8c86..425a79b6623 100644 --- a/modules/sipcapture/sipcapture.c +++ b/modules/sipcapture/sipcapture.c @@ -626,13 +626,13 @@ void * capture_mode_init(str *name, str * params) { return n; error: - if (n->name.s){ - pkg_free(n->name.s); - } - if (n->table_names){ - pkg_free(n->table_names); - } if (n){ + if (n->name.s){ + pkg_free(n->name.s); + } + if (n->table_names){ + pkg_free(n->table_names); + } pkg_free(n); } return 0; diff --git a/modules/sipcapture/sql/create_logs_capture.sql b/modules/sipcapture/sql/create_logs_capture.sql deleted file mode 100644 index c9b3bb79f52..00000000000 --- a/modules/sipcapture/sql/create_logs_capture.sql +++ /dev/null @@ -1,25 +0,0 @@ -CREATE TABLE IF NOT EXISTS `logs_capture` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `micro_ts` bigint(18) NOT NULL DEFAULT '0', - `correlation_id` varchar(256) NOT NULL DEFAULT '', - `source_ip` varchar(60) NOT NULL DEFAULT '', - `source_port` int(10) NOT NULL, - `destination_ip` varchar(60) NOT NULL DEFAULT '', - `destination_port` int(10) NOT NULL, - `proto` int(5) NOT NULL, - `family` int(1) DEFAULT NULL, - `type` int(2) NOT NULL, - `node` varchar(125) NOT NULL, - `msg` varchar(2500) NOT NULL, - PRIMARY KEY (`id`,`date`), - KEY `date` (`date`), - KEY `correlationid` (`correlation_id`(255)) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 -/*!50100 PARTITION BY RANGE ( UNIX_TIMESTAMP(`date`)) -(PARTITION p2013082901 VALUES LESS THAN (1377734400) ENGINE = InnoDB, - PARTITION p2013090821 VALUES LESS THAN (1378670400) ENGINE = InnoDB, - PARTITION p2013090822 VALUES LESS THAN (1378674000) ENGINE = InnoDB, - PARTITION p2013090823 VALUES LESS THAN (1378677600) ENGINE = InnoDB, - PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ - diff --git a/modules/sipcapture/sql/create_rtcp_capture.sql b/modules/sipcapture/sql/create_rtcp_capture.sql deleted file mode 100644 index 130c72f3341..00000000000 --- a/modules/sipcapture/sql/create_rtcp_capture.sql +++ /dev/null @@ -1,25 +0,0 @@ -CREATE TABLE IF NOT EXISTS `rtcp_capture` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `micro_ts` bigint(18) NOT NULL DEFAULT '0', - `correlation_id` varchar(256) NOT NULL DEFAULT '', - `source_ip` varchar(60) NOT NULL DEFAULT '', - `source_port` int(10) NOT NULL, - `destination_ip` varchar(60) NOT NULL DEFAULT '', - `destination_port` int(10) NOT NULL, - `proto` int(5) NOT NULL, - `family` int(1) DEFAULT NULL, - `type` int(2) NOT NULL, - `node` varchar(125) NOT NULL, - `msg` varchar(1500) NOT NULL, - PRIMARY KEY (`id`,`date`), - KEY `date` (`date`), - KEY `correlationid` (`correlation_id`(255)) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 -/*!50100 PARTITION BY RANGE ( UNIX_TIMESTAMP(`date`)) -(PARTITION p2013082901 VALUES LESS THAN (1377734400) ENGINE = InnoDB, - PARTITION p2013090821 VALUES LESS THAN (1378670400) ENGINE = InnoDB, - PARTITION p2013090822 VALUES LESS THAN (1378674000) ENGINE = InnoDB, - PARTITION p2013090823 VALUES LESS THAN (1378677600) ENGINE = InnoDB, - PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ - diff --git a/modules/sipcapture/sql/create_sipcapture.sql b/modules/sipcapture/sql/create_sipcapture.sql deleted file mode 100644 index a7c31fa956a..00000000000 --- a/modules/sipcapture/sql/create_sipcapture.sql +++ /dev/null @@ -1,59 +0,0 @@ - -/* this is SQL schema version # 4 */ - -CREATE TABLE IF NOT EXISTS `sip_capture` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `micro_ts` bigint(18) NOT NULL DEFAULT '0', - `method` varchar(50) NOT NULL DEFAULT '', - `reply_reason` varchar(100) NOT NULL, - `ruri` varchar(200) NOT NULL DEFAULT '', - `ruri_user` varchar(100) NOT NULL DEFAULT '', - `ruri_domain` varchar(150) NOT NULL DEFAULT '', - `from_user` varchar(100) NOT NULL DEFAULT '', - `from_domain` varchar(150) NOT NULL DEFAULT '', - `from_tag` varchar(64) NOT NULL DEFAULT '', - `to_user` varchar(100) NOT NULL DEFAULT '', - `to_domain` varchar(150) NOT NULL DEFAULT '', - `to_tag` varchar(64) NOT NULL, - `pid_user` varchar(100) NOT NULL DEFAULT '', - `contact_user` varchar(120) NOT NULL, - `auth_user` varchar(120) NOT NULL, - `callid` varchar(100) NOT NULL DEFAULT '', - `callid_aleg` varchar(100) NOT NULL DEFAULT '', - `via_1` varchar(256) NOT NULL, - `via_1_branch` varchar(80) NOT NULL, - `cseq` varchar(25) NOT NULL, - `diversion` varchar(256) NOT NULL, - `reason` varchar(200) NOT NULL, - `content_type` varchar(256) NOT NULL, - `auth` varchar(256) NOT NULL, - `user_agent` varchar(256) NOT NULL, - `source_ip` varchar(60) NOT NULL DEFAULT '', - `source_port` int(10) NOT NULL, - `destination_ip` varchar(60) NOT NULL DEFAULT '', - `destination_port` int(10) NOT NULL, - `contact_ip` varchar(60) NOT NULL, - `contact_port` int(10) NOT NULL, - `originator_ip` varchar(60) NOT NULL DEFAULT '', - `originator_port` int(10) NOT NULL, - `correlation_id` varchar(256) NOT NULL, - `proto` int(5) NOT NULL, - `family` int(1) DEFAULT NULL, - `rtp_stat` varchar(256) NOT NULL, - `type` int(2) NOT NULL, - `node` varchar(125) NOT NULL, - `msg` varchar(1500) NOT NULL, - PRIMARY KEY (`id`,`date`), - KEY `ruri_user` (`ruri_user`), - KEY `from_user` (`from_user`), - KEY `to_user` (`to_user`), - KEY `pid_user` (`pid_user`), - KEY `auth_user` (`auth_user`), - KEY `callid_aleg` (`callid_aleg`), - KEY `date` (`date`), - KEY `callid` (`callid`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 -PARTITION BY RANGE ( UNIX_TIMESTAMP(`date`) ) ( -PARTITION pmax VALUES LESS THAN (MAXVALUE) -); diff --git a/modules/sipcapture/sql/create_sipcapture_postgress.sql b/modules/sipcapture/sql/create_sipcapture_postgress.sql index fb387a3d399..ab3b48e97eb 100644 --- a/modules/sipcapture/sql/create_sipcapture_postgress.sql +++ b/modules/sipcapture/sql/create_sipcapture_postgress.sql @@ -3,6 +3,7 @@ * Postgress SQL Schema for Sipcapture * Author: Ovind Kolbu * + * UNSUPORTED FOR HOMER5. Please update */ CREATE TABLE sip_capture ( diff --git a/modules/sipcapture/sql/homer_databases.sql b/modules/sipcapture/sql/homer_databases.sql new file mode 100644 index 00000000000..64f2624f483 --- /dev/null +++ b/modules/sipcapture/sql/homer_databases.sql @@ -0,0 +1,3 @@ +CREATE DATABASE homer_data; +CREATE DATABASE homer_configuration; +CREATE DATABASE homer_statistic; diff --git a/modules/sipcapture/sql/homer_user.sql b/modules/sipcapture/sql/homer_user.sql new file mode 100644 index 00000000000..6ccd5e5b52c --- /dev/null +++ b/modules/sipcapture/sql/homer_user.sql @@ -0,0 +1,4 @@ +CREATE USER 'homer_user'@'localhost' IDENTIFIED BY 'homer_password'; +GRANT ALL ON homer_configuration.* TO 'homer_user'@'localhost'; +GRANT ALL ON homer_statistic.* TO 'homer_user'@'localhost'; +GRANT ALL ON homer_data.* TO 'homer_user'@'localhost'; diff --git a/modules/sipcapture/sql/schema_configuration.sql b/modules/sipcapture/sql/schema_configuration.sql new file mode 100644 index 00000000000..54dbf1b7f89 --- /dev/null +++ b/modules/sipcapture/sql/schema_configuration.sql @@ -0,0 +1,185 @@ + +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; + +-- +-- Database: `homer_configuration` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `alias` +-- + +CREATE TABLE IF NOT EXISTS `alias` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `gid` int(5) NOT NULL DEFAULT 0, + `ip` varchar(80) NOT NULL DEFAULT '', + `port` int(10) NOT NULL DEFAULT '0', + `capture_id` varchar(100) NOT NULL DEFAULT '', + `alias` varchar(100) NOT NULL DEFAULT '', + `status` tinyint(1) NOT NULL DEFAULT 0, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `id` (`id`), + UNIQUE KEY `host_2` (`ip`,`port`,`capture_id`), + KEY `host` (`ip`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `alias` +-- + +INSERT INTO `alias` (`id`, `gid`, `ip`, `port`, `capture_id`, `alias`, `status`, `created`) VALUES +(1, 10, '192.168.0.30', 0, 'homer01', 'proxy01', 1, '2014-06-12 20:36:50'), +(2, 10, '192.168.0.4', 0, 'homer01', 'acme-234', 1, '2014-06-12 20:37:01'), +(22, 10, '127.0.0.1:5060', 0, 'homer01', 'sip.local.net', 1, '2014-06-12 20:37:01'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `group` +-- + +CREATE TABLE IF NOT EXISTS `group` ( + `gid` int(10) NOT NULL DEFAULT 0, + `name` varchar(100) NOT NULL DEFAULT '', + UNIQUE KEY `gid` (`gid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `group` +-- + +INSERT INTO `group` (`gid`, `name`) VALUES (10, 'Administrator'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `link_share` +-- + +CREATE TABLE IF NOT EXISTS `link_share` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `uid` int(10) NOT NULL DEFAULT 0, + `uuid` varchar(120) NOT NULL DEFAULT '', + `data` text NOT NULL, + `expire` datetime NOT NULL DEFAULT '2032-12-31 00:00:00', + `active` tinyint(1) NOT NULL DEFAULT '1', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `node` +-- + +CREATE TABLE IF NOT EXISTS `node` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `host` varchar(80) NOT NULL DEFAULT '', + `dbname` varchar(100) NOT NULL DEFAULT '', + `dbport` varchar(100) NOT NULL DEFAULT '', + `dbusername` varchar(100) NOT NULL DEFAULT '', + `dbpassword` varchar(100) NOT NULL DEFAULT '', + `dbtables` varchar(100) NOT NULL DEFAULT 'sip_capture', + `name` varchar(100) NOT NULL DEFAULT '', + `status` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + UNIQUE KEY `id` (`id`), + UNIQUE KEY `host_2` (`host`), + KEY `host` (`host`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `node` +-- + +INSERT INTO `node` (`id`, `host`, `dbname`, `dbport`, `dbusername`, `dbpassword`, `dbtables`, `name`, `status`) VALUES +(1, '127.0.0.1', 'homer_data', '3306', 'homer_user', 'mysql_password', 'sip_capture', 'homer01', 1), +(21, '10.1.0.7', 'homer_data', '3306', 'homer_user', 'mysql_password', 'sip_capture', 'external', 1); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `setting` +-- + +CREATE TABLE IF NOT EXISTS `setting` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `uid` int(10) NOT NULL DEFAULT '0', + `param_name` varchar(120) NOT NULL DEFAULT '', + `param_value` text NOT NULL, + `valid_param_from` datetime NOT NULL DEFAULT '2012-01-01 00:00:00', + `valid_param_to` datetime NOT NULL DEFAULT '2032-12-01 00:00:00', + `param_prio` int(2) NOT NULL DEFAULT '10', + `active` int(1) NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + UNIQUE KEY `uid_2` (`uid`,`param_name`), + KEY `param_name` (`param_name`), + KEY `uid` (`uid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 ; + +-- +-- Dumping data for table `setting` +-- + +INSERT INTO `setting` (`id`, `uid`, `param_name`, `param_value`, `valid_param_from`, `valid_param_to`, `param_prio`, `active`) VALUES +(1, 1, 'timerange', '{"from":"2015-05-26T18:34:42.654Z","to":"2015-05-26T18:44:42.654Z"}', '2012-01-01 00:00:00', '2032-12-01 00:00:00', 10, 1); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `user` +-- + +CREATE TABLE IF NOT EXISTS `user` ( + `uid` int(10) unsigned NOT NULL AUTO_INCREMENT, + `gid` int(10) NOT NULL DEFAULT '10', + `grp` varchar(200) NOT NULL DEFAULT '', + `username` varchar(50) NOT NULL DEFAULT '', + `password` varchar(100) NOT NULL DEFAULT '', + `firstname` varchar(250) NOT NULL DEFAULT '', + `lastname` varchar(250) NOT NULL DEFAULT '', + `email` varchar(250) NOT NULL DEFAULT '', + `department` varchar(100) NOT NULL DEFAULT '', + `regdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `lastvisit` datetime NOT NULL, + `active` tinyint(1) NOT NULL DEFAULT '1', + PRIMARY KEY (`uid`), + UNIQUE KEY `login` (`username`), + UNIQUE KEY `username` (`username`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `user` +-- + +INSERT INTO `user` (`uid`, `gid`, `grp`, `username`, `password`, `firstname`, `lastname`, `email`, `department`, `regdate`, `lastvisit`, `active`) VALUES +(1, 10, 'users,admins', 'admin', PASSWORD('test123'), 'Admin', 'Admin', 'admin@test.com', 'Voice Enginering', '2012-01-19 00:00:00', '2015-05-29 07:17:35', 1), +(2, 10, 'users', 'noc', PASSWORD('123test'), 'NOC', 'NOC', 'noc@test.com', 'Voice NOC', '2012-01-19 00:00:00', '2015-05-29 07:17:35', 1); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `user_menu` +-- + +CREATE TABLE IF NOT EXISTS `user_menu` ( + `id` varchar(125) NOT NULL DEFAULT '', + `name` varchar(100) NOT NULL DEFAULT '', + `alias` varchar(200) NOT NULL DEFAULT '', + `icon` varchar(100) NOT NULL DEFAULT '', + `weight` int(10) NOT NULL DEFAULT '10', + `active` int(1) NOT NULL DEFAULT '1', + UNIQUE KEY `id` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `user_menu` +-- + +INSERT INTO `user_menu` (`id`, `name`, `alias`, `icon`, `weight`, `active`) VALUES +('_1426001444630', 'SIP Search', 'search', 'fa-search', 10, 1), +('_1427728371642', 'Home', 'home', 'fa-home', 1, 1), +('_1431721484444', 'Alarms', 'alarms', 'fa-warning', 20, 1); diff --git a/modules/sipcapture/sql/schema_data.sql b/modules/sipcapture/sql/schema_data.sql new file mode 100644 index 00000000000..f9adbe81240 --- /dev/null +++ b/modules/sipcapture/sql/schema_data.sql @@ -0,0 +1,298 @@ +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `logs_capture` +-- + +CREATE TABLE IF NOT EXISTS `logs_capture` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `micro_ts` bigint(18) NOT NULL DEFAULT '0', + `correlation_id` varchar(256) NOT NULL DEFAULT '', + `source_ip` varchar(60) NOT NULL DEFAULT '', + `source_port` int(10) NOT NULL DEFAULT 0, + `destination_ip` varchar(60) NOT NULL DEFAULT '', + `destination_port` int(10) NOT NULL DEFAULT 0, + `proto` int(5) NOT NULL DEFAULT 0, + `family` int(1) DEFAULT NULL, + `type` int(5) NOT NULL DEFAULT 0, + `node` varchar(125) NOT NULL DEFAULT '', + `msg` varchar(1500) NOT NULL DEFAULT '', + PRIMARY KEY (`id`,`date`), + KEY `date` (`date`), + KEY `correlationid` (`correlation_id`(255)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 +/*!50100 PARTITION BY RANGE ( UNIX_TIMESTAMP(`date`)) +(PARTITION p2013082901 VALUES LESS THAN (1377734400) ENGINE = InnoDB, + PARTITION p2013090821 VALUES LESS THAN (1378670400) ENGINE = InnoDB, + PARTITION p2013090822 VALUES LESS THAN (1378674000) ENGINE = InnoDB, + PARTITION p2013090823 VALUES LESS THAN (1378677600) ENGINE = InnoDB, + PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `report_capture` +-- + +CREATE TABLE IF NOT EXISTS `report_capture` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `micro_ts` bigint(18) NOT NULL DEFAULT '0', + `correlation_id` varchar(256) NOT NULL DEFAULT '', + `source_ip` varchar(60) NOT NULL DEFAULT '', + `source_port` int(10) NOT NULL DEFAULT 0, + `destination_ip` varchar(60) NOT NULL DEFAULT '', + `destination_port` int(10) NOT NULL DEFAULT 0, + `proto` int(5) NOT NULL DEFAULT 0, + `family` int(1) DEFAULT NULL, + `type` int(5) NOT NULL DEFAULT 0, + `node` varchar(125) NOT NULL DEFAULT '', + `msg` varchar(1500) NOT NULL DEFAULT '', + PRIMARY KEY (`id`,`date`), + KEY `date` (`date`), + KEY `correlationid` (`correlation_id`(255)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 +/*!50100 PARTITION BY RANGE ( UNIX_TIMESTAMP(`date`)) +(PARTITION p2013082901 VALUES LESS THAN (1377734400) ENGINE = InnoDB, + PARTITION p2013090821 VALUES LESS THAN (1378670400) ENGINE = InnoDB, + PARTITION p2013090822 VALUES LESS THAN (1378674000) ENGINE = InnoDB, + PARTITION p2013090823 VALUES LESS THAN (1378677600) ENGINE = InnoDB, + PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `rtcp_capture` +-- + +CREATE TABLE IF NOT EXISTS `rtcp_capture` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `micro_ts` bigint(18) NOT NULL DEFAULT '0', + `correlation_id` varchar(256) NOT NULL DEFAULT '', + `source_ip` varchar(60) NOT NULL DEFAULT '', + `source_port` int(10) NOT NULL DEFAULT 0, + `destination_ip` varchar(60) NOT NULL DEFAULT '', + `destination_port` int(10) NOT NULL DEFAULT 0, + `proto` int(5) NOT NULL DEFAULT 0, + `family` int(1) DEFAULT NULL, + `type` int(5) NOT NULL DEFAULT 0, + `node` varchar(125) NOT NULL DEFAULT '', + `msg` varchar(1500) NOT NULL DEFAULT '', + PRIMARY KEY (`id`,`date`), + KEY `date` (`date`), + KEY `correlationid` (`correlation_id`(255)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 +/*!50100 PARTITION BY RANGE ( UNIX_TIMESTAMP(`date`)) +(PARTITION p2013082901 VALUES LESS THAN (1377734400) ENGINE = InnoDB, + PARTITION p2013090821 VALUES LESS THAN (1378670400) ENGINE = InnoDB, + PARTITION p2013090822 VALUES LESS THAN (1378674000) ENGINE = InnoDB, + PARTITION p2013090823 VALUES LESS THAN (1378677600) ENGINE = InnoDB, + PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `sip_capture_call_20150407` +-- + +CREATE TABLE IF NOT EXISTS `sip_capture_call_20150407` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `micro_ts` bigint(18) NOT NULL DEFAULT '0', + `method` varchar(50) NOT NULL DEFAULT '', + `reply_reason` varchar(100) NOT NULL DEFAULT '', + `ruri` varchar(200) NOT NULL DEFAULT '', + `ruri_user` varchar(100) NOT NULL DEFAULT '', + `ruri_domain` varchar(150) NOT NULL DEFAULT '', + `from_user` varchar(100) NOT NULL DEFAULT '', + `from_domain` varchar(150) NOT NULL DEFAULT '', + `from_tag` varchar(64) NOT NULL DEFAULT '', + `to_user` varchar(100) NOT NULL DEFAULT '', + `to_domain` varchar(150) NOT NULL DEFAULT '', + `to_tag` varchar(64) NOT NULL DEFAULT '', + `pid_user` varchar(100) NOT NULL DEFAULT '', + `contact_user` varchar(120) NOT NULL DEFAULT '', + `auth_user` varchar(120) NOT NULL DEFAULT '', + `callid` varchar(120) NOT NULL DEFAULT '', + `callid_aleg` varchar(120) NOT NULL DEFAULT '', + `via_1` varchar(256) NOT NULL DEFAULT '', + `via_1_branch` varchar(80) NOT NULL DEFAULT '', + `cseq` varchar(25) NOT NULL DEFAULT '', + `diversion` varchar(256) NOT NULL DEFAULT '', + `reason` varchar(200) NOT NULL DEFAULT '', + `content_type` varchar(256) NOT NULL DEFAULT '', + `auth` varchar(256) NOT NULL DEFAULT '', + `user_agent` varchar(256) NOT NULL DEFAULT '', + `source_ip` varchar(60) NOT NULL DEFAULT '', + `source_port` int(10) NOT NULL DEFAULT 0, + `destination_ip` varchar(60) NOT NULL DEFAULT '', + `destination_port` int(10) NOT NULL DEFAULT 0, + `contact_ip` varchar(60) NOT NULL DEFAULT '', + `contact_port` int(10) NOT NULL DEFAULT 0, + `originator_ip` varchar(60) NOT NULL DEFAULT '', + `originator_port` int(10) NOT NULL DEFAULT 0, + `correlation_id` varchar(256) NOT NULL DEFAULT '', + `custom_field1` varchar(120) NOT NULL DEFAULT '', + `custom_field2` varchar(120) NOT NULL DEFAULT '', + `custom_field3` varchar(120) NOT NULL DEFAULT '', + `proto` int(5) NOT NULL DEFAULT 0, + `family` int(1) DEFAULT NULL, + `rtp_stat` varchar(256) NOT NULL DEFAULT '', + `type` int(2) NOT NULL DEFAULT 0, + `node` varchar(125) NOT NULL DEFAULT '', + `msg` varchar(1500) NOT NULL DEFAULT '', + PRIMARY KEY (`id`,`date`), + KEY `ruri_user` (`ruri_user`), + KEY `from_user` (`from_user`), + KEY `to_user` (`to_user`), + KEY `pid_user` (`pid_user`), + KEY `auth_user` (`auth_user`), + KEY `callid_aleg` (`callid_aleg`), + KEY `date` (`date`), + KEY `callid` (`callid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 COMMENT='20150407' +/*!50100 PARTITION BY RANGE ( UNIX_TIMESTAMP(`date`)) +(PARTITION p2013082901 VALUES LESS THAN (1377734400) ENGINE = InnoDB, + PARTITION p2013090822 VALUES LESS THAN (1378674000) ENGINE = InnoDB, + PARTITION p2013090823 VALUES LESS THAN (1378677600) ENGINE = InnoDB, + PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `sip_capture_registration_20150407` +-- + +CREATE TABLE IF NOT EXISTS `sip_capture_registration_20150407` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `micro_ts` bigint(18) NOT NULL DEFAULT '0', + `method` varchar(50) NOT NULL DEFAULT '', + `reply_reason` varchar(100) NOT NULL DEFAULT '', + `ruri` varchar(200) NOT NULL DEFAULT '', + `ruri_user` varchar(100) NOT NULL DEFAULT '', + `ruri_domain` varchar(150) NOT NULL DEFAULT '', + `from_user` varchar(100) NOT NULL DEFAULT '', + `from_domain` varchar(150) NOT NULL DEFAULT '', + `from_tag` varchar(64) NOT NULL DEFAULT '', + `to_user` varchar(100) NOT NULL DEFAULT '', + `to_domain` varchar(150) NOT NULL DEFAULT '', + `to_tag` varchar(64) NOT NULL DEFAULT '', + `pid_user` varchar(100) NOT NULL DEFAULT '', + `contact_user` varchar(120) NOT NULL DEFAULT '', + `auth_user` varchar(120) NOT NULL DEFAULT '', + `callid` varchar(120) NOT NULL DEFAULT '', + `callid_aleg` varchar(120) NOT NULL DEFAULT '', + `via_1` varchar(256) NOT NULL DEFAULT '', + `via_1_branch` varchar(80) NOT NULL DEFAULT '', + `cseq` varchar(25) NOT NULL DEFAULT '', + `diversion` varchar(256) NOT NULL DEFAULT '', + `reason` varchar(200) NOT NULL DEFAULT '', + `content_type` varchar(256) NOT NULL DEFAULT '', + `auth` varchar(256) NOT NULL DEFAULT '', + `user_agent` varchar(256) NOT NULL DEFAULT '', + `source_ip` varchar(60) NOT NULL DEFAULT '', + `source_port` int(10) NOT NULL DEFAULT 0, + `destination_ip` varchar(60) NOT NULL DEFAULT '', + `destination_port` int(10) NOT NULL DEFAULT 0, + `contact_ip` varchar(60) NOT NULL DEFAULT '', + `contact_port` int(10) NOT NULL DEFAULT 0, + `originator_ip` varchar(60) NOT NULL DEFAULT '', + `originator_port` int(10) NOT NULL DEFAULT 0, + `correlation_id` varchar(256) NOT NULL DEFAULT '', + `custom_field1` varchar(120) NOT NULL DEFAULT '', + `custom_field2` varchar(120) NOT NULL DEFAULT '', + `custom_field3` varchar(120) NOT NULL DEFAULT '', + `proto` int(5) NOT NULL DEFAULT 0, + `family` int(1) DEFAULT NULL, + `rtp_stat` varchar(256) NOT NULL DEFAULT '', + `type` int(2) NOT NULL DEFAULT 0, + `node` varchar(125) NOT NULL DEFAULT '', + `msg` varchar(1500) NOT NULL DEFAULT '', + PRIMARY KEY (`id`,`date`), + KEY `ruri_user` (`ruri_user`), + KEY `from_user` (`from_user`), + KEY `to_user` (`to_user`), + KEY `pid_user` (`pid_user`), + KEY `auth_user` (`auth_user`), + KEY `callid_aleg` (`callid_aleg`), + KEY `date` (`date`), + KEY `callid` (`callid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 COMMENT='20150407' +/*!50100 PARTITION BY RANGE ( UNIX_TIMESTAMP(`date`)) +(PARTITION p2013082901 VALUES LESS THAN (1377734400) ENGINE = InnoDB, + PARTITION p2013090822 VALUES LESS THAN (1378674000) ENGINE = InnoDB, + PARTITION p2013090823 VALUES LESS THAN (1378677600) ENGINE = InnoDB, + PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `sip_capture_rest_20150407` +-- + +CREATE TABLE IF NOT EXISTS `sip_capture_rest_20150407` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `micro_ts` bigint(18) NOT NULL DEFAULT '0', + `method` varchar(50) NOT NULL DEFAULT '', + `reply_reason` varchar(100) NOT NULL DEFAULT '', + `ruri` varchar(200) NOT NULL DEFAULT '', + `ruri_user` varchar(100) NOT NULL DEFAULT '', + `ruri_domain` varchar(150) NOT NULL DEFAULT '', + `from_user` varchar(100) NOT NULL DEFAULT '', + `from_domain` varchar(150) NOT NULL DEFAULT '', + `from_tag` varchar(64) NOT NULL DEFAULT '', + `to_user` varchar(100) NOT NULL DEFAULT '', + `to_domain` varchar(150) NOT NULL DEFAULT '', + `to_tag` varchar(64) NOT NULL DEFAULT '', + `pid_user` varchar(100) NOT NULL DEFAULT '', + `contact_user` varchar(120) NOT NULL DEFAULT '', + `auth_user` varchar(120) NOT NULL DEFAULT '', + `callid` varchar(120) NOT NULL DEFAULT '', + `callid_aleg` varchar(120) NOT NULL DEFAULT '', + `via_1` varchar(256) NOT NULL DEFAULT '', + `via_1_branch` varchar(80) NOT NULL DEFAULT '', + `cseq` varchar(25) NOT NULL DEFAULT '', + `diversion` varchar(256) NOT NULL DEFAULT '', + `reason` varchar(200) NOT NULL DEFAULT '', + `content_type` varchar(256) NOT NULL DEFAULT '', + `auth` varchar(256) NOT NULL DEFAULT '', + `user_agent` varchar(256) NOT NULL DEFAULT '', + `source_ip` varchar(60) NOT NULL DEFAULT '', + `source_port` int(10) NOT NULL DEFAULT 0, + `destination_ip` varchar(60) NOT NULL DEFAULT '', + `destination_port` int(10) NOT NULL DEFAULT 0, + `contact_ip` varchar(60) NOT NULL DEFAULT '', + `contact_port` int(10) NOT NULL DEFAULT 0, + `originator_ip` varchar(60) NOT NULL DEFAULT '', + `originator_port` int(10) NOT NULL DEFAULT 0, + `correlation_id` varchar(256) NOT NULL DEFAULT '', + `custom_field1` varchar(120) NOT NULL DEFAULT '', + `custom_field2` varchar(120) NOT NULL DEFAULT '', + `custom_field3` varchar(120) NOT NULL DEFAULT '', + `proto` int(5) NOT NULL DEFAULT 0, + `family` int(1) DEFAULT NULL, + `rtp_stat` varchar(256) NOT NULL DEFAULT '', + `type` int(2) NOT NULL DEFAULT 0, + `node` varchar(125) NOT NULL DEFAULT '', + `msg` varchar(1500) NOT NULL DEFAULT '', + PRIMARY KEY (`id`,`date`), + KEY `ruri_user` (`ruri_user`), + KEY `from_user` (`from_user`), + KEY `to_user` (`to_user`), + KEY `pid_user` (`pid_user`), + KEY `auth_user` (`auth_user`), + KEY `callid_aleg` (`callid_aleg`), + KEY `date` (`date`), + KEY `callid` (`callid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 COMMENT='20150407' +/*!50100 PARTITION BY RANGE ( UNIX_TIMESTAMP(`date`)) +(PARTITION p2013082901 VALUES LESS THAN (1377734400) ENGINE = InnoDB, + PARTITION p2013090822 VALUES LESS THAN (1378674000) ENGINE = InnoDB, + PARTITION p2013090823 VALUES LESS THAN (1378677600) ENGINE = InnoDB, + PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ ; diff --git a/modules/sipcapture/sql/schema_statistic.sql b/modules/sipcapture/sql/schema_statistic.sql new file mode 100644 index 00000000000..9e54be1ac0f --- /dev/null +++ b/modules/sipcapture/sql/schema_statistic.sql @@ -0,0 +1,275 @@ + +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO,ALLOW_INVALID_DATES"; + +-- +-- Database: `homer_statistic` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `alarm_config` +-- + +CREATE TABLE IF NOT EXISTS `alarm_config` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(200) NOT NULL DEFAULT '', + `startdate` datetime NOT NULL, + `stopdate` datetime NOT NULL, + `type` varchar(50) CHARACTER SET utf8 NOT NULL DEFAULT '', + `value` int(5) NOT NULL DEFAULT 0, + `notify` tinyint(1) NOT NULL DEFAULT '1', + `email` varchar(200) NOT NULL DEFAULT '', + `createdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `active` int(1) NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + UNIQUE KEY `type` (`type`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `alarm_data` +-- + +CREATE TABLE IF NOT EXISTS `alarm_data` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `type` varchar(50) NOT NULL DEFAULT '', + `total` int(20) NOT NULL DEFAULT 0, + `source_ip` varchar(150) NOT NULL DEFAULT '0.0.0.0', + `description` varchar(256) NOT NULL DEFAULT '', + `status` int(1) NOT NULL DEFAULT '1', + PRIMARY KEY (`id`,`create_date`), + KEY `to_date` (`create_date`), + KEY `method` (`type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 +/*!50100 PARTITION BY RANGE ( UNIX_TIMESTAMP(`create_date`)) +(PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `alarm_data_mem` +-- + +CREATE TABLE IF NOT EXISTS `alarm_data_mem` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `type` varchar(50) NOT NULL DEFAULT '', + `total` int(20) NOT NULL DEFAULT 0, + `source_ip` varchar(150) NOT NULL DEFAULT '0.0.0.0', + `description` varchar(256) NOT NULL DEFAULT '', + `status` int(1) NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + UNIQUE KEY `type` (`type`,`source_ip`), + KEY `to_date` (`create_date`), + KEY `method` (`type`) +) ENGINE=MEMORY DEFAULT CHARSET=latin1 ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `stats_data` +-- + +CREATE TABLE IF NOT EXISTS `stats_data` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `from_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `to_date` timestamp NOT NULL DEFAULT '1971-01-01 00:00:01', + `type` varchar(50) NOT NULL DEFAULT '', + `total` int(20) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`,`from_date`), + UNIQUE KEY `datemethod` (`from_date`,`to_date`,`type`), + KEY `from_date` (`from_date`), + KEY `to_date` (`to_date`), + KEY `method` (`type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 +/*!50100 PARTITION BY RANGE ( UNIX_TIMESTAMP(`from_date`)) +(PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `stats_ip` +-- + +CREATE TABLE IF NOT EXISTS `stats_ip` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `from_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `to_date` timestamp NOT NULL DEFAULT '1971-01-01 00:00:01', + `method` varchar(50) NOT NULL DEFAULT '', + `source_ip` varchar(255) NOT NULL DEFAULT '0.0.0.0', + `total` int(20) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`,`from_date`), + UNIQUE KEY `datemethod` (`from_date`,`to_date`,`method`,`source_ip`), + KEY `from_date` (`from_date`), + KEY `to_date` (`to_date`), + KEY `method` (`method`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 +/*!50100 PARTITION BY RANGE ( UNIX_TIMESTAMP(`from_date`)) +(PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `stats_ip_mem` +-- + +CREATE TABLE IF NOT EXISTS `stats_ip_mem` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `method` varchar(50) NOT NULL DEFAULT '', + `source_ip` varchar(255) NOT NULL DEFAULT '0.0.0.0', + `total` int(20) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + UNIQUE KEY `datemethod` (`method`,`source_ip`) +) ENGINE=MEMORY DEFAULT CHARSET=latin1; + + +-- -------------------------------------------------------- + +-- +-- Table structure for table `stats_geo_mem` +-- + +CREATE TABLE IF NOT EXISTS `stats_geo_mem` ( +`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT , + `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `method` varchar(50) NOT NULL DEFAULT '', + `country` varchar(255) NOT NULL DEFAULT 'UN', + `lat` float NOT NULL DEFAULT '0', + `lon` float NOT NULL DEFAULT '0', + `total` int(20) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `datemethod` (`method`,`country`) +) ENGINE=MEMORY DEFAULT CHARSET=latin1; + + +-- -------------------------------------------------------- + +-- +-- Table structure for table `stats_geo` +-- + +CREATE TABLE IF NOT EXISTS `stats_geo` ( +`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `from_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `to_date` timestamp NOT NULL DEFAULT '1971-01-01 00:00:01', + `method` varchar(50) NOT NULL DEFAULT '', + `country` varchar(255) NOT NULL DEFAULT 'UN', + `lat` float NOT NULL DEFAULT '0', + `lon` float NOT NULL DEFAULT '0', + `total` int(20) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`,`from_date`), + UNIQUE KEY `datemethod` (`from_date`,`to_date`,`method`,`country`), + KEY `from_date` (`from_date`), + KEY `to_date` (`to_date`), + KEY `method` (`method`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 +/*!50100 PARTITION BY RANGE ( UNIX_TIMESTAMP(`from_date`)) +(PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `stats_method` +-- + +CREATE TABLE IF NOT EXISTS `stats_method` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `from_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `to_date` timestamp NOT NULL DEFAULT '1971-01-01 00:00:01', + `method` varchar(50) NOT NULL DEFAULT '', + `auth` tinyint(1) NOT NULL DEFAULT '0', + `cseq` varchar(100) NOT NULL DEFAULT '', + `totag` tinyint(1) NOT NULL DEFAULT 0, + `total` int(20) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`,`from_date`), + UNIQUE KEY `datemethod` (`from_date`,`to_date`,`method`,`auth`,`totag`,`cseq`), + KEY `from_date` (`from_date`), + KEY `to_date` (`to_date`), + KEY `method` (`method`), + KEY `completed` (`cseq`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 +/*!50100 PARTITION BY RANGE ( UNIX_TIMESTAMP(`from_date`)) +(PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `stats_method_mem` +-- + +CREATE TABLE IF NOT EXISTS `stats_method_mem` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `method` varchar(50) NOT NULL DEFAULT '', + `auth` tinyint(1) NOT NULL DEFAULT '0', + `cseq` varchar(100) NOT NULL DEFAULT '', + `totag` tinyint(1) NOT NULL DEFAULT 0, + `total` int(20) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + UNIQUE KEY `datemethod` (`method`,`auth`,`totag`,`cseq`), + KEY `from_date` (`create_date`), + KEY `method` (`method`), + KEY `completed` (`cseq`) +) ENGINE=MEMORY DEFAULT CHARSET=latin1 ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `stats_useragent` +-- + +CREATE TABLE IF NOT EXISTS `stats_useragent` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `from_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `to_date` timestamp NOT NULL DEFAULT '1971-01-01 00:00:01', + `useragent` varchar(100) NOT NULL DEFAULT '', + `method` varchar(50) NOT NULL DEFAULT '', + `total` int(10) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`,`from_date`), + UNIQUE KEY `datemethodua` (`from_date`,`to_date`,`method`,`useragent`), + KEY `from_date` (`from_date`), + KEY `to_date` (`to_date`), + KEY `useragent` (`useragent`), + KEY `method` (`method`), + KEY `total` (`total`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 +/*!50100 PARTITION BY RANGE ( UNIX_TIMESTAMP(`from_date`)) +(PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `stats_useragent_mem` +-- + +CREATE TABLE IF NOT EXISTS `stats_useragent_mem` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `useragent` varchar(100) NOT NULL DEFAULT '', + `method` varchar(50) NOT NULL DEFAULT '', + `total` int(10) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `useragent` (`useragent`,`method`) +) ENGINE=MEMORY DEFAULT CHARSET=latin1 ; + + +CREATE TABLE IF NOT EXISTS `stats_generic` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `from_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `to_date` timestamp NOT NULL DEFAULT '1971-01-01 00:00:01', + `type` varchar(50) NOT NULL DEFAULT '', + `tag` varchar(50) NOT NULL DEFAULT '', + `total` int(20) NOT NULL, + PRIMARY KEY (`id`,`from_date`), + UNIQUE KEY `datemethod` (`from_date`,`to_date`,`type`,`tag`), + KEY `from_date` (`from_date`), + KEY `to_date` (`to_date`), + KEY `method` (`type`,`tag`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 +/*!50100 PARTITION BY RANGE ( UNIX_TIMESTAMP(`from_date`)) +(PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */; + diff --git a/modules/sipcapture/sql/statistics.sql b/modules/sipcapture/sql/statistics.sql deleted file mode 100644 index 33e85425795..00000000000 --- a/modules/sipcapture/sql/statistics.sql +++ /dev/null @@ -1,174 +0,0 @@ --- --- structure for table `alarm_data` --- -DROP TABLE IF EXISTS alarm_data; -CREATE TABLE IF NOT EXISTS `alarm_data` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `create_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `type` varchar(50) NOT NULL DEFAULT '', - `total` int(20) NOT NULL, - `source_ip` varchar(150) NOT NULL DEFAULT '0.0.0.0', - `description` varchar(256) NOT NULL, - `status` int(1) NOT NULL DEFAULT '1', - PRIMARY KEY (`id`), - KEY `to_date` (`create_date`), - KEY `method` (`type`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - --- -------------------------------------------------------- - --- --- Table structure for table `alarm_data_mem` --- -DROP TABLE IF EXISTS alarm_data_mem; -CREATE TABLE IF NOT EXISTS `alarm_data_mem` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `create_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `type` varchar(50) NOT NULL DEFAULT '', - `total` int(20) NOT NULL, - `source_ip` varchar(150) NOT NULL DEFAULT '0.0.0.0', - `description` varchar(256) NOT NULL, - `status` int(1) NOT NULL DEFAULT '1', - PRIMARY KEY (`id`), - UNIQUE KEY `type` (`type`,`source_ip`), - KEY `to_date` (`create_date`), - KEY `method` (`type`) -) ENGINE=MEMORY DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - --- -------------------------------------------------------- - --- --- Table structure for table `stats_data` --- -DROP TABLE IF EXISTS stats_data; - -CREATE TABLE IF NOT EXISTS `stats_data` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `from_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `to_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `type` varchar(50) NOT NULL DEFAULT '', - `total` int(20) NOT NULL, - PRIMARY KEY (`id`), - KEY `from_date` (`from_date`), - KEY `to_date` (`to_date`), - KEY `method` (`type`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - --- -------------------------------------------------------- - --- --- Table structure for table `stats_ip` --- -DROP TABLE IF EXISTS stats_ip; -CREATE TABLE IF NOT EXISTS `stats_ip` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `from_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `to_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `method` varchar(50) NOT NULL DEFAULT '', - `source_ip` varchar(255) NOT NULL DEFAULT '0.0.0.0', - `total` int(20) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `datemethod` (`to_date`,`method`,`source_ip`), - KEY `from_date` (`from_date`), - KEY `to_date` (`to_date`), - KEY `method` (`method`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - --- -------------------------------------------------------- - --- --- Table structure for table `stats_ip_mem` --- -DROP TABLE IF EXISTS stats_ip_mem; -CREATE TABLE IF NOT EXISTS `stats_ip_mem` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `method` varchar(50) NOT NULL DEFAULT '', - `source_ip` varchar(255) NOT NULL DEFAULT '0.0.0.0', - `total` int(20) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `datemethod` (`method`,`source_ip`) -) ENGINE=MEMORY DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - --- -------------------------------------------------------- - --- --- Table structure for table `stats_method` --- -DROP TABLE IF EXISTS stats_method; -CREATE TABLE IF NOT EXISTS `stats_method` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `from_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `to_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `method` varchar(50) NOT NULL DEFAULT '', - `auth` tinyint(1) NOT NULL DEFAULT '0', - `cseq` varchar(100) NOT NULL, - `totag` tinyint(1) NOT NULL, - `total` int(20) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `datemethod` (`to_date`,`method`,`auth`,`totag`,`cseq`), - KEY `from_date` (`from_date`), - KEY `to_date` (`to_date`), - KEY `method` (`method`), - KEY `completed` (`cseq`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - --- -------------------------------------------------------- - --- --- Table structure for table `stats_method_mem` --- -DROP TABLE IF EXISTS stats_method_mem; -CREATE TABLE IF NOT EXISTS `stats_method_mem` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `method` varchar(50) NOT NULL DEFAULT '', - `auth` tinyint(1) NOT NULL DEFAULT '0', - `cseq` varchar(100) NOT NULL, - `totag` tinyint(1) NOT NULL, - `total` int(20) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `datemethod` (`method`,`auth`,`totag`, `cseq`), - KEY `from_date` (`create_date`), - KEY `method` (`method`), - KEY `completed` (`cseq`) -) ENGINE=MEMORY DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - --- -------------------------------------------------------- - --- --- Table structure for table `stats_useragent` --- -DROP TABLE IF EXISTS stats_useragent; -CREATE TABLE IF NOT EXISTS `stats_useragent` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `from_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `to_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `useragent` varchar(100) NOT NULL DEFAULT '', - `method` varchar(50) NOT NULL DEFAULT '', - `total` int(10) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `datemethodua` (`to_date`,`method`,`useragent`), - KEY `from_date` (`from_date`), - KEY `to_date` (`to_date`), - KEY `useragent` (`useragent`), - KEY `method` (`method`), - KEY `total` (`total`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - --- -------------------------------------------------------- - --- --- Table structure for table `stats_useragent_mem` --- -DROP TABLE IF EXISTS stats_useragent_mem; -CREATE TABLE IF NOT EXISTS `stats_useragent_mem` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `useragent` varchar(100) NOT NULL DEFAULT '', - `method` varchar(50) NOT NULL DEFAULT '', - `total` int(10) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `useragent` (`useragent`,`method`) -) ENGINE=MEMORY DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - diff --git a/modules/siptrace/README b/modules/siptrace/README index 7ee26f96325..eb6235f5cf5 100644 --- a/modules/siptrace/README +++ b/modules/siptrace/README @@ -16,9 +16,9 @@ Daniel-Constantin Mierla - Copyright 2010 asipto.com + Copyright © 2010 asipto.com - Copyright 2006 voice-system.ro + Copyright © 2006 voice-system.ro __________________________________________________________________ Table of Contents @@ -144,7 +144,7 @@ Chapter 1. Admin Guide There are two ways of storing information: * by calling the sip_trace() method explicitely in the Kamailio configuration file. In this case the original message is processed. - * by setting the flag equal with the value of "trace_flag" (e.g., + * by setting the flag equal with the value of “trace_flag” (e.g., setflag(__trace_flag__)) parameter of the module. In this case, the message sent forward is processed. The logging mechanism is based on TM/SL callbacks, so only messages processed with the TM module @@ -210,7 +210,7 @@ modparam("siptrace", "db_url", "mysql://user:passwd@host/dbname") Name of the table where to store the SIP messages. - Default value is "sip_trace". + Default value is “sip_trace”. Example 1.2. Set sip_trace parameter ... @@ -242,7 +242,7 @@ modparam("siptrace", "trace_on", 1) 3.5. traced_user_avp (str) The name of the AVP storing the SIP URI of the traced user. If the AVP - is set, messages are stored in database table and the "traced_user" + is set, messages are stored in database table and the “traced_user” column is filled with AVP's value. You can store the message many times for many users by having multiple values for this AVP. @@ -257,10 +257,10 @@ modparam("siptrace", "traced_user_avp", "$avp(s:user)") 3.6. trace_table_avp (str) The name of the AVP storing the name of the table where to store the - SIP messages. If it is not set, the value of "table" parameter is used. + SIP messages. If it is not set, the value of “table” parameter is used. In this way one can select dynamically where to store the traced messages. The table must exists, and must have the same structure as - the "sip_trace" table. + the “sip_trace” table. Default value is "NULL" (feature disabled). @@ -286,7 +286,7 @@ modparam("siptrace", "duplicate_uri", "sip:10.1.1.1:5888") Parameter to enable/disable inserts to the database from this Kamailio. - In case we only want to send the SIP messages to the "duplicate_uri" + In case we only want to send the SIP messages to the “duplicate_uri” and not store the information to the local database we can set this to "0". @@ -299,7 +299,7 @@ modparam("siptrace", "trace_to_database", 0) 3.9. trace_local_ip (str) - The address to be used in "fromip" field for locally generated + The address to be used in “fromip” field for locally generated messages. If not set, the module sets it to the address of the socket that will be used to send the message. @@ -331,9 +331,9 @@ modparam("siptrace", "trace_sl_acks", 0) Parameter to enable/disable writing of x-headers. - Stores "fromip", "toip", "method" and "direction" in "X-Siptrace-*" + Stores “fromip”, “toip”, “method” and “direction” in “X-Siptrace-*” headers. This allows to transmit them to a second Kamailio server using - the "duplicate_uri" feature. Because the headers are added after the + the “duplicate_uri” feature. Because the headers are added after the data is written to the database, the headers only show up in the packets sent by duplicate_uri. @@ -354,7 +354,7 @@ modparam("siptrace", "xheaders_write", 0) Parameter to enable/disable reading of x-headers. - Reads and removes the "X-Siptrace-*" headers. Packets not containing + Reads and removes the “X-Siptrace-*” headers. Packets not containing the headers are neither stored to the database nor relayed (duplicate_uri). See xheaders_write for further information. @@ -378,8 +378,8 @@ modparam("siptrace", "hep_mode_on", 1) 3.14. hep_version (integer) - The parameter indicate the version of the HEP protocol. Can be "1" or - "2". In HEPv2 the timestamp and capture agent ID will be included to + The parameter indicate the version of the HEP protocol. Can be “1” or + “2”. In HEPv2 the timestamp and capture agent ID will be included to HEP header. Default value is "1". @@ -403,8 +403,8 @@ modparam("siptrace", "hep_capture_id", 234) 3.16. trace_delayed (integer) - Use "INSERT DELAYED" to store to database when it is available, instead - of "INSERT". + Use “INSERT DELAYED” to store to database when it is available, instead + of “INSERT”. Default value is 0 (off). @@ -444,7 +444,7 @@ modparam("siptrace", "trace_mode", 1) 4.1. sip_trace([address]) -4.1. sip_trace([address]) +4.1. sip_trace([address]) Store or forward the current processed SIP message in database. It is stored in the form prior applying changes made to it. @@ -469,7 +469,7 @@ sip_trace("sip:10.1.1.2:5085"); 5.1. sip_trace -5.1. sip_trace +5.1. sip_trace Name: sip_trace @@ -478,7 +478,7 @@ sip_trace("sip:10.1.1.2:5085"); + on + off The parameter is optional - if missing, the command will return the - status of the SIP message tracing (as string "on" or "off" ) + status of the SIP message tracing (as string “on” or “off” ) without changing anything. MI FIFO Command Format: @@ -490,7 +490,7 @@ sip_trace("sip:10.1.1.2:5085"); 6.1. siptrace.status param -6.1. siptrace.status param +6.1. siptrace.status param Name: siptrace.status @@ -498,7 +498,7 @@ sip_trace("sip:10.1.1.2:5085"); * on or off: turns on/off SIP message tracing.. Possible values are: + on + off - * "check" does not change siptrace status, just reports the current + * “check” does not change siptrace status, just reports the current status. 7. Database setup diff --git a/modules/siputils/README b/modules/siputils/README index 27b2d265125..d202b8833c0 100644 --- a/modules/siputils/README +++ b/modules/siputils/README @@ -32,11 +32,15 @@ Edited by Jan Janak +Edited by + Bogdan-Andrei Iancu +Edited by + Gabriel Vasile - Copyright 2008, 2005, 2003 1&1 Internet AG, FhG Fokus, Voice Sistem + Copyright © 2008, 2005, 2003 1&1 Internet AG, FhG Fokus, Voice Sistem SRL __________________________________________________________________ @@ -208,7 +212,7 @@ Chapter 1. Admin Guide To answer OPTIONS request directed to your server is the easiest way for is-alive-tests on the SIP (application) layer from remote (similar - to ICMP echo requests, also known as "ping", on the network layer). + to ICMP echo requests, also known as “ping”, on the network layer). 2. Dependencies @@ -242,9 +246,9 @@ Chapter 1. Admin Guide Timeout value in seconds, define how long the call-id is stored in the internal list kept for replacing 183 messages with 180. A reasonable - value is "30". + value is “30”. - Default value is "0". This means functionality is disabled. + Default value is “0”. This means functionality is disabled. Example 1.1. Set ring_timeout parameter ... @@ -255,10 +259,10 @@ modparam("siputils", "ring_timeout", 30) This parameter is the content of the Accept header field. Note: it is not clearly written in RFC3261 if a proxy should accept any content - (the default "*/*") because it does not care about content. Or if it - does not accept any content, which is "". + (the default “*/*”) because it does not care about content. Or if it + does not accept any content, which is “”. - Default value is "*/*". + Default value is “*/*”. Example 1.2. Set options_accept parameter ... @@ -271,7 +275,7 @@ modparam("siputils", "options_accept", "application/*") Please do not change the default value because Kamailio does not support any encodings yet. - Default value is "". + Default value is “”. Example 1.3. Set options_accept_encoding parameter ... @@ -289,7 +293,7 @@ Warning inside username,password or other fields of contact. Otherwise it is possible for the decoding step to fail/produce wrong results. - Default value is "*". + Default value is “*”. Example 1.4. Set contact_flds_separator parameter ... @@ -306,7 +310,7 @@ modparam("siputils", "contact_flds_separator", "-") other devices, but presumably there are not many devices around which support other languages than the default English. - Default value is "en". + Default value is “en”. Example 1.5. Set options_accept_language parameter ... @@ -320,7 +324,7 @@ modparam("siputils", "options_accept_language", "de") Kamailio currently does not support any of the SIP extensions registered at the IANA. - Default value is "". + Default value is “”. Example 1.6. Set options_support parameter ... @@ -332,7 +336,7 @@ modparam("siputils", "options_support", "100rel") Prefix to be added to Remote-Party-ID header field just before the URI returned from either radius or database. - Default value is "". + Default value is “”. Example 1.7. rpid_prefix parameter example modparam("auth", "rpid_prefix", "Whatever <") @@ -342,7 +346,7 @@ modparam("auth", "rpid_prefix", "Whatever <") Suffix to be added to Remote-Party-ID header field after the URI returned from either radius or database. - Default value is ";party=calling;id-type=subscriber;screen=yes". + Default value is “;party=calling;id-type=subscriber;screen=yes”. Example 1.8. rpid_suffix parameter example modparam("auth", "rpid_suffix", "@1.2.3.4>") @@ -356,7 +360,7 @@ modparam("auth", "rpid_suffix", "@1.2.3.4>") If defined to NULL string, all RPID functions will fail at runtime. - Default value is "$avp(s:rpid)". + Default value is “$avp(s:rpid)”. Example 1.9. rpid_avp parameter example modparam("auth", "rpid_avp", "$avp(myrpid)") @@ -393,7 +397,7 @@ modparam("auth", "rpid_avp", "$avp(myrpid)") 4.28. is_first_hop() 4.29. sip_p_charging_vector(flags) -4.1. ring_insert_callid() +4.1. ring_insert_callid() Inserting the call-id in the internal list, which is checked when further replies arrive. Any 183 reply that is received during the @@ -410,14 +414,14 @@ modparam("auth", "rpid_avp", "$avp(myrpid)") ring_insert_callid(); ... -4.2. options_reply() +4.2. options_reply() This function checks if the request method is OPTIONS and if the request URI does not contain an username. If both is true the request - will be answered stateless with "200 OK" and the capabilities from the + will be answered stateless with “200 OK” and the capabilities from the modules parameters. - It sends "500 Server Internal Error" for some errors and returns false + It sends “500 Server Internal Error” for some errors and returns false if it is called for a wrong request. The check for the request method and the missing username is optional @@ -438,7 +442,7 @@ if (uri==myself) { } ... -4.3. is_user(username) +4.3. is_user(username) Check if the username in credentials matches the given username. @@ -454,7 +458,7 @@ if (is_user("john")) { }; ... -4.4. has_totag() +4.4. has_totag() Check if To header field uri contains tag parameter. @@ -467,7 +471,7 @@ if (has_totag()) { }; ... -4.5. uri_param(param) +4.5. uri_param(param) Find if Request URI has a given parameter with no value @@ -483,7 +487,7 @@ if (uri_param("param1")) { }; ... -4.6. uri_param(param,value) +4.6. uri_param(param,value) Find if Request URI has a given parameter with matching value @@ -500,12 +504,12 @@ if (uri_param("param1","value1")) { }; ... -4.7. add_uri_param(param) +4.7. add_uri_param(param) Add to RURI a parameter (name=value); Meaning of the parameters is as follows: - * param - parameter to be appended in "name=value" format. + * param - parameter to be appended in “name=value” format. This function can be used from REQUEST_ROUTE. @@ -514,7 +518,7 @@ if (uri_param("param1","value1")) { add_uri_param("nat=yes"); ... -4.8. get_uri_param(name, var) +4.8. get_uri_param(name, var) Get the value of RURI parameter. @@ -529,7 +533,7 @@ add_uri_param("nat=yes"); get_uri_param("nat", "$var(nat)"); ... -4.9. tel2sip(uri, hostpart, result) +4.9. tel2sip(uri, hostpart, result) Converts URI in first param (pseudo variable or string) to SIP URI, if it is a tel URI. If conversion was done, writes resulting SIP URI to @@ -561,7 +565,7 @@ tel2sip("$ru", $fd", "$ru"); # $ru: sip:+12345678;ext=200;isub=+123-456@foo.com;user=phone ... -4.10. is_e164(pseudo-variable) +4.10. is_e164(pseudo-variable) Checks if string value of pseudo variable argument is an E164 number. @@ -579,7 +583,7 @@ if (is_e164("$avp(i:705)") { }; ... -4.11. is_uri_user_e164(pseudo-variable) +4.11. is_uri_user_e164(pseudo-variable) Checks if userpart of URI stored in pseudo variable is E164 number. @@ -596,7 +600,7 @@ if (is_uri_user_e164("$avp(i:705)") { }; ... -4.12. is_tel_number(tval) +4.12. is_tel_number(tval) Checks if the parameter value is a telephone number: starting with one optional +, followed by digits. The parameter can include variables. @@ -613,7 +617,7 @@ if (is_tel_number("+24242424") { } ... -4.13. is_numeric(tval) +4.13. is_numeric(tval) Checks if the parameter value consists solely of decimal digits. The parameter can include variables. @@ -627,7 +631,7 @@ if (is_numeric($rU)) { # Test if R-URI user consists of decimal digits } ... -4.14. encode_contact(encoding_prefix,hostpart) +4.14. encode_contact(encoding_prefix,hostpart) This function will encode uri-s inside Contact header in the following manner sip:username:password@ip:port;transport=protocol goes @@ -654,7 +658,7 @@ if (is_numeric($rU)) { # Test if R-URI user consists of decimal digits if (src_ip == 10.0.0.0/8) encode_contact("natted_client","1.2.3.4"); ... -4.15. decode_contact() +4.15. decode_contact() This function will decode the request URI. If the RURI is in the format sip:encoding_prefix*username*ip*port*protocol@hostpart it will be @@ -672,7 +676,7 @@ if (src_ip == 10.0.0.0/8) encode_contact("natted_client","1.2.3.4"); if (uri =~ "^sip:natted_client") { decode_contact(); } ... -4.16. decode_contact_header() +4.16. decode_contact_header() This function will decode URIs inside Contact header. If the URI in the format sip:encoding_prefix*username*ip*port*protocol@hostpart it will @@ -694,7 +698,7 @@ reply_route[2] { } ... -4.17. cmp_uri(str1, str2) +4.17. cmp_uri(str1, str2) The function returns true if the two parameters matches as SIP URI. @@ -708,7 +712,7 @@ if(cmp_uri("$ru", "sip:kamailio@kamailio.org")) } ... -4.18. cmp_aor(str1, str2) +4.18. cmp_aor(str1, str2) The function returns true if the two parameters matches as AoR. The parameters have to be SIP URIs. @@ -723,7 +727,7 @@ if(cmp_aor("$rU@KaMaIlIo.org", "sip:kamailio@$fd")) } ... -4.19. append_rpid_hf() +4.19. append_rpid_hf() Appends to the message a Remote-Party-ID header that contains header 'Remote-Party-ID: ' followed by the saved value of the SIP URI received @@ -739,9 +743,9 @@ if(cmp_aor("$rU@KaMaIlIo.org", "sip:kamailio@$fd")) append_rpid_hf(); # Append Remote-Party-ID header field ... -4.20. append_rpid_hf(prefix, suffix) +4.20. append_rpid_hf(prefix, suffix) - This function is the same as Section 4.19, " append_rpid_hf()". The + This function is the same as Section 4.19, “ append_rpid_hf()”. The only difference is that it accepts two parameters--prefix and suffix to be added to Remote-Party-ID header field. This function ignores rpid_prefix and rpid_suffix parameters, instead of that allows to set @@ -764,7 +768,7 @@ append_rpid_hf(); # Append Remote-Party-ID header field append_rpid_hf("", ";party=calling;id-type=subscriber;screen=yes"); ... -4.21. is_rpid_user_e164() +4.21. is_rpid_user_e164() The function checks if the SIP URI received from the database or radius server and will potentially be used in Remote-Party-ID header field @@ -781,7 +785,7 @@ if (is_rpid_user_e164()) { }; ... -4.22. set_uri_user(uri, user) +4.22. set_uri_user(uri, user) Sets userpart of SIP URI stored in writable pseudo variable 'uri' to value of pseudo variable 'user'. @@ -795,7 +799,7 @@ $var(user) = "new_user"; set_uri_user("$var(uri)", "$var(user)"); ... -4.23. set_uri_host(uri, host) +4.23. set_uri_host(uri, host) Sets hostpart of SIP URI stored in writable pseudo variable 'uri' to value of pseudo variable 'host'. @@ -809,7 +813,7 @@ $var(host) = "new_host"; set_uri_host("$var(uri)", "$var(host)"); ... -4.24. is_request() +4.24. is_request() Return true if the SIP message is a request. @@ -822,7 +826,7 @@ if (is_request()) { } ... -4.25. is_reply() +4.25. is_reply() Return true if the SIP message is a reply. @@ -835,7 +839,7 @@ if (is_reply()) { } ... -4.26. is_gruu([uri]) +4.26. is_gruu([uri]) The function returns true if the uri is GRUU ('gr' parameter is present): 1 - pub-gruu; 2 - temp-gruu. @@ -851,7 +855,7 @@ if (is_reply()) { if(is_gruu()) { ... } ... -4.27. is_supported(option) +4.27. is_supported(option) Function returns true if given option is listed in Supported header(s) (if any) of the request. Currently the following options are known: @@ -864,7 +868,7 @@ if(is_gruu()) { ... } if (is_supported("outbound")) { ... } ... -4.28. is_first_hop() +4.28. is_first_hop() The function returns true if the proxy is first hop after the original sender. For incoming SIP requests, it means there is only one Via @@ -881,7 +885,7 @@ if (is_supported("outbound")) { ... } if(is_first_hop()) { ... } ... -4.29. sip_p_charging_vector(flags) +4.29. sip_p_charging_vector(flags) Manage the P-Charging-Vector header (RFC3455). The flags can be: 'r' - remove; 'g' - generate; 'f' - force (remove + generate). diff --git a/modules/siputils/chargingvector.c b/modules/siputils/chargingvector.c index b314e6cdfad..6d020001365 100644 --- a/modules/siputils/chargingvector.c +++ b/modules/siputils/chargingvector.c @@ -13,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -80,7 +80,7 @@ static void sip_generate_charging_vector(char * pcv) if (in->s_addr == LOOPBACK_IP ) { if ( ip.s_addr == 0 ) - { + { ip=*in; } } @@ -105,7 +105,7 @@ static void sip_generate_charging_vector(char * pcv) { if ( idx < 7 ) { - // 3-6 =IP + // 3-6 =IP newConferenceIdentifier[idx]=((ip.s_addr>>(ipx*8))&0xff); ipx++; } @@ -221,13 +221,13 @@ static int sip_get_charging_vector(struct sip_msg *msg, struct hdr_field ** hf_p if ( cmp_hdrname_str(&hf->name, &hdrname) == 0) { - /* + /* * append p charging vector valus after the header name "P-Charging-Vector" and * the ": " (+2) */ char * pcv_body = pcv_buf + strlen(P_CHARGING_VECTOR) + 2; - if (hf->body.len > 0) + if (hf->body.len > 0) { memcpy( pcv_body, hf->body.s, hf->body.len ); pcv.len = hf->body.len + strlen(P_CHARGING_VECTOR) + 2; @@ -265,7 +265,7 @@ static int sip_remove_charging_vector(struct sip_msg *msg, struct hdr_field *hf if ( hf != NULL ) { l=del_lump(msg, hf->name.s-msg->buf, hf->len, 0); - if (l==0) + if (l==0) { LM_ERR("no memory\n"); return -1; @@ -284,7 +284,7 @@ static int sip_add_charging_vector(struct sip_msg *msg) char * s; anchor = anchor_lump(msg, msg->unparsed - msg->buf, 0, 0); - if(anchor == 0) + if(anchor == 0) { LM_ERR("can't get anchor\n"); return -1; @@ -311,7 +311,7 @@ int sip_handle_pcv(struct sip_msg *msg, char *flags, char *str2) int generate_pcv = 0; int remove_pcv = 0; int replace_pcv = 0; - int i; + int i; str flag_str; struct hdr_field * hf_pcv = NULL; @@ -358,7 +358,7 @@ int sip_handle_pcv(struct sip_msg *msg, char *flags, char *str2) if (i <= 0) return i; } - /* Generate PCV if + /* Generate PCV if * - we were asked to generate it and it could not be obtained from the inbound packet * - or if we were asked to replace it alltogether regardless its former value */ @@ -379,8 +379,8 @@ int sip_handle_pcv(struct sip_msg *msg, char *flags, char *str2) sip_generate_charging_vector(pcv_value); - pcv.len = snprintf( pcv_body, PVC_BUF_SIZE - 19, "icid-value=%.*s; icid-generated-at=%.*s\r\n", 32, pcv_value, - msg->rcv.bind_address->address_str.len, + pcv.len = snprintf( pcv_body, PVC_BUF_SIZE - 19, "icid-value=%.*s; icid-generated-at=%.*s\r\n", 32, pcv_value, + msg->rcv.bind_address->address_str.len, msg->rcv.bind_address->address_str.s ); pcv.len += 19; @@ -441,7 +441,7 @@ int pv_get_charging_vector(struct sip_msg *msg, pv_param_t *param, pv_value_t *r break; } - if ( pcv_pv.len > 0 ) + if ( pcv_pv.len > 0 ) return pv_get_strval(msg, param, res, &pcv_pv ); else LM_WARN("No value for pseudo-var $pcv but status was %d.\n", pcv_status); diff --git a/modules/siputils/chargingvector.h b/modules/siputils/chargingvector.h index d2c027f0d70..c171672327b 100644 --- a/modules/siputils/chargingvector.h +++ b/modules/siputils/chargingvector.h @@ -13,12 +13,12 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -/* +/* * Support for rfc3455 P-Charging-Vector * - parse charging vector from SIP message * - generate new unique charging vector diff --git a/modules/siputils/checks.c b/modules/siputils/checks.c index 963032c9403..3858e3d4da7 100644 --- a/modules/siputils/checks.c +++ b/modules/siputils/checks.c @@ -17,8 +17,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -354,15 +354,15 @@ int tel2sip(struct sip_msg* _msg, char* _uri, char* _hostpart, char* _res) return -1; } - /* Remove visual separators before converting to SIP URI. Don't remove - visual separators in TEL URI parameters (after the first ";") */ + /* Remove visual separators before converting to SIP URI. Don't remove + * visual separators in TEL URI parameters (after the first ";") */ for (i=0, j=0; i < uri.len; i++) { if (in_tel_parameters == 0) { if (uri.s[i] == ';') in_tel_parameters = 1; } if (in_tel_parameters == 0) { - if ((uri.s[i] != '-') && (uri.s[i] != '.') && + if ((uri.s[i] != '-') && (uri.s[i] != '.') && (uri.s[i] != '(') && (uri.s[i] != ')')) tel_uri.s[j++] = tolower(uri.s[i]); } else { diff --git a/modules/siputils/checks.h b/modules/siputils/checks.h index f4c9c64baa1..203fbad6d95 100644 --- a/modules/siputils/checks.h +++ b/modules/siputils/checks.h @@ -15,8 +15,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ diff --git a/modules/siputils/config.c b/modules/siputils/config.c index 0c68dcf9261..be4059449ac 100644 --- a/modules/siputils/config.c +++ b/modules/siputils/config.c @@ -18,7 +18,7 @@ */ /*! - * \file + * \file * \brief Siputils :: Configuration * \ingroup Siputils */ diff --git a/modules/siputils/config.h b/modules/siputils/config.h index 2bc4050ab55..455e891b9ff 100644 --- a/modules/siputils/config.h +++ b/modules/siputils/config.h @@ -17,7 +17,7 @@ */ /*! - * \file + * \file * \brief Siputils :: Configuration * \ingroup siputils */ diff --git a/modules/siputils/contact_ops.c b/modules/siputils/contact_ops.c index 60397855c29..a07e1b72b26 100644 --- a/modules/siputils/contact_ops.c +++ b/modules/siputils/contact_ops.c @@ -45,7 +45,7 @@ //#define DEBUG -int + int encode_contact (struct sip_msg *msg, char *encoding_prefix,char *public_ip) { @@ -59,20 +59,20 @@ encode_contact (struct sip_msg *msg, char *encoding_prefix,char *public_ip) /* - * I have a list of contacts in contact->parsed which is of type contact_body_t + * I have a list of contacts in contact->parsed which is of type contact_body_t * inside i have a contact->parsed->contact which is the head of the list of contacts - * inside it is a + * inside it is a * str uri; * struct contact *next; * I just have to visit each uri and encode each uri according to a scheme */ - + if ((msg->contact == NULL)&&((parse_headers(msg,HDR_CONTACT_F,0) == -1) || (msg->contact == NULL) )) - { + { LM_ERR("no Contact header present\n"); return -1; - } + } separator = DEFAULT_SEPARATOR[0]; @@ -90,56 +90,56 @@ encode_contact (struct sip_msg *msg, char *encoding_prefix,char *public_ip) { uri = c->uri; res = encode_uri (uri, encoding_prefix, public_ip,separator, &newUri); - + if (res != 0) - { + { LM_ERR("failed encoding contact.Code %d\n", res); #ifdef STRICT_CHECK return res; #endif - } + } else if (patch (msg, uri.s, uri.len, newUri.s, newUri.len) < 0) { LM_ERR("lumping failed in mangling port \n"); return -2; } - + /* encoding next contacts too?*/ #ifdef ENCODE_ALL_CONTACTS while (c->next != NULL) { c = c->next; uri = c->uri; - + res = encode_uri (uri, encoding_prefix,public_ip,separator,&newUri); if (res != 0) - { + { LM_ERR("failed encode_uri.Code %d\n",res); #ifdef STRICT_CHECK - return res; + return res; #endif - } - else - if (patch (msg, uri.s, uri.len, newUri.s, newUri.len)< 0) - { - LM_ERR("lumping failed in mangling port \n"); - return -3; } + else + if (patch (msg, uri.s, uri.len, newUri.s, newUri.len)< 0) + { + LM_ERR("lumping failed in mangling port \n"); + return -3; + } } /* while */ #endif /* ENCODE_ALL_CONTACTS */ } /* if c != NULL */ } /* end if */ else /* after parsing still NULL */ - { - LM_ERR("unable to parse Contact header\n"); - return -4; - } + { + LM_ERR("unable to parse Contact header\n"); + return -4; + } return 1; } -int + int decode_contact (struct sip_msg *msg,char *unused1,char *unused2) { @@ -153,7 +153,7 @@ decode_contact (struct sip_msg *msg,char *unused1,char *unused2) #ifdef DEBUG fprintf (stdout,"---START--------DECODE CONTACT-----------------\n"); - fprintf (stdout,"%.*s\n",50,msg->buf); + fprintf (stdout,"%.*s\n",50,msg->buf); fprintf (stdout, "INITIAL.s=[%.*s]\n", uri.len, uri.s); #endif @@ -161,22 +161,22 @@ decode_contact (struct sip_msg *msg,char *unused1,char *unused2) if (contact_flds_separator != NULL) if (strlen(contact_flds_separator)>=1) separator = contact_flds_separator[0]; - + if ((msg->new_uri.s == NULL) || (msg->new_uri.len == 0)) { uri = msg->first_line.u.request.uri; - if (uri.s == NULL) + if (uri.s == NULL) return -1; } else { uri = msg->new_uri; } - + res = decode_uri (uri, separator, &newUri); - + #ifdef DEBUG - if (res == 0) + if (res == 0) fprintf (stdout, "newuri.s=[%.*s]\n", newUri.len, newUri.s); #endif if (res != 0) @@ -189,18 +189,18 @@ decode_contact (struct sip_msg *msg,char *unused1,char *unused2) else { /* we do not modify the original first line */ - if ((msg->new_uri.s == NULL) || (msg->new_uri.len == 0)) + if ((msg->new_uri.s == NULL) || (msg->new_uri.len == 0)) msg->new_uri = newUri; else { pkg_free(msg->new_uri.s); msg->new_uri = newUri; - } + } } return 1; } -int + int decode_contact_header (struct sip_msg *msg,char *unused1,char *unused2) { @@ -210,8 +210,8 @@ decode_contact_header (struct sip_msg *msg,char *unused1,char *unused2) str newUri; char separator; int res; - - + + #ifdef DEBUG str* ruri; fprintf (stdout,"---START--------DECODE CONTACT HEADER-----------------\n"); @@ -219,10 +219,10 @@ decode_contact_header (struct sip_msg *msg,char *unused1,char *unused2) if ((msg->contact == NULL)&&((parse_headers(msg,HDR_CONTACT_F,0) == -1) || (msg->contact== NULL) )) - { + { LM_ERR("no Contact header present\n"); return -1; - } + } separator = DEFAULT_SEPARATOR[0]; if (contact_flds_separator != NULL) @@ -237,64 +237,64 @@ decode_contact_header (struct sip_msg *msg,char *unused1,char *unused2) ruri = &msg->first_line.u.request.uri; fprintf (stdout, "INITIAL.s=[%.*s]\n", ruri->len, ruri->s); #endif - + if (msg->contact->parsed == NULL) parse_contact (msg->contact); if (msg->contact->parsed != NULL) { cb = (contact_body_t *) msg->contact->parsed; c = cb->contacts; - // we visit each contact - if (c != NULL) - { - uri = c->uri; + // we visit each contact + if (c != NULL) + { + uri = c->uri; - res = decode_uri (uri, separator, &newUri); + res = decode_uri (uri, separator, &newUri); #ifdef DEBUG - fprintf (stdout, "newuri.s=[%.*s]\n", newUri.len, newUri.s); + fprintf (stdout, "newuri.s=[%.*s]\n", newUri.len, newUri.s); #endif - if (res != 0) - { - LM_ERR("failed decoding contact.Code %d\n", res); + if (res != 0) + { + LM_ERR("failed decoding contact.Code %d\n", res); #ifdef STRICT_CHECK return res; #endif - } - else - if (patch (msg, uri.s, uri.len, newUri.s, newUri.len) < 0) - { - LM_ERR("lumping failed in mangling port \n"); - return -2; - } + } + else + if (patch (msg, uri.s, uri.len, newUri.s, newUri.len) < 0) + { + LM_ERR("lumping failed in mangling port \n"); + return -2; + } #ifdef DECODE_ALL_CONTACTS - while (c->next != NULL) - { - c = c->next; - uri = c->uri; + while (c->next != NULL) + { + c = c->next; + uri = c->uri; - res = decode_uri (uri, separator, &newUri); - if (res != 0) + res = decode_uri (uri, separator, &newUri); + if (res != 0) { - LM_ERR("failed decoding contact.Code %d\n",res); + LM_ERR("failed decoding contact.Code %d\n",res); #ifdef STRICT_CHECK - return res; + return res; #endif } - else - if (patch (msg, uri.s, uri.len, newUri.s, newUri.len) < 0) - { - LM_ERR("lumping failed in mangling port \n"); - return -3; - } - } // end while + else + if (patch (msg, uri.s, uri.len, newUri.s, newUri.len) < 0) + { + LM_ERR("lumping failed in mangling port \n"); + return -3; + } + } // end while #endif - } // if c!= NULL - } // end if - else // after parsing still NULL - { - LM_ERR("unable to parse Contact header\n"); - return -4; - } + } // if c!= NULL + } // end if + else // after parsing still NULL + { + LM_ERR("unable to parse Contact header\n"); + return -4; + } #ifdef DEBUG fprintf (stdout,"---END--------DECODE CONTACT HEADER-----------------\n");fflush(stdout); #endif @@ -304,7 +304,7 @@ decode_contact_header (struct sip_msg *msg,char *unused1,char *unused2) -int + int encode2format (str uri, struct uri_format *format) { int foo; @@ -354,53 +354,52 @@ encode2format (str uri, struct uri_format *format) return foo-10; } - + format->username = sipUri.user; format->password = sipUri.passwd; format->ip = sipUri.host; format->port = sipUri.port; format->protocol = sipUri.transport_val; - -#ifdef DEBUG + +#ifdef DEBUG fprintf (stdout, "transport=[%.*s] transportval=[%.*s]\n", sipUri.transport.len,sipUri.transport.s,sipUri.transport_val.len,sipUri.transport_val.s); fprintf(stdout,"First %d,second %d\n",format->first,format->second); - #endif - +#endif + return 0; } -int + int encode_uri (str uri, char *encoding_prefix, char *public_ip,char separator, str * result) { struct uri_format format; char *pos; int foo,res; - result->s = NULL; result->len = 0; if (uri.len <= 1) return -1; /* no contact or an invalid one */ - if (public_ip == NULL) - { - LM_ERR("invalid NULL value for public_ip parameter\n"); - return -2; - } + if (public_ip == NULL) + { + LM_ERR("invalid NULL value for public_ip parameter\n"); + return -2; + } #ifdef DEBUG fprintf (stdout, "Primit cerere de encodare a [%.*s] cu %s-%s\n", uri.len,uri.s, encoding_prefix, public_ip); #endif fflush (stdout); foo = encode2format (uri, &format); if (foo < 0) - { + { LM_ERR("unable to encode Contact URI [%.*s].Return code %d\n",uri.len,uri.s,foo); return foo - 20; - } + } #ifdef DEBUG fprintf(stdout,"user=%.*s ip=%.*s port=%.*s protocol=%.*s\n",format.username.len,format.username.s,format.ip.len,format.ip.s, - format.port.len,format.port.s,format.protocol.len,format.protocol.s); + format.port.len,format.port.s,format.protocol.len,format.protocol.s); #endif /* a complete uri would be sip:username@ip:port;transport=protocol goes to @@ -418,27 +417,27 @@ encode_uri (str uri, char *encoding_prefix, char *public_ip,char separator, str result->s = pkg_malloc (result->len); pos = result->s; if (pos == NULL) - { + { #ifdef DEBUG - fprintf (stdout, "Unable to alloc result [%d] end=%d\n",result->len, format.second); + fprintf (stdout, "Unable to alloc result [%d] end=%d\n",result->len, format.second); #endif - LM_ERR("unable to alloc pkg memory\n"); - return -3; - } + LM_ERR("unable to alloc pkg memory\n"); + return -3; + } #ifdef DEBUG fprintf (stdout, "[pass=%d][Allocated %d bytes][first=%d][lengthsec=%d]\nAdding [%d] ->%.*s\n",format.password.len,result->len,format.first,uri.len-format.second,format.first, format.first,uri.s);fflush (stdout); #endif - + res = snprintf(pos,result->len,"%.*s%s%c%.*s%c%.*s%c%.*s%c%.*s%c%.*s@",format.first,uri.s,encoding_prefix,separator, - format.username.len,format.username.s,separator,format.password.len,format.password.s, - separator,format.ip.len,format.ip.s,separator,format.port.len,format.port.s,separator,format.protocol.len,format.protocol.s); + format.username.len,format.username.s,separator,format.password.len,format.password.s, + separator,format.ip.len,format.ip.s,separator,format.port.len,format.port.s,separator,format.protocol.len,format.protocol.s); - if ((res < 0 )||(res>result->len)) - { - LM_ERR("unable to construct new uri.\n"); - if (result->s != NULL) pkg_free(result->s); - return -4; - } + if ((res < 0 )||(res>result->len)) + { + LM_ERR("unable to construct new uri.\n"); + if (result->s != NULL) pkg_free(result->s); + return -4; + } #ifdef DEBUG fprintf(stdout,"res= %d\npos=%s\n",res,pos); #endif @@ -447,7 +446,7 @@ encode_uri (str uri, char *encoding_prefix, char *public_ip,char separator, str pos = pos + strlen (public_ip); memcpy (pos, uri.s + format.second, uri.len - format.second); -#ifdef DEBUG +#ifdef DEBUG fprintf (stdout, "Adding2 [%d] ->%.*s\n", uri.len - format.second,uri.len - format.second, uri.s + format.second); fprintf (stdout, "NEW NEW uri is->[%.*s]\n", result->len, result->s); #endif @@ -458,7 +457,7 @@ encode_uri (str uri, char *encoding_prefix, char *public_ip,char separator, str } -int + int decode2format (str uri, char separator, struct uri_format *format) { char *start, *end, *pos,*lastpos; @@ -468,12 +467,12 @@ decode2format (str uri, char separator, struct uri_format *format) //memset (format, 0, sizeof ((struct uri_format))); if (uri.s == NULL) - { + { LM_ERR("invalid parameter uri.It is NULL\n"); return -1; - } + } /* sip:enc_pref*username*password*ip*port*protocol@public_ip */ - + start = memchr (uri.s, ':', uri.len); if (start == NULL) { @@ -482,86 +481,86 @@ decode2format (str uri, char separator, struct uri_format *format) } /* invalid uri */ start = start + 1; /* jumping over sip: ATENTIE LA BUFFER OVERFLOW DACA E DOAR sip: */ format->first = start - uri.s; - + /* start */ end = memchr(start,'@',uri.len-(start-uri.s)); - if (end == NULL) - { + if (end == NULL) + { LM_ERR("invalid SIP uri.Missing @\n"); return -3;/* no host address found */ - } + } #ifdef DEBUG - fprintf (stdout, "Decoding %.*s\n", (int)(long)(end-start), start); + fprintf (stdout, "Decoding %.*s\n", (int)(long)(end-start), start); #endif - + state = EX_PREFIX; lastpos = start; - + for (pos = start;pos0) tmp.s = lastpos; - else tmp.s = NULL; - switch (state) - { - case EX_PREFIX: state = EX_USER;break; - case EX_USER:format->username = tmp;state = EX_PASS;break; - case EX_PASS:format->password = tmp;state = EX_IP;break; - case EX_IP:format->ip = tmp;state = EX_PORT;break; - case EX_PORT:format->port = tmp;state = EX_PROT;break; - default: - { - /* this should not happen, we should find @ not separator */ - return -4; - break; - } - } - - lastpos = pos+1; - - } + /* we copy between lastpos and pos */ + tmp.len = pos - lastpos; + if (tmp.len>0) tmp.s = lastpos; + else tmp.s = NULL; + switch (state) + { + case EX_PREFIX: state = EX_USER;break; + case EX_USER:format->username = tmp;state = EX_PASS;break; + case EX_PASS:format->password = tmp;state = EX_IP;break; + case EX_IP:format->ip = tmp;state = EX_PORT;break; + case EX_PORT:format->port = tmp;state = EX_PROT;break; + default: + { + /* this should not happen, we should find @ not separator */ + return -4; + break; + } + } + + lastpos = pos+1; + } - - + } + + /* we must be in state EX_PROT and protocol is between lastpos and end@ */ if (state != EX_PROT) return -6; format->protocol.len = end - lastpos; if (format->protocol.len>0) format->protocol.s = lastpos; - else format->protocol.s = NULL; + else format->protocol.s = NULL; /* I should check perhaps that after @ there is something */ - + #ifdef DEBUG - fprintf (stdout, "username=%.*s\n", format->username.len,format->username.s); - fprintf (stdout, "password=%.*s\n", format->password.len,format->password.s); - fprintf (stdout, "ip=%.*s\n", format->ip.len, format->ip.s); - fprintf (stdout, "port=%.*s\n", format->port.len,format->port.s); - fprintf (stdout, "protocol=%.*s\n", format->protocol.len,format->protocol.s); + fprintf (stdout, "username=%.*s\n", format->username.len,format->username.s); + fprintf (stdout, "password=%.*s\n", format->password.len,format->password.s); + fprintf (stdout, "ip=%.*s\n", format->ip.len, format->ip.s); + fprintf (stdout, "port=%.*s\n", format->port.len,format->port.s); + fprintf (stdout, "protocol=%.*s\n", format->protocol.len,format->protocol.s); #endif /* looking for the end of public ip */ start = end;/*we are now at @ */ for(pos = start;pos')) { - if ((*pos == ';')||(*pos == '>')) - { - /* found end */ - format->second = pos - uri.s; - return 0; - } + /* found end */ + format->second = pos - uri.s; + return 0; } + } /* if we are here we did not find > or ; */ format->second = uri.len; - return 0; - + return 0; + } -int + int decode_uri (str uri, char separator, str * result) { char *pos; @@ -572,59 +571,59 @@ decode_uri (str uri, char separator, str * result) result->len = 0; if ((uri.len <= 0) || (uri.s == NULL)) - { + { LM_ERR("invalid value for uri\n"); return -1; - } + } foo = decode2format (uri, separator, &format); if (foo < 0) - { + { LM_ERR("failed to decode Contact uri .Error code %d\n",foo); return foo - 20; - } + } /* sanity check */ if (format.ip.len <= 0) - { - LM_ERR("unable to decode host address \n"); - return -2;/* should I quit or ignore ? */ - } + { + LM_ERR("unable to decode host address \n"); + return -2;/* should I quit or ignore ? */ + } if ((format.password.len > 0) && (format.username.len <= 0)) - { - LM_ERR("password decoded but no username available\n"); - return -3; - } - + { + LM_ERR("password decoded but no username available\n"); + return -3; + } + /* a complete uri would be sip:username:password@ip:port;transport=protocol goes to * sip:enc_pref#username#password#ip#port#protocol@public_ip */ result->len = format.first + (uri.len - format.second); /* not NULL terminated */ if (format.username.len > 0) result->len += format.username.len + 1; //: or @ if (format.password.len > 0) result->len += format.password.len + 1; //@ - + /* if (format.ip.len > 0) */ result->len += format.ip.len; - + if (format.port.len > 0) result->len += 1 + format.port.len; //: if (format.protocol.len > 0) result->len += 1 + 10 + format.protocol.len; //;transport= #ifdef DEBUG fprintf (stdout, "Result size is %d.Original Uri size is %d\n",result->len, uri.len); #endif - + /* adding one comes from * */ result->s = pkg_malloc (result->len); if (result->s == NULL) - { - LM_ERR("unable to allocate pkg memory\n"); - return -4; - } + { + LM_ERR("unable to allocate pkg memory\n"); + return -4; + } pos = result->s; #ifdef DEBUG fprintf (stdout, "Adding [%d] ->%.*s\n", format.first, format.first,uri.s);fflush (stdout); #endif memcpy (pos, uri.s, format.first); /* till sip: */ pos = pos + format.first; - + if (format.username.len > 0) { memcpy (pos, format.username.s, format.username.len); @@ -644,9 +643,9 @@ decode_uri (str uri, char separator, str * result) } /* if (format.ip.len > 0) */ - memcpy (pos, format.ip.s, format.ip.len); - pos = pos + format.ip.len; - + memcpy (pos, format.ip.s, format.ip.len); + pos = pos + format.ip.len; + if (format.port.len > 0) { memcpy (pos, ":", 1); diff --git a/modules/siputils/contact_ops.h b/modules/siputils/contact_ops.h index 48a94054bbe..4385fb68f86 100644 --- a/modules/siputils/contact_ops.h +++ b/modules/siputils/contact_ops.h @@ -68,15 +68,11 @@ typedef struct uri_format contact_fields_t; int encode_contact (struct sip_msg *msg, char *encoding_prefix,char *public_ip); int decode_contact (struct sip_msg *msg, char *unused1,char *unused2); int decode_contact_header (struct sip_msg *msg, char *unused1,char *unused2); - + int encode2format (str uri, struct uri_format *format); int decode2format (str uri, char separator, struct uri_format *format); int encode_uri (str uri, char *encoding_prefix, char *public_ip,char separator, str * result); int decode_uri (str uri, char separator, str * result); - - - - #endif diff --git a/modules/siputils/options.c b/modules/siputils/options.c index b7b7e29d22e..f95ca9bc073 100644 --- a/modules/siputils/options.c +++ b/modules/siputils/options.c @@ -62,7 +62,7 @@ int opt_reply(struct sip_msg* _msg, char* _foo, char* _bar) { } /* calculate the length and allocated the mem */ - rpl_hf.len = ACPT_STR_LEN + ACPT_ENC_STR_LEN + ACPT_LAN_STR_LEN + + rpl_hf.len = ACPT_STR_LEN + ACPT_ENC_STR_LEN + ACPT_LAN_STR_LEN + SUPT_STR_LEN + 4*HF_SEP_STR_LEN + opt_accept.len + opt_accept_enc.len + opt_accept_lang.len + opt_supported.len; rpl_hf.s = (char*)pkg_malloc(rpl_hf.len); diff --git a/modules/siputils/ring.c b/modules/siputils/ring.c index a6b6919756f..10ffe698157 100644 --- a/modules/siputils/ring.c +++ b/modules/siputils/ring.c @@ -155,7 +155,7 @@ static unsigned int hash(char *buf, int len) unsigned int retval = 0; MD5_CTX md5context; char digest[16]; - + MD5Init(&md5context); MD5Update(&md5context, buf, len); MD5Final(digest, &md5context); @@ -196,7 +196,7 @@ static void insert(str callid) { unsigned int index = hash(callid.s, callid.len) & HASHTABLEMASK; struct ring_record_t* rr; - + remove_timeout(index); rr = shm_malloc(sizeof(struct ring_record_t)); assert(rr); @@ -261,7 +261,7 @@ static int conv183(struct sip_msg *msg) char *chunk3_start; int chunk3_len; char *chunk3_dst; - + if (del1_start>del2_start) { char *tmp = del1_start; del1_start = del2_start; diff --git a/modules/siputils/rpid.c b/modules/siputils/rpid.c index 3d5259b8123..53c320d9080 100644 --- a/modules/siputils/rpid.c +++ b/modules/siputils/rpid.c @@ -13,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -97,7 +97,7 @@ void get_rpid_avp( int_str *rpid_avp_p, int *rpid_avp_type_p ) /*! * \brief Check if user is a E164 number - * \param _user user + * \param _user user * \note Copy of is_e164 from enum module * \return 1 if its a E164 number, -1 if not */ @@ -105,7 +105,7 @@ static inline int is_e164(str* _user) { int i; char c; - + if ((_user->len > 2) && (_user->len < 17) && ((_user->s)[0] == '+')) { for (i = 1; i < _user->len; i++) { c = (_user->s)[i]; @@ -113,7 +113,7 @@ static inline int is_e164(str* _user) } return 1; } else { - return -1; + return -1; } } @@ -128,18 +128,18 @@ static inline int is_e164(str* _user) static inline int append_rpid_helper(struct sip_msg* _m, str *_s) { struct lump* anchor; - + if (parse_headers(_m, HDR_EOH_F, 0) == -1) { LM_ERR("failed to parse message\n"); return -1; } - + anchor = anchor_lump(_m, _m->unparsed - _m->buf, 0, 0); if (!anchor) { LM_ERR("can't get anchor\n"); return -2; } - + if (!insert_new_lump_before(anchor, _s->s, _s->len, 0)) { LM_ERR("can't insert lump\n"); return -3; @@ -321,8 +321,8 @@ int is_rpid_user_e164(struct sip_msg* _m, char* _s1, char* _s2) } if (parse_uri(tmp.s, tmp.len, &uri) < 0) { - LM_ERR("failed to parse RPID URI\n"); - goto err; + LM_ERR("failed to parse RPID URI\n"); + goto err; } return is_e164(&uri.user); diff --git a/modules/siputils/rpid.h b/modules/siputils/rpid.h index 77f726f091c..dc872d74443 100644 --- a/modules/siputils/rpid.h +++ b/modules/siputils/rpid.h @@ -13,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ diff --git a/modules/siputils/sipops.c b/modules/siputils/sipops.c index 9750f713a47..060568901e1 100644 --- a/modules/siputils/sipops.c +++ b/modules/siputils/sipops.c @@ -90,7 +90,7 @@ int w_cmp_aor(struct sip_msg *msg, char *uri1, char *uri2) int w_is_gruu(sip_msg_t *msg, char *uri1, char *p2) { - str s1, *s2; + str s1, *s2; sip_uri_t turi; sip_uri_t *puri; @@ -102,15 +102,15 @@ int w_is_gruu(sip_msg_t *msg, char *uri1, char *p2) return -8; } if(parse_uri(s1.s, s1.len, &turi)!=0) { - LM_ERR("parsing of uri '%.*s' failed\n", s1.len, s1.s); - return -1; + LM_ERR("parsing of uri '%.*s' failed\n", s1.len, s1.s); + return -1; } puri = &turi; } else { - if(parse_sip_msg_uri(msg)<0) { - s2 = GET_RURI(msg); - LM_ERR("parsing of uri '%.*s' failed\n", s2->len, s2->s); - return -1; + if(parse_sip_msg_uri(msg)<0) { + s2 = GET_RURI(msg); + LM_ERR("parsing of uri '%.*s' failed\n", s2->len, s2->s); + return -1; } puri = &msg->parsed_uri; } diff --git a/modules/siputils/siputils.c b/modules/siputils/siputils.c index 08692f37e8a..7bc47c5895b 100644 --- a/modules/siputils/siputils.c +++ b/modules/siputils/siputils.c @@ -31,27 +31,27 @@ * \defgroup siputils SIPUTILS :: Various SIP message handling functions * * - This module implement various functions and checks related to - SIP message handling and URI handling. - - It offers some functions related to handle ringing. In a - parallel forking scenario you get several 183s with SDP. You - don't want that your customers hear more than one ringtone or - answer machine in parallel on the phone. So its necessary to - drop the 183 in this cases and send a 180 instead. - - This module provides a function to answer OPTIONS requests - which are directed to the server itself. This means an OPTIONS - request which has the address of the server in the request - URI, and no username in the URI. The request will be answered - with a 200 OK which the capabilities of the server. - - To answer OPTIONS request directed to your server is the - easiest way for is-alive-tests on the SIP (application) layer - from remote (similar to ICMP echo requests, also known as - "ping", on the network layer). + * This module implement various functions and checks related to + * SIP message handling and URI handling. + * + * It offers some functions related to handle ringing. In a + * parallel forking scenario you get several 183s with SDP. You + * don't want that your customers hear more than one ringtone or + * answer machine in parallel on the phone. So its necessary to + * drop the 183 in this cases and send a 180 instead. + * + * This module provides a function to answer OPTIONS requests + * which are directed to the server itself. This means an OPTIONS + * request which has the address of the server in the request + * URI, and no username in the URI. The request will be answered + * with a 200 OK which the capabilities of the server. + * + * To answer OPTIONS request directed to your server is the + * easiest way for is-alive-tests on the SIP (application) layer + * from remote (similar to ICMP echo requests, also known as + * "ping", on the network layer). - */ +*/ #include @@ -132,10 +132,10 @@ static cmd_export_t cmds[]={ 0, REQUEST_ROUTE|LOCAL_ROUTE}, {"add_uri_param", (cmd_function)add_uri_param, 1, fixup_str_null, 0, REQUEST_ROUTE}, - {"get_uri_param", (cmd_function)get_uri_param, 2, fixup_get_uri_param, + {"get_uri_param", (cmd_function)get_uri_param, 2, fixup_get_uri_param, free_fixup_get_uri_param, REQUEST_ROUTE|LOCAL_ROUTE}, {"tel2sip", (cmd_function)tel2sip, 3, fixup_tel2sip, 0, - REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE}, + REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE}, {"is_e164", (cmd_function)is_e164, 1, fixup_pvar_null, fixup_free_pvar_null, REQUEST_ROUTE|FAILURE_ROUTE|LOCAL_ROUTE}, {"is_uri_user_e164", (cmd_function)w_is_uri_user_e164, 1, fixup_pvar_null, @@ -151,21 +151,21 @@ static cmd_export_t cmds[]={ {"cmp_aor", (cmd_function)w_cmp_aor, 2, fixup_spve_spve, 0, ANY_ROUTE}, {"is_rpid_user_e164", (cmd_function)is_rpid_user_e164, 0, 0, - 0, REQUEST_ROUTE}, + 0, REQUEST_ROUTE}, {"append_rpid_hf", (cmd_function)append_rpid_hf, 0, 0, - 0, REQUEST_ROUTE|BRANCH_ROUTE|FAILURE_ROUTE}, + 0, REQUEST_ROUTE|BRANCH_ROUTE|FAILURE_ROUTE}, {"append_rpid_hf", (cmd_function)append_rpid_hf_p, 2, fixup_str_str, - 0, REQUEST_ROUTE|BRANCH_ROUTE|FAILURE_ROUTE}, + 0, REQUEST_ROUTE|BRANCH_ROUTE|FAILURE_ROUTE}, {"set_uri_user", (cmd_function)set_uri_user, 2, fixup_set_uri, - fixup_free_set_uri, ANY_ROUTE}, + fixup_free_set_uri, ANY_ROUTE}, {"set_uri_host", (cmd_function)set_uri_host, 2, fixup_set_uri, - fixup_free_set_uri, ANY_ROUTE}, + fixup_free_set_uri, ANY_ROUTE}, {"bind_siputils", (cmd_function)bind_siputils, 1, 0, - 0, 0}, + 0, 0}, {"is_request", (cmd_function)w_is_request, 0, 0, - 0, ANY_ROUTE}, + 0, ANY_ROUTE}, {"is_reply", (cmd_function)w_is_reply, 0, 0, - 0, ANY_ROUTE}, + 0, ANY_ROUTE}, {"is_gruu", (cmd_function)w_is_gruu, 0, 0, 0, ANY_ROUTE}, {"is_gruu", (cmd_function)w_is_gruu, 1, fixup_spve_null, @@ -197,7 +197,7 @@ static param_export_t params[] = { }; - static pv_export_t mod_pvs[] = { +static pv_export_t mod_pvs[] = { { {"pcv", (sizeof("pvc")-1)}, PVT_OTHER, pv_get_charging_vector, 0, pv_parse_charging_vector_name, 0, 0, 0}, @@ -242,7 +242,7 @@ static int mod_init(void) LM_ERR("cannot bind to SL API\n"); return -1; } - + if ( init_rpid_avp(rpid_avp_param)<0 ) { LM_ERR("failed to init rpid AVP name\n"); return -1; @@ -293,24 +293,24 @@ int bind_siputils(siputils_api_t* api) */ static int fixup_set_uri(void** param, int param_no) { - if (param_no == 1) { - if (fixup_pvar_null(param, 1) != 0) { - LM_ERR("failed to fixup uri pvar\n"); - return -1; - } - if (((pv_spec_t *)(*param))->setf == NULL) { - LM_ERR("uri pvar is not writeble\n"); - return -1; + if (param_no == 1) { + if (fixup_pvar_null(param, 1) != 0) { + LM_ERR("failed to fixup uri pvar\n"); + return -1; + } + if (((pv_spec_t *)(*param))->setf == NULL) { + LM_ERR("uri pvar is not writeble\n"); + return -1; + } + return 0; } - return 0; - } - if (param_no == 2) { - return fixup_pvar_null(param, 1); - } + if (param_no == 2) { + return fixup_pvar_null(param, 1); + } - LM_ERR("invalid parameter number <%d>\n", param_no); - return -1; + LM_ERR("invalid parameter number <%d>\n", param_no); + return -1; } /* @@ -318,7 +318,7 @@ static int fixup_set_uri(void** param, int param_no) */ static int fixup_free_set_uri(void** param, int param_no) { - return fixup_free_pvar_null(param, 1); + return fixup_free_pvar_null(param, 1); } @@ -328,28 +328,28 @@ static int fixup_free_set_uri(void** param, int param_no) */ static int fixup_tel2sip(void** param, int param_no) { - if ((param_no == 1) || (param_no == 2)) { - if (fixup_var_str_12(param, 1) < 0) { - LM_ERR("failed to fixup uri or hostpart pvar\n"); - return -1; + if ((param_no == 1) || (param_no == 2)) { + if (fixup_var_str_12(param, 1) < 0) { + LM_ERR("failed to fixup uri or hostpart pvar\n"); + return -1; + } + return 0; } - return 0; - } - if (param_no == 3) { - if (fixup_pvar_null(param, 1) != 0) { - LM_ERR("failed to fixup result pvar\n"); - return -1; - } - if (((pv_spec_t *)(*param))->setf == NULL) { - LM_ERR("result pvar is not writeble\n"); - return -1; + if (param_no == 3) { + if (fixup_pvar_null(param, 1) != 0) { + LM_ERR("failed to fixup result pvar\n"); + return -1; + } + if (((pv_spec_t *)(*param))->setf == NULL) { + LM_ERR("result pvar is not writeble\n"); + return -1; + } + return 0; } - return 0; - } - LM_ERR("invalid parameter number <%d>\n", param_no); - return -1; + LM_ERR("invalid parameter number <%d>\n", param_no); + return -1; } /* */ @@ -389,65 +389,65 @@ static int free_fixup_get_uri_param(void** param, int param_no) { /* */ static int fixup_option(void** param, int param_no) { - char *option; - unsigned int option_len, res; + char *option; + unsigned int option_len, res; - option = (char *)*param; - option_len = strlen(option); + option = (char *)*param; + option_len = strlen(option); - if (param_no != 1) { - LM_ERR("invalid parameter number <%d>\n", param_no); - return -1; - } - - switch (option_len) { - case 4: - if (strncasecmp(option, "path", 4) == 0) - res = F_OPTION_TAG_PATH; - else if (strncasecmp(option, "gruu", 4) == 0) - res = F_OPTION_TAG_GRUU; - else { - LM_ERR("unknown option <%s>\n", option); - return -1; - } - break; - case 5: - if (strncasecmp(option, "timer", 5) == 0) - res = F_OPTION_TAG_TIMER; - else { - LM_ERR("unknown option <%s>\n", option); - return -1; - } - break; - case 6: - if (strncasecmp(option, "100rel", 6) == 0) - res = F_OPTION_TAG_100REL; - else { - LM_ERR("unknown option <%s>\n", option); - return -1; - } - break; - case 8: - if (strncasecmp(option, "outbound", 8) == 0) - res = F_OPTION_TAG_OUTBOUND; - else { - LM_ERR("unknown option <%s>\n", option); - return -1; + if (param_no != 1) { + LM_ERR("invalid parameter number <%d>\n", param_no); + return -1; } - break; - case 9: - if (strncasecmp(option, "eventlist", 9) == 0) - res = F_OPTION_TAG_EVENTLIST; - else { - LM_ERR("unknown option <%s>\n", option); - return -1; + + switch (option_len) { + case 4: + if (strncasecmp(option, "path", 4) == 0) + res = F_OPTION_TAG_PATH; + else if (strncasecmp(option, "gruu", 4) == 0) + res = F_OPTION_TAG_GRUU; + else { + LM_ERR("unknown option <%s>\n", option); + return -1; + } + break; + case 5: + if (strncasecmp(option, "timer", 5) == 0) + res = F_OPTION_TAG_TIMER; + else { + LM_ERR("unknown option <%s>\n", option); + return -1; + } + break; + case 6: + if (strncasecmp(option, "100rel", 6) == 0) + res = F_OPTION_TAG_100REL; + else { + LM_ERR("unknown option <%s>\n", option); + return -1; + } + break; + case 8: + if (strncasecmp(option, "outbound", 8) == 0) + res = F_OPTION_TAG_OUTBOUND; + else { + LM_ERR("unknown option <%s>\n", option); + return -1; + } + break; + case 9: + if (strncasecmp(option, "eventlist", 9) == 0) + res = F_OPTION_TAG_EVENTLIST; + else { + LM_ERR("unknown option <%s>\n", option); + return -1; + } + break; + default: + LM_ERR("unknown option <%s>\n", option); + return -1; } - break; - default: - LM_ERR("unknown option <%s>\n", option); - return -1; - } - *param = (void *)(long)res; - return 0; + *param = (void *)(long)res; + return 0; } diff --git a/modules/siputils/siputils.h b/modules/siputils/siputils.h index f8b9d79c2d7..e3af5cf8e3b 100644 --- a/modules/siputils/siputils.h +++ b/modules/siputils/siputils.h @@ -45,13 +45,13 @@ int bind_siputils(siputils_api_t* api); inline static int siputils_load_api(siputils_api_t *pxb) { - bind_siputils_t bind_siputils_exports; - if (!(bind_siputils_exports = (bind_siputils_t)find_export("bind_siputils", 1, 0))) - { - LM_ERR("Failed to import bind_siputils\n"); - return -1; - } - return bind_siputils_exports(pxb); + bind_siputils_t bind_siputils_exports; + if (!(bind_siputils_exports = (bind_siputils_t)find_export("bind_siputils", 1, 0))) + { + LM_ERR("Failed to import bind_siputils\n"); + return -1; + } + return bind_siputils_exports(pxb); } #endif diff --git a/modules/siputils/utils.c b/modules/siputils/utils.c index 8b39ae58632..9b71cd9d9b3 100644 --- a/modules/siputils/utils.c +++ b/modules/siputils/utils.c @@ -41,7 +41,7 @@ int patch (struct sip_msg *msg, char *oldstr, unsigned int oldlen, char *newstr, - unsigned int newlen) + unsigned int newlen) { int off; struct lump *anchor; @@ -105,8 +105,7 @@ patch_content_length (struct sip_msg *msg, unsigned int newValue) } memcpy (s, pos, len); /* perhaps we made it and no one called int2str,might use sprintf */ - if (patch - (msg, contentLength->body.s, contentLength->body.len, s, len) < 0) + if (patch(msg, contentLength->body.s, contentLength->body.len, s, len)<0) { pkg_free (s); LM_ERR("lumping failed\n"); diff --git a/modules/siputils/utils.h b/modules/siputils/utils.h index 1f99ed97cd8..2715d40bd32 100644 --- a/modules/siputils/utils.h +++ b/modules/siputils/utils.h @@ -34,22 +34,22 @@ #include "../../parser/msg_parser.h" /* struct sip_msg */ -/* replace a part of a sip message identified by (start address,length) with a new part +/* replace a part of a sip message identified by (start address,length) with a new part @param msg a pointer to a sip message @param oldstr the start address of the part to be modified @param oldlen the length of the part being modified @param newstr the start address of the part to be added @param oldlen the length of the part being added - @return 0 in case of success, negative on error + @return 0 in case of success, negative on error */ int patch (struct sip_msg *msg, char *oldstr, unsigned int oldlen, - char *newstr, unsigned int newlen); + char *newstr, unsigned int newlen); /* modify the Content-Length header of a sip message @param msg a pointer to a sip message @param newValue the new value of Content-Length - @return 0 in case of success, negative on error + @return 0 in case of success, negative on error */ int patch_content_length (struct sip_msg *msg, unsigned int newValue); diff --git a/modules/sl/README b/modules/sl/README index a45dc335cbb..520a9e07c70 100644 --- a/modules/sl/README +++ b/modules/sl/README @@ -8,7 +8,7 @@ Daniel-Constantin Mierla asipto.com - Copyright 2003 FhG FOKUS + Copyright © 2003 FhG FOKUS __________________________________________________________________ Table of Contents @@ -185,7 +185,7 @@ modparam("sl", "bind_tm", 0) # feature disabled 3.3. sl_reply_error() 3.4. sl_forward _reply([ code, [ reason ] ]) -3.1. sl_send_reply(code, reason) +3.1. sl_send_reply(code, reason) For the current request, a reply is sent back having the given code and text reason. The reply is sent stateless, totally independent of the @@ -211,7 +211,7 @@ modparam("sl", "bind_tm", 0) # feature disabled sl_send_reply("404", "Not found"); ... -3.2. send_reply(code, reason) +3.2. send_reply(code, reason) For the current request, a reply is sent back having the given code and text reason. The reply is sent stateful or stateless, depending of the @@ -233,7 +233,7 @@ send_reply("404", "Not found"); send_reply("403", "Invalid user - $fU"); ... -3.3. sl_reply_error() +3.3. sl_reply_error() Sends back an error reply describing the nature of the last internal error. Usually this function should be used after a script function @@ -244,7 +244,7 @@ send_reply("403", "Invalid user - $fU"); sl_reply_error(); ... -3.4. sl_forward _reply([ code, [ reason ] ]) +3.4. sl_forward _reply([ code, [ reason ] ]) Forward statelessy the current received SIP reply, with the option to change the status code and reason text. The new code has to be in the diff --git a/modules/sl/sl_funcs.c b/modules/sl/sl_funcs.c index a65a7b84bf5..ec5a2baa4cb 100644 --- a/modules/sl/sl_funcs.c +++ b/modules/sl/sl_funcs.c @@ -182,6 +182,8 @@ int sl_reply_helper(struct sip_msg *msg, int code, char *reason, str *tag) sl_run_callbacks(SLCB_REPLY_READY, msg, code, reason, &buf, &dst); + *(sl_timeout) = get_ticks() + SL_RPL_WAIT_TIME; + /* supress multhoming support when sending a reply back -- that makes sure that replies will come from where requests came in; good for NATs (there is no known use for mhomed for locally generated replies; @@ -286,8 +288,6 @@ int sl_reply_helper(struct sip_msg *msg, int code, char *reason, str *tag) if (ret<0) { goto error; } - - *(sl_timeout) = get_ticks() + SL_RPL_WAIT_TIME; update_sl_stats(code); return 1; diff --git a/modules/sms/README b/modules/sms/README index 316846e378f..24f278f34bb 100644 --- a/modules/sms/README +++ b/modules/sms/README @@ -1,12 +1,11 @@ - SMS Module Bogdan Iancu FhG FOKUS - Copyright 2003 FhG FOKUS - _________________________________________________________________ + Copyright © 2003 FhG FOKUS + __________________________________________________________________ Table of Contents @@ -32,8 +31,8 @@ Bogdan Iancu 4. Functions - 4.1. sms_send_msg_to_net(network_name) - 4.2. sms_send_msg() + 4.1. sms_send_msg_to_net(network_name) + 4.2. sms_send_msg() List of Examples @@ -72,8 +71,8 @@ Chapter 1. Admin Guide 4. Functions - 4.1. sms_send_msg_to_net(network_name) - 4.2. sms_send_msg() + 4.1. sms_send_msg_to_net(network_name) + 4.2. sms_send_msg() 1. Overview @@ -81,54 +80,54 @@ Chapter 1. Admin Guide 1.2. Numbering Plan 1.3. Address Mapping - This module provides a way of communication between SIP network (via + This module provides a way of communication between SIP network (via SIP MESSAGE) and GSM networks (via ShortMessageService). Communication - is possible from SIP to SMS and vice versa. The module provides - facilities like SMS confirmation--the gateway can confirm to the SIP - user if his message really reached its destination as a SMS--or - multi-part messages--if a SIP messages is too long it will be split - and sent as multiple SMS. - - Errors occurred because of an invalid number or a too long message or - because of an internal modem malfunction are reported back to the SIP + is possible from SIP to SMS and vice versa. The module provides + facilities like SMS confirmation--the gateway can confirm to the SIP + user if his message really reached its destination as a SMS--or + multi-part messages--if a SIP messages is too long it will be split and + sent as multiple SMS. + + Errors occurred because of an invalid number or a too long message or + because of an internal modem malfunction are reported back to the SIP user via a SIP message containing explanations regarding the error. 1.1. Hardware Requirements - The SMS module needs a GSM modem to be able to send/receive the SMS - messages. Usually, this kind of modems are externals, linked to the - machine via serial cable. The modem can be a dedicated one (as the - ones provided by FALCOM) or can be a GSM telephone that has an - internal modem (as the latest mobile phones from NOKIA and ERICSSON). + The SMS module needs a GSM modem to be able to send/receive the SMS + messages. Usually, this kind of modems are externals, linked to the + machine via serial cable. The modem can be a dedicated one (as the ones + provided by FALCOM) or can be a GSM telephone that has an internal + modem (as the latest mobile phones from NOKIA and ERICSSON). 1.2. Numbering Plan - The gateway accepts and advertises phone numbers in international - format, more specific like: +(international code)(area code)(number). - Ex: Germany, D1 = +49 170 5678181 Romania, Connex = +40 722 123456 A - number in this format is expected to be placed as username into RURI - or in the To header. If RURI misses the username, the To header will - be consider. Also, the gateway will advertise in this format the - username in Contact headers (in SIP replies and requests) and in From - headers (in SIP requests). + The gateway accepts and advertises phone numbers in international + format, more specific like: +(international code)(area code)(number). + Ex: Germany, D1 = +49 170 5678181 Romania, Connex = +40 722 123456 A + number in this format is expected to be placed as username into RURI or + in the To header. If RURI misses the username, the To header will be + consider. Also, the gateway will advertise in this format the username + in Contact headers (in SIP replies and requests) and in From headers + (in SIP requests). 1.3. Address Mapping - To identify the destination number of the SMS, the gateway expects to - have a mobile number in username of the SIP destination address (for - example sip:+401704678811@iptel.org). For the reverse direction, - because the gateway has only one GSM number, the destination SIP - address has to be encapsulated into the SMS body. The gateway expects - to find a SIP address at the beginning of the SMS body in - "sip:user.host" format. Everything before the SIP address will be - discarded, the useful text begins exactly after the address (for - example SMS="For sip:user@host hello world!!" -> SIP="hello world"), - view configuration for disable this behavior (modems parameters 's' y - 't'). In order to facilitate replying, the gateway sends all the SMS - messages with a header containing the source SIP address in the - following format: "From sip:user@host (if you reply DONOT remove - it)". When an SMS-reply is received having this header (all - of it or truncated at the end), the header will be left out (it will + To identify the destination number of the SMS, the gateway expects to + have a mobile number in username of the SIP destination address (for + example sip:+401704678811@iptel.org). For the reverse direction, + because the gateway has only one GSM number, the destination SIP + address has to be encapsulated into the SMS body. The gateway expects + to find a SIP address at the beginning of the SMS body in + "sip:user.host" format. Everything before the SIP address will be + discarded, the useful text begins exactly after the address (for + example SMS="For sip:user@host hello world!!" -> SIP="hello world"), + view configuration for disable this behavior (modems parameters 's' y + 't'). In order to facilitate replying, the gateway sends all the SMS + messages with a header containing the source SIP address in the + following format: "From sip:user@host (if you reply DONOT remove + it)". When an SMS-reply is received having this header (all + of it or truncated at the end), the header will be left out (it will not be in the SIP message). 2. Dependencies @@ -156,22 +155,22 @@ list_of_params = modem_param *( ";" modem_param ) modem_param = name "=" value The following parameters can be used: - * d=device (mandatory) - Device associated with modem (/dev/ttyS0, + * d=device (mandatory) - Device associated with modem (/dev/ttyS0, /dev/modem, etc.). * p=pin (optional) - SIM PIN - default is NULL. * m=mode (optional) - Modem working mode ("ASCII","OLD","DIGICOM","NEW"). Default value is "NEW". - * c=SMS_Center (optional) - SMS center number for that modem. - Default is the SMS center set on the SIM card. + * c=SMS_Center (optional) - SMS center number for that modem. Default + is the SMS center set on the SIM card. * b=baudrate (optional) - Default is 19600. - * r=retry (optional) - How many times to try to re-send a SMS that + * r=retry (optional) - How many times to try to re-send a SMS that reported error. Default is twice. - * l=looping (optional) - Time for modem to wait before performing a + * l=looping (optional) - Time for modem to wait before performing a new check for incomimg/outgoing SMS/SIP_MSG. Default is 20. * t=to (optional) - uri for sip header TO. Default is NULL. * s=scan (optional) - Values: 0: NOT SCAN uri from body sms, use URI - in t=to. 1: SCAN uri from body sms (normal mode, default mode, - clasic mode) 2: SCAN MIX (both modes), First SCAN Default is 1 + in t=to. 1: SCAN uri from body sms (normal mode, default mode, + clasic mode) 2: SCAN MIX (both modes), First SCAN Default is 1 (SCAN). Note @@ -194,14 +193,14 @@ list_of_params = set_param *( ";" set_param ) set_param = name "=" value The following parameters can be used: - * m=msx_sms_per_call (optional) - Maximum number of SMS send / - received from that net in one modem loop. Default is 10. This + * m=msx_sms_per_call (optional) - Maximum number of SMS send / + received from that net in one modem loop. Default is 10. This parameter was introduced to avoid starvation. - Example of the starvation--a modem can send SMS for more than 1 - networks. If you have a huge number of SMS for the first network - and the number of incoming SIP messages is equal to the sent SMS - per same unit of time, the modem will never get to send SMS for - the next networks. + Example of the starvation--a modem can send SMS for more than 1 + networks. If you have a huge number of SMS for the first network + and the number of incoming SIP messages is equal to the sent SMS + per same unit of time, the modem will never get to send SMS for the + next networks. Note @@ -229,15 +228,15 @@ modparam("sms", "links", "NOKIA[D1;d2]") ... The modem NOKIA will send SMS from D1 and D2 net (in this order !). if - in a net queue are more then max_sms_per_call SMS the modem will not + in a net queue are more then max_sms_per_call SMS the modem will not sleep before starting the next loop ! Shortly, if messages are waiting to be sent, the modem will not go in sleep. 3.4. default_net (string) - The default network to use. If no one specified, the first defined - network is used. This parameter is useful only if the "sms_send_msg" - exported function is used (see Section 4, "Functions"). + The default network to use. If no one specified, the first defined + network is used. This parameter is useful only if the "sms_send_msg" + exported function is used (see Section 4, “Functions”). Example 1.4. Set default_net parameter ... @@ -246,7 +245,7 @@ modparam("sms", "default_net", "D1") 3.5. max_sms_parts (integer) - Shows in how many parts (SMS messages) a SIP message can be split. If + Shows in how many parts (SMS messages) a SIP message can be split. If exceeded, the SIP message will be sent truncated and the SIP user will get back another message containing the unsent part. @@ -259,9 +258,9 @@ modparam("sms", "max_sms_parts", 10) 3.6. domain_str (string) - Specify a fake domain name to be used by the gateway. The Contact - headers and the From header from request will be construct based on - this fake domain name. It's useful when the gateway is transparently + Specify a fake domain name to be used by the gateway. The Contact + headers and the From header from request will be construct based on + this fake domain name. It's useful when the gateway is transparently hidden behind a proxy/register (located on different machines). Default is the name of the machine the gateway is running on. @@ -285,14 +284,14 @@ modparam("sms", "use_contact", 1) 3.8. sms_report_type (integer) - If the modem should ask for SMS confirmation from the SMS Center. If - the SMSC reply with an error code, the gateway will send back to SIP - user a SIP message containing the text (or part of it) that couldn't - be send. Two report mechanisms are implemented: + If the modem should ask for SMS confirmation from the SMS Center. If + the SMSC reply with an error code, the gateway will send back to SIP + user a SIP message containing the text (or part of it) that couldn't be + send. Two report mechanisms are implemented: * 1 - the reports are delivered by the GSM device as SMS reports (so far supported only by Nokia modems); - * 2 - the reports are delivered as async. CDS responses (supported - by almost all modems, except Ericsson). + * 2 - the reports are delivered as async. CDS responses (supported by + almost all modems, except Ericsson). Default is 0 (no report). @@ -303,12 +302,12 @@ modparam("sms", "sms_report_type", 1) 4. Functions - 4.1. sms_send_msg_to_net(network_name) - 4.2. sms_send_msg() + 4.1. sms_send_msg_to_net(network_name) + 4.2. sms_send_msg() 4.1. sms_send_msg_to_net(network_name) - Put the SIP msg in the specified network queue. The function return + Put the SIP msg in the specified network queue. The function return error if the number encapsulated into SIP message is malformed, if the content_type is incorrect or because of some internal failures. diff --git a/modules/sms/libsms_modem.c b/modules/sms/libsms_modem.c index d0f5b339e30..e9d88fa4ee5 100644 --- a/modules/sms/libsms_modem.c +++ b/modules/sms/libsms_modem.c @@ -74,7 +74,9 @@ int put_command( struct modem *mdm, char* cmd, int cmd_len, char* answer, LM_DBG("-<%d>-->[%.*s] \n",cmd_len,cmd_len,cmd); #endif /* send the command to the modem */ - write(mdm->fd,cmd,cmd_len); + if (write(mdm->fd,cmd,cmd_len)<0) { + LM_ERR("write error: %s\n", strerror(errno)); + } tcdrain(mdm->fd); /* read from the modem */ diff --git a/modules/smsops/README b/modules/smsops/README index 182525a4c92..2bb6df878e6 100644 --- a/modules/smsops/README +++ b/modules/smsops/README @@ -11,7 +11,7 @@ Carsten Bock - Copyright 2015 Carsten Bock, ng-voice GmbH + Copyright © 2015 Carsten Bock, ng-voice GmbH __________________________________________________________________ Table of Contents diff --git a/modules/smsops/smsops_impl.c b/modules/smsops/smsops_impl.c index f90e6db44a9..9caf19fcc29 100644 --- a/modules/smsops/smsops_impl.c +++ b/modules/smsops/smsops_impl.c @@ -301,7 +301,7 @@ static void EncodeTime(char * buffer) { // Decode SMS-Body into the given structure: int decode_3gpp_sms(struct sip_msg *msg) { str body; - int len, j, p = 0; + int len, blen, j, p = 0; // Parse only the body again, if the mesage differs from the last call: if (msg->id != current_msg_id) { // Extract Message-body and length: taken from RTPEngine's code @@ -385,25 +385,30 @@ int decode_3gpp_sms(struct sip_msg *msg) { rp_data->pdu.destination.s = pkg_malloc(rp_data->pdu.destination.len); DecodePhoneNumber(&body.s[p], rp_data->pdu.destination.len, rp_data->pdu.destination); if (rp_data->pdu.destination.len % 2 == 0) { - p += rp_data->pdu.destination.len/2; + p += rp_data->pdu.destination.len/2; } else { - p += (rp_data->pdu.destination.len/2)+1; + p += (rp_data->pdu.destination.len/2)+1; } - + } rp_data->pdu.pid = (unsigned char)body.s[p++]; rp_data->pdu.coding = (unsigned char)body.s[p++]; rp_data->pdu.validity = (unsigned char)body.s[p++]; len = body.s[p++]; if (len > 0) { + blen = 2 + len*4; + rp_data->pdu.payload.s = pkg_malloc(blen); + if(rp_data->pdu.payload.s==NULL) { + LM_ERR("no more pkg\n"); + return -1; + } + memset(rp_data->pdu.payload.s, 0, blen); // Coding: 7 Bit if (rp_data->pdu.coding == 0x00) { // We don't care about the extra used bytes here. - rp_data->pdu.payload.s = pkg_malloc(len); - rp_data->pdu.payload.len = gsm_to_ascii(&body.s[p], len, rp_data->pdu.payload); + rp_data->pdu.payload.len = gsm_to_ascii(&body.s[p], blen, rp_data->pdu.payload); } else { // Length is worst-case 2 * len (UCS2 is 2 Bytes, UTF8 is worst-case 4 Bytes) - rp_data->pdu.payload.s = pkg_malloc(len*4); rp_data->pdu.payload.len = 0; while (len > 0) { j = (body.s[p] << 8) + body.s[p + 1]; @@ -413,11 +418,11 @@ int decode_3gpp_sms(struct sip_msg *msg) { } } } - } + } } } - return 1; + return 1; } int dumpRPData(sms_rp_data_t * rpdata, int level) { @@ -598,7 +603,7 @@ int pv_get_sms(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { int pv_set_sms(struct sip_msg* msg, pv_param_t *param, int op, pv_value_t *val) { if (param==NULL) return -1; - + if (!rp_send_data) { rp_send_data = (sms_rp_data_t*)pkg_malloc(sizeof(struct _sms_rp_data)); if (!rp_send_data) { @@ -650,6 +655,10 @@ int pv_set_sms(struct sip_msg* msg, pv_param_t *param, int op, pv_value_t *val) return -1; } rp_send_data->originator.s = pkg_malloc(val->rs.len); + if(rp_send_data->originator.s==NULL) { + LM_ERR("no more pkg\n"); + return -1; + } rp_send_data->originator.len = val->rs.len; memcpy(rp_send_data->originator.s, val->rs.s, val->rs.len); break; @@ -666,6 +675,10 @@ int pv_set_sms(struct sip_msg* msg, pv_param_t *param, int op, pv_value_t *val) return -1; } rp_send_data->destination.s = pkg_malloc(val->rs.len); + if(rp_send_data->destination.s==NULL) { + LM_ERR("no more pkg\n"); + return -1; + } rp_send_data->destination.len = val->rs.len; memcpy(rp_send_data->destination.s, val->rs.s, val->rs.len); break; @@ -749,6 +762,10 @@ int pv_set_sms(struct sip_msg* msg, pv_param_t *param, int op, pv_value_t *val) return -1; } rp_send_data->pdu.payload.s = pkg_malloc(val->rs.len); + if(rp_send_data->pdu.payload.s==NULL) { + LM_ERR("no more pkg\n"); + return -1; + } rp_send_data->pdu.payload.len = val->rs.len; memcpy(rp_send_data->pdu.payload.s, val->rs.s, val->rs.len); break; @@ -765,6 +782,10 @@ int pv_set_sms(struct sip_msg* msg, pv_param_t *param, int op, pv_value_t *val) return -1; } rp_send_data->pdu.destination.s = pkg_malloc(val->rs.len); + if(rp_send_data->pdu.destination.s==NULL) { + LM_ERR("no more pkg\n"); + return -1; + } rp_send_data->pdu.destination.len = val->rs.len; memcpy(rp_send_data->pdu.destination.s, val->rs.s, val->rs.len); break; @@ -781,6 +802,10 @@ int pv_set_sms(struct sip_msg* msg, pv_param_t *param, int op, pv_value_t *val) return -1; } rp_send_data->pdu.originating_address.s = pkg_malloc(val->rs.len); + if(rp_send_data->pdu.originating_address.s==NULL) { + LM_ERR("no more pkg\n"); + return -1; + } rp_send_data->pdu.originating_address.len = val->rs.len; memcpy(rp_send_data->pdu.originating_address.s, val->rs.s, val->rs.len); break; diff --git a/modules/snmpstats/README b/modules/snmpstats/README index 12d2c3189b6..07770b7aca8 100644 --- a/modules/snmpstats/README +++ b/modules/snmpstats/README @@ -12,9 +12,9 @@ Edited by Olle E. Johansson - Copyright 2006 SOMA Networks, Inc. + Copyright © 2006 SOMA Networks, Inc. - Copyright 2013 Edvina AB, Sollentuna, Sweden + Copyright © 2013 Edvina AB, Sollentuna, Sweden __________________________________________________________________ Table of Contents @@ -390,7 +390,7 @@ modparam("snmpstats", "MsgQueueMajorThreshold", 5000) the master agent. You can use this parameter to set the path to your instance of NetSNMP's snmpget program. - Default value is "/usr/local/bin/". + Default value is “/usr/local/bin/”. Example 1.6. Setting the snmpgetPath parameter ... @@ -404,7 +404,7 @@ modparam("snmpstats", "snmpgetPath", "/my/custom/path/") the master agent. If you have defined a custom community string for the snmp daemon, you need to specify it with this parameter. - Default value is "public". + Default value is “public”. Example 1.7. Setting the snmpCommunity parameter ... @@ -417,7 +417,7 @@ modparam("snmpstats", "snmpCommunity", "customCommunityString") parameter is set to 1. This will result in more memory usage and bigger exporter structure. - Default value is "0" (don't export). + Default value is “0” (don't export). Example 1.8. Setting the export_registrar parameter ... @@ -442,7 +442,7 @@ modparam("snmpstats", "export_registrar", 1) There are several things that need to be done to get the SNMPStats module compiled and up and running. -6.1. Compiling the SNMPStats Module +6.1. Compiling the SNMPStats Module In order for the SNMPStats module to compile, you will need at least version 5.3 of the NetSNMP source code. The source can be found at: @@ -464,7 +464,7 @@ modparam("snmpstats", "export_registrar", 1) recommended you install NetSNMP from source to avoid bringing in excessive dependencies to the SNMPStats module. -6.2. Configuring NetSNMP to allow connections from the SNMPStats module. +6.2. Configuring NetSNMP to allow connections from the SNMPStats module. The SNMPStats module will communicate with the NetSNMP Master Agent. This communication happens over a protocol known as AgentX. This means @@ -496,7 +496,7 @@ modparam("snmpstats", "export_registrar", 1) This tells NetSNMP to act as a master agent, listening on the localhost UDP interface at port 705. -6.3. Configuring the SNMPStats module for communication with a Master Agent +6.3. Configuring the SNMPStats module for communication with a Master Agent The previous section explained how to set up a NetSNMP master agent to accept AgentX connections. We now need to tell the SNMPStats module how @@ -516,7 +516,7 @@ modparam("snmpstats", "export_registrar", 1) be present on the same machine as Kamailio. localhost could be replaced with any other machine. -6.4. Testing for a proper Configuration +6.4. Testing for a proper Configuration As a quick test to make sure that the SNMPStats module sub-agent can succesfully connect to the NetSNMP Master agent, start snmpd with the @@ -773,4 +773,4 @@ Name How can I report a bug? Please follow the guidelines provided at: - http://sip-router.org/tracker. + https://github.com/kamailio/kamailio/issues. diff --git a/modules/speeddial/README b/modules/speeddial/README index 8ab20d18dee..fa3027b4f69 100644 --- a/modules/speeddial/README +++ b/modules/speeddial/README @@ -10,7 +10,7 @@ Elena-Ramona Modroiu - Copyright 2004 Voice Sistem SRL + Copyright © 2004 Voice Sistem SRL __________________________________________________________________ Table of Contents @@ -134,7 +134,7 @@ modparam("speeddial", "db_url", "mysql://openser:xxx@localhost/openser") The name of column storing the user name of the owner of the speed dial record. - Default value is "username". + Default value is “username”. Example 1.2. Set user_column parameter ... @@ -146,7 +146,7 @@ modparam("speeddial", "user_column", "userid") The name of column storing the domain of the owner of the speed dial record. - Default value is "domain". + Default value is “domain”. Example 1.3. Set domain_column parameter ... @@ -157,7 +157,7 @@ modparam("speeddial", "domain_column", "userdomain") The name of the column storing the user part of the short dial address. - Default value is "sd_username". + Default value is “sd_username”. Example 1.4. Set sd_user_column parameter ... @@ -168,7 +168,7 @@ modparam("speeddial", "sd_user_column", "short_user") The name of the column storing the domain of the short dial address. - Default value is "sd_domain". + Default value is “sd_domain”. Example 1.5. Set sd_domain_column parameter ... @@ -180,7 +180,7 @@ modparam("speeddial", "sd_domain_column", "short_domain") The name of the column containing the URI that will be use to replace the short dial URI. - Default value is "new_uri". + Default value is “new_uri”. Example 1.6. Set new_uri_column parameter ... @@ -217,7 +217,7 @@ modparam("speeddial", "use_domain", 1) 4.1. sd_lookup(table [, owner]) -4.1. sd_lookup(table [, owner]) +4.1. sd_lookup(table [, owner]) The function lookups the short dial number from R-URI in 'table' and replaces the R-URI with associated address. diff --git a/modules/sqlops/README b/modules/sqlops/README index ccf03b3413e..b04f8eabcf2 100644 --- a/modules/sqlops/README +++ b/modules/sqlops/README @@ -11,7 +11,7 @@ Daniel-Constantin Mierla - Copyright 2008 http://www.asipto.com + Copyright © 2008 http://www.asipto.com __________________________________________________________________ Table of Contents @@ -97,7 +97,7 @@ Chapter 1. Admin Guide * Access via pseudo-variables - the content of the SQL query result is accessible via pseudo-variables. Please note that only integer and string variables are supported at the moment because of the - internal usage of "AVPs" to hold the values. So it is not possible + internal usage of “AVPs” to hold the values. So it is not possible for example to return floating point or big integer values this way. * Array indexes - fast access to result values via array position: @@ -138,7 +138,7 @@ Chapter 1. Admin Guide This parameter may be set multiple times to get many DB connections in the same configuration file. * connection_name - string specifying the name of a database - connection. This string is used by the "sql_query()" function to + connection. This string is used by the “sql_query()” function to refer to the DB connection. * database_url - Standardized Kamailio database URL used to connect to database. @@ -180,11 +180,11 @@ modparam("sqlops", "sqlres", "ra") * 1 - query successful, at least one row in resultset (for SELECTs) * 2 - query successful, no rows returned -4.1. sql_query(connection, query[, result]) +4.1. sql_query(connection, query[, result]) Make an SQL query using 'connection' and store data in 'result'. * connection - the name of the connection to be used for the query - (defined via the "sqlcon" parameter). + (defined via the “sqlcon” parameter). * query - SQL query string or pseudo-variables containing SQL query. * result - string name to identify the result. Will be used by $dbr(...) pseudo-variable to access result attributes. If omitted, @@ -203,11 +203,11 @@ xlog("number of rows in table domain: $dbr(ra=>rows)\n"); sql_result_free("ra"); ... -4.2. sql_xquery(connection, query, result) +4.2. sql_xquery(connection, query, result) Make an SQL query using 'connection' and store data in 'result' xavp. * connection - the name of the connection to be used for the query - (defined via the "sqlcon" parameter). + (defined via the “sqlcon” parameter). * query - SQL query string or pseudo-variables containing SQL query. * result - string name to identify the result xavp. Each row will be added to this xavp, each column can be accessed by its name. @@ -226,15 +226,15 @@ if (sql_xquery("ca", "select * from domain", "ra") == 1) { } .. -4.3. sql_pvquery(connection, query, result) +4.3. sql_pvquery(connection, query, result) Make an SQL query using 'connection' and store data in arbitrary pseudo variables specified by 'result' parameter. * connection - the name of the connection to be used for query - (defined via the "sqlcon" parameter). + (defined via the “sqlcon” parameter). * query - SQL query string or pseudo-variables containing SQL query. * result - a list with PV names where to store the result. The format - is "$pv;$pv;...". Every PV that is writable may be used (for + is “$pv;$pv;...”. Every PV that is writable may be used (for example $var, $avp, $xavp, $ru, $du, $sht, etc). The PV are assigned values in the following order: last row to first row, first field to last field. Assignment has the same @@ -248,7 +248,9 @@ if (sql_xquery("ca", "select * from domain", "ra") == 1) { the type of the columns. Please note that only these two datatypes are supported, other datatypes will/may be converted to string. - This function can be used from ANY_ROUTE. + This function can be used from ANY_ROUTE. Returns -1 on Error, 1 on + successful query, 2 if query provided no result set, 3 if result is + ignored (no result parameter given) Example 1.5. sql_pvquery() usage ... @@ -258,7 +260,7 @@ sql_pvquery("ca", "select 'col1', 2, NULL, 'sip:test@example.com'", "$var(a), $avp(col2), $xavp(item[0]=>s), $ru"); ... -4.4. sql_result_free(result) +4.4. sql_result_free(result) Free data in SQL 'result'. @@ -274,7 +276,7 @@ xlog("number of rows in table domain: $dbr(ra=>rows)\n"); sql_result_free("ra"); ... -4.5. sql_query_async(connection, query) +4.5. sql_query_async(connection, query) Make an async SQL query using 'connection', if implemented by db driver module (e.g., db_mysql). The query is executed in another process and @@ -283,7 +285,7 @@ sql_result_free("ra"); update...). Note that async_workers core parameter must be set in order to enable the asyncronous framework needed by this function. * connection - the name of the connection to be used for the query - (defined via "sqlcon" parameter). + (defined via “sqlcon” parameter). * query - SQL query string or pseudo-variables containing SQL query. This function can be used from ANY_ROUTE. @@ -304,10 +306,10 @@ sql_query_async("ca", "delete from domain"); Access hash table entries. - The "result" must be the name identifying a SQL result (third parameter + The “result” must be the name identifying a SQL result (third parameter of sql_query(...)). - The "key" can be: + The “key” can be: * rows - return the number of rows in query result * cols - return the number of columns in the result. * [row,col] - return the value at position (row,col) in the result @@ -372,7 +374,7 @@ if (sql_xquery("ca", "select * from domain", "ra") == 1) connection. It's primary use is to get the number of rows affected by UPDATE, INSERT and DELETE queries. - "con" must be the name identifying a DB connection. + “con” must be the name identifying a DB connection. Example 1.9. $sqlrows(con) usage ... diff --git a/modules/sqlops/doc/sqlops_admin.xml b/modules/sqlops/doc/sqlops_admin.xml index bb9011bd0b9..824d7a9221e 100644 --- a/modules/sqlops/doc/sqlops_admin.xml +++ b/modules/sqlops/doc/sqlops_admin.xml @@ -338,7 +338,9 @@ if (sql_xquery("ca", "select * from domain", "ra") == 1) { - This function can be used from ANY_ROUTE. + This function can be used from ANY_ROUTE. Returns -1 on Error, + 1 on successful query, 2 if query provided no result set, + 3 if result is ignored (no result parameter given) <function>sql_pvquery()</function> usage diff --git a/modules/sqlops/sqlops.c b/modules/sqlops/sqlops.c index 3ca35090e2e..61ba89a22c4 100644 --- a/modules/sqlops/sqlops.c +++ b/modules/sqlops/sqlops.c @@ -26,10 +26,9 @@ */ /*! \defgroup sqlops Kamailio :: SQL Operations - * \note Kamailio module - part of modules_k - + * * The module adds support for raw SQL queries in the configuration file. - + * */ diff --git a/modules/sst/README b/modules/sst/README index da1ff6f6bb7..77eee87a2c6 100644 --- a/modules/sst/README +++ b/modules/sst/README @@ -8,7 +8,7 @@ Edited by Ron Winacott - Copyright 2006 SOMA Networks, Inc. + Copyright © 2006 SOMA Networks, Inc. __________________________________________________________________ Table of Contents @@ -99,7 +99,7 @@ Chapter 1. Admin Guide 2. How it works - The sst module uses the "dialog module" to be notified of any new or + The sst module uses the “dialog module” to be notified of any new or updated dialogs. It will then look for and extract the session-expire: header value (if there is one) and override the dialog expire timer value for the current context dialog by setting the avp value. @@ -111,10 +111,10 @@ Chapter 1. Admin Guide All of this happens with a properly configured dialog and sst module and setting the dialog flag and the sst flag at the time any INVITE sip message is seen. There is no kamailio.cfg script function call required - to set the dialog expire timeout value. See the "dialog module" users + to set the dialog expire timeout value. See the “dialog module” users guide for more information. - The "sstCheckMin()" script function can be used to verify that the + The “sstCheckMin()” script function can be used to verify that the Session-expires / MIN-SE header field values are not too small for your server. If the SST min_se parameter value is smaller than the messages Session-Expires / MIN-SE values, the test will return true. You can @@ -193,7 +193,7 @@ Chapter 1. Admin Guide variables, the module provide information about the dialog processing. Set it to zero to disable or to non-zero to enable it. - Default value is "1" (enabled). + Default value is “1” (enabled). Example 1.2. Set enable_stats parameter ... @@ -204,13 +204,13 @@ modparam("sst", "enable_stats", 0) The value is used to set the proxies MIN-SE value and is used in the 422 error reply as the proxys MIN-SE: header value if the - "sstCheckMin()" flag is set to true and the check fails. + “sstCheckMin()” flag is set to true and the check fails. - If not set and "sstCheckMin()" is called with the send-reply flag set + If not set and “sstCheckMin()” is called with the send-reply flag set to true, the default 1800 seconds will be used as the compare and the MIN-SE: header value if the 422 reply is sent. - Default value is "1800" seconds. + Default value is “1800” seconds. Example 1.3. Set min_se parameter ... @@ -226,7 +226,7 @@ modparam("sst", "min_se", 2400) This is how the sst module knows which avp in the dialog module it has to change with the new expire value. - Default value is "NULL!" it is not set by default. + Default value is “NULL!” it is not set by default. Example 1.4. Set timeout_avp parameter ... @@ -240,14 +240,14 @@ modparam("sst", "timeout_avp", "$avp(i:10)") In the initial INVITE if the UAC has requested a Session-Expire: and it's value is smaller than our local policies Min-SE (see min_se above), then the proxy has the right to reject the call by replying to - the message with a "422 Session Timer Too Small" and state our local + the message with a “422 Session Timer Too Small” and state our local Min-SE: value. The INVITE is NOT forwarded on through the proxy. If this flag is true, the SST module to reject the INVITE with a 422 response. If false, the INVITE is forwarded through the PROXY without any modifications. - Default value is "1" (true/on). + Default value is “1” (true/on). Example 1.5. Set reject_to_small parameter ... @@ -268,7 +268,7 @@ modparam("sst", "reject_to_small", 0) This parameter must be set or the module will not load. - Default value is "Not set!". + Default value is “Not set!”. Example 1.6. Set sst_flag parameter ... @@ -288,7 +288,7 @@ route { 5.1. sstCheckMin(send_reply_flag) -5.1. sstCheckMin(send_reply_flag) +5.1. sstCheckMin(send_reply_flag) Check the current Session-Expires / MIN-SE values against the sst_min_se parameter value. If the Session-Expires or MIN_SE header diff --git a/modules/statistics/README b/modules/statistics/README index 03798f021bd..68aefb1db9e 100644 --- a/modules/statistics/README +++ b/modules/statistics/README @@ -8,7 +8,7 @@ Edited by Bogdan Iancu - Copyright 2006 Voice Sistem SRL + Copyright © 2006 Voice Sistem SRL __________________________________________________________________ Table of Contents diff --git a/modules/statsc/README b/modules/statsc/README index c35bbe7f230..a546b56db5a 100644 --- a/modules/statsc/README +++ b/modules/statsc/README @@ -10,7 +10,7 @@ Daniel-Constantin Mierla - Copyright 2016 asipto.com + Copyright © 2016 asipto.com __________________________________________________________________ Table of Contents @@ -129,13 +129,15 @@ modparam("statsc", "items", 200) Example 1.3. Set track parameter ... modparam("statsc", "track", "req.received=rcv_requests") +modparam("statsc", "track", "req.received=rcv_requests;rpl.received=rcv_replies" +) ... 4. RPC Commands 4.1. statsc.exec -4.1. statsc.exec +4.1. statsc.exec Get the report of recorded statistics. @@ -143,8 +145,8 @@ modparam("statsc", "track", "req.received=rcv_requests") Parameters: * _type_ : - + "list": list recorded values - + "diff": show diff between recorded values + + “list”: list recorded values + + “diff”: show diff between recorded values * _name_: (optional) name of the statistic to show the report for. If missing or set to 'all', then the reports for all recorded statistics are done. diff --git a/modules/statsd/README b/modules/statsd/README index 06dd6988fb6..3d7c8360c83 100644 --- a/modules/statsd/README +++ b/modules/statsd/README @@ -104,7 +104,7 @@ modparam("statsd", "port", "8125") 3.5. statsd_incr(key) 3.6. statsd_decr(key) -3.1. statsd_set(key, value) +3.1. statsd_set(key, value) Sets count the number of unique values passed to a key. @@ -122,13 +122,14 @@ failure_route[tryagain] { } ... -3.2. statsd_gauge(key, value) +3.2. statsd_gauge(key, value) Gauges are a constant data type. They are not subject to averaging, and - they don't change unless you change them. That is, once you set a gauge - value, it will be a flat line on the graph until you change it again. + they don’t change unless you change them. That is, once you set a + gauge value, it will be a flat line on the graph until you change it + again. - Gauges are useful for things that are already averaged, or don't need + Gauges are useful for things that are already averaged, or don’t need to reset periodically This function can be used in ALL ROUTES. @@ -141,7 +142,7 @@ route [gauge_method]{ statsd_gauge("customer_credit"+$var(customer),"$var(customer_credit)"); } -3.3. statsd_start(key) +3.3. statsd_start(key) statsd start set a avp with the key name, and when you use statsd_stop(key), module will send to statsd the difference in @@ -153,7 +154,7 @@ route [gauge_method]{ the statsd server collects all timers under the stats.timers prefix, and will calculate the lower bound, mean, 90th percentile, upper bound, and count of each timer for each period (by the time you see it in - graphite, that's usually per minute). + graphite, that’s usually per minute). Example 1.5. statsd_start usage ... @@ -162,7 +163,7 @@ sql_query("ca", "select sleep(0.2)", "ra"); statsd_stop("long_mysql_query"); ... -3.4. statsd_stop(key) +3.4. statsd_stop(key) statsd_stop(key) get the avp string with the key and calculate the difference from the start time. When finish app send the milliseconds @@ -177,7 +178,7 @@ sql_query("ca", "select sleep(0.2)", "ra"); statsd_stop("long_mysql_query"); ... -3.5. statsd_incr(key) +3.5. statsd_incr(key) Increment a counter @@ -190,7 +191,7 @@ if(geoip_match("$si", "src")){ } ... -3.6. statsd_decr(key) +3.6. statsd_decr(key) Decrement a counter diff --git a/modules/statsd/lib_statsd.c b/modules/statsd/lib_statsd.c index 878b45239b9..926aa3ecb5e 100644 --- a/modules/statsd/lib_statsd.c +++ b/modules/statsd/lib_statsd.c @@ -19,7 +19,7 @@ static StatsConnection statsd_connection = { bool statsd_connect(void){ - struct addrinfo *serverAddr; + struct addrinfo *serverAddr = NULL; int rc; if (statsd_connection.sock > 0){ @@ -34,12 +34,14 @@ bool statsd_connect(void){ LM_ERR( "Statsd: could not initiate server information (%s)\n", gai_strerror(rc)); + if(serverAddr) freeaddrinfo(serverAddr); return false; } statsd_connection.sock = socket(serverAddr->ai_family, SOCK_DGRAM, IPPROTO_UDP); if (statsd_connection.sock < 0 ){ LM_ERR("Statsd: could not create a socket for statsd connection\n"); + if(serverAddr) freeaddrinfo(serverAddr); return false; } diff --git a/modules/statsd/statsd.c b/modules/statsd/statsd.c index daae3589fb1..6b956582ced 100644 --- a/modules/statsd/statsd.c +++ b/modules/statsd/statsd.c @@ -107,7 +107,7 @@ static int func_set(struct sip_msg* msg, char* key, char* val) static int func_time_start(struct sip_msg *msg, char *key) { int_str avp_key, avp_val; - char unix_time[20]; + char unix_time[24]; get_milliseconds(unix_time); avp_key.s.s = key; avp_key.s.len = strlen(avp_key.s.s); @@ -125,7 +125,7 @@ static int func_time_start(struct sip_msg *msg, char *key) static int func_time_end(struct sip_msg *msg, char *key) { - char unix_time[20]; + char unix_time[24]; char *endptr; long int start_time; int result; diff --git a/modules/stun/README b/modules/stun/README index d572a2f8f38..b33fd59925e 100644 --- a/modules/stun/README +++ b/modules/stun/README @@ -4,9 +4,9 @@ Peter Dunkley Crocodile RCS Ltd - Copyright 2013 Crocodile RCS Ltd + Copyright © 2013 Crocodile RCS Ltd - Copyright 2001-2003 FhG Fokus + Copyright © 2001-2003 FhG Fokus __________________________________________________________________ Table of Contents diff --git a/modules/tcpops/README b/modules/tcpops/README index b2a883a05f8..e60a6721ed7 100644 --- a/modules/tcpops/README +++ b/modules/tcpops/README @@ -31,6 +31,10 @@ Olle E. Johansson 3.5. tcp_set_connection_lifetime([conid], lifetime) 3.6. tcp_enable_closed_event([conid]) + 4. Event routes + + 4.1. tcp:closed + List of Examples 1.1. Set closed_event parameter @@ -59,6 +63,10 @@ Chapter 1. Admin Guide 3.5. tcp_set_connection_lifetime([conid], lifetime) 3.6. tcp_enable_closed_event([conid]) + 4. Event routes + + 4.1. tcp:closed + 1. Overview This modules allows Kamailio to control the TCP connection options @@ -67,7 +75,7 @@ Chapter 1. Admin Guide Note: the keepalive functions only work on systems with the HAVE_TCP_KEEPIDLE, HAVE_TCP_KEEPCNT and HAVE_TCP_KEEPINTVL macros - defined (currently only Linux). + defined (Linux, FreeBSD, DragonFly BSD, NetBSD). 2. Parameters @@ -106,7 +114,7 @@ modparam("tcpops", "closed_event", 0) Check the state of a TCP or WS connection ID Meaning of the parameters is as follows: - * conid (optionnal): the Kamailio internal connection id (as in the + * conid (optional): the Kamailio internal connection id (as in the $conid pseudovariable). Retuns values: @@ -128,7 +136,7 @@ modparam("tcpops", "closed_event", 0) Check the state of a TCP or WS connection ID Meaning of the parameters is as follows: - * conid (optionnal): the Kamailio internal connection id (as in the + * conid (optional): the Kamailio internal connection id (as in the $conid pseudovariable). Retuns values: @@ -159,7 +167,7 @@ modparam("tcpops", "closed_event", 0) Enables keepalive on a TCP connection. Meaning of the parameters is as follows: - * conid (optionnal): the kamailio internal connection id on which TCP + * conid (optional): the kamailio internal connection id on which TCP keepalive will be enabled. If no parameter is given, the keepalive mechanism will be enabled on the current message source connection. * idle (seconds): the time before the first keepalive packet is sent @@ -194,7 +202,7 @@ onreply_route[foo] { Disables keepalive on a TCP connection. Meaning of the parameters is as follows: - * conid (optionnal): the kamailio internal connection id on which TCP + * conid (optional): the kamailio internal connection id on which TCP keepalive will be disabled. If no parameter is given, the keepalive mechanism will be disabled on the current message source connection. @@ -225,7 +233,7 @@ onreply_route[foo] { Sets the connection lifetime of a connection (TCP). Meaning of the parameters is as follows: - * conid (optionnal): the kamailio internal connection id on which to + * conid (optional): the kamailio internal connection id on which to set the new lifetime. If no parameter is given, it will be set on the current message source connection. * lifetime (seconds): the new connection lifetime. @@ -277,3 +285,22 @@ request_route { event_route[tcp:closed] { xlog("connection $conid was closed"); } + +4. Event routes + + 4.1. tcp:closed + +4.1. tcp:closed + + This route is called when a socket is closed by the remote party, or + reset, or timeout. The corresponding $conid variable will be available + in the event route. + + Whether this route is always called, never, or on a per socket basis is + controlled by the closed_event parameter. + +... +event_route[tcp:closed] { + xlog("L_INFO", "TCP connection closed ($conid)\n"); +} +... diff --git a/modules/tcpops/doc/eventroutes.xml b/modules/tcpops/doc/eventroutes.xml new file mode 100644 index 00000000000..f219b1da091 --- /dev/null +++ b/modules/tcpops/doc/eventroutes.xml @@ -0,0 +1,35 @@ + + + +%docentities; + +]> +
+ Event routes +
+ + <function moreinfo="none">tcp:closed</function> + + + This route is called when a socket is closed by the remote party, + or reset, or timeout. The corresponding $conid + variable will be available in the event route. + + + Whether this route is always called, never, or on a per socket basis + is controlled by the closed_event parameter. + + + +... +event_route[tcp:closed] { + xlog("L_INFO", "TCP connection closed ($conid)\n"); +} +... + + +
+
\ No newline at end of file diff --git a/modules/tcpops/doc/tcpops.xml b/modules/tcpops/doc/tcpops.xml index e4137e0f84e..896c6a20c95 100644 --- a/modules/tcpops/doc/tcpops.xml +++ b/modules/tcpops/doc/tcpops.xml @@ -51,6 +51,7 @@ + diff --git a/modules/textops/README b/modules/textops/README index 5cfe2b2d2ab..752607e39fc 100644 --- a/modules/textops/README +++ b/modules/textops/README @@ -23,7 +23,7 @@ Juha Heinanen - Copyright 2003 FhG FOKUS + Copyright © 2003 FhG FOKUS __________________________________________________________________ Table of Contents @@ -209,7 +209,7 @@ Chapter 1. Admin Guide 1.1. Known Limitations - search ignores folded lines. For example, search("(From|f):.*@foo.bar") + search ignores folded lines. For example, search(“(From|f):.*@foo.bar”) doesn't match the following From header field: From: medabeda ;tag=1234 @@ -274,7 +274,7 @@ From: medabeda 3.40. get_body_part_raw(content_type, opv) 3.41. remove_body_part(content_type) -3.1. search(re) +3.1. search(re) Searches for the re in the message. @@ -289,7 +289,7 @@ From: medabeda if ( search("[Ss][Ii][Pp]") ) { /*....*/ }; ... -3.2. search_body(re) +3.2. search_body(re) Searches for the re in the body of the message. @@ -304,7 +304,7 @@ if ( search("[Ss][Ii][Pp]") ) { /*....*/ }; if ( search_body("[Ss][Ii][Pp]") ) { /*....*/ }; ... -3.3. search_hf(hf, re, flags) +3.3. search_hf(hf, re, flags) Searches for the re in the body of a header field. @@ -323,7 +323,7 @@ if ( search_body("[Ss][Ii][Pp]") ) { /*....*/ }; if ( search_hf("From", ":test@", "a") ) { /*....*/ }; ... -3.4. search_append(re, txt) +3.4. search_append(re, txt) Searches for the first match of re and appends txt after it. @@ -339,7 +339,7 @@ if ( search_hf("From", ":test@", "a") ) { /*....*/ }; search_append("[Oo]pen[Ss]er", " SIP Proxy"); ... -3.5. search_append_body(re, txt) +3.5. search_append_body(re, txt) Searches for the first match of re in the body of the message and appends txt after it. @@ -356,7 +356,7 @@ search_append("[Oo]pen[Ss]er", " SIP Proxy"); search_append_body("[Oo]pen[Ss]er", " SIP Proxy"); ... -3.6. replace(re, txt) +3.6. replace(re, txt) Replaces the first occurrence of re with txt. @@ -372,7 +372,7 @@ search_append_body("[Oo]pen[Ss]er", " SIP Proxy"); replace("openser", "Kamailio SIP Proxy"); ... -3.7. replace_body(re, txt) +3.7. replace_body(re, txt) Replaces the first occurrence of re in the body of the message with txt. @@ -389,7 +389,7 @@ replace("openser", "Kamailio SIP Proxy"); replace_body("openser", "Kamailio SIP Proxy"); ... -3.8. replace_all(re, txt) +3.8. replace_all(re, txt) Replaces all occurrence of re with txt. @@ -405,7 +405,7 @@ replace_body("openser", "Kamailio SIP Proxy"); replace_all("openser", "Kamailio SIP Proxy"); ... -3.9. replace_body_all(re, txt) +3.9. replace_body_all(re, txt) Replaces all occurrence of re in the body of the message with txt. Matching is done on a per-line basis. @@ -422,7 +422,7 @@ replace_all("openser", "Kamailio SIP Proxy"); replace_body_all("openser", "Kamailio SIP Proxy"); ... -3.10. replace_body_atonce(re, txt) +3.10. replace_body_atonce(re, txt) Replaces all occurrence of re in the body of the message with txt. Matching is done over the whole body. @@ -441,7 +441,7 @@ if(has_body() && replace_body_atonce("^.+$", "")) remove_hf("Content-Type"); ... -3.11. subst('/re/repl/flags') +3.11. subst('/re/repl/flags') Replaces re with repl (sed or perl like). @@ -467,7 +467,7 @@ if ( subst('/^To:(.*)sip:[^@]*@[a-zA-Z0-9.]+(.*)$/t:\1$avp(sip_address)\2/ig') ) ... -3.12. subst_uri('/re/repl/flags') +3.12. subst_uri('/re/repl/flags') Runs the re substitution on the message uri (like subst but works only on the uri) @@ -495,7 +495,7 @@ if (subst_uri('/^sip:([0-9]+)@(.*)$/sip:$avp(uri_prefix)\1@\2;orig_uri=\0/i')){$ ... -3.13. subst_user('/re/repl/flags') +3.13. subst_user('/re/repl/flags') Runs the re substitution on the message uri (like subst_uri but works only on the user portion of the uri) @@ -522,7 +522,7 @@ if (subst_user('/(.*)3642$/$avp(user_prefix)\13642/')){$ ... -3.14. subst_body('/re/repl/flags') +3.14. subst_body('/re/repl/flags') Replaces re with repl (sed or perl like) in the body of the message. @@ -543,7 +543,7 @@ if ( subst_body('/^o=(.*) /o=$fU /') ) {}; ... -3.15. subst_hf(hf, subexp, flags) +3.15. subst_hf(hf, subexp, flags) Perl-like substitutions in the body of a header field. @@ -563,7 +563,7 @@ if ( subst_body('/^o=(.*) /o=$fU /') ) {}; if ( subst_hf("From", "/:test@/:best@/", "a") ) { /*....*/ }; ... -3.16. set_body(txt,content_type) +3.16. set_body(txt,content_type) Set body to a SIP message. @@ -580,7 +580,7 @@ if ( subst_hf("From", "/:test@/:best@/", "a") ) { /*....*/ }; set_body("test", "text/plain"); ... -3.17. set_reply_body(txt,content_type) +3.17. set_reply_body(txt,content_type) Set body to a SIP reply to be generated by Kamailio. @@ -597,7 +597,7 @@ set_body("test", "text/plain"); set_reply_body("test", "text/plain"); ... -3.18. filter_body(content_type) +3.18. filter_body(content_type) Filters multipart/mixed body by leaving out all other body parts except the first body part of given type. @@ -620,7 +620,7 @@ if (has_body("multipart/mixed")) { } ... -3.19. append_to_reply(txt) +3.19. append_to_reply(txt) Append txt as header to the reply. @@ -636,7 +636,7 @@ append_to_reply("Foo: bar\r\n"); append_to_reply("Foo: $rm at $Ts\r\n"); ... -3.20. append_hf(txt[, hdr]) +3.20. append_hf(txt[, hdr]) Appends 'txt' as header after first header field or after last 'hdr' header field. @@ -655,7 +655,7 @@ append_hf("P-hint: VOICEMAIL\r\n"); append_hf("From-username: $fU\r\n", "Call-ID"); ... -3.21. insert_hf(txt[, hdr]) +3.21. insert_hf(txt[, hdr]) Inserts 'txt' as header before the first header field or before first 'hdr' header field if 'hdr' is given. @@ -676,7 +676,7 @@ insert_hf("P-hint: VOICEMAIL\r\n", "Call-ID"); insert_hf("To-username: $tU\r\n", "Call-ID"); ... -3.22. append_urihf(prefix, suffix) +3.22. append_urihf(prefix, suffix) Append header field name with original Request-URI in middle. @@ -692,14 +692,14 @@ insert_hf("To-username: $tU\r\n", "Call-ID"); append_urihf("CC-Diversion: ", "\r\n"); ... -3.23. is_present_hf(hf_name) +3.23. is_present_hf(hf_name) Return true if a header field is present in message. Note The function is also able to distinguish the compact names. For exmaple - "From" will match with "f" + “From” will match with “f” Meaning of the parameters is as follows: * hf_name - Header field name.(long or compact form) @@ -712,7 +712,7 @@ Note if (is_present_hf("From")) log(1, "From HF Present"); ... -3.24. is_present_hf_re(hf_name_re) +3.24. is_present_hf_re(hf_name_re) Return true if a header field whose name matches regular expression 'hf_name_re' is present in message. @@ -728,12 +728,12 @@ if (is_present_hf("From")) log(1, "From HF Present"); if (is_present_hf_re("^P-")) log(1, "There are headers starting with P-\n"); ... -3.25. append_time() +3.25. append_time() Adds a time header to the reply of the request. You must use it before functions that are likely to send a reply, e.g., save() from - 'registrar' module. Header format is: "Date: %a, %d %b %Y %H:%M:%S - GMT", with the legend: + 'registrar' module. Header format is: “Date: %a, %d %b %Y %H:%M:%S + GMT”, with the legend: * %a abbreviated week of day name (locale) * %d day of month as decimal number * %b abbreviated month name (locale) @@ -752,10 +752,10 @@ if (is_present_hf_re("^P-")) log(1, "There are headers starting with P-\n"); append_time(); ... -3.26. append_time_to_request() +3.26. append_time_to_request() - Adds a time header to the request. Header format is: "Date: %a, %d %b - %Y %H:%M:%S GMT", with the legend: + Adds a time header to the request. Header format is: “Date: %a, %d %b + %Y %H:%M:%S GMT”, with the legend: * %a abbreviated week of day name (locale) * %d day of month as decimal number * %b abbreviated month name (locale) @@ -775,7 +775,7 @@ if(!is_present_hf("Date")) append_time_to_request(); ... -3.27. is_method(name) +3.27. is_method(name) Check if the method of the message matches the name. If name is a known method (invite, cancel, ack, bye, options, info, update, register, @@ -812,9 +812,9 @@ if(is_method("OPTION|UPDATE")) } ... -3.28. remove_hf(hname) +3.28. remove_hf(hname) - Remove from message all headers with name "hname". Header matching is + Remove from message all headers with name “hname”. Header matching is case-insensitive. Matches and removes also the compact header forms. Returns true if at least one header is found and removed. @@ -837,10 +837,10 @@ remove_hf("Contact") remove_hf("m") ... -3.29. remove_hf_re(re) +3.29. remove_hf_re(re) Remove from message all headers with name matching regular expression - "re" + “re” Returns true if at least one header is found and removed. @@ -858,16 +858,16 @@ if(remove_hf_re("^P-")) } ... -3.30. has_body(), has_body(mime) +3.30. has_body(), has_body(mime) The function returns true if the SIP message has a body attached. The - checked includes also the "Content-Length" header presence and value. + checked includes also the “Content-Length” header presence and value. If a parameter is given, the mime described will be also checked - against the "Content-Type" header. + against the “Content-Type” header. Meaning of the parameters is as follows: - * mime - mime to be checked against the "Content-Type" header. If not + * mime - mime to be checked against the “Content-Type” header. If not present or 0, this check will be disabled. This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE, @@ -881,7 +881,7 @@ if(has_body("application/sdp")) } ... -3.31. is_audio_on_hold() +3.31. is_audio_on_hold() The function returns true if the SIP message has a body attached and at least one audio stream in on hold. @@ -897,7 +897,7 @@ if(is_audio_on_hold()) } ... -3.32. is_privacy(privacy_type) +3.32. is_privacy(privacy_type) The function returns true if the SIP message has a Privacy header field that includes the given privacy_type among its privacy values. See @@ -915,7 +915,7 @@ if(is_privacy("id")) } ... -3.33. in_list(subject, list, separator) +3.33. in_list(subject, list, separator) Function checks if subject string is found in list string where list items are separated by separator string. Subject and list strings may @@ -933,7 +933,7 @@ if (in_list("$var(subject)", "$var(list)", ",") { } ... -3.34. cmp_str(str1, str2) +3.34. cmp_str(str1, str2) The function returns true if the two parameters matches as string case sensitive comparison. @@ -949,7 +949,7 @@ if(cmp_str("$rU", "kamailio")) } ... -3.35. cmp_istr(str1, str2) +3.35. cmp_istr(str1, str2) The function returns true if the two parameters matches as string case insensitive comparison. @@ -965,7 +965,7 @@ if(cmp_istr("$rU@you", "kamailio@YOU")) } ... -3.36. starts_with(str1, str2) +3.36. starts_with(str1, str2) The function returns true if the first string starts with the second string. @@ -981,7 +981,7 @@ if (starts_with("$rU", "+358")) } ... -3.37. set_body_multipart([txt,content_type][,boundary]) +3.37. set_body_multipart([txt,content_type][,boundary]) Set multipart body to a SIP message. If called with no parameters, will convert present body to multipart. @@ -999,11 +999,19 @@ if (starts_with("$rU", "+358")) The core will take care of the last boundary ending "--". Detecting wich one is the last and fixing the others if needed. + Note: it may be required that msg_apply_changes() from textops module + has to be executed if there are other operations over the new body. + Example 1.37. set_body_multipart usage ... set_body_multipart("test", "text/plain", "delimiter"); +msg_apply_changes(); +append_body_part(...); + ... -Will produce: + +# Will produce: + ... Content-Type: multipart/mixed;boundary="delimiter" Mime-Version: 1.0 @@ -1016,7 +1024,7 @@ text --delimiter ... -3.38. append_body_part(txt,content_type[, content_disposition]) +3.38. append_body_part(txt,content_type[, content_disposition]) Append a part on multipart body SIP message. Will use "unique-boundary-1" as boundary. @@ -1040,7 +1048,9 @@ $var(b) = "7e Od 04 55 75 69 20 4d 61 6b 65 43 61 6c 6c" append_body_part("$var(b)", "application/vnd.cirpack.isdn-ext", "signal;handling =required"); ... -Will append this the body: + +# Will append this to the body: + ... Content-Type: application/vnd.cirpack.isdn-ext Content-Disposition: signal;handling=required @@ -1050,7 +1060,7 @@ Content-Disposition: signal;handling=required --unique-boundary-1 ... -3.39. get_body_part(content_type, opv) +3.39. get_body_part(content_type, opv) Return the content of a multipart body SIP message, storing it in opv. @@ -1068,7 +1078,7 @@ Content-Disposition: signal;handling=required get_body_part("application/vnd.cirpack.isdn-ext", "$var(pbody)"); ... -3.40. get_body_part_raw(content_type, opv) +3.40. get_body_part_raw(content_type, opv) Return the content of a multipart body SIP message, including headers and boundary string, storing it in opv. @@ -1087,7 +1097,7 @@ get_body_part("application/vnd.cirpack.isdn-ext", "$var(pbody)"); get_body_part("application/vnd.cirpack.isdn-ext", "$var(hbody)"); ... -3.41. remove_body_part(content_type) +3.41. remove_body_part(content_type) Remove a part on a multipart body SIP message. @@ -1124,10 +1134,10 @@ Chapter 2. Developer Guide 1.1. load_textops(*import_structure) -1.1. load_textops(*import_structure) +1.1. load_textops(*import_structure) For programmatic use only--import the Textops API. Meaning of the parameters is as follows: - * import_structure - Pointer to the import structure - see "struct - textops_binds" in modules/textops/api.h + * import_structure - Pointer to the import structure - see “struct + textops_binds” in modules/textops/api.h diff --git a/modules/textops/doc/textops_admin.xml b/modules/textops/doc/textops_admin.xml index 1cbe72a0158..6180e4c7ed8 100644 --- a/modules/textops/doc/textops_admin.xml +++ b/modules/textops/doc/textops_admin.xml @@ -1391,13 +1391,22 @@ if (starts_with("$rU", "+358")) The core will take care of the last boundary ending "--". Detecting wich one is the last and fixing the others if needed. + + Note: it may be required that msg_apply_changes() from textops module + has to be executed if there are other operations over the new body. + <function>set_body_multipart</function> usage ... set_body_multipart("test", "text/plain", "delimiter"); +msg_apply_changes(); +append_body_part(...); + ... -Will produce: + +# Will produce: + ... Content-Type: multipart/mixed;boundary="delimiter" Mime-Version: 1.0 @@ -1452,7 +1461,9 @@ text $var(b) = "7e Od 04 55 75 69 20 4d 61 6b 65 43 61 6c 6c" append_body_part("$var(b)", "application/vnd.cirpack.isdn-ext", "signal;handling=required"); ... -Will append this the body: + +# Will append this to the body: + ... Content-Type: application/vnd.cirpack.isdn-ext Content-Disposition: signal;handling=required diff --git a/modules/textops/textops.c b/modules/textops/textops.c index 74d7726b450..b209e36c2c1 100644 --- a/modules/textops/textops.c +++ b/modules/textops/textops.c @@ -13,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @@ -973,7 +973,8 @@ static int filter_body_f(struct sip_msg* msg, char* _content_type, if (find_line_start(boundary.s, boundary.len, &start, &len)) { - if (del_lump(msg, start - msg->buf, len, 0) == 0) + /* we need to remove \r\n too */ + if (del_lump(msg, (start-2) - msg->buf, len+2, 0) == 0) { LM_ERR("deleting lump <%.*s> failed\n", len, start); goto err; @@ -1011,10 +1012,13 @@ int remove_hf_f(struct sip_msg* msg, char* str_hf, char* foo) cnt=0; /* we need to be sure we have seen all HFs */ - parse_headers(msg, HDR_EOH_F, 0); + if(parse_headers(msg, HDR_EOH_F, 0)<0) { + LM_ERR("error while parsing message headers\n"); + return -1; + } for (hf=msg->headers; hf; hf=hf->next) { - /* for well known header names str_hf->s will be set to NULL - during parsing of kamailio.cfg and str_hf->len contains + /* for well known header names str_hf->s will be set to NULL + during parsing of kamailio.cfg and str_hf->len contains the header type */ if(gp->type==GPARAM_TYPE_INT) { @@ -1049,7 +1053,10 @@ static int remove_hf_re_f(struct sip_msg* msg, char* key, char* foo) cnt=0; /* we need to be sure we have seen all HFs */ - parse_headers(msg, HDR_EOH_F, 0); + if(parse_headers(msg, HDR_EOH_F, 0)<0) { + LM_ERR("error while parsing message headers\n"); + return -1; + } for (hf=msg->headers; hf; hf=hf->next) { c = hf->name.s[hf->name.len]; @@ -1080,7 +1087,10 @@ static int is_present_hf_f(struct sip_msg* msg, char* str_hf, char* foo) gp = (gparam_p)str_hf; /* we need to be sure we have seen all HFs */ - parse_headers(msg, HDR_EOH_F, 0); + if(parse_headers(msg, HDR_EOH_F, 0)<0) { + LM_ERR("error while parsing message headers\n"); + return -1; + } for (hf=msg->headers; hf; hf=hf->next) { if(gp->type==GPARAM_TYPE_INT) { @@ -1107,7 +1117,10 @@ static int is_present_hf_re_f(struct sip_msg* msg, char* key, char* foo) re = (regex_t*)key; /* we need to be sure we have seen all HFs */ - parse_headers(msg, HDR_EOH_F, 0); + if(parse_headers(msg, HDR_EOH_F, 0)<0) { + LM_ERR("error while parsing message headers\n"); + return -1; + } for (hf=msg->headers; hf; hf=hf->next) { c = hf->name.s[hf->name.len]; @@ -1763,6 +1776,8 @@ int set_multibody_helper(struct sip_msg* msg, char* p1, char* p2, char* p3) } pkg_free(nbb); if(nc.s!=NULL) pkg_free(nc.s); + if(convert && nb.s!=NULL) pkg_free(nb.s); + if(convert && oc.s!=NULL) pkg_free(oc.s); LM_DBG("set flag FL_BODY_MULTIPART\n"); msg->msg_flags |= FL_BODY_MULTIPART; return 1; @@ -2211,7 +2226,7 @@ int add_hf_helper(struct sip_msg* msg, str *str1, str *str2, LM_ERR("error while parsing message\n"); return -1; } - + hf = 0; if(hfanc!=NULL) { for (hf=msg->headers; hf; hf=hf->next) { @@ -2262,7 +2277,7 @@ int add_hf_helper(struct sip_msg* msg, str *str1, str *str2, s0.s = 0; } } - + len=s0.len; if (str2) len+= str2->len + REQ_LINE(msg).uri.len; @@ -2896,7 +2911,10 @@ static int search_hf_f(struct sip_msg* msg, char* str_hf, char* re, char *flags) gp = (gparam_t*)str_hf; /* we need to be sure we have seen all HFs */ - parse_headers(msg, HDR_EOH_F, 0); + if(parse_headers(msg, HDR_EOH_F, 0)<0) { + LM_ERR("error while parsing message headers\n"); + return -1; + } for (hf=msg->headers; hf; hf=hf->next) { if(gp->type==GPARAM_TYPE_INT) { @@ -2977,7 +2995,10 @@ static int subst_hf_f(struct sip_msg *msg, char *str_hf, char *subst, char *flag se=(struct subst_expr*)subst; /* we need to be sure we have seen all HFs */ - parse_headers(msg, HDR_EOH_F, 0); + if(parse_headers(msg, HDR_EOH_F, 0)<0) { + LM_ERR("error while parsing message headers\n"); + return -1; + } for (hf=msg->headers; hf; hf=hf->next) { if(gp->type==GPARAM_TYPE_INT) { @@ -3017,7 +3038,7 @@ static int subst_hf_f(struct sip_msg *msg, char *str_hf, char *subst, char *flag ret=-1; goto error; } - /* hack to avoid re-copying rpl, possible because both + /* hack to avoid re-copying rpl, possible because both * replace_lst & lumps use pkg_malloc */ if (insert_new_lump_after(l, rpl->rpl.s, rpl->rpl.len, 0)==0) { diff --git a/modules/textopsx/README b/modules/textopsx/README index bbc859b0f85..b3ab14c2ab9 100644 --- a/modules/textopsx/README +++ b/modules/textopsx/README @@ -9,7 +9,7 @@ Daniel-Constantin Mierla asipto.com - Copyright 2003 FhG FOKUS + Copyright © 2003 FhG FOKUS __________________________________________________________________ Table of Contents @@ -109,7 +109,7 @@ Chapter 1. Admin Guide 2.13. exclude_hf_value(hf, hvalue) 2.14. hf_value_exists(hf, hvalue) -2.1. msg_apply_changes() +2.1. msg_apply_changes() Use this function to apply changes performed on SIP message content. Be careful when using this function; due to special handling of changes to @@ -123,7 +123,12 @@ Chapter 1. Admin Guide no longer valid for config processing, like it happens when a broken message is received from network). - This function can be used from REQUEST_ROUTE or ONREPLY_ROUTE. + This function can be used from REQUEST_ROUTE or core REPLY_ROUTE. + + Note: It must be used before the transaction is created in + request_route and not inside the onreply_route[name] executed by tm + module. Also, do not used after resuming a suspended request or reply, + at that moment the transaction is already created. Example 1.1. msg_apply_changes() usage ... @@ -138,7 +143,7 @@ if(msg_apply_changes()) } ... -2.2. change_reply_status(code, reason) +2.2. change_reply_status(code, reason) Intercept a SIP reply (in an onreply_route) and change its status code and reason phrase prior to forwarding it. @@ -159,7 +164,7 @@ onreply_route { } ... -2.3. remove_body() +2.3. remove_body() Use this function to remove the body of SIP requests or replies. @@ -170,7 +175,7 @@ onreply_route { remove_body(); ... -2.4. keep_hf([regexp]) +2.4. keep_hf([regexp]) Remove headers that don't match the regular expression regexp. Several header are ignored always (thus not removed): Via, From, To, Call-ID, @@ -186,7 +191,7 @@ remove_body(); keep_hf("User-Agent"); ... -2.5. fnmatch(value, expr [, flags]) +2.5. fnmatch(value, expr [, flags]) Match the value against the expr using shell-style pattern for file name matching (see man page for C function fnmatch()). It is known to @@ -205,7 +210,7 @@ if(fnmatch("$rU", "123*")) } ... -2.6. append_hf_value(hf, hvalue) +2.6. append_hf_value(hf, hvalue) Append new header value after an existing header, if no index acquired append at the end of list. Note that a header may consist of comma @@ -225,7 +230,7 @@ append_hf_value("foo[-1]", "$var(Bar)") # try add value to the last header, if n ot exists add new header ... -2.7. insert_hf_value(hf, hvalue) +2.7. insert_hf_value(hf, hvalue) Insert new header value before an existing header, if no index acquired insert before first hf header. Note that a header may consist of comma @@ -245,7 +250,7 @@ insert_hf_value("foo", "$avp(foo)") # add new header at the top of list insert_hf_value("foo[1]", "gogo") # try add to the first header ... -2.8. remove_hf_value(hf_par) +2.8. remove_hf_value(hf_par) Remove the header value from existing header, Note that a header may consist of comma delimited list of values. @@ -264,7 +269,7 @@ remove_hf_value("foo.bar") # delete parameter remove_hf_value("foo[*].bar") # for each foo delete bar parameters ... -2.9. remove_hf_value2(hf_par) +2.9. remove_hf_value2(hf_par) Remove specified header or parameter. It is expected header in Authorization format (comma delimiters are not treated as multi-value @@ -285,7 +290,7 @@ remove_hf_value2("foo.bar") # delete parameter remove_hf_value2("foo[*].bar") # for each foo delete bar parameters ... -2.10. assign_hf_value(hf, hvalue) +2.10. assign_hf_value(hf, hvalue) Assign value to specified header value / param. @@ -307,7 +312,7 @@ assign_hf_value("foo[*]", "") # remove all foo's, empty value remains assign_hf_value("foo[*].bar", "") # set empty value (ex. lr) ... -2.11. assign_hf_value2(hf, hvalue) +2.11. assign_hf_value2(hf, hvalue) Assign value to specified header. It is expected header in Authorization format (comma delimiters are not treated as multi-value @@ -327,7 +332,7 @@ assign_hf_value2("foo[-1]", "gogo") # foo[last_foo] assign_hf_value2("foo[*].bar", "") # set empty value (ex. lr) ... -2.12. include_hf_value(hf, hvalue) +2.12. include_hf_value(hf, hvalue) Add value in set if not exists, eg. "Supported: path,100rel". @@ -340,7 +345,7 @@ assign_hf_value2("foo[*].bar", "") # set empty value (ex. lr) include_hf_value("Supported", "path"); ... -2.13. exclude_hf_value(hf, hvalue) +2.13. exclude_hf_value(hf, hvalue) Remove value from set if exists, eg. "Supported: path,100rel". @@ -353,7 +358,7 @@ include_hf_value("Supported", "path"); exclude_hf_value("Supported", "100rel"); ... -2.14. hf_value_exists(hf, hvalue) +2.14. hf_value_exists(hf, hvalue) Check if value exists in set. Alternate select @hf_value_exists.HF.VALUE may be used. It returns one or zero. diff --git a/modules/textopsx/doc/functions.xml b/modules/textopsx/doc/functions.xml index 280b73048b3..28bc7f17da1 100644 --- a/modules/textopsx/doc/functions.xml +++ b/modules/textopsx/doc/functions.xml @@ -24,7 +24,13 @@ broken message is received from network). - This function can be used from REQUEST_ROUTE or ONREPLY_ROUTE. + This function can be used from REQUEST_ROUTE or core REPLY_ROUTE. + + + Note: It must be used before the transaction is created in + request_route and not inside the onreply_route[name] executed by tm + module. Also, do not used after resuming a suspended request or reply, + at that moment the transaction is already created. <function>msg_apply_changes()</function> usage diff --git a/modules/timer/README b/modules/timer/README index e6af28c8119..34e80249db4 100644 --- a/modules/timer/README +++ b/modules/timer/README @@ -4,7 +4,7 @@ Tomas Mandys Iptel.org - Copyright 2007 iptelorg GmbH + Copyright © 2007 iptelorg GmbH __________________________________________________________________ Table of Contents @@ -101,7 +101,7 @@ le"); 5.2. @timer.timer.timer_id.enabled 5.3. @timer.executed -5.1. timer_enable(timer_id, enable_disable) +5.1. timer_enable(timer_id, enable_disable) Enable/disable timer route specified by timer_id. Because of timer core API the callback is not disabled immediately but is removed from @@ -114,7 +114,7 @@ le"); timer_enable("MY_TIMER", 1); ... -5.2. @timer.timer.timer_id.enabled +5.2. @timer.timer.timer_id.enabled Return true ("1") if timer specified by timer_id is enabled, otherwise returns false ("0"). @@ -124,7 +124,7 @@ le"); .... } -5.3. @timer.executed +5.3. @timer.executed Returns name of timer which has been executed, i.e. non empty value is returned only when handler is being processed. diff --git a/modules/tls/README b/modules/tls/README index 75ebc01638d..d91ebec211c 100644 --- a/modules/tls/README +++ b/modules/tls/README @@ -8,9 +8,9 @@ Carsten Bock ng-voice GmbH - Copyright 2007 iptelorg GmbH + Copyright © 2007 iptelorg GmbH - Copyright 2014 ng-voice GmbH + Copyright © 2014 ng-voice GmbH __________________________________________________________________ Table of Contents @@ -191,7 +191,11 @@ Chapter 1. Admin Guide This module implements the TLS transport for Kamailio using the OpenSSL library (http://www.openssl.org). To enable the Kamailio TLS support this module must be loaded and enable_tls=yes core setting must be - added to the Kamailio config file + added to the Kamailio config file. + + IMPORTANT: tls module must be loaded before any other Kamailio module + that uses libssl (OpenSSL library). A safe option is to have tls module + loaded first (be in the first "loadmodule" inside Kamailio.cfg). 2. Quick Start diff --git a/modules/tls/doc/tls.xml b/modules/tls/doc/tls.xml index 22046d8d6a2..af4ff22bb20 100644 --- a/modules/tls/doc/tls.xml +++ b/modules/tls/doc/tls.xml @@ -2,7 +2,7 @@ + "xmlns:xi CDATA #FIXED 'http://www.w3.org/2001/XInclude'"> %docentities; @@ -48,8 +48,13 @@ This module implements the TLS transport for &kamailio; using the OpenSSL library (http://www.openssl.org). To enable the &kamailio; TLS support this - module must be loaded and enable_tls=yes core setting - must be added to the Kamailio config file + module must be loaded and enable_tls=yes core setting + must be added to the Kamailio config file. + + + IMPORTANT: tls module must be loaded before any other &kamailio; module + that uses libssl (OpenSSL library). A safe option is to have tls module + loaded first (be in the first "loadmodule" inside &kamailio;.cfg).
diff --git a/modules/tls/tls_bio.c b/modules/tls/tls_bio.c index aee1953ebd9..b0aae5b260b 100644 --- a/modules/tls/tls_bio.c +++ b/modules/tls/tls_bio.c @@ -1,4 +1,4 @@ -/* +/* * Kamailio TLS module * * Copyright (C) 2010 iptelorg GmbH @@ -63,6 +63,7 @@ static int tls_bio_mbuf_puts(BIO* b, const char* s); static long tls_bio_mbuf_ctrl(BIO* b, int cmd, long arg1, void* arg2); +#if OPENSSL_VERSION_NUMBER < 0x010100000L static BIO_METHOD tls_mbuf_method = { BIO_TYPE_TLS_MBUF, /* type */ "sr_tls_mbuf", /* name */ @@ -75,12 +76,35 @@ static BIO_METHOD tls_mbuf_method = { tls_bio_mbuf_free, /* destroy(free) function */ 0 /* ctrl callback */ }; +#else +static BIO_METHOD *tls_mbuf_method = NULL; +#endif /** returns a custom tls_mbuf BIO. */ BIO_METHOD* tls_BIO_mbuf(void) { +#if OPENSSL_VERSION_NUMBER < 0x010100000L return &tls_mbuf_method; +#else + if(tls_mbuf_method != NULL) { + return tls_mbuf_method; + } + tls_mbuf_method = BIO_meth_new(BIO_TYPE_TLS_MBUF, "sr_tls_mbuf"); + if(tls_mbuf_method==NULL) { + LM_ERR("cannot get a new bio method structure\n"); + return NULL; + } + BIO_meth_set_write(tls_mbuf_method, tls_bio_mbuf_write); + BIO_meth_set_read(tls_mbuf_method, tls_bio_mbuf_read); + BIO_meth_set_puts(tls_mbuf_method, tls_bio_mbuf_puts); + BIO_meth_set_gets(tls_mbuf_method, NULL); + BIO_meth_set_ctrl(tls_mbuf_method, tls_bio_mbuf_ctrl); + BIO_meth_set_create(tls_mbuf_method, tls_bio_mbuf_new); + BIO_meth_set_destroy(tls_mbuf_method, tls_bio_mbuf_free); + BIO_meth_set_callback_ctrl(tls_mbuf_method, NULL); + return tls_mbuf_method; +#endif } @@ -91,7 +115,7 @@ BIO_METHOD* tls_BIO_mbuf(void) BIO* tls_BIO_new_mbuf(struct tls_mbuf* rd, struct tls_mbuf* wr) { BIO* ret; - + TLS_BIO_DBG("tls_BIO_new_mbuf called (%p, %p)\n", rd, wr); ret = BIO_new(tls_BIO_mbuf()); if (unlikely(ret == 0)) @@ -111,16 +135,24 @@ BIO* tls_BIO_new_mbuf(struct tls_mbuf* rd, struct tls_mbuf* wr) int tls_BIO_mbuf_set(BIO* b, struct tls_mbuf* rd, struct tls_mbuf* wr) { struct tls_bio_mbuf_data* d; - + TLS_BIO_DBG("tls_BIO_mbuf_set called (%p => %p, %p)\n", b, rd, wr); - if (unlikely(b->ptr == 0)){ - BUG("null BIO ptr\n"); +#if OPENSSL_VERSION_NUMBER < 0x010100000L + d = b->ptr; +#else + d = BIO_get_data(b); +#endif + if (unlikely(d == 0)){ + BUG("null BIO ptr data\n"); return 0; } - d = b->ptr; d->rd = rd; d->wr = wr; +#if OPENSSL_VERSION_NUMBER < 0x010100000L b->init = 1; +#else + BIO_set_init(b, 1); +#endif return 1; } @@ -133,8 +165,9 @@ int tls_BIO_mbuf_set(BIO* b, struct tls_mbuf* rd, struct tls_mbuf* wr) static int tls_bio_mbuf_new(BIO* b) { struct tls_bio_mbuf_data* d; - + TLS_BIO_DBG("tls_bio_mbuf_new called (%p)\n", b); +#if OPENSSL_VERSION_NUMBER < 0x010100000L b->init = 0; /* not initialized yet */ b->num = 0; b->ptr = 0; @@ -145,6 +178,14 @@ static int tls_bio_mbuf_new(BIO* b) d->rd = 0; d->wr = 0; b->ptr = d; +#else + BIO_set_init(b, 0); + BIO_set_data(b, NULL); + d = OPENSSL_zalloc(sizeof(*d)); + if (unlikely(d == 0)) + return 0; + BIO_set_data(b, d); +#endif return 1; } @@ -159,11 +200,23 @@ static int tls_bio_mbuf_free(BIO* b) TLS_BIO_DBG("tls_bio_mbuf_free called (%p)\n", b); if (unlikely( b == 0)) return 0; +#if OPENSSL_VERSION_NUMBER < 0x010100000L if (likely(b->ptr)){ OPENSSL_free(b->ptr); b->ptr = 0; b->init = 0; } +#else + do { + struct tls_bio_mbuf_data* d; + d = BIO_get_data(b); + if (likely(d)) { + OPENSSL_free(d); + BIO_set_data(b, NULL); + BIO_set_init(b, 0); + } + } while(0); +#endif return 1; } @@ -179,10 +232,14 @@ static int tls_bio_mbuf_read(BIO* b, char* dst, int dst_len) struct tls_bio_mbuf_data* d; struct tls_mbuf* rd; int ret; - + ret = 0; if (likely(dst)) { - d= b->ptr; +#if OPENSSL_VERSION_NUMBER < 0x010100000L + d = b->ptr; +#else + d = BIO_get_data(b); +#endif BIO_clear_retry_flags(b); if (unlikely(d == 0 || d->rd->buf == 0)) { if (d == 0) @@ -232,9 +289,13 @@ static int tls_bio_mbuf_write(BIO* b, const char* src, int src_len) struct tls_bio_mbuf_data* d; struct tls_mbuf* wr; int ret; - + ret = 0; - d= b->ptr; +#if OPENSSL_VERSION_NUMBER < 0x010100000L + d = b->ptr; +#else + d = BIO_get_data(b); +#endif BIO_clear_retry_flags(b); if (unlikely(d == 0 || d->wr->buf == 0)) { if (d == 0) @@ -306,12 +367,10 @@ static long tls_bio_mbuf_ctrl(BIO* b, int cmd, long arg1, void* arg2) static int tls_bio_mbuf_puts(BIO* b, const char* s) { int len; - + TLS_BIO_DBG("puts called (%p, %s)\n", b, s); len=strlen(s); return tls_bio_mbuf_write(b, s, len); } - - /* vi: set ts=4 sw=4 tw=79:ai:cindent: */ diff --git a/modules/tls/tls_config.c b/modules/tls/tls_config.c index af1d88a0324..fc631550b48 100644 --- a/modules/tls/tls_config.c +++ b/modules/tls/tls_config.c @@ -400,12 +400,16 @@ tls_domains_cfg_t* tls_load_config(str* filename) pkg_free(file_path); file_path = NULL; while (read(in_fd, &ch, 1)) { - write(out_fd, &ch, 1); + if (write(out_fd, &ch, 1)<0) { + LOG(L_ERR, "write error: %s\n", strerror(errno)); + } } close(in_fd); in_fd = 0; ch = '\n'; - write(out_fd, &ch, 1); + if (write(out_fd, &ch, 1)<0) { + LOG(L_ERR, "write error: %s\n", strerror(errno)); + } } } closedir(dir); diff --git a/modules/tls/tls_domain.c b/modules/tls/tls_domain.c index e64e8bd1d3f..bf8d0f23f6e 100644 --- a/modules/tls/tls_domain.c +++ b/modules/tls/tls_domain.c @@ -107,19 +107,31 @@ static unsigned char dh3072_g[] = { 0x02 }; static void setup_dh(SSL_CTX *ctx) { - DH *dh; + DH *dh; + BIGNUM *p; + BIGNUM *g; - dh = DH_new(); - if (dh == NULL) { - return; - } + dh = DH_new(); + if (dh == NULL) { + return; + } + + p = BN_bin2bn(dh3072_p, sizeof(dh3072_p), NULL); + g = BN_bin2bn(dh3072_g, sizeof(dh3072_g), NULL); + + if (p == NULL || g == NULL) { + DH_free(dh); + return; + } + +#if (OPENSSL_VERSION_NUMBER >= 0x1010000fL) + /* libssl >= v1.1.0 */ + DH_set0_pqg(dh, p, NULL, g); +#else + dh->p = p; + dh->g = g; +#endif - dh->p = BN_bin2bn(dh3072_p, sizeof(dh3072_p), NULL); - dh->g = BN_bin2bn(dh3072_g, sizeof(dh3072_g), NULL); - if (dh->p == NULL || dh->g == NULL) { - DH_free(dh); - return; - } SSL_CTX_set_options(ctx, SSL_OP_SINGLE_DH_USE); SSL_CTX_set_tmp_dh(ctx, dh); @@ -713,11 +725,13 @@ static void sr_ssl_ctx_info_callback(const SSL *ssl, int event, int ret) if(data==0) data = (struct tls_extra_data*)SSL_get_app_data(ssl); LOG(tls_dbg, "SSL handshake done\n"); +#if OPENSSL_VERSION_NUMBER < 0x010100000L /* CVE-2009-3555 - disable renegotiation */ if (ssl->s3) { LOG(tls_dbg, "SSL disable renegotiation\n"); ssl->s3->flags |= SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS; } +#endif data->flags |= F_TLS_CON_HANDSHAKED; } } @@ -835,6 +849,7 @@ static int tls_ssl_ctx_mode(SSL_CTX* ctx, long mode, void* clear) */ static int tls_ssl_ctx_set_freelist(SSL_CTX* ctx, long val, void* unused) { +#if OPENSSL_VERSION_NUMBER < 0x010100000L if (val >= 0) #if OPENSSL_VERSION_NUMBER >= 0x01000000L #ifndef OPENSSL_NO_BUF_FREELISTS @@ -843,6 +858,7 @@ static int tls_ssl_ctx_set_freelist(SSL_CTX* ctx, long val, void* unused) #endif #if defined (OPENSSL_NO_BUF_FREELISTS) || OPENSSL_VERSION_NUMBER < 0x01000000L return -1; +#endif #endif return 0; } @@ -927,7 +943,7 @@ static int tls_server_name_cb(SSL *ssl, int *ad, void *private) /* SSL_set_SSL_CTX only sets the correct certificate parameters, but does set the proper verify options. Thus this will be done manually! */ - SSL_set_options(ssl, SSL_CTX_get_options(ssl->ctx)); + SSL_set_options(ssl, SSL_CTX_get_options(SSL_get_SSL_CTX(ssl))); if ((SSL_get_verify_mode(ssl) == SSL_VERIFY_NONE) || (SSL_num_renegotiations(ssl) == 0)) { /* @@ -937,8 +953,8 @@ static int tls_server_name_cb(SSL *ssl, int *ad, void *private) * Otherwise, we would possibly reset a per-directory * configuration which was put into effect by ssl_hook_access. */ - SSL_set_verify(ssl, SSL_CTX_get_verify_mode(ssl->ctx), - SSL_CTX_get_verify_callback(ssl->ctx)); + SSL_set_verify(ssl, SSL_CTX_get_verify_mode(SSL_get_SSL_CTX(ssl)), + SSL_CTX_get_verify_callback(SSL_get_SSL_CTX(ssl))); } return SSL_TLSEXT_ERR_OK; diff --git a/modules/tls/tls_init.c b/modules/tls/tls_init.c index d7f3cef9167..af2d4c54efa 100644 --- a/modules/tls/tls_init.c +++ b/modules/tls/tls_init.c @@ -1,4 +1,4 @@ -/* +/* * TLS module * * Copyright (C) 2005,2006 iptelorg GmbH @@ -43,7 +43,7 @@ #include #include #include - + #include "../../dprint.h" #include "../../mem/shm_mem.h" #include "../../tcp_init.h" @@ -160,7 +160,7 @@ inline static int backtrace2str(char* buf, int size) char* next; char* s; char* e; - + p=buf; end=buf+size; bt_size=backtrace(bt, sizeof(bt)/sizeof(bt[0])); bt_strs=backtrace_symbols(bt, bt_size); @@ -203,7 +203,7 @@ static void* ser_malloc(size_t size, const char* file, int line) #ifdef RAND_NULL_MALLOC static ticks_t st=0; - /* start random null returns only after + /* start random null returns only after * NULL_GRACE_PERIOD from first call */ if (st==0) st=get_ticks(); if (((get_ticks()-st)address_str.len, si->address_str.s, si->port_no); + si->address_str.len, si->address_str.s, si->port_no); goto error; } - + si->proto = PROTO_TLS; return 0; - - error: + +error: if (si->socket != -1) { close(si->socket); si->socket = -1; @@ -326,7 +348,7 @@ int tls_h_init_si(struct socket_info *si) /* - * initialize ssl methods + * initialize ssl methods */ static void init_ssl_methods(void) { @@ -338,11 +360,13 @@ static void init_ssl_methods(void) ssl_methods[TLS_USE_SSLv23 - 1] = SSLv23_method(); /* only specific SSL or TLS version */ +#if OPENSSL_VERSION_NUMBER < 0x010100000L #ifndef OPENSSL_NO_SSL2 ssl_methods[TLS_USE_SSLv2_cli - 1] = SSLv2_client_method(); ssl_methods[TLS_USE_SSLv2_srv - 1] = SSLv2_server_method(); ssl_methods[TLS_USE_SSLv2 - 1] = SSLv2_method(); #endif +#endif #ifndef OPENSSL_NO_SSL3_METHOD ssl_methods[TLS_USE_SSLv3_cli - 1] = SSLv3_client_method(); @@ -384,16 +408,17 @@ static void init_ssl_methods(void) */ static int init_tls_compression(void) { +#if OPENSSL_VERSION_NUMBER < 0x010100000L #if OPENSSL_VERSION_NUMBER >= 0x00908000L int n, r; STACK_OF(SSL_COMP)* comp_methods; SSL_COMP* zlib_comp; long ssl_version; - + /* disabling compression */ # ifndef SSL_COMP_ZLIB_IDX # define SSL_COMP_ZLIB_IDX 1 /* openssl/ssl/ssl_ciph.c:84 */ -# endif +# endif comp_methods = SSL_COMP_get_compression_methods(); if (comp_methods == 0) { LOG(L_INFO, "tls: init_tls: compression support disabled in the" @@ -419,7 +444,7 @@ static int init_tls_compression(void) DBG("tls: init_tls: found compression method %p id %d\n", zlib_comp, zlib_comp->id); if (zlib_comp->id == SSL_COMP_ZLIB_IDX) { - DBG("tls: init_tls: found zlib compression (%d)\n", + DBG("tls: init_tls: found zlib compression (%d)\n", SSL_COMP_ZLIB_IDX); break /* found */; } else { @@ -438,7 +463,7 @@ static int init_tls_compression(void) "bug workaround (replacing zlib COMP method with " "our own version)\n"); /* hack: make sure that the CRYPTO_EX_INDEX_COMP class is empty - * and it does not contain any free_ex_data from the + * and it does not contain any free_ex_data from the * built-in zlib. This can happen if the current openssl * zlib malloc fix patch is used (CRYPTO_get_ex_new_index() in * COMP_zlib()). Unfortunately the only way @@ -447,7 +472,7 @@ static int init_tls_compression(void) * (only the COMP class is initialized before). */ CRYPTO_cleanup_all_ex_data(); - + if (fixed_c_zlib_init() != 0) { LOG(L_CRIT, "tls: init_tls: BUG: failed to initialize zlib" " compression fix, disabling compression...\n"); @@ -468,6 +493,7 @@ static int init_tls_compression(void) } end: #endif /* OPENSSL_VERSION_NUMBER >= 0.9.8 */ +#endif /* OPENSSL_VERSION_NUMBER < 1.1.0 */ return 0; } @@ -478,16 +504,30 @@ static int init_tls_compression(void) */ int tls_pre_init(void) { - /* - * this has to be called before any function calling CRYPTO_malloc, - * CRYPTO_malloc will set allow_customize in openssl to 0 - */ +#if OPENSSL_VERSION_NUMBER < 0x010100000L + void *(*mf)(size_t) = NULL; + void *(*rf)(void *, size_t) = NULL; + void (*ff)(void *) = NULL; +#else + void *(*mf)(size_t, const char *, int) = NULL; + void *(*rf)(void *, size_t, const char *, int) = NULL; + void (*ff)(void *, const char *, int) = NULL; +#endif + + /* + * this has to be called before any function calling CRYPTO_malloc, + * CRYPTO_malloc will set allow_customize in openssl to 0 + */ #ifdef TLS_MALLOC_DBG if (!CRYPTO_set_mem_ex_functions(ser_malloc, ser_realloc, ser_free)) { #else if (!CRYPTO_set_mem_functions(ser_malloc, ser_realloc, ser_free)) { #endif ERR("Unable to set the memory allocation functions\n"); + CRYPTO_get_mem_functions(&mf, &rf, &ff); + ERR("libssl current mem functions - m: %p r: %p f: %p\n", mf, rf, ff); + ERR("Be sure tls module is loaded before any other module using libssl" + " (can be loaded first to be safe)\n"); return -1; } @@ -509,7 +549,7 @@ int tls_mod_pre_init_h(void) LM_DBG("already mod pre-initialized\n"); return 0; } - DBG("============= :preparing tls env for modules initialization\n"); + DBG("preparing tls env for modules initialization\n"); SSL_library_init(); SSL_load_error_strings(); tls_mod_preinitialized=1; @@ -545,8 +585,10 @@ int init_tls_h(void) #endif ssl_version=SSLeay(); /* check if version have the same major minor and fix level - * (e.g. 0.9.8a & 0.9.8c are ok, but 0.9.8 and 0.9.9x are not) */ - if ((ssl_version>>8)!=(OPENSSL_VERSION_NUMBER>>8)){ + * (e.g. 0.9.8a & 0.9.8c are ok, but 0.9.8 and 0.9.9x are not) + * - values is represented as 0xMMNNFFPPS: major minor fix patch status + * 0x00090705f == 0.9.7e release */ + if ((ssl_version>>12)!=(OPENSSL_VERSION_NUMBER>>12)){ LOG(L_CRIT, "ERROR: tls: init_tls_h: installed openssl library " "version is too different from the library the Kamailio tls module " "was compiled with: installed \"%s\" (0x%08lx), compiled " @@ -576,7 +618,7 @@ int init_tls_h(void) lib_cflags=SSLeay_version(SSLEAY_CFLAGS); lib_kerberos=0; lib_zlib=0; - if ((lib_cflags==0) || strstr(lib_cflags, "not available")){ + if ((lib_cflags==0) || strstr(lib_cflags, "not available")){ lib_kerberos=-1; lib_zlib=-1; }else{ @@ -585,7 +627,7 @@ int init_tls_h(void) if (strstr(lib_cflags, "-DKRB5_")) lib_kerberos=1; } - LOG(L_INFO, "tls: _init_tls_h: compiled with openssl version " + LOG(L_INFO, "tls: _init_tls_h: compiled with openssl version " "\"%s\" (0x%08lx), kerberos support: %s, compression: %s\n", OPENSSL_VERSION_TEXT, (long)OPENSSL_VERSION_NUMBER, kerberos_support?"on":"off", comp_support?"on":"off"); @@ -623,7 +665,7 @@ int init_tls_h(void) /* if openssl compiled with kerberos support, and openssl < 0.9.8e-dev * or openssl between 0.9.9-dev and 0.9.9-beta1 apply workaround for * openssl bug #1467 */ - if (ssl_version < 0x00908050L || + if (ssl_version < 0x00908050L || (ssl_version >= 0x00909000L && ssl_version < 0x00909001L)){ openssl_kssl_malloc_bug=1; LOG(L_WARN, "tls: init_tls_h: openssl kerberos malloc bug detected, " @@ -651,7 +693,7 @@ int init_tls_h(void) " workaround enabled (on low memory tls operations will fail" " preemptively) with free memory thresholds %d and %d bytes\n", low_mem_threshold1, low_mem_threshold2); - + if (shm_available()==(unsigned long)(-1)){ LOG(L_WARN, "tls: Kamailio is compiled without MALLOC_STATS support:" " the workaround for low mem. openssl bugs will _not_ " @@ -659,8 +701,9 @@ int init_tls_h(void) low_mem_threshold1=0; low_mem_threshold2=0; } - if ((low_mem_threshold1 != cfg_get(tls, tls_cfg, low_mem_threshold1)) || - (low_mem_threshold2 != cfg_get(tls, tls_cfg, low_mem_threshold2))) { + if ((low_mem_threshold1 != cfg_get(tls, tls_cfg, low_mem_threshold1)) + || (low_mem_threshold2 + != cfg_get(tls, tls_cfg, low_mem_threshold2))) { /* ugly hack to set the initial values for the mem tresholds */ if (cfg_register_ctx(&cfg_ctx, 0)) { ERR("failed to register cfg context\n"); @@ -685,7 +728,7 @@ int init_tls_h(void) return -1; } } - + init_ssl_methods(); tls_mod_initialized = 1; return 0; diff --git a/modules/tls/tls_locking.c b/modules/tls/tls_locking.c index 3515f019b69..b969186bd2a 100644 --- a/modules/tls/tls_locking.c +++ b/modules/tls/tls_locking.c @@ -145,6 +145,10 @@ int tls_init_locks() n_static_locks=0; } if (n_static_locks){ + if (CRYPTO_get_locking_callback()!=NULL) { + LM_CRIT("ssl locking callback already set\n"); + return -1; + } static_locks=lock_set_alloc(n_static_locks); if (static_locks==0){ LOG(L_CRIT, "ERROR: tls_init_locking: could not allocate lockset" diff --git a/modules/tls/tls_mod.c b/modules/tls/tls_mod.c index c4478b28333..3446c8c0294 100644 --- a/modules/tls/tls_mod.c +++ b/modules/tls/tls_mod.c @@ -1,7 +1,7 @@ /* * TLS module * - * Copyright (C) 2007 iptelorg GmbH + * Copyright (C) 2007 iptelorg GmbH * Copyright (C) Motorola Solutions, Inc. * * Permission to use, copy, modify, and distribute this software for any @@ -84,7 +84,7 @@ MODULE_VERSION str sr_tls_xavp_cfg = {0, 0}; /* - * Default settings when modparams are used + * Default settings when modparams are used */ static tls_domain_t mod_params = { TLS_DOMAIN_DEF | TLS_DOMAIN_SRV, /* Domain Type */ @@ -193,11 +193,11 @@ static param_export_t params[] = { {"session_id", PARAM_STR, &default_tls_cfg.session_id }, {"config", PARAM_STR, &default_tls_cfg.config_file }, {"tls_disable_compression", PARAM_INT, - &default_tls_cfg.disable_compression}, + &default_tls_cfg.disable_compression}, {"ssl_release_buffers", PARAM_INT, &default_tls_cfg.ssl_release_buffers}, {"ssl_freelist_max_len", PARAM_INT, &default_tls_cfg.ssl_freelist_max}, {"ssl_max_send_fragment", PARAM_INT, - &default_tls_cfg.ssl_max_send_fragment}, + &default_tls_cfg.ssl_max_send_fragment}, {"ssl_read_ahead", PARAM_INT, &default_tls_cfg.ssl_read_ahead}, {"send_close_notify", PARAM_INT, &default_tls_cfg.send_close_notify}, {"con_ct_wq_max", PARAM_INT, &default_tls_cfg.con_ct_wq_max}, @@ -253,11 +253,11 @@ static struct tls_hooks tls_h = { static tls_domains_cfg_t* tls_use_modparams(void) { tls_domains_cfg_t* ret; - + ret = tls_new_cfg(); if (!ret) return; - + } #endif @@ -333,8 +333,8 @@ static int mod_init(void) goto error; } - /* if (init_tls() < 0) return -1; */ - + /* if (init_tls() < 0) return -1; */ + tls_domains_cfg_lock = lock_alloc(); if (tls_domains_cfg_lock == 0) { ERR("Unable to create TLS configuration lock\n"); @@ -350,7 +350,7 @@ static int mod_init(void) goto error; } if (cfg_get(tls, tls_cfg, config_file).s) { - *tls_domains_cfg = + *tls_domains_cfg = tls_load_config(&cfg_get(tls, tls_cfg, config_file)); if (!(*tls_domains_cfg)) goto error; } else { @@ -379,7 +379,7 @@ static int mod_child(int rank) { if (tls_disable || (tls_domains_cfg==0)) return 0; - /* fix tls config only from the main proc/PROC_INIT., when we know + /* fix tls config only from the main proc/PROC_INIT., when we know * the exact process number and before any other process starts*/ if (rank == PROC_INIT){ if (cfg_get(tls, tls_cfg, config_file).s){ @@ -399,7 +399,7 @@ static int mod_child(int rank) static void destroy(void) { /* tls is destroyed via the registered destroy_tls_h callback - => nothing to do here */ + * => nothing to do here */ } diff --git a/modules/tls/tls_server.c b/modules/tls/tls_server.c index 880fae25aa7..20faa4febae 100644 --- a/modules/tls/tls_server.c +++ b/modules/tls/tls_server.c @@ -258,12 +258,14 @@ static int tls_complete_init(struct tcp_connection* c) } #endif +#if OPENSSL_VERSION_NUMBER < 0x010100000L #ifdef TLS_KSSL_WORKARROUND /* if needed apply workaround for openssl bug #1467 */ if (data->ssl->kssl_ctx && openssl_kssl_malloc_bug){ kssl_ctx_free(data->ssl->kssl_ctx); data->ssl->kssl_ctx=0; } +#endif #endif SSL_set_bio(data->ssl, data->rwbio, data->rwbio); c->extra_data = data; diff --git a/modules/tls/tls_verify.c b/modules/tls/tls_verify.c index 728006dece9..1da392a7f20 100644 --- a/modules/tls/tls_verify.c +++ b/modules/tls/tls_verify.c @@ -30,7 +30,7 @@ /* FIXME: remove this and use the value in domains instead */ #define VERIFY_DEPTH_S 3 -/* This callback is called during each verification process, +/* This callback is called during each verification process, at each step during the chain of certificates (this function is not the certificate_verification one!). */ int verify_callback(int pre_verify_ok, X509_STORE_CTX *ctx) { @@ -44,49 +44,54 @@ int verify_callback(int pre_verify_ok, X509_STORE_CTX *ctx) { LOG(L_NOTICE, "tls_init: verify_callback: cert chain too long ( depth > VERIFY_DEPTH_S)\n"); pre_verify_ok=0; } - + if( pre_verify_ok ) { LOG(L_NOTICE, "tls_init: verify_callback: preverify is good: verify return: %d\n", pre_verify_ok); return pre_verify_ok; } - + err_cert = X509_STORE_CTX_get_current_cert(ctx); - err = X509_STORE_CTX_get_error(ctx); + err = X509_STORE_CTX_get_error(ctx); X509_NAME_oneline(X509_get_subject_name(err_cert),buf,sizeof buf); - + LOG(L_NOTICE, "tls_init: verify_callback: subject = %s\n", buf); - LOG(L_NOTICE, "tls_init: verify_callback: verify error:num=%d:%s\n", err, X509_verify_cert_error_string(err)); - LOG(L_NOTICE, "tls_init: verify_callback: error code is %d\n", ctx->error); - - switch (ctx->error) { + LOG(L_NOTICE, "tls_init: verify_callback: verify error - num=%d:%s\n", err, + X509_verify_cert_error_string(err)); + LOG(L_NOTICE, "tls_init: verify_callback: error code is %d (depth: %d)\n", + err, depth); + + switch (err) { + case X509_V_OK: + LOG(L_NOTICE, "tls_init: verify_callback: all ok\n"); + break; case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: - X509_NAME_oneline(X509_get_issuer_name(ctx->current_cert),buf,sizeof buf); + X509_NAME_oneline(X509_get_issuer_name(err_cert),buf,sizeof buf); LOG(L_NOTICE, "tls_init: verify_callback: issuer= %s\n",buf); break; - + case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: case X509_V_ERR_CERT_NOT_YET_VALID: LOG(L_NOTICE, "tls_init: verify_callback: notBefore\n"); break; - + case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: case X509_V_ERR_CERT_HAS_EXPIRED: LOG(L_NOTICE, "tls_init: verify_callback: notAfter\n"); break; - + case X509_V_ERR_CERT_SIGNATURE_FAILURE: case X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: LOG(L_NOTICE, "tls_init: verify_callback: unable to decrypt cert signature\n"); break; - + case X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: LOG(L_NOTICE, "tls_init: verify_callback: unable to decode issuer public key\n"); break; - + case X509_V_ERR_OUT_OF_MEM: ERR("tls_init: verify_callback: Out of memory \n"); break; - + case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: LOG(L_NOTICE, "tls_init: verify_callback: Self signed certificate issue\n"); @@ -110,12 +115,14 @@ int verify_callback(int pre_verify_ok, X509_STORE_CTX *ctx) { case X509_V_ERR_CERT_REJECTED: LOG(L_NOTICE, "tls_init: verify_callback: certificate rejected\n"); break; - + default: - LOG(L_NOTICE, "tls_init: verify_callback: something wrong with the cert ... error code is %d (check x509_vfy.h)\n", ctx->error); + LOG(L_NOTICE, "tls_init: verify_callback: something wrong with the" + " cert ... error code is %d (check x509_vfy.h)\n", + err); break; } - + LOG(L_NOTICE, "tls_init: verify_callback: verify return:%d\n", pre_verify_ok); return(pre_verify_ok); } diff --git a/modules/tm/README b/modules/tm/README index 9b31ebc1e9f..78c7a0afbb2 100644 --- a/modules/tm/README +++ b/modules/tm/README @@ -8,9 +8,9 @@ Juha Heinanen - Copyright 2003 FhG FOKUS + Copyright © 2003 FhG FOKUS - Copyright 2008 Juha Heinanen + Copyright © 2008 Juha Heinanen __________________________________________________________________ Table of Contents @@ -420,13 +420,13 @@ Chapter 1. Admin Guide Note Several Kamailio TM module functions are now implemented in the TMX - module: "modules_k/tmx". Check it to see if what you are looking for is + module: “modules_k/tmx”. Check it to see if what you are looking for is there. 2. Serial Forking Based on Q Value A single SIP INVITE request may be forked to multiple destinations. We - call the set of all such destinations a "destination set". Individual + call the set of all such destinations a “destination set”. Individual elements within the destination sets are called branches. The script writer can add URIs to the destination set from the configuration file, or they can be loaded from the user location database. Each registered @@ -459,7 +459,7 @@ Note and t_next_contacts(). Every branch in the destination set is assigned a priority number, also - known as the "q value". The q value is a floating point number in a + known as the “q value”. The q value is a floating point number in a range 0 to 1.0. The higher the q value number, the more priority is given to the particular branch in the destination set. Branches with q value 1.0 have maximum priority, such branches should be always be @@ -1573,7 +1573,7 @@ modparam("tm", "dns_reuse_rcv_socket", 1) The name of XAVP storing the attributes per contact. This must be the same as the usrloc parameter xavp_contacts. - Default value is "NULL". + Default value is “NULL”. Example 1.46. Set xavp_contact parameter ... @@ -1634,7 +1634,7 @@ modparam("tm|usrloc", "xavp_contact", "ulattrs") 5.50. t_use_uac_headers() 5.51. t_is_retr_async_reply() -5.1. t_relay([host, port]) +5.1. t_relay([host, port]) Relay a message statefully either to the destination indicated in the current URI (if called without any parameters) or to the specified host @@ -1662,7 +1662,7 @@ if (!t_relay()) }; ... -5.2. t_relay_to_udp([ip, port]) +5.2. t_relay_to_udp([ip, port]) Relay a message statefully using a fixed protocol either to the specified fixed destination or to a destination derived from the @@ -1688,19 +1688,19 @@ else t_relay_to_tcp(); # relay to msg. uri, but over tcp ... -5.3. t_relay_to_tcp([ip, port]) +5.3. t_relay_to_tcp([ip, port]) See function t_relay_to_udp([ip, port]). -5.4. t_relay_to_tls([ip, port]) +5.4. t_relay_to_tls([ip, port]) See function t_relay_to_udp([ip, port]). -5.5. t_relay_to_sctp([ip, port]) +5.5. t_relay_to_sctp([ip, port]) See function t_relay_to_udp([ip, port]). -5.6. t_on_failure(failure_route) +5.6. t_on_failure(failure_route) Sets failure routing block, to which control is passed after a transaction completed with a negative result but before sending a final @@ -1737,7 +1737,7 @@ failure_route[1] { See test/onr.cfg for a more complex example of combination of serial with parallel forking. -5.7. t_on_branch_failure(branch_failure_route) +5.7. t_on_branch_failure(branch_failure_route) Sets the branch_failure routing block, to which control is passed on each negative response to a transaction. This route is run before @@ -1770,7 +1770,7 @@ event_route[tm:branch-failure:myroute] { } ... -5.8. t_on_reply(onreply_route) +5.8. t_on_reply(onreply_route) Sets the reply routing block, to which control is passed when a reply for the current transaction is received. Note that the set of commands @@ -1800,7 +1800,7 @@ es'); } } -5.9. t_on_branch(branch_route) +5.9. t_on_branch(branch_route) Sets the branch routing block, to which control is passed after forking (when a new branch is created). For now branch routes are intended only @@ -1824,7 +1824,7 @@ branch_route[1] { } } -5.10. t_newtran() +5.10. t_newtran() Creates a new transaction, returns a negative value on error. This is the only way a script can add a new transaction in an atomic way. @@ -1840,7 +1840,7 @@ if (t_newtran()) { See test/uas.cfg for more examples. -5.11. t_reply(code, reason_phrase) +5.11. t_reply(code, reason_phrase) Sends a stateful reply after a transaction has been established. See t_newtran for usage. @@ -1865,7 +1865,7 @@ if (t_newtran()) { t_reply("404", "Not found"); ... -5.12. t_lookup_request() +5.12. t_lookup_request() Checks if a transaction exists. Returns a positive value if so, negative otherwise. Most likely you will not want to use it, as a @@ -1880,7 +1880,7 @@ if (t_lookup_request()) { }; ... -5.13. t_retransmit_reply() +5.13. t_retransmit_reply() Retransmits a reply sent previously by UAS transaction. @@ -1889,7 +1889,7 @@ if (t_lookup_request()) { t_retransmit_reply(); ... -5.14. t_release() +5.14. t_release() Remove transaction from memory (it will be first put on a wait timer to absorb delayed messages). @@ -1899,7 +1899,7 @@ t_retransmit_reply(); t_release(); ... -5.15. t_forward_nonack([ip, port]) +5.15. t_forward_nonack([ip, port]) Mainly for internal usage -- forward a non-ACK request statefully. Variants of this functions can enforce a specific transport protocol. @@ -1913,23 +1913,23 @@ t_release(); t_forward_nonack("1.2.3.4", "5060"); ... -5.16. t_forward_nonack_udp(ip, port) +5.16. t_forward_nonack_udp(ip, port) See function t_forward_nonack([ip, port]). -5.17. t_forward_nonack_tcp(ip, port) +5.17. t_forward_nonack_tcp(ip, port) See function t_forward_nonack([ip, port]). -5.18. t_forward_nonack_tls(ip, port) +5.18. t_forward_nonack_tls(ip, port) See function t_forward_nonack([ip, port]). -5.19. t_forward_nonack_sctp(ip, port) +5.19. t_forward_nonack_sctp(ip, port) See function t_forward_nonack([ip, port]). -5.20. t_set_fr(fr_inv_timeout [, fr_timeout]) +5.20. t_set_fr(fr_inv_timeout [, fr_timeout]) Sets the fr_inv_timeout and optionally fr_timeout for the current transaction or for transactions created during the same script @@ -1963,7 +1963,7 @@ branch_route[1] { } } -5.21. t_reset_fr() +5.21. t_reset_fr() Resets the fr_inv_timer and fr_timer for the current transaction to the default values (set using the tm module parameters fr_inv_timer and @@ -1982,7 +1982,7 @@ route { ... } -5.22. t_set_max_lifetime(inv_lifetime, noninv_lifetime) +5.22. t_set_max_lifetime(inv_lifetime, noninv_lifetime) Sets the maximum lifetime for the current INVITE or non-INVITE transaction, or for transactions created during the same script @@ -2011,7 +2011,7 @@ route { # INVITE and to 15s if not } -5.23. t_reset_max_lifetime() +5.23. t_reset_max_lifetime() Resets the the maximum lifetime for the current INVITE or non-INVITE transaction to the default value (set using the tm module parameter @@ -2030,7 +2030,7 @@ route { ... } -5.24. t_set_retr(retr_t1_interval, retr_t2_interval) +5.24. t_set_retr(retr_t1_interval, retr_t2_interval) Sets the retr_t1_interval and retr_t2_interval for the current transaction or for transactions created during the same script @@ -2076,7 +2076,7 @@ branch_route[1] { } } -5.25. t_reset_retr() +5.25. t_reset_retr() Resets the retr_timer1 and retr_timer2 for the current transaction to the default values (set using the tm module parameters retr_timer1 and @@ -2095,7 +2095,7 @@ route { ... } -5.26. t_set_auto_inv_100(0|1) +5.26. t_set_auto_inv_100(0|1) Switch automatically sending 100 replies to INVITEs on/off on a per transaction basis. It overrides the auto_inv_100 value for the current @@ -2112,7 +2112,7 @@ route { ... } -5.27. t_branch_timeout() +5.27. t_branch_timeout() Returns true if the failure route is executed for a branch that did timeout. It can be used from failure_route and branch-failure event @@ -2127,7 +2127,7 @@ failure_route[0]{ } } -5.28. t_branch_replied() +5.28. t_branch_replied() Returns true if the failure route is executed for a branch that did receive at least one reply in the past (the "current" reply is not @@ -2146,7 +2146,7 @@ failure_route[0]{ } } -5.29. t_any_timeout() +5.29. t_any_timeout() Returns true if at least one of the current transactions branches did timeout. @@ -2162,7 +2162,7 @@ failure_route[0]{ } } -5.30. t_any_replied() +5.30. t_any_replied() Returns true if at least one of the current transactions branches did receive some reply in the past. If called from a failure or onreply @@ -2177,7 +2177,7 @@ onreply_route[0]{ } } -5.31. t_grep_status("code") +5.31. t_grep_status("code") Returns true if "code" is the final reply received (or locally generated) in at least one of the current transactions branches. @@ -2191,7 +2191,7 @@ onreply_route[0]{ } } -5.32. t_is_canceled() +5.32. t_is_canceled() Returns true if the current transaction was canceled. @@ -2204,7 +2204,7 @@ failure_route[0]{ } } -5.33. t_is_expired() +5.33. t_is_expired() Returns true if the current transaction has already been expired, i.e. the max_inv_lifetime/max_noninv_lifetime interval has already elapsed. @@ -2218,7 +2218,7 @@ failure_route[0]{ } } -5.34. t_relay_cancel() +5.34. t_relay_cancel() Forwards the CANCEL if the corresponding INVITE transaction exists. The function is supposed to be used at the very beginning of the script, @@ -2243,7 +2243,7 @@ if (method == CANCEL) { # do the same as for INVITEs } -5.35. t_lookup_cancel([1]) +5.35. t_lookup_cancel([1]) Returns true if the corresponding INVITE transaction exists for a CANCEL request. The function can be called at the beginning of the @@ -2275,7 +2275,7 @@ if (method == CANCEL) { # do the same as for INVITEs } -5.36. t_drop_replies([mode]) +5.36. t_drop_replies([mode]) Drops all the previously received replies in failure_route block to make sure that none of them is picked up again. @@ -2303,7 +2303,7 @@ failure_route[0]{ } } -5.37. t_save_lumps() +5.37. t_save_lumps() Forces the modifications of the processed SIP message to be saved in shared memory before t_relay() is called. The new branches which are @@ -2343,7 +2343,7 @@ failure_route[1] { t_relay(); } -5.38. t_load_contacts() +5.38. t_load_contacts() This is the first of the three functions that can be used to implement serial/parallel forking based on q and +sip.instance values of @@ -2385,7 +2385,7 @@ if (!t_load_contacts()) { }; ... -5.39. t_next_contacts() +5.39. t_next_contacts() Function t_next_contacts() is the second of the three functions that can be used to implement serial/parallel forking based on the q value @@ -2437,7 +2437,7 @@ if (!t_next_contacts()) { }; ... -5.40. t_next_contact_flow() +5.40. t_next_contact_flow() Function t_next_contact_flow() is the last of the three functions that can be used to implement serial/parallel forking based on the q value @@ -2467,9 +2467,9 @@ event_route[tm:branch-failure:outbound] } ... -5.41. t_check_status(re) +5.41. t_check_status(re) - Returns true if the regular expresion "re" match the reply code of the + Returns true if the regular expresion “re” match the reply code of the response message as follows: * in routing block - the code of the last sent reply. * in on_reply block - the code of the current received reply. @@ -2485,7 +2485,7 @@ if (t_check_status("(487)|(408)")) { } ... -5.42. t_check_trans() +5.42. t_check_trans() t_check_trans() can be used to quickly check if a message belongs or is related to a transaction. It behaves differently for different types of @@ -2537,7 +2537,7 @@ if ( method == "CANCEL" && !t_check_trans()) sl_reply("403", "cancel out of the blue forbidden"); # note: in this example t_check_trans() can be replaced by t_lookup_cancel() -5.43. t_set_disable_6xx(0|1) +5.43. t_set_disable_6xx(0|1) Turn off/on 6xx replies special rfc conformant handling on a per transaction basis. If turned off (t_set_disable_6xx("1")) 6XXs will be @@ -2556,7 +2556,7 @@ route { ... } -5.44. t_set_disable_failover(0|1) +5.44. t_set_disable_failover(0|1) Turn off/on dns failover on a per transaction basis. @@ -2571,7 +2571,7 @@ route { ... } -5.45. t_set_disable_internal_reply(0|1) +5.45. t_set_disable_internal_reply(0|1) Turn off/on sending internally a SIP reply in case of relay errors. @@ -2583,7 +2583,7 @@ if(!t_relay()) { } ... -5.46. t_replicate([params]) +5.46. t_replicate([params]) Replicate the SIP request to a specific address. @@ -2619,7 +2619,7 @@ t_replicate("sip:$var(h);transport=tls"); t_replicate_to_udp("1.2.3.4", "5060"); ... -5.47. t_relay_to(proxy, flags) +5.47. t_relay_to(proxy, flags) Forward the SIP request to a specific address, controlling internal behavior via flags. @@ -2652,7 +2652,7 @@ t_relay_to("tls:1.2.3.4"); t_relay_to("0x01"); ... -5.48. t_set_no_e2e_cancel_reason(0|1) +5.48. t_set_no_e2e_cancel_reason(0|1) Enables/disables reason header (RFC 3326) copying from the triggering received CANCEL to the generated hop-by-hop CANCEL. 0 enables and 1 @@ -2676,7 +2676,7 @@ opying ... } -5.49. t_is_set(target) +5.49. t_is_set(target) Return true if the attribute specified by 'target' is set for transaction. @@ -2695,7 +2695,7 @@ if(!t_is_set("failure_route")) LM_DBG("no failure route will be executed for current transaction\n"); ... -5.50. t_use_uac_headers() +5.50. t_use_uac_headers() Set internal flags to tell tm to use UAC side for building headers for local generated requests (ACK, CANCEL) - useful when changing From/To @@ -2708,7 +2708,7 @@ if(!t_is_set("failure_route")) t_use_uac_headers(); ... -5.51. t_is_retr_async_reply() +5.51. t_is_retr_async_reply() Check to see if the reply is a retransmitted reply on a transaction that is currently suspended asynchronously (suspended during reply @@ -2811,7 +2811,7 @@ end of body 6.2. Functions -6.2.1. register_tmcb(cb_type, cb_func) +6.2.1. register_tmcb(cb_type, cb_func) For programmatic use only--register a function to be called back on an event. See t_hooks.h for more details. @@ -2820,7 +2820,7 @@ end of body * cb_type - Callback type. * cb_func - Callback function. -6.2.2. load_tm(*import_structure) +6.2.2. load_tm(*import_structure) For programmatic use only--import exported TM functions. See the acc module for an example of use. @@ -2828,7 +2828,7 @@ end of body Meaning of the parameters is as follows: * import_structure - Pointer to the import structure. -6.2.3. int t_suspend(struct sip_msg *msg, unsigned int *hash_index, unsigned +6.2.3. int t_suspend(struct sip_msg *msg, unsigned int *hash_index, unsigned int *label) For programmatic use only. This function together with t_continue() can @@ -2866,7 +2866,7 @@ int *label) t_suspend() should return 0 to make sure that the script processing does not continue. -6.2.4. int t_continue(unsigned int hash_index, unsigned int label, struct +6.2.4. int t_continue(unsigned int hash_index, unsigned int label, struct action *route) For programmatic use only. This function is the pair of t_suspend(), @@ -2882,7 +2882,7 @@ action *route) Return value: 0 - success, <0 - error. -6.2.5. int t_cancel_suspend(unsigned int hash_index, unsigned int label) +6.2.5. int t_cancel_suspend(unsigned int hash_index, unsigned int label) For programmatic use only. This function is for revoking t_suspend() from the same process as it was executed before. t_cancel_suspend() can @@ -2902,7 +2902,7 @@ action *route) 7.1. event_route[tm:branch-failure] -7.1. event_route[tm:branch-failure] +7.1. event_route[tm:branch-failure] Named branch failure routes can be defined to run when when a failure response is received. This allows handling failures on individual diff --git a/modules/tm/config.c b/modules/tm/config.c index ee290aec135..2fc745b792d 100644 --- a/modules/tm/config.c +++ b/modules/tm/config.c @@ -34,6 +34,9 @@ #include "config.h" struct cfg_group_tm default_tm_cfg = { + "trying -- your call is important to us", /* tm_auto_inv_100_r */ + "Server Internal Error", /* default_reason */ + STR_NULL, /* ac_extra_hdrs */ /* should be request-uri matching used as a part of pre-3261 * transaction matching, as the standard wants us to do so * (and is reasonable to do so, to be able to distinguish @@ -65,16 +68,13 @@ struct cfg_group_tm default_tm_cfg = { MAX_NONINV_LIFETIME, /* tm_max_noninv_lifetime */ 1, /* noisy_ctimer */ 1, /* tm_auto_inv_100 */ - "trying -- your call is important to us", /* tm_auto_inv_100_r */ 500, /* tm_unix_tx_timeout -- 500 ms by default */ 1, /* restart_fr_on_each_reply */ 0, /* pass_provisional_replies */ 1, /* tm_aggregate_auth */ UM_CANCEL_STATEFULL, /* unmatched_cancel */ 500, /* default_code */ - "Server Internal Error", /* default_reason */ 1, /* reparse_invite */ - STR_NULL, /* ac_extra_hdrs */ 0, /* tm_blst_503 -- if 1 blacklist 503 sources, using tm_blst_503_min, * tm_blst_503_max, tm_blst_503_default and the Retry-After header @@ -100,6 +100,15 @@ struct cfg_group_tm default_tm_cfg = { void *tm_cfg = &default_tm_cfg; cfg_def_t tm_cfg_def[] = { + {"auto_inv_100_reason", CFG_VAR_STRING, 0, 0, 0, 0, + "reason text of the automatically send 100 to an INVITE"}, + {"default_reason", CFG_VAR_STRING, 0, 0, 0, 0, + "default SIP reason phrase sent by t_reply(), if the function " + "cannot retrieve its parameters"}, + {"ac_extra_hdrs", CFG_VAR_STR, 0, 0, 0, 0, + "header fields prefixed by this parameter value are included " + "in the CANCEL and negative ACK messages if they were present " + "in the outgoing INVITE (depends on reparse_invite)"}, {"ruri_matching", CFG_VAR_INT | CFG_ATOMIC, 0, 1, 0, 0, "perform Request URI check in transaction matching"}, {"via1_matching", CFG_VAR_INT | CFG_ATOMIC, 0, 1, 0, 0, @@ -136,8 +145,6 @@ cfg_def_t tm_cfg_def[] = { "will be always replied"}, {"auto_inv_100", CFG_VAR_INT | CFG_ATOMIC, 0, 1, 0, 0, "automatically send 100 to an INVITE"}, - {"auto_inv_100_reason", CFG_VAR_STRING, 0, 0, 0, 0, - "reason text of the automatically send 100 to an INVITE"}, {"unix_tx_timeout", CFG_VAR_INT, 0, 0, 0, 0, "Unix socket transmission timeout, in milliseconds"}, {"restart_fr_on_each_reply", CFG_VAR_INT | CFG_ATOMIC , 0, 1, 0, 0, @@ -155,17 +162,10 @@ cfg_def_t tm_cfg_def[] = { {"default_code", CFG_VAR_INT | CFG_ATOMIC, 400, 699, 0, 0, "default SIP response code sent by t_reply(), if the function " "cannot retrieve its parameters"}, - {"default_reason", CFG_VAR_STRING, 0, 0, 0, 0, - "default SIP reason phrase sent by t_reply(), if the function " - "cannot retrieve its parameters"}, {"reparse_invite", CFG_VAR_INT, 0, 1, 0, 0, "if set to 1, the CANCEL and negative ACK requests are " "constructed from the INVITE message which was sent out " "instead of building them from the received request"}, - {"ac_extra_hdrs", CFG_VAR_STR, 0, 0, 0, 0, - "header fields prefixed by this parameter value are included " - "in the CANCEL and negative ACK messages if they were present " - "in the outgoing INVITE (depends on reparse_invite)"}, {"blst_503", CFG_VAR_INT | CFG_ATOMIC, 0, 1, 0, 0, "if set to 1, blacklist 503 SIP response sources"}, {"blst_503_def_timeout", CFG_VAR_INT | CFG_ATOMIC, 0, 0, 0, 0, diff --git a/modules/tm/config.h b/modules/tm/config.h index 7081dd31673..5e748894d5f 100644 --- a/modules/tm/config.h +++ b/modules/tm/config.h @@ -99,6 +99,9 @@ #define SUBST_CHAR '!' struct cfg_group_tm { + char *tm_auto_inv_100_r; + char *default_reason; + str ac_extra_hdrs; int ruri_matching; int via1_matching; int callid_matching; @@ -113,16 +116,13 @@ struct cfg_group_tm { unsigned int tm_max_noninv_lifetime; int noisy_ctimer; int tm_auto_inv_100; - char *tm_auto_inv_100_r; int tm_unix_tx_timeout; int restart_fr_on_each_reply; int pass_provisional_replies; int tm_aggregate_auth; int unmatched_cancel; int default_code; - char *default_reason; int reparse_invite; - str ac_extra_hdrs; int tm_blst_503; int tm_blst_503_default; int tm_blst_503_min; diff --git a/modules/tm/h_table.h b/modules/tm/h_table.h index 0cbe24cfebd..c6b334b0320 100644 --- a/modules/tm/h_table.h +++ b/modules/tm/h_table.h @@ -182,13 +182,11 @@ typedef struct ua_server /* User Agent Client content */ -#define TM_UAC_FLAGS -#ifdef TM_UAC_FLAGS /* UAC internal flags */ -#define TM_UAC_FLAG_RR 1 /* Record-Route applied */ -#define TM_UAC_FLAG_R2 2 /* 2nd Record-Route applied */ -#define TM_UAC_FLAG_FB 4 /* Mark first entry in new branch set */ -#endif +#define TM_UAC_FLAG_RR (1) /* Record-Route applied */ +#define TM_UAC_FLAG_R2 (1<<1) /* 2nd Record-Route applied */ +#define TM_UAC_FLAG_FB (1<<2) /* Mark first entry in new branch set */ +#define TM_UAC_FLAG_BLIND (1<<3) /* A blind uac */ typedef struct ua_client { @@ -197,7 +195,7 @@ typedef struct ua_client char *end_reply; /* pointer to end of sip_msg so we know the shm blocked used in clone...(used in async replies) */ struct retr_buf request; /* we maintain a separate copy of cancel rather than - reuse the structure for original request; the + reuse the structure for original request; the original request is no longer needed but its delayed timer may fire and interfere with whoever tries to rewrite it @@ -216,10 +214,8 @@ typedef struct ua_client /* if we don't store, we at least want to know the status */ int last_received; -#ifdef TM_UAC_FLAGS /* internal flags per tm uac */ unsigned int flags; -#endif /* per branch flags */ flag_t branch_flags; /* internal processing code - (mapping over sip warning codes) diff --git a/modules/tm/t_append_branches.c b/modules/tm/t_append_branches.c index f38a0a21efa..f745e755d03 100644 --- a/modules/tm/t_append_branches.c +++ b/modules/tm/t_append_branches.c @@ -127,7 +127,9 @@ int t_append_branches(void) { found = 0; for (i=0; iuac[i].ruid.len == ruid.len - && !memcmp(t->uac[i].ruid.s, ruid.s, ruid.len)) { + && !memcmp(t->uac[i].ruid.s, ruid.s, ruid.len) + && t->uac[i].uri.len == current_uri.len + && !memcmp(t->uac[i].uri.s, current_uri.s, current_uri.len)) { LM_DBG("branch already added [%.*s]\n", ruid.len, ruid.s); found = 1; break; diff --git a/modules/tm/t_cancel.c b/modules/tm/t_cancel.c index 9db7abe1767..9702f65aa99 100644 --- a/modules/tm/t_cancel.c +++ b/modules/tm/t_cancel.c @@ -43,7 +43,7 @@ typedef struct cancel_reason_map { } cancel_reason_map_t; static cancel_reason_map_t _cancel_reason_map[] = { - { 200, str_init("Answered elsewhere") }, + { 200, str_init("Call completed elsewhere") }, { 0, {0, 0} } }; diff --git a/modules/tm/t_cancel.h b/modules/tm/t_cancel.h index f8fe1189dd6..d3289388f0f 100644 --- a/modules/tm/t_cancel.h +++ b/modules/tm/t_cancel.h @@ -103,9 +103,14 @@ inline short static prepare_cancel_branch( struct cell *t, int b, int noreply ) int last_received; unsigned long old; + /* blind uac branch (e.g., suspend) without outgoing request */ + if((t->uac[b].flags & TM_UAC_FLAG_BLIND) + && t->uac[b].request.buffer==NULL) + return 0; + last_received=t->uac[b].last_received; - /* if noreply=1 cancel even if no reply received (in this case - * cancel_branch() won't actually send the cancel but it will do the + /* if noreply=1 cancel even if no reply received (in this case + * cancel_branch() won't actually send the cancel but it will do the * cleanup) */ if (last_received<200 && (noreply || last_received>=100)){ old=atomic_cmpxchg_long((void*)&t->uac[b].local_cancel.buffer, 0, diff --git a/modules/tm/t_fwd.c b/modules/tm/t_fwd.c index 15f0969af1c..4bf74efcce2 100644 --- a/modules/tm/t_fwd.c +++ b/modules/tm/t_fwd.c @@ -536,13 +536,11 @@ static int prepare_new_uac( struct cell *t, struct sip_msg *i_req, memcpy( t->uac[branch].location_ua.s, i_req->location_ua.s, i_req->location_ua.len); } -#ifdef TM_UAC_FLAGS len = count_applied_lumps(i_req->add_rm, HDR_RECORDROUTE_T); if(len==1) t->uac[branch].flags = TM_UAC_FLAG_RR; else if(len==2) t->uac[branch].flags = TM_UAC_FLAG_RR|TM_UAC_FLAG_R2; -#endif ret=0; @@ -699,6 +697,8 @@ int add_blind_uac( /*struct cell *t*/ ) t->flags |= T_NOISY_CTIMER_FLAG; membar_write(); /* to allow lockless prepare_to_cancel() we want to be sure all the writes finished before updating branch number*/ + + t->uac[branch].flags |= TM_UAC_FLAG_BLIND; t->nr_of_outgoings=(branch+1); t->async_backup.blind_uac = branch; /* whenever we create a blind UAC, lets save the current branch * this is used in async tm processing specifically to be able to route replies @@ -999,7 +999,7 @@ int add_uac_dns_fallback(struct cell *t, struct sip_msg* msg, "branches exceeded\n"); if (lock_replies) UNLOCK_REPLIES(t); - ret=ser_error=E_TOO_MANY_BRANCHES; + ret=ser_error=E_TOO_MANY_BRANCHES; return ret; } /* copy the dns handle into the new uac */ @@ -1268,9 +1268,19 @@ void e2e_cancel( struct sip_msg *cancel_msg, t_reply( t_cancel, cancel_msg, 200, CANCEL_DONE ); return; } - + /* determine which branches to cancel ... */ prepare_to_cancel(t_invite, &cancel_bm, 0); + + /* no branches to cancel (e.g., a suspended transaction with blind uac) */ + if (cancel_bm==0){ + /* no outgoing branches yet => force a reply to the invite */ + t_reply( t_invite, t_invite->uas.request, 487, CANCELED ); + DBG("DEBUG: e2e_cancel: e2e cancel -- no active branches\n"); + t_reply( t_cancel, cancel_msg, 200, CANCEL_DONE ); + return; + } + #ifdef E2E_CANCEL_HOP_BY_HOP /* we don't need to set t_cancel label to be the same as t_invite if * we do hop by hop cancel. The cancel transaction will have a different @@ -1299,7 +1309,7 @@ void e2e_cancel( struct sip_msg *cancel_msg, } } #endif /* CANCEL_REASON_SUPPORT */ - for (i=0; inr_of_outgoings; i++) + for (i=0; inr_of_outgoings; i++) { if (cancel_bm & (1< free it */ @@ -1714,10 +1725,8 @@ int t_forward_nonack( struct cell *t, struct sip_msg* p_msg , return lowest_ret; } -#ifdef TM_UAC_FLAGS /* mark the fist branch in this fwd step */ t->uac[first_branch].flags |= TM_UAC_FLAG_FB; -#endif ser_error=0; /* clear branch adding errors */ /* send them out now */ diff --git a/modules/tm/t_msgbuilder.c b/modules/tm/t_msgbuilder.c index ded1b473894..09bb6dcd4df 100644 --- a/modules/tm/t_msgbuilder.c +++ b/modules/tm/t_msgbuilder.c @@ -1456,29 +1456,6 @@ static inline char* print_callid(char* w, dlg_t* dialog, struct cell* t) return w; } -/* -* Find the first occurrence of find in s, where the search is limited to the -* first slen characters of s. -*/ -static -char * _strnstr(const char* s, const char* find, size_t slen) { - char c, sc; - size_t len; - - if ((c = *find++) != '\0') { - len = strlen(find); - do { - do { - if (slen-- < 1 || (sc = *s++) == '\0') - return (NULL); - } while (sc != c); - if (len > slen) - return (NULL); - } while (strncmp(s, find, len) != 0); - s--; - } - return ((char *)s); -} /* * Create a request diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c index 9011c87e5dd..cf56de701b7 100644 --- a/modules/tm/t_reply.c +++ b/modules/tm/t_reply.c @@ -1333,6 +1333,7 @@ static enum rps t_should_relay_response( struct cell *Trans , int new_code, drop_replies = failure_reply_mode; replies_dropped = 0; + tm_ctx_set_branch_index(picked_branch); /* run ON_FAILURE handlers ( route and callbacks) */ if (unlikely(has_tran_tmcbs( Trans, TMCB_ON_FAILURE_RO|TMCB_ON_FAILURE) || Trans->uac[picked_branch].on_failure )) { @@ -2057,7 +2058,7 @@ enum rps local_reply( struct cell *t, struct sip_msg *p_msg, int branch, } } UNLOCK_REPLIES(t); - + if (local_winner >= 0 && cfg_get(tm, tm_cfg, pass_provisional_replies) && winning_code < 200) { @@ -2068,7 +2069,7 @@ enum rps local_reply( struct cell *t, struct sip_msg *p_msg, int branch, winning_msg, winning_code); } } - + if (local_winner>=0 && winning_code>=200 ) { DBG("DEBUG: local transaction completed %d/%d (totag retr: %d/%d)\n", winning_code, local_winner, totag_retr, t->tmcb_hl.reg_types); @@ -2173,7 +2174,7 @@ int reply_received( struct sip_msg *p_msg ) DBG("DEBUG: reply to local CANCEL processed\n"); goto done; } - + onreply_route=uac->on_reply; if ( msg_status >= 200 ){ #ifdef TM_ONREPLY_FINAL_DROP_OK @@ -2186,7 +2187,7 @@ int reply_received( struct sip_msg *p_msg ) #endif /* TM_ONREPLY_FINAL_DROP_OK */ /* stop final response timer & retr. if I got a final response */ - stop_rb_timers(&uac->request); + stop_rb_timers(&uac->request); /* acknowledge negative INVITE replies (do it before detailed * on_reply processing, which may take very long, like if it * is attempted to establish a TCP connection to a fail-over dst */ @@ -2194,23 +2195,24 @@ int reply_received( struct sip_msg *p_msg ) if (msg_status >= 300) { ack = build_ack(p_msg, t, branch, &ack_len); if (ack) { - if (SEND_PR_BUFFER(&uac->request, ack, ack_len)>=0) - if (unlikely(has_tran_tmcbs(t, TMCB_REQUEST_SENT))){ - INIT_TMCB_ONSEND_PARAMS(onsend_params, - t->uas.request, p_msg, &uac->request, - &uac->request.dst, ack, ack_len, - TMCB_LOCAL_F, branch, TYPE_LOCAL_ACK); - run_trans_callbacks_off_params(TMCB_REQUEST_SENT, t, - &onsend_params); - } - if (unlikely(has_tran_tmcbs(t, TMCB_ACK_NEG_IN))){ + if (SEND_PR_BUFFER(&uac->request, ack, ack_len)>=0) { + if (unlikely(has_tran_tmcbs(t, TMCB_REQUEST_SENT))){ INIT_TMCB_ONSEND_PARAMS(onsend_params, t->uas.request, p_msg, &uac->request, &uac->request.dst, ack, ack_len, TMCB_LOCAL_F, branch, TYPE_LOCAL_ACK); - run_trans_callbacks_off_params(TMCB_ACK_NEG_IN, t, + run_trans_callbacks_off_params(TMCB_REQUEST_SENT, t, &onsend_params); } + } + if (unlikely(has_tran_tmcbs(t, TMCB_ACK_NEG_IN))){ + INIT_TMCB_ONSEND_PARAMS(onsend_params, + t->uas.request, p_msg, &uac->request, + &uac->request.dst, ack, ack_len, + TMCB_LOCAL_F, branch, TYPE_LOCAL_ACK); + run_trans_callbacks_off_params(TMCB_ACK_NEG_IN, t, + &onsend_params); + } shm_free(ack); } } else if (is_local(t) /*&& 200 <= msg_status < 300*/) { @@ -2219,7 +2221,7 @@ int reply_received( struct sip_msg *p_msg ) if (msg_send(&lack_dst, ack, ack_len)<0) LOG(L_ERR, "Error while sending local ACK\n"); else if (unlikely(has_tran_tmcbs(t, TMCB_REQUEST_SENT))){ - INIT_TMCB_ONSEND_PARAMS(onsend_params, + INIT_TMCB_ONSEND_PARAMS(onsend_params, t->uas.request, p_msg, &uac->request, &lack_dst, ack, ack_len, TMCB_LOCAL_F, branch, TYPE_LOCAL_ACK); @@ -2251,7 +2253,7 @@ int reply_received( struct sip_msg *p_msg ) }else if (atomic_cmpxchg_long((void*)&uac->local_cancel.buffer, 0, (long)BUSY_BUFFER)==0){ /* try to rebuild it if empty (not set or marked as BUSY). - * if BUSY or set just exit, a cancel will be (or was) sent + * if BUSY or set just exit, a cancel will be (or was) sent * shortly on this branch */ DBG("tm: reply_received: branch CANCEL created\n"); #ifdef CANCEL_REASON_SUPPORT @@ -2393,13 +2395,13 @@ int reply_received( struct sip_msg *p_msg ) p_msg->rcv.proto, &p_msg->rcv.src_su) ){ blst_503_timeout=cfg_get(tm, tm_cfg, tm_blst_503_default); - if ((parse_headers(p_msg, HDR_RETRY_AFTER_F, 0)==0) && + if ((parse_headers(p_msg, HDR_RETRY_AFTER_F, 0)==0) && (p_msg->parsed_flag & HDR_RETRY_AFTER_F)){ for (hf=p_msg->headers; hf; hf=hf->next) if (hf->type==HDR_RETRY_AFTER_T){ /* found */ blst_503_timeout=(unsigned)(unsigned long)hf->parsed; - blst_503_timeout=MAX_unsigned(blst_503_timeout, + blst_503_timeout=MAX_unsigned(blst_503_timeout, cfg_get(tm, tm_cfg, tm_blst_503_min)); blst_503_timeout=MIN_unsigned(blst_503_timeout, cfg_get(tm, tm_cfg, tm_blst_503_max)); @@ -2434,7 +2436,7 @@ int reply_received( struct sip_msg *p_msg ) } } #endif - + if (unlikely(p_msg->msg_flags&FL_RPL_SUSPENDED)) { goto skip_send_reply; /* suspend the reply (async), no error */ @@ -2471,7 +2473,7 @@ int reply_received( struct sip_msg *p_msg ) cleanup_uac_timers( t ); /* 2xx is a special case: we can have a COMPLETED request * with branches still open => we have to cancel them */ - if (is_invite(t) && cancel_data.cancel_bitmap) + if (is_invite(t) && cancel_data.cancel_bitmap) cancel_uacs( t, &cancel_data, F_CANCEL_B_KILL); /* FR for negative INVITES, WAIT anything else */ /* Call to set_final_timer is embedded in relay_reply to avoid @@ -2497,7 +2499,7 @@ int reply_received( struct sip_msg *p_msg ) restart_rb_fr(& uac->request, t->fr_inv_timeout); uac->request.flags|=F_RB_FR_INV; /* mark fr_inv */ } /* provisional replies */ - + skip_send_reply: if (likely(replies_locked)){ diff --git a/modules/tm/t_serial.c b/modules/tm/t_serial.c index 2fb734f23ec..85d02470d4c 100644 --- a/modules/tm/t_serial.c +++ b/modules/tm/t_serial.c @@ -548,7 +548,9 @@ int t_next_contacts(struct sip_msg* msg, char* key, char* value) } /* Rewrite Request-URI */ - rewrite_uri(msg, &uri); + if(rewrite_uri(msg, &uri)<0) { + LM_WARN("failed to rewrite r-uri\n"); + } if (dst_uri.len) { set_dst_uri(msg, &dst_uri); @@ -557,7 +559,9 @@ int t_next_contacts(struct sip_msg* msg, char* key, char* value) } if (path.len) { - set_path_vector(msg, &path); + if(set_path_vector(msg, &path)<0) { + LM_WARN("failed to set path vector\n"); + } } else { reset_path_vector(msg); } diff --git a/modules/tm/t_suspend.c b/modules/tm/t_suspend.c index dc783c92e12..6bb25473b37 100644 --- a/modules/tm/t_suspend.c +++ b/modules/tm/t_suspend.c @@ -13,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -22,6 +22,7 @@ #include "../../action.h" #include "../../script_cb.h" #include "../../dset.h" +#include "../../cfg/cfg_struct.h" #include "config.h" #include "sip_msg.h" @@ -120,7 +121,7 @@ int t_suspend(struct sip_msg *msg, if (t_check( msg , &branch )==-1){ LOG(L_ERR, "ERROR: t_suspend_reply: " \ "failed find UAC branch\n"); - return -1; + return -1; } LM_DBG("found a a match with branch id [%d] - " "cloning reply message to t->uac[branch].reply\n", branch); @@ -176,6 +177,9 @@ int t_continue(unsigned int hash_index, unsigned int label, int reply_status; int do_put_on_wait; struct hdr_field *hdr, *prev = 0, *tmp = 0; + int route_type_bk; + + cfg_update(); if (t_lookup_ident(&t, hash_index, label) < 0) { LM_ERR("transaction not found\n"); @@ -204,8 +208,11 @@ int t_continue(unsigned int hash_index, unsigned int label, t->flags |= T_ASYNC_CONTINUE; /* we can now know anywhere in kamailio * that we are executing post a suspend */ + /* transaction is no longer suspended, resetting the SUSPEND flag */ + t->flags &= ~T_ASYNC_SUSPENDED; + /* which route block type were we in when we were suspended */ - cb_type = FAILURE_CB_TYPE;; + cb_type = FAILURE_CB_TYPE; switch (t->async_backup.backup_route) { case REQUEST_ROUTE: cb_type = FAILURE_CB_TYPE; @@ -221,17 +228,17 @@ int t_continue(unsigned int hash_index, unsigned int label, break; } - if(t->async_backup.backup_route != TM_ONREPLY_ROUTE){ - branch = t->async_backup.blind_uac; /* get the branch of the blind UAC setup - * during suspend */ + if(t->async_backup.backup_route != TM_ONREPLY_ROUTE) { + /* resume processing of a sip request */ + /* get the branch of the blind UAC setup during suspend */ + branch = t->async_backup.blind_uac; if (branch >= 0) { stop_rb_timers(&t->uac[branch].request); - + if (t->uac[branch].last_received != 0) { /* Either t_continue() has already been * called or the branch has already timed out. * Needless to continue. */ - t->flags &= ~T_ASYNC_SUSPENDED; UNLOCK_ASYNC_CONTINUE(t); UNREF(t); /* t_unref would kill the transaction */ return 1; @@ -254,7 +261,7 @@ int t_continue(unsigned int hash_index, unsigned int label, /* We should not reset kr here to 0 as it's quite possible before continuing the dev. has correctly set the * kr by, for example, sending a transactional reply in code - resetting here will cause a dirty log message - * "WARNING: script writer didn't release transaction" to appear in log files. TODO: maybe we need to add + * "WARNING: script writer didn't release transaction" to appear in log files. TODO: maybe we need to add * a special kr for async? * reset_kr(); */ @@ -267,12 +274,15 @@ int t_continue(unsigned int hash_index, unsigned int label, } faked_env( t, &faked_req, 1); + route_type_bk = get_route_type(); + set_route_type(FAILURE_ROUTE); /* execute the pre/post -script callbacks based on original route block */ if (exec_pre_script_cb(&faked_req, cb_type)>0) { if (run_top_route(route, &faked_req, 0)<0) LM_ERR("failure inside run_top_route\n"); exec_post_script_cb(&faked_req, cb_type); } + set_route_type(route_type_bk); /* TODO: save_msg_lumps should clone the lumps to shm mem */ @@ -304,6 +314,7 @@ int t_continue(unsigned int hash_index, unsigned int label, } } else { + /* resume processing of a sip response */ branch = t->async_backup.backup_branch; init_cancel_info(&cancel_data); @@ -312,12 +323,11 @@ int t_continue(unsigned int hash_index, unsigned int label, " - resetting the suspend branch flag\n"); if (t->uac[branch].reply) { - t->uac[branch].reply->msg_flags &= ~FL_RPL_SUSPENDED; - } else { + t->uac[branch].reply->msg_flags &= ~FL_RPL_SUSPENDED; + } else { LM_WARN("no reply in t_continue for branch. not much we can do\n"); return 0; } - if (t->uas.request) t->uas.request->msg_flags&= ~FL_RPL_SUSPENDED; faked_env( t, t->uac[branch].reply, 1); @@ -372,7 +382,7 @@ int t_continue(unsigned int hash_index, unsigned int label, cleanup_uac_timers( t ); /* 2xx is a special case: we can have a COMPLETED request * with branches still open => we have to cancel them */ - if (is_invite(t) && cancel_data.cancel_bitmap) + if (is_invite(t) && cancel_data.cancel_bitmap) cancel_uacs( t, &cancel_data, F_CANCEL_B_KILL); /* FR for negative INVITES, WAIT anything else */ /* Call to set_final_timer is embedded in relay_reply to avoid @@ -404,7 +414,7 @@ int t_continue(unsigned int hash_index, unsigned int label, restart_rb_fr(& t->uac[branch].request, t->fr_inv_timeout); t->uac[branch].request.flags|=F_RB_FR_INV; /* mark fr_inv */ } - + } done: @@ -414,7 +424,7 @@ int t_continue(unsigned int hash_index, unsigned int label, /* unref the transaction */ t_unref(t->uas.request); } else { - tm_ctx_set_branch_index(T_BR_UNDEFINED); + tm_ctx_set_branch_index(T_BR_UNDEFINED); /* unref the transaction */ t_unref(t->uac[branch].reply); LOG(L_DBG,"DEBUG: t_continue_reply: Freeing earlier cloned reply\n"); @@ -457,14 +467,10 @@ int t_continue(unsigned int hash_index, unsigned int label, t->uac[branch].reply = 0; } - /*This transaction is no longer suspended so unsetting the SUSPEND flag*/ - t->flags &= ~T_ASYNC_SUSPENDED; - return 0; kill_trans: - t->flags &= ~T_ASYNC_SUSPENDED; /* The script has hopefully set the error code. If not, * let us reply with a default error. */ if ((kill_transaction_unsafe(t, @@ -495,7 +501,7 @@ int t_continue(unsigned int hash_index, unsigned int label, * after t_suspend() has already been executed in the same * process, and it turns out that the transaction should * not have been suspended. - * + * * Return value: * 0 - success * <0 - failure @@ -504,7 +510,7 @@ int t_cancel_suspend(unsigned int hash_index, unsigned int label) { struct cell *t; int branch; - + t = get_t(); if (!t || t == T_UNDEFINED) { LOG(L_ERR, "ERROR: t_revoke_suspend: " \ @@ -519,7 +525,7 @@ int t_cancel_suspend(unsigned int hash_index, unsigned int label) "transaction id mismatch\n"); return -1; } - + if(t->async_backup.backup_route != TM_ONREPLY_ROUTE){ /* The transaction does not need to be locked because this * function is either executed from the original route block @@ -556,8 +562,8 @@ int t_cancel_suspend(unsigned int hash_index, unsigned int label) t->uac[branch].reply->msg_flags &= ~FL_RPL_SUSPENDED; if (t->uas.request) t->uas.request->msg_flags&= ~FL_RPL_SUSPENDED; - } - + } + return 0; } diff --git a/modules/tm/t_suspend.h b/modules/tm/t_suspend.h index df19f22fed5..2e411b3bc44 100644 --- a/modules/tm/t_suspend.h +++ b/modules/tm/t_suspend.h @@ -13,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ diff --git a/modules/tm/tm.c b/modules/tm/tm.c index ecca92e26df..e220458bc0e 100644 --- a/modules/tm/tm.c +++ b/modules/tm/tm.c @@ -1,30 +1,5 @@ /* - * TM module - * - * - * *************************************************** - * * Jiri's Source Memorial * - * * * - * * Welcome, pilgrim ! This is the greatest place * - * * where dramatic changes happend. There are not * - * * many places with a history like this, as there * - * * are not so many people like Jiri, one of the * - * * ser's fathers, who brought everywhere the wind * - * * of change, the flood of clean-up. We all felt * - * * his fatherly eye watching over us day and night.* - * * * - * * Please, preserve this codework heritage, as * - * * it's unlikely for fresh, juicy pieces of code to * - * * arise to give him the again the chance to * - * * demonstrate his clean-up and improvement skills.* - * * * - * * Hereby, we solicit you to adopt this historical * - * * piece of code. For $100, your name will be * - * * be printed in this banner and we will use * - * * collected funds to create and display an ASCII * - * * statue of Jiri . * - * *************************************************** - * + * TM (transaction management) module * * Copyright (C) 2001-2003 FhG Fokus * @@ -46,54 +21,28 @@ */ /** TM :: Module API (core). - * @file + * @file * @ingroup tm */ /** * @defgroup tm TM :: Transaction stateful proxy support * - The TM module enables stateful processing of SIP transactions. The main use - of stateful logic, which is costly in terms of memory and CPU, is some - services that inherently need state. - - For example, transaction-based accounting (module acc) needs to process - transaction state as opposed to individual messages, and any kinds of - forking must be implemented statefully. Other use of stateful processing - is it trading CPU caused by retransmission processing for memory. - That however only makes sense if CPU consumption per request is huge. - For example, if you want to avoid costly DNS resolution for every - retransmission of a request to an unresolvable destination, use stateful - mode. Then, only the initial message burdens server by DNS queries, - subsequent retransmissions will be dropped and will not result in more - processes blocked by DNS resolution. The price is more memory consumption - and higher processing latency. - + * The TM module enables stateful processing of SIP transactions. The main use + * of stateful logic, which is costly in terms of memory and CPU, is some + * services that inherently need state. * -\code - * *************************************************** - * * Jiri's Source Memorial * - * * * - * * Welcome, pilgrim ! This is the greatest place * - * * where dramatic changes happend. There are not * - * * many places with a history like this, as there * - * * are not so many people like Jiri, one of the * - * * ser's fathers, who brought everywhere the wind * - * * of change, the flood of clean-up. We all felt * - * * his fatherly eye watching over us day and night.* - * * * - * * Please, preserve this codework heritage, as * - * * it's unlikely for fresh, juicy pieces of code to * - * * arise to give him the again the chance to * - * * demonstrate his clean-up and improvement skills.* - * * * - * * Hereby, we solicit you to adopt this historical * - * * piece of code. For $100, your name will be * - * * be printed in this banner and we will use * - * * collected funds to create and display an ASCII * - * * statue of Jiri . * - * *************************************************** -\endcode + * For example, transaction-based accounting (module acc) needs to process + * transaction state as opposed to individual messages, and any kinds of + * forking must be implemented statefully. Other use of stateful processing + * is it trading CPU caused by retransmission processing for memory. + * That however only makes sense if CPU consumption per request is huge. + * For example, if you want to avoid costly DNS resolution for every + * retransmission of a request to an unresolvable destination, use stateful + * mode. Then, only the initial message burdens server by DNS queries, + * subsequent retransmissions will be dropped and will not result in more + * processes blocked by DNS resolution. The price is more memory consumption + * and higher processing latency. */ @@ -163,53 +112,53 @@ inline static int w_t_lookup_cancel(struct sip_msg* msg, char* str, char* str2); inline static int w_t_reply(struct sip_msg* msg, char* str, char* str2); inline static int w_t_release(struct sip_msg* msg, char* str, char* str2); inline static int w_t_retransmit_reply(struct sip_msg* p_msg, char* foo, - char* bar ); + char* bar ); inline static int w_t_newtran(struct sip_msg* p_msg, char* foo, char* bar ); inline static int w_t_relay( struct sip_msg *p_msg , char *_foo, char *_bar); inline static int w_t_relay2( struct sip_msg *p_msg , char *proxy, char*); inline static int w_t_relay_to_udp( struct sip_msg *p_msg , char *proxy, - char *); + char *); inline static int w_t_relay_to_udp_uri( struct sip_msg *p_msg , char*, char*); #ifdef USE_TCP inline static int w_t_relay_to_tcp( struct sip_msg *p_msg , char *proxy, - char *); + char *); inline static int w_t_relay_to_tcp_uri( struct sip_msg *p_msg , char*, char*); #endif #ifdef USE_TLS inline static int w_t_relay_to_tls( struct sip_msg *p_msg , char *proxy, - char *); + char *); inline static int w_t_relay_to_tls_uri( struct sip_msg *p_msg , char*, char*); #endif #ifdef USE_SCTP inline static int w_t_relay_to_sctp( struct sip_msg *p_msg , char *proxy, - char *); + char *); inline static int w_t_relay_to_sctp_uri( struct sip_msg*, char*, char*); #endif inline static int w_t_relay_to_avp(struct sip_msg* msg, char* str,char*); inline static int w_t_relay_to(struct sip_msg* msg, char* str,char*); inline static int w_t_replicate_uri( struct sip_msg *p_msg , - char *uri, /* sip uri as string or variable */ - char *_foo /* nothing expected */ ); + char *uri, /* sip uri as string or variable */ + char *_foo /* nothing expected */ ); inline static int w_t_replicate( struct sip_msg *p_msg , - char *proxy, /* struct proxy_l *proxy expected */ - char *_foo /* nothing expected */ ); + char *proxy, /* struct proxy_l *proxy expected */ + char *_foo /* nothing expected */ ); inline static int w_t_replicate_udp( struct sip_msg *p_msg , - char *proxy, /* struct proxy_l *proxy expected */ - char *_foo /* nothing expected */ ); + char *proxy, /* struct proxy_l *proxy expected */ + char *_foo /* nothing expected */ ); #ifdef USE_TCP inline static int w_t_replicate_tcp( struct sip_msg *p_msg , - char *proxy, /* struct proxy_l *proxy expected */ - char *_foo /* nothing expected */ ); + char *proxy, /* struct proxy_l *proxy expected */ + char *_foo /* nothing expected */ ); #endif #ifdef USE_TLS inline static int w_t_replicate_tls( struct sip_msg *p_msg , - char *proxy, /* struct proxy_l *proxy expected */ - char *_foo /* nothing expected */ ); + char *proxy, /* struct proxy_l *proxy expected */ + char *_foo /* nothing expected */ ); #endif #ifdef USE_SCTP inline static int w_t_replicate_sctp( struct sip_msg *p_msg , - char *proxy, /* struct proxy_l *proxy expected */ - char *_foo /* nothing expected */ ); + char *proxy, /* struct proxy_l *proxy expected */ + char *_foo /* nothing expected */ ); #endif inline static int w_t_replicate_to(struct sip_msg* msg, char* str,char*); inline static int w_t_forward_nonack(struct sip_msg* msg, char* str, char* ); @@ -243,7 +192,7 @@ static int t_set_disable_6xx(struct sip_msg* msg, char* on_off, char* foo); static int t_set_disable_failover(struct sip_msg* msg, char* on_off, char* f); #ifdef CANCEL_REASON_SUPPORT static int t_set_no_e2e_cancel_reason(struct sip_msg* msg, char* on_off, - char* f); + char* f); #endif /* CANCEL_REASON_SUPPORT */ static int t_set_disable_internal_reply(struct sip_msg* msg, char* on_off, char* f); static int t_branch_timeout(struct sip_msg* msg, char*, char*); @@ -282,177 +231,177 @@ static int fixup_t_check_status(void** param, int param_no); static cmd_export_t cmds[]={ {"t_newtran", w_t_newtran, 0, 0, - REQUEST_ROUTE}, + REQUEST_ROUTE}, {"t_lookup_request", w_t_check, 0, 0, - REQUEST_ROUTE}, + REQUEST_ROUTE}, {"t_lookup_cancel", w_t_lookup_cancel, 0, 0, - REQUEST_ROUTE}, + REQUEST_ROUTE}, {"t_lookup_cancel", w_t_lookup_cancel, 1, fixup_int_1, - REQUEST_ROUTE}, + REQUEST_ROUTE}, {"t_reply", w_t_reply, 2, fixup_t_reply, - REQUEST_ROUTE | ONREPLY_ROUTE | FAILURE_ROUTE }, + REQUEST_ROUTE | ONREPLY_ROUTE | FAILURE_ROUTE }, {"t_retransmit_reply", w_t_retransmit_reply, 0, 0, - REQUEST_ROUTE}, + REQUEST_ROUTE}, {"t_release", w_t_release, 0, 0, - REQUEST_ROUTE}, + REQUEST_ROUTE}, {"t_relay_to_udp", w_t_relay_to_udp, 2, fixup_hostport2proxy, - REQUEST_ROUTE|FAILURE_ROUTE}, + REQUEST_ROUTE|FAILURE_ROUTE}, {"t_relay_to_udp", w_t_relay_to_udp_uri, 0, 0, - REQUEST_ROUTE|FAILURE_ROUTE}, + REQUEST_ROUTE|FAILURE_ROUTE}, #ifdef USE_TCP {"t_relay_to_tcp", w_t_relay_to_tcp, 2, fixup_hostport2proxy, - REQUEST_ROUTE|FAILURE_ROUTE}, + REQUEST_ROUTE|FAILURE_ROUTE}, {"t_relay_to_tcp", w_t_relay_to_tcp_uri, 0, 0, - REQUEST_ROUTE|FAILURE_ROUTE}, + REQUEST_ROUTE|FAILURE_ROUTE}, #endif #ifdef USE_TLS {"t_relay_to_tls", w_t_relay_to_tls, 2, fixup_hostport2proxy, - REQUEST_ROUTE|FAILURE_ROUTE}, + REQUEST_ROUTE|FAILURE_ROUTE}, {"t_relay_to_tls", w_t_relay_to_tls_uri, 0, 0, - REQUEST_ROUTE|FAILURE_ROUTE}, + REQUEST_ROUTE|FAILURE_ROUTE}, #endif #ifdef USE_SCTP {"t_relay_to_sctp", w_t_relay_to_sctp, 2, fixup_hostport2proxy, - REQUEST_ROUTE|FAILURE_ROUTE}, + REQUEST_ROUTE|FAILURE_ROUTE}, {"t_relay_to_sctp", w_t_relay_to_sctp_uri, 0, 0, - REQUEST_ROUTE|FAILURE_ROUTE}, + REQUEST_ROUTE|FAILURE_ROUTE}, #endif {"t_replicate", w_t_replicate_uri, 0, 0, - REQUEST_ROUTE}, + REQUEST_ROUTE}, {"t_replicate", w_t_replicate_uri, 1, fixup_spve_null, - REQUEST_ROUTE}, + REQUEST_ROUTE}, {"t_replicate", w_t_replicate, 2, fixup_hostport2proxy, - REQUEST_ROUTE}, + REQUEST_ROUTE}, {"t_replicate_udp", w_t_replicate_udp, 2, fixup_hostport2proxy, - REQUEST_ROUTE}, + REQUEST_ROUTE}, #ifdef USE_TCP {"t_replicate_tcp", w_t_replicate_tcp, 2, fixup_hostport2proxy, - REQUEST_ROUTE}, + REQUEST_ROUTE}, #endif #ifdef USE_TLS {"t_replicate_tls", w_t_replicate_tls, 2, fixup_hostport2proxy, - REQUEST_ROUTE}, + REQUEST_ROUTE}, #endif #ifdef USE_SCTP {"t_replicate_sctp", w_t_replicate_sctp, 2, fixup_hostport2proxy, - REQUEST_ROUTE}, + REQUEST_ROUTE}, #endif {"t_replicate_to", w_t_replicate_to, 2, fixup_proto_hostport2proxy, - REQUEST_ROUTE}, + REQUEST_ROUTE}, {"t_relay", w_t_relay, 0, 0, - REQUEST_ROUTE | FAILURE_ROUTE }, + REQUEST_ROUTE | FAILURE_ROUTE }, {"t_relay", w_t_relay2, 2, fixup_hostport2proxy, - REQUEST_ROUTE | FAILURE_ROUTE }, + REQUEST_ROUTE | FAILURE_ROUTE }, {"t_relay_to_avp", w_t_relay_to_avp, 2, fixup_proto_hostport2proxy, - REQUEST_ROUTE}, + REQUEST_ROUTE}, {"t_relay_to", w_t_relay_to, 0, 0, - REQUEST_ROUTE | FAILURE_ROUTE }, + REQUEST_ROUTE | FAILURE_ROUTE }, {"t_relay_to", w_t_relay_to, 1, fixup_t_relay_to, - REQUEST_ROUTE | FAILURE_ROUTE }, + REQUEST_ROUTE | FAILURE_ROUTE }, {"t_relay_to", w_t_relay_to, 2, fixup_t_relay_to, - REQUEST_ROUTE | FAILURE_ROUTE }, + REQUEST_ROUTE | FAILURE_ROUTE }, {"t_forward_nonack", w_t_forward_nonack, 2, fixup_hostport2proxy, - REQUEST_ROUTE}, + REQUEST_ROUTE}, {"t_forward_nonack_uri", w_t_forward_nonack_uri, 0, 0, - REQUEST_ROUTE}, + REQUEST_ROUTE}, {"t_forward_nonack_udp", w_t_forward_nonack_udp, 2, fixup_hostport2proxy, - REQUEST_ROUTE}, + REQUEST_ROUTE}, #ifdef USE_TCP {"t_forward_nonack_tcp", w_t_forward_nonack_tcp, 2, fixup_hostport2proxy, - REQUEST_ROUTE}, + REQUEST_ROUTE}, #endif #ifdef USE_TLS {"t_forward_nonack_tls", w_t_forward_nonack_tls, 2, fixup_hostport2proxy, - REQUEST_ROUTE}, + REQUEST_ROUTE}, #endif #ifdef USE_SCTP {"t_forward_nonack_sctp", w_t_forward_nonack_sctp, 2, fixup_hostport2proxy, - REQUEST_ROUTE}, + REQUEST_ROUTE}, #endif {"t_forward_nonack_to", w_t_forward_nonack_to, 2, fixup_proto_hostport2proxy, - REQUEST_ROUTE}, + REQUEST_ROUTE}, {"t_relay_cancel", w_t_relay_cancel, 0, 0, - REQUEST_ROUTE}, + REQUEST_ROUTE}, {"t_on_failure", w_t_on_failure, 1, fixup_on_failure, - REQUEST_ROUTE | FAILURE_ROUTE | TM_ONREPLY_ROUTE | BRANCH_ROUTE }, + REQUEST_ROUTE | FAILURE_ROUTE | TM_ONREPLY_ROUTE | BRANCH_ROUTE }, {"t_on_branch_failure",w_t_on_branch_failure, 1, fixup_on_branch_failure, - REQUEST_ROUTE | FAILURE_ROUTE | TM_ONREPLY_ROUTE | BRANCH_ROUTE }, + REQUEST_ROUTE | FAILURE_ROUTE | TM_ONREPLY_ROUTE | BRANCH_ROUTE }, {"t_on_reply", w_t_on_reply, 1, fixup_on_reply, - REQUEST_ROUTE | FAILURE_ROUTE | TM_ONREPLY_ROUTE | BRANCH_ROUTE }, + REQUEST_ROUTE | FAILURE_ROUTE | TM_ONREPLY_ROUTE | BRANCH_ROUTE }, {"t_on_branch", w_t_on_branch, 1, fixup_on_branch, - REQUEST_ROUTE | FAILURE_ROUTE }, + REQUEST_ROUTE | FAILURE_ROUTE }, {"t_check_status", t_check_status, 1, fixup_t_check_status, - REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE}, + REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE}, {"t_write_req", t_write_req, 2, fixup_t_write, - REQUEST_ROUTE | FAILURE_ROUTE }, + REQUEST_ROUTE | FAILURE_ROUTE }, {"t_write_unix", t_write_unix, 2, fixup_t_write, - REQUEST_ROUTE | FAILURE_ROUTE }, + REQUEST_ROUTE | FAILURE_ROUTE }, {"t_set_fr", t_set_fr_inv, 1, fixup_var_int_1, - REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, + REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, {"t_set_fr", t_set_fr_all, 2, fixup_var_int_12, - REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, + REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, {"t_reset_fr", w_t_reset_fr, 0, 0, - REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, + REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, {"t_set_retr", w_t_set_retr, 2, fixup_var_int_12, - REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, + REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, {"t_reset_retr", w_t_reset_retr, 0, 0, - REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, + REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, {"t_set_max_lifetime", w_t_set_max_lifetime, 2, fixup_var_int_12, - REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, + REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, {"t_reset_max_lifetime", w_t_reset_max_lifetime, 0, 0, - REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, + REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, {"t_set_auto_inv_100", t_set_auto_inv_100, 1, fixup_var_int_1, - REQUEST_ROUTE}, + REQUEST_ROUTE}, {"t_set_disable_6xx", t_set_disable_6xx, 1, fixup_var_int_1, - REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, + REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, {"t_set_disable_failover", t_set_disable_failover, 1, fixup_var_int_1, - REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, + REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, #ifdef CANCEL_REASON_SUPPORT {"t_set_no_e2e_cancel_reason", t_set_no_e2e_cancel_reason, 1, fixup_var_int_1, - REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, + REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, /* alias for t_set_no_e2e_cancel_reason */ {"t_disable_e2e_cancel_reason", t_set_no_e2e_cancel_reason, 1, fixup_var_int_1, - REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, + REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, #endif /* CANCEL_REASON_SUPPORT */ {"t_set_disable_internal_reply", t_set_disable_internal_reply, 1, fixup_var_int_1, - REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, + REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, {"t_branch_timeout", t_branch_timeout, 0, 0, - FAILURE_ROUTE|EVENT_ROUTE}, + FAILURE_ROUTE|EVENT_ROUTE}, {"t_branch_replied", t_branch_replied, 0, 0, - FAILURE_ROUTE|EVENT_ROUTE}, - {"t_any_timeout", t_any_timeout, 0, 0, - REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, - {"t_any_replied", t_any_replied, 0, 0, - REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, + FAILURE_ROUTE|EVENT_ROUTE}, + {"t_any_timeout", t_any_timeout, 0, 0, + REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, + {"t_any_replied", t_any_replied, 0, 0, + REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, {"t_is_canceled", w_t_is_canceled, 0, 0, - REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, - {"t_is_retr_async_reply", w_t_is_retr_async_reply, 0, 0, - TM_ONREPLY_ROUTE}, + REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, + {"t_is_retr_async_reply", w_t_is_retr_async_reply, 0, 0, + TM_ONREPLY_ROUTE}, {"t_is_expired", t_is_expired, 0, 0, - REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, - {"t_grep_status", t_grep_status, 1, fixup_var_int_1, - REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, + REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, + {"t_grep_status", t_grep_status, 1, fixup_var_int_1, + REQUEST_ROUTE|TM_ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE }, {"t_drop_replies", w_t_drop_replies, 0, 0, - FAILURE_ROUTE}, + FAILURE_ROUTE}, {"t_drop_replies", w_t_drop_replies, 1, 0, - FAILURE_ROUTE}, + FAILURE_ROUTE}, {"t_save_lumps", w_t_save_lumps, 0, 0, - REQUEST_ROUTE}, + REQUEST_ROUTE}, {"t_check_trans", w_t_check_trans, 0, 0, - REQUEST_ROUTE|ONREPLY_ROUTE|BRANCH_ROUTE }, + REQUEST_ROUTE|ONREPLY_ROUTE|BRANCH_ROUTE }, {"t_is_set", w_t_is_set, 1, fixup_t_is_set, - ANY_ROUTE }, + ANY_ROUTE }, {"t_use_uac_headers", w_t_use_uac_headers, 0, 0, - ANY_ROUTE }, + ANY_ROUTE }, {"t_load_contacts", t_load_contacts, 0, 0, - REQUEST_ROUTE | FAILURE_ROUTE}, + REQUEST_ROUTE | FAILURE_ROUTE}, {"t_next_contacts", t_next_contacts, 0, 0, - REQUEST_ROUTE | FAILURE_ROUTE}, + REQUEST_ROUTE | FAILURE_ROUTE}, {"t_next_contact_flow", t_next_contact_flow, 0, 0, - REQUEST_ROUTE }, + REQUEST_ROUTE }, /* not applicable from the script */ {"load_tm", (cmd_function)load_tm, NO_SCRIPT, 0, 0}, @@ -478,13 +427,13 @@ static param_export_t params[]={ {"auto_inv_100_reason", PARAM_STRING, &default_tm_cfg.tm_auto_inv_100_r }, {"unix_tx_timeout", PARAM_INT, &default_tm_cfg.tm_unix_tx_timeout }, {"restart_fr_on_each_reply", PARAM_INT, - &default_tm_cfg.restart_fr_on_each_reply}, + &default_tm_cfg.restart_fr_on_each_reply}, {"fr_timer_avp", PARAM_STRING, &fr_timer_param }, {"fr_inv_timer_avp", PARAM_STRING, &fr_inv_timer_param }, - {"tw_append", PARAM_STRING|PARAM_USE_FUNC, - (void*)parse_tw_append }, - {"pass_provisional_replies", PARAM_INT, - &default_tm_cfg.pass_provisional_replies }, + {"tw_append", PARAM_STRING|PARAM_USE_FUNC, + (void*)parse_tw_append }, + {"pass_provisional_replies", PARAM_INT, + &default_tm_cfg.pass_provisional_replies }, {"aggregate_challenges", PARAM_INT, &default_tm_cfg.tm_aggregate_auth }, {"unmatched_cancel", PARAM_INT, &default_tm_cfg.unmatched_cancel }, {"default_code", PARAM_INT, &default_tm_cfg.default_code }, @@ -520,1693 +469,1729 @@ static param_export_t params[]={ #ifdef STATIC_TM struct module_exports tm_exports = { #else -struct module_exports exports= { + struct module_exports exports= { #endif - "tm", - /* -------- exported functions ----------- */ - cmds, - tm_rpc, /* RPC methods */ - /* ------------ exported variables ---------- */ - params, - - mod_init, /* module initialization function */ - (response_function) reply_received, - (destroy_function) tm_shutdown, - 0, /* w_onbreak, */ - child_init /* per-child init function */ -}; + "tm", + /* -------- exported functions ----------- */ + cmds, + tm_rpc, /* RPC methods */ + /* ------------ exported variables ---------- */ + params, + mod_init, /* module initialization function */ + (response_function) reply_received, + (destroy_function) tm_shutdown, + 0, /* w_onbreak, */ + child_init /* per-child init function */ + }; -/* helper for fixup_on_* */ -static int fixup_routes(char* r_type, struct route_list* rt, void** param) -{ - int i; - - i=route_get(rt, (char*)*param); - if (i==-1){ - LOG(L_ERR, "ERROR: tm: fixup_routes: route_get failed\n"); - return E_UNSPEC; - } - if (r_type && rt->rlist[i]==0){ - LOG(L_WARN, "WARNING: %s(\"%s\"): empty/non existing route\n", - r_type, (char*)*param); - } - *param=(void*)(long)i; - return 0; -} - -static int fixup_t_reply(void** param, int param_no) -{ - if (param_no == 1) { - if (fixup_var_int_12(param, 1) != 0) return -1; - } else if (param_no == 2) { - return fixup_var_str_12(param, 2); - } - return 0; -} - -static int fixup_on_failure(void** param, int param_no) -{ - if (param_no==1){ - if(strlen((char*)*param)<=1 - && (*(char*)(*param)==0 || *(char*)(*param)=='0')) { - *param = (void*)0; - return 0; - } - return fixup_routes("t_on_failure", &failure_rt, param); - } - return 0; -} -#define BRANCH_FAILURE_ROUTE_PREFIX "tm:branch-failure" -static int fixup_on_branch_failure(void** param, int param_no) -{ - char *full_route_name = NULL; - int len; - int ret = 0; - if (param_no==1){ - if((len = strlen((char*)*param))<=1 - && (*(char*)(*param)==0 || *(char*)(*param)=='0')) { - *param = (void*)0; - return 0; + /* helper for fixup_on_* */ + static int fixup_routes(char* r_type, struct route_list* rt, void** param) + { + int i; + + i=route_get(rt, (char*)*param); + if (i==-1){ + LOG(L_ERR, "ERROR: tm: fixup_routes: route_get failed\n"); + return E_UNSPEC; } - len += strlen(BRANCH_FAILURE_ROUTE_PREFIX) + 1; - if ((full_route_name = pkg_malloc(len+1)) == NULL) - { - LM_ERR("No memory left in branch_failure fixup\n"); - return -1; + if (r_type && rt->rlist[i]==0){ + LOG(L_WARN, "WARNING: %s(\"%s\"): empty/non existing route\n", + r_type, (char*)*param); } - sprintf(full_route_name, "%s:%s", BRANCH_FAILURE_ROUTE_PREFIX, (char*)*param); - *param=(void*)full_route_name; - ret = fixup_routes("t_on_branch_failure", &event_rt, param); - pkg_free(full_route_name); + *param=(void*)(long)i; + return 0; } - return ret; -} - -static int fixup_on_reply(void** param, int param_no) -{ - if (param_no==1){ - if(strlen((char*)*param)<=1 - && (*(char*)(*param)==0 || *(char*)(*param)=='0')) { - *param = (void*)0; - return 0; + static int fixup_t_reply(void** param, int param_no) + { + if (param_no == 1) { + if (fixup_var_int_12(param, 1) != 0) return -1; + } else if (param_no == 2) { + return fixup_var_str_12(param, 2); } - return fixup_routes("t_on_reply", &onreply_rt, param); + return 0; } - return 0; -} - - -static int fixup_on_branch(void** param, int param_no) -{ - if (param_no==1){ - if(strlen((char*)*param)<=1 - && (*(char*)(*param)==0 || *(char*)(*param)=='0')) { - *param = (void*)0; - return 0; + static int fixup_on_failure(void** param, int param_no) + { + if (param_no==1){ + if(strlen((char*)*param)<=1 + && (*(char*)(*param)==0 || *(char*)(*param)=='0')) { + *param = (void*)0; + return 0; + } + return fixup_routes("t_on_failure", &failure_rt, param); } - return fixup_routes("t_on_branch", &branch_rt, param); + return 0; } - return 0; -} -static int fixup_on_sl_reply(modparam_t type, void* val) -{ - if ((type & PARAM_STRING) == 0) { - LOG(L_ERR, "ERROR: tm: fixup_on_sl_reply: not a string parameter\n"); - return -1; +#define BRANCH_FAILURE_ROUTE_PREFIX "tm:branch-failure" + static int fixup_on_branch_failure(void** param, int param_no) + { + char *full_route_name = NULL; + int len; + int ret = 0; + if (param_no==1){ + if((len = strlen((char*)*param))<=1 + && (*(char*)(*param)==0 || *(char*)(*param)=='0')) { + *param = (void*)0; + return 0; + } + len += strlen(BRANCH_FAILURE_ROUTE_PREFIX) + 1; + if ((full_route_name = pkg_malloc(len+1)) == NULL) + { + LM_ERR("No memory left in branch_failure fixup\n"); + return -1; + } + sprintf(full_route_name, "%s:%s", BRANCH_FAILURE_ROUTE_PREFIX, (char*)*param); + *param=(void*)full_route_name; + ret = fixup_routes("t_on_branch_failure", &event_rt, param); + pkg_free(full_route_name); + } + return ret; } - if (fixup_routes(0, &onreply_rt, &val)) - return -1; - - goto_on_sl_reply = (int)(long)val; - return 0; -} + static int fixup_on_reply(void** param, int param_no) + { + if (param_no==1){ + if(strlen((char*)*param)<=1 + && (*(char*)(*param)==0 || *(char*)(*param)=='0')) { + *param = (void*)0; + return 0; + } + return fixup_routes("t_on_reply", &onreply_rt, param); + } + return 0; + } -/* (char *hostname, char *port_nr) ==> (struct proxy_l *, -) */ -static int fixup_hostport2proxy(void** param, int param_no) -{ - unsigned int port; - char *host; - int err; - struct proxy_l *proxy; - action_u_t *a; - str s; - DBG("TM module: fixup_hostport2proxy(%s, %d)\n", (char*)*param, param_no); - if (param_no==1){ + static int fixup_on_branch(void** param, int param_no) + { + if (param_no==1){ + if(strlen((char*)*param)<=1 + && (*(char*)(*param)==0 || *(char*)(*param)=='0')) { + *param = (void*)0; + return 0; + } + return fixup_routes("t_on_branch", &branch_rt, param); + } return 0; - } else if (param_no==2) { - a = fixup_get_param(param, param_no, 1); - host= a->u.string; - port=str2s(*param, strlen(*param), &err); - if (err!=0) { - LOG(L_ERR, "TM module:fixup_hostport2proxy: bad port number <%s>\n", - (char*)(*param)); - return E_UNSPEC; - } - s.s = host; - s.len = strlen(host); - proxy=mk_proxy(&s, port, 0); /* FIXME: udp or tcp? */ - if (proxy==0) { - LOG(L_ERR, "ERROR: fixup_hostport2proxy: bad host name in URI <%s>\n", - host ); - return E_BAD_ADDRESS; + } + + static int fixup_on_sl_reply(modparam_t type, void* val) + { + if ((type & PARAM_STRING) == 0) { + LOG(L_ERR, "ERROR: tm: fixup_on_sl_reply: not a string parameter\n"); + return -1; } - /* success -- fix the first parameter to proxy now ! */ - a->u.data=proxy; + if (fixup_routes(0, &onreply_rt, &val)) + return -1; + + goto_on_sl_reply = (int)(long)val; return 0; - } else { - LOG(L_ERR,"ERROR: fixup_hostport2proxy called with parameter #<>{1,2}\n"); - return E_BUG; } -} -/* (char *$proto, char *$host:port) ==> (fparam, fparam) */ -static int fixup_proto_hostport2proxy(void** param, int param_no) { - int ret; - ret = fix_param(FPARAM_AVP, param); - if (ret <= 0) return ret; -/* if (param_no = 1) { FIXME: param_str currently does not offer INT/STR overloading - ret = fix_param(FPARAM_INT, param); - if (ret <= 0) return ret; - } */ - if (fix_param(FPARAM_STRING, param) != 0) return -1; - return 0; -} - - -static int fixup_t_check_status(void** param, int param_no) -{ - int ret; - - ret = fix_param(FPARAM_AVP, param); - if (ret <= 0) return ret; - - ret = fix_param(FPARAM_SELECT, param); - if (ret <= 0) return ret; - - if (fix_param(FPARAM_REGEX, param) != 0) return -1; - return 0; -} - - -/***************************** init functions *****************************/ -static int w_t_unref( struct sip_msg *foo, unsigned int flags, void *bar) -{ - return t_unref(foo); -} - - -static int script_init( struct sip_msg *foo, unsigned int flags, void *bar) -{ - /* we primarily reset all private memory here to make sure - * private values left over from previous message will - * not be used again */ - - /* make sure the new message will not inherit previous - message's t_on_failure value - */ - t_on_failure( 0 ); - t_on_branch_failure(0); - t_on_reply(0); - t_on_branch(0); - /* reset the kr status */ - reset_kr(); - /* set request mode so that multiple-mode actions know - * how to behave */ - set_route_type(REQUEST_ROUTE); - lumps_are_cloned = 0; - return 1; -} - - -static int mod_init(void) -{ - DBG( "TM - (sizeof cell=%ld, sip_msg=%ld) initializing...\n", - (long)sizeof(struct cell), (long)sizeof(struct sip_msg)); - - /* checking if we have sufficient bitmap capacity for given - maximum number of branches */ - if (sr_dst_max_branches+1>31) { - LOG(L_CRIT, "Too many max UACs for UAC branch_bm_t bitmap: %d\n", - sr_dst_max_branches ); - return -1; - } - if (init_callid() < 0) { - LOG(L_CRIT, "Error while initializing Call-ID generator\n"); - return -1; - } + /* (char *hostname, char *port_nr) ==> (struct proxy_l *, -) */ + static int fixup_hostport2proxy(void** param, int param_no) + { + unsigned int port; + char *host; + int err; + struct proxy_l *proxy; + action_u_t *a; + str s; + + DBG("TM module: fixup_hostport2proxy(%s, %d)\n", (char*)*param, param_no); + if (param_no==1){ + return 0; + } else if (param_no==2) { + a = fixup_get_param(param, param_no, 1); + host= a->u.string; + port=str2s(*param, strlen(*param), &err); + if (err!=0) { + LOG(L_ERR, "TM module:fixup_hostport2proxy: bad port number <%s>\n", + (char*)(*param)); + return E_UNSPEC; + } + s.s = host; + s.len = strlen(host); + proxy=mk_proxy(&s, port, 0); /* FIXME: udp or tcp? */ + if (proxy==0) { + LOG(L_ERR, "ERROR: fixup_hostport2proxy: bad host name in URI <%s>\n", + host ); + return E_BAD_ADDRESS; + } + /* success -- fix the first parameter to proxy now ! */ - /* building the hash table*/ - if (!init_hash_table()) { - LOG(L_ERR, "ERROR: mod_init: initializing hash_table failed\n"); - return -1; + a->u.data=proxy; + return 0; + } else { + LOG(L_ERR,"ERROR: fixup_hostport2proxy called with parameter #<>{1,2}\n"); + return E_BUG; + } } - /* init static hidden values */ - init_t(); + /* (char *$proto, char *$host:port) ==> (fparam, fparam) */ + static int fixup_proto_hostport2proxy(void** param, int param_no) { + int ret; - if (tm_init_selects()==-1) { - LOG(L_ERR, "ERROR: mod_init: select init failed\n"); - return -1; + ret = fix_param(FPARAM_AVP, param); + if (ret <= 0) return ret; + /* if (param_no = 1) { FIXME: param_str currently does not offer INT/STR overloading + ret = fix_param(FPARAM_INT, param); + if (ret <= 0) return ret; + } */ + if (fix_param(FPARAM_STRING, param) != 0) return -1; + return 0; } - /* the default timer values must be fixed-up before - * declaring the configuration (Miklos) */ - if (tm_init_timers()==-1) { - LOG(L_ERR, "ERROR: mod_init: timer init failed\n"); - return -1; - } - - /* the cancel branch flags must be fixed before declaring the - * configuration */ - if (cancel_b_flags_get(&default_tm_cfg.cancel_b_flags, - default_tm_cfg.cancel_b_flags)<0){ - LOG(L_ERR, "ERROR: mod_init: bad cancel branch method\n"); - return -1; - } -#ifdef USE_DNS_FAILOVER - if (default_tm_cfg.reparse_on_dns_failover && mhomed) { - LOG(L_WARN, "WARNING: mod_init: " - "reparse_on_dns_failover is enabled on a " - "multihomed host -- check the readme of tm module!\n"); - } -#endif + static int fixup_t_check_status(void** param, int param_no) + { + int ret; - /* declare the configuration */ - if (cfg_declare("tm", tm_cfg_def, &default_tm_cfg, cfg_sizeof(tm), - &tm_cfg)) { - LOG(L_ERR, "ERROR: mod_init: failed to declare the configuration\n"); - return -1; - } + ret = fix_param(FPARAM_AVP, param); + if (ret <= 0) return ret; - /* First tm_stat initialization function only allocates the top level stat - * structure in shared memory, the initialization will complete in child - * init with init_tm_stats_child when the final value of estimated_process_count is - * known - */ - if (init_tm_stats() < 0) { - LOG(L_CRIT, "ERROR: mod_init: failed to init stats\n"); - return -1; - } + ret = fix_param(FPARAM_SELECT, param); + if (ret <= 0) return ret; - if (uac_init()==-1) { - LOG(L_ERR, "ERROR: mod_init: uac_init failed\n"); - return -1; + if (fix_param(FPARAM_REGEX, param) != 0) return -1; + return 0; } - if (init_tmcb_lists()!=1) { - LOG(L_CRIT, "ERROR:tm:mod_init: failed to init tmcb lists\n"); - return -1; - } - - tm_init_tags(); - init_twrite_lines(); - if (init_twrite_sock() < 0) { - LOG(L_ERR, "ERROR:tm:mod_init: Unable to create socket\n"); - return -1; - } - /* register post-script clean-up function */ - if (register_script_cb( w_t_unref, POST_SCRIPT_CB|REQUEST_CB, 0)<0 ) { - LOG(L_ERR,"ERROR:tm:mod_init: failed to register POST request " - "callback\n"); - return -1; - } - if (register_script_cb( script_init, PRE_SCRIPT_CB|REQUEST_CB , 0)<0 ) { - LOG(L_ERR,"ERROR:tm:mod_init: failed to register PRE request " - "callback\n"); - return -1; + /***************************** init functions *****************************/ + static int w_t_unref( struct sip_msg *foo, unsigned int flags, void *bar) + { + return t_unref(foo); } - if (init_avp_params(fr_timer_param, fr_inv_timer_param) < 0) { - LOG(L_ERR,"ERROR:tm:mod_init: failed to process AVP params\n"); - return -1; - } - if ((contacts_avp.len > 0) && (contact_flows_avp.len == 0)) { - LOG(L_ERR,"ERROR:tm:mod_init: contact_flows_avp param has not been defined\n"); - return -1; + + static int script_init( struct sip_msg *foo, unsigned int flags, void *bar) + { + /* we primarily reset all private memory here to make sure + * private values left over from previous message will + * not be used again */ + + /* make sure the new message will not inherit previous + message's t_on_failure value + */ + t_on_failure( 0 ); + t_on_branch_failure(0); + t_on_reply(0); + t_on_branch(0); + /* reset the kr status */ + reset_kr(); + /* set request mode so that multiple-mode actions know + * how to behave */ + set_route_type(REQUEST_ROUTE); + lumps_are_cloned = 0; + return 1; } -#ifdef WITH_EVENT_LOCAL_REQUEST - goto_on_local_req=route_lookup(&event_rt, "tm:local-request"); - if (goto_on_local_req>=0 && event_rt.rlist[goto_on_local_req]==0) - goto_on_local_req=-1; /* disable */ - if (goto_on_local_req>=0) - set_child_rpc_sip_mode(); -#endif /* WITH_EVENT_LOCAL_REQUEST */ - if (goto_on_sl_reply && onreply_rt.rlist[goto_on_sl_reply]==0) - WARN("empty/non existing on_sl_reply route\n"); -#ifdef WITH_TM_CTX - tm_ctx_init(); -#endif - tm_init = 1; - return 0; -} - -static int child_init(int rank) -{ - if (rank == PROC_INIT) { - /* we must init stats when rank==PROC_INIT: after mod_init we know - * the exact number of processes and we must init the shared structure - * before any other process is starting (or else some new process - * might try to use the stats before the stats array is allocated) */ - if (init_tm_stats_child() < 0) { - ERR("Error while initializing tm statistics structures\n"); + static int mod_init(void) + { + DBG( "TM - (sizeof cell=%ld, sip_msg=%ld) initializing...\n", + (long)sizeof(struct cell), (long)sizeof(struct sip_msg)); + + /* checking if we have sufficient bitmap capacity for given + * maximum number of branches */ + if (sr_dst_max_branches+1>31) { + LOG(L_CRIT, "Too many max UACs for UAC branch_bm_t bitmap: %d\n", + sr_dst_max_branches ); return -1; } - }else if (child_init_callid(rank) < 0) { - /* don't init callid for PROC_INIT*/ - LOG(L_ERR, "ERROR: child_init: Error while initializing Call-ID" - " generator\n"); - return -2; - } - return 0; -} - - - -/**************************** wrapper functions ***************************/ -static int t_check_status(struct sip_msg* msg, char *p1, char *foo) -{ - regmatch_t pmatch; - struct cell *t; - char *status, *s = NULL; - char backup; - int lowest_status, n, ret; - fparam_t* fp; - regex_t* re = NULL; - str tmp; - - fp = (fparam_t*)p1; - t = 0; - /* first get the transaction */ - if (t_check(msg, 0 ) == -1) return -1; - if ((t = get_t()) == 0) { - LOG(L_ERR, "ERROR: t_check_status: cannot check status for a reply " - "which has no T-state established\n"); - goto error; - } - backup = 0; - - switch(fp->type) { - case FPARAM_REGEX: - re = fp->v.regex; - break; - - default: - /* AVP or select, get the value and compile the regex */ - if (get_str_fparam(&tmp, msg, fp) < 0) goto error; - s = pkg_malloc(tmp.len + 1); - if (s == NULL) { - ERR("Out of memory\n"); - goto error; - } - memcpy(s, tmp.s, tmp.len); - s[tmp.len] = '\0'; - - if ((re = pkg_malloc(sizeof(regex_t))) == 0) { - ERR("No memory left\n"); - goto error; - } - - if (regcomp(re, s, REG_EXTENDED|REG_ICASE|REG_NEWLINE)) { - ERR("Bad regular expression '%s'\n", s); - pkg_free(re); - re = NULL; - goto error; - } - break; - } - - switch(get_route_type()) { - case REQUEST_ROUTE: - /* use the status of the last sent reply */ - status = int2str( t->uas.status, 0); - break; - - case TM_ONREPLY_ROUTE: - case CORE_ONREPLY_ROUTE: - /* use the status of the current reply */ - status = msg->first_line.u.reply.status.s; - backup = status[msg->first_line.u.reply.status.len]; - status[msg->first_line.u.reply.status.len] = 0; - break; - - case FAILURE_ROUTE: - /* use the status of the winning reply */ - ret = t_pick_branch( -1, 0, t, &lowest_status); - if (ret == -1) { - /* t_pick_branch() retuns error also when there are only - * blind UACs. Let us give it another chance including the - * blind branches. */ - LOG(L_DBG, "DEBUG: t_check_status: t_pick_branch returned error, " - "trying t_pick_branch_blind\n"); - ret = t_pick_branch_blind(t, &lowest_status); - } - if (ret < 0) { - LOG(L_CRIT,"BUG:t_check_status: t_pick_branch failed to get " - " a final response in FAILURE_ROUTE\n"); - goto error; - } - status = int2str( lowest_status , 0); - break; - case BRANCH_FAILURE_ROUTE: - status = int2str(t->uac[get_t_branch()].last_received, 0); - break; - default: - LOG(L_ERR,"ERROR:t_check_status: unsupported route type %d\n", - get_route_type()); - goto error; - } - - DBG("DEBUG:t_check_status: checked status is <%s>\n",status); - /* do the checking */ - n = regexec(re, status, 1, &pmatch, 0); - - if (backup) status[msg->first_line.u.reply.status.len] = backup; - if (s) pkg_free(s); - if ((fp->type != FPARAM_REGEX) && re) { - regfree(re); - pkg_free(re); - } - - if (unlikely(t && is_route_type(CORE_ONREPLY_ROUTE))){ - /* t_check() above has the side effect of setting T and - REFerencing T => we must unref and unset it. */ - UNREF( t ); - set_t(T_UNDEFINED, T_BR_UNDEFINED); - } - if (n!=0) return -1; - return 1; - - error: - if (unlikely(t && is_route_type(CORE_ONREPLY_ROUTE))){ - /* t_check() above has the side effect of setting T and - REFerencing T => we must unref and unset it. */ - UNREF( t ); - set_t(T_UNDEFINED, T_BR_UNDEFINED); - } - if (s) pkg_free(s); - if ((fp->type != FPARAM_REGEX) && re) { - regfree(re); - pkg_free(re); - } - return -1; -} - - -inline static int w_t_check(struct sip_msg* msg, char* str, char* str2) -{ - return (t_check_msg( msg , 0 )==1) ? 1 : -1; -} - -inline static int w_t_lookup_cancel(struct sip_msg* msg, char* str, char* str2) -{ - struct cell *ret; - int i=0; - if (msg->REQ_METHOD==METHOD_CANCEL) { - ret = t_lookupOriginalT( msg ); - DBG("lookup_original: t_lookupOriginalT returned: %p\n", ret); - if (ret != T_NULL_CELL) { - /* If the parameter is set to 1, overwrite the message flags of - * the CANCEL with the flags of the INVITE */ - if (str && (get_int_fparam(&i, msg, (fparam_t*)str)==0) && i) - msg->flags = ret->uas.request->flags; - - /* The cell is reffed by t_lookupOriginalT, but T is not set. - So we must unref it before returning. */ - UNREF(ret); - return 1; - } - } else { - LOG(L_WARN, "WARNING: script error t_lookup_cancel() called for non-CANCEL request\n"); - } - return -1; -} - -inline static int str2proto(char *s, int len) { - if (len == 3 && !strncasecmp(s, "udp", 3)) - return PROTO_UDP; - else if (len == 3 && !strncasecmp(s, "tcp", 3)) /* tcp&tls checks will be passed in getproto() */ - return PROTO_TCP; - else if (len == 3 && !strncasecmp(s, "tls", 3)) - return PROTO_TLS; - else if (len == 4 && !strncasecmp(s, "sctp", 4)) - return PROTO_SCTP; - else if (len == 2 && !strncasecmp(s, "ws", 2)) - return PROTO_WS; - else if (len == 3 && !strncasecmp(s, "wss", 3)) { - LM_WARN("\"wss\" used somewhere...\n"); - return PROTO_WS; - } else - return PROTO_NONE; -} - -inline static struct proxy_l* t_protoaddr2proxy(char *proto_par, char *addr_par) { - struct proxy_l *proxy = 0; - avp_t* avp; - avp_value_t val; - int proto, port, err; - str s; - char *c; - - switch(((fparam_t *)proto_par)->type) { - case FPARAM_AVP: - if (!(avp = search_first_avp(((fparam_t *)proto_par)->v.avp.flags, ((fparam_t *)proto_par)->v.avp.name, &val, 0))) { - proto = PROTO_NONE; - } else { - if (avp->flags & AVP_VAL_STR) { - proto = str2proto(val.s.s, val.s.len); - } - else { - proto = val.n; - } + + if (init_callid() < 0) { + LOG(L_CRIT, "Error while initializing Call-ID generator\n"); + return -1; } - break; - case FPARAM_INT: - proto = ((fparam_t *)proto_par)->v.i; - break; - case FPARAM_STRING: - proto = str2proto( ((fparam_t *)proto_par)->v.asciiz, strlen(((fparam_t *)proto_par)->v.asciiz)); - break; - default: - ERR("BUG: Invalid proto parameter value in t_protoaddr2proxy\n"); - return 0; - } + /* building the hash table*/ + if (!init_hash_table()) { + LOG(L_ERR, "ERROR: mod_init: initializing hash_table failed\n"); + return -1; + } + /* init static hidden values */ + init_t(); - switch(((fparam_t *)addr_par)->type) { - case FPARAM_AVP: - if (!(avp = search_first_avp(((fparam_t *)addr_par)->v.avp.flags, ((fparam_t *)addr_par)->v.avp.name, &val, 0))) { - s.len = 0; - } else { - if ((avp->flags & AVP_VAL_STR) == 0) { - LOG(L_ERR, "tm:t_protoaddr2proxy: avp <%.*s> value is not string\n", - ((fparam_t *)addr_par)->v.avp.name.s.len, ((fparam_t *)addr_par)->v.avp.name.s.s); - return 0; - } - s = val.s; + if (tm_init_selects()==-1) { + LOG(L_ERR, "ERROR: mod_init: select init failed\n"); + return -1; } - break; - case FPARAM_STRING: - s.s = ((fparam_t *) addr_par)->v.asciiz; - s.len = strlen(s.s); - break; + /* the default timer values must be fixed-up before + * declaring the configuration (Miklos) */ + if (tm_init_timers()==-1) { + LOG(L_ERR, "ERROR: mod_init: timer init failed\n"); + return -1; + } - default: - ERR("BUG: Invalid addr parameter value in t_protoaddr2proxy\n"); - return 0; - } + /* the cancel branch flags must be fixed before declaring the + * configuration */ + if (cancel_b_flags_get(&default_tm_cfg.cancel_b_flags, + default_tm_cfg.cancel_b_flags)<0){ + LOG(L_ERR, "ERROR: mod_init: bad cancel branch method\n"); + return -1; + } - port = 5060; - if (s.len) { - c = memchr(s.s, ':', s.len); - if (c) { - port = str2s(c+1, s.len-(c-s.s+1), &err); - if (err!=0) { - LOG(L_ERR, "tm:t_protoaddr2proxy: bad port number <%.*s>\n", - s.len, s.s); - return 0; - } - s.len = c-s.s; +#ifdef USE_DNS_FAILOVER + if (default_tm_cfg.reparse_on_dns_failover && mhomed) { + LOG(L_WARN, "WARNING: mod_init: " + "reparse_on_dns_failover is enabled on a " + "multihomed host -- check the readme of tm module!\n"); } - } - if (!s.len) { - LOG(L_ERR, "tm: protoaddr2proxy: host name is empty\n"); - return 0; - } - proxy=mk_proxy(&s, port, proto); - if (proxy==0) { - LOG(L_ERR, "tm: protoaddr2proxy: bad host name in URI <%.*s>\n", - s.len, s.s ); - return 0; - } - return proxy; -} +#endif -inline static int _w_t_forward_nonack(struct sip_msg* msg, struct proxy_l* proxy, - int proto) -{ - struct cell *t; - if (t_check( msg , 0 )==-1) { - LOG(L_ERR, "ERROR: forward_nonack: " - "can't forward when no transaction was set up\n"); - return -1; - } - t=get_t(); - if ( t && t!=T_UNDEFINED ) { - if (msg->REQ_METHOD==METHOD_ACK) { - LOG(L_WARN,"WARNING: you don't really want to fwd hbh ACK\n"); + /* declare the configuration */ + if (cfg_declare("tm", tm_cfg_def, &default_tm_cfg, cfg_sizeof(tm), + &tm_cfg)) { + LOG(L_ERR, "ERROR: mod_init: failed to declare the configuration\n"); return -1; } - return t_forward_nonack(t, msg, proxy, proto ); - } else { - DBG("DEBUG: forward_nonack: no transaction found\n"); - return -1; - } -} + /* First tm_stat initialization function only allocates the top level stat + * structure in shared memory, the initialization will complete in child + * init with init_tm_stats_child when the final value of estimated_process_count is + * known + */ + if (init_tm_stats() < 0) { + LOG(L_CRIT, "ERROR: mod_init: failed to init stats\n"); + return -1; + } -inline static int w_t_forward_nonack( struct sip_msg* msg, char* proxy, - char* foo) -{ - return _w_t_forward_nonack(msg, ( struct proxy_l *) proxy, PROTO_NONE); -} + if (uac_init()==-1) { + LOG(L_ERR, "ERROR: mod_init: uac_init failed\n"); + return -1; + } + if (init_tmcb_lists()!=1) { + LOG(L_CRIT, "ERROR:tm:mod_init: failed to init tmcb lists\n"); + return -1; + } -inline static int w_t_forward_nonack_uri(struct sip_msg* msg, char *foo, - char *bar) -{ - return _w_t_forward_nonack(msg, 0, PROTO_NONE); -} + tm_init_tags(); + init_twrite_lines(); + if (init_twrite_sock() < 0) { + LOG(L_ERR, "ERROR:tm:mod_init: Unable to create socket\n"); + return -1; + } + /* register post-script clean-up function */ + if (register_script_cb( w_t_unref, POST_SCRIPT_CB|REQUEST_CB, 0)<0 ) { + LOG(L_ERR,"ERROR:tm:mod_init: failed to register POST request " + "callback\n"); + return -1; + } + if (register_script_cb( script_init, PRE_SCRIPT_CB|REQUEST_CB , 0)<0 ) { + LOG(L_ERR,"ERROR:tm:mod_init: failed to register PRE request " + "callback\n"); + return -1; + } -inline static int w_t_forward_nonack_udp( struct sip_msg* msg, char* proxy, - char* foo) -{ - return _w_t_forward_nonack(msg, ( struct proxy_l *) proxy, PROTO_UDP); -} + if (init_avp_params(fr_timer_param, fr_inv_timer_param) < 0) { + LOG(L_ERR,"ERROR:tm:mod_init: failed to process AVP params\n"); + return -1; + } + if ((contacts_avp.len > 0) && (contact_flows_avp.len == 0)) { + LOG(L_ERR,"ERROR:tm:mod_init: contact_flows_avp param has not been defined\n"); + return -1; + } +#ifdef WITH_EVENT_LOCAL_REQUEST + goto_on_local_req=route_lookup(&event_rt, "tm:local-request"); + if (goto_on_local_req>=0 && event_rt.rlist[goto_on_local_req]==0) + goto_on_local_req=-1; /* disable */ + if (goto_on_local_req>=0) + set_child_rpc_sip_mode(); +#endif /* WITH_EVENT_LOCAL_REQUEST */ + if (goto_on_sl_reply && onreply_rt.rlist[goto_on_sl_reply]==0) + WARN("empty/non existing on_sl_reply route\n"); -#ifdef USE_TCP -inline static int w_t_forward_nonack_tcp( struct sip_msg* msg, char* proxy, - char* foo) -{ - return _w_t_forward_nonack(msg, ( struct proxy_l *) proxy, PROTO_TCP); -} +#ifdef WITH_TM_CTX + tm_ctx_init(); #endif + tm_init = 1; + return 0; + } + static int child_init(int rank) + { + if (rank == PROC_INIT) { + /* we must init stats when rank==PROC_INIT: after mod_init we know + * the exact number of processes and we must init the shared structure + * before any other process is starting (or else some new process + * might try to use the stats before the stats array is allocated) */ + if (init_tm_stats_child() < 0) { + ERR("Error while initializing tm statistics structures\n"); + return -1; + } + }else if (child_init_callid(rank) < 0) { + /* don't init callid for PROC_INIT*/ + LOG(L_ERR, "ERROR: child_init: Error while initializing Call-ID" + " generator\n"); + return -2; + } + return 0; + } -#ifdef USE_TLS -inline static int w_t_forward_nonack_tls( struct sip_msg* msg, char* proxy, - char* foo) -{ - return _w_t_forward_nonack(msg, ( struct proxy_l *) proxy, PROTO_TLS); -} -#endif -#ifdef USE_SCTP -inline static int w_t_forward_nonack_sctp( struct sip_msg* msg, char* proxy, - char* foo) -{ - return _w_t_forward_nonack(msg, ( struct proxy_l *) proxy, PROTO_SCTP); -} -#endif + /**************************** wrapper functions ***************************/ + static int t_check_status(struct sip_msg* msg, char *p1, char *foo) + { + regmatch_t pmatch; + struct cell *t; + char *status, *s = NULL; + char backup; + int lowest_status, n, ret; + fparam_t* fp; + regex_t* re = NULL; + str tmp; + + fp = (fparam_t*)p1; + t = 0; + /* first get the transaction */ + if (t_check(msg, 0 ) == -1) return -1; + if ((t = get_t()) == 0) { + LOG(L_ERR, "ERROR: t_check_status: cannot check status for a reply " + "which has no T-state established\n"); + goto error; + } + backup = 0; + + switch(fp->type) { + case FPARAM_REGEX: + re = fp->v.regex; + break; + + default: + /* AVP or select, get the value and compile the regex */ + if (get_str_fparam(&tmp, msg, fp) < 0) goto error; + s = pkg_malloc(tmp.len + 1); + if (s == NULL) { + ERR("Out of memory\n"); + goto error; + } + memcpy(s, tmp.s, tmp.len); + s[tmp.len] = '\0'; + if ((re = pkg_malloc(sizeof(regex_t))) == 0) { + ERR("No memory left\n"); + goto error; + } -inline static int w_t_forward_nonack_to( struct sip_msg *p_msg , - char *proto_par, - char *addr_par ) -{ - struct proxy_l *proxy; - int r = -1; - proxy = t_protoaddr2proxy(proto_par, addr_par); - if (proxy) { - r = _w_t_forward_nonack(p_msg, proxy, proxy->proto); - free_proxy(proxy); - pkg_free(proxy); - } - return r; -} + if (regcomp(re, s, REG_EXTENDED|REG_ICASE|REG_NEWLINE)) { + ERR("Bad regular expression '%s'\n", s); + pkg_free(re); + re = NULL; + goto error; + } + break; + } + switch(get_route_type()) { + case REQUEST_ROUTE: + /* use the status of the last sent reply */ + status = int2str( t->uas.status, 0); + break; + + case TM_ONREPLY_ROUTE: + case CORE_ONREPLY_ROUTE: + /* use the status of the current reply */ + status = msg->first_line.u.reply.status.s; + backup = status[msg->first_line.u.reply.status.len]; + status[msg->first_line.u.reply.status.len] = 0; + break; + + case FAILURE_ROUTE: + /* use the status of the winning reply */ + ret = t_pick_branch( -1, 0, t, &lowest_status); + if (ret == -1) { + /* t_pick_branch() retuns error also when there are only + * blind UACs. Let us give it another chance including the + * blind branches. */ + LOG(L_DBG, "DEBUG: t_check_status: t_pick_branch returned error, " + "trying t_pick_branch_blind\n"); + ret = t_pick_branch_blind(t, &lowest_status); + } + if (ret < 0) { + LOG(L_CRIT,"BUG:t_check_status: t_pick_branch failed to get " + " a final response in FAILURE_ROUTE\n"); + goto error; + } + status = int2str( lowest_status , 0); + break; + case BRANCH_FAILURE_ROUTE: + status = int2str(t->uac[get_t_branch()].last_received, 0); + break; + default: + LOG(L_ERR,"ERROR:t_check_status: unsupported route type %d\n", + get_route_type()); + goto error; + } -inline static int w_t_reply(struct sip_msg* msg, char* p1, char* p2) -{ - struct cell *t; - int code, ret = -1; - str reason; - char* r; + DBG("DEBUG:t_check_status: checked status is <%s>\n",status); + /* do the checking */ + n = regexec(re, status, 1, &pmatch, 0); - if (msg->REQ_METHOD==METHOD_ACK) { - LOG(L_WARN, "WARNING: t_reply: ACKs are not replied\n"); - return -1; - } - if (t_check( msg , 0 )==-1) return -1; - t=get_t(); - if (!t) { - LOG(L_ERR, "ERROR: t_reply: cannot send a t_reply to a message " - "for which no T-state has been established\n"); - return -1; - } + if (backup) status[msg->first_line.u.reply.status.len] = backup; + if (s) pkg_free(s); + if ((fp->type != FPARAM_REGEX) && re) { + regfree(re); + pkg_free(re); + } - if (get_int_fparam(&code, msg, (fparam_t*)p1) < 0) { - code = cfg_get(tm, tm_cfg, default_code); - } - - if (get_str_fparam(&reason, msg, (fparam_t*)p2) < 0) { - r = cfg_get(tm, tm_cfg, default_reason); - } else { - r = as_asciiz(&reason); - if (r == NULL) r = cfg_get(tm, tm_cfg, default_reason); - } - - /* if called from reply_route, make sure that unsafe version - * is called; we are already in a mutex and another mutex in - * the safe version would lead to a deadlock - */ - - t->flags |= T_ADMIN_REPLY; - if (is_route_type(FAILURE_ROUTE)) { - DBG("DEBUG: t_reply_unsafe called from w_t_reply\n"); - ret = t_reply_unsafe(t, msg, code, r); - } else if (is_route_type(REQUEST_ROUTE)) { - ret = t_reply( t, msg, code, r); - } else if (is_route_type(ONREPLY_ROUTE)) { - if (likely(t->uas.request)){ - if (is_route_type(CORE_ONREPLY_ROUTE)) - ret=t_reply(t, t->uas.request, code, r); - else - ret=t_reply_unsafe(t, t->uas.request, code, r); - }else - ret=-1; - /* t_check() above has the side effect of setting T and - REFerencing T => we must unref and unset it. - Note: this is needed only in the CORE_ONREPLY_ROUTE and not also in - the TM_ONREPLY_ROUTE. - */ - if (is_route_type(CORE_ONREPLY_ROUTE)) { + if (unlikely(t && is_route_type(CORE_ONREPLY_ROUTE))){ + /* t_check() above has the side effect of setting T and + * REFerencing T => we must unref and unset it. */ + UNREF( t ); + set_t(T_UNDEFINED, T_BR_UNDEFINED); + } + if (n!=0) return -1; + return 1; + +error: + if (unlikely(t && is_route_type(CORE_ONREPLY_ROUTE))){ + /* t_check() above has the side effect of setting T and + * REFerencing T => we must unref and unset it. */ UNREF( t ); set_t(T_UNDEFINED, T_BR_UNDEFINED); } - } else { - LOG(L_CRIT, "BUG: w_t_reply entered in unsupported mode\n"); - ret = -1; + if (s) pkg_free(s); + if ((fp->type != FPARAM_REGEX) && re) { + regfree(re); + pkg_free(re); + } + return -1; } - if (r && (r != cfg_get(tm, tm_cfg, default_reason))) pkg_free(r); - return ret; -} + inline static int w_t_check(struct sip_msg* msg, char* str, char* str2) + { + return (t_check_msg( msg , 0 )==1) ? 1 : -1; + } -inline static int w_t_release(struct sip_msg* msg, char* str, char* str2) -{ - struct cell *t; - int ret; - - if(get_route_type()!=REQUEST_ROUTE) + inline static int w_t_lookup_cancel(struct sip_msg* msg, char* str, char* str2) { - LM_INFO("invalid usage - not in request route\n"); + struct cell *ret; + int i=0; + if (msg->REQ_METHOD==METHOD_CANCEL) { + ret = t_lookupOriginalT( msg ); + DBG("lookup_original: t_lookupOriginalT returned: %p\n", ret); + if (ret != T_NULL_CELL) { + /* If the parameter is set to 1, overwrite the message flags of + * the CANCEL with the flags of the INVITE */ + if (str && (get_int_fparam(&i, msg, (fparam_t*)str)==0) && i) + msg->flags = ret->uas.request->flags; + + /* The cell is reffed by t_lookupOriginalT, but T is not set. + So we must unref it before returning. */ + UNREF(ret); + return 1; + } + } else { + LOG(L_WARN, "WARNING: script error t_lookup_cancel() called for non-CANCEL request\n"); + } return -1; } - if (t_check( msg , 0 )==-1) return -1; - t=get_t(); - if ( t && t!=T_UNDEFINED ) { - ret = t_release_transaction( t ); - t_unref(msg); - return ret; - } - return 1; -} + inline static int str2proto(char *s, int len) { + if (len == 3 && !strncasecmp(s, "udp", 3)) + return PROTO_UDP; + else if (len == 3 && !strncasecmp(s, "tcp", 3)) /* tcp&tls checks will be passed in getproto() */ + return PROTO_TCP; + else if (len == 3 && !strncasecmp(s, "tls", 3)) + return PROTO_TLS; + else if (len == 4 && !strncasecmp(s, "sctp", 4)) + return PROTO_SCTP; + else if (len == 2 && !strncasecmp(s, "ws", 2)) + return PROTO_WS; + else if (len == 3 && !strncasecmp(s, "wss", 3)) { + LM_WARN("\"wss\" used somewhere...\n"); + return PROTO_WS; + } else + return PROTO_NONE; + } + + inline static struct proxy_l* t_protoaddr2proxy(char *proto_par, char *addr_par) { + struct proxy_l *proxy = 0; + avp_t* avp; + avp_value_t val; + int proto, port, err; + str s; + char *c; + + switch(((fparam_t *)proto_par)->type) { + case FPARAM_AVP: + if (!(avp = search_first_avp(((fparam_t *)proto_par)->v.avp.flags, ((fparam_t *)proto_par)->v.avp.name, &val, 0))) { + proto = PROTO_NONE; + } else { + if (avp->flags & AVP_VAL_STR) { + proto = str2proto(val.s.s, val.s.len); + } + else { + proto = val.n; + } + } + break; + + case FPARAM_INT: + proto = ((fparam_t *)proto_par)->v.i; + break; + case FPARAM_STRING: + proto = str2proto( ((fparam_t *)proto_par)->v.asciiz, strlen(((fparam_t *)proto_par)->v.asciiz)); + break; + default: + ERR("BUG: Invalid proto parameter value in t_protoaddr2proxy\n"); + return 0; + } -inline static int w_t_retransmit_reply( struct sip_msg* p_msg, char* foo, char* bar) -{ - struct cell *t; + switch(((fparam_t *)addr_par)->type) { + case FPARAM_AVP: + if (!(avp = search_first_avp(((fparam_t *)addr_par)->v.avp.flags, ((fparam_t *)addr_par)->v.avp.name, &val, 0))) { + s.len = 0; + } else { + if ((avp->flags & AVP_VAL_STR) == 0) { + LOG(L_ERR, "tm:t_protoaddr2proxy: avp <%.*s> value is not string\n", + ((fparam_t *)addr_par)->v.avp.name.s.len, ((fparam_t *)addr_par)->v.avp.name.s.s); + return 0; + } + s = val.s; + } + break; + case FPARAM_STRING: + s.s = ((fparam_t *) addr_par)->v.asciiz; + s.len = strlen(s.s); + break; - if (t_check( p_msg , 0 )==-1) - return 1; - t=get_t(); - if (t) { - if (p_msg->REQ_METHOD==METHOD_ACK) { - LOG(L_WARN, "WARNING: : ACKs transmit_replies not replied\n"); - return -1; + default: + ERR("BUG: Invalid addr parameter value in t_protoaddr2proxy\n"); + return 0; } - return t_retransmit_reply( t ); - } else - return -1; -} - - -inline static int w_t_newtran( struct sip_msg* p_msg, char* foo, char* bar ) -{ - /* t_newtran returns 0 on error (negative value means - 'transaction exists' */ - int ret; - ret = t_newtran( p_msg ); - if (ret==E_SCRIPT) { - LOG(L_ERR, "ERROR: t_newtran: " - "transaction already in process %p\n", get_t() ); - } - return ret; -} - - -inline static int w_t_on_failure( struct sip_msg* msg, char *go_to, char *foo) -{ - t_on_failure( (unsigned int )(long) go_to ); - return 1; -} - - -inline static int w_t_on_branch_failure( struct sip_msg* msg, char *go_to, char *foo) -{ - t_on_branch_failure( (unsigned int )(long) go_to ); - return 1; -} - - -inline static int w_t_on_branch( struct sip_msg* msg, char *go_to, char *foo) -{ - t_on_branch( (unsigned int )(long) go_to ); - return 1; -} - - -inline static int w_t_on_reply( struct sip_msg* msg, char *go_to, char *foo ) -{ - t_on_reply( (unsigned int )(long) go_to ); - return 1; -} - - -static int w_t_is_set(struct sip_msg* msg, char *target, char *foo ) -{ - int r; - tm_cell_t *t = NULL; - - r = 0; - t = get_t(); - if (t==T_UNDEFINED) t = NULL; - - switch(target[0]) { - case 'b': - if(t==NULL) - r = get_on_branch(); - else - r = t->on_branch; - break; - case 'f': - if(t==NULL) - r = get_on_failure(); - else - r = t->on_failure; - break; - case 'o': - if(t==NULL) - r = get_on_reply(); - else - r = t->on_reply; - break; - } - if(r) return 1; - return -1; -} - -static int fixup_t_is_set(void** param, int param_no) -{ - int len; - if (param_no==1) { - len = strlen((char*)*param); - if((len==13 && strncmp((char*)*param, "failure_route", 13)==0) - || (len==13 && strncmp((char*)*param, "onreply_route", 13)==0) - || (len==12 && strncmp((char*)*param, "branch_route", 12)==0)) { + + port = 5060; + if (s.len) { + c = memchr(s.s, ':', s.len); + if (c) { + port = str2s(c+1, s.len-(c-s.s+1), &err); + if (err!=0) { + LOG(L_ERR, "tm:t_protoaddr2proxy: bad port number <%.*s>\n", + s.len, s.s); + return 0; + } + s.len = c-s.s; + } + } + if (!s.len) { + LOG(L_ERR, "tm: protoaddr2proxy: host name is empty\n"); return 0; } - - LM_ERR("invalid parameter value: %s\n", (char*)*param); - return 1; + proxy=mk_proxy(&s, port, proto); + if (proxy==0) { + LOG(L_ERR, "tm: protoaddr2proxy: bad host name in URI <%.*s>\n", + s.len, s.s ); + return 0; + } + return proxy; } - return 0; -} -inline static int _w_t_relay_to(struct sip_msg *p_msg , - struct proxy_l *proxy, int force_proto) -{ - struct cell *t; - int res; - - if (is_route_type(FAILURE_ROUTE|BRANCH_FAILURE_ROUTE)) { - t=get_t(); - if (!t || t==T_UNDEFINED) { - LOG(L_CRIT, "BUG: w_t_relay_to: undefined T\n"); + inline static int _w_t_forward_nonack(struct sip_msg* msg, struct proxy_l* proxy, + int proto) + { + struct cell *t; + if (t_check( msg , 0 )==-1) { + LOG(L_ERR, "ERROR: forward_nonack: " + "can't forward when no transaction was set up\n"); return -1; } - res = t_forward_nonack(t, p_msg, proxy, force_proto); - if (res <= 0) { - if (res != E_CFG) { - LOG(L_ERR, "ERROR: w_t_relay_to: t_relay_to failed\n"); - /* let us save the error code, we might need it later - when the failure_route has finished (Miklos) */ + t=get_t(); + if ( t && t!=T_UNDEFINED ) { + if (msg->REQ_METHOD==METHOD_ACK) { + LOG(L_WARN,"WARNING: you don't really want to fwd hbh ACK\n"); + return -1; } - tm_error=ser_error; + return t_forward_nonack(t, msg, proxy, proto ); + } else { + DBG("DEBUG: forward_nonack: no transaction found\n"); return -1; } - return 1; } - if (is_route_type(REQUEST_ROUTE)) - return t_relay_to( p_msg, proxy, force_proto, - 0 /* no replication */ ); - LOG(L_CRIT, "ERROR: w_t_relay_to: unsupported route type: %d\n", - get_route_type()); - return 0; -} -inline static int w_t_relay_to_udp( struct sip_msg *p_msg , - char *proxy,/* struct proxy_l * expected */ - char *_foo /* nothing expected */ ) -{ - return _w_t_relay_to( p_msg, ( struct proxy_l *) proxy, PROTO_UDP); -} + inline static int w_t_forward_nonack( struct sip_msg* msg, char* proxy, + char* foo) + { + return _w_t_forward_nonack(msg, ( struct proxy_l *) proxy, PROTO_NONE); + } -/* forward to uri, but force udp as transport */ -inline static int w_t_relay_to_udp_uri( struct sip_msg *p_msg , - char *_foo, char *_bar ) -{ - return _w_t_relay_to(p_msg, (struct proxy_l *)0, PROTO_UDP); -} + + inline static int w_t_forward_nonack_uri(struct sip_msg* msg, char *foo, + char *bar) + { + return _w_t_forward_nonack(msg, 0, PROTO_NONE); + } + + + inline static int w_t_forward_nonack_udp( struct sip_msg* msg, char* proxy, + char* foo) + { + return _w_t_forward_nonack(msg, ( struct proxy_l *) proxy, PROTO_UDP); + } #ifdef USE_TCP -inline static int w_t_relay_to_tcp( struct sip_msg *p_msg , - char *proxy, /* struct proxy_l* */ - char *_foo /* nothing expected */ ) -{ - return _w_t_relay_to( p_msg, ( struct proxy_l *) proxy, PROTO_TCP); -} - -/* forward to uri, but force tcp as transport */ -inline static int w_t_relay_to_tcp_uri( struct sip_msg *p_msg , - char *_foo, char *_bar ) -{ - return _w_t_relay_to(p_msg, (struct proxy_l *)0, PROTO_TCP); -} + inline static int w_t_forward_nonack_tcp( struct sip_msg* msg, char* proxy, + char* foo) + { + return _w_t_forward_nonack(msg, ( struct proxy_l *) proxy, PROTO_TCP); + } #endif #ifdef USE_TLS -inline static int w_t_relay_to_tls( struct sip_msg *p_msg , - char *proxy, /* struct proxy_l* expected */ - char *_foo /* nothing expected */ ) -{ - return _w_t_relay_to( p_msg, ( struct proxy_l *) proxy, PROTO_TLS); -} - -/* forward to uri, but force tls as transport */ -inline static int w_t_relay_to_tls_uri( struct sip_msg *p_msg , - char *_foo, char *_bar ) -{ - return _w_t_relay_to(p_msg, (struct proxy_l *)0, PROTO_TLS); -} + inline static int w_t_forward_nonack_tls( struct sip_msg* msg, char* proxy, + char* foo) + { + return _w_t_forward_nonack(msg, ( struct proxy_l *) proxy, PROTO_TLS); + } #endif #ifdef USE_SCTP -inline static int w_t_relay_to_sctp( struct sip_msg *p_msg , - char *proxy, /* struct proxy_l* */ - char *_foo /* nothing expected */ ) -{ - return _w_t_relay_to( p_msg, ( struct proxy_l *) proxy, PROTO_SCTP); -} - -/* forward to uri, but force tcp as transport */ -inline static int w_t_relay_to_sctp_uri( struct sip_msg *p_msg , - char *_foo, char *_bar ) -{ - return _w_t_relay_to(p_msg, (struct proxy_l *)0, PROTO_SCTP); -} + inline static int w_t_forward_nonack_sctp( struct sip_msg* msg, char* proxy, + char* foo) + { + return _w_t_forward_nonack(msg, ( struct proxy_l *) proxy, PROTO_SCTP); + } #endif -inline static int w_t_relay_to_avp( struct sip_msg *p_msg , - char *proto_par, - char *addr_par ) -{ - struct proxy_l *proxy; - int r = -1; - - proxy = t_protoaddr2proxy(proto_par, addr_par); - if (proxy) { - r = _w_t_relay_to(p_msg, proxy, PROTO_NONE); - free_proxy(proxy); - pkg_free(proxy); - } - return r; -} - -int t_replicate_uri(struct sip_msg *msg, str *suri) -{ - struct proxy_l *proxy = NULL; - struct sip_uri turi; - int r = -1; - - if (suri != NULL && suri->s != NULL && suri->len > 0) - { - memset(&turi, 0, sizeof(struct sip_uri)); - if(parse_uri(suri->s, suri->len, &turi)!=0) + inline static int w_t_forward_nonack_to( struct sip_msg *p_msg , + char *proto_par, + char *addr_par ) + { + struct proxy_l *proxy; + int r = -1; + proxy = t_protoaddr2proxy(proto_par, addr_par); + if (proxy) { + r = _w_t_forward_nonack(p_msg, proxy, proxy->proto); + free_proxy(proxy); + pkg_free(proxy); + } + return r; + } + + + inline static int w_t_reply(struct sip_msg* msg, char* p1, char* p2) + { + struct cell *t; + int code, ret = -1; + str reason; + char* r; + + if (msg->REQ_METHOD==METHOD_ACK) { + LOG(L_WARN, "WARNING: t_reply: ACKs are not replied\n"); + return -1; + } + if (t_check( msg , 0 )==-1) return -1; + t=get_t(); + if (!t) { + LOG(L_ERR, "ERROR: t_reply: cannot send a t_reply to a message " + "for which no T-state has been established\n"); + return -1; + } + + if (get_int_fparam(&code, msg, (fparam_t*)p1) < 0) { + code = cfg_get(tm, tm_cfg, default_code); + } + + if (get_str_fparam(&reason, msg, (fparam_t*)p2) < 0) { + r = cfg_get(tm, tm_cfg, default_reason); + } else { + r = as_asciiz(&reason); + if (r == NULL) r = cfg_get(tm, tm_cfg, default_reason); + } + + /* if called from reply_route, make sure that unsafe version + * is called; we are already in a mutex and another mutex in + * the safe version would lead to a deadlock + */ + + t->flags |= T_ADMIN_REPLY; + if (is_route_type(FAILURE_ROUTE)) { + DBG("DEBUG: t_reply_unsafe called from w_t_reply\n"); + ret = t_reply_unsafe(t, msg, code, r); + } else if (is_route_type(REQUEST_ROUTE)) { + ret = t_reply( t, msg, code, r); + } else if (is_route_type(ONREPLY_ROUTE)) { + if (likely(t->uas.request)){ + if (is_route_type(CORE_ONREPLY_ROUTE)) + ret=t_reply(t, t->uas.request, code, r); + else + ret=t_reply_unsafe(t, t->uas.request, code, r); + }else + ret=-1; + /* t_check() above has the side effect of setting T and + * REFerencing T => we must unref and unset it. + * Note: this is needed only in the CORE_ONREPLY_ROUTE and not also in + * the TM_ONREPLY_ROUTE. + */ + if (is_route_type(CORE_ONREPLY_ROUTE)) { + UNREF( t ); + set_t(T_UNDEFINED, T_BR_UNDEFINED); + } + } else { + LOG(L_CRIT, "BUG: w_t_reply entered in unsupported mode\n"); + ret = -1; + } + + if (r && (r != cfg_get(tm, tm_cfg, default_reason))) pkg_free(r); + return ret; + } + + + inline static int w_t_release(struct sip_msg* msg, char* str, char* str2) + { + struct cell *t; + int ret; + + if(get_route_type()!=REQUEST_ROUTE) { - LM_ERR("bad replicate SIP address!\n"); + LM_INFO("invalid usage - not in request route\n"); return -1; } - proxy=mk_proxy(&turi.host, turi.port_no, turi.proto); - if (proxy==0) { - LM_ERR("cannot create proxy from URI <%.*s>\n", - suri->len, suri->s ); + if (t_check( msg , 0 )==-1) return -1; + t=get_t(); + if ( t && t!=T_UNDEFINED ) { + ret = t_release_transaction( t ); + t_unref(msg); + return ret; + } + return 1; + } + + + inline static int w_t_retransmit_reply( struct sip_msg* p_msg, char* foo, char* bar) + { + struct cell *t; + + + if (t_check( p_msg , 0 )==-1) + return 1; + t=get_t(); + if (t) { + if (p_msg->REQ_METHOD==METHOD_ACK) { + LOG(L_WARN, "WARNING: : ACKs transmit_replies not replied\n"); + return -1; + } + return t_retransmit_reply( t ); + } else return -1; + } + + + inline static int w_t_newtran( struct sip_msg* p_msg, char* foo, char* bar ) + { + /* t_newtran returns 0 on error (negative value means + * 'transaction exists' */ + int ret; + ret = t_newtran( p_msg ); + if (ret==E_SCRIPT) { + LOG(L_ERR, "ERROR: t_newtran: " + "transaction already in process %p\n", get_t() ); } + return ret; + } + - r = t_replicate(msg, proxy, proxy->proto); - free_proxy(proxy); - pkg_free(proxy); - } else { - r = t_replicate(msg, NULL, 0); + inline static int w_t_on_failure( struct sip_msg* msg, char *go_to, char *foo) + { + t_on_failure( (unsigned int )(long) go_to ); + return 1; + } + + + inline static int w_t_on_branch_failure( struct sip_msg* msg, char *go_to, char *foo) + { + t_on_branch_failure( (unsigned int )(long) go_to ); + return 1; } - return r; -} -inline static int w_t_replicate_uri(struct sip_msg *msg , - char *uri, /* sip uri as string or variable */ - char *_foo /* nothing expected */ ) -{ - str suri; - if(uri==NULL) - return t_replicate_uri(msg, NULL); + inline static int w_t_on_branch( struct sip_msg* msg, char *go_to, char *foo) + { + t_on_branch( (unsigned int )(long) go_to ); + return 1; + } - if(fixup_get_svalue(msg, (gparam_p)uri, &suri)!=0) + + inline static int w_t_on_reply( struct sip_msg* msg, char *go_to, char *foo ) { - LM_ERR("invalid replicate uri parameter"); + t_on_reply( (unsigned int )(long) go_to ); + return 1; + } + + + static int w_t_is_set(struct sip_msg* msg, char *target, char *foo ) + { + int r; + tm_cell_t *t = NULL; + + r = 0; + t = get_t(); + if (t==T_UNDEFINED) t = NULL; + + switch(target[0]) { + case 'b': + if(t==NULL) + r = get_on_branch(); + else + r = t->on_branch; + break; + case 'f': + if(t==NULL) + r = get_on_failure(); + else + r = t->on_failure; + break; + case 'o': + if(t==NULL) + r = get_on_reply(); + else + r = t->on_reply; + break; + } + if(r) return 1; return -1; } - return t_replicate_uri(msg, &suri); -} -inline static int w_t_replicate( struct sip_msg *p_msg , - char *proxy, /* struct proxy_l *proxy expected */ - char *_foo /* nothing expected */ ) -{ - return t_replicate(p_msg, ( struct proxy_l *) proxy, p_msg->rcv.proto ); -} + static int fixup_t_is_set(void** param, int param_no) + { + int len; + if (param_no==1) { + len = strlen((char*)*param); + if((len==13 && strncmp((char*)*param, "failure_route", 13)==0) + || (len==13 && strncmp((char*)*param, "onreply_route", 13)==0) + || (len==12 && strncmp((char*)*param, "branch_route", 12)==0)) { + return 0; + } + + LM_ERR("invalid parameter value: %s\n", (char*)*param); + return 1; + } + return 0; + } + + inline static int _w_t_relay_to(struct sip_msg *p_msg , + struct proxy_l *proxy, int force_proto) + { + struct cell *t; + int res; + + if (is_route_type(FAILURE_ROUTE|BRANCH_FAILURE_ROUTE)) { + t=get_t(); + if (!t || t==T_UNDEFINED) { + LOG(L_CRIT, "BUG: w_t_relay_to: undefined T\n"); + return -1; + } + res = t_forward_nonack(t, p_msg, proxy, force_proto); + if (res <= 0) { + if (res != E_CFG) { + LOG(L_ERR, "ERROR: w_t_relay_to: t_relay_to failed\n"); + /* let us save the error code, we might need it later + * when the failure_route has finished (Miklos) */ + } + tm_error=ser_error; + return -1; + } + return 1; + } + if (is_route_type(REQUEST_ROUTE)) + return t_relay_to( p_msg, proxy, force_proto, + 0 /* no replication */ ); + LOG(L_CRIT, "ERROR: w_t_relay_to: unsupported route type: %d\n", + get_route_type()); + return 0; + } -inline static int w_t_replicate_udp( struct sip_msg *p_msg , - char *proxy, /* struct proxy_l *proxy expected */ - char *_foo /* nothing expected */ ) -{ - return t_replicate(p_msg, ( struct proxy_l *) proxy, PROTO_UDP ); -} + + inline static int w_t_relay_to_udp( struct sip_msg *p_msg , + char *proxy,/* struct proxy_l * expected */ + char *_foo /* nothing expected */ ) + { + return _w_t_relay_to( p_msg, ( struct proxy_l *) proxy, PROTO_UDP); + } + + /* forward to uri, but force udp as transport */ + inline static int w_t_relay_to_udp_uri( struct sip_msg *p_msg , + char *_foo, char *_bar ) + { + return _w_t_relay_to(p_msg, (struct proxy_l *)0, PROTO_UDP); + } #ifdef USE_TCP -inline static int w_t_replicate_tcp( struct sip_msg *p_msg , - char *proxy, /* struct proxy_l *proxy expected */ - char *_foo /* nothing expected */ ) -{ - return t_replicate(p_msg, ( struct proxy_l *) proxy, PROTO_TCP ); -} + inline static int w_t_relay_to_tcp( struct sip_msg *p_msg , + char *proxy, /* struct proxy_l* */ + char *_foo /* nothing expected */ ) + { + return _w_t_relay_to( p_msg, ( struct proxy_l *) proxy, PROTO_TCP); + } + + /* forward to uri, but force tcp as transport */ + inline static int w_t_relay_to_tcp_uri( struct sip_msg *p_msg , + char *_foo, char *_bar ) + { + return _w_t_relay_to(p_msg, (struct proxy_l *)0, PROTO_TCP); + } #endif #ifdef USE_TLS -inline static int w_t_replicate_tls( struct sip_msg *p_msg , - char *proxy, /* struct proxy_l *proxy expected */ - char *_foo /* nothing expected */ ) -{ - return t_replicate(p_msg, ( struct proxy_l *) proxy, PROTO_TLS ); -} + inline static int w_t_relay_to_tls( struct sip_msg *p_msg , + char *proxy, /* struct proxy_l* expected */ + char *_foo /* nothing expected */ ) + { + return _w_t_relay_to( p_msg, ( struct proxy_l *) proxy, PROTO_TLS); + } + + /* forward to uri, but force tls as transport */ + inline static int w_t_relay_to_tls_uri( struct sip_msg *p_msg , + char *_foo, char *_bar ) + { + return _w_t_relay_to(p_msg, (struct proxy_l *)0, PROTO_TLS); + } #endif #ifdef USE_SCTP -inline static int w_t_replicate_sctp( struct sip_msg *p_msg , - char *proxy, /* struct proxy_l *proxy expected */ - char *_foo /* nothing expected */ ) -{ - return t_replicate(p_msg, ( struct proxy_l *) proxy, PROTO_SCTP ); -} + inline static int w_t_relay_to_sctp( struct sip_msg *p_msg , + char *proxy, /* struct proxy_l* */ + char *_foo /* nothing expected */ ) + { + return _w_t_relay_to( p_msg, ( struct proxy_l *) proxy, PROTO_SCTP); + } + + /* forward to uri, but force tcp as transport */ + inline static int w_t_relay_to_sctp_uri( struct sip_msg *p_msg , + char *_foo, char *_bar ) + { + return _w_t_relay_to(p_msg, (struct proxy_l *)0, PROTO_SCTP); + } #endif -inline static int w_t_replicate_to( struct sip_msg *p_msg , - char *proto_par, - char *addr_par ) -{ - struct proxy_l *proxy; - int r = -1; - proxy = t_protoaddr2proxy(proto_par, addr_par); - if (proxy) { - r = t_replicate(p_msg, proxy, proxy->proto); - free_proxy(proxy); - pkg_free(proxy); - } - return r; -} - -inline static int w_t_relay( struct sip_msg *p_msg , - char *_foo, char *_bar) -{ - return _w_t_relay_to(p_msg, (struct proxy_l *)0, PROTO_NONE); -} - - -/* like t_relay but use the specified destination and port and the same proto - * as the received msg */ -static int w_t_relay2( struct sip_msg *p_msg , char *proxy, - char *_foo) -{ - return _w_t_relay_to(p_msg, (struct proxy_l*) proxy, p_msg->rcv.proto); -} - - -/* relays CANCEL at the beginning of the script */ -inline static int w_t_relay_cancel( struct sip_msg *p_msg , - char *_foo, char *_bar) -{ - if (p_msg->REQ_METHOD!=METHOD_CANCEL) - return 1; + inline static int w_t_relay_to_avp( struct sip_msg *p_msg , + char *proto_par, + char *addr_par ) + { + struct proxy_l *proxy; + int r = -1; + + proxy = t_protoaddr2proxy(proto_par, addr_par); + if (proxy) { + r = _w_t_relay_to(p_msg, proxy, PROTO_NONE); + free_proxy(proxy); + pkg_free(proxy); + } + return r; + } + + int t_replicate_uri(struct sip_msg *msg, str *suri) + { + struct proxy_l *proxy = NULL; + struct sip_uri turi; + int r = -1; + + if (suri != NULL && suri->s != NULL && suri->len > 0) + { + memset(&turi, 0, sizeof(struct sip_uri)); + if(parse_uri(suri->s, suri->len, &turi)!=0) + { + LM_ERR("bad replicate SIP address!\n"); + return -1; + } + + proxy=mk_proxy(&turi.host, turi.port_no, turi.proto); + if (proxy==0) { + LM_ERR("cannot create proxy from URI <%.*s>\n", + suri->len, suri->s ); + return -1; + } + + r = t_replicate(msg, proxy, proxy->proto); + free_proxy(proxy); + pkg_free(proxy); + } else { + r = t_replicate(msg, NULL, 0); + } + return r; + } + + inline static int w_t_replicate_uri(struct sip_msg *msg , + char *uri, /* sip uri as string or variable */ + char *_foo /* nothing expected */ ) + { + str suri; + + if(uri==NULL) + return t_replicate_uri(msg, NULL); + + if(fixup_get_svalue(msg, (gparam_p)uri, &suri)!=0) + { + LM_ERR("invalid replicate uri parameter"); + return -1; + } + return t_replicate_uri(msg, &suri); + } + + inline static int w_t_replicate( struct sip_msg *p_msg , + char *proxy, /* struct proxy_l *proxy expected */ + char *_foo /* nothing expected */ ) + { + return t_replicate(p_msg, ( struct proxy_l *) proxy, p_msg->rcv.proto ); + } + + inline static int w_t_replicate_udp( struct sip_msg *p_msg , + char *proxy, /* struct proxy_l *proxy expected */ + char *_foo /* nothing expected */ ) + { + return t_replicate(p_msg, ( struct proxy_l *) proxy, PROTO_UDP ); + } + + +#ifdef USE_TCP + inline static int w_t_replicate_tcp( struct sip_msg *p_msg , + char *proxy, /* struct proxy_l *proxy expected */ + char *_foo /* nothing expected */ ) + { + return t_replicate(p_msg, ( struct proxy_l *) proxy, PROTO_TCP ); + } +#endif + + +#ifdef USE_TLS + inline static int w_t_replicate_tls( struct sip_msg *p_msg , + char *proxy, /* struct proxy_l *proxy expected */ + char *_foo /* nothing expected */ ) + { + return t_replicate(p_msg, ( struct proxy_l *) proxy, PROTO_TLS ); + } +#endif + + +#ifdef USE_SCTP + inline static int w_t_replicate_sctp( struct sip_msg *p_msg , + char *proxy, /* struct proxy_l *proxy expected */ + char *_foo /* nothing expected */ ) + { + return t_replicate(p_msg, ( struct proxy_l *) proxy, PROTO_SCTP ); + } +#endif + + + inline static int w_t_replicate_to( struct sip_msg *p_msg , + char *proto_par, + char *addr_par ) + { + struct proxy_l *proxy; + int r = -1; + proxy = t_protoaddr2proxy(proto_par, addr_par); + if (proxy) { + r = t_replicate(p_msg, proxy, proxy->proto); + free_proxy(proxy); + pkg_free(proxy); + } + return r; + } + + inline static int w_t_relay( struct sip_msg *p_msg , + char *_foo, char *_bar) + { + return _w_t_relay_to(p_msg, (struct proxy_l *)0, PROTO_NONE); + } + + + /* like t_relay but use the specified destination and port and the same proto + * as the received msg */ + static int w_t_relay2( struct sip_msg *p_msg , char *proxy, + char *_foo) + { + return _w_t_relay_to(p_msg, (struct proxy_l*) proxy, p_msg->rcv.proto); + } + + + /* relays CANCEL at the beginning of the script */ + inline static int w_t_relay_cancel( struct sip_msg *p_msg , + char *_foo, char *_bar) + { + if (p_msg->REQ_METHOD!=METHOD_CANCEL) + return 1; + + /* it makes no sense to use this function without reparse_invite=1 */ + if (!cfg_get(tm, tm_cfg, reparse_invite)) + LOG(L_WARN, "WARNING: t_relay_cancel is probably used with " + "wrong configuration, check the readme for details\n"); + + return t_relay_cancel(p_msg); + } + + /* set fr_inv_timeout & or fr_timeout; 0 means: use the default value */ + static int t_set_fr_all(struct sip_msg* msg, char* p1, char* p2) + { + int fr, fr_inv; + + if (get_int_fparam(&fr_inv, msg, (fparam_t*)p1) < 0) return -1; + if (p2) { + if (get_int_fparam(&fr, msg, (fparam_t*)p2) < 0) return -1; + } else { + fr = 0; + } + + return t_set_fr(msg, fr_inv, fr); + } - /* it makes no sense to use this function without reparse_invite=1 */ - if (!cfg_get(tm, tm_cfg, reparse_invite)) - LOG(L_WARN, "WARNING: t_relay_cancel is probably used with " - "wrong configuration, check the readme for details\n"); - - return t_relay_cancel(p_msg); -} - -/* set fr_inv_timeout & or fr_timeout; 0 means: use the default value */ -static int t_set_fr_all(struct sip_msg* msg, char* p1, char* p2) -{ - int fr, fr_inv; - - if (get_int_fparam(&fr_inv, msg, (fparam_t*)p1) < 0) return -1; - if (p2) { - if (get_int_fparam(&fr, msg, (fparam_t*)p2) < 0) return -1; - } else { - fr = 0; - } - - return t_set_fr(msg, fr_inv, fr); -} - -static int t_set_fr_inv(struct sip_msg* msg, char* fr_inv, char* foo) -{ - return t_set_fr_all(msg, fr_inv, (char*)0); -} - -/* reset fr_timer and fr_inv_timer to the default values */ -static int w_t_reset_fr(struct sip_msg* msg, char* foo, char* bar) -{ - return t_reset_fr(); -} - -/* set retr. intervals per transaction; 0 means: use the default value */ -static int w_t_set_retr(struct sip_msg* msg, char* p1, char* p2) -{ - int t1, t2; - - if (get_int_fparam(&t1, msg, (fparam_t*)p1) < 0) return -1; - if (p2) { - if (get_int_fparam(&t2, msg, (fparam_t*)p2) < 0) return -1; - } else { - t2 = 0; + static int t_set_fr_inv(struct sip_msg* msg, char* fr_inv, char* foo) + { + return t_set_fr_all(msg, fr_inv, (char*)0); + } + + /* reset fr_timer and fr_inv_timer to the default values */ + static int w_t_reset_fr(struct sip_msg* msg, char* foo, char* bar) + { + return t_reset_fr(); } + + /* set retr. intervals per transaction; 0 means: use the default value */ + static int w_t_set_retr(struct sip_msg* msg, char* p1, char* p2) + { + int t1, t2; + + if (get_int_fparam(&t1, msg, (fparam_t*)p1) < 0) return -1; + if (p2) { + if (get_int_fparam(&t2, msg, (fparam_t*)p2) < 0) return -1; + } else { + t2 = 0; + } #ifdef TM_DIFF_RT_TIMEOUT - return t_set_retr(msg, t1, t2); + return t_set_retr(msg, t1, t2); #else - ERR("w_t_set_retr: support for changing retransmission intervals on " - "the fly not compiled in (re-compile tm with" - " -DTM_DIFF_RT_TIMEOUT)\n"); - return -1; + ERR("w_t_set_retr: support for changing retransmission intervals on " + "the fly not compiled in (re-compile tm with" + " -DTM_DIFF_RT_TIMEOUT)\n"); + return -1; #endif -} + } -/* reset retr. t1 and t2 to the default values */ -int w_t_reset_retr(struct sip_msg* msg, char* foo, char* bar) -{ + /* reset retr. t1 and t2 to the default values */ + int w_t_reset_retr(struct sip_msg* msg, char* foo, char* bar) + { #ifdef TM_DIFF_RT_TIMEOUT - return t_reset_retr(); + return t_reset_retr(); #else - ERR("w_t_reset_retr: support for changing retransmission intervals on " - "the fly not compiled in (re-compile tm with" - " -DTM_DIFF_RT_TIMEOUT)\n"); - return -1; + ERR("w_t_reset_retr: support for changing retransmission intervals on " + "the fly not compiled in (re-compile tm with" + " -DTM_DIFF_RT_TIMEOUT)\n"); + return -1; #endif -} - -/* set maximum transaction lifetime for inv & noninv */ -static int w_t_set_max_lifetime(struct sip_msg* msg, char* p1, char* p2) -{ - int t1, t2; - - if (get_int_fparam(&t1, msg, (fparam_t*)p1) < 0) return -1; - if (p2) { - if (get_int_fparam(&t2, msg, (fparam_t*)p2) < 0) return -1; - } else { - t2 = 0; - } - return t_set_max_lifetime(msg, t1, t2); -} - -/* reset maximum invite/non-invite lifetime to the default value */ -int w_t_reset_max_lifetime(struct sip_msg* msg, char* foo, char* bar) -{ - return t_reset_max_lifetime(); -} - - - -/* helper macro, builds a function for setting a cell flag from the script. - e.g. T_SET_FLAG_GEN_FUNC(t_set_foo, T_FOO) => - static int t_set_foo(struct sip_msg* msg, char*, char* ) - that will expect fparam as first param and will set or reset T_FOO - in the current or next to be created transaction. */ + } + + /* set maximum transaction lifetime for inv & noninv */ + static int w_t_set_max_lifetime(struct sip_msg* msg, char* p1, char* p2) + { + int t1, t2; + + if (get_int_fparam(&t1, msg, (fparam_t*)p1) < 0) return -1; + if (p2) { + if (get_int_fparam(&t2, msg, (fparam_t*)p2) < 0) return -1; + } else { + t2 = 0; + } + return t_set_max_lifetime(msg, t1, t2); + } + + /* reset maximum invite/non-invite lifetime to the default value */ + int w_t_reset_max_lifetime(struct sip_msg* msg, char* foo, char* bar) + { + return t_reset_max_lifetime(); + } + + + + /** + * helper macro, builds a function for setting a cell flag from the script. + * e.g. T_SET_FLAG_GEN_FUNC(t_set_foo, T_FOO) => + * static int t_set_foo(struct sip_msg* msg, char*, char* ) + * that will expect fparam as first param and will set or reset T_FOO + * in the current or next to be created transaction. */ #define T_SET_FLAG_GEN_FUNC(fname, T_FLAG_NAME) \ -static int fname(struct sip_msg* msg, char* p1, char* p2) \ -{ \ - int state; \ - struct cell* t; \ - unsigned int set_flags; \ - unsigned int reset_flags; \ - \ - if (get_int_fparam(&state, msg, (fparam_t*)p1) < 0) return -1; \ - t=get_t(); \ - /* in REPLY_ROUTE and FAILURE_ROUTE T will be set to current transaction; \ - * in REQUEST_ROUTE T will be set only if the transaction was already \ - * created; if not -> use the static variables */ \ - if (!t || t==T_UNDEFINED ){ \ - set_flags=get_msgid_val(user_cell_set_flags, msg->id, int); \ - reset_flags=get_msgid_val(user_cell_reset_flags, msg->id, int); \ - if (state){ \ - /* set */ \ - set_flags|= T_FLAG_NAME; \ - reset_flags&=~T_FLAG_NAME; \ + static int fname(struct sip_msg* msg, char* p1, char* p2) \ + { \ + int state; \ + struct cell* t; \ + unsigned int set_flags; \ + unsigned int reset_flags; \ + \ + if (get_int_fparam(&state, msg, (fparam_t*)p1) < 0) return -1; \ + t=get_t(); \ + /* in REPLY_ROUTE and FAILURE_ROUTE T will be set to current transaction; \ + * in REQUEST_ROUTE T will be set only if the transaction was already \ + * created; if not -> use the static variables */ \ + if (!t || t==T_UNDEFINED ){ \ + set_flags=get_msgid_val(user_cell_set_flags, msg->id, int); \ + reset_flags=get_msgid_val(user_cell_reset_flags, msg->id, int); \ + if (state){ \ + /* set */ \ + set_flags|= T_FLAG_NAME; \ + reset_flags&=~T_FLAG_NAME; \ + }else{ \ + /* reset */ \ + set_flags&=~T_FLAG_NAME; \ + reset_flags|=T_FLAG_NAME; \ + } \ + set_msgid_val(user_cell_set_flags, msg->id, int, set_flags); \ + set_msgid_val(user_cell_reset_flags, msg->id, int, reset_flags); \ }else{ \ - /* reset */ \ - set_flags&=~T_FLAG_NAME; \ - reset_flags|=T_FLAG_NAME; \ - } \ - set_msgid_val(user_cell_set_flags, msg->id, int, set_flags); \ - set_msgid_val(user_cell_reset_flags, msg->id, int, reset_flags); \ - }else{ \ - if (state) \ + if (state) \ t->flags|=T_FLAG_NAME; \ - else \ + else \ t->flags&=~T_FLAG_NAME; \ - } \ - return 1; \ -} + } \ + return 1; \ + } -/* set automatically sending 100 replies on/off for the current or - * next to be created transaction */ -T_SET_FLAG_GEN_FUNC(t_set_auto_inv_100, T_AUTO_INV_100) + /* set automatically sending 100 replies on/off for the current or + * next to be created transaction */ + T_SET_FLAG_GEN_FUNC(t_set_auto_inv_100, T_AUTO_INV_100) -/* set 6xx handling for the current or next to be created transaction */ -T_SET_FLAG_GEN_FUNC(t_set_disable_6xx, T_DISABLE_6xx) + /* set 6xx handling for the current or next to be created transaction */ + T_SET_FLAG_GEN_FUNC(t_set_disable_6xx, T_DISABLE_6xx) -/* disable dns failover for the current transaction */ -T_SET_FLAG_GEN_FUNC(t_set_disable_failover, T_DISABLE_FAILOVER) + /* disable dns failover for the current transaction */ + T_SET_FLAG_GEN_FUNC(t_set_disable_failover, T_DISABLE_FAILOVER) #ifdef CANCEL_REASON_SUPPORT -/* disable/enable e2e cancel reason copy for the current transaction */ -T_SET_FLAG_GEN_FUNC(t_set_no_e2e_cancel_reason, T_NO_E2E_CANCEL_REASON) + /* disable/enable e2e cancel reason copy for the current transaction */ + T_SET_FLAG_GEN_FUNC(t_set_no_e2e_cancel_reason, T_NO_E2E_CANCEL_REASON) #endif /* CANCEL_REASON_SUPPORT */ -/* disable internal negative reply for the current transaction */ -T_SET_FLAG_GEN_FUNC(t_set_disable_internal_reply, T_DISABLE_INTERNAL_REPLY) - - -/* script function, FAILURE_ROUTE and BRANCH_FAILURE_ROUTE only, - * returns true if the choosed "failure" branch failed because of a timeout, - * -1 otherwise */ -int t_branch_timeout(struct sip_msg* msg, char* foo, char* bar) -{ - switch(get_route_type()) { - case FAILURE_ROUTE: - case BRANCH_FAILURE_ROUTE: - return (msg->msg_flags & FL_TIMEOUT)?1:-1; - default: - LOG(L_ERR, "ERROR:t_check_status: unsupported route type %d\n", - get_route_type()); - } - return -1; -} - - -/* script function, FAILURE_ROUTE and BRANCH_FAILURE_ROUTE only, - * returns true if the choosed "failure" branch ever received a reply, - * -1 otherwise */ -int t_branch_replied(struct sip_msg* msg, char* foo, char* bar) -{ - switch(get_route_type()) { - case FAILURE_ROUTE: - case BRANCH_FAILURE_ROUTE: - return (msg->msg_flags & FL_REPLIED)?1:-1; - default: - LOG(L_ERR, "ERROR:t_check_status: unsupported route type %d\n", - get_route_type()); - } - return -1; -} - - - -/* script function, returns: 1 if the transaction was canceled, -1 if not */ -int t_is_canceled(struct sip_msg* msg) -{ - struct cell *t; - int ret; - - - if (t_check( msg , 0 )==-1) return -1; - t=get_t(); - if ((t==0) || (t==T_UNDEFINED)){ - LOG(L_ERR, "ERROR: t_is_canceled: cannot check a message " - "for which no T-state has been established\n"); - ret=-1; - }else{ - ret=(t->flags & T_CANCELED)?1:-1; - } - return ret; -} - -static int w_t_is_canceled(struct sip_msg* msg, char* foo, char* bar) -{ - return t_is_canceled(msg); -} - -/* script function, returns: 1 if the transaction is currently suspended, -1 if not */ -int t_is_retr_async_reply(struct sip_msg* msg) -{ - struct cell *t; - int ret; - - if (t_check( msg , 0 )==-1) return -1; - t=get_t(); - if ((t==0) || (t==T_UNDEFINED)){ - LOG(L_ERR, "ERROR: t_is_retr_async_reply: cannot check a message " - "for which no T-state has been established\n"); - ret=-1; - }else{ - LOG(L_DBG, "TRANSACTION FLAGS IS %d\n", t->flags); - ret=(t->flags & T_ASYNC_SUSPENDED)?1:-1; - } - return ret; -} -static int w_t_is_retr_async_reply(struct sip_msg* msg, char* foo, char* bar) -{ - return t_is_retr_async_reply(msg); -} - -/* script function, returns: 1 if the transaction lifetime interval has already elapsed, -1 if not */ -int t_is_expired(struct sip_msg* msg, char* foo, char* bar) -{ - struct cell *t; - int ret; - - - if (t_check( msg , 0 )==-1) return -1; - t=get_t(); - if ((t==0) || (t==T_UNDEFINED)){ - LOG(L_ERR, "ERROR: t_is_expired: cannot check a message " - "for which no T-state has been established\n"); - ret=-1; - }else{ - ret=(TICKS_GT(t->end_of_life, get_ticks_raw()))?-1:1; - } - return ret; -} - -/* script function, returns: 1 if any of the branches did timeout, -1 if not */ -int t_any_timeout(struct sip_msg* msg, char* foo, char* bar) -{ - struct cell *t; - int r; - - if (t_check( msg , 0 )==-1) return -1; - t=get_t(); - if ((t==0) || (t==T_UNDEFINED)){ - LOG(L_ERR, "ERROR: t_any_timeout: cannot check a message " - "for which no T-state has been established\n"); - return -1; - }else{ - for (r=0; rnr_of_outgoings; r++){ - if (t->uac[r].request.flags & F_RB_TIMEOUT) - return 1; + /* disable internal negative reply for the current transaction */ + T_SET_FLAG_GEN_FUNC(t_set_disable_internal_reply, T_DISABLE_INTERNAL_REPLY) + + + /* script function, FAILURE_ROUTE and BRANCH_FAILURE_ROUTE only, + * returns true if the choosed "failure" branch failed because of a timeout, + * -1 otherwise */ + int t_branch_timeout(struct sip_msg* msg, char* foo, char* bar) + { + switch(get_route_type()) { + case FAILURE_ROUTE: + case BRANCH_FAILURE_ROUTE: + return (msg->msg_flags & FL_TIMEOUT)?1:-1; + default: + LOG(L_ERR, "ERROR:t_check_status: unsupported route type %d\n", + get_route_type()); + } + return -1; } + + + /* script function, FAILURE_ROUTE and BRANCH_FAILURE_ROUTE only, + * returns true if the choosed "failure" branch ever received a reply, + * -1 otherwise */ + int t_branch_replied(struct sip_msg* msg, char* foo, char* bar) + { + switch(get_route_type()) { + case FAILURE_ROUTE: + case BRANCH_FAILURE_ROUTE: + return (msg->msg_flags & FL_REPLIED)?1:-1; + default: + LOG(L_ERR, "ERROR:t_check_status: unsupported route type %d\n", + get_route_type()); + } + return -1; } - return -1; -} -/* script function, returns: 1 if any of the branches received at leat one - * reply, -1 if not */ -int t_any_replied(struct sip_msg* msg, char* foo, char* bar) -{ - struct cell *t; - int r; - - if (t_check( msg , 0 )==-1) return -1; - t=get_t(); - if ((t==0) || (t==T_UNDEFINED)){ - LOG(L_ERR, "ERROR: t_any_replied: cannot check a message " - "for which no T-state has been established\n"); - return -1; - }else{ - for (r=0; rnr_of_outgoings; r++){ - if (t->uac[r].request.flags & F_RB_REPLIED) - return 1; + /* script function, returns: 1 if the transaction was canceled, -1 if not */ + int t_is_canceled(struct sip_msg* msg) + { + struct cell *t; + int ret; + + if (t_check( msg , 0 )==-1) return -1; + t=get_t(); + if ((t==0) || (t==T_UNDEFINED)){ + LOG(L_ERR, "ERROR: t_is_canceled: cannot check a message " + "for which no T-state has been established\n"); + ret=-1; + }else{ + ret=(t->flags & T_CANCELED)?1:-1; } + return ret; } - return -1; -} + static int w_t_is_canceled(struct sip_msg* msg, char* foo, char* bar) + { + return t_is_canceled(msg); + } + /* script function, returns: 1 if the transaction is currently suspended, -1 if not */ + int t_is_retr_async_reply(struct sip_msg* msg) + { + struct cell *t; + int ret; -/* script function, returns: 1 if any of the branches received the - * reply code "status" */ -int t_grep_status(struct sip_msg* msg, char* status, char* bar) -{ - struct cell *t; - int r; - int code; - - if (get_int_fparam(&code, msg, (fparam_t*)status) < 0) return -1; - if (t_check( msg , 0 )==-1) return -1; - t=get_t(); - if ((t==0) || (t==T_UNDEFINED)){ - LOG(L_ERR, "ERROR: t_any_replied: cannot check a message " - "for which no T-state has been established\n"); - return -1; - }else{ - for (r=0; rnr_of_outgoings; r++){ - if ((t->uac[r].last_received==code) && - (t->uac[r].request.flags & F_RB_REPLIED)) - return 1; + if (t_check( msg , 0 )==-1) return -1; + t=get_t(); + if ((t==0) || (t==T_UNDEFINED)){ + LOG(L_ERR, "ERROR: t_is_retr_async_reply: cannot check a message " + "for which no T-state has been established\n"); + ret=-1; + }else{ + LOG(L_DBG, "TRANSACTION FLAGS IS %d\n", t->flags); + ret=(t->flags & T_ASYNC_SUSPENDED)?1:-1; } + return ret; } - return -1; -} - -/* drop all the existing replies in failure_route to make sure - * that none of them is picked up again */ -static int w_t_drop_replies(struct sip_msg* msg, char* foo, char* bar) -{ - if(foo==NULL) - t_drop_replies(1); - else if(*foo=='n') - t_drop_replies(0); - else if(*foo=='l') - t_drop_replies(2); - else - t_drop_replies(1); - return 1; -} - -/* save the message lumps after t_newtran() but before t_relay() */ -static int w_t_save_lumps(struct sip_msg* msg, char* foo, char* bar) -{ - struct cell *t; - - if (is_route_type(REQUEST_ROUTE)) { + static int w_t_is_retr_async_reply(struct sip_msg* msg, char* foo, char* bar) + { + return t_is_retr_async_reply(msg); + } + + /* script function, returns: 1 if the transaction lifetime interval has already elapsed, -1 if not */ + int t_is_expired(struct sip_msg* msg, char* foo, char* bar) + { + struct cell *t; + int ret; + + if (t_check( msg , 0 )==-1) return -1; t=get_t(); - if (!t || t==T_UNDEFINED) { - LOG(L_ERR, "ERROR: w_t_save_lumps: transaction has not been created yet\n"); + if ((t==0) || (t==T_UNDEFINED)){ + LOG(L_ERR, "ERROR: t_is_expired: cannot check a message " + "for which no T-state has been established\n"); + ret=-1; + }else{ + ret=(TICKS_GT(t->end_of_life, get_ticks_raw()))?-1:1; + } + return ret; + } + + /* script function, returns: 1 if any of the branches did timeout, -1 if not */ + int t_any_timeout(struct sip_msg* msg, char* foo, char* bar) + { + struct cell *t; + int r; + + if (t_check( msg , 0 )==-1) return -1; + t=get_t(); + if ((t==0) || (t==T_UNDEFINED)){ + LOG(L_ERR, "ERROR: t_any_timeout: cannot check a message " + "for which no T-state has been established\n"); return -1; + }else{ + for (r=0; rnr_of_outgoings; r++){ + if (t->uac[r].request.flags & F_RB_TIMEOUT) + return 1; + } } + return -1; + } - if (save_msg_lumps(t->uas.request, msg)) { - LOG(L_ERR, "ERROR: w_t_save_lumps: " - "failed to save the message lumps\n"); + + + /* script function, returns: 1 if any of the branches received at leat one + * reply, -1 if not */ + int t_any_replied(struct sip_msg* msg, char* foo, char* bar) + { + struct cell *t; + int r; + + if (t_check( msg , 0 )==-1) return -1; + t=get_t(); + if ((t==0) || (t==T_UNDEFINED)){ + LOG(L_ERR, "ERROR: t_any_replied: cannot check a message " + "for which no T-state has been established\n"); return -1; + }else{ + for (r=0; rnr_of_outgoings; r++){ + if (t->uac[r].request.flags & F_RB_REPLIED) + return 1; + } } - } /* else nothing to do, the lumps have already been saved */ - return 1; -} + return -1; + } + + /* script function, returns: 1 if any of the branches received the + * reply code "status" */ + int t_grep_status(struct sip_msg* msg, char* status, char* bar) + { + struct cell *t; + int r; + int code; -/* wrapper function needed after changes in w_t_reply */ -int w_t_reply_wrp(struct sip_msg *m, unsigned int code, char *txt) -{ - fparam_t c; - fparam_t r; - - c.type = FPARAM_INT; - c.orig = NULL; /* ? */ - c.v.i = code; - - r.type = FPARAM_STRING; - r.orig = NULL; /* ? */ - r.v.asciiz = txt; + if (get_int_fparam(&code, msg, (fparam_t*)status) < 0) return -1; + if (t_check( msg , 0 )==-1) return -1; + t=get_t(); + if ((t==0) || (t==T_UNDEFINED)){ + LOG(L_ERR, "ERROR: t_any_replied: cannot check a message " + "for which no T-state has been established\n"); + return -1; + }else{ + for (r=0; rnr_of_outgoings; r++){ + if ((t->uac[r].last_received==code) && + (t->uac[r].request.flags & F_RB_REPLIED)) + return 1; + } + } + return -1; + } - return w_t_reply(m, (char *)&c, (char*)&r); -} + /* drop all the existing replies in failure_route to make sure + * that none of them is picked up again */ + static int w_t_drop_replies(struct sip_msg* msg, char* foo, char* bar) + { + if(foo==NULL) + t_drop_replies(1); + else if(*foo=='n') + t_drop_replies(0); + else if(*foo=='l') + t_drop_replies(2); + else + t_drop_replies(1); + return 1; + } + /* save the message lumps after t_newtran() but before t_relay() */ + static int w_t_save_lumps(struct sip_msg* msg, char* foo, char* bar) + { + struct cell *t; + if (is_route_type(REQUEST_ROUTE)) { + t=get_t(); + if (!t || t==T_UNDEFINED) { + LOG(L_ERR, "ERROR: w_t_save_lumps: transaction has not been created yet\n"); + return -1; + } -/** script function, check if a msg is assoc. to a transaction. - * @return -1 (not), 1 (reply, e2e ack or cancel for an existing transaction), - * 0 (request retransmission, ack to negative reply or ack to local - * transaction) - * Note: the e2e ack matching works only for local e2e acks or for - * transactions with E2EACK* callbacks installed (but even in this - * case matching E2EACKs on proxied transaction is not entirely - * reliable: if the ACK is delayed the proxied transaction might - * be already deleted when it reaches the proxy (wait_timeout)) - */ -int t_check_trans(struct sip_msg* msg) -{ - struct cell* t; - int branch; - int ret; - - /* already processing a T */ - if(is_route_type(FAILURE_ROUTE) - || is_route_type(BRANCH_ROUTE) - || is_route_type(BRANCH_FAILURE_ROUTE) - || is_route_type(TM_ONREPLY_ROUTE)) { + if (save_msg_lumps(t->uas.request, msg)) { + LOG(L_ERR, "ERROR: w_t_save_lumps: " + "failed to save the message lumps\n"); + return -1; + } + } /* else nothing to do, the lumps have already been saved */ return 1; } - if (msg->first_line.type==SIP_REPLY) { - branch = 0; - ret = (t_check_msg( msg , &branch)==1) ? 1 : -1; - tm_ctx_set_branch_index(branch); - return ret; - } else if (msg->REQ_METHOD==METHOD_CANCEL) { - return w_t_lookup_cancel(msg, 0, 0); - } else { - switch(t_check_msg(msg, 0)){ - case -2: /* possible e2e ack */ - return 1; - case 1: /* found */ - t=get_t(); - if (msg->REQ_METHOD==METHOD_ACK){ - /* ack to neg. reply or ack to local trans. - => process it and end the script */ - /* FIXME: there's no way to distinguish here - between acks to local trans. and neg. acks */ - if (unlikely(has_tran_tmcbs(t, TMCB_ACK_NEG_IN))) - run_trans_callbacks(TMCB_ACK_NEG_IN, t, msg, - 0, msg->REQ_METHOD); - t_release_transaction(t); - } else { - /* is a retransmission */ - if (unlikely(has_tran_tmcbs(t, TMCB_REQ_RETR_IN))) - run_trans_callbacks(TMCB_REQ_RETR_IN, t, msg, - 0, msg->REQ_METHOD); - t_retransmit_reply(t); - } - /* no need for UNREF(t); set_t(0) - the end-of-script - t_unref callback will take care of them */ - return 0; /* exit from the script */ - } - /* not found or error */ + + + /* wrapper function needed after changes in w_t_reply */ + int w_t_reply_wrp(struct sip_msg *m, unsigned int code, char *txt) + { + fparam_t c; + fparam_t r; + + c.type = FPARAM_INT; + c.orig = NULL; /* ? */ + c.v.i = code; + + r.type = FPARAM_STRING; + r.orig = NULL; /* ? */ + r.v.asciiz = txt; + + return w_t_reply(m, (char *)&c, (char*)&r); } - return -1; -} -static int w_t_check_trans(struct sip_msg* msg, char* foo, char* bar) -{ - return t_check_trans(msg); -} -static int hexatoi(str *s, unsigned int* result) -{ - int i, xv, fact; - /* more than 32bit hexa? */ - if (s->len>8) + /** script function, check if a msg is assoc. to a transaction. + * @return -1 (not), 1 (reply, e2e ack or cancel for an existing transaction), + * 0 (request retransmission, ack to negative reply or ack to local + * transaction) + * Note: the e2e ack matching works only for local e2e acks or for + * transactions with E2EACK* callbacks installed (but even in this + * case matching E2EACKs on proxied transaction is not entirely + * reliable: if the ACK is delayed the proxied transaction might + * be already deleted when it reaches the proxy (wait_timeout)) + */ + int t_check_trans(struct sip_msg* msg) + { + struct cell* t; + int branch; + int ret; + + /* already processing a T */ + if(is_route_type(FAILURE_ROUTE) + || is_route_type(BRANCH_ROUTE) + || is_route_type(BRANCH_FAILURE_ROUTE) + || is_route_type(TM_ONREPLY_ROUTE)) { + return 1; + } + + if (msg->first_line.type==SIP_REPLY) { + branch = 0; + ret = (t_check_msg( msg , &branch)==1) ? 1 : -1; + tm_ctx_set_branch_index(branch); + return ret; + } else if (msg->REQ_METHOD==METHOD_CANCEL) { + return w_t_lookup_cancel(msg, 0, 0); + } else { + switch(t_check_msg(msg, 0)){ + case -2: /* possible e2e ack */ + return 1; + case 1: /* found */ + t=get_t(); + if (msg->REQ_METHOD==METHOD_ACK){ + /* ack to neg. reply or ack to local trans. + * => process it and end the script */ + /* FIXME: there's no way to distinguish here + * between acks to local trans. and neg. acks */ + if (unlikely(has_tran_tmcbs(t, TMCB_ACK_NEG_IN))) + run_trans_callbacks(TMCB_ACK_NEG_IN, t, msg, + 0, msg->REQ_METHOD); + t_release_transaction(t); + } else { + /* is a retransmission */ + if (unlikely(has_tran_tmcbs(t, TMCB_REQ_RETR_IN))) + run_trans_callbacks(TMCB_REQ_RETR_IN, t, msg, + 0, msg->REQ_METHOD); + t_retransmit_reply(t); + } + /* no need for UNREF(t); set_t(0) - the end-of-script + * t_unref callback will take care of them */ + return 0; /* exit from the script */ + } + /* not found or error */ + } return -1; + } - *result = 0; - fact = 1; + static int w_t_check_trans(struct sip_msg* msg, char* foo, char* bar) + { + return t_check_trans(msg); + } - for(i=s->len-1; i>=0 ;i--) + static int hexatoi(str *s, unsigned int* result) { - xv = hex2int(s->s[i]); - if(xv<0) + int i, xv, fact; + + /* more than 32bit hexa? */ + if (s->len>8) return -1; - *result += (xv * fact); - fact *= 16; - } - return 0; -} - -static int fixup_t_relay_to(void** param, int param_no) -{ - - int port; - int proto; - unsigned int flags; - struct proxy_l *proxy; - action_u_t *a; - str s; - str host; - - s.s = (char*)*param; - s.len = strlen(s.s); - LM_DBG("fixing (%s, %d)\n", s.s, param_no); - if (param_no==1){ - a = fixup_get_param(param, param_no, 2); - if(a==NULL) + *result = 0; + fact = 1; + + for(i=s->len-1; i>=0 ;i--) { - LM_CRIT("server error for parameter <%s>\n",s.s); - return E_UNSPEC; + xv = hex2int(s->s[i]); + if(xv<0) + return -1; + + *result += (xv * fact); + fact *= 16; } - if(a->u.string!=NULL) { - /* second parameter set, first should be proxy addr */ - if (parse_phostport(s.s, &host.s, &host.len, &port, &proto)!=0){ - LM_CRIT("invalid proxy addr parameter <%s>\n",s.s); + return 0; + } + + static int fixup_t_relay_to(void** param, int param_no) + { + + int port; + int proto; + unsigned int flags; + struct proxy_l *proxy; + action_u_t *a; + str s; + str host; + + s.s = (char*)*param; + s.len = strlen(s.s); + LM_DBG("fixing (%s, %d)\n", s.s, param_no); + if (param_no==1){ + a = fixup_get_param(param, param_no, 2); + if(a==NULL) + { + LM_CRIT("server error for parameter <%s>\n",s.s); return E_UNSPEC; } + if(a->u.string!=NULL) { + /* second parameter set, first should be proxy addr */ + if (parse_phostport(s.s, &host.s, &host.len, &port, &proto)!=0){ + LM_CRIT("invalid proxy addr parameter <%s>\n",s.s); + return E_UNSPEC; + } - proxy = mk_proxy(&host, port, proto); - if (proxy==0) { - LM_ERR("failed to build proxy structure for <%.*s>\n", host.len, host.s ); - return E_UNSPEC; + proxy = mk_proxy(&host, port, proto); + if (proxy==0) { + LM_ERR("failed to build proxy structure for <%.*s>\n", host.len, host.s ); + return E_UNSPEC; + } + *(param)=proxy; + return 0; + } else { + /* no second parameter, then is proxy addr or flags */ + flags = 0; + if (s.len>2 && s.s[0]=='0' && s.s[1]=='x') { + s.s += 2; + s.len -= 2; + if(hexatoi(&s, &flags)<0) + { + LM_CRIT("invalid hexa flags <%s>\n", s.s); + return E_UNSPEC; + } + a->u.data = (void*)(unsigned long int)flags; + *(param)= 0; + return 0; + } else { + if(str2int(&s, &flags)==0) + { + a->u.data = (void*)(unsigned long int)flags; + *(param)= 0; + return 0; + } else { + /* try proxy */ + if (parse_phostport(s.s, &host.s, &host.len, &port, &proto)!=0){ + LM_CRIT("invalid proxy addr parameter <%s>\n",s.s); + return E_UNSPEC; + } + + proxy = mk_proxy(&host, port, proto); + if (proxy==0) { + LM_ERR("failed to build proxy structure for <%.*s>\n", host.len, host.s ); + return E_UNSPEC; + } + *(param)=proxy; + return 0; + } + } } - *(param)=proxy; - return 0; - } else { - /* no second parameter, then is proxy addr or flags */ + } else if (param_no==2) { + /* flags */ flags = 0; if (s.len>2 && s.s[0]=='0' && s.s[1]=='x') { s.s += 2; @@ -2216,153 +2201,116 @@ static int fixup_t_relay_to(void** param, int param_no) LM_CRIT("invalid hexa flags <%s>\n", s.s); return E_UNSPEC; } - a->u.data = (void*)(unsigned long int)flags; - *(param)= 0; + *(param) = (void*)(unsigned long int)flags; return 0; } else { if(str2int(&s, &flags)==0) { - a->u.data = (void*)(unsigned long int)flags; - *(param)= 0; + *(param) = (void*)(unsigned long int)flags; return 0; } else { - /* try proxy */ - if (parse_phostport(s.s, &host.s, &host.len, &port, &proto)!=0){ - LM_CRIT("invalid proxy addr parameter <%s>\n",s.s); - return E_UNSPEC; - } - - proxy = mk_proxy(&host, port, proto); - if (proxy==0) { - LM_ERR("failed to build proxy structure for <%.*s>\n", host.len, host.s ); - return E_UNSPEC; - } - *(param)=proxy; - return 0; + LM_CRIT("invalid flags <%s>\n", s.s); + return E_UNSPEC; } } - } - } else if (param_no==2) { - /* flags */ - flags = 0; - if (s.len>2 && s.s[0]=='0' && s.s[1]=='x') { - s.s += 2; - s.len -= 2; - if(hexatoi(&s, &flags)<0) - { - LM_CRIT("invalid hexa flags <%s>\n", s.s); - return E_UNSPEC; - } - *(param) = (void*)(unsigned long int)flags; - return 0; } else { - if(str2int(&s, &flags)==0) - { - *(param) = (void*)(unsigned long int)flags; - return 0; - } else { - LM_CRIT("invalid flags <%s>\n", s.s); - return E_UNSPEC; - } + LM_ERR("invalid parameter number %d\n", param_no); + return E_BUG; } - } else { - LM_ERR("invalid parameter number %d\n", param_no); - return E_BUG; } -} - - -inline static int w_t_relay_to(struct sip_msg *msg, char *proxy, char *flags) -{ - unsigned int fl; - struct proxy_l *px; - fparam_t param; - fl = (unsigned int)(long)(void*)flags; - px = (struct proxy_l*)proxy; - if(flags!=0) + inline static int w_t_relay_to(struct sip_msg *msg, char *proxy, char *flags) { - memset(¶m, 0, sizeof(fparam_t)); - param.type = FPARAM_INT; - /* no auto 100 trying */ - if(fl&1) { - param.v.i = 0; - t_set_auto_inv_100(msg, (char*)(¶m), 0); - } - /* no auto negative reply */ - if(fl&2) { - param.v.i = 1; - t_set_disable_internal_reply(msg, (char*)(¶m), 0); - } - /* no dns failover */ - if(fl&4) { - param.v.i = 1; - t_set_disable_failover(msg, (char*)(¶m), 0); - } - } - return _w_t_relay_to(msg, px, PROTO_NONE); -} - + unsigned int fl; + struct proxy_l *px; + fparam_t param; -static int w_t_use_uac_headers(sip_msg_t* msg, char* foo, char* bar) -{ - tm_cell_t *t; + fl = (unsigned int)(long)(void*)flags; + px = (struct proxy_l*)proxy; - t=get_t(); - if (t!=NULL && t!=T_UNDEFINED) { - t->uas.request->msg_flags |= FL_USE_UAC_FROM|FL_USE_UAC_TO; + if(flags!=0) + { + memset(¶m, 0, sizeof(fparam_t)); + param.type = FPARAM_INT; + /* no auto 100 trying */ + if(fl&1) { + param.v.i = 0; + t_set_auto_inv_100(msg, (char*)(¶m), 0); + } + /* no auto negative reply */ + if(fl&2) { + param.v.i = 1; + t_set_disable_internal_reply(msg, (char*)(¶m), 0); + } + /* no dns failover */ + if(fl&4) { + param.v.i = 1; + t_set_disable_failover(msg, (char*)(¶m), 0); + } + } + return _w_t_relay_to(msg, px, PROTO_NONE); } - msg->msg_flags |= FL_USE_UAC_FROM|FL_USE_UAC_TO; - - return 1; -} - -/* rpc docs */ - -static const char* rpc_cancel_doc[2] = { - "Cancel a pending transaction", - 0 -}; - -static const char* rpc_reply_doc[2] = { - "Reply transaction", - 0 -}; - -static const char* tm_rpc_stats_doc[2] = { - "Print transaction statistics.", - 0 -}; -static const char* tm_rpc_hash_stats_doc[2] = { - "Prints hash table statistics (can be used only if tm is compiled" - " with -DTM_HASH_STATS).", - 0 -}; -static const char* rpc_t_uac_start_doc[2] = { - "starts a tm uac using a list of string parameters: method, ruri, dst_uri" - ", send_sock, headers (CRLF separated) and body (optional)", - 0 -}; + static int w_t_use_uac_headers(sip_msg_t* msg, char* foo, char* bar) + { + tm_cell_t *t; -static const char* rpc_t_uac_wait_doc[2] = { - "starts a tm uac and waits for the final reply, using a list of string " - "parameters: method, ruri, dst_uri send_sock, headers (CRLF separated)" - " and body (optional)", - 0 -}; + t=get_t(); + if (t!=NULL && t!=T_UNDEFINED) { + t->uas.request->msg_flags |= FL_USE_UAC_FROM|FL_USE_UAC_TO; + } + msg->msg_flags |= FL_USE_UAC_FROM|FL_USE_UAC_TO; + return 1; + } -/* rpc exports */ -static rpc_export_t tm_rpc[] = { - {"tm.cancel", rpc_cancel, rpc_cancel_doc, 0}, - {"tm.reply", rpc_reply, rpc_reply_doc, 0}, - {"tm.stats", tm_rpc_stats, tm_rpc_stats_doc, 0}, - {"tm.hash_stats", tm_rpc_hash_stats, tm_rpc_hash_stats_doc, 0}, - {"tm.t_uac_start", rpc_t_uac_start, rpc_t_uac_start_doc, 0 }, - {"tm.t_uac_wait", rpc_t_uac_wait, rpc_t_uac_wait_doc, RET_ARRAY}, - {0, 0, 0, 0} -}; + /* rpc docs */ + + static const char* rpc_cancel_doc[2] = { + "Cancel a pending transaction", + 0 + }; + + static const char* rpc_reply_doc[2] = { + "Reply transaction", + 0 + }; + + static const char* tm_rpc_stats_doc[2] = { + "Print transaction statistics.", + 0 + }; + + static const char* tm_rpc_hash_stats_doc[2] = { + "Prints hash table statistics (can be used only if tm is compiled" + " with -DTM_HASH_STATS).", + 0 + }; + + static const char* rpc_t_uac_start_doc[2] = { + "starts a tm uac using a list of string parameters: method, ruri, dst_uri" + ", send_sock, headers (CRLF separated) and body (optional)", + 0 + }; + + static const char* rpc_t_uac_wait_doc[2] = { + "starts a tm uac and waits for the final reply, using a list of string " + "parameters: method, ruri, dst_uri send_sock, headers (CRLF separated)" + " and body (optional)", + 0 + }; + + + /* rpc exports */ + static rpc_export_t tm_rpc[] = { + {"tm.cancel", rpc_cancel, rpc_cancel_doc, 0}, + {"tm.reply", rpc_reply, rpc_reply_doc, 0}, + {"tm.stats", tm_rpc_stats, tm_rpc_stats_doc, 0}, + {"tm.hash_stats", tm_rpc_hash_stats, tm_rpc_hash_stats_doc, 0}, + {"tm.t_uac_start", rpc_t_uac_start, rpc_t_uac_start_doc, 0 }, + {"tm.t_uac_wait", rpc_t_uac_wait, rpc_t_uac_wait_doc, RET_ARRAY}, + {0, 0, 0, 0} + }; diff --git a/modules/tm/ut.h b/modules/tm/ut.h index 956b32937cd..c7962b2a343 100644 --- a/modules/tm/ut.h +++ b/modules/tm/ut.h @@ -16,8 +16,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -112,11 +112,11 @@ inline static struct proxy_l *uri2proxy( str *uri, int proto ) enum sip_protos uri_proto; if (parse_uri(uri->s, uri->len, &parsed_uri) < 0) { - LOG(L_ERR, "ERROR: uri2proxy: bad_uri: %.*s\n", - uri->len, uri->s ); + LOG(L_ERR, "ERROR: uri2proxy: bad_uri: [%.*s]\n", + uri->len, uri->s ); return 0; } - + if (parsed_uri.type==SIPS_URI_T){ if (parsed_uri.proto==PROTO_UDP) { LOG(L_ERR, "ERROR: uri2proxy: bad transport for sips uri: %d\n", @@ -130,9 +130,9 @@ inline static struct proxy_l *uri2proxy( str *uri, int proto ) uri_proto=parsed_uri.proto; #ifdef HONOR_MADDR if (parsed_uri.maddr_val.s && parsed_uri.maddr_val.len) { - p = mk_proxy(&parsed_uri.maddr_val, - parsed_uri.port_no, - get_proto(proto, uri_proto)); + p = mk_proxy(&parsed_uri.maddr_val, + parsed_uri.port_no, + get_proto(proto, uri_proto)); if (p == 0) { LOG(L_ERR, "ERROR: uri2proxy: bad maddr param in URI <%.*s>\n", uri->len, ZSW(uri->s)); @@ -140,15 +140,15 @@ inline static struct proxy_l *uri2proxy( str *uri, int proto ) } } else #endif - p = mk_proxy(&parsed_uri.host, - parsed_uri.port_no, - get_proto(proto, uri_proto)); + p = mk_proxy(&parsed_uri.host, + parsed_uri.port_no, + get_proto(proto, uri_proto)); if (p == 0) { LOG(L_ERR, "ERROR: uri2proxy: bad host name in URI <%.*s>\n", - uri->len, ZSW(uri->s)); + uri->len, ZSW(uri->s)); return 0; } - + return p; } @@ -160,7 +160,7 @@ inline static struct proxy_l *uri2proxy( str *uri, int proto ) * host - filled with the uri host part * port - filled with the uri port * proto - if != PROTO_NONE, this protocol will be forced over the - * uri_proto, otherwise the uri proto will be used + * uri_proto, otherwise the uri proto will be used * (value/return) * comp - compression (if used) * returns 0 on success, < 0 on error @@ -170,13 +170,13 @@ inline static int get_uri_send_info(str* uri, str* host, unsigned short* port, { struct sip_uri parsed_uri; enum sip_protos uri_proto; - + if (parse_uri(uri->s, uri->len, &parsed_uri) < 0) { LOG(L_ERR, "ERROR: get_uri_send_info: bad_uri: %.*s\n", uri->len, uri->s ); return -1; } - + if (parsed_uri.type==SIPS_URI_T){ if (parsed_uri.proto==PROTO_UDP) { LOG(L_ERR, "ERROR: get_uri_send_info: bad transport for" @@ -188,7 +188,7 @@ inline static int get_uri_send_info(str* uri, str* host, unsigned short* port, uri_proto=PROTO_WS; }else uri_proto=parsed_uri.proto; - + *proto= get_proto(*proto, uri_proto); #ifdef USE_COMP *comp=parsed_uri.comp; @@ -196,7 +196,7 @@ inline static int get_uri_send_info(str* uri, str* host, unsigned short* port, #ifdef HONOR_MADDR if (parsed_uri.maddr_val.s && parsed_uri.maddr_val.len) { *host=parsed_uri.maddr_val; - DBG("maddr dst: %.*s:%d\n", parsed_uri.maddr_val.len, + DBG("maddr dst: %.*s:%d\n", parsed_uri.maddr_val.len, parsed_uri.maddr_val.s, parsed_uri.port_no); } else #endif @@ -210,7 +210,7 @@ inline static int get_uri_send_info(str* uri, str* host, unsigned short* port, /* * Convert a URI into a dest_info structure. * Same as uri2dst, but uses directly force_send_socket instead of msg. - * If the uri host resolves to multiple ips and dns_h!=0 the first ip for + * If the uri host resolves to multiple ips and dns_h!=0 the first ip for * which a send socket is found will be used. If no send_socket are found, * the first ip is selected. * @@ -218,8 +218,8 @@ inline static int get_uri_send_info(str* uri, str* host, unsigned short* port, * null. If null or use_dns_failover==0 normal dns lookup will * be performed (no failover). * dst - will be filled - * force_send_sock - if 0 dst->send_sock will be set to the default - * (see get_send_socket2()) + * force_send_sock - if 0 dst->send_sock will be set to the default + * (see get_send_socket2()) * sflags - send flags * uri - uri in str form * proto - if != PROTO_NONE, this protocol will be forced over the @@ -250,11 +250,11 @@ inline static struct dest_info *uri2dst2(struct dest_info* dst, #endif if (parse_uri(uri->s, uri->len, &parsed_uri) < 0) { - LOG(L_ERR, "ERROR: uri2dst: bad_uri: %.*s\n", - uri->len, uri->s ); + LOG(L_ERR, "ERROR: uri2dst: bad_uri: [%.*s]\n", + uri->len, uri->s ); return 0; } - + if (parsed_uri.type==SIPS_URI_T){ if (parsed_uri.proto==PROTO_UDP) { LOG(L_ERR, "ERROR: uri2dst: bad transport for sips uri: %d\n", @@ -266,7 +266,7 @@ inline static struct dest_info *uri2dst2(struct dest_info* dst, uri_proto=PROTO_WS; }else uri_proto=parsed_uri.proto; - + init_dest_info(dst); dst->proto= get_proto(proto, uri_proto); #ifdef USE_COMP @@ -276,7 +276,7 @@ inline static struct dest_info *uri2dst2(struct dest_info* dst, #ifdef HONOR_MADDR if (parsed_uri.maddr_val.s && parsed_uri.maddr_val.len) { host=&parsed_uri.maddr_val; - DBG("maddr dst: %.*s:%d\n", parsed_uri.maddr_val.len, + DBG("maddr dst: [%.*s:%d]\n", parsed_uri.maddr_val.len, parsed_uri.maddr_val.s, parsed_uri.port_no); } else #endif @@ -309,7 +309,7 @@ inline static struct dest_info *uri2dst2(struct dest_info* dst, return dst; /* found a good one */ } }while(dns_srv_handle_next(dns_h, err)); - ERR("no corresponding socket for \"%.*s\" af %d\n", host->len, + ERR("no corresponding socket for \"%.*s\" af %d\n", host->len, ZSW(host->s), dst->to.s.sa_family); /* try to continue */ return dst; @@ -335,7 +335,7 @@ inline static struct dest_info *uri2dst2(struct dest_info* dst, /* * Convert a URI into a dest_info structure - * If the uri host resolves to multiple ips and dns_h!=0 the first ip for + * If the uri host resolves to multiple ips and dns_h!=0 the first ip for * which a send socket is found will be used. If no send_socket are found, * the first ip is selected. * @@ -344,8 +344,8 @@ inline static struct dest_info *uri2dst2(struct dest_info* dst, * be performed (no failover). * dst - will be filled * msg - sip message used to set dst->send_sock and dst->send_flags, - * if 0 dst->send_sock will be set to the default w/o using - * msg->force_send_socket (see get_send_socket()) and the + * if 0 dst->send_sock will be set to the default w/o using + * msg->force_send_socket (see get_send_socket()) and the * send_flags will be set to 0. * uri - uri in str form * proto - if != PROTO_NONE, this protocol will be forced over the @@ -356,7 +356,7 @@ inline static struct dest_info *uri2dst2(struct dest_info* dst, #ifdef USE_DNS_FAILOVER inline static struct dest_info *uri2dst(struct dns_srv_handle* dns_h, struct dest_info* dst, - struct sip_msg *msg, str *uri, + struct sip_msg *msg, str *uri, int proto ) { snd_flags_t sflags; @@ -368,7 +368,7 @@ inline static struct dest_info *uri2dst(struct dns_srv_handle* dns_h, } #else inline static struct dest_info *uri2dst(struct dest_info* dst, - struct sip_msg *msg, str *uri, + struct sip_msg *msg, str *uri, int proto ) { snd_flags_t sflags; diff --git a/modules/tmrec/README b/modules/tmrec/README index afee28b0b8d..c573475832a 100644 --- a/modules/tmrec/README +++ b/modules/tmrec/README @@ -22,9 +22,9 @@ Richard Fuchs - Copyright 2012 asipto.com + Copyright © 2012 asipto.com - Copyright 2012 Sipwise GmbH + Copyright © 2012 Sipwise GmbH __________________________________________________________________ Table of Contents @@ -119,7 +119,7 @@ modparam("tmrec", "separator", ";") 4.2. is_leap_year([year]) 4.3. time_period_match(period [, timestamp]) -4.1. tmrec_match(timerec [, timestamp]) +4.1. tmrec_match(timerec [, timestamp]) Match a time recurrence rule against the timestamp (UNIX epoch format). If the timestamp parameter is missing, the current UNIX epoch time is @@ -142,43 +142,43 @@ modparam("tmrec", "separator", ";") Description of time recurrence attributes: * startdate - date for the start of the first period. * duration - the duration of the time period. For a recurring - interval, the "duration" parameter MUST be small enough such that + interval, the “duration” parameter MUST be small enough such that subsequent intervals do not overlap. For non-recurring intervals, durations of any positive length are permitted. Zero-length - duration means "forever". Negative-length durations are not + duration means “forever”. Negative-length durations are not allowed. See RFC 2445 for the format of duration. In short for common cases when the duration doesn't exeed a data, it must start with PT followed by the value for hours, minutes or seconds - e.g., a duration of 8 hours must be written as PT8H. - * frequency - can be one of the following values: "daily" - specify - repeating periods based on an interval of a day or more; "weekly" - + * frequency - can be one of the following values: “daily” - specify + repeating periods based on an interval of a day or more; “weekly” - specify repeating periods based on an interval of a week or more; - "monthly" - specify repeating periods based on an interval of a - month or more; "yearly" - specify repeating periods based on an + “monthly” - specify repeating periods based on an interval of a + month or more; “yearly” - specify repeating periods based on an interval of a year or more. These values are case-insensitive. * until - defines an iCalendar COS DATE or DATE-TIME value which bounds the recurrence rule in an inclusive manner. If the value - specified by "until" is synchronized with the specified recurrence, + specified by “until” is synchronized with the specified recurrence, this date or date-time becomes the last instance of the recurrence. If it is not present, the recurrence is considered to repeat forever. * interval - a positive integer representing how often the recurrence - rule repeats. The default value is "1", meaning every day for a - "daily" rule, every week for a "weekly" rule, every month for a - "monthly" rule and every year for a "yearly" rule. + rule repeats. The default value is “1”, meaning every day for a + “daily” rule, every week for a “weekly” rule, every month for a + “monthly” rule and every year for a “yearly” rule. * byday - a comma-separated list short codes of days of the week. The - days are specified as: "MO" for Monday; "TU" for Tuesday; "WE" for - Wednesday; "TH" for Thursday; "FR" for Friday; "SA" for Saturday; - "SU" for Sunday. These values are case insensitive. - Each "byday" value can also be prefixed by a positive (+n) or + days are specified as: “MO” for Monday; “TU” for Tuesday; “WE” for + Wednesday; “TH” for Thursday; “FR” for Friday; “SA” for Saturday; + “SU” for Sunday. These values are case insensitive. + Each “byday” value can also be prefixed by a positive (+n) or negative (-n) integer. If present, this indicates the n-th - occurrence of the specific day within the "monthly" or "yearly" - recurrence. For example, within a "monthly" rule, +1MO (or simply + occurrence of the specific day within the “monthly” or “yearly” + recurrence. For example, within a “monthly” rule, +1MO (or simply 1MO) represents the first Monday within the month, whereas -1MO represents the last Monday of the month. If an integer modifier is not present, it means all days of this type within the specified - frequency. For example, within a "monthly" rule, MO represents all + frequency. For example, within a “monthly” rule, MO represents all Mondays within the month. * bymonthday - a comma-separated list of days of the month. Valid values are 1 to 31 or -31 to -1. For example, -10 represents the @@ -192,43 +192,43 @@ modparam("tmrec", "separator", ";") * bymonth - parameter specifies a comma-separated list of months of the year. Valid values are 1 to 12. - A recurrence is specified by including the "frequency" parameter, which + A recurrence is specified by including the “frequency” parameter, which indicates the type of the recurrence rule. Parameters other than - "startdate" and "duration" SHOULD NOT be specified unless "frequency" + “startdate” and “duration” SHOULD NOT be specified unless “frequency” is set. - If invalid byxxx parameter values are found (ie, bymonthday="30" in + If invalid byxxx parameter values are found (ie, bymonthday=“30” in February), they are simply ignored. Byxxx parameters modify the recurrence rule matching. The Byxxx rule, as an attribute for a period of time which is greater than or equal to the frequency, generally reduces or limits the number of occurrences - for the recurrence definition. For example, frequency="daily" - bymonth="3" reduces the number of recurrence instances from all days - (if the "bymonth" parameter is not present) to all days in March. Byxxx + for the recurrence definition. For example, frequency=“daily” + bymonth=“3” reduces the number of recurrence instances from all days + (if the “bymonth” parameter is not present) to all days in March. Byxxx parameters for a period of time less than the frequency generally increases or expands the number of occurrences of the recurrence. For - example, frequency="yearly" bymonth="8,9" increases the number of days - within the yearly recurrence set from 1 (if "bymonth" parameter is not + example, frequency=“yearly” bymonth=“8,9” increases the number of days + within the yearly recurrence set from 1 (if “bymonth” parameter is not present) to 2. If multiple Byxxx parameters are specified, then after evaluating the - specified "frequency" and "interval" parameters, the Byxxx parameters + specified “frequency” and “interval” parameters, the Byxxx parameters are applied to the current set of evaluated occurrences in the - following order: "bymonth", "byweekno", "byyearday", "bymonthday", - "byday"; then "until" is evaluated. + following order: “bymonth”, “byweekno”, “byyearday”, “bymonthday”, + “byday”; then “until” is evaluated. Next is an example of evaluating multiple Byxxx parameters. - startdate="20100101T093000" duration="PT10H30M" frequency="yearly" - interval="4" bymonth="3" byday="SU" + startdate=“20100101T093000” duration=“PT10H30M” frequency=“yearly” + interval=“4” bymonth=“3” byday=“SU” - First, the interval="4" would be applied to frequency="yearly" to match - on "every 4th year" . Then, bymonth="1" would be applied to match on - "every March, every 4th year". Then, byday="SU" would be applied to - match on "every Sunday in March, every 4th year, from 9:30 to 20:00 ". + First, the interval=“4” would be applied to frequency=“yearly” to match + on “every 4th year” . Then, bymonth=“1” would be applied to match on + “every March, every 4th year”. Then, byday=“SU” would be applied to + match on “every Sunday in March, every 4th year, from 9:30 to 20:00 ”. The start and end hours:minutes have been retrieved from the - "startdate" and "duration" parameters. + “startdate” and “duration” parameters. This function can be used in ANY_ROUTE. @@ -240,7 +240,7 @@ modparam("tmrec", "separator", ";") xdbg("it is with working hours\n"); ... -4.2. is_leap_year([year]) +4.2. is_leap_year([year]) Return true if the value from parameter is a leap year. If the parameter is missing, then the year from the current time is taken. @@ -254,7 +254,7 @@ modparam("tmrec", "separator", ";") if(is_leap_year("2010")) ... -4.3. time_period_match(period [, timestamp]) +4.3. time_period_match(period [, timestamp]) Matches the point in time specified by the timestamp parameter, or the current time if the parameter is missing, against the given period @@ -287,26 +287,26 @@ if(is_leap_year("2010")) the current century. * month or mo - Month of the year, either a number between 1 and 12, or at least the first 3 letters of a spelled out month name, e.g. - "jan", "janua" or "january" will all work. + “jan”, “janua” or “january” will all work. * week or wk - Week of the month, a number between 1 and 6. The first day of the week is Sunday. * yday or yd - Day of the year, a number between 1 and 366. * mday or md - Day of the month, a number between 1 and 31. * wday or wd - Day of the week, either a number between 1 and 7, or at least the first 2 letters of a spelled out weekday name - (analogous to the "month" scale). Sunday is the first day of the + (analogous to the “month” scale). Sunday is the first day of the week. * hour or hr - A number between 0 and 23. Unlike the Perl - Time::Period module, "am" or "pm" specifications are not supported. + Time::Period module, “am” or “pm” specifications are not supported. * minute or min - A number between 0 and 59. * second or sec - A number between 0 and 60 (to allow for leap seconds). The parameters can include pseudo-variables. Whitespace (more precisely, the space character only) can occur anywhere, but is - optional. Ranges in all scales (with the exception of the "year" scale) - are allowed to wrap-around, e.g. a weekday scale of "{fri-tue}" is - equivalent to "{fri-sat,sun-tue}". + optional. Ranges in all scales (with the exception of the “year” scale) + are allowed to wrap-around, e.g. a weekday scale of “{fri-tue}” is + equivalent to “{fri-sat,sun-tue}”. Example 1.4. time_period_match usage ... diff --git a/modules/tmx/README b/modules/tmx/README index e56b139abc3..961a54047ff 100644 --- a/modules/tmx/README +++ b/modules/tmx/README @@ -48,10 +48,11 @@ Juha Heinanen 4.5. t_is_failure_route() 4.6. t_is_branch_route() 4.7. t_is_reply_route() - 4.8. t_suspend() - 4.9. t_continue(tindex, tlabel, rtname) - 4.10. t_reuse_branch() - 4.11. t_precheck_trans() + 4.8. t_is_request_route() + 4.9. t_suspend() + 4.10. t_continue(tindex, tlabel, rtname) + 4.11. t_reuse_branch() + 4.12. t_precheck_trans() 5. Exported pseudo-variables 6. MI Commands @@ -89,10 +90,11 @@ Juha Heinanen 1.6. t_is_failure_route usage 1.7. t_is_branch_route usage 1.8. t_is_reply_route usage - 1.9. t_suspend usage - 1.10. t_continue usage - 1.11. t_reuse_branch usage - 1.12. t_precheck_trans usage + 1.9. t_is_request_route usage + 1.10. t_suspend usage + 1.11. t_continue usage + 1.12. t_reuse_branch usage + 1.13. t_precheck_trans usage Chapter 1. Admin Guide @@ -117,10 +119,11 @@ Chapter 1. Admin Guide 4.5. t_is_failure_route() 4.6. t_is_branch_route() 4.7. t_is_reply_route() - 4.8. t_suspend() - 4.9. t_continue(tindex, tlabel, rtname) - 4.10. t_reuse_branch() - 4.11. t_precheck_trans() + 4.8. t_is_request_route() + 4.9. t_suspend() + 4.10. t_continue(tindex, tlabel, rtname) + 4.11. t_reuse_branch() + 4.12. t_precheck_trans() 5. Exported pseudo-variables 6. MI Commands @@ -197,10 +200,11 @@ modparam("tmx", "precheck_trans", 0) 4.5. t_is_failure_route() 4.6. t_is_branch_route() 4.7. t_is_reply_route() - 4.8. t_suspend() - 4.9. t_continue(tindex, tlabel, rtname) - 4.10. t_reuse_branch() - 4.11. t_precheck_trans() + 4.8. t_is_request_route() + 4.9. t_suspend() + 4.10. t_continue(tindex, tlabel, rtname) + 4.11. t_reuse_branch() + 4.12. t_precheck_trans() 4.1. t_cancel_branches(which) @@ -329,7 +333,24 @@ route[abc] { } ... -4.8. t_suspend() +4.8. t_is_request_route() + + Returns true if the top-executed route block is request_route. + + This function can be used from ANY_ROUTE . + + Example 1.9. t_is_request_route usage +... +request_route[xyz] { + route(abc); +} + +route[abc] { + if(t_is_request_route()) { ... } +} +... + +4.9. t_suspend() Suspend the execution of SIP request in a transaction. If transaction was not created yet, it is created by this function. Returns true in @@ -338,7 +359,7 @@ route[abc] { This function can be used from ANY_ROUTE . - Example 1.9. t_suspend usage + Example 1.10. t_suspend usage ... if(t_suspend()) { @@ -347,7 +368,7 @@ if(t_suspend()) } ... -4.9. t_continue(tindex, tlabel, rtname) +4.10. t_continue(tindex, tlabel, rtname) Continue the execution of the transaction identified by tindex and tlabel with the actions defined in route[rtname]. @@ -362,12 +383,12 @@ if(t_suspend()) This function can be used in ANY_ROUTE. - Example 1.10. t_continue usage + Example 1.11. t_continue usage ... t_continue('123', '456', 'MYROUTE'); ... -4.10. t_reuse_branch() +4.11. t_reuse_branch() Creates new "main" branch by making copy of branch-failure branch. Currently the following branch attributes are copied from @@ -376,7 +397,7 @@ t_continue('123', '456', 'MYROUTE'); This function can be used from tm:branch-failure event_route. - Example 1.11. t_reuse_branch usage + Example 1.12. t_reuse_branch usage ... event_route [tm:branch-failure:contact] { t_reuse_branch(); @@ -386,7 +407,7 @@ event_route [tm:branch-failure:contact] { } ... -4.11. t_precheck_trans() +4.12. t_precheck_trans() Check if current processed message is handled by other process. This function is useful to catch retransmissions before transaction is @@ -398,7 +419,7 @@ event_route [tm:branch-failure:contact] { This function can be used from REQUEST_ROUTE . - Example 1.12. t_precheck_trans usage + Example 1.13. t_precheck_trans usage ... # handle retransmissions if(t_precheck_trans()) { diff --git a/modules/tmx/t_mi.c b/modules/tmx/t_mi.c index 485b160eec1..beab1c5d90d 100644 --- a/modules/tmx/t_mi.c +++ b/modules/tmx/t_mi.c @@ -641,6 +641,7 @@ struct mi_root* mi_tm_cancel(struct mi_root* cmd_tree, void* param) init_cancel_info(&cancel_data); cancel_data.cancel_bitmap = ~0; /*all branches*/ + _tmx_tmb.prepare_to_cancel(trans, &cancel_data.cancel_bitmap, 0); _tmx_tmb.cancel_uacs(trans, &cancel_data, 0); _tmx_tmb.unref_cell(trans); diff --git a/modules/tmx/t_var.c b/modules/tmx/t_var.c index bcd58395d67..9756d801c87 100644 --- a/modules/tmx/t_var.c +++ b/modules/tmx/t_var.c @@ -32,10 +32,10 @@ #include "t_var.h" struct _pv_tmx_data { - struct cell *T; + unsigned int index; + unsigned int label; struct sip_msg msg; struct sip_msg *tmsgp; - unsigned int id; char *buf; int buf_size; }; @@ -99,8 +99,7 @@ int pv_t_update_req(struct sip_msg *msg) if(t->uas.request==NULL) return 1; - if(_pv_treq.T==t && t->uas.request==_pv_treq.tmsgp - && t->uas.request->id==_pv_treq.id) + if (_pv_treq.label == t->label && _pv_treq.index == t->hash_index) return 0; /* make a copy */ @@ -111,8 +110,8 @@ int pv_t_update_req(struct sip_msg *msg) if(_pv_treq.tmsgp) free_sip_msg(&_pv_treq.msg); _pv_treq.tmsgp = NULL; - _pv_treq.id = 0; - _pv_treq.T = NULL; + _pv_treq.index = 0; + _pv_treq.label = 0; _pv_treq.buf_size = t->uas.request->len+1; _pv_treq.buf = (char*)pkg_malloc(_pv_treq.buf_size*sizeof(char)); if(_pv_treq.buf==NULL) @@ -130,8 +129,8 @@ int pv_t_update_req(struct sip_msg *msg) _pv_treq.msg.len = t->uas.request->len; _pv_treq.msg.buf = _pv_treq.buf; _pv_treq.tmsgp = t->uas.request; - _pv_treq.id = t->uas.request->id; - _pv_treq.T = t; + _pv_treq.index = t->hash_index; + _pv_treq.label = t->label; if(pv_t_copy_msg(t->uas.request, &_pv_treq.msg)!=0) @@ -140,7 +139,8 @@ int pv_t_update_req(struct sip_msg *msg) _pv_treq.buf_size = 0; _pv_treq.buf = NULL; _pv_treq.tmsgp = NULL; - _pv_treq.T = NULL; + _pv_treq.index = 0; + _pv_treq.label = 0; return -1; } @@ -175,8 +175,7 @@ int pv_t_update_rpl(struct sip_msg *msg) if(t->uac[branch].reply==NULL || t->uac[branch].reply==FAKED_REPLY) return 1; - if(_pv_trpl.T==t && t->uac[branch].reply==_pv_trpl.tmsgp - && t->uac[branch].reply->id==_pv_trpl.id) + if (_pv_trpl.label == t->label && _pv_trpl.index == t->hash_index) return 0; /* make a copy */ @@ -187,8 +186,8 @@ int pv_t_update_rpl(struct sip_msg *msg) if(_pv_trpl.tmsgp) free_sip_msg(&_pv_trpl.msg); _pv_trpl.tmsgp = NULL; - _pv_trpl.id = 0; - _pv_trpl.T = NULL; + _pv_trpl.index = 0; + _pv_trpl.label = 0; _pv_trpl.buf_size = t->uac[branch].reply->len+1; _pv_trpl.buf = (char*)pkg_malloc(_pv_trpl.buf_size*sizeof(char)); if(_pv_trpl.buf==NULL) @@ -206,8 +205,8 @@ int pv_t_update_rpl(struct sip_msg *msg) _pv_trpl.msg.len = t->uac[branch].reply->len; _pv_trpl.msg.buf = _pv_trpl.buf; _pv_trpl.tmsgp = t->uac[branch].reply; - _pv_trpl.id = t->uac[branch].reply->id; - _pv_trpl.T = t; + _pv_trpl.index = t->hash_index; + _pv_trpl.label = t->label; if(pv_t_copy_msg(t->uac[branch].reply, &_pv_trpl.msg)!=0) { @@ -215,7 +214,8 @@ int pv_t_update_rpl(struct sip_msg *msg) _pv_trpl.buf_size = 0; _pv_trpl.buf = NULL; _pv_trpl.tmsgp = NULL; - _pv_trpl.T = NULL; + _pv_trpl.index = 0; + _pv_trpl.label = 0; return -1; } @@ -241,8 +241,7 @@ int pv_t_update_inv(struct sip_msg *msg) return 1; } - if(_pv_tinv.T==t && t->uas.request==_pv_tinv.tmsgp - && t->uas.request->id==_pv_tinv.id) + if (_pv_tinv.label == t->label && _pv_tinv.index == t->hash_index) goto done; /* make a copy */ @@ -253,8 +252,8 @@ int pv_t_update_inv(struct sip_msg *msg) if(_pv_tinv.tmsgp) free_sip_msg(&_pv_tinv.msg); _pv_tinv.tmsgp = NULL; - _pv_tinv.id = 0; - _pv_tinv.T = NULL; + _pv_tinv.index = 0; + _pv_tinv.label = 0; _pv_tinv.buf_size = t->uas.request->len+1; _pv_tinv.buf = (char*)pkg_malloc(_pv_tinv.buf_size*sizeof(char)); if(_pv_tinv.buf==NULL) @@ -272,8 +271,8 @@ int pv_t_update_inv(struct sip_msg *msg) _pv_tinv.msg.len = t->uas.request->len; _pv_tinv.msg.buf = _pv_tinv.buf; _pv_tinv.tmsgp = t->uas.request; - _pv_tinv.id = t->uas.request->id; - _pv_tinv.T = t; + _pv_tinv.index = t->hash_index; + _pv_tinv.label = t->label; if(pv_t_copy_msg(t->uas.request, &_pv_tinv.msg)!=0) @@ -282,7 +281,8 @@ int pv_t_update_inv(struct sip_msg *msg) _pv_tinv.buf_size = 0; _pv_tinv.buf = NULL; _pv_tinv.tmsgp = NULL; - _pv_tinv.T = NULL; + _pv_tinv.index = 0; + _pv_tinv.label = 0; goto error; } @@ -396,7 +396,7 @@ int pv_get_tm_branch_idx(struct sip_msg *msg, pv_param_t *param, return -1; /* statefull replies have the branch_index set */ - if(msg->first_line.type == SIP_REPLY && route_type != CORE_ONREPLY_ROUTE) { + if(msg->first_line.type == SIP_REPLY) { tcx = _tmx_tmb.tm_ctx_get(); if(tcx != NULL) idx = tcx->branch_index; diff --git a/modules/topoh/README b/modules/topoh/README index 8812b7b1ab5..213524545c9 100644 --- a/modules/topoh/README +++ b/modules/topoh/README @@ -10,7 +10,7 @@ Daniel-Constantin Mierla - Copyright 2009 FhG FOKUS + Copyright © 2009 FhG FOKUS __________________________________________________________________ Table of Contents diff --git a/modules/topos/README b/modules/topos/README index 242fa40ac9d..3fc421c6dbf 100644 --- a/modules/topos/README +++ b/modules/topos/README @@ -10,7 +10,7 @@ Daniel-Constantin Mierla - Copyright 2016 FhG FOKUS + Copyright © 2016 FhG FOKUS __________________________________________________________________ Table of Contents @@ -28,12 +28,18 @@ Daniel-Constantin Mierla 3.1. db_url (str) 3.2. mask_callid (int) 3.3. sanity_checks (int) + 3.4. branch_expires (int) + 3.5. branch_dialog (int) + 3.6. clean_inteval (int) List of Examples 1.1. Set db_url parameter 1.2. Set mask_callid parameter 1.3. Set sanity_checks parameter + 1.4. Set branch_expires parameter + 1.5. Set branch_dialog parameter + 1.6. Set clean_interval parameter Chapter 1. Admin Guide @@ -50,6 +56,9 @@ Chapter 1. Admin Guide 3.1. db_url (str) 3.2. mask_callid (int) 3.3. sanity_checks (int) + 3.4. branch_expires (int) + 3.5. branch_dialog (int) + 3.6. clean_inteval (int) 1. Overview @@ -60,6 +69,8 @@ Chapter 1. Admin Guide The module is transparent for the configuration writer. It only needs to be loaded (tune the parameters if needed). + It works for SIP MESSAGE requests. + 2. Dependencies 2.1. Kamailio Modules @@ -84,12 +95,15 @@ Chapter 1. Admin Guide 3.1. db_url (str) 3.2. mask_callid (int) 3.3. sanity_checks (int) + 3.4. branch_expires (int) + 3.5. branch_dialog (int) + 3.6. clean_inteval (int) 3.1. db_url (str) Database URL. - Default value is "mysql://kamailio:kamailiorw@localhost/kamailio". + Default value is “mysql://kamailio:kamailiorw@localhost/kamailio”. Example 1.1. Set db_url parameter ... @@ -98,6 +112,9 @@ modparam("topos", "db_url", "dbdriver://username:password@dbhost/dbname") 3.2. mask_callid (int) + Note: this functionality is not implemented yet - the parameter is + present in order to be in pair with topoh module. + Whether to replace or not the Call-ID with another unique id generated by Kamailio. @@ -121,3 +138,36 @@ modparam("topos", "mask_callid", 1) ... modparam("topoh", "sanity_checks", 1) ... + +3.4. branch_expires (int) + + Interval in seconds after which the branch records are deleted. + + Default value is 180 (3 min). + + Example 1.4. Set branch_expires parameter +... +modparam("topos", "branch_expires", 300) +... + +3.5. branch_dialog (int) + + Interval in seconds after which the dialog records are deleted. + + Default value is 10800 (3 hours). + + Example 1.5. Set branch_dialog parameter +... +modparam("topos", "branch_dialog", 3600) +... + +3.6. clean_inteval (int) + + Interval in seconds to run the clean up of stored records. + + Default value is 60 (1 min). + + Example 1.6. Set clean_interval parameter +... +modparam("topos", "clean_interval", 30) +... diff --git a/modules/topos/doc/topos_admin.xml b/modules/topos/doc/topos_admin.xml index 7d5a9ed538f..ad74d22dd94 100644 --- a/modules/topos/doc/topos_admin.xml +++ b/modules/topos/doc/topos_admin.xml @@ -10,9 +10,9 @@ - + &adminguide; - +
Overview @@ -25,6 +25,9 @@ The module is transparent for the configuration writer. It only needs to be loaded (tune the parameters if needed). + + It works for SIP MESSAGE requests. +
Dependencies @@ -86,6 +89,11 @@ modparam("topos", "db_url", "&exampledb;")
<varname>mask_callid</varname> (int) + + Note: this functionality is not implemented yet - the + parameter is present in order to be in pair with topoh + module. + Whether to replace or not the Call-ID with another unique id generated by &kamailio;. @@ -123,6 +131,64 @@ modparam("topos", "mask_callid", 1) ... modparam("topoh", "sanity_checks", 1) ... + + +
+
+ <varname>branch_expires</varname> (int) + + Interval in seconds after which the branch records are deleted. + + + + Default value is 180 (3 min). + + + + Set <varname>branch_expires</varname> parameter + +... +modparam("topos", "branch_expires", 300) +... + + +
+
+ <varname>branch_dialog</varname> (int) + + Interval in seconds after which the dialog records are deleted. + + + + Default value is 10800 (3 hours). + + + + Set <varname>branch_dialog</varname> parameter + +... +modparam("topos", "branch_dialog", 3600) +... + + +
+
+ <varname>clean_inteval</varname> (int) + + Interval in seconds to run the clean up of stored + records. + + + + Default value is 60 (1 min). + + + + Set <varname>clean_interval</varname> parameter + +... +modparam("topos", "clean_interval", 30) +...
diff --git a/modules/topos/topos_mod.c b/modules/topos/topos_mod.c index a0ae6bcab61..2d45ba484a1 100644 --- a/modules/topos/topos_mod.c +++ b/modules/topos/topos_mod.c @@ -222,10 +222,11 @@ int tps_prepare_msg(sip_msg_t *msg) return 2; } - /* force 2nd via parsing here - it helps checking it later */ - if (parse_headers(msg, HDR_VIA2_F, 0)==-1 - || (msg->via2==0) || (msg->via2->error!=PARSE_OK)) { - LM_DBG("no second via in this message \n"); + parse_headers(msg, HDR_VIA2_F, 0); + + if(parse_headers(msg, HDR_CSEQ_F, 0)!=0 || msg->cseq==NULL) { + LM_ERR("cannot parse cseq header\n"); + return -1; } if(parse_from_header(msg)<0) { @@ -254,7 +255,6 @@ int tps_msg_received(void *data) sip_msg_t msg; str *obuf; char *nbuf = NULL; - int direction; int dialog; obuf = (str*)data; @@ -270,7 +270,6 @@ int tps_msg_received(void *data) goto done; } - direction = 0; if(msg.first_line.type==SIP_REQUEST) { if(_tps_sanity_checks!=0) { if(scb.check_defaults(&msg)<1) { @@ -279,19 +278,16 @@ int tps_msg_received(void *data) } } dialog = (get_to(&msg)->tag_value.len>0)?1:0; - if(dialog) { - direction = tps_route_direction(&msg); - if(direction<0) { - LM_ERR("not able to detect direction\n"); - goto done; - } - } if(dialog) { /* dialog request */ - tps_request_received(&msg, dialog, direction); + tps_request_received(&msg, dialog); } } else { /* reply */ + if(msg.first_line.u.reply.statuscode==100) { + /* nothing to do - it should be absorbed */ + return 0; + } tps_response_received(&msg); } @@ -319,7 +315,6 @@ int tps_msg_sent(void *data) { sip_msg_t msg; str *obuf; - int direction; int dialog; int local; @@ -337,24 +332,23 @@ int tps_msg_sent(void *data) } if(msg.first_line.type==SIP_REQUEST) { - direction = tps_route_direction(&msg); dialog = (get_to(&msg)->tag_value.len>0)?1:0; local = 0; if(msg.via2==0) { local = 1; - if(direction==0) { - /* downstream local request (e.g., dlg bye) */ - local = 2; - } } - tps_request_sent(&msg, dialog, direction, local); + tps_request_sent(&msg, dialog, local); } else { + /* reply */ + if(msg.first_line.u.reply.statuscode==100) { + /* nothing to do - it should be locally generated */ + return 0; + } tps_response_sent(&msg); } -ready: obuf->s = tps_msg_update(&msg, (unsigned int*)&obuf->len); done: diff --git a/modules/topos/tps_msg.c b/modules/topos/tps_msg.c index 0aa12adcdd2..bdd3839e223 100644 --- a/modules/topos/tps_msg.c +++ b/modules/topos/tps_msg.c @@ -33,6 +33,7 @@ #include "../../data_lump.h" #include "../../forward.h" #include "../../trim.h" +#include "../../dset.h" #include "../../msg_translator.h" #include "../../parser/parse_rr.h" #include "../../parser/parse_uri.h" @@ -47,6 +48,9 @@ extern int _tps_param_mask_callid; +str _sr_hname_xbranch = str_init("P-SR-XBranch"); +str _sr_hname_xuuid = str_init("P-SR-XUID"); + /** * */ @@ -117,7 +121,7 @@ int tps_remove_headers(sip_msg_t *msg, uint32_t hdr) continue; l=del_lump(msg, hf->name.s-msg->buf, hf->len, 0); if (l==0) { - LM_ERR("no memory\n"); + LM_ERR("failed to remove the header\n"); return -1; } } @@ -152,7 +156,8 @@ int tps_add_headers(sip_msg_t *msg, str *hname, str *hbody, int hpos) hs.len = hname->len + 2 + hbody->len; hs.s = (char*)pkg_malloc(hs.len + 3); if (hs.s==NULL) { - LM_ERR("no pkg memory left\n"); + LM_ERR("no pkg memory left (%.*s - %d)\n", + hname->len, hname->s, hs.len); return -1; } memcpy(hs.s, hname->s, hname->len); @@ -161,7 +166,7 @@ int tps_add_headers(sip_msg_t *msg, str *hname, str *hbody, int hpos) memcpy(hs.s + hname->len + 2, hbody->s, hbody->len); /* add end of header if not present */ - if(hs.s[hname->len + 2 + hbody->len]!='\n') { + if(hs.s[hname->len + 2 + hbody->len - 1]!='\n') { hs.s[hname->len + 2 + hbody->len] = '\r'; hs.s[hname->len + 2 + hbody->len+1] = '\n'; hs.len += 2; @@ -240,78 +245,63 @@ char* tps_msg_update(sip_msg_t *msg, unsigned int *olen) /** * */ -int tps_route_direction(sip_msg_t *msg) +int tps_skip_msg(sip_msg_t *msg) { - rr_t *rr; - struct sip_uri puri; - str ftn = {"ftag", 4}; - str ftv = {0, 0}; - - if(get_from(msg)->tag_value.len<=0) - { - LM_ERR("failed to get from header tag\n"); - return -1; - } - if(msg->route==NULL) - { - LM_DBG("no route header - downstream\n"); - return 0; - } - if (parse_rr(msg->route) < 0) - { - LM_ERR("failed to parse route header\n"); - return -1; - } - - rr =(rr_t*)msg->route->parsed; - - if (parse_uri(rr->nameaddr.uri.s, rr->nameaddr.uri.len, &puri) < 0) { - LM_ERR("failed to parse the first route URI\n"); - return -1; + if (msg->cseq==NULL || get_cseq(msg)==NULL) { + LM_WARN("Invalid/Unparsed CSeq in message. Skipping."); + return 1; } - if(tps_get_param_value(&puri.params, &ftn, &ftv)!=0) - return 0; - if(get_from(msg)->tag_value.len!=ftv.len - || strncmp(get_from(msg)->tag_value.s, ftv.s, ftv.len)!=0) - { - LM_DBG("ftag mismatch\n"); + if((get_cseq(msg)->method_id)&(METHOD_REGISTER|METHOD_PUBLISH)) return 1; - } - LM_DBG("ftag match\n"); + return 0; } /** * */ -int tps_skip_msg(sip_msg_t *msg) +int tps_dlg_message_update(sip_msg_t *msg, tps_data_t *ptsd) { - if (msg->cseq==NULL || get_cseq(msg)==NULL) { - LM_WARN("Invalid/Unparsed CSeq in message. Skipping."); - return 1; + if(parse_sip_msg_uri(msg)<0) { + LM_ERR("failed to parse r-uri\n"); + return -1; } - - if((get_cseq(msg)->method_id)&(METHOD_REGISTER|METHOD_PUBLISH)) + if(msg->parsed_uri.user.len<10) { + LM_DBG("not an expected user format\n"); return 1; + } + if(memcmp(msg->parsed_uri.user.s, "atpsh-", 6)==0) { + ptsd->a_uuid = msg->parsed_uri.user; + return 0; + } + if(memcmp(msg->parsed_uri.user.s, "btpsh-", 6)==0) { + ptsd->a_uuid = msg->parsed_uri.user; + ptsd->b_uuid = msg->parsed_uri.user; + return 0; + } + LM_DBG("not an expected user prefix\n"); - return 0; + return 1; } /** * */ -int tps_pack_request(sip_msg_t *msg, tps_data_t *ptsd) +int tps_pack_message(sip_msg_t *msg, tps_data_t *ptsd) { hdr_field_t *hdr; via_body_t *via; rr_t *rr; int i; int vlen; + int r2; + int isreq; if(ptsd->cp==NULL) { ptsd->cp = ptsd->cbuf; } + i = 0; for(hdr=msg->h_via1; hdr; hdr=next_sibling_hdr(hdr)) { for(via=(struct via_body*)hdr->parsed; via; via=via->next) { @@ -351,8 +341,11 @@ int tps_pack_request(sip_msg_t *msg, tps_data_t *ptsd) ptsd->x_via2.len, ZSW(ptsd->x_via2.s), ptsd->x_via2.len, ptsd->x_vbranch1.len, ZSW(ptsd->x_vbranch1.s), ptsd->x_vbranch1.len); - i = 0; ptsd->a_rr.len = 0; + ptsd->s_rr.len = 0; + i = 0; + r2 = 0; + isreq = (msg->first_line.type==SIP_REQUEST)?1:0; for(hdr=msg->record_route; hdr; hdr=next_sibling_hdr(hdr)) { if (parse_rr(hdr) < 0) { LM_ERR("failed to parse RR\n"); @@ -365,50 +358,95 @@ int tps_pack_request(sip_msg_t *msg, tps_data_t *ptsd) LM_ERR("no more spage to pack rr headers\n"); return -1; } - if(i>1) { - *ptsd->cp = ','; + if(isreq==1) { + /* sip request - get a+s-side record route */ + if(i>1) { + if(i==2 &&r2==0) { + ptsd->s_rr.len = ptsd->a_rr.len; + } + if(i==3 &&r2==1) { + ptsd->s_rr.len = ptsd->a_rr.len; + } + *ptsd->cp = ','; + ptsd->cp++; + ptsd->a_rr.len++; + } + *ptsd->cp = '<'; + if(i==1) { + ptsd->a_rr.s = ptsd->cp; + ptsd->s_rr.s = ptsd->cp; + } + if(i==2 && r2==0) { + ptsd->a_rr.s = ptsd->cp; + ptsd->a_rr.len = 0; + } + if(i==3 && r2==1) { + ptsd->a_rr.s = ptsd->cp; + ptsd->a_rr.len = 0; + } + ptsd->cp++; ptsd->a_rr.len++; - } - *ptsd->cp = '<'; - if(i==1) { - ptsd->a_rr.s = ptsd->cp; - } - ptsd->cp++; - ptsd->a_rr.len++; - memcpy(ptsd->cp, rr->nameaddr.uri.s, rr->nameaddr.uri.len); - if(i==1) { - ptsd->bs_contact.s = ptsd->cp; - ptsd->bs_contact.len = rr->nameaddr.uri.len; - if(strnstr(ptsd->bs_contact.s, ";r2=on", - ptsd->bs_contact.len)==NULL) { - LM_DBG("single record routing by proxy\n"); - ptsd->as_contact.s = ptsd->cp; - ptsd->as_contact.len = rr->nameaddr.uri.len; + memcpy(ptsd->cp, rr->nameaddr.uri.s, rr->nameaddr.uri.len); + if(i==1) { + ptsd->bs_contact.s = ptsd->cp; + ptsd->bs_contact.len = rr->nameaddr.uri.len; + if(_strnstr(ptsd->bs_contact.s, ";r2=on", + ptsd->bs_contact.len)==0) { + LM_DBG("single record routing by proxy\n"); + ptsd->as_contact.s = ptsd->cp; + ptsd->as_contact.len = rr->nameaddr.uri.len; + } else { + r2 = 1; + } + } else { + if(i==2 && ptsd->as_contact.len==0) { + LM_DBG("double record routing by proxy\n"); + ptsd->as_contact.s = ptsd->cp; + ptsd->as_contact.len = rr->nameaddr.uri.len; + } } + ptsd->a_rr.len += rr->nameaddr.uri.len; + ptsd->cp += rr->nameaddr.uri.len; + *ptsd->cp = '>'; + ptsd->cp++; + ptsd->a_rr.len++; } else { - if(i==2 && ptsd->as_contact.len==0) { - LM_DBG("double record routing by proxy\n"); - ptsd->as_contact.s = ptsd->cp; - ptsd->as_contact.len = rr->nameaddr.uri.len; - } + /* sip response - get b-side record route */ + *ptsd->cp = '<'; + ptsd->b_rr.s = ptsd->cp; + ptsd->cp++; + ptsd->b_rr.len++; + memcpy(ptsd->cp, rr->nameaddr.uri.s, rr->nameaddr.uri.len); + ptsd->cp += rr->nameaddr.uri.len; + ptsd->b_rr.len += rr->nameaddr.uri.len; + *ptsd->cp = '>'; + ptsd->cp++; + ptsd->b_rr.len++; } - ptsd->a_rr.len += rr->nameaddr.uri.len; - ptsd->cp += rr->nameaddr.uri.len; - *ptsd->cp = '>'; - ptsd->cp++; - ptsd->a_rr.len++; } - } - LM_DBG("compacted headers - a_rr: [%.*s](%d) - b_rr: [%.*s](%d)\n", + if(isreq==1) { + if(i==1) { + ptsd->s_rr.len = ptsd->a_rr.len; + ptsd->a_rr.len = 0; + } + if(i==2 && r2==1) { + ptsd->s_rr.len = ptsd->a_rr.len; + ptsd->a_rr.len = 0; + } + } + LM_DBG("compacted headers - a_rr: [%.*s](%d) - b_rr: [%.*s](%d)" + " - s_rr: [%.*s](%d)\n", ptsd->a_rr.len, ZSW(ptsd->a_rr.s), ptsd->a_rr.len, - ptsd->b_rr.len, ZSW(ptsd->b_rr.s), ptsd->b_rr.len); + ptsd->b_rr.len, ZSW(ptsd->b_rr.s), ptsd->b_rr.len, + ptsd->s_rr.len, ZSW(ptsd->s_rr.s), ptsd->s_rr.len); LM_DBG("compacted headers - as_contact: [%.*s](%d) - bs_contact: [%.*s](%d)\n", ptsd->as_contact.len, ZSW(ptsd->as_contact.s), ptsd->as_contact.len, ptsd->bs_contact.len, ZSW(ptsd->bs_contact.s), ptsd->bs_contact.len); ptsd->x_rr = ptsd->a_rr; + ptsd->s_method_id = get_cseq(msg)->method_id; return 0; } @@ -441,6 +479,31 @@ int tps_reinsert_contact(sip_msg_t *msg, tps_data_t *ptsd, str *hbody) return 0; } +/** + * + */ +int tps_remove_name_headers(sip_msg_t *msg, str *hname) +{ + hdr_field_t *hf; + struct lump* l; + for (hf=msg->headers; hf; hf=hf->next) + { + if (hf->name.len==hname->len + && strncasecmp(hf->name.s, hname->s, + hname->len)==0) + { + l=del_lump(msg, hf->name.s-msg->buf, hf->len, 0); + if (l==0) { + LM_ERR("unable to delete header [%.*s]\n", + hname->len, hname->s); + return -1; + } + return 0; + } + } + return 0; +} + /** * */ @@ -455,6 +518,101 @@ int tps_reappend_via(sip_msg_t *msg, tps_data_t *ptsd, str *hbody) return 0; } +/** + * + */ +int tps_append_xbranch(sip_msg_t *msg, str *hbody) +{ + if(tps_add_headers(msg, &_sr_hname_xbranch, hbody, 0)<0) { + LM_ERR("failed to add xbranch header [%.*s]/%d\n", + hbody->len, hbody->s, hbody->len); + return -1; + } + + return 0; +} + +/** + * + */ +int tps_remove_xbranch(sip_msg_t *msg) +{ + return tps_remove_name_headers(msg, &_sr_hname_xbranch); +} + +/** + * + */ +int tps_get_xbranch(sip_msg_t *msg, str *hbody) +{ + hdr_field_t *hf; + if(parse_headers(msg, HDR_EOH_F, 0)<0) { + return -1; + } + + for (hf=msg->headers; hf; hf=hf->next) + { + if(_sr_hname_xbranch.len==hf->name.len + && strncasecmp(_sr_hname_xbranch.s, hf->name.s, + hf->name.len)==0) { + break; + } + } + if(hf!=NULL) { + *hbody = hf->body; + return 0; + } + return -1; +} + + +/** + * + */ +int tps_append_xuuid(sip_msg_t *msg, str *hbody) +{ + if(tps_add_headers(msg, &_sr_hname_xuuid, hbody, 0)<0) { + LM_ERR("failed to add xuuid header [%.*s]/%d\n", + hbody->len, hbody->s, hbody->len); + return -1; + } + + return 0; +} + +/** + * + */ +int tps_remove_xuuid(sip_msg_t *msg) +{ + return tps_remove_name_headers(msg, &_sr_hname_xuuid); +} + +/** + * + */ +int tps_get_xuuid(sip_msg_t *msg, str *hbody) +{ + hdr_field_t *hf; + if(parse_headers(msg, HDR_EOH_F, 0)<0) { + return -1; + } + + for (hf=msg->headers; hf; hf=hf->next) + { + if(_sr_hname_xuuid.len==hf->name.len + && strncasecmp(_sr_hname_xuuid.s, hf->name.s, + hf->name.len)==0) { + break; + } + } + if(hf!=NULL) { + *hbody = hf->body; + return 0; + } + return -1; +} + /** * */ @@ -472,13 +630,155 @@ int tps_reappend_rr(sip_msg_t *msg, tps_data_t *ptsd, str *hbody) /** * */ -int tps_request_received(sip_msg_t *msg, int dialog, int direction) +int tps_reappend_route(sip_msg_t *msg, tps_data_t *ptsd, str *hbody, int rev) { + str hname = str_init("Route"); + int i; + int c; + str sb; + + if(hbody==NULL || hbody->s==NULL || hbody->len<=0 || hbody->s[0]=='\0') + return 0; + + if(rev==1) { + c = 0; + sb.len = 1; + for(i=hbody->len-2; i>=0; i--) { + if(hbody->s[i]==',') { + c = 1; + if(sb.len>0) { + sb.s = hbody->s + i + 1; + if(sb.s[sb.len-1]==',') sb.len--; + if(tps_add_headers(msg, &hname, &sb, 0)<0) { + return -1; + } + } + sb.len = 0; + } + sb.len++; + } + if(c==1) { + if(sb.len>0) { + sb.s = hbody->s; + if(sb.s[sb.len-1]==',') sb.len--; + if(tps_add_headers(msg, &hname, &sb, 0)<0) { + return -1; + } + } + return 0; + } + } + + sb = *hbody; + if(sb.len>0 && sb.s[sb.len-1]==',') sb.len--; + trim_zeros_lr(&sb); + trim(&sb); + if(sb.len>0 && sb.s[sb.len-1]==',') sb.len--; + if(tps_add_headers(msg, &hname, &sb, 0)<0) { + return -1; + } + + return 0; +} + +/** + * + */ +int tps_request_received(sip_msg_t *msg, int dialog) +{ + tps_data_t mtsd; + tps_data_t stsd; + str lkey; + str ftag; + str nuri; + uint32_t direction = TPS_DIR_DOWNSTREAM; + int ret; + + LM_DBG("handling incoming request\n"); + if(dialog==0) { /* nothing to do for initial request */ return 0; } + + memset(&mtsd, 0, sizeof(tps_data_t)); + memset(&stsd, 0, sizeof(tps_data_t)); + + if(tps_pack_message(msg, &mtsd)<0) { + LM_ERR("failed to extract and pack the headers\n"); + return -1; + } + + ret = tps_dlg_message_update(msg, &mtsd); + if(ret<0) { + LM_ERR("failed to update on dlg message\n"); + return -1; + } + + lkey = msg->callid->body; + + tps_storage_lock_get(&lkey); + + if(tps_storage_load_dialog(msg, &mtsd, &stsd)<0) { + goto error; + } + + /* detect direction - get from-tag */ + if(parse_from_header(msg)<0 || msg->from==NULL) { + LM_ERR("failed getting 'from' header!\n"); + goto error; + } + ftag = get_from(msg)->tag_value; + + if(stsd.a_tag.len!=ftag.len) { + direction = TPS_DIR_UPSTREAM; + } else { + if(memcmp(stsd.a_tag.s, ftag.s, ftag.len)==0) { + direction = TPS_DIR_DOWNSTREAM; + } else { + direction = TPS_DIR_UPSTREAM; + } + } + mtsd.direction = direction; + + tps_storage_lock_release(&lkey); + + if(direction == TPS_DIR_UPSTREAM) { + nuri = stsd.a_contact; + } else { + nuri = stsd.b_contact; + } + if(nuri.len>0) { + if(rewrite_uri(msg, &nuri)<0) { + LM_ERR("failed to update r-uri\n"); + return -1; + } + } + + if(tps_reappend_route(msg, &stsd, &stsd.s_rr, + (direction==TPS_DIR_UPSTREAM)?0:1)<0) { + LM_ERR("failed to reappend s-route\n"); + return -1; + } + if(direction == TPS_DIR_UPSTREAM) { + if(tps_reappend_route(msg, &stsd, &stsd.a_rr, 0)<0) { + LM_ERR("failed to reappend a-route\n"); + return -1; + } + } else { + if(tps_reappend_route(msg, &stsd, &stsd.b_rr, 0)<0) { + LM_ERR("failed to reappend b-route\n"); + return -1; + } + } + if(dialog!=0) { + tps_append_xuuid(msg, &stsd.a_uuid); + } return 0; + +error: + tps_storage_lock_release(&lkey); + return -1; } /** @@ -489,17 +789,24 @@ int tps_response_received(sip_msg_t *msg) tps_data_t mtsd; tps_data_t stsd; tps_data_t btsd; - tps_data_t *ptsd; str lkey; + str ftag; + uint32_t direction; + + LM_DBG("handling incoming response\n"); + + if(msg->first_line.u.reply.statuscode==100) { + /* nothing to do - it should be absorbed */ + return 0; + } memset(&mtsd, 0, sizeof(tps_data_t)); memset(&stsd, 0, sizeof(tps_data_t)); memset(&btsd, 0, sizeof(tps_data_t)); - ptsd = &mtsd; lkey = msg->callid->body; - if(tps_pack_request(msg, &mtsd)<0) { + if(tps_pack_message(msg, &mtsd)<0) { LM_ERR("failed to extract and pack the headers\n"); return -1; } @@ -513,10 +820,35 @@ int tps_response_received(sip_msg_t *msg) goto error; } + /* detect direction - get from-tag */ + if(parse_from_header(msg)<0 || msg->from==NULL) { + LM_ERR("failed getting 'from' header!\n"); + goto error; + } + ftag = get_from(msg)->tag_value; + + if(stsd.a_tag.len!=ftag.len) { + direction = TPS_DIR_UPSTREAM; + } else { + if(memcmp(stsd.a_tag.s, ftag.s, ftag.len)==0) { + direction = TPS_DIR_DOWNSTREAM; + } else { + direction = TPS_DIR_UPSTREAM; + } + } + mtsd.direction = direction; + if(tps_storage_update_branch(msg, &mtsd, &btsd)<0) { + goto error; + } + if(tps_storage_update_dialog(msg, &mtsd, &stsd)<0) { + goto error; + } tps_storage_lock_release(&lkey); tps_reappend_via(msg, &btsd, &btsd.x_via); + tps_reappend_rr(msg, &btsd, &btsd.s_rr); tps_reappend_rr(msg, &btsd, &btsd.x_rr); + tps_append_xbranch(msg, &mtsd.x_vbranch1); return 0; @@ -528,32 +860,53 @@ int tps_response_received(sip_msg_t *msg) /** * */ -int tps_request_sent(sip_msg_t *msg, int dialog, int direction, int local) +int tps_request_sent(sip_msg_t *msg, int dialog, int local) { tps_data_t mtsd; + tps_data_t btsd; tps_data_t stsd; tps_data_t *ptsd; str lkey; + str xuuid; + int direction = TPS_DIR_DOWNSTREAM; + + LM_DBG("handling outgoing request\n"); memset(&mtsd, 0, sizeof(tps_data_t)); + memset(&btsd, 0, sizeof(tps_data_t)); memset(&stsd, 0, sizeof(tps_data_t)); ptsd = &mtsd; - if(tps_pack_request(msg, &mtsd)<0) { + if(tps_pack_message(msg, &mtsd)<0) { LM_ERR("failed to extract and pack the headers\n"); return -1; } - if(direction==TPS_DIR_DOWNSTREAM) { - lkey = get_from(msg)->tag_value; - } else { - lkey = get_to(msg)->tag_value; + if(dialog!=0) { + if(tps_get_xuuid(msg, &xuuid)<0) { + LM_DBG("no x-uuid header - nothing to do\n"); + return 0; + } + mtsd.a_uuid = xuuid; + tps_remove_xuuid(msg); } + + lkey = msg->callid->body; + tps_storage_lock_get(&lkey); - if(dialog==0) { - if(tps_storage_record(msg, ptsd)<0) { + + if(tps_storage_load_branch(msg, &mtsd, &btsd)!=0) { + if(tps_storage_record(msg, ptsd, dialog)<0) { goto error; } + } else { + ptsd = &btsd; + } + + if(dialog!=0) { + if(tps_storage_load_dialog(msg, &mtsd, &stsd)==0) { + ptsd = &stsd; + } } /* local generated requests */ @@ -574,13 +927,17 @@ int tps_request_sent(sip_msg_t *msg, int dialog, int direction, int local) tps_remove_headers(msg, HDR_CONTACT_T); tps_remove_headers(msg, HDR_VIA_T); - tps_reinsert_via(msg, ptsd, &ptsd->x_via1); + tps_reinsert_via(msg, &mtsd, &mtsd.x_via1); if(direction==TPS_DIR_UPSTREAM) { tps_reinsert_contact(msg, ptsd, &ptsd->as_contact); } else { tps_reinsert_contact(msg, ptsd, &ptsd->bs_contact); } + if(dialog!=0) { + tps_storage_end_dialog(msg, &mtsd, ptsd); + } + done: tps_storage_lock_release(&lkey); return 0; @@ -595,5 +952,63 @@ int tps_request_sent(sip_msg_t *msg, int dialog, int direction, int local) */ int tps_response_sent(sip_msg_t *msg) { + tps_data_t mtsd; + tps_data_t stsd; + tps_data_t btsd; + str lkey; + int direction = TPS_DIR_UPSTREAM; + str xvbranch = {0, 0}; + + LM_DBG("handling outgoing response\n"); + + memset(&mtsd, 0, sizeof(tps_data_t)); + memset(&stsd, 0, sizeof(tps_data_t)); + memset(&btsd, 0, sizeof(tps_data_t)); + + if(tps_get_xbranch(msg, &xvbranch)<0) { + LM_DBG("no x-branch header - nothing to do\n"); + return 0; + } + + if(tps_pack_message(msg, &mtsd)<0) { + LM_ERR("failed to extract and pack the headers\n"); + return -1; + } + mtsd.x_vbranch1 = xvbranch; + tps_remove_xbranch(msg); + + if(get_cseq(msg)->method_id==METHOD_MESSAGE) { + tps_remove_headers(msg, HDR_RECORDROUTE_T); + tps_remove_headers(msg, HDR_CONTACT_T); + return 0; + } + + lkey = msg->callid->body; + + tps_storage_lock_get(&lkey); + if(tps_storage_load_branch(msg, &mtsd, &btsd)<0) { + goto error; + } + LM_DBG("loaded dialog a_uuid [%.*s]\n", + btsd.a_uuid.len, ZSW(btsd.a_uuid.s)); + if(tps_storage_load_dialog(msg, &btsd, &stsd)<0) { + goto error; + } + tps_storage_lock_release(&lkey); + + tps_remove_headers(msg, HDR_RECORDROUTE_T); + tps_remove_headers(msg, HDR_CONTACT_T); + + if(direction==TPS_DIR_UPSTREAM) { + tps_reinsert_contact(msg, &stsd, &stsd.as_contact); + } else { + tps_reinsert_contact(msg, &stsd, &stsd.bs_contact); + } + + tps_reappend_rr(msg, &btsd, &btsd.x_rr); return 0; + +error: + tps_storage_lock_release(&lkey); + return -1; } diff --git a/modules/topos/tps_msg.h b/modules/topos/tps_msg.h index 81fd4ce3a2a..1af82e4e9ff 100644 --- a/modules/topos/tps_msg.h +++ b/modules/topos/tps_msg.h @@ -33,11 +33,10 @@ int tps_update_hdr_replaces(sip_msg_t *msg); char* tps_msg_update(sip_msg_t *msg, unsigned int *olen); -int tps_route_direction(sip_msg_t *msg); int tps_skip_msg(sip_msg_t *msg); -int tps_request_received(sip_msg_t *msg, int dialog, int direction); +int tps_request_received(sip_msg_t *msg, int dialog); int tps_response_received(sip_msg_t *msg); -int tps_request_sent(sip_msg_t *msg, int dialog, int direction, int local); +int tps_request_sent(sip_msg_t *msg, int dialog, int local); int tps_response_sent(sip_msg_t *msg); #endif diff --git a/modules/topos/tps_storage.c b/modules/topos/tps_storage.c index 1eb6fca9cb7..faf202f1f94 100644 --- a/modules/topos/tps_storage.c +++ b/modules/topos/tps_storage.c @@ -170,14 +170,20 @@ int tps_storage_fill_contact(sip_msg_t *msg, tps_data_t *td, int dir) { str sv; sip_uri_t puri; - - sruid_next(&_tps_sruid); + int i; if(dir==TPS_DIR_DOWNSTREAM) { sv = td->bs_contact; } else { sv = td->as_contact; } + if(sv.len<=0) { + /* no contact - skip */ + return 0; + } + + sruid_next(&_tps_sruid); + if(td->cp + 8 + (2*_tps_sruid.uid.len) + sv.len >= td->cbuf + TPS_DATA_SIZE) { LM_ERR("insufficient data buffer\n"); return -1; @@ -207,6 +213,11 @@ int tps_storage_fill_contact(sip_msg_t *msg, tps_data_t *td, int dir) } *td->cp = '<'; td->cp++; + for(i=0; icp = sv.s[i]; + td->cp++; + if(sv.s[i]==':') break; + } if(dir==TPS_DIR_DOWNSTREAM) { *td->cp = 'b'; } else { @@ -257,26 +268,40 @@ int tps_storage_link_msg(sip_msg_t *msg, tps_data_t *td, int dir) trim(&stxt); td->a_callid = stxt; + /* get from-tag */ + if(parse_from_header(msg)<0 || msg->from==NULL) { + LM_ERR("failed getting 'from' header!\n"); + goto error; + } + td->a_tag = get_from(msg)->tag_value; + + /* get to-tag */ + if(parse_to_header(msg)<0 || msg->to==NULL) { + LM_ERR("failed getting 'to' header!\n"); + goto error; + } + td->b_tag = get_to(msg)->tag_value; + if(dir==TPS_DIR_DOWNSTREAM) { - /* get from-tag */ - if(parse_from_header(msg)<0 || msg->from==NULL) { - LM_ERR("failed getting 'from' header!\n"); - goto error; - } - td->a_tag = get_from(msg)->tag_value; td->x_tag = td->a_tag; } else { - /* get to-tag */ - if(parse_to_header(msg)<0 || msg->to==NULL) { - LM_ERR("failed getting 'to' header!\n"); - goto error; - } - td->b_tag = get_to(msg)->tag_value; - td->b_tag = td->a_tag; + td->x_tag = td->b_tag; } + td->x_via = td->x_via2; + if(parse_headers(msg, HDR_CSEQ_F, 0)!=0 || msg->cseq==NULL) { + LM_ERR("cannot parse cseq header\n"); + return -1; /* should it be 0 ?!?! */ + } + td->s_method = get_cseq(msg)->method; + td->s_cseq = get_cseq(msg)->number; + /* extract the contact address */ if(parse_headers(msg, HDR_CONTACT_F, 0)<0 || msg->contact==NULL) { + if(td->s_method_id != METHOD_INVITE) { + /* no mandatory contact unless is INVITE - done */ + return 0; + } LM_ERR("bad sip message or missing Contact hdr\n"); goto error; } @@ -286,12 +311,20 @@ int tps_storage_link_msg(sip_msg_t *msg, tps_data_t *td, int dir) LM_ERR("bad Contact header\n"); return -1; } - if(dir==TPS_DIR_DOWNSTREAM) { - td->a_contact = ((contact_body_t*)msg->contact->parsed)->contacts->uri; + if(msg->first_line.type==SIP_REQUEST) { + if(dir==TPS_DIR_DOWNSTREAM) { + td->a_contact = ((contact_body_t*)msg->contact->parsed)->contacts->uri; + } else { + td->b_contact = ((contact_body_t*)msg->contact->parsed)->contacts->uri; + } } else { - td->b_contact = ((contact_body_t*)msg->contact->parsed)->contacts->uri; + if(dir==TPS_DIR_DOWNSTREAM) { + td->b_contact = ((contact_body_t*)msg->contact->parsed)->contacts->uri; + } else { + td->a_contact = ((contact_body_t*)msg->contact->parsed)->contacts->uri; + } } - td->x_via = td->x_via2; + return 0; error: @@ -301,7 +334,7 @@ int tps_storage_link_msg(sip_msg_t *msg, tps_data_t *td, int dir) /** * */ -int tps_storage_record(sip_msg_t *msg, tps_data_t *td) +int tps_storage_record(sip_msg_t *msg, tps_data_t *td, int dialog) { int ret; @@ -311,8 +344,10 @@ int tps_storage_record(sip_msg_t *msg, tps_data_t *td) if(ret<0) goto error; ret = tps_storage_link_msg(msg, td, TPS_DIR_DOWNSTREAM); if(ret<0) goto error; - ret = tps_db_insert_dialog(td); - if(ret<0) goto error; + if(dialog==0) { + ret = tps_db_insert_dialog(td); + if(ret<0) goto error; + } ret = tps_db_insert_branch(td); if(ret<0) goto error; @@ -340,12 +375,15 @@ str td_col_a_tag = str_init("a_tag"); str td_col_b_tag = str_init("b_tag"); str td_col_a_rr = str_init("a_rr"); str td_col_b_rr = str_init("b_rr"); +str td_col_s_rr = str_init("s_rr"); str td_col_iflags = str_init("iflags"); str td_col_a_uri = str_init("a_uri"); str td_col_b_uri = str_init("b_uri"); str td_col_r_uri = str_init("r_uri"); -str td_col_a_srcip = str_init("a_srcip"); -str td_col_b_srcip = str_init("b_srcip"); +str td_col_a_srcaddr = str_init("a_srcaddr"); +str td_col_b_srcaddr = str_init("b_srcaddr"); +str td_col_s_method = str_init("s_method"); +str td_col_s_cseq = str_init("s_cseq"); str tt_table_name = str_init("topos_t"); str tt_col_rectime = str_init("rectime"); @@ -356,8 +394,12 @@ str tt_col_direction = str_init("direction"); str tt_col_x_via = str_init("x_via"); str tt_col_x_vbranch = str_init("x_vbranch"); str tt_col_x_rr = str_init("x_rr"); +str tt_col_y_rr = str_init("y_rr"); +str tt_col_s_rr = str_init("s_rr"); str tt_col_x_uri = str_init("x_uri"); str tt_col_x_tag = str_init("x_tag"); +str tt_col_s_method = str_init("s_method"); +str tt_col_s_cseq = str_init("s_cseq"); #define TPS_NR_KEYS 32 @@ -437,6 +479,11 @@ int tps_db_insert_dialog(tps_data_t *td) db_vals[nr_keys].val.str_val = TPS_STRZ(td->b_rr); nr_keys++; + db_keys[nr_keys] = &td_col_s_rr; + db_vals[nr_keys].type = DB1_STR; + db_vals[nr_keys].val.str_val = TPS_STRZ(td->s_rr); + nr_keys++; + db_keys[nr_keys] = &td_col_iflags; db_vals[nr_keys].type = DB1_INT; db_vals[nr_keys].val.int_val = td->iflags; @@ -457,14 +504,24 @@ int tps_db_insert_dialog(tps_data_t *td) db_vals[nr_keys].val.str_val = TPS_STRZ(td->r_uri); nr_keys++; - db_keys[nr_keys] = &td_col_a_srcip; + db_keys[nr_keys] = &td_col_a_srcaddr; + db_vals[nr_keys].type = DB1_STR; + db_vals[nr_keys].val.str_val = TPS_STRZ(td->a_srcaddr); + nr_keys++; + + db_keys[nr_keys] = &td_col_b_srcaddr; + db_vals[nr_keys].type = DB1_STR; + db_vals[nr_keys].val.str_val = TPS_STRZ(td->b_srcaddr); + nr_keys++; + + db_keys[nr_keys] = &td_col_s_method; db_vals[nr_keys].type = DB1_STR; - db_vals[nr_keys].val.str_val = TPS_STRZ(td->a_srcip); + db_vals[nr_keys].val.str_val = TPS_STRZ(td->s_method); nr_keys++; - db_keys[nr_keys] = &td_col_b_srcip; + db_keys[nr_keys] = &td_col_s_cseq; db_vals[nr_keys].type = DB1_STR; - db_vals[nr_keys].val.str_val = TPS_STRZ(td->b_srcip); + db_vals[nr_keys].val.str_val = TPS_STRZ(td->s_cseq); nr_keys++; if (_tpsdbf.use_table(_tps_db_handle, &td_table_name) < 0) { @@ -490,17 +547,18 @@ int tps_db_clean_dialogs(void) { db_key_t db_keys[2]; db_val_t db_vals[2]; - db_op_t db_ops[2] = { OP_LEQ }; + db_op_t db_ops[2]; int nr_keys; nr_keys = 0; LM_DBG("cleaning expired dialog records\n"); - db_keys[0] = &td_col_rectime; - db_vals[0].type = DB1_DATETIME; - db_vals[0].nul = 0; - db_vals[0].val.time_val = time(NULL) - _tps_dialog_expire; + db_keys[nr_keys] = &td_col_rectime; + db_ops[nr_keys] = OP_LEQ; + db_vals[nr_keys].type = DB1_DATETIME; + db_vals[nr_keys].nul = 0; + db_vals[nr_keys].val.time_val = time(NULL) - _tps_dialog_expire; nr_keys++; if (_tpsdbf.use_table(_tps_db_handle, &td_table_name) < 0) { @@ -511,6 +569,21 @@ int tps_db_clean_dialogs(void) if (_tpsdbf.delete(_tps_db_handle, db_keys, db_ops, db_vals, nr_keys) < 0) { LM_DBG("failed to clean expired dialog records\n"); } + + /* dialog not confirmed - delete dlg after branch expires */ + db_vals[0].val.time_val = time(NULL) - _tps_branch_expire; + + db_keys[nr_keys] = &td_col_iflags; + db_ops[nr_keys] = OP_EQ; + db_vals[nr_keys].type = DB1_INT; + db_vals[nr_keys].nul = 0; + db_vals[nr_keys].val.int_val = 0; + nr_keys++; + + if (_tpsdbf.delete(_tps_db_handle, db_keys, db_ops, db_vals, nr_keys) < 0) { + LM_DBG("failed to clean expired dialog records\n"); + } + return 0; } @@ -567,6 +640,16 @@ int tps_db_insert_branch(tps_data_t *td) db_vals[nr_keys].val.str_val = TPS_STRZ(td->x_rr); nr_keys++; + db_keys[nr_keys] = &tt_col_y_rr; + db_vals[nr_keys].type = DB1_STR; + db_vals[nr_keys].val.str_val = TPS_STRZ(td->y_rr); + nr_keys++; + + db_keys[nr_keys] = &tt_col_s_rr; + db_vals[nr_keys].type = DB1_STR; + db_vals[nr_keys].val.str_val = TPS_STRZ(td->s_rr); + nr_keys++; + db_keys[nr_keys] = &tt_col_x_uri; db_vals[nr_keys].type = DB1_STR; db_vals[nr_keys].val.str_val = TPS_STRZ(td->x_uri); @@ -577,6 +660,16 @@ int tps_db_insert_branch(tps_data_t *td) db_vals[nr_keys].val.str_val = TPS_STRZ(td->x_tag); nr_keys++; + db_keys[nr_keys] = &tt_col_s_method; + db_vals[nr_keys].type = DB1_STR; + db_vals[nr_keys].val.str_val = TPS_STRZ(td->s_method); + nr_keys++; + + db_keys[nr_keys] = &tt_col_s_cseq; + db_vals[nr_keys].type = DB1_STR; + db_vals[nr_keys].val.str_val = TPS_STRZ(td->s_cseq); + nr_keys++; + if (_tpsdbf.use_table(_tps_db_handle, &tt_table_name) < 0) { LM_ERR("failed to perform use table\n"); return -1; @@ -601,17 +694,18 @@ int tps_db_clean_branches(void) { db_key_t db_keys[2]; db_val_t db_vals[2]; - db_op_t db_ops[2] = { OP_LEQ }; + db_op_t db_ops[2]; int nr_keys; nr_keys = 0; LM_DBG("cleaning expired branch records\n"); - db_keys[0] = &tt_col_rectime; - db_vals[0].type = DB1_DATETIME; - db_vals[0].nul = 0; - db_vals[0].val.time_val = time(NULL) - _tps_branch_expire; + db_keys[nr_keys] = &tt_col_rectime; + db_ops[nr_keys] = OP_LEQ; + db_vals[nr_keys].type = DB1_DATETIME; + db_vals[nr_keys].nul = 0; + db_vals[nr_keys].val.time_val = time(NULL) - _tps_branch_expire; nr_keys++; if (_tpsdbf.use_table(_tps_db_handle, &tt_table_name) < 0) { @@ -705,8 +799,12 @@ int tps_storage_load_branch(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd) db_cols[nr_cols++] = &tt_col_x_via; db_cols[nr_cols++] = &tt_col_x_vbranch; db_cols[nr_cols++] = &tt_col_x_rr; + db_cols[nr_cols++] = &tt_col_y_rr; + db_cols[nr_cols++] = &tt_col_s_rr; db_cols[nr_cols++] = &tt_col_x_uri; db_cols[nr_cols++] = &tt_col_x_tag; + db_cols[nr_cols++] = &tt_col_s_method; + db_cols[nr_cols++] = &tt_col_s_cseq; if (_tpsdbf.use_table(_tps_db_handle, &tt_table_name) < 0) { LM_ERR("failed to perform use table\n"); @@ -736,8 +834,12 @@ int tps_storage_load_branch(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd) TPS_DATA_APPEND_DB(sd, db_res, n, &sd->x_via); n++; TPS_DATA_APPEND_DB(sd, db_res, n, &sd->x_vbranch1); n++; TPS_DATA_APPEND_DB(sd, db_res, n, &sd->x_rr); n++; + TPS_DATA_APPEND_DB(sd, db_res, n, &sd->y_rr); n++; + TPS_DATA_APPEND_DB(sd, db_res, n, &sd->s_rr); n++; TPS_DATA_APPEND_DB(sd, db_res, n, &sd->x_uri); n++; TPS_DATA_APPEND_DB(sd, db_res, n, &sd->x_tag); n++; + TPS_DATA_APPEND_DB(sd, db_res, n, &sd->s_method); n++; + TPS_DATA_APPEND_DB(sd, db_res, n, &sd->s_cseq); n++; if ((db_res!=NULL) && _tpsdbf.free_result(_tps_db_handle, db_res)<0) LM_ERR("failed to free result of query\n"); @@ -768,14 +870,39 @@ int tps_storage_load_dialog(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd) if(msg==NULL || md==NULL || sd==NULL || _tps_db_handle==NULL) return -1; + if(md->a_uuid.len<=0 && md->b_uuid.len<=0) { + LM_DBG("no dlg uuid provided\n"); + return -1; + } + nr_keys = 0; nr_cols = 0; - db_keys[nr_keys]=&td_col_a_uuid; db_ops[nr_keys]=OP_EQ; db_vals[nr_keys].type = DB1_STR; db_vals[nr_keys].nul = 0; - db_vals[nr_keys].val.str_val = TPS_STRZ(md->a_uuid); + db_vals[nr_keys].val.str_val.len = 0; + if(md->a_uuid.len>0) { + if(md->a_uuid.s[0]=='a') { + db_keys[nr_keys]=&td_col_a_uuid; + db_vals[nr_keys].val.str_val = TPS_STRZ(md->a_uuid); + } else if(md->a_uuid.s[0]=='b') { + db_keys[nr_keys]=&td_col_b_uuid; + db_vals[nr_keys].val.str_val = TPS_STRZ(md->a_uuid); + } + } else { + if(md->b_uuid.s[0]=='a') { + db_keys[nr_keys]=&td_col_a_uuid; + db_vals[nr_keys].val.str_val = TPS_STRZ(md->b_uuid); + } else if(md->b_uuid.s[0]=='b') { + db_keys[nr_keys]=&td_col_b_uuid; + db_vals[nr_keys].val.str_val = TPS_STRZ(md->b_uuid); + } + } + if(db_vals[nr_keys].val.str_val.len<=0) { + LM_ERR("invalid dlg uuid provided\n"); + return -1; + } nr_keys++; db_cols[nr_cols++] = &td_col_rectime; @@ -790,12 +917,15 @@ int tps_storage_load_dialog(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd) db_cols[nr_cols++] = &td_col_b_tag; db_cols[nr_cols++] = &td_col_a_rr; db_cols[nr_cols++] = &td_col_b_rr; + db_cols[nr_cols++] = &td_col_s_rr; db_cols[nr_cols++] = &td_col_iflags; db_cols[nr_cols++] = &td_col_a_uri; db_cols[nr_cols++] = &td_col_b_uri; db_cols[nr_cols++] = &td_col_r_uri; - db_cols[nr_cols++] = &td_col_a_srcip; - db_cols[nr_cols++] = &td_col_b_srcip; + db_cols[nr_cols++] = &td_col_a_srcaddr; + db_cols[nr_cols++] = &td_col_b_srcaddr; + db_cols[nr_cols++] = &td_col_s_method; + db_cols[nr_cols++] = &td_col_s_cseq; if (_tpsdbf.use_table(_tps_db_handle, &td_table_name) < 0) { @@ -830,12 +960,15 @@ int tps_storage_load_dialog(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd) TPS_DATA_APPEND_DB(sd, db_res, n, &sd->b_tag); n++; TPS_DATA_APPEND_DB(sd, db_res, n, &sd->a_rr); n++; TPS_DATA_APPEND_DB(sd, db_res, n, &sd->b_rr); n++; + TPS_DATA_APPEND_DB(sd, db_res, n, &sd->s_rr); n++; n++; /*iflags*/ TPS_DATA_APPEND_DB(sd, db_res, n, &sd->a_uri); n++; TPS_DATA_APPEND_DB(sd, db_res, n, &sd->b_uri); n++; TPS_DATA_APPEND_DB(sd, db_res, n, &sd->r_uri); n++; - TPS_DATA_APPEND_DB(sd, db_res, n, &sd->a_srcip); n++; - TPS_DATA_APPEND_DB(sd, db_res, n, &sd->b_srcip); n++; + TPS_DATA_APPEND_DB(sd, db_res, n, &sd->a_srcaddr); n++; + TPS_DATA_APPEND_DB(sd, db_res, n, &sd->b_srcaddr); n++; + TPS_DATA_APPEND_DB(sd, db_res, n, &sd->s_method); n++; + TPS_DATA_APPEND_DB(sd, db_res, n, &sd->s_cseq); n++; if ((db_res!=NULL) && _tpsdbf.free_result(_tps_db_handle, db_res)<0) LM_ERR("failed to free result of query\n"); @@ -849,6 +982,171 @@ int tps_storage_load_dialog(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd) return -1; } +/** + * + */ +int tps_storage_update_branch(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd) +{ + return 0; +} + +/** + * + */ +int tps_storage_update_dialog(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd) +{ + db_key_t db_keys[4]; + db_op_t db_ops[4]; + db_val_t db_vals[4]; + db_key_t db_ucols[TPS_NR_KEYS]; + db_val_t db_uvals[TPS_NR_KEYS]; + int nr_keys; + int nr_ucols; + int ret; + + if(msg==NULL || md==NULL || sd==NULL || _tps_db_handle==NULL) + return -1; + + if(md->s_method_id != METHOD_INVITE) { + return 0; + } + if(msg->first_line.u.reply.statuscode<200 + || msg->first_line.u.reply.statuscode>=300) { + return 0; + } + + + ret = tps_storage_link_msg(msg, md, md->direction); + if(ret<0) return -1; + + memset(db_ucols, 0, TPS_NR_KEYS*sizeof(db_key_t)); + memset(db_uvals, 0, TPS_NR_KEYS*sizeof(db_val_t)); + + nr_keys = 0; + nr_ucols = 0; + + db_keys[nr_keys]=&td_col_a_uuid; + db_ops[nr_keys]=OP_EQ; + db_vals[nr_keys].type = DB1_STR; + db_vals[nr_keys].nul = 0; + if(sd->a_uuid.len>0 && sd->a_uuid.s[0]=='a') { + db_vals[nr_keys].val.str_val = TPS_STRZ(sd->a_uuid); + } else { + if(sd->b_uuid.len<=0) { + LM_ERR("no valid dlg uuid\n"); + return -1; + } + db_vals[nr_keys].val.str_val = TPS_STRZ(sd->b_uuid); + } + nr_keys++; + + db_ucols[nr_ucols] = &td_col_b_contact; + db_uvals[nr_ucols].type = DB1_STR; + db_uvals[nr_ucols].val.str_val = TPS_STRZ(md->b_contact); + nr_ucols++; + + if(msg->first_line.type==SIP_REPLY) { + if(sd->b_tag.len<=0 + && msg->first_line.u.reply.statuscode>=200 + && msg->first_line.u.reply.statuscode<300) { + + if((sd->iflags&TPS_IFLAG_DLGON) == 0) { + db_ucols[nr_ucols] = &td_col_b_rr; + db_uvals[nr_ucols].type = DB1_STR; + db_uvals[nr_ucols].val.str_val = TPS_STRZ(md->b_rr); + nr_ucols++; + } + + db_ucols[nr_ucols] = &td_col_b_tag; + db_uvals[nr_ucols].type = DB1_STR; + db_uvals[nr_ucols].val.str_val = TPS_STRZ(md->b_tag); + nr_ucols++; + + db_ucols[nr_ucols] = &td_col_iflags; + db_uvals[nr_ucols].type = DB1_INT; + db_uvals[nr_ucols].val.int_val = sd->iflags|TPS_IFLAG_DLGON; + nr_ucols++; + } + } + if (_tpsdbf.use_table(_tps_db_handle, &td_table_name) < 0) { + LM_ERR("failed to perform use table\n"); + return -1; + } + + if(_tpsdbf.update(_tps_db_handle, db_keys, db_ops, db_vals, + db_ucols, db_uvals, nr_keys, nr_ucols)!=0) { + LM_ERR("failed to do db update for [%.*s]!\n", + md->a_uuid.len, md->a_uuid.s); + return -1; + } + return 0; +} + +/** + * + */ +int tps_storage_end_dialog(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd) +{ + db_key_t db_keys[4]; + db_op_t db_ops[4]; + db_val_t db_vals[4]; + db_key_t db_ucols[TPS_NR_KEYS]; + db_val_t db_uvals[TPS_NR_KEYS]; + int nr_keys; + int nr_ucols; + + if(msg==NULL || md==NULL || sd==NULL || _tps_db_handle==NULL) + return -1; + + if(md->s_method_id != METHOD_BYE) { + return 0; + } + + memset(db_ucols, 0, TPS_NR_KEYS*sizeof(db_key_t)); + memset(db_uvals, 0, TPS_NR_KEYS*sizeof(db_val_t)); + + nr_keys = 0; + nr_ucols = 0; + + db_keys[nr_keys]=&td_col_a_uuid; + db_ops[nr_keys]=OP_EQ; + db_vals[nr_keys].type = DB1_STR; + db_vals[nr_keys].nul = 0; + if(sd->a_uuid.len>0 && sd->a_uuid.s[0]=='a') { + db_vals[nr_keys].val.str_val = TPS_STRZ(sd->a_uuid); + } else { + if(sd->b_uuid.len<=0) { + LM_ERR("no valid dlg uuid\n"); + return -1; + } + db_vals[nr_keys].val.str_val = TPS_STRZ(sd->b_uuid); + } + nr_keys++; + + db_ucols[nr_ucols] = &td_col_rectime; + db_uvals[nr_ucols].type = DB1_DATETIME; + db_uvals[nr_ucols].val.time_val = time(NULL); + nr_ucols++; + + db_ucols[nr_ucols] = &td_col_iflags; + db_uvals[nr_ucols].type = DB1_INT; + db_uvals[nr_ucols].val.int_val = 0; + nr_ucols++; + + if (_tpsdbf.use_table(_tps_db_handle, &td_table_name) < 0) { + LM_ERR("failed to perform use table\n"); + return -1; + } + + if(_tpsdbf.update(_tps_db_handle, db_keys, db_ops, db_vals, + db_ucols, db_uvals, nr_keys, nr_ucols)!=0) { + LM_ERR("failed to do db update for [%.*s]!\n", + md->a_uuid.len, md->a_uuid.s); + return -1; + } + return 0; +} + /** * */ diff --git a/modules/topos/tps_storage.h b/modules/topos/tps_storage.h index ce36273a199..ad370489f84 100644 --- a/modules/topos/tps_storage.h +++ b/modules/topos/tps_storage.h @@ -34,6 +34,9 @@ #define TPS_DIR_DOWNSTREAM 0 #define TPS_DIR_UPSTREAM 1 +#define TPS_IFLAG_INIT 1 +#define TPS_IFLAG_DLGON 2 + #define TPS_DATA_SIZE 8192 typedef struct tps_data { char cbuf[TPS_DATA_SIZE]; @@ -43,6 +46,7 @@ typedef struct tps_data { str a_callid; str a_rr; str b_rr; + str s_rr; str a_contact; str b_contact; str as_contact; @@ -52,17 +56,23 @@ typedef struct tps_data { str a_uri; str b_uri; str r_uri; - str a_srcip; - str b_srcip; + str a_srcaddr; + str b_srcaddr; + str a_socket; + str b_socket; str x_via1; str x_via2; str x_vbranch1; str x_via; str x_tag; str x_rr; + str y_rr; str x_uri; + str s_method; + str s_cseq; int32_t iflags; int32_t direction; + uint32_t s_method_id; } tps_data_t; int tps_storage_dialog_find(sip_msg_t *msg, tps_data_t *td); @@ -73,9 +83,12 @@ int tps_storage_branch_find(sip_msg_t *msg, tps_data_t *td); int tps_storage_branch_save(sip_msg_t *msg, tps_data_t *td); int tps_storage_branch_rm(sip_msg_t *msg, tps_data_t *td); -int tps_storage_record(sip_msg_t *msg, tps_data_t *td); +int tps_storage_record(sip_msg_t *msg, tps_data_t *td, int dialog); int tps_storage_load_branch(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd); +int tps_storage_update_branch(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd); int tps_storage_load_dialog(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd); +int tps_storage_update_dialog(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd); +int tps_storage_end_dialog(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd); int tps_storage_lock_set_init(void); int tps_storage_lock_get(str *lkey); diff --git a/modules/tsilo/ts_rpc.c b/modules/tsilo/ts_rpc.c index 20783f487ef..7a3b6595a7a 100644 --- a/modules/tsilo/ts_rpc.c +++ b/modules/tsilo/ts_rpc.c @@ -45,6 +45,9 @@ static inline int rpc_dump_transaction(rpc_t* rpc, void* ctx, void *ih, ts_trans { void* vh; + if(t==NULL) + return -1; + if(rpc->struct_add(ih, "{", "Transaction", &vh)<0) { rpc->fault(ctx, 500, "Internal error creating transaction struct"); @@ -73,9 +76,9 @@ static inline int rpc_dump_transaction(rpc_t* rpc, void* ctx, void *ih, ts_trans */ static void rpc_tsilo_dump(rpc_t *rpc, void *c) { - ts_transaction_t* trans; - struct ts_urecord* record; - struct ts_entry* entry; + ts_transaction_t* trans = NULL; + struct ts_urecord* record = NULL; + struct ts_entry* entry = NULL; str brief = {0, 0}; @@ -115,8 +118,8 @@ static void rpc_tsilo_dump(rpc_t *rpc, void *c) /* add the entries per hash */ for(i=0,n=0,max=0,ntrans=0; isize; i++) { + lock_entry(&t_table->entries[i]); entry = &t_table->entries[i]; - lock_entry(entry); n += entry->n; if(maxn) @@ -130,7 +133,7 @@ static void rpc_tsilo_dump(rpc_t *rpc, void *c) "Hash", record->rurihash, "Transactions", &ih)<0) { - unlock_entry(entry); + unlock_entry(&t_table->entries[i]); rpc->fault(c, 500, "Internal error creating ruri struct"); return; } @@ -139,13 +142,13 @@ static void rpc_tsilo_dump(rpc_t *rpc, void *c) ntrans += 1; if (short_dump==0) { if (rpc_dump_transaction(rpc, c, ih, trans) == -1) { - unlock_entry(entry); + unlock_entry(&t_table->entries[i]); return; } } } } - unlock_entry(entry); + unlock_entry(&t_table->entries[i]); } /* extra attributes node */ diff --git a/modules/uac/README b/modules/uac/README index b2842afcb88..c9b6dc4fbd0 100644 --- a/modules/uac/README +++ b/modules/uac/README @@ -836,9 +836,8 @@ event_route[uac:reply] { 8.6. uac.reg_refresh Load one record by l_uuid from database for remote registrations. If - the record exists in memory, its authentication password is updated, - otherwise a new record is added. The command has a parameter, which is - the value of l_uuid field. + the record exists in memory, it will be replaced with the new values + loaded from database. Example 1.33. uac.reg_refresh usage ... diff --git a/modules/uac/auth.c b/modules/uac/auth.c index 7b8e6ed5e2e..e0b42fc6299 100644 --- a/modules/uac/auth.c +++ b/modules/uac/auth.c @@ -30,6 +30,8 @@ #include "../../mem/mem.h" #include "../../hashes.h" #include "../../dset.h" +#include "../../srapi.h" +#include "../../parser/parse_cseq.h" #include "../../modules/tm/tm_load.h" #include "auth.h" @@ -369,7 +371,7 @@ static inline int apply_urihdr_changes( struct sip_msg *req, -int uac_auth( struct sip_msg *msg) +int uac_auth(sip_msg_t *msg) { static struct authenticate_body auth; struct uac_credential *crd; @@ -379,6 +381,7 @@ int uac_auth( struct sip_msg *msg) struct hdr_field *hdr; HASHHEX response; str *new_hdr; + sr_cfgenv_t *cenv = NULL; /* get transaction */ t = uac_tmb.t_gett(); @@ -465,7 +468,15 @@ int uac_auth( struct sip_msg *msg) /* mark request in T with uac auth for increase of cseq via dialog * - this function is executed in failure route, msg_flags will be * reset afterwards by tm fake env */ - if(t->uas.request) t->uas.request->msg_flags |= FL_UAC_AUTH; + if(t->uas.request) { + t->uas.request->msg_flags |= FL_UAC_AUTH; + cenv = sr_cfgenv_get(); + if(cenv->cb_cseq_update != NULL) { + if(cenv->cb_cseq_update(msg)<0) { + goto error; + } + } + } return 0; error: diff --git a/modules/uac/doc/uac_admin.xml b/modules/uac/doc/uac_admin.xml index db5f695f6ba..254f471de2c 100644 --- a/modules/uac/doc/uac_admin.xml +++ b/modules/uac/doc/uac_admin.xml @@ -995,9 +995,8 @@ event_route[uac:reply] { Load one record by l_uuid from database for remote registrations. - If the record exists in memory, its authentication password is - updated, otherwise a new record is added. The command has a - parameter, which is the value of l_uuid field. + If the record exists in memory, it will be replaced with the new + values loaded from database. <function>uac.reg_refresh</function> usage diff --git a/modules/uac/replace.c b/modules/uac/replace.c index f0bd4718645..c6a8dcc4781 100644 --- a/modules/uac/replace.c +++ b/modules/uac/replace.c @@ -182,8 +182,7 @@ static inline int decode_uri( str *src , str *dst) static inline struct lump* get_display_anchor(struct sip_msg *msg, - struct hdr_field *hdr, struct to_body *body, str - *dsp) + struct hdr_field *hdr, struct to_body *body, str *dsp) { struct lump* l; char *p1; @@ -237,7 +236,7 @@ static inline struct lump* get_display_anchor(struct sip_msg *msg, * replace uri and/or display name in FROM / TO header */ int replace_uri( struct sip_msg *msg, str *display, str *uri, - struct hdr_field *hdr, str *rr_param, str* restore_avp, int check_from) + struct hdr_field *hdr, str *rr_param, str* restore_avp, int check_from) { static char buf_s[MAX_URI_SIZE]; struct to_body *body; @@ -285,13 +284,16 @@ int replace_uri( struct sip_msg *msg, str *display, str *uri, avp_value.s.len = p - body->body.s + ((p[i]=='>') ? (i+1) : 0) ; avp_value.s.s=body->body.s; - LM_DBG("value to store is is '%.*s' and len is '%d'\n",avp_value.s.len, avp_value.s.s,avp_value.s.len); + LM_DBG("value to store is is '%.*s' and len is '%d'\n", + avp_value.s.len, avp_value.s.s,avp_value.s.len); if(check_from) { - LM_DBG("Storing in FROM-AVP (for use in reply): '%.*s' with len '%d'\n",avp_value.s.len, avp_value.s.s,avp_value.s.len); + LM_DBG("Storing in FROM-AVP (for use in reply): '%.*s' with len '%d'\n", + avp_value.s.len, avp_value.s.s,avp_value.s.len); add_avp(restore_from_avp_type, restore_from_avp_name, avp_value); } else { - LM_DBG("Storing in TO-AVP (for use in reply): '%.*s' with len '%d'\n",avp_value.s.len, avp_value.s.s,avp_value.s.len); + LM_DBG("Storing in TO-AVP (for use in reply): '%.*s' with len '%d'\n", + avp_value.s.len, avp_value.s.s,avp_value.s.len); add_avp(restore_to_avp_type, restore_to_avp_name, avp_value); } } @@ -304,9 +306,10 @@ int replace_uri( struct sip_msg *msg, str *display, str *uri, /* first remove the existing display */ if ( body->display.len) { - LM_DBG("removing display [%.*s]\n", body->display.len,body->display.s); + LM_DBG("removing display [%.*s]\n", + body->display.len, body->display.s); /* build del lump */ - l = del_lump( msg, body->display.s-msg->buf, body->display.len, 0); + l = del_lump(msg, body->display.s-msg->buf, body->display.len, 0); if (l==0) { LM_ERR("display del lump failed\n"); @@ -323,9 +326,9 @@ int replace_uri( struct sip_msg *msg, str *display, str *uri, LM_ERR("no more pkg mem\n"); goto error; } - memcpy( buf.s, display->s, display->len); - buf.len = display->len; - if (l==0 && (l=get_display_anchor(msg,hdr,body,&buf))==0) + memcpy( buf.s, display->s, display->len); + buf.len = display->len; + if (l==0 && (l=get_display_anchor(msg,hdr,body,&buf))==0) { LM_ERR("failed to insert anchor\n"); goto error; @@ -399,10 +402,13 @@ int replace_uri( struct sip_msg *msg, str *display, str *uri, goto error; } LM_DBG("Stored <%.*s> var in dialog with value %.*s\n", - dlgvar_names[0].len, dlgvar_names[0].s, body->uri.len, body->uri.s); + dlgvar_names[0].len, dlgvar_names[0].s, + body->uri.len, body->uri.s); - if (dlg_api.register_dlgcb(dlg, DLGCB_REQ_WITHIN|DLGCB_CONFIRMED|DLGCB_TERMINATED, - (void*)(unsigned long)replace_callback, (void*)(unsigned long)uac_flag, 0) != 0) { + if (dlg_api.register_dlgcb(dlg, + DLGCB_REQ_WITHIN|DLGCB_CONFIRMED|DLGCB_TERMINATED, + (void*)(unsigned long)replace_callback, + (void*)(unsigned long)uac_flag, 0) != 0) { LM_ERR("cannot register callback\n"); dlg_api.release_dlg(dlg); goto error; @@ -427,7 +433,7 @@ int replace_uri( struct sip_msg *msg, str *display, str *uri, buf.s = buf_s; if ( body->uri.len>uri->len ) { if (body->uri.len>MAX_URI_SIZE) { - LM_ERR("old %.*s uri too long\n",hdr->name.len,hdr->name.s); + LM_ERR("old %.*s uri too long\n",hdr->name.len,hdr->name.s); goto error; } memcpy( buf.s, body->uri.s, body->uri.len); @@ -508,14 +514,15 @@ int replace_uri( struct sip_msg *msg, str *display, str *uri, * return 0 - restored * -1 - not restored or error */ -int restore_uri( struct sip_msg *msg, str *rr_param, str* restore_avp, int check_from) +int restore_uri( struct sip_msg *msg, str *rr_param, str* restore_avp, + int check_from) { struct lump* l; str param_val; str add_to_rr = {0, 0}; struct to_body* old_body; - str old_uri; - str new_uri; + str old_uri = {0, 0}; + str new_uri = {0, 0}; char *p; int i; int_str avp_value; @@ -547,24 +554,26 @@ int restore_uri( struct sip_msg *msg, str *rr_param, str* restore_avp, int check LM_ERR("no more pkg mem\n"); goto failed; } - add_to_rr.len = sprintf(add_to_rr.s, ";%.*s=%.*s", rr_param->len,rr_param->s,param_val.len,param_val.s); + add_to_rr.len = sprintf(add_to_rr.s, ";%.*s=%.*s", + rr_param->len, rr_param->s, param_val.len, param_val.s); if ( uac_rrb.add_rr_param(msg, &add_to_rr)!=0 ) { LM_ERR("add rr param failed\n"); goto failed; } pkg_free(add_to_rr.s); + add_to_rr.s = NULL; - /* dencrypt parameter ;) */ - if (uac_passwd.len) + /* decrypt parameter */ + if (uac_passwd.len) { for( i=0 ; ito==0 && (parse_headers(msg,HDR_TO_F,0)!=0 || msg->to==0) ) { LM_ERR("failed to parse TO hdr\n"); @@ -592,10 +601,12 @@ int restore_uri( struct sip_msg *msg, str *rr_param, str* restore_avp, int check avp_value.s.s=old_body->body.s; if(flag==FL_USE_UAC_FROM) { - LM_DBG("Storing in FROM-AVP (for use in reply): '%.*s' with len '%d'\n",avp_value.s.len, avp_value.s.s,avp_value.s.len); + LM_DBG("Storing in FROM-AVP (for use in reply): '%.*s' with len '%d'\n", + avp_value.s.len, avp_value.s.s,avp_value.s.len); add_avp(restore_from_avp_type, restore_from_avp_name, avp_value); } else { - LM_DBG("Storing in TO-AVP (for use in reply): '%.*s' with len '%d'\n",avp_value.s.len, avp_value.s.s,avp_value.s.len); + LM_DBG("Storing in TO-AVP (for use in reply): '%.*s' with len '%d'\n", + avp_value.s.len, avp_value.s.s,avp_value.s.len); add_avp(restore_to_avp_type, restore_to_avp_name, avp_value); } } @@ -620,6 +631,16 @@ int restore_uri( struct sip_msg *msg, str *rr_param, str* restore_avp, int check goto failed; } + /* check if new uri has valid characters */ + for(i=0; i replace in reply */ - /* in callback we need TO/FROM to be parsed- it's already done + /* in callback we need TO/FROM to be parsed- it's already done * by restore_from_to() function */ if ( uac_tmb.register_tmcb( msg, 0, TMCB_RESPONSE_IN, restore_uris_reply, 0, 0)!=1 ) { @@ -680,7 +701,7 @@ void rr_checker(struct sip_msg *msg, str *r_param, void *cb_param) /* replace the entire HDR with the original request */ static inline int restore_uri_reply(struct sip_msg *rpl, - struct hdr_field *rpl_hdr, struct hdr_field *req_hdr, str* stored_value) + struct hdr_field *rpl_hdr, struct hdr_field *req_hdr, str* stored_value) { struct lump* l; @@ -758,13 +779,14 @@ void restore_uris_reply(struct cell* t, int type, struct tmcb_params *p) /* parse FROM in reply */ if (parse_from_header( rpl )<0 ) { - LM_ERR("failed to find/parse FROM hdr\n"); + LM_ERR("failed to find/parse FROM hdr\n"); return; } avp_value.s.len=0; if(restore_from_avp.s) { - search_first_avp(restore_from_avp_type, restore_from_avp_name, &avp_value,0); + search_first_avp(restore_from_avp_type, restore_from_avp_name, + &avp_value,0); } if (restore_uri_reply( rpl, rpl->from, req->from, &avp_value.s)) { @@ -776,18 +798,19 @@ void restore_uris_reply(struct cell* t, int type, struct tmcb_params *p) if (req->msg_flags & FL_USE_UAC_TO ) { /* parse TO in reply */ - if ( rpl->to==0 && (parse_headers(rpl,HDR_TO_F,0)!=0 || rpl->to==0) ) { + if ( rpl->to==0 && (parse_headers(rpl,HDR_TO_F,0)!=0 || rpl->to==0) ) { LM_ERR("failed to parse TO hdr\n"); return; } avp_value.s.len=0; if(restore_to_avp.s) { - search_first_avp(restore_to_avp_type, restore_to_avp_name, &avp_value,0); + search_first_avp(restore_to_avp_type, restore_to_avp_name, + &avp_value, 0); } if (restore_uri_reply( rpl, rpl->to, req->to, &avp_value.s)) { - LM_ERR("failed to restore TO\n"); + LM_ERR("failed to restore TO\n"); } } @@ -819,8 +842,9 @@ static void replace_callback(struct dlg_cell *dlg, int type, dlgvar_names = (uac_flag==FL_USE_UAC_FROM)?from_dlgvar:to_dlgvar; /* check the request direction */ - if ( ((uac_flag == FL_USE_UAC_TO) && _params->direction == DLG_DIR_DOWNSTREAM) || - ((uac_flag != FL_USE_UAC_TO) && _params->direction == DLG_DIR_UPSTREAM) ) { + if ( ((uac_flag == FL_USE_UAC_TO) && _params->direction == DLG_DIR_DOWNSTREAM) + || ((uac_flag != FL_USE_UAC_TO) + && _params->direction == DLG_DIR_UPSTREAM) ) { /* replace the TO URI */ if ( msg->to==0 && (parse_headers(msg,HDR_TO_F,0)!=0 || msg->to==0) ) { LM_ERR("failed to parse TO hdr\n"); @@ -874,7 +898,8 @@ static void replace_callback(struct dlg_cell *dlg, int type, goto free; } - /* register tm callback to change replies but only if not registered earlier */ + /* register tm callback to change replies, + * but only if not registered earlier */ if (!(msg->msg_flags & (FL_USE_UAC_FROM|FL_USE_UAC_TO)) && uac_tmb.register_tmcb( msg, 0, TMCB_RESPONSE_IN, restore_uris_reply, 0, 0) != 1 ) { diff --git a/modules/uac/uac_reg.c b/modules/uac/uac_reg.c index 8ff63bdef28..467a59e511c 100644 --- a/modules/uac/uac_reg.c +++ b/modules/uac/uac_reg.c @@ -600,7 +600,10 @@ int reg_ht_update_attrs(reg_uac_t *reg) strncpy(ri->r->auth_proxy.s, reg->auth_proxy.s, reg->auth_proxy.len); ri->r->auth_proxy.len = reg->auth_proxy.len; ri->r->auth_proxy.s[reg->auth_proxy.len] = '\0'; - if(reg->flags & UAC_REG_DISABLED) ri->r->flags |= UAC_REG_DISABLED; + if(reg->flags & UAC_REG_DISABLED) + ri->r->flags |= UAC_REG_DISABLED; + else + ri->r->flags &= ~UAC_REG_DISABLED; lock_release(&_reg_htable->entries[slot].lock); return 0; } @@ -660,7 +663,7 @@ reg_uac_t *reg_ht_get_byuser(str *user, str *domain) it = _reg_htable->entries[slot].byuser; while(it) { - if((it->r->h_uuid==hash) && (it->r->l_username.len==user->len) + if((it->r->h_user==hash) && (it->r->l_username.len==user->len) && (strncmp(it->r->l_username.s, user->s, user->len)==0)) { if(domain!=NULL && domain->s!=NULL) @@ -812,6 +815,10 @@ void uac_reg_tm_callback( struct cell *t, int type, struct tmcb_params *ps) goto done; } } + + LM_DBG("sip response %d while registering [%.*s] with no match\n", + ps->code, ri->l_uuid.len, ri->l_uuid.s); + goto done; } if(ps->code == 401 || ps->code == 407) @@ -848,7 +855,7 @@ void uac_reg_tm_callback( struct cell *t, int type, struct tmcb_params *ps) } } cred.realm = auth.realm; - cred.user = ri->auth_username; + cred.user = ri->auth_username; cred.passwd = ri->auth_password; cred.next = NULL; @@ -917,8 +924,7 @@ void uac_reg_tm_callback( struct cell *t, int type, struct tmcb_params *ps) ri->flags |= UAC_REG_AUTHSENT; return; - } else - { + } else { LM_ERR("got sip response %d while registering [%.*s]\n", ps->code, ri->l_uuid.len, ri->l_uuid.s); goto error; @@ -1079,7 +1085,7 @@ void uac_reg_timer(unsigned int ticks) if(reg.attr.len == 0) { \ LM_ERR("empty value not allowed for column[%d]='%.*s' - ignoring record\n", \ pos, db_cols[pos]->len, db_cols[pos]->s); \ - continue; \ + goto nextrec; \ } \ } \ } while(0); @@ -1162,7 +1168,7 @@ int uac_reg_load_db(void) } } else { if((ret=reg_dbf.query(reg_db_con, NULL, NULL, NULL, db_cols, - 0, 10, 0, &db_res))!=0 + 0, 12, 0, &db_res))!=0 || RES_ROW_N(db_res)<=0 ) { reg_dbf.free_result(reg_db_con, db_res); @@ -1178,7 +1184,7 @@ int uac_reg_load_db(void) do { for(i=0; i - Copyright 2002, 2003 FhG FOKUS - _________________________________________________________________ + Copyright © 2002, 2003 FhG FOKUS + __________________________________________________________________ Table of Contents @@ -75,16 +74,16 @@ Chapter 1. Admin Guide 1. Overview - This module contains all authentication related functions that need - the access to the database. This module should be used together with - auth module, it cannot be used independently because it depends on the - module. Select this module if you want to use database to store + This module contains all authentication related functions that need the + access to the database. This module should be used together with auth + module, it cannot be used independently because it depends on the + module. Select this module if you want to use database to store authentication information like subscriber usernames and passwords. If you want to use radius authentication, then use auth_radius instead. 2. Dependencies - The module depends on the following modules (in the other words the + The module depends on the following modules (in the other words the listed modules must be loaded before this module): * auth. Generic authentication functions. * database. Any database module (currently mysql, postgres, dbtext) @@ -104,11 +103,10 @@ Chapter 1. Admin Guide 3.1. db_url (string) This is URL of the database to be used. Value of the parameter depends - on the database module used. For example for mysql and postgres - modules this is something like - mysql://username:password@host:port/database. For dbtext module (which - stores data in plaintext files) it is directory in which the database - resides. + on the database module used. For example for mysql and postgres modules + this is something like mysql://username:password@host:port/database. + For dbtext module (which stores data in plaintext files) it is + directory in which the database resides. Default value is "mysql://serro:47serro11@localhost/ser". @@ -117,9 +115,8 @@ modparam("auth_db", "db_url", "mysql://foo:bar@foobar.org/ser") 3.2. user_column (string) - This is the name of the column holding usernames. Default value is - fine for most people. Use the parameter if you really need to change - it. + This is the name of the column holding usernames. Default value is fine + for most people. Use the parameter if you really need to change it. Default value is "username". @@ -129,8 +126,8 @@ modparam("auth_db", "user_column", "user") 3.3. domain_column (string) This is the name of the column holding domains of users. Default value - is fine for most people. Use the parameter if you really need to - change it. + is fine for most people. Use the parameter if you really need to change + it. Default value is "domain". @@ -139,10 +136,10 @@ modparam("auth_db", "domain_column", "domain") 3.4. password_column (string) - This is the name of the column holding passwords. Passwords can be + This is the name of the column holding passwords. Passwords can be either stored as plain text or pre-calculated HA1 strings. HA1 strings - are MD5 hashes of username, password, and realm. HA1 strings are more - safe because the server doesn't need to know plaintext passwords and + are MD5 hashes of username, password, and realm. HA1 strings are more + safe because the server doesn't need to know plaintext passwords and they cannot be obtained from HA1 strings. Default value is "ha1". @@ -152,8 +149,8 @@ modparam("auth_db", "password_column", "password") 3.5. rpid_column (string) - This is the name of the column holding information for the - Remote-Party-ID header field. Default value is fine for most people. + This is the name of the column holding information for the + Remote-Party-ID header field. Default value is fine for most people. Use the parameter if you really need to change it. Default value is "rpid". @@ -163,24 +160,24 @@ modparam("auth_db", "rpid_column", "remote_party_id") 3.6. calculate_ha1 (integer) - This parameter tells server whether it should read plaintext password + This parameter tells server whether it should read plaintext password from the database or HA1 string. If the parameter is set to 1 then the server will assume that the column pointed to by plain_password_column - contains plaintext passwords and it will calculate HA1 strings on the + contains plaintext passwords and it will calculate HA1 strings on the fly. If the parameter is set to 0 then the server assumes that the database - contains HA1 strings directly and will not calculate them. In this - case it will use value of password_column as name of column with HA1 - password. If username parameter of credentials contains also @domain - (some user agents put domain in username parameter), then column - pointed to by password_column_2 parameter will be used instead. This - column should also contain HA1 strings but they should be calculated - including the domain in the username parameter (as opposed to - password_column which (when containing HA1 strings) should always + contains HA1 strings directly and will not calculate them. In this case + it will use value of password_column as name of column with HA1 + password. If username parameter of credentials contains also @domain + (some user agents put domain in username parameter), then column + pointed to by password_column_2 parameter will be used instead. This + column should also contain HA1 strings but they should be calculated + including the domain in the username parameter (as opposed to + password_column which (when containing HA1 strings) should always contains HA1 strings calculated without domain in username. - This ensures that the authentication will always work when using + This ensures that the authentication will always work when using pre-calculated HA1 string, not depending on the presence of the domain in username. @@ -191,7 +188,7 @@ modparam("auth_db", "calculate_ha1", 1) 3.7. plain_password_column (string) - This parameter holds the name of column holding plain text password. + This parameter holds the name of column holding plain text password. This column is used when calculate_ha1 is set. Default value is "password". @@ -201,9 +198,9 @@ modparam("auth_db", "plain_password_column", "password") 3.8. password_column_2 (string) - As described in the previous section this parameter contains name of - column holding pre-calculated HA1 string that were calculated - including the domain in the username. This parameter is used only when + As described in the previous section this parameter contains name of + column holding pre-calculated HA1 string that were calculated including + the domain in the username. This parameter is used only when calculate_ha1 is set to 0 and user agent send a credentials containing the domain in the username. @@ -214,10 +211,10 @@ modparam("auth_db", "password_column_2", "ha1_2") 3.9. use_rpid (integer) - This parameter specifies whether the server should fetch a value for + This parameter specifies whether the server should fetch a value for the Remote-Party-ID header field from the database. - If the parameter is set to 1 the server expects to find a value for + If the parameter is set to 1 the server expects to find a value for this header in the column specified by the rpid_column parameter. Default value of this parameter is 0. @@ -232,24 +229,24 @@ modparam("auth_db", "use_rpid", 1) 4.1. www_authorize(realm, table) - The function verifies credentials according to RFC2617. If the - credentials are verified successfully then the function will succeed - and mark the credentials as authorized (marked credentials can be - later used by some other functions). If the function was unable to - verify the credentials for some reason then it will fail and the - script should call www_challenge which will challenge the user again. + The function verifies credentials according to RFC2617. If the + credentials are verified successfully then the function will succeed + and mark the credentials as authorized (marked credentials can be later + used by some other functions). If the function was unable to verify the + credentials for some reason then it will fail and the script should + call www_challenge which will challenge the user again. Meaning of the parameters is as follows: - * realm. Realm is a opaque string that the user agent should - present to the user so he can decide what username and password to - use. Usually this is domain of the host the server is running on. - If an empty string "" is used then the server will generate it - from the request. In case of REGISTER requests To header field - domain will be used (because this header field represents a user - being registered), for all other messages From header field domain - will be used. - * table. Table to be used to lookup usernames and passwords - (usually subscribers table). + * realm. Realm is a opaque string that the user agent should present + to the user so he can decide what username and password to use. + Usually this is domain of the host the server is running on. If an + empty string "" is used then the server will generate it from the + request. In case of REGISTER requests To header field domain will + be used (because this header field represents a user being + registered), for all other messages From header field domain will + be used. + * table. Table to be used to lookup usernames and passwords (usually + subscribers table). Example 1.10. www_authorize usage ... @@ -260,22 +257,21 @@ if (www_authorize("iptel.org", "subscriber")) { 4.2. proxy_authorize(realm, table) - The function verifies credentials according to RFC2617. If the - credentials are verified successfully then the function will succeed - and mark the credentials as authorized (marked credentials can be - later used by some other functions). If the function was unable to - verify the credentials for some reason then it will fail and the - script should call proxy_challenge which will challenge the user - again. + The function verifies credentials according to RFC2617. If the + credentials are verified successfully then the function will succeed + and mark the credentials as authorized (marked credentials can be later + used by some other functions). If the function was unable to verify the + credentials for some reason then it will fail and the script should + call proxy_challenge which will challenge the user again. Meaning of the parameters is as follows: - * realm - Realm is a opaque string that the user agent should - present to the user so he can decide what username and password to - use. Usually this is domain of the host the server is running on. - If an empty string "" is used then the server will generate it - from the request. From header field domain will be used as realm. - * table - Table to be used to lookup usernames and passwords - (usually subscribers table). + * realm - Realm is a opaque string that the user agent should present + to the user so he can decide what username and password to use. + Usually this is domain of the host the server is running on. + If an empty string "" is used then the server will generate it from + the request. From header field domain will be used as realm. + * table - Table to be used to lookup usernames and passwords (usually + subscribers table). Example 1.11. proxy_authorize usage ... diff --git a/modules/uid_avp_db/Makefile b/modules/uid_avp_db/Makefile index 0b9a74c2252..2b08ae25044 100644 --- a/modules/uid_avp_db/Makefile +++ b/modules/uid_avp_db/Makefile @@ -8,7 +8,6 @@ include ../../Makefile.defs auto_gen= NAME=uid_avp_db.so LIBS= -DEFS += -Wall DEFS+=-DSER_MOD_INTERFACE diff --git a/modules/uid_avp_db/README b/modules/uid_avp_db/README index a8eb8ca9fba..d5a1803a4ec 100644 --- a/modules/uid_avp_db/README +++ b/modules/uid_avp_db/README @@ -1,4 +1,3 @@ - UID AVP DB Module Jiri Kuthan @@ -6,8 +5,8 @@ Jiri Kuthan FhG FOKUS - Copyright 2004, 2005 FhG FOKUS - _________________________________________________________________ + Copyright © 2004, 2005 FhG FOKUS + __________________________________________________________________ Table of Contents @@ -81,22 +80,22 @@ Chapter 1. Admin Guide 1. Overview - This module contains several functions that can be used to manipulate - the contents of AVPs (Attribute-Value pairs). The AVPs are variables - attached to the SIP message being processed. Each variable has its - name and value. AVPs can be used to store arbitrary data or as a means - of inter-module comminication. + This module contains several functions that can be used to manipulate + the contents of AVPs (Attribute-Value pairs). The AVPs are variables + attached to the SIP message being processed. Each variable has its name + and value. AVPs can be used to store arbitrary data or as a means of + inter-module comminication. - You may also want to check the avpops module which is more flexible - and contains more functions. In future SER releases the avp module - will be probably deprecated in favor of avpops module. + You may also want to check the avpops module which is more flexible and + contains more functions. In future SER releases the avp module will be + probably deprecated in favor of avpops module. - Domain module operates in caching mode. Domain module reads the - default values of AVPs into cache memory when the module is loaded. - After that default values is re-read only when module is given - avp_list_reload fifo command. Any changes in usr_preferences_types - table must thus be followed by avp_list_reload command in order to - reflect them in module behavior. + Domain module operates in caching mode. Domain module reads the default + values of AVPs into cache memory when the module is loaded. After that + default values is re-read only when module is given avp_list_reload + fifo command. Any changes in usr_preferences_types table must thus be + followed by avp_list_reload command in order to reflect them in module + behavior. 2. Dependencies @@ -144,7 +143,7 @@ Chapter 1. Admin Guide 3.5. username_column (string) - Name of the column containing the username of the subscriber in uri + Name of the column containing the username of the subscriber in uri attributes table. Default value is "username". @@ -182,24 +181,24 @@ Chapter 1. Admin Guide 3.11. scheme_column (string) - The name of the column containing subscriber's scheme in uri + The name of the column containing subscriber's scheme in uri attributes. Default value is "scheme". 3.12. attr_group (string) - 'Extra attribute' group definition. It can be repeated to define more + 'Extra attribute' group definition. It can be repeated to define more attribute groups. - The group definition contains one or more assignments in the form + The group definition contains one or more assignments in the form key=value. Possible keys are: id Attribute group identifier. Must be set. table - Table name used for storing attributes from this attribute + Table name used for storing attributes from this attribute group. Must be set. flag @@ -207,29 +206,29 @@ Chapter 1. Admin Guide be set. key_column - Column name holding key. Default value is "id". + Column name holding key. Default value is “id”. name_column - Column name used for storing attribute name. Default value is - "name". + Column name used for storing attribute name. Default value is + “name”. value_column - Column name used for storing attribute value. Default value is - "value". + Column name used for storing attribute value. Default value is + “value”. type_column - Column name used for storing attribute type. Default value is - "type". + Column name used for storing attribute type. Default value is + “type”. flags_column - Column name used for storing attribute flags. Default value is - "flags". + Column name used for storing attribute flags. Default value is + “flags”. None defined by default. Example 1.1. attribute group definition -modparam("avp_db", "attr_group", "id=dlg,flag=dialog_flag,table=dlg_attrs,key_c -olumn=dlg_id"); +modparam("avp_db", "attr_group", "id=dlg,flag=dialog_flag,table=dlg_attrs,key_co +lumn=dlg_id"); Table used for these attributes: mysql> describe dlg_attrs; @@ -244,7 +243,7 @@ mysql> describe dlg_attrs; +--------+------------------+------+-----+---------+-------+ 5 rows in set (0.00 sec) - Setting flags from code (all attrs beginning with "dlg_"): + Setting flags from code (all attrs beginning with “dlg_”): avpflags dialog_flag; ... route { @@ -255,10 +254,10 @@ route { 3.13. auto_unlock_extra_attrs (string) - Determines the action when any of the 'extra attributes' lock is + Determines the action when any of the 'extra attributes' lock is detected when routing script execution was finished. When the value of - this parameter is zero (default) BUG level message is logged, but the - lock is kept, so another process trying to obtain the lock might get + this parameter is zero (default) BUG level message is logged, but the + lock is kept, so another process trying to obtain the lock might get stuck. If the value is nonzero, DEBUG level message is sent to the log and all the locks are released. @@ -280,24 +279,24 @@ route { track $fu - Load user attributes into from track. In this case the + Load user attributes into from track. In this case the second parameter is UID used to search attributes. $tu - Load user attributes into to track. In this case the + Load user attributes into to track. In this case the second parameter is UID used to search attributes. $fr - Load uri attributes into from track. In this case the + Load uri attributes into from track. In this case the second parameter is URI used to search attributes. $tr - Load uri attributes into to track. In this case the - second parameter is URI used to search attributes. + Load uri attributes into to track. In this case the second + parameter is URI used to search attributes. id - Identifier used for searching attributes. When searching for - user attributes it is UID, when searchnig uri attributes it is + Identifier used for searching attributes. When searching for + user attributes it is UID, when searchnig uri attributes it is URI. 4.2. load_extra_attrs (group_id, id) @@ -305,8 +304,8 @@ route { Loads 'extra attributes' stored by previous call to save_extra_attrs. group_id - Identifies attribute group, see Section 3.12, "attr_group - (string)". + Identifies attribute group, see Section 3.12, “attr_group + (string)”. id Identifies attributes which should be loaded. @@ -316,8 +315,8 @@ route { Saves 'extra attributes' flagged by group flag under given id. group_id - Identifies attribute group, see Section 3.12, "attr_group - (string)". + Identifies attribute group, see Section 3.12, “attr_group + (string)”. id Identifier stored with flagged attributes. @@ -327,20 +326,20 @@ route { Removes all extra attributes with given id. group_id - Identifies attribute group, see Section 3.12, "attr_group - (string)". + Identifies attribute group, see Section 3.12, “attr_group + (string)”. id Identifies attributes which should be removed. 4.5. lock_extra_attrs (group_id, id) - Locks extra attributes. Currently locks whole attribute group (not - only id). + Locks extra attributes. Currently locks whole attribute group (not only + id). group_id - Identifies attribute group, see Section 3.12, "attr_group - (string)". + Identifies attribute group, see Section 3.12, “attr_group + (string)”. id Identifies attributes which should be locked. @@ -351,8 +350,8 @@ route { only id). group_id - Identifies attribute group, see Section 3.12, "attr_group - (string)". + Identifies attribute group, see Section 3.12, “attr_group + (string)”. id Identifies attributes which should be unlocked. @@ -395,8 +394,8 @@ loadmodule "/home/kubartv/SER/lib/ser/modules/gflags.so" modparam("usrloc", "db_mode", 1); modparam("usrloc|avp_db", "db_url", "mysql://ser:heslo@127.0.0.1/ser") -modparam("avp_db", "attr_group", "id=dlg,flag=dialog_flag,table=dlg_attrs,key_c -olumn=dlg_id"); +modparam("avp_db", "attr_group", "id=dlg,flag=dialog_flag,table=dlg_attrs,key_co +lumn=dlg_id"); modparam("gflags", "load_global_attrs", 1); @@ -416,7 +415,7 @@ route["create_dialog"] { onreply_route["dialog_creation_reply"] { xplog("L_ERR", "dialog creation reply (%rs, %@cseq.method) [%@from.tag, - %@to.tag]\n"); +%@to.tag]\n"); $res = @msg.response.code; xplog("L_ERR", " ... response: %$res\n"); @@ -425,15 +424,15 @@ onreply_route["dialog_creation_reply"] { break; } if ($res < 101) { - xplog("L_ERR", " ... I won't create dialog from 100 response.\n -"); + xplog("L_ERR", " ... I won't create dialog from 100 response.\n" +); break; } - del_attr("$id"); # xlset_attr works strange when the attribute already -exists - xlset_attr("$id", "call-id:%@call_id caller_tag:%@from.tag callee_tag:% -@to.tag"); + del_attr("$id"); # xlset_attr works strange when the attribute already e +xists + xlset_attr("$id", "call-id:%@call_id caller_tag:%@from.tag callee_tag:%@ +to.tag"); if ($res > 299) { xplog("L_ERR", " ... dialog terminated\n"); remove_extra_attrs("dlg", "$id"); @@ -472,8 +471,8 @@ route["save_dialog"] { # use this if you want to delete destroyed dialogs: # remove_extra_attrs("dlg", "$id"); - # else if you want leave them in DB (with the time of terminati -on) + # else if you want leave them in DB (with the time of terminatio +n) $dlg_destroyed_at = @sys.now.local; # set flag for attributes with name beggining with dlg_ @@ -494,8 +493,8 @@ route["load_dialog_data"] { del_attr("$dlg_init_method"); # used as flag of succesful read of data - # delete all used dlg attrs (because load_extra_attrs doesn't delete th -em itself before adding) + # delete all used dlg attrs (because load_extra_attrs doesn't delete the +m itself before adding) del_attr("$dlg_init_method"); del_attr("$dlg_caller"); del_attr("$dlg_callee"); @@ -516,20 +515,20 @@ route["load_dialog"] { # tries to load dialog according tags and callid # try to load dialog - del_attr("$id"); # xlset_attr works strange when the attribute already -exists - xlset_attr("$id", "call-id:%@call_id caller_tag:%@from.tag callee_tag:% -@to.tag"); + del_attr("$id"); # xlset_attr works strange when the attribute already e +xists + xlset_attr("$id", "call-id:%@call_id caller_tag:%@from.tag callee_tag:%@ +to.tag"); if (route("load_dialog_data")) { $dir = "caller2callee"; return 1; } # try to load dialog in other direction - del_attr("$id"); # xlset_attr works strange when the attribute already -exists - xlset_attr("$id", "call-id:%@call_id caller_tag:%@to.tag callee_tag:%@f -rom.tag"); + del_attr("$id"); # xlset_attr works strange when the attribute already e +xists + xlset_attr("$id", "call-id:%@call_id caller_tag:%@to.tag callee_tag:%@fr +om.tag"); if (route("load_dialog_data")) { $dir = "callee2caller"; return 1; @@ -545,8 +544,8 @@ route["update_dialog_reply"] { # target refresh for INVITE dialogs if ($dir == "caller2calle") { # if request from caller - $dlg_callee = @contact; # update callee's contact (resp -onse!) + $dlg_callee = @contact; # update callee's contact (respo +nse!) } else { $dlg_caller = @contact; @@ -562,8 +561,8 @@ route["update_dialog"] { # target refresh for INVITE dialogs if ($dir == "caller2calle") { # if request from caller - $dlg_caller = @contact; # update caller's contact (requ -est!) + $dlg_caller = @contact; # update caller's contact (reque +st!) } else { $dlg_callee = @contact; @@ -571,19 +570,19 @@ est!) } if ($dir == "caller2callee") { # if request from caller - # TODO: verify CSeq before modifying and return 500 if lower th -an last one + # TODO: verify CSeq before modifying and return 500 if lower tha +n last one $dlg_caller_cseq = @cseq.num; } else { - # TODO: verify CSeq before modifying and return 500 if lower th -an last one + # TODO: verify CSeq before modifying and return 500 if lower tha +n last one $dlg_callee_cseq = @cseq.num; } if (method=="BYE") { - $dlg_status = "pre-destroyed"; # to see that BYE already went t -hrough + $dlg_status = "pre-destroyed"; # to see that BYE already went th +rough } return 1; } @@ -603,7 +602,7 @@ route["trace_dialog"] { onreply_route["dialog_reply"] { if ($id) { xplog("L_ERR", "In-dialog reply (%rs, %@cseq.method) [%@to.tag, - %@from.tag]\n"); +%@from.tag]\n"); if (!route("load_dialog")) { xplog("L_ERR", "Can't load dialog data\n"); } @@ -662,8 +661,7 @@ route { # initial request or non-dialog message if (method=="INVITE") { route("create_dialog"); - # we don't save the dialog here because AVPs will be se -t + # we don't save the dialog here because AVPs will be set # when reply comes and the dialog will be stored then } else { @@ -679,8 +677,8 @@ t t_on_reply("dialog_reply"); } else { - xplog("L_ERR", "Message within unknown dialog: %@cseq, -to_tag=%@to.tag from_tag=%@from.tag\n"); + xplog("L_ERR", "Message within unknown dialog: %@cseq, t +o_tag=%@to.tag from_tag=%@from.tag\n"); } } diff --git a/modules/uid_domain/README b/modules/uid_domain/README index 7c7af947e51..08889ae5fb7 100644 --- a/modules/uid_domain/README +++ b/modules/uid_domain/README @@ -1,12 +1,11 @@ - UID Domain Module Juha Heinanen - Copyright 2002-2010 Juha Heinanen - _________________________________________________________________ + Copyright © 2002-2010 Juha Heinanen + __________________________________________________________________ Table of Contents @@ -116,49 +115,49 @@ Chapter 1. Admin Guide 1.2. Domain-level Configuration Attributes 1.3. Caching - Domain modules, as the name suggests, implements support for multiple - independent virtual domains hosted on one SIP server. This is often + Domain modules, as the name suggests, implements support for multiple + independent virtual domains hosted on one SIP server. This is often useful if you have multiple domain names and you want to make them all work and appear as one. Alternatively you might find the module useful - if you want to run a shared SIP service for multiple independent - customers. The module stores all supported domains and associated - configuration in a database table. Most of the information can be + if you want to run a shared SIP service for multiple independent + customers. The module stores all supported domains and associated + configuration in a database table. Most of the information can be cached in memory for performance reasons. 1.1. Virtual Domains - The domain module adds support for so-called virtual domains. A - virtual domain is just a collection of domain names and associated - configuration information identified by a unique identifier. We refer - to the domain identifier as DID elsewhere in the documentation. DID + The domain module adds support for so-called virtual domains. A virtual + domain is just a collection of domain names and associated + configuration information identified by a unique identifier. We refer + to the domain identifier as DID elsewhere in the documentation. DID stands for "Domain IDentifier". In traditional POST world the term DID has a different meaning though. Please be aware that this is just pure coincidence. - All domain names that belong to one virtual domain are - interchangeable. From SIP server's perspective there is no difference - between them. They can be used in SIP URIs interchangeably and the - behavior of the SIP server will not be affected. This is called - "domain name normalization" and it is one of the steps performed early - during SIP message processing. + All domain names that belong to one virtual domain are interchangeable. + From SIP server's perspective there is no difference between them. They + can be used in SIP URIs interchangeably and the behavior of the SIP + server will not be affected. This is called "domain name normalization" + and it is one of the steps performed early during SIP message + processing. - The DID identifier can be anything. To the SIP server DIDs are just + The DID identifier can be anything. To the SIP server DIDs are just opaque strings and what format you choose depends on your requirements - and the type of the setup. You can use numbers in smaller setups if - the size of the data is a concern. You can set the DID to the - canonical domain name of the domain. You can use RFC 4122 style UUIDs - if your setup is large and distributed. You can use anything as long - as it can be represented as string. The only requirement is that the - identifier of each virtual domain must be unique. - - The following example illustrates how one virtual domain can be + and the type of the setup. You can use numbers in smaller setups if the + size of the data is a concern. You can set the DID to the canonical + domain name of the domain. You can use RFC 4122 style UUIDs if your + setup is large and distributed. You can use anything as long as it can + be represented as string. The only requirement is that the identifier + of each virtual domain must be unique. + + The following example illustrates how one virtual domain can be represented. The iptel.org domain runs a public SIP service. The users - of the service can use SIP URIs of form sip:username@iptel.org. The - SIP service is distributed, there is a number of SIP servers. The SIP - servers are also available through a number of other domain names, - such as sip.iptel.org, proxy.iptel.org and so on. We created one - virtual domain in the domain module and added all such domain names to - the virtual domain: + of the service can use SIP URIs of form sip:username@iptel.org. The SIP + service is distributed, there is a number of SIP servers. The SIP + servers are also available through a number of other domain names, such + as sip.iptel.org, proxy.iptel.org and so on. We created one virtual + domain in the domain module and added all such domain names to the + virtual domain: Example 1.1. Virtual Domain iptel.org iptel @@ -168,17 +167,17 @@ iptel +---proxy.iptel.org +---213.192.59.75 - In the example above, we chose "iptel" as the unique identifier for - the virtual domain. This identifier is permanent. It never changes. - Over time we may change domain names assigned to this virtual domain, - but this identifier never changes. The main reason why virtual domain + In the example above, we chose "iptel" as the unique identifier for the + virtual domain. This identifier is permanent. It never changes. Over + time we may change domain names assigned to this virtual domain, but + this identifier never changes. The main reason why virtual domain identifiers must never change is that because they are referenced from - other tables, for example the accounting table. The data in the - accounting table is long-lived, usually archived, and this ensures - that the data will still reference correct virtual domain, no matter - what domain names are assigned to it. + other tables, for example the accounting table. The data in the + accounting table is long-lived, usually archived, and this ensures that + the data will still reference correct virtual domain, no matter what + domain names are assigned to it. - The virtual domain described above will be stored in the domain table + The virtual domain described above will be stored in the domain table in the database: Example 1.2. Database Representation of Virtual Domain @@ -191,42 +190,42 @@ iptel | iptel | 213.192.59.75 | 33 | +-------+-----------------+-------+ - Because all domain names that belong to one particular virtual domain - are equal, it does not matter which domain name is used in the host - part of the SIP URI. Thus an imaginary user joe with SIP URI - sip:joe@iptel.org will also be reachable as sip:joe@sip.iptel.org, - sip:joe@proxy.iptel.org, and sip:joe@213.192.59.75. If we add a new - domain name to this virtual domain then joe will also be able to use - the new domain name in his SIP URI, without the need to change + Because all domain names that belong to one particular virtual domain + are equal, it does not matter which domain name is used in the host + part of the SIP URI. Thus an imaginary user joe with SIP URI + sip:joe@iptel.org will also be reachable as sip:joe@sip.iptel.org, + sip:joe@proxy.iptel.org, and sip:joe@213.192.59.75. If we add a new + domain name to this virtual domain then joe will also be able to use + the new domain name in his SIP URI, without the need to change anything. 1.2. Domain-level Configuration Attributes - In addition to a number of domain names, each virtual domain can also - have extra configuration information associated with it. The - possibility to configure the SIP server sightly differently in each - virtual domain is, in fact, the main reason why we introduced the - concept of virtual domains. We wanted to have one SIP server which - will provide SIP service to multiple different customers and each of - the customers may have slightly different configuration requirements. + In addition to a number of domain names, each virtual domain can also + have extra configuration information associated with it. The + possibility to configure the SIP server sightly differently in each + virtual domain is, in fact, the main reason why we introduced the + concept of virtual domains. We wanted to have one SIP server which will + provide SIP service to multiple different customers and each of the + customers may have slightly different configuration requirements. That's how domain-level configuration attributes were born. Because the administrator of the SIP server seldom knows configuration - requirements in advance, we decided to implement a generic solution - and store all configuration options in named attributes. Named - attributes are just like variables, they have a name and they have a - value. Attributes are accessible from the configuration script of the - SIP server. Domain-level attributes are attributes that are associated - with a particular virtual domain. They can be used to store additional - configuration for the entire virtual domain, that is all users that - belong (or have SIP URI) in that particular virtual domain. - Domain-level attributes can be overridden be user-level attributes - with the same name configured for a particular user. In other words a - domain level attribute will only be effective if no user-level - attribute with the same name exists. - - Domain-level attributes are stored in a separate table. The name of - the table is domain_attrs and it is defined as follows: + requirements in advance, we decided to implement a generic solution and + store all configuration options in named attributes. Named attributes + are just like variables, they have a name and they have a value. + Attributes are accessible from the configuration script of the SIP + server. Domain-level attributes are attributes that are associated with + a particular virtual domain. They can be used to store additional + configuration for the entire virtual domain, that is all users that + belong (or have SIP URI) in that particular virtual domain. + Domain-level attributes can be overridden be user-level attributes with + the same name configured for a particular user. In other words a domain + level attribute will only be effective if no user-level attribute with + the same name exists. + + Domain-level attributes are stored in a separate table. The name of the + table is domain_attrs and it is defined as follows: Example 1.3. Table domain_attrs +-------+------------------+------+-----+---------+-------+ @@ -239,55 +238,54 @@ iptel | flags | int(10) unsigned | NO | | 0 | | +-------+------------------+------+-----+---------+-------+ - Each attribute has name, type and value. A single attribute can have - multiple values and in that case it will occupy more rows in the - table. Each attribute is associated with a particular virtual domain - using the DID identifier. Domain-level attributes can contain just - about anything. It is a generic configuration mechanism and it is up - to you to define a list of attribute that are meaningful in your setup - and use those attributes in the routing part of the configuration - file. - - Attributes for a particular virtual-domain are made available to - script function by the lookup_domain function. This is the function - that is used to map domain names to DIDs. One of the side-effects of - the function is that it makes domain-level attributes available to - script function if a matching virtual domain is found. - - When caching is enabled, all attributes from domain_attrs table are - cached in memory, just like virtual domain themselves. If you disable - caching then the domain module will attempt to load attributes from - the database each time you call lookup_domain. Attributes cached in - memory can be realoaded with the domain.reload management function. + Each attribute has name, type and value. A single attribute can have + multiple values and in that case it will occupy more rows in the table. + Each attribute is associated with a particular virtual domain using the + DID identifier. Domain-level attributes can contain just about + anything. It is a generic configuration mechanism and it is up to you + to define a list of attribute that are meaningful in your setup and use + those attributes in the routing part of the configuration file. + + Attributes for a particular virtual-domain are made available to script + function by the lookup_domain function. This is the function that is + used to map domain names to DIDs. One of the side-effects of the + function is that it makes domain-level attributes available to script + function if a matching virtual domain is found. + + When caching is enabled, all attributes from domain_attrs table are + cached in memory, just like virtual domain themselves. If you disable + caching then the domain module will attempt to load attributes from the + database each time you call lookup_domain. Attributes cached in memory + can be realoaded with the domain.reload management function. 1.3. Caching - Domain module operates in caching or non-caching mode depending on + Domain module operates in caching or non-caching mode depending on value of module parameter db_mode. In caching mode domain module reads - the contents of domain table into cache memory when the module is - loaded. After that domain table is re-read only when module is given - domain_reload fifo command. Any changes in domain table must thus be - followed by domain_reload command in order to reflect them in module - behavior. In non-caching mode domain module always queries domain - table in the database. - - Caching is implemented using a hash table. The size of the hash table - is given by HASH_SIZE constant defined in domain_mod.h. Its "factory - default" value is 128. Caching mode is highly recommended if you want + the contents of domain table into cache memory when the module is + loaded. After that domain table is re-read only when module is given + domain_reload fifo command. Any changes in domain table must thus be + followed by domain_reload command in order to reflect them in module + behavior. In non-caching mode domain module always queries domain table + in the database. + + Caching is implemented using a hash table. The size of the hash table + is given by HASH_SIZE constant defined in domain_mod.h. Its "factory + default" value is 128. Caching mode is highly recommended if you want to use domain-level attributes. 2. Dependencies - The module depends on the following modules (in the other words the + The module depends on the following modules (in the other words the listed modules must be loaded before this module): * database - Any database module 3. Known Limitations - There is an unlikely race condition on domain list update. If a - process uses a table, which is reloaded at the same time twice through - FIFO, the second reload will delete the original table still in use by - the process. + There is an unlikely race condition on domain list update. If a process + uses a table, which is reloaded at the same time twice through FIFO, + the second reload will delete the original table still in use by the + process. 4. Parameters @@ -316,8 +314,8 @@ modparam("domain", "db_url", "mysql://ser:pass@db_host/ser") 4.2. db_mode (integer) - Database mode. Value 0 means non-caching, 1 means caching is enabled. - It is highly recommended to enable caching if you want to use + Database mode. Value 0 means non-caching, 1 means caching is enabled. + It is highly recommended to enable caching if you want to use domain-level attributes. Default value is 1 (caching). @@ -327,8 +325,8 @@ modparam("domain", "db_mode", 0) # Do not use caching 4.3. domain_table (string) - Name of table containing names of local domains that the proxy is - responsible for. Local users must have in their SIP URI a host part + Name of table containing names of local domains that the proxy is + responsible for. Local users must have in their SIP URI a host part that is equal to one of the domains stored in this table. Default value is "domain". @@ -338,10 +336,10 @@ modparam("domain", "domain_table", "new_name") 4.4. did_col (string) - This is the name of the column in domain table that contains the - unique identifiers of virtual domains. Domains names found in this - table are arranged into virtual domains. Each virtual domain must have - a unique identifier and it can contain one or more domain names. + This is the name of the column in domain table that contains the unique + identifiers of virtual domains. Domains names found in this table are + arranged into virtual domains. Each virtual domain must have a unique + identifier and it can contain one or more domain names. Default value is "did". @@ -359,10 +357,10 @@ modparam("domain", "domain_col", "domain") 4.6. flags_col (string) - This is the name of the column in domain table which stores various - flags. Each row in the table has a bunch of generic flags that can be - used mark the row disabled, deleted, etc. The flags allow for more - flexible administration of the data in the database and they are + This is the name of the column in domain table which stores various + flags. Each row in the table has a bunch of generic flags that can be + used mark the row disabled, deleted, etc. The flags allow for more + flexible administration of the data in the database and they are present in several other tables too. Default value is "flags". @@ -372,11 +370,11 @@ modparam("domain", "flags_col", "domain") 4.7. domattr_table (string) - This parameter can be used to configure the name of the table that is - used to store domain-level attributes. Domain level attributes are - attributes that are associated with a particular virtual domain. They - are typically used to store additional domain-wide settings that - should apply to all users who belong to the domain. + This parameter can be used to configure the name of the table that is + used to store domain-level attributes. Domain level attributes are + attributes that are associated with a particular virtual domain. They + are typically used to store additional domain-wide settings that should + apply to all users who belong to the domain. Default value is "domain_attrs". @@ -386,10 +384,9 @@ modparam("domain", "domattr_table", "domain_attrs") 4.8. domattr_did (string) Use this parameter to configure the name of the column in domain_attrs - table that is used to store the did of the virtual domain the - attribute belongs to. Normally there is no need to configure this - parameter, unless you want adapt to module to a different database - schema. + table that is used to store the did of the virtual domain the attribute + belongs to. Normally there is no need to configure this parameter, + unless you want adapt to module to a different database schema. Default value is "did". @@ -399,9 +396,9 @@ modparam("domain", "domattr_did", "did") 4.9. domattr_name (string) Use this parameter to configure the name of the column in domain_attrs - table that is used to store the name of the attribute. Normally there - is no need to configure this parameter, unless you want adapt to - module to a different database schema. + table that is used to store the name of the attribute. Normally there + is no need to configure this parameter, unless you want adapt to module + to a different database schema. Default value is "name". @@ -411,9 +408,9 @@ modparam("domain", "domattr_name", "name") 4.10. domattr_type (string) Use this parameter to configure the name of the column in domain_attrs - table that is used to store the type of the attribute. Normally there - is no need to configure this parameter, unless you want adapt to - module to a different database schema. + table that is used to store the type of the attribute. Normally there + is no need to configure this parameter, unless you want adapt to module + to a different database schema. Default value is "type". @@ -424,8 +421,8 @@ modparam("domain", "domattr_type", "type") Use this parameter to configure the name of the column in domain_attrs table that is used to store the value of the attribute. Normally there - is no need to configure this parameter, unless you want adapt to - module to a different database schema. + is no need to configure this parameter, unless you want adapt to module + to a different database schema. Default value is "value". @@ -434,11 +431,11 @@ modparam("domain", "domattr_value", "value") 4.12. domattr_flags (string) - This is the name of the column in domain_attrs table which stores + This is the name of the column in domain_attrs table which stores various flags. Each row in the table has a bunch of generic flags that - can be used mark the row disabled, deleted, etc. The flags allow for - more flexible administration of the data in the database and they are - present in several other tables too. You do not have to touch this + can be used mark the row disabled, deleted, etc. The flags allow for + more flexible administration of the data in the database and they are + present in several other tables too. You do not have to touch this parameter under normal circumstances. Default value is "flags". @@ -448,16 +445,16 @@ modparam("domain", "domattr_flags", "flags") 4.13. load_domain_attrs (integer) - This parameter can be used to enable/disable user of domain-level - attributes. Domain-level attributes are variables that can be used to - store additional configuration that applies to the whole virtual - domain and all users within the virtual domain. Domain-level - attributes are stored in domain_attrs. If you set this parameter to a - non-zero value then the server will make domain-level attributes - available to the script every time you call function lookup_domain. If - you set the parameter to 0 then domain-level attributes will be - ignored, the domain module will not load them from the database and - the lookup function will not make them available to the script. + This parameter can be used to enable/disable user of domain-level + attributes. Domain-level attributes are variables that can be used to + store additional configuration that applies to the whole virtual domain + and all users within the virtual domain. Domain-level attributes are + stored in domain_attrs. If you set this parameter to a non-zero value + then the server will make domain-level attributes available to the + script every time you call function lookup_domain. If you set the + parameter to 0 then domain-level attributes will be ignored, the domain + module will not load them from the database and the lookup function + will not make them available to the script. Default value is 0. @@ -471,21 +468,21 @@ modparam("domain", "load_domain_attrs", 1) 5.1. is_local(domain) - This function can be used to test whether a given domain name in - parameter belongs to one of the virtual domains defined in the domain + This function can be used to test whether a given domain name in + parameter belongs to one of the virtual domains defined in the domain table. Such domain name is said to be local. The function returns 1 if the domain name is found in the domain table and -1 otherwise. - The first parameter of the function can be anything that returns a - string with domain name. In its simplest form it can be a string with - domain name: is_local("iptel.org"). You can also test a domain name - stored in an attribute: is_local("$my_domain"). And finally you can - test a domain name present in the SIP message with selects: + The first parameter of the function can be anything that returns a + string with domain name. In its simplest form it can be a string with + domain name: is_local("iptel.org"). You can also test a domain name + stored in an attribute: is_local("$my_domain"). And finally you can + test a domain name present in the SIP message with selects: is_local("@ruri.host"). - Note: Unlike function lookup_domain, this function does not make - domain attributes of the virtual domain available to the script. - Domain attributes are simply ignored by this function. + Note: Unlike function lookup_domain, this function does not make domain + attributes of the virtual domain available to the script. Domain + attributes are simply ignored by this function. Example 1.17. is_uri_host_local_local usage ... @@ -496,46 +493,46 @@ if (is_local("@ruri.host")) { 5.2. lookup_domain(attr_group, domain) - This is the main function of the domain module. It can be used to - implement support for virtual domains in the SIP server. Each virtual + This is the main function of the domain module. It can be used to + implement support for virtual domains in the SIP server. Each virtual domain is identified by a unique identifier (opaque string) and it can - have one or more associated domain names. Given a domain name in the - second parameter, this function finds the associated virtual domain - identifier (known as DID) and stores it in an attribute for later - user. In addition to that the function also loads all domain-level - attributes for the virtual domain and makes them available to the - configuration script. + have one or more associated domain names. Given a domain name in the + second parameter, this function finds the associated virtual domain + identifier (known as DID) and stores it in an attribute for later user. + In addition to that the function also loads all domain-level attributes + for the virtual domain and makes them available to the configuration + script. The first parameter of the function identifies the group of attributes - where the DID and domain-level attributes shall be stored. The value - of the first parameter can be either "$fd" for the domain-level - attribute group that belongs to the calling party (From), or "$td" for - the domain-level attribute group that belongs to the called party + where the DID and domain-level attributes shall be stored. The value of + the first parameter can be either "$fd" for the domain-level attribute + group that belongs to the calling party (From), or "$td" for the + domain-level attribute group that belongs to the called party (Request-URI). The value of the second parameter can be a simple string, an attribute name, or a select. See the documentation of function is_local for more details. - If a match is found then the DID of the virtual domain will be stored - either in $fd.did or in $td.did, depending on the value of the first - parameter. In addition to that domain-level attributes, if any, will - be available as either $fd. or $td.. + If a match is found then the DID of the virtual domain will be stored + either in $fd.did or in $td.did, depending on the value of the first + parameter. In addition to that domain-level attributes, if any, will be + available as either $fd. or $td.. - The function returns 1 when a matching virtual domain for the given + The function returns 1 when a matching virtual domain for the given domain name was found and -1 otherwise. - The following example shows a typical use of the function. In a multi - domain setup, one has to typically figure out where the both the - calling and the called domains are local (i.e. configured on the - server as the domains the server is responsible for). This is - typically done by calling function lookup_domain twice, once with the - hostname part of the From header as parameter and secondly with the - hostname part of the Request-URI as parameter. - - The type of the situation can be then determined from the value of - corresponding attributes ($td.did and $fd.did). A non-existing - attribute value indicates that the domain name is not local (it does + The following example shows a typical use of the function. In a multi + domain setup, one has to typically figure out where the both the + calling and the called domains are local (i.e. configured on the server + as the domains the server is responsible for). This is typically done + by calling function lookup_domain twice, once with the hostname part of + the From header as parameter and secondly with the hostname part of the + Request-URI as parameter. + + The type of the situation can be then determined from the value of + corresponding attributes ($td.did and $fd.did). A non-existing + attribute value indicates that the domain name is not local (it does not belong to any virtual domain configured in the domain table). Example 1.18. lookup_domain usage @@ -572,26 +569,26 @@ if ($fd.did && $td.did) { 6.1. domain.reload - Causes domain module to re-read the contents of domain table into - cache memory. If domain-level attributes are used then it will also - re-load the contents of the domain_attrs table in the memory cache. + Causes domain module to re-read the contents of domain table into cache + memory. If domain-level attributes are used then it will also re-load + the contents of the domain_attrs table in the memory cache. 6.2. domain.dump - Causes domain module to dump hash indexes and domain names in its - cache memory. + Causes domain module to dump hash indexes and domain names in its cache + memory. 7. Internal API - The domain module has an internal API which can be used to access - additional functions of the module (i.e. functions that are normally + The domain module has an internal API which can be used to access + additional functions of the module (i.e. functions that are normally not available from the routing script). Currently the API exports only - the function is_domain_local. That function can be used to determine - whether a given domain name is on the list of locally configured - domain names. + the function is_domain_local. That function can be used to determine + whether a given domain name is on the list of locally configured domain + names. - If you want to use the internal API of domain module from your module - then you need to include the header file domain_api.h and call + If you want to use the internal API of domain module from your module + then you need to include the header file domain_api.h and call load_domain_api first. Example 1.19. Calling load_domain_api @@ -603,7 +600,7 @@ if (load_domain_api(&dom_api) != 0) { /* error */ } - After that you can call function is_domain_local whose pointer is + After that you can call function is_domain_local whose pointer is stored in the initialized data structure: str tmp = STR_STATIC_INIT("mydomain.com"); diff --git a/modules/uid_domain/uid_domain_mod.c b/modules/uid_domain/uid_domain_mod.c index fda7bb960df..abe43d5b382 100644 --- a/modules/uid_domain/uid_domain_mod.c +++ b/modules/uid_domain/uid_domain_mod.c @@ -433,7 +433,7 @@ static int db_load_domain(domain_t** d, unsigned long flags, str* domain) static int lookup_domain(struct sip_msg* msg, char* flags, char* fp) { str domain, tmp; - domain_t* d; + domain_t* d = NULL; int ret = -1; if (get_str_fparam(&domain, msg, (fparam_t*)fp) != 0) { @@ -527,13 +527,12 @@ int reload_domain_list(void) static int lookup_domain_fixup(void** param, int param_no) { - unsigned long flags; + unsigned long flags=0; char* s; if (param_no == 1) { /* Determine the track and class of attributes to be loaded */ s = (char*)*param; - flags = 0; if (*s != '$' || (strlen(s) != 3)) { ERR("Invalid parameter value, $xy expected\n"); return -1; diff --git a/modules/uid_gflags/README b/modules/uid_gflags/README index 4679fb7bf41..89b2b514e27 100644 --- a/modules/uid_gflags/README +++ b/modules/uid_gflags/README @@ -4,7 +4,7 @@ Jiri Kuthan - Copyright 2004 FhG FOKUS + Copyright © 2004 FhG FOKUS __________________________________________________________________ Table of Contents diff --git a/modules/uid_uri_db/README b/modules/uid_uri_db/README index 5926fe1fa75..3853195a4c9 100644 --- a/modules/uid_uri_db/README +++ b/modules/uid_uri_db/README @@ -1,12 +1,11 @@ - UID Uri_db Module Jan Janak FhG FOKUS - Copyright 2003 FhG FOKUS - _________________________________________________________________ + Copyright © 2003 FhG FOKUS + __________________________________________________________________ Table of Contents @@ -27,9 +26,9 @@ Jan Janak 4. Functions - 4.1. check_to() - 4.2. check_from() - 4.3. does_uri_exist() + 4.1. check_to() + 4.2. check_from() + 4.3. does_uri_exist() List of Examples @@ -64,9 +63,9 @@ Chapter 1. Admin Guide 4. Functions - 4.1. check_to() - 4.2. check_from() - 4.3. does_uri_exist() + 4.1. check_to() + 4.2. check_from() + 4.3. does_uri_exist() 1. Overview @@ -178,9 +177,9 @@ modparam("module", "subscriber_domain_column", "domain") 4. Functions - 4.1. check_to() - 4.2. check_from() - 4.3. does_uri_exist() + 4.1. check_to() + 4.2. check_from() + 4.3. does_uri_exist() 4.1. check_to() diff --git a/modules/uri_db/README b/modules/uri_db/README index 2a7d42c07e4..ee174ee7d41 100644 --- a/modules/uri_db/README +++ b/modules/uri_db/README @@ -12,9 +12,9 @@ Edited by Bogdan-Andrei Iancu - Copyright 2003 FhG FOKUS + Copyright © 2003 FhG FOKUS - Copyright 2005 Voice Sistem SRL + Copyright © 2005 Voice Sistem SRL __________________________________________________________________ Table of Contents @@ -118,7 +118,7 @@ Chapter 1. Admin Guide If the db_url string is empty, the default database URL will be used. - Default value is "mysql://kamailioro:kamailioro@localhost/kamailio". + Default value is “mysql://kamailioro:kamailioro@localhost/kamailio”. Example 1.1. Set db_url parameter ... @@ -127,11 +127,11 @@ modparam("uri_db", "db_url", "mysql://username:password@localhost/openser") 3.2. db_table (string) - The DB table that should be used. Its possible to use the "subscriber" - and "uri" table. If the "uri" table should be used, an additional - parameter "use-uri-table") must be set. + The DB table that should be used. Its possible to use the “subscriber” + and “uri” table. If the “uri” table should be used, an additional + parameter “use-uri-table”) must be set. - Default value is "subscriber". + Default value is “subscriber”. Example 1.2. Set uri_table parameter ... @@ -142,7 +142,7 @@ modparam("uri_db", "db_table", "uri") Column holding usernames in the table. - Default value is "username". + Default value is “username”. Example 1.3. Set user_column parameter ... @@ -153,7 +153,7 @@ modparam("uri_db", "user_column", "username") Column holding domain in the table. - Default value is "domain". + Default value is “domain”. Example 1.4. Set domain_column parameter ... @@ -164,7 +164,7 @@ modparam("uri_db", "domain_column", "domain") Column holding URI username in the table. - Default value is "uri_user". + Default value is “uri_user”. Example 1.5. Set uriuser_column parameter ... @@ -173,10 +173,10 @@ modparam("uri_db", "uriuser_column", "uri_user") 3.6. use_uri_table (integer) - Specify if the "uri" table should be used for checkings instead of - "subscriber" table. A non-zero value means true. + Specify if the “uri” table should be used for checkings instead of + “subscriber” table. A non-zero value means true. - Default value is "0 (false)". + Default value is “0 (false)”. Example 1.6. Set use_uri_table parameter ... @@ -189,11 +189,11 @@ modparam("uri_db", "use_uri_table", 1) users (along with username). This is useful in multi domain setups, a non-zero value means true. - This parameter is only evaluated for calls to "does_uri_exist", all + This parameter is only evaluated for calls to “does_uri_exist”, all other functions checks the digest username and realm against the given - username, if the "uri" table is used. + username, if the “uri” table is used. - Default value is "0 (false)". + Default value is “0 (false)”. Example 1.7. Set use_domain parameter ... @@ -206,9 +206,9 @@ modparam("uri_db", "use_domain", 1) 4.2. check_from() 4.3. does_uri_exist() -4.1. check_to() +4.1. check_to() - Check "To" username against URI table (if use_uri_table is set) or + Check “To” username against URI table (if use_uri_table is set) or digest credentials (no DB backend required). This function can be used from REQUEST_ROUTE. @@ -220,9 +220,9 @@ if (check_to()) { }; ... -4.2. check_from() +4.2. check_from() - Check "From" username against URI table (if use_uri_table is set) or + Check “From” username against URI table (if use_uri_table is set) or digest credentials (no DB backend required). This function can be used from REQUEST_ROUTE. @@ -234,7 +234,7 @@ if (check_from()) { }; ... -4.3. does_uri_exist() +4.3. does_uri_exist() Check if username in the request URI belongs to an existing user. diff --git a/modules/userblacklist/README b/modules/userblacklist/README index affcbe9d5b4..ec67c00a7b0 100644 --- a/modules/userblacklist/README +++ b/modules/userblacklist/README @@ -14,7 +14,7 @@ Pawel Kuzak 1&1 Internet AG - Copyright 2008 1&1 Internet AG + Copyright © 2008 1&1 Internet AG __________________________________________________________________ Table of Contents @@ -58,6 +58,11 @@ Pawel Kuzak 5. MI Commands 5.1. reload_blacklist + 5.2. dump_blacklist + 5.3. check_blacklist prefix + 5.4. check_whitelist prefix + 5.5. check_userblacklist user [domain] prefix + 5.6. check_userwhitelist user [domain] prefix 6. Installation and Running @@ -84,8 +89,13 @@ Pawel Kuzak 1.17. check_blacklist usage 1.18. check_whitelist usage 1.19. reload_blacklist usage - 1.20. Example database content - globalblacklist table - 1.21. Example database content - userblacklist table + 1.20. dump_blacklist usage + 1.21. check_blacklist usage + 1.22. check_whitelist usage + 1.23. check_userblacklist usage + 1.24. check_userwhitelist usage + 1.25. Example database content - globalblacklist table + 1.26. Example database content - userblacklist table Chapter 1. Admin Guide @@ -128,6 +138,11 @@ Chapter 1. Admin Guide 5. MI Commands 5.1. reload_blacklist + 5.2. dump_blacklist + 5.3. check_blacklist prefix + 5.4. check_whitelist prefix + 5.5. check_userblacklist user [domain] prefix + 5.6. check_userwhitelist user [domain] prefix 6. Installation and Running @@ -200,7 +215,7 @@ Chapter 1. Admin Guide If set to non-zero value, the domain column in the userblacklist table is used. - Default value is "0". + Default value is “0”. Example 1.1. Set use_domain parameter ... @@ -216,7 +231,7 @@ modparam("userblacklist", "use_domain", 1) matching. Please be aware that memory requirements for storing the routing tree in shared memory will also increase by a factor of 12.8. - Default value is "10". + Default value is “10”. Example 1.2. Set match_mode parameter ... @@ -227,7 +242,7 @@ modparam("userblacklist", "match_mode", 128) URL to the database containing the data. - Default value is "mysql://kamailioro:kamailioro@localhost/kamailio". + Default value is “mysql://kamailioro:kamailioro@localhost/kamailio”. Example 1.3. Set db_url parameter ... @@ -239,7 +254,7 @@ modparam("userblacklist", "db_url", "dbdriver://username:password@dbhost/dbname" Name of the userblacklist table for the userblacklist module. - Default value is "userblacklist". + Default value is “userblacklist”. Example 1.4. Set userblacklist_table parameter ... @@ -297,7 +312,7 @@ modparam("userblacklist", "userblacklist_whitelist_col", "whitelist") note that this table is used when the check_blacklist function is called with no parameters. - Default value is "globalblacklist". + Default value is “globalblacklist”. Example 1.10. Set globalblacklist_table parameter ... @@ -351,7 +366,7 @@ modparam("userblacklist", "globalblacklist_description_col", "description") 4.3. check_blacklist ([string table]) 4.4. check_whitelist (string table) -4.1. check_user_blacklist (string user, string domain, string number, string +4.1. check_user_blacklist (string user, string domain, string number, string table) Finds the longest prefix that matches the request URI user (or the @@ -372,7 +387,7 @@ if (!check_user_blacklist("$avp(i:80)", "$avp(i:82)")) { } ... -4.2. check_user_whitelist (string user, string domain, string number, string +4.2. check_user_whitelist (string user, string domain, string number, string table) Finds the longest prefix that matches the request URI user (or the @@ -393,7 +408,7 @@ if (!check_user_whitelist("$avp(i:80)", "$avp(i:82)")) { } ... -4.3. check_blacklist ([string table]) +4.3. check_blacklist ([string table]) Finds the longest prefix that matches the request URI for the given table. If a match is found and it is not set to whitelist, false is @@ -408,7 +423,7 @@ if (!check_blacklist("globalblacklist")) { } ... -4.4. check_whitelist (string table) +4.4. check_whitelist (string table) Finds the longest prefix that matches the request URI for the given table. If a match is found and it is set to whitelist, true is @@ -425,16 +440,93 @@ if (!check_whitelist("globalblacklist")) { 5. MI Commands 5.1. reload_blacklist + 5.2. dump_blacklist + 5.3. check_blacklist prefix + 5.4. check_whitelist prefix + 5.5. check_userblacklist user [domain] prefix + 5.6. check_userwhitelist user [domain] prefix -5.1. reload_blacklist +5.1. reload_blacklist Reload the internal global blacklist cache. This is necessary after the database tables for the global blacklist have been changed. Example 1.19. reload_blacklist usage -... -kamctl fifo reload_blacklist -... + ... + kamctl fifo reload_blacklist + ... + +5.2. dump_blacklist + + Dumps the default, in memory, global_blacklist content to stdout. Note + that a reload_blacklist should be issued before, in order to see the + latest content of the database. + + Example 1.20. dump_blacklist usage + ... + kamctl fifo reload_blacklist + kamctl fifo dump_blacklist + ... + +5.3. check_blacklist prefix + + Searches in the default, in memory, global list. Finds the longest + prefix that matches the given prefix parameter. Returns true if the + prefix is found and the whitelist is not set. Returns false otherwise - + either prefix found and whitelist set or prefix not found. Note that a + reload_blacklist should be issued before, in order to check through the + latest content of the database. + + Example 1.21. check_blacklist usage + ... + kamctl fifo reload_blacklist + kamctl fifo check_blacklist prefix + ... + +5.4. check_whitelist prefix + + Searches in the default, in memory, global list. Finds the longest + prefix that matches the given prefix parameter. Returns true if the + prefix is found and the whitelist is set. Returns false otherwise - + either prefix found and whitelist not set or prefix not found. Note + that a reload_blacklist should be issued before, in order to check + through the latest content of the database. + + Example 1.22. check_whitelist usage + ... + kamctl fifo reload_blacklist + kamctl fifo check_whitelist prefix + ... + +5.5. check_userblacklist user [domain] prefix + + Searches in the default user list table. Finds the longest prefix for + the given user@domain that matches the given prefix parameter. Returns + true if the prefix is found and the whitelist is not set. Returns false + otherwise - either prefix found and whitelist set or prefix not found. + Note that the domain parameter is optional. If not given, the second + parameter is the considered to be the prefix. + + Example 1.23. check_userblacklist usage + ... + kamctl fifo check_userblacklist user [do +main] prefix + ... + +5.6. check_userwhitelist user [domain] prefix + + Searches in the default user list table. Finds the longest prefix for + the given user@domain that matches the given prefix parameter. Returns + true if the prefix is found and the whitelist is set. Returns false + otherwise - either prefix found and whitelist not set or prefix not + found. Note that the domain parameter is optional. If not given, the + second parameter is the considered to be the prefix. + + Example 1.24. check_userwhitelist usage + ... + kamctl fifo check_userwhitelist user [do +main] prefix + ... 6. Installation and Running @@ -453,7 +545,7 @@ kamctl fifo reload_blacklist complete database documentation on the project webpage, http://www.kamailio.org/docs/db-tables/kamailio-db-devel.html. - Example 1.20. Example database content - globalblacklist table + Example 1.25. Example database content - globalblacklist table ... +----+-----------+-----------+ | id | prefix | whitelist | @@ -466,11 +558,11 @@ kamctl fifo reload_blacklist ... This table will setup a global blacklist for all numbers, only allowing - calls starting with "1". Numbers that starts with "123456" and - "123455787" are also blacklisted, because the longest prefix will be + calls starting with “1”. Numbers that starts with “123456” and + “123455787” are also blacklisted, because the longest prefix will be matched. - Example 1.21. Example database content - userblacklist table + Example 1.26. Example database content - userblacklist table ... +----+----------------+-------------+-----------+-----------+ | id | username | domain | prefix | whitelist | @@ -486,7 +578,7 @@ kamctl fifo reload_blacklist ... This table will setup user specific blacklists for certain usernames. - For example for user "49721123456788" the prefix "1234" will be not - allowed, but the number "123456788" is allowed. Additionally a domain + For example for user “49721123456788” the prefix “1234” will be not + allowed, but the number “123456788” is allowed. Additionally a domain could be specified that is used for username matching if the - "use_domain" parameter is set. + “use_domain” parameter is set. diff --git a/modules/userblacklist/db.c b/modules/userblacklist/db.c index bebb574bb7a..a679ae8f0f6 100644 --- a/modules/userblacklist/db.c +++ b/modules/userblacklist/db.c @@ -13,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -42,7 +42,8 @@ extern int match_mode; -int db_build_userbl_tree(const str *username, const str *domain, const str *table, struct dtrie_node_t *root, int use_domain) +int db_build_userbl_tree(const str *username, const str *domain, + const str *dbtable, struct dtrie_node_t *root, int use_domain) { db_key_t columns[2] = { &userblacklist_prefix_col, &userblacklist_whitelist_col }; db_key_t key[2] = { &userblacklist_username_col, &userblacklist_domain_col }; @@ -59,13 +60,14 @@ int db_build_userbl_tree(const str *username, const str *domain, const str *tabl VAL_STR(val + 1).s = domain->s; VAL_STR(val + 1).len = domain->len; - - if (userblacklist_dbf.use_table(userblacklist_dbh, table) < 0) { - LM_ERR("cannot use table '%.*s'.\n", table->len, table->s); + if (userblacklist_dbf.use_table(userblacklist_dbh, dbtable) < 0) { + LM_ERR("cannot use db table '%.*s'.\n", dbtable->len, dbtable->s); return -1; } - if (userblacklist_dbf.query(userblacklist_dbh, key, 0, val, columns, (!use_domain) ? (1) : (2), 2, 0, &res) < 0) { - LM_ERR("error while executing query.\n"); + if (userblacklist_dbf.query(userblacklist_dbh, key, 0, val, columns, + (!use_domain) ? (1) : (2), 2, 0, &res) < 0) { + LM_ERR("error while executing query on db table '%.*s'\n", + dbtable->len, dbtable->s); return -1; } @@ -85,8 +87,12 @@ int db_build_userbl_tree(const str *username, const str *domain, const str *tabl } else { nodeflags=(void *)MARK_WHITELIST; } - if (dtrie_insert(root, RES_ROWS(res)[i].values[0].val.string_val, strlen(RES_ROWS(res)[i].values[0].val.string_val), - nodeflags, match_mode) < 0) LM_ERR("could not insert values into trie.\n"); + + if (dtrie_insert(root, RES_ROWS(res)[i].values[0].val.string_val, + strlen(RES_ROWS(res)[i].values[0].val.string_val), + nodeflags, match_mode) < 0) + LM_ERR("could not insert values into trie.\n"); + n++; } else { @@ -105,20 +111,22 @@ int db_build_userbl_tree(const str *username, const str *domain, const str *tabl * Rebuild d-tree using database entries * \return negative on failure, positive on success, indicating the number of d-tree entries */ -int db_reload_source(const str *table, struct dtrie_node_t *root) +int db_reload_source(const str *dbtable, struct dtrie_node_t *root) { db_key_t columns[2] = { &globalblacklist_prefix_col, &globalblacklist_whitelist_col }; db1_res_t *res; int i; int n = 0; void *nodeflags; - - if (userblacklist_dbf.use_table(userblacklist_dbh, table) < 0) { - LM_ERR("cannot use table '%.*s'.\n", table->len, table->s); + + if (userblacklist_dbf.use_table(userblacklist_dbh, dbtable) < 0) { + LM_ERR("cannot use db table '%.*s'\n", dbtable->len, dbtable->s); return -1; } - if (userblacklist_dbf.query(userblacklist_dbh, NULL, NULL, NULL, columns, 0, 2, NULL, &res) < 0) { - LM_ERR("error while executing query.\n"); + if (userblacklist_dbf.query(userblacklist_dbh, NULL, NULL, NULL, + columns, 0, 2, NULL, &res) < 0) { + LM_ERR("error while executing query on db table '%.*s'\n", + dbtable->len, dbtable->s); return -1; } @@ -133,10 +141,17 @@ int db_reload_source(const str *table, struct dtrie_node_t *root) /* LM_DBG("insert into tree prefix %s, whitelist %d", RES_ROWS(res)[i].values[0].val.string_val, RES_ROWS(res)[i].values[1].val.int_val); */ - if (RES_ROWS(res)[i].values[1].val.int_val == 0) nodeflags=(void *) MARK_BLACKLIST; - else nodeflags=(void *)MARK_WHITELIST; - if (dtrie_insert(root, RES_ROWS(res)[i].values[0].val.string_val, strlen(RES_ROWS(res)[i].values[0].val.string_val), - nodeflags, match_mode) < 0) LM_ERR("could not insert values into trie.\n"); + if (RES_ROWS(res)[i].values[1].val.int_val == 0) { + nodeflags=(void *)MARK_BLACKLIST; + } else { + nodeflags=(void *)MARK_WHITELIST; + } + + if (dtrie_insert(root, RES_ROWS(res)[i].values[0].val.string_val, + strlen(RES_ROWS(res)[i].values[0].val.string_val), + nodeflags, match_mode) < 0) + LM_ERR("could not insert values into trie.\n"); + n++; } else { diff --git a/modules/userblacklist/userblacklist.c b/modules/userblacklist/userblacklist.c index 17aebc2fae7..2a1a448cff1 100644 --- a/modules/userblacklist/userblacklist.c +++ b/modules/userblacklist/userblacklist.c @@ -13,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -75,7 +75,7 @@ typedef struct _avp_check struct check_blacklist_fs_t { - struct dtrie_node_t *dtrie_root; + struct dtrie_node_t *dtrie_root; }; str userblacklist_db_url = str_init(DEFAULT_RODB_URL); @@ -89,15 +89,19 @@ static int check_user_blacklist_fixup(void** param, int param_no); static int check_globalblacklist_fixup(void** param, int param_no); /* ---- exported commands: */ -static int check_user_blacklist(struct sip_msg *msg, char* str1, char* str2, char* str3, char* str4); -static int check_user_whitelist(struct sip_msg *msg, char* str1, char* str2, char* str3, char* str4); -static int check_user_blacklist2(struct sip_msg *msg, char* str1, char* str2); -static int check_user_whitelist2(struct sip_msg *msg, char* str1, char* str2); -static int check_user_blacklist3(struct sip_msg *msg, char* str1, char* str2, char* str3); -static int check_user_whitelist3(struct sip_msg *msg, char* str1, char* str2, char* str3); -static int check_blacklist(struct sip_msg *msg, struct check_blacklist_fs_t *arg1); -static int check_whitelist(struct sip_msg *msg, struct check_blacklist_fs_t *arg1); -static int check_globalblacklist(struct sip_msg *msg); +static int check_user_blacklist(sip_msg_t *msg, char* puser, + char* pdomain, char* pnumber, char* ptable); +static int check_user_whitelist(sip_msg_t *msg, char* puser, + char* pdomain, char* pnumber, char* ptable); +static int check_user_blacklist2(sip_msg_t *msg, char* puser, char* pdomain); +static int check_user_whitelist2(sip_msg_t *msg, char* puser, char* pdomain); +static int check_user_blacklist3(sip_msg_t *msg, char* puser, char* pdomain, + char* pnumber); +static int check_user_whitelist3(sip_msg_t *msg, char* puser, char* pdomain, + char* pnumber); +static int check_blacklist(sip_msg_t *msg, struct check_blacklist_fs_t *arg1); +static int check_whitelist(sip_msg_t *msg, struct check_blacklist_fs_t *arg1); +static int check_globalblacklist(sip_msg_t *msg); /* ---- module init functions: */ @@ -116,15 +120,24 @@ struct mi_root * mi_check_userwhitelist(struct mi_root* cmd, void* param); /* u static cmd_export_t cmds[]={ - { "check_user_blacklist", (cmd_function)check_user_blacklist2, 2, check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE }, - { "check_user_whitelist", (cmd_function)check_user_whitelist2, 2, check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE }, - { "check_user_blacklist", (cmd_function)check_user_blacklist3, 3, check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE }, - { "check_user_whitelist", (cmd_function)check_user_whitelist3, 3, check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE }, - { "check_user_blacklist", (cmd_function)check_user_blacklist, 4, check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE }, - { "check_user_whitelist", (cmd_function)check_user_whitelist, 4, check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE }, - { "check_blacklist", (cmd_function)check_blacklist, 1, check_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE }, - { "check_whitelist", (cmd_function)check_whitelist, 1, check_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE }, - { "check_blacklist", (cmd_function)check_globalblacklist, 0, check_globalblacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE }, + { "check_user_blacklist", (cmd_function)check_user_blacklist2, 2, + check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE }, + { "check_user_whitelist", (cmd_function)check_user_whitelist2, 2, + check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE }, + { "check_user_blacklist", (cmd_function)check_user_blacklist3, 3, + check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE }, + { "check_user_whitelist", (cmd_function)check_user_whitelist3, 3, + check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE }, + { "check_user_blacklist", (cmd_function)check_user_blacklist, 4, + check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE }, + { "check_user_whitelist", (cmd_function)check_user_whitelist, 4, + check_user_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE }, + { "check_blacklist", (cmd_function)check_blacklist, 1, + check_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE }, + { "check_whitelist", (cmd_function)check_whitelist, 1, + check_blacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE }, + { "check_blacklist", (cmd_function)check_globalblacklist, 0, + check_globalblacklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE }, { 0, 0, 0, 0, 0, 0} }; @@ -179,7 +192,7 @@ struct source_t { struct source_list_t { - struct source_t *head; + struct source_t *head; }; @@ -190,41 +203,13 @@ static struct dtrie_node_t *dtrie_root = NULL; static int check_user_blacklist_fixup(void** param, int param_no) { - pv_elem_t *model=NULL; - str s; - - /* convert to str */ - s.s = (char*)*param; - s.len = strlen(s.s); - if (param_no > 0 && param_no <= 4) { - if(s.len == 0 && param_no != 4) { + if(strlen((char*)*param) == 0 && param_no != 4) { LM_ERR("no parameter %d\n", param_no); return E_UNSPEC; } + return fixup_spve_null(param, 1); - if(pv_parse_format(&s, &model) < 0 || !model) { - LM_ERR("wrong format [%.*s] for parameter %d\n", s.len, s.s, param_no); - return E_UNSPEC; - } - - if(model->spec==NULL || model->spec->getf==NULL) { - if(param_no == 1) { - if(str2int(&s, (unsigned int*)&model->spec->pvp.pvn.u.isname.name.n) != 0) { - LM_ERR("wrong value [%.*s] for parameter %d\n", s.len, s.s, param_no); - return E_UNSPEC; - } - } else { - if(param_no == 2 || param_no == 3) { - LM_ERR("wrong value [%.*s] for parameter %d\n", s.len, s.s, param_no); - return E_UNSPEC; - } else { - // only a string - return 0; - } - } - } - *param = (void*)model; } else { LM_ERR("wrong number of parameters\n"); } @@ -233,7 +218,8 @@ static int check_user_blacklist_fixup(void** param, int param_no) } -static int check_user_list(struct sip_msg *msg, char* str1, char* str2, char* str3, char* str4, int listtype) +static int check_user_list(sip_msg_t *msg, char* puser, char* pdomain, + char* pnumber, char* ptable, int listtype) { str user = { .len = 0, .s = NULL }; str domain = { .len = 0, .s = NULL}; @@ -245,32 +231,31 @@ static int check_user_list(struct sip_msg *msg, char* str1, char* str2, char* st char req_number[MAXNUMBERLEN+1]; /* user */ - if(((pv_elem_p)str1)->spec!=NULL && ((pv_elem_p)str1)->spec->getf!=NULL) { - if(pv_printf_s(msg, (pv_elem_p)str1, &user) != 0) { - LM_ERR("cannot print user pseudo-variable\n"); - return -1; - } + if(fixup_get_svalue(msg, (gparam_t*)puser, &user)!=0) { + LM_ERR("cannot print user pseudo-variable\n"); + return -1; } /* domain */ - if(((pv_elem_p)str2)->spec!=NULL && ((pv_elem_p)str2)->spec->getf) { - if(pv_printf_s(msg, (pv_elem_p)str2, &domain) != 0) { - LM_ERR("cannot print domain pseudo-variable\n"); - return -1; - } + if(fixup_get_svalue(msg, (gparam_t*)pdomain, &domain)!=0) { + LM_ERR("cannot print domain pseudo-variable\n"); + return -1; } /* source number */ - if(str3 != NULL && ((pv_elem_p)str3)->spec!=NULL && ((pv_elem_p)str3)->spec->getf!=NULL) { - if(pv_printf_s(msg, (pv_elem_p)str3, &number) != 0) { + if(pnumber != NULL) { + if(fixup_get_svalue(msg, (gparam_t*)pnumber, &number)!=0) { LM_ERR("cannot print number pseudo-variable\n"); return -1; } } /* table name */ - if(str4 != NULL && strlen(str4) > 0) { - /* string */ - table.s=str4; - table.len=strlen(str4); - } else { + if(ptable != NULL) { + if(fixup_get_svalue(msg, (gparam_t*)ptable, &table)!=0) { + LM_ERR("cannot print table pseudo-variable\n"); + return -1; + } + } + + if(table.len<=0) { /* use default table name */ table.len=userblacklist_table.len; table.s=userblacklist_table.s; @@ -283,7 +268,8 @@ static int check_user_list(struct sip_msg *msg, char* str1, char* str2, char* st if(number.s == NULL) { /* use R-URI */ - if ((parse_sip_msg_uri(msg) < 0) || (!msg->parsed_uri.user.s) || (msg->parsed_uri.user.len > MAXNUMBERLEN)) { + if ((parse_sip_msg_uri(msg) < 0) || (!msg->parsed_uri.user.s) + || (msg->parsed_uri.user.len > MAXNUMBERLEN)) { LM_ERR("cannot parse msg URI\n"); return -1; } @@ -331,37 +317,41 @@ static int check_user_list(struct sip_msg *msg, char* str1, char* str2, char* st } -static int check_user_whitelist(struct sip_msg *msg, char* str1, char* str2, char* str3, char* str4) +static int check_user_whitelist(sip_msg_t *msg, char* puser, + char* pdomain, char* pnumber, char* ptable) { - return check_user_list(msg, str1, str2, str3, str4, 1); + return check_user_list(msg, puser, pdomain, pnumber, ptable, 1); } -static int check_user_blacklist(struct sip_msg *msg, char* str1, char* str2, char* str3, char* str4) +static int check_user_blacklist(sip_msg_t *msg, char* puser, + char* pdomain, char* pnumber, char* ptable) { - return check_user_list(msg, str1, str2, str3, str4, 0); + return check_user_list(msg, puser, pdomain, pnumber, ptable, 0); } -static int check_user_whitelist2(struct sip_msg *msg, char* str1, char* str2) +static int check_user_whitelist2(sip_msg_t *msg, char* puser, char* pdomain) { - return check_user_list(msg, str1, str2, NULL, NULL, 1); + return check_user_list(msg, puser, pdomain, NULL, NULL, 1); } -static int check_user_blacklist2(struct sip_msg *msg, char* str1, char* str2) +static int check_user_blacklist2(sip_msg_t *msg, char* puser, char* pdomain) { - return check_user_list(msg, str1, str2, NULL, NULL, 0); + return check_user_list(msg, puser, pdomain, NULL, NULL, 0); } -static int check_user_whitelist3(struct sip_msg *msg, char* str1, char* str2, char* str3) +static int check_user_whitelist3(sip_msg_t *msg, char* puser, char* pdomain, + char* pnumber) { - return check_user_list(msg, str1, str2, str3, NULL, 1); + return check_user_list(msg, puser, pdomain, pnumber, NULL, 1); } -static int check_user_blacklist3(struct sip_msg *msg, char* str1, char* str2, char* str3) +static int check_user_blacklist3(sip_msg_t *msg, char* puser, char* pdomain, + char* pnumber) { - return check_user_list(msg, str1, str2, str3, NULL, 0); + return check_user_list(msg, puser, pdomain, pnumber, NULL, 0); } @@ -453,7 +443,7 @@ static int check_globalblacklist_fixup(void** param, int param_no) return 0; } -static int check_globalblacklist(struct sip_msg* msg) +static int check_globalblacklist(sip_msg_t* msg) { static struct check_blacklist_fs_t* arg = NULL; if(!arg){ @@ -473,7 +463,7 @@ static int check_blacklist_fixup(void **arg, int arg_no) char *table = (char *)(*arg); struct dtrie_node_t *node = NULL; struct check_blacklist_fs_t *new_arg; - + if (arg_no != 1) { LM_ERR("wrong number of parameters\n"); return -1; @@ -487,7 +477,7 @@ static int check_blacklist_fixup(void **arg, int arg_no) if (add_source(table) != 0) { LM_ERR("could not add table"); return -1; - } + } /* get the node that belongs to the table */ node = table2dt(table); @@ -509,7 +499,7 @@ static int check_blacklist_fixup(void **arg, int arg_no) } -static int check_blacklist(struct sip_msg *msg, struct check_blacklist_fs_t *arg1) +static int check_blacklist(sip_msg_t *msg, struct check_blacklist_fs_t *arg1) { void **nodeflags; char *ptr; @@ -555,7 +545,7 @@ static int check_blacklist(struct sip_msg *msg, struct check_blacklist_fs_t *arg return ret; } -static int check_whitelist(struct sip_msg *msg, struct check_blacklist_fs_t *arg1) +static int check_whitelist(sip_msg_t *msg, struct check_blacklist_fs_t *arg1) { void **nodeflags; char *ptr; @@ -705,8 +695,8 @@ static void dump_dtrie_mi(const struct dtrie_node_t *root, return ; } - /* If data found, add a new node to the reply tree */ - if (root->data) { + /* If data found, add a new node to the reply tree */ + if (root->data) { /* Create new node and add it to the roots's kids */ if(!(crt_node = add_mi_node_child(&reply->node, MI_DUP_NAME, prefix, *length, 0, 0)) ) { @@ -729,34 +719,34 @@ static void dump_dtrie_mi(const struct dtrie_node_t *root, LM_ERR("cannot add attributes to the node\n"); return ; } - } + } /* Perform a DFS search */ - for (i = 0; i < branches; i++) { - /* If child branch found, traverse it */ - if (root->child[i]) { - if (branches == 10) { - digit = i + '0'; - } else { - digit = i; - } - - /* Push digit in prefix stack */ + for (i = 0; i < branches; i++) { + /* If child branch found, traverse it */ + if (root->child[i]) { + if (branches == 10) { + digit = i + '0'; + } else { + digit = i; + } + + /* Push digit in prefix stack */ if (*length >= MAXNUMBERLEN + 1) { LM_ERR("prefix length exceeds %d\n", MAXNUMBERLEN + 1); return ; } - prefix[(*length)++] = digit; + prefix[(*length)++] = digit; - /* Recursive DFS call */ - dump_dtrie_mi(root->child[i], branches, prefix, length, reply); + /* Recursive DFS call */ + dump_dtrie_mi(root->child[i], branches, prefix, length, reply); - /* Pop digit from prefix stack */ - (*length)--; - } - } + /* Pop digit from prefix stack */ + (*length)--; + } + } - return ; + return ; } @@ -840,8 +830,8 @@ static struct mi_root * check_list_mi(struct mi_root* cmd, int list_type) switch (list_type) { case MARK_WHITELIST: - attr.s = WHITELISTED_S; - attr.len = WHITELISTED_LEN; + attr.s = WHITELISTED_S; + attr.len = WHITELISTED_LEN; if (ret == MARK_WHITELIST) { val.s = TRUE_S; @@ -850,8 +840,8 @@ static struct mi_root * check_list_mi(struct mi_root* cmd, int list_type) break; case MARK_BLACKLIST: - attr.s = BLACKLISTED_S; - attr.len = BLACKLISTED_LEN; + attr.s = BLACKLISTED_S; + attr.len = BLACKLISTED_LEN; if (ret == MARK_BLACKLIST) { val.s = TRUE_S; @@ -983,8 +973,8 @@ static struct mi_root * check_userlist_mi(struct mi_root* cmd, int list_type) switch (list_type) { case MARK_WHITELIST: - attr.s = WHITELISTED_S; - attr.len = WHITELISTED_LEN; + attr.s = WHITELISTED_S; + attr.len = WHITELISTED_LEN; if (ret == MARK_WHITELIST) { val.s = TRUE_S; @@ -993,8 +983,8 @@ static struct mi_root * check_userlist_mi(struct mi_root* cmd, int list_type) break; case MARK_BLACKLIST: - attr.s = BLACKLISTED_S; - attr.len = BLACKLISTED_LEN; + attr.s = BLACKLISTED_S; + attr.len = BLACKLISTED_LEN; if (ret == MARK_BLACKLIST) { val.s = TRUE_S; diff --git a/modules/usrloc/README b/modules/usrloc/README index b949dabf051..f49c2548981 100644 --- a/modules/usrloc/README +++ b/modules/usrloc/README @@ -12,17 +12,21 @@ Edited by Jan Janak +Edited by + Bogdan-Andrei Iancu +Edited by + Carsten Bock ng-voice GmbH - Copyright 2003 FhG FOKUS + Copyright © 2003 FhG FOKUS - Copyright 2005 Voice Sistem SRL + Copyright © 2005 Voice Sistem SRL - Copyright 2015 ng-voice GmbH + Copyright © 2015 ng-voice GmbH __________________________________________________________________ Table of Contents @@ -308,8 +312,8 @@ Chapter 1. Admin Guide check the Call-ID only (independent of the Contact-Header or Path). To find out how to control/select the contact maching algorithm, please - see the module parameter matching_mode - Section 3.26, "matching_mode - (integer)". + see the module parameter matching_mode - Section 3.26, “matching_mode + (integer)”. 2. Dependencies @@ -378,7 +382,7 @@ Chapter 1. Admin Guide is or not natted). This is a branch flag and it will be imported and used by all other modules depending of usrloc module. - Default value is "not set". + Default value is “not set”. Example 1.1. Set nat_bflag parameter ... @@ -389,7 +393,7 @@ modparam("usrloc", "nat_bflag", 3) Name of database column containing usernames. - Default value is "username". + Default value is “username”. Example 1.2. Set user_column parameter ... @@ -400,7 +404,7 @@ modparam("usrloc", "user_column", "username") Name of database column containing domains. - Default value is "domain". + Default value is “domain”. Example 1.3. Set user_column parameter ... @@ -411,7 +415,7 @@ modparam("usrloc", "domain_column", "domain") Name of database column containing contacts. - Default value is "contact". + Default value is “contact”. Example 1.4. Set contact_column parameter ... @@ -422,7 +426,7 @@ modparam("usrloc", "contact_column", "contact") Name of database column containing expires value. - Default value is "expires". + Default value is “expires”. Example 1.5. Set expires_column parameter ... @@ -433,7 +437,7 @@ modparam("usrloc", "expires_column", "expires") Name of database column containing q values. - Default value is "q". + Default value is “q”. Example 1.6. Set q_column parameter ... @@ -444,7 +448,7 @@ modparam("usrloc", "q_column", "q") Name of database column containing Call-ID values. - Default value is "callid". + Default value is “callid”. Example 1.7. Set callid_column parameter ... @@ -455,7 +459,7 @@ modparam("usrloc", "callid_column", "callid") Name of database column containing Cseq. - Default value is "cseq". + Default value is “cseq”. Example 1.8. Set cseq_column parameter ... @@ -466,7 +470,7 @@ modparam("usrloc", "cseq_column", "cseq") Name of database column containing supported methods. - Default value is "methods". + Default value is “methods”. Example 1.9. Set methods_column parameter ... @@ -477,7 +481,7 @@ modparam("usrloc", "methods_column", "methods") Name of database column to save the internal flags of the record. - Default value is "flags". + Default value is “flags”. Example 1.10. Set flags_column parameter ... @@ -488,7 +492,7 @@ modparam("usrloc", "flags_column", "flags") Name of database column to save the branch/contact flags of the record. - Default value is "cflags". + Default value is “cflags”. Example 1.11. Set cflags_column parameter ... @@ -499,7 +503,7 @@ modparam("usrloc", "cflags_column", "cflags") Name of database column containing user-agent values. - Default value is "user_agent". + Default value is “user_agent”. Example 1.12. Set user_agent_column parameter ... @@ -511,7 +515,7 @@ modparam("usrloc", "user_agent_column", "user_agent") Name of database column containing the source IP, port, and protocol from the REGISTER message. - Default value is "received". + Default value is “received”. Example 1.13. Set received_column parameter ... @@ -523,7 +527,7 @@ modparam("usrloc", "received_column", "received") Name of database column containing the received socket information (IP:port) for the REGISTER message. - Default value is "socket". + Default value is “socket”. Example 1.14. Set socket_column parameter ... @@ -534,7 +538,7 @@ modparam("usrloc", "socket_column", "socket") Name of database column containing the Path header. - Default value is "path". + Default value is “path”. Example 1.15. Set path_column parameter ... @@ -545,7 +549,7 @@ modparam("usrloc", "path_column", "path") Name of database column containing the Kamailio record unique id. - Default value is "ruid". + Default value is “ruid”. Example 1.16. Set ruid_column parameter ... @@ -557,7 +561,7 @@ modparam("usrloc", "ruid_column", "myruid") Name of database column containing the SIP instance ID (GRUU - RFC5627). This is a unique device identifier - UUID. - Default value is "instance". + Default value is “instance”. Example 1.17. Set instance_column parameter ... @@ -568,7 +572,7 @@ modparam("usrloc", "instance_column", "myinstance") Name of database table column containing the value for server id. - Default value is "server_id". + Default value is “server_id”. Example 1.18. Set server_id_column parameter ... @@ -579,7 +583,7 @@ modparam("usrloc", "server_id_column", "srv_id") Name of database table column containing the value for connection id. - Default value is "connection_id". + Default value is “connection_id”. Example 1.19. Set connection_id_column parameter ... @@ -591,7 +595,7 @@ modparam("usrloc", "connection_id_column", "con_id") Name of database table column containing the value for keepalive status. - Default value is "keepalive". + Default value is “keepalive”. Example 1.20. Set keepalive_column parameter ... @@ -604,7 +608,7 @@ modparam("usrloc", "keepalive_column", "kalive") identifing the user (along with the username part). Useful in multi domain scenarios. Non 0 value means true. - Default value is "0 (false)". + Default value is “0 (false)”. Example 1.21. Set use_domain parameter ... @@ -616,7 +620,7 @@ modparam("usrloc", "use_domain", 1) If the user's contacts should be kept timestamp ordered; otherwise the contact will be ordered based on q value. Non 0 value means true. - Default value is "0 (false)". + Default value is “0 (false)”. Example 1.22. Set desc_time_order parameter ... @@ -640,7 +644,7 @@ modparam("usrloc", "timer_interval", 120) URL of the database that should be used. - Default value is "mysql://kamailio:kamailiorw@localhost/kamailio". + Default value is “mysql://kamailio:kamailiorw@localhost/kamailio”. Example 1.24. Set db_url parameter ... @@ -701,7 +705,7 @@ modparam("usrloc", "db_mode", 2) 3.26. matching_mode (integer) What contact matching algorithm to be used. Refer to section - Section 1.1, "Contact matching" for the description of the algorithms. + Section 1.1, “Contact matching” for the description of the algorithms. The parameter may take the following values: * 0 - CONTACT ONLY based matching algorithm. @@ -731,7 +735,7 @@ modparam("usrloc", "matching_mode", 1) A value of 0 disable the retransmission detection. - Default value is "20 seconds". + Default value is “20 seconds”. Example 1.27. Set cseq_delay parameter ... @@ -745,7 +749,7 @@ modparam("usrloc", "cseq_delay", 5) startup. For 1MB of private memory (default) it should be below 4000. The database driver must support fetch_result() capability. - Default value is "2000". + Default value is “2000”. Example 1.28. Set fetch_rows parameter ... @@ -758,7 +762,7 @@ modparam("usrloc", "fetch_rows", 3000) location records is 2^hash_size. For hash_size=4, the number of slots of the hash table is 16. - Default value is "10" (1024 slots). + Default value is “10” (1024 slots). Example 1.29. Set hash_size parameter ... @@ -772,7 +776,7 @@ modparam("usrloc", "hash_size", 12) parameter only to load tables that are not used by registrar module directly in configuration file. - Default value is "NULL". + Default value is “NULL”. Example 1.30. Set preload parameter ... @@ -785,7 +789,7 @@ modparam("usrloc", "preload", "location") UPDATE DB operations. It is recommended to set this parameter if you use Cassandra as a DB backend. - Default value is "0". + Default value is “0”. Example 1.31. Set db_update_as_insert parameter ... @@ -800,7 +804,7 @@ modparam("usrloc", "db_update_as_insert", 1) parameter is ignored - e.g., MySQL and Postgres DB connectors offer affected_rows(). - Default value is "0" (no DB INSERT). + Default value is “0” (no DB INSERT). Example 1.32. Set db_check_update parameter ... @@ -814,7 +818,7 @@ modparam("usrloc", "db_check_update", 1) set to 0, no dedicated timer is started, the one from core will be used. - Default value is "0". + Default value is “0”. Example 1.33. Set timer_procs parameter ... @@ -828,7 +832,7 @@ modparam("usrloc", "timer_procs", 4) xavp_contact must also be set to the same value to use the t_load_contacts and t_next_contacts functions. - Default value is "NULL". + Default value is “NULL”. Example 1.34. Set xavp_contact parameter ... @@ -841,7 +845,7 @@ modparam("usrloc", "xavp_contact", "ulattrs") value. If it is set to 0, the old style using aor, contact and call-id is done. - Default value is "1". + Default value is “1”. Example 1.35. Set db_ops_ruid parameter ... @@ -854,7 +858,7 @@ modparam("usrloc", "db_ops_ruid", 0) TCP/TLS/WS/WSS transports when it looses corresponding tcp connections. Does not currently work in DB-Only scheme. - Default value is "0". + Default value is “0”. Example 1.36. Set handle_lost_tcp parameter ... @@ -866,7 +870,7 @@ modparam("usrloc", "handle_lost_tcp", 1) If set to 1, Kamailio will close the TCP connection when a contact has expired, if the corresponding transport is TCP/TLS/WS/WSS. - Default value is "0". + Default value is “0”. Example 1.37. Set close_expired_tcp parameter ... @@ -881,7 +885,7 @@ modparam("usrloc", "close_expired_tcp", 1) expected to be on default type 'DATETIME'. When it is 1, the database columns types have to be changed manually to 'BIGINT'. - Default value is "0". + Default value is “0”. Example 1.38. Set expires_type parameter ... @@ -896,7 +900,7 @@ modparam("usrloc", "expires_type", 1) (working for MySQL, PostgreSQL, ...). If it is set to 1, the query required by Oracle is used. - Default value is "0". + Default value is “0”. Example 1.39. Set db_raw_fetch_type parameter ... @@ -908,7 +912,7 @@ modparam("usrloc", "db_raw_fetch_type", 1) If set to 1, the insert operation to database will add null values in the sql statement. - Default value is "0" (don't add null fields in insert statement). + Default value is “0” (don't add null fields in insert statement). Example 1.40. Set db_insert_null parameter ... @@ -921,7 +925,7 @@ modparam("usrloc", "db_insert_null", 1) database, if socket value of the record does not in kamailio listening socket list. - Default value is "0". + Default value is “0”. Example 1.41. Set skip_remote_socket parameter ... @@ -934,7 +938,7 @@ modparam("usrloc", "skip_remote_socket", 1) for db_mode WRITE-BACK and WRITE-THROUGH. It uses the secondary timer process. - Default value is "0". + Default value is “0”. Example 1.42. Set db_timer_clean parameter ... @@ -954,7 +958,7 @@ modparam("usrloc", "db_timer_clean", 1) 5.5. ul_add 5.6. ul_show_contact -5.1. ul_rm +5.1. ul_rm Deletes an entire AOR record (including its contacts). @@ -963,7 +967,7 @@ modparam("usrloc", "db_timer_clean", 1) * AOR - user AOR in username[@domain] format (domain must be supplied only if use_domain option is on). -5.2. ul_rm_contact +5.2. ul_rm_contact Deletes a contact from an AOR record. @@ -973,20 +977,20 @@ modparam("usrloc", "db_timer_clean", 1) only if use_domain option is on). * contact - exact contact to be removed -5.3. ul_dump +5.3. ul_dump Dumps the entire content of the USRLOC in memory cache Parameters: * brief - (optional, may not be present); if equals to string - "brief", a brief dump will be done (only AOR and contacts, with no + “brief”, a brief dump will be done (only AOR and contacts, with no other details) -5.4. ul_flush +5.4. ul_flush Triggers the flush of USRLOC memory cache into DB. -5.5. ul_add +5.5. ul_add Adds a new contact for an user AOR. @@ -1002,7 +1006,7 @@ modparam("usrloc", "db_timer_clean", 1) * cflags - per branch flags of the contact * methods - mask with supported requests of the contact -5.6. ul_show_contact +5.6. ul_show_contact Dumps the contacts of an user AOR. @@ -1023,14 +1027,14 @@ modparam("usrloc", "db_timer_clean", 1) 6.8. ul.db_contacts 6.9. ul.db_expired_contacts -6.1. ul.dump +6.1. ul.dump Dumps the content of the location table Parameters: * None. -6.2. ul.lookup table AOR +6.2. ul.lookup table AOR Looks up the contents of an AOR entry in the location table @@ -1039,7 +1043,7 @@ modparam("usrloc", "db_timer_clean", 1) * AOR - user AOR in username[@domain] format (domain must be supplied only if use_domain option is on). -6.3. ul.rm table AOR +6.3. ul.rm table AOR Deletes an entire AOR record (including its contacts). @@ -1048,7 +1052,7 @@ modparam("usrloc", "db_timer_clean", 1) * AOR - user AOR in username[@domain] format (domain must be supplied only if use_domain option is on). -6.4. ul.rm_contact table AOR contact +6.4. ul.rm_contact table AOR contact Deletes a contact from an AOR record. @@ -1058,11 +1062,11 @@ modparam("usrloc", "db_timer_clean", 1) only if use_domain option is on). * contact - exact contact to be removed -6.5. ul.flush +6.5. ul.flush Triggers the flush of USRLOC memory cache into DB. -6.6. ul.add +6.6. ul.add Adds a new contact for an user AOR. @@ -1078,7 +1082,7 @@ modparam("usrloc", "db_timer_clean", 1) * cflags - per branch flags of the contact * methods - mask with supported requests of the contact -6.7. ul.db_users +6.7. ul.db_users Tell number of different users (AoRs) in a location table that have unexpired contacts. @@ -1087,7 +1091,7 @@ modparam("usrloc", "db_timer_clean", 1) * table name - location table where the users are looked for, for example, location. -6.8. ul.db_contacts +6.8. ul.db_contacts Tell number of unexpired contacts in a location table. @@ -1095,7 +1099,7 @@ modparam("usrloc", "db_timer_clean", 1) * table name - location table where the contacts are looked for, for example, location. -6.9. ul.db_expired_contacts +6.9. ul.db_expired_contacts Tell number of expired contacts in a location table. @@ -1184,7 +1188,7 @@ Chapter 2. Developer Guide 1.15. ul_register_ulcb(type ,callback, param) 1.16. ul_get_num_users() -1.1. ul_register_domain(name) +1.1. ul_register_domain(name) The function registers a new domain. Domain is just another name for table used in registrar. The function is called from fixups in @@ -1199,7 +1203,7 @@ Chapter 2. Developer Guide * const char* name - Name of the domain (also called table) to be registered. -1.2. ul_insert_urecord(domain, aor, rec) +1.2. ul_insert_urecord(domain, aor, rec) The function creates a new record structure and inserts it in the specified domain. The record is structure that contains all the @@ -1214,7 +1218,7 @@ Chapter 2. Developer Guide * urecord_t** rec - The newly created record structure. -1.3. ul_delete_urecord(domain, aor) +1.3. ul_delete_urecord(domain, aor) The function deletes all the contacts bound with the given Address Of Record. @@ -1226,7 +1230,7 @@ Chapter 2. Developer Guide * str* aor - Address of record (aka username) of the record, that should be deleted. -1.4. ul_delete_urecord_by_ruid(domain, ruid) +1.4. ul_delete_urecord_by_ruid(domain, ruid) The function deletes from given domain a contact with given ruid. @@ -1236,7 +1240,7 @@ Chapter 2. Developer Guide * str* ruid - ruid of contact that should be deleted. -1.5. ul_get_urecord(domain, aor) +1.5. ul_get_urecord(domain, aor) The function returns pointer to record with given Address of Record. @@ -1246,7 +1250,7 @@ Chapter 2. Developer Guide * str* aor - Address of Record of request record. -1.6. ul_lock_udomain(domain) +1.6. ul_lock_udomain(domain) The function lock the specified domain, it means, that no other processes will be able to access during the time. This prevents race @@ -1257,14 +1261,14 @@ Chapter 2. Developer Guide Meaning of the parameters is as follows: * udomain_t* domain - Domain to be locked. -1.7. ul_unlock_udomain(domain) +1.7. ul_unlock_udomain(domain) Unlock the specified domain previously locked by ul_lock_udomain. Meaning of the parameters is as follows: * udomain_t* domain - Domain to be unlocked. -1.8. ul_release_urecord(record) +1.8. ul_release_urecord(record) Do some sanity checks - if all contacts have been removed, delete the entire record structure. @@ -1272,7 +1276,7 @@ Chapter 2. Developer Guide Meaning of the parameters is as follows: * urecord_t* record - Record to be released. -1.9. ul_insert_ucontact(record, contact, expires, q, callid, cseq, flags, +1.9. ul_insert_ucontact(record, contact, expires, q, callid, cseq, flags, cont, ua, sock) The function inserts a new contact in the given record with specified @@ -1293,7 +1297,7 @@ cont, ua, sock) * struct socket_info *sock - socket on which the REGISTER message was received on. -1.10. ul_delete_ucontact (record, contact) +1.10. ul_delete_ucontact (record, contact) The function deletes given contact from record. @@ -1303,7 +1307,7 @@ cont, ua, sock) * ucontact_t* contact - Contact to be deleted. -1.11. ul_get_ucontact(record, contact) +1.11. ul_get_ucontact(record, contact) The function tries to find contact with given Contact URI and returns pointer to structure representing the contact. @@ -1313,13 +1317,13 @@ cont, ua, sock) * str_t* contact - URI of the request contact. -1.12. ul_get_all_ucontacts (buf, len, flags) +1.12. ul_get_all_ucontacts (buf, len, flags) The function retrieves all contacts of all registered users and returns them in the caller-supplied buffer. If the buffer is too small, the function returns positive value indicating how much additional space would be necessary to accommodate all of them. Please note that the - positive return value should be used only as a "hint", as there is no + positive return value should be used only as a “hint”, as there is no guarantee that during the time between two subsequent calls number of registered contacts will remain the same. @@ -1334,7 +1338,7 @@ cont, ua, sock) * unsigned int flags - Flags that must be set. -1.13. ul_update_ucontact(contact, expires, q, callid, cseq, set, res, ua, +1.13. ul_update_ucontact(contact, expires, q, callid, cseq, set, res, ua, sock) The function updates contact with new values. @@ -1353,7 +1357,7 @@ sock) * struct socket_info *sock - socket on which the REGISTER message was received on. -1.14. ul_bind_ursloc( api ) +1.14. ul_bind_ursloc( api ) The function imports all functions that are exported by the USRLOC module. Overs for other modules which want to user the internal USRLOC @@ -1362,7 +1366,7 @@ sock) Meaning of the parameters is as follows: * usrloc_api_t* api - USRLOC API -1.15. ul_register_ulcb(type ,callback, param) +1.15. ul_register_ulcb(type ,callback, param) The function register with USRLOC a callback function to be called when some event occures inside USRLOC. @@ -1375,6 +1379,6 @@ sock) * void *param - some parameter to be passed to the callback each time when it is called. -1.16. ul_get_num_users() +1.16. ul_get_num_users() The function loops through all domains summing up the number of users. diff --git a/modules/usrloc/dlist.c b/modules/usrloc/dlist.c index 65ea97b2e9f..08bc834a2b2 100644 --- a/modules/usrloc/dlist.c +++ b/modules/usrloc/dlist.c @@ -124,7 +124,7 @@ static inline int get_all_db_ucontacts(void *buf, int len, unsigned int flags, /* get the current time in DB format */ now.len = 25; now.s = now_s; - if (db_time2str( time(0), now.s, &now.len)!=0) { + if (db_time2str_ex( time(0), now.s, &now.len, 0)!=0) { LM_ERR("failed to print now time\n"); return -1; } diff --git a/modules/usrloc/udomain.c b/modules/usrloc/udomain.c index d57f212ca83..58fc9a31d02 100644 --- a/modules/usrloc/udomain.c +++ b/modules/usrloc/udomain.c @@ -697,6 +697,8 @@ urecord_t* db_load_urecord(db1_con_t* _c, udomain_t* _d, str *_aor) goto done; } + if(r==0) goto done; + for (c = r->contacts; c != NULL; c = c->next) { vals[0].val.str_val.s = c->ruid.s; vals[0].val.str_val.len = c->ruid.len; diff --git a/modules/usrloc/ul_mod.c b/modules/usrloc/ul_mod.c index fa72e2ba18b..24dde3df077 100644 --- a/modules/usrloc/ul_mod.c +++ b/modules/usrloc/ul_mod.c @@ -366,7 +366,10 @@ static int mod_init(void) } if(db_mode==WRITE_THROUGH || db_mode==WRITE_BACK) { if(ul_db_timer_clean!=0) { - sr_wtimer_add(ul_db_clean_timer, 0, timer_interval); + if(sr_wtimer_add(ul_db_clean_timer, 0, timer_interval)<0) { + LM_ERR("failed to add db clean timer routine\n"); + return -1; + } } } @@ -421,8 +424,10 @@ static int child_init(int _rank) return 0; case DB_ONLY: case WRITE_THROUGH: - /* connect to db only from SIP workers, TIMER and MAIN processes */ - if (_rank<=0 && _rank!=PROC_TIMER && _rank!=PROC_MAIN) + /* connect to db only from SIP workers, TIMER and MAIN processes, + * and RPC processes */ + if (_rank<=0 && _rank!=PROC_TIMER && _rank!=PROC_MAIN + && _rank!=PROC_RPC) return 0; break; case WRITE_BACK: diff --git a/modules/utils/README b/modules/utils/README index 73107b20480..ae080ee4f45 100644 --- a/modules/utils/README +++ b/modules/utils/README @@ -8,9 +8,9 @@ Carsten Bock ng-voice GmbH - Copyright 2008-2009 Juha Heinanen + Copyright © 2008-2009 Juha Heinanen - Copyright 2013-2015 Carsten Bock, ng-voice GmbH + Copyright © 2013-2015 Carsten Bock, ng-voice GmbH __________________________________________________________________ Table of Contents @@ -110,7 +110,7 @@ Chapter 1. Admin Guide deactivated. Function xcap_auth_status can be used to check from presence server - database, if watcher is authorized to subscribe event "presence" of + database, if watcher is authorized to subscribe event “presence” of presentity. 2. Dependencies @@ -179,7 +179,7 @@ modparam("utils", "http_response_trim", 1) Defines if the forwarding callback should be installed. - Default value is "0" - disabled. + Default value is “0” - disabled. Example 1.4. Set forward_active parameter ... @@ -203,7 +203,7 @@ modparam("utils", "pres_db_url", "mysql://foo:secret@localhost/pres") Defines the name of the xcap table in the presence server database. See the xcap_server module documentation for more information. - Default value is "xcap". + Default value is “xcap”. Example 1.6. Set xcap_table parameter ... @@ -215,21 +215,21 @@ modparam("utils", "xcap_table", "pres_xcap") 4.1. http_query(url, [post-data], [header-data], result) 4.2. xcap_auth_status(watcher_uri, presentity_uri) -4.1. http_query(url, [post-data], [header-data], result) +4.1. http_query(url, [post-data], [header-data], result) - Sends HTTP GET or POST request according to URL given in "url" + Sends HTTP GET or POST request according to URL given in “url” parameter, which is a string that may contain pseudo variables. - If you want to make a POST-Request, you have to define the "post"-data, + If you want to make a POST-Request, you have to define the “post”-data, that should be submitted in that request as the second parameter. If this parameter is empty, it is not set. If you want to add additional headers to the request, you have to - define the "header"-data, that should be submitted in that request as + define the “header”-data, that should be submitted in that request as the third parameter. If this parameter is empty, it is not set. If HTTP server returns a class 2xx, 3xx or 4xx reply, the first line of - the reply's body (if any) is stored in "result" parameter, which must + the reply's body (if any) is stored in “result” parameter, which must be a writable pseudo variable. Function returns reply code of HTTP reply or -1 if something went @@ -243,7 +243,7 @@ modparam("utils", "xcap_table", "pres_xcap") # GET-Request http_query("http://tutpro.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu{s .escape.param})", - "$var(result)") + "$var(result)"); switch ($retcode) { ... } @@ -252,7 +252,7 @@ switch ($retcode) { # POST-Request http_query("http://tutpro.com/index.php", "r_uri=$(ru{s.escape.param})&f_uri=$(f u{s.escape.param})", - "$var(result)") + "$var(result)"); switch ($retcode) { ... } @@ -261,16 +261,16 @@ switch ($retcode) { # GET-Request with additional headers and Post-Data. http_query("http://tutpro.com/index.php", "{ "alert": "Alert text goes here" }", "Content-Type: application/json" - "$var(result)") + "$var(result)"); switch ($retcode) { ... } ... -4.2. xcap_auth_status(watcher_uri, presentity_uri) +4.2. xcap_auth_status(watcher_uri, presentity_uri) Function checks in the presence server database if a watcher is - authorized to subscribe to event "presence" of presentity. Sphere + authorized to subscribe to event “presence” of presentity. Sphere checking is not included. Both watcher_uri and presentity_uri are pseudo variables. The function diff --git a/modules/utils/doc/utils_admin.xml b/modules/utils/doc/utils_admin.xml index 1c00eb123ab..4e9d58c5adf 100644 --- a/modules/utils/doc/utils_admin.xml +++ b/modules/utils/doc/utils_admin.xml @@ -237,7 +237,7 @@ modparam("utils", "xcap_table", "pres_xcap") ... # GET-Request http_query("http://tutpro.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu{s.escape.param})", - "$var(result)") + "$var(result)"); switch ($retcode) { ... } @@ -247,7 +247,7 @@ switch ($retcode) { ... # POST-Request http_query("http://tutpro.com/index.php", "r_uri=$(ru{s.escape.param})&f_uri=$(fu{s.escape.param})", - "$var(result)") + "$var(result)"); switch ($retcode) { ... } @@ -257,7 +257,7 @@ switch ($retcode) { ... # GET-Request with additional headers and Post-Data. http_query("http://tutpro.com/index.php", "{ "alert": "Alert text goes here" }", "Content-Type: application/json" - "$var(result)") + "$var(result)"); switch ($retcode) { ... } diff --git a/modules/utils/functions.c b/modules/utils/functions.c index 5de92ad8763..58f23cb88f0 100644 --- a/modules/utils/functions.c +++ b/modules/utils/functions.c @@ -228,5 +228,5 @@ int http_query(struct sip_msg* _m, char* _url, char* _dst, char* _post, char* _h curl_easy_cleanup(curl); pkg_free(stream.buf); - return stat; + return (stat!=0)?stat:-1; } diff --git a/modules/utils/xcap_auth.c b/modules/utils/xcap_auth.c index 35ef6b0538a..fd6be403391 100644 --- a/modules/utils/xcap_auth.c +++ b/modules/utils/xcap_auth.c @@ -17,15 +17,15 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ /*! * \file - * \brief Kamailio utils :: + * \brief Kamailio utils :: * \ingroup utils * Module: \ref utils */ @@ -49,484 +49,485 @@ xmlNodePtr get_rule_node(subs_t* subs, xmlDocPtr xcap_tree) { - str w_uri = {0, 0}; - char* id = NULL, *domain = NULL, *time_cont= NULL; - int apply_rule = -1; - xmlNodePtr ruleset_node = NULL, node1= NULL, node2= NULL; - xmlNodePtr cond_node = NULL, except_node = NULL; - xmlNodePtr identity_node = NULL; - xmlNodePtr iden_child; - xmlNodePtr validity_node, time_node; - time_t t_init, t_fin, t; - int valid= 0; - - uandd_to_uri(subs->from_user, subs->from_domain, &w_uri); - if (w_uri.s == NULL) { - LM_ERR("while creating uri\n"); - return NULL; - } - ruleset_node = xmlDocGetNodeByName(xcap_tree, "ruleset", NULL); - if (ruleset_node == NULL) { - LM_DBG("ruleset_node NULL\n"); - goto error; - } - for (node1 = ruleset_node->children; node1; node1 = node1->next) { - if (xmlStrcasecmp(node1->name, (unsigned char*)"text") == 0) - continue; - - /* process conditions */ - LM_DBG("node1->name= %s\n", node1->name); - - cond_node = xmlNodeGetChildByName(node1, "conditions"); - if(cond_node == NULL) { - LM_DBG("cond node NULL\n"); - goto error; + str w_uri = {0, 0}; + char* id = NULL, *domain = NULL, *time_cont= NULL; + int apply_rule = -1; + xmlNodePtr ruleset_node = NULL, node1= NULL, node2= NULL; + xmlNodePtr cond_node = NULL, except_node = NULL; + xmlNodePtr identity_node = NULL; + xmlNodePtr iden_child; + xmlNodePtr validity_node, time_node; + time_t t_init, t_fin, t; + int valid= 0; + + uandd_to_uri(subs->from_user, subs->from_domain, &w_uri); + if (w_uri.s == NULL) { + LM_ERR("while creating uri\n"); + return NULL; } - LM_DBG("cond_node->name= %s\n", cond_node->name); - - validity_node = xmlNodeGetChildByName(cond_node, "validity"); - if (validity_node != NULL) { - LM_DBG("found validity tag\n"); - - t= time(NULL); - - /* search all from-until pair */ - for (time_node = validity_node->children; time_node; - time_node = time_node->next) { - if (xmlStrcasecmp(time_node->name, (unsigned char*)"from")!= 0) - continue; - - time_cont= (char*)xmlNodeGetContent(time_node); - t_init= xml_parse_dateTime(time_cont); - xmlFree(time_cont); - if (t_init< 0) { - LM_ERR("failed to parse xml dateTime\n"); - goto error; - } + ruleset_node = xmlDocGetNodeByName(xcap_tree, "ruleset", NULL); + if (ruleset_node == NULL) { + LM_DBG("ruleset_node NULL\n"); + goto error; + } + for (node1 = ruleset_node->children; node1; node1 = node1->next) { + if (xmlStrcasecmp(node1->name, (unsigned char*)"text") == 0) + continue; - if (t< t_init) { - LM_DBG("the lower time limit is not respected\n"); - continue; - } - - time_node= time_node->next; - while (1) { - if (time_node == NULL) { - LM_ERR("bad formatted xml doc:until child not found in" - " validity pair\n"); + /* process conditions */ + LM_DBG("node1->name= %s\n", node1->name); + + cond_node = xmlNodeGetChildByName(node1, "conditions"); + if(cond_node == NULL) { + LM_DBG("cond node NULL\n"); goto error; - } - if( xmlStrcasecmp(time_node->name, - (unsigned char*)"until")== 0) - break; - time_node= time_node->next; - } - - time_cont = (char*)xmlNodeGetContent(time_node); - t_fin= xml_parse_dateTime(time_cont); - xmlFree(time_cont); - - if (t_fin< 0) { - LM_ERR("failed to parse xml dateTime\n"); - goto error; - } - - if (t <= t_fin) { - LM_DBG("the rule is active at this time\n"); - valid= 1; } - - } - - if (!valid) { - LM_DBG("the rule is not active at this time\n"); - continue; - } - - } - - identity_node = xmlNodeGetChildByName(cond_node, "identity"); - if (identity_node == NULL) { - LM_ERR("didn't find identity tag\n"); - goto error; - } - - iden_child = xmlNodeGetChildByName(identity_node, "one"); - if(iden_child) { - for (node2 = identity_node->children; node2; node2 = node2->next) { - if(xmlStrcasecmp(node2->name, (unsigned char*)"one")!= 0) - continue; - - id = xmlNodeGetAttrContentByName(node2, "id"); - if(id== NULL) { - LM_ERR("while extracting attribute\n"); - goto error; - } - if ((strlen(id)== w_uri.len && - (strncmp(id, w_uri.s, w_uri.len)==0))) { - apply_rule = 1; - xmlFree(id); - break; + LM_DBG("cond_node->name= %s\n", cond_node->name); + + validity_node = xmlNodeGetChildByName(cond_node, "validity"); + if (validity_node != NULL) { + LM_DBG("found validity tag\n"); + + t= time(NULL); + + /* search all from-until pair */ + for (time_node = validity_node->children; time_node; + time_node = time_node->next) { + if (xmlStrcasecmp(time_node->name, (unsigned char*)"from")!= 0) + continue; + + time_cont= (char*)xmlNodeGetContent(time_node); + t_init= xml_parse_dateTime(time_cont); + xmlFree(time_cont); + if (t_init< 0) { + LM_ERR("failed to parse xml dateTime\n"); + goto error; + } + + if (t< t_init) { + LM_DBG("the lower time limit is not respected\n"); + continue; + } + + time_node= time_node->next; + while (1) { + if (time_node == NULL) { + LM_ERR("bad formatted xml doc:until child not found in" + " validity pair\n"); + goto error; + } + if( xmlStrcasecmp(time_node->name, + (unsigned char*)"until")== 0) + break; + time_node= time_node->next; + } + + time_cont = (char*)xmlNodeGetContent(time_node); + t_fin= xml_parse_dateTime(time_cont); + xmlFree(time_cont); + + if (t_fin< 0) { + LM_ERR("failed to parse xml dateTime\n"); + goto error; + } + + if (t <= t_fin) { + LM_DBG("the rule is active at this time\n"); + valid= 1; + } + + } + + if (!valid) { + LM_DBG("the rule is not active at this time\n"); + continue; + } + } - xmlFree(id); - } - } - - /* search for many node*/ - iden_child = xmlNodeGetChildByName(identity_node, "many"); - if (iden_child) { - domain = NULL; - for (node2 = identity_node->children; node2; node2 = node2->next) { - if (xmlStrcasecmp(node2->name, (unsigned char*)"many") != 0) - continue; - - domain = xmlNodeGetAttrContentByName(node2, "domain"); - if(domain == NULL) { - LM_DBG("No domain attribute to many\n"); - } else { - LM_DBG("\n", domain); - if((strlen(domain)!= subs->from_domain.len && - strncmp(domain, subs->from_domain.s, - subs->from_domain.len) )) { - xmlFree(domain); - continue; - } + + identity_node = xmlNodeGetChildByName(cond_node, "identity"); + if (identity_node == NULL) { + LM_ERR("didn't find identity tag\n"); + goto error; } - xmlFree(domain); - apply_rule = 1; - if (node2->children == NULL) /* there is no exception */ - break; - - for (except_node = node2->children; except_node; - except_node= except_node->next) { - if(xmlStrcasecmp(except_node->name, - (unsigned char*)"except")) - continue; - id = xmlNodeGetAttrContentByName(except_node, "id"); - if (id != NULL) { - if((strlen(id)- 1== w_uri.len && - (strncmp(id, w_uri.s, w_uri.len)==0))) { - xmlFree(id); - apply_rule = 0; - break; + iden_child = xmlNodeGetChildByName(identity_node, "one"); + if(iden_child) { + for (node2 = identity_node->children; node2; node2 = node2->next) { + if(xmlStrcasecmp(node2->name, (unsigned char*)"one")!= 0) + continue; + + id = xmlNodeGetAttrContentByName(node2, "id"); + if(id== NULL) { + LM_ERR("while extracting attribute\n"); + goto error; + } + if ((strlen(id)== w_uri.len && + (strncmp(id, w_uri.s, w_uri.len)==0))) { + apply_rule = 1; + xmlFree(id); + break; + } + xmlFree(id); } - xmlFree(id); - } else { + } + + /* search for many node*/ + iden_child = xmlNodeGetChildByName(identity_node, "many"); + if (iden_child) { domain = NULL; - domain = xmlNodeGetAttrContentByName(except_node, - "domain"); - if(domain!=NULL) { - LM_DBG("Found except domain= %s\n- strlen(domain)= %d\n", - domain, (int)strlen(domain)); - if (strlen(domain)==subs->from_domain.len && - (strncmp(domain,subs->from_domain.s , - subs->from_domain.len)==0)) { - LM_DBG("except domain match\n"); + for (node2 = identity_node->children; node2; node2 = node2->next) { + if (xmlStrcasecmp(node2->name, (unsigned char*)"many") != 0) + continue; + + domain = xmlNodeGetAttrContentByName(node2, "domain"); + if(domain == NULL) { + LM_DBG("No domain attribute to many\n"); + } else { + LM_DBG("\n", domain); + if((strlen(domain)!= subs->from_domain.len && + strncmp(domain, subs->from_domain.s, + subs->from_domain.len) )) { + xmlFree(domain); + continue; + } + } xmlFree(domain); - apply_rule = 0; - break; - } - xmlFree(domain); - } - } + apply_rule = 1; + if (node2->children == NULL) /* there is no exception */ + break; + + for (except_node = node2->children; except_node; + except_node= except_node->next) { + if(xmlStrcasecmp(except_node->name, + (unsigned char*)"except")) + continue; + + id = xmlNodeGetAttrContentByName(except_node, "id"); + if (id != NULL) { + if((strlen(id)- 1== w_uri.len && + (strncmp(id, w_uri.s, w_uri.len)==0))) { + xmlFree(id); + apply_rule = 0; + break; + } + xmlFree(id); + } else { + domain = NULL; + domain = xmlNodeGetAttrContentByName(except_node, + "domain"); + if(domain!=NULL) { + LM_DBG("Found except domain= %s\n- strlen(domain)= %d\n", + domain, (int)strlen(domain)); + if (strlen(domain)==subs->from_domain.len && + (strncmp(domain,subs->from_domain.s , + subs->from_domain.len)==0)) { + LM_DBG("except domain match\n"); + xmlFree(domain); + apply_rule = 0; + break; + } + xmlFree(domain); + } + } + } + if (apply_rule == 1) /* if a match was found no need to keep searching*/ + break; + } } - if (apply_rule == 1) /* if a match was found no need to keep searching*/ - break; - } + if (apply_rule ==1) + break; } - if (apply_rule ==1) - break; - } - LM_DBG("apply_rule= %d\n", apply_rule); - if(w_uri.s!=NULL) - pkg_free(w_uri.s); + LM_DBG("apply_rule= %d\n", apply_rule); + if(w_uri.s!=NULL) + pkg_free(w_uri.s); - if( !apply_rule || !node1) - return NULL; - - return node1; + if( !apply_rule || !node1) + return NULL; + + return node1; - error: - if(w_uri.s) - pkg_free(w_uri.s); - return NULL; +error: + if(w_uri.s) + pkg_free(w_uri.s); + return NULL; } int pres_watcher_allowed(subs_t* subs) { - xmlDocPtr xcap_tree= NULL; - xmlNodePtr node= NULL, actions_node = NULL; - xmlNodePtr sub_handling_node = NULL; - char* sub_handling = NULL; - - subs->status= PENDING_STATUS; - subs->reason.s= NULL; - subs->reason.len= 0; - - if (subs->auth_rules_doc== NULL) - return 0; + xmlDocPtr xcap_tree= NULL; + xmlNodePtr node= NULL, actions_node = NULL; + xmlNodePtr sub_handling_node = NULL; + char* sub_handling = NULL; + + subs->status= PENDING_STATUS; + subs->reason.s= NULL; + subs->reason.len= 0; + + if (subs->auth_rules_doc== NULL) + return 0; + + xcap_tree= xmlParseMemory(subs->auth_rules_doc->s, + subs->auth_rules_doc->len); + if (xcap_tree== NULL) { + LM_ERR("parsing xml memory\n"); + return -1; + } - xcap_tree= xmlParseMemory(subs->auth_rules_doc->s, - subs->auth_rules_doc->len); - if (xcap_tree== NULL) { - LM_ERR("parsing xml memory\n"); - return -1; - } + node= get_rule_node(subs, xcap_tree); + if (node== NULL) { + xmlFreeDoc(xcap_tree); + return 0; + } - node= get_rule_node(subs, xcap_tree); - if (node== NULL) { - xmlFreeDoc(xcap_tree); - return 0; + /* process actions */ + actions_node = xmlNodeGetChildByName(node, "actions"); + if (actions_node == NULL) { + LM_DBG("actions_node NULL\n"); + xmlFreeDoc(xcap_tree); + return 0; } + LM_DBG("actions_node->name= %s\n", actions_node->name); - /* process actions */ - actions_node = xmlNodeGetChildByName(node, "actions"); - if (actions_node == NULL) { - LM_DBG("actions_node NULL\n"); - xmlFreeDoc(xcap_tree); - return 0; - } - LM_DBG("actions_node->name= %s\n", actions_node->name); - - sub_handling_node = xmlNodeGetChildByName(actions_node, "sub-handling"); - if (sub_handling_node== NULL) { - LM_DBG("sub_handling_node NULL\n"); - xmlFreeDoc(xcap_tree); - return 0; - } - sub_handling = (char*)xmlNodeGetContent(sub_handling_node); - LM_DBG("sub_handling_node->name= %s\n", sub_handling_node->name); - LM_DBG("sub_handling_node->content= %s\n", sub_handling); - - if (sub_handling == NULL) { - LM_ERR("Couldn't get sub-handling content\n"); - xmlFreeDoc(xcap_tree); - return -1; - } - if (strncmp((char*)sub_handling, "block", 5) == 0) { - subs->status = TERMINATED_STATUS;; - subs->reason.s= "rejected"; - subs->reason.len = 8; - } else - if (strncmp((char*)sub_handling, "confirm", 7) == 0) { - subs->status = PENDING_STATUS; - } else - if (strncmp((char*)sub_handling , "polite-block", 12) == 0) { - subs->status = ACTIVE_STATUS; - subs->reason.s= "polite-block"; - subs->reason.len = 12; - } - else - if (strncmp((char*)sub_handling, "allow", 5) == 0) { - subs->status = ACTIVE_STATUS; - subs->reason.s = NULL; - } - else { - LM_ERR("unknown subscription handling action\n"); + sub_handling_node = xmlNodeGetChildByName(actions_node, "sub-handling"); + if (sub_handling_node== NULL) { + LM_DBG("sub_handling_node NULL\n"); + xmlFreeDoc(xcap_tree); + return 0; + } + sub_handling = (char*)xmlNodeGetContent(sub_handling_node); + LM_DBG("sub_handling_node->name= %s\n", sub_handling_node->name); + LM_DBG("sub_handling_node->content= %s\n", sub_handling); + + if (sub_handling == NULL) { + LM_ERR("Couldn't get sub-handling content\n"); xmlFreeDoc(xcap_tree); - xmlFree(sub_handling); return -1; - } + } + if (strncmp((char*)sub_handling, "block", 5) == 0) { + subs->status = TERMINATED_STATUS; + subs->reason.s= "rejected"; + subs->reason.len = 8; + } else { + if (strncmp((char*)sub_handling, "confirm", 7) == 0) { + subs->status = PENDING_STATUS; + } else { + if (strncmp((char*)sub_handling , "polite-block", 12) == 0) { + subs->status = ACTIVE_STATUS; + subs->reason.s= "polite-block"; + subs->reason.len = 12; + } else { + if (strncmp((char*)sub_handling, "allow", 5) == 0) { + subs->status = ACTIVE_STATUS; + subs->reason.s = NULL; + } else { + LM_ERR("unknown subscription handling action\n"); + xmlFreeDoc(xcap_tree); + xmlFree(sub_handling); + return -1; + } + } + } + } xmlFreeDoc(xcap_tree); - xmlFree(sub_handling); + xmlFree(sub_handling); - return 0; + return 0; } int get_rules_doc(str* user, str* domain, int type, str** rules_doc) { - db_key_t query_cols[5]; - db_val_t query_vals[5]; - db_key_t result_cols[3]; - int n_query_cols = 0; - db1_res_t *result = 0; - db_row_t *row; - db_val_t *row_vals; - str body; - str* doc= NULL; - int n_result_cols= 0, xcap_doc_col; - static str tmp1 = str_init("username"); - static str tmp2 = str_init("domain"); - static str tmp3 = str_init("doc_type"); - static str tmp4 = str_init("doc"); - - LM_DBG("[user]= %.*s\t[domain]= %.*s", - user->len, user->s, domain->len, domain->s); - - query_cols[n_query_cols] = &tmp1; - query_vals[n_query_cols].type = DB1_STR; - query_vals[n_query_cols].nul = 0; - query_vals[n_query_cols].val.str_val = *user; - n_query_cols++; - - query_cols[n_query_cols] = &tmp2; - query_vals[n_query_cols].type = DB1_STR; - query_vals[n_query_cols].nul = 0; - query_vals[n_query_cols].val.str_val = *domain; - n_query_cols++; - - query_cols[n_query_cols] = &tmp3; - query_vals[n_query_cols].type = DB1_INT; - query_vals[n_query_cols].nul = 0; - query_vals[n_query_cols].val.int_val= type; - n_query_cols++; - - result_cols[xcap_doc_col= n_result_cols++] = &tmp4; - - if (pres_dbf.query(pres_dbh, query_cols, 0 , query_vals, result_cols, - n_query_cols, 1, 0, &result) < 0) { - LM_ERR("while querying table xcap for [user]=%.*s\t[domain]= %.*s\n", - user->len, user->s, domain->len, domain->s); - if (result) - pres_dbf.free_result(pres_dbh, result); - return -1; - } + db_key_t query_cols[5]; + db_val_t query_vals[5]; + db_key_t result_cols[3]; + int n_query_cols = 0; + db1_res_t *result = 0; + db_row_t *row; + db_val_t *row_vals; + str body; + str* doc= NULL; + int n_result_cols= 0, xcap_doc_col; + static str tmp1 = str_init("username"); + static str tmp2 = str_init("domain"); + static str tmp3 = str_init("doc_type"); + static str tmp4 = str_init("doc"); + + LM_DBG("[user]= %.*s\t[domain]= %.*s", + user->len, user->s, domain->len, domain->s); + + query_cols[n_query_cols] = &tmp1; + query_vals[n_query_cols].type = DB1_STR; + query_vals[n_query_cols].nul = 0; + query_vals[n_query_cols].val.str_val = *user; + n_query_cols++; + + query_cols[n_query_cols] = &tmp2; + query_vals[n_query_cols].type = DB1_STR; + query_vals[n_query_cols].nul = 0; + query_vals[n_query_cols].val.str_val = *domain; + n_query_cols++; + + query_cols[n_query_cols] = &tmp3; + query_vals[n_query_cols].type = DB1_INT; + query_vals[n_query_cols].nul = 0; + query_vals[n_query_cols].val.int_val= type; + n_query_cols++; + + result_cols[xcap_doc_col= n_result_cols++] = &tmp4; + + if (pres_dbf.query(pres_dbh, query_cols, 0 , query_vals, result_cols, + n_query_cols, 1, 0, &result) < 0) { + LM_ERR("while querying table xcap for [user]=%.*s\t[domain]= %.*s\n", + user->len, user->s, domain->len, domain->s); + if (result) + pres_dbf.free_result(pres_dbh, result); + return -1; + } - if(result == NULL) - return -1; + if(result == NULL) + return -1; + + if (result->n <= 0) { + LM_DBG("No document found in db table for [user]=%.*s" + "\t[domain]= %.*s\t[doc_type]= %d\n",user->len, user->s, + domain->len, domain->s, type); + pres_dbf.free_result(pres_dbh, result); + return 0; + } + + row = &result->rows[xcap_doc_col]; + row_vals = ROW_VALUES(row); + + body.s = (char*)row_vals[0].val.string_val; + if (body.s== NULL) { + LM_ERR("Xcap doc NULL\n"); + goto error; + } + body.len = strlen(body.s); + if (body.len== 0) { + LM_ERR("Xcap doc empty\n"); + goto error; + } + LM_DBG("xcap document:\n%.*s", body.len,body.s); + + doc= (str*)pkg_malloc(sizeof(str)); + if (doc== NULL) { + ERR_MEM(PKG_MEM_STR); + } + doc->s= (char*)pkg_malloc(body.len* sizeof(char)); + if (doc->s== NULL) { + pkg_free(doc); + ERR_MEM(PKG_MEM_STR); + } + memcpy(doc->s, body.s, body.len); + doc->len= body.len; + + *rules_doc= doc; + + if (result) + pres_dbf.free_result(pres_dbh, result); - if (result->n <= 0) { - LM_DBG("No document found in db table for [user]=%.*s" - "\t[domain]= %.*s\t[doc_type]= %d\n",user->len, user->s, - domain->len, domain->s, type); - pres_dbf.free_result(pres_dbh, result); return 0; - } - - row = &result->rows[xcap_doc_col]; - row_vals = ROW_VALUES(row); - - body.s = (char*)row_vals[0].val.string_val; - if (body.s== NULL) { - LM_ERR("Xcap doc NULL\n"); - goto error; - } - body.len = strlen(body.s); - if (body.len== 0) { - LM_ERR("Xcap doc empty\n"); - goto error; - } - LM_DBG("xcap document:\n%.*s", body.len,body.s); - - doc= (str*)pkg_malloc(sizeof(str)); - if (doc== NULL) { - ERR_MEM(PKG_MEM_STR); - } - doc->s= (char*)pkg_malloc(body.len* sizeof(char)); - if (doc->s== NULL) { - pkg_free(doc); - ERR_MEM(PKG_MEM_STR); - } - memcpy(doc->s, body.s, body.len); - doc->len= body.len; - - *rules_doc= doc; - - if (result) - pres_dbf.free_result(pres_dbh, result); - - return 0; error: - if (result) - pres_dbf.free_result(pres_dbh, result); + if (result) + pres_dbf.free_result(pres_dbh, result); - return -1; + return -1; } -/* +/* * Checks from presence server xcap table if watcher is authorized * to subscribe event 'presence' of presentity. */ int xcap_auth_status(struct sip_msg* _msg, char* _sp1, char* _sp2) { - pv_spec_t *sp; - pv_value_t pv_val; - str watcher_uri, presentity_uri; - struct sip_uri uri; - str* rules_doc = NULL; - subs_t subs; - int res; - - if (pres_dbh == 0) { - LM_ERR("function is disabled, to enable define pres_db_url\n"); - return -1; - } + pv_spec_t *sp; + pv_value_t pv_val; + str watcher_uri, presentity_uri; + struct sip_uri uri; + str* rules_doc = NULL; + subs_t subs; + int res; + + if (pres_dbh == 0) { + LM_ERR("function is disabled, to enable define pres_db_url\n"); + return -1; + } - sp = (pv_spec_t *)_sp1; + sp = (pv_spec_t *)_sp1; - if (sp && (pv_get_spec_value(_msg, sp, &pv_val) == 0)) { - if (pv_val.flags & PV_VAL_STR) { - watcher_uri = pv_val.rs; - if (watcher_uri.len == 0 || watcher_uri.s == NULL) { - LM_ERR("missing watcher uri\n"); - return -1; - } + if (sp && (pv_get_spec_value(_msg, sp, &pv_val) == 0)) { + if (pv_val.flags & PV_VAL_STR) { + watcher_uri = pv_val.rs; + if (watcher_uri.len == 0 || watcher_uri.s == NULL) { + LM_ERR("missing watcher uri\n"); + return -1; + } + } else { + LM_ERR("watcher pseudo variable value is not string\n"); + return -1; + } } else { - LM_ERR("watcher pseudo variable value is not string\n"); - return -1; + LM_ERR("cannot get watcher pseudo variable value\n"); + return -1; } - } else { - LM_ERR("cannot get watcher pseudo variable value\n"); - return -1; - } - sp = (pv_spec_t *)_sp2; + sp = (pv_spec_t *)_sp2; - if (sp && (pv_get_spec_value(_msg, sp, &pv_val) == 0)) { - if (pv_val.flags & PV_VAL_STR) { - presentity_uri = pv_val.rs; - if (presentity_uri.len == 0 || presentity_uri.s == NULL) { - LM_DBG("missing presentity uri\n"); - return -1; - } + if (sp && (pv_get_spec_value(_msg, sp, &pv_val) == 0)) { + if (pv_val.flags & PV_VAL_STR) { + presentity_uri = pv_val.rs; + if (presentity_uri.len == 0 || presentity_uri.s == NULL) { + LM_DBG("missing presentity uri\n"); + return -1; + } + } else { + LM_ERR("presentity pseudo variable value is not string\n"); + return -1; + } } else { - LM_ERR("presentity pseudo variable value is not string\n"); - return -1; + LM_ERR("cannot get presentity pseudo variable value\n"); + return -1; } - } else { - LM_ERR("cannot get presentity pseudo variable value\n"); - return -1; - } - if (parse_uri(presentity_uri.s, presentity_uri.len, &uri) < 0) { - LM_ERR("failed to parse presentity uri\n"); + if (parse_uri(presentity_uri.s, presentity_uri.len, &uri) < 0) { + LM_ERR("failed to parse presentity uri\n"); + return -1; + } + res = get_rules_doc(&uri.user, &uri.host, PRES_RULES, &rules_doc); + if ((res < 0) || (rules_doc == NULL) || (rules_doc->s == NULL)) { + LM_DBG("no xcap rules doc found for presentity uri\n"); + return PENDING_STATUS; + } + + if (parse_uri(watcher_uri.s, watcher_uri.len, &uri) < 0) { + LM_ERR("failed to parse watcher uri\n"); + goto err; + } + + subs.from_user = uri.user; + subs.from_domain = uri.host; + subs.pres_uri = presentity_uri; + subs.auth_rules_doc = rules_doc; + if (pres_watcher_allowed(&subs) < 0) { + LM_ERR("getting status from rules document\n"); + goto err; + } + LM_DBG("auth status of watcher <%.*s> on presentity <%.*s> is %d\n", + watcher_uri.len, watcher_uri.s, presentity_uri.len, presentity_uri.s, + subs.status); + pkg_free(rules_doc->s); + pkg_free(rules_doc); + return subs.status; + +err: + pkg_free(rules_doc->s); + pkg_free(rules_doc); return -1; - } - res = get_rules_doc(&uri.user, &uri.host, PRES_RULES, &rules_doc); - if ((res < 0) || (rules_doc == NULL) || (rules_doc->s == NULL)) { - LM_DBG("no xcap rules doc found for presentity uri\n"); - return PENDING_STATUS; - } - - if (parse_uri(watcher_uri.s, watcher_uri.len, &uri) < 0) { - LM_ERR("failed to parse watcher uri\n"); - goto err; - } - - subs.from_user = uri.user; - subs.from_domain = uri.host; - subs.pres_uri = presentity_uri; - subs.auth_rules_doc = rules_doc; - if (pres_watcher_allowed(&subs) < 0) { - LM_ERR("getting status from rules document\n"); - goto err; - } - LM_DBG("auth status of watcher <%.*s> on presentity <%.*s> is %d\n", - watcher_uri.len, watcher_uri.s, presentity_uri.len, presentity_uri.s, - subs.status); - pkg_free(rules_doc->s); - pkg_free(rules_doc); - return subs.status; - - err: - pkg_free(rules_doc->s); - pkg_free(rules_doc); - return -1; } diff --git a/modules/uuid/Makefile b/modules/uuid/Makefile index 102e57766fa..3fe7864212b 100644 --- a/modules/uuid/Makefile +++ b/modules/uuid/Makefile @@ -6,12 +6,15 @@ auto_gen= NAME=uuid.so ifeq ($(CROSS_COMPILE),) - BUILDER = $(shell which pkg-config) +BUILDER = $(shell \ + if pkg-config --exists uuid; then \ + echo 'pkg-config uuid'; \ + fi) endif ifneq ($(BUILDER),) - DEFS += $(shell $(BUILDER) --cflags uuid) - LIBS += $(shell $(BUILDER) --libs uuid) + DEFS += $(shell $(BUILDER) --cflags) + LIBS += $(shell $(BUILDER) --libs) else DEFS +=-I$(LOCALBASE)/include -I$(SYSBASE)/include LIBS+=-L$(LOCALBASE)/lib -L$(SYSBASE)/lib -luuid diff --git a/modules/uuid/README b/modules/uuid/README index 1be3f53e3ba..3034dab7003 100644 --- a/modules/uuid/README +++ b/modules/uuid/README @@ -10,7 +10,7 @@ Daniel-Constantin Mierla - Copyright 2014 asipto.com + Copyright © 2014 asipto.com __________________________________________________________________ Table of Contents diff --git a/modules/websocket/README b/modules/websocket/README index 270b5e21cbe..ff16e904896 100644 --- a/modules/websocket/README +++ b/modules/websocket/README @@ -4,7 +4,7 @@ Peter Dunkley Crocodile RCS Ltd - Copyright 2012-2013 Crocodile RCS Ltd + Copyright © 2012-2013 Crocodile RCS Ltd __________________________________________________________________ Table of Contents @@ -129,11 +129,11 @@ Chapter 1. Admin Guide 2.1. Initiating a connection A WebSocket connection is initiated with an HTTP GET. The xhttp module - is used to handle this GET and call the Section 5.1, " - ws_handle_handshake() " exported function. + is used to handle this GET and call the Section 5.1, “ + ws_handle_handshake() ” exported function. event_route[xhttp:request] should perform some validation of the HTTP - headers before calling Section 5.1, " ws_handle_handshake() ". The + headers before calling Section 5.1, “ ws_handle_handshake() ”. The event_route can also be used to make sure the HTTP GET has the correct URI, perform HTTP authentication on the WebSocket connection, and check the Origin header (RFC 6454) to ensure a browser-based SIP UA or MSRP @@ -437,7 +437,7 @@ modparam("websocket", "cors_mode", 2) 5.1. ws_handle_handshake() 5.2. ws_close([status, reason[, connection_id]]) -5.1. ws_handle_handshake() +5.1. ws_handle_handshake() This function checks an HTTP GET request for the required headers and values, and (if successful) upgrades the connection from HTTP to @@ -456,7 +456,7 @@ Note ws_handle_handshake(); ... -5.2. ws_close([status, reason[, connection_id]]) +5.2. ws_close([status, reason[, connection_id]]) This function closes a WebSocket connection. @@ -497,7 +497,7 @@ ws_close(4000, "Because I say so"); Name: ws.dump Parameters: - * order (optional) - "id_hash", "used_desc", or "used_asc". + * order (optional) - “id_hash”, “used_desc”, or “used_asc”. Note @@ -582,7 +582,7 @@ Note 7.1. websocket:closed -7.1. websocket:closed +7.1. websocket:closed When defined, the module calls event_route[websocket:closed] when a connection closes. The connection may be identified using the the $si diff --git a/modules/websocket/ws_frame.c b/modules/websocket/ws_frame.c index 16f79015838..833af22c4de 100644 --- a/modules/websocket/ws_frame.c +++ b/modules/websocket/ws_frame.c @@ -136,6 +136,8 @@ static str str_status_error_closing = str_init("Error closing connection"); static str str_status_error_sending = str_init("Error sending frame"); static str str_status_string_error = str_init("Error converting string to int"); +static int ws_send_crlf(ws_connection_t *wsc, int opcode); + static int encode_and_send_ws_frame(ws_frame_t *frame, conn_close_t conn_close) { int pos = 0, extended_length; @@ -680,10 +682,19 @@ int ws_frame_receive(void *data) case OPCODE_BINARY_FRAME: if (likely(frame.wsc->sub_protocol == SUB_PROTOCOL_SIP)) { - LM_DBG("Rx SIP message:\n%.*s\n", frame.payload_len, + LM_DBG("Rx SIP (or text) message:\n%.*s\n", frame.payload_len, frame.payload_data); update_stat(ws_sip_received_frames, 1); + if((frame.payload_len==CRLF_LEN + && strncmp(frame.payload_data, CRLF, CRLF_LEN)==0) + || (frame.payload_len==CRLFCRLF_LEN + && strncmp(frame.payload_data, CRLFCRLF, CRLFCRLF_LEN)==0)) + { + ws_send_crlf(frame.wsc, opcode); + wsconn_put(frame.wsc); + return 0; + } if (frame.fin) { @@ -788,7 +799,7 @@ int ws_frame_transmit(void *data) frame.payload_data); if (encode_and_send_ws_frame(&frame, CONN_CLOSE_DONT) < 0) - { + { LM_ERR("sending message\n"); wsconn_put(frame.wsc); @@ -813,7 +824,7 @@ static int ping_pong(ws_connection_t *wsc, int opcode) frame.wsc = wsc; if (encode_and_send_ws_frame(&frame, CONN_CLOSE_DONT) < 0) - { + { LM_ERR("sending keepalive\n"); return -1; } @@ -824,6 +835,25 @@ static int ping_pong(ws_connection_t *wsc, int opcode) return 0; } +static int ws_send_crlf(ws_connection_t *wsc, int opcode) +{ + ws_frame_t frame; + + memset(&frame, 0, sizeof(frame)); + frame.fin = 1; + frame.opcode = opcode; + frame.payload_len = CRLF_LEN; + frame.payload_data = CRLF; + frame.wsc = wsc; + + if (encode_and_send_ws_frame(&frame, CONN_CLOSE_DONT) < 0) { + LM_ERR("failed sending CRLF\n"); + return -1; + } + + return 0; +} + struct mi_root *ws_mi_close(struct mi_root *cmd, void *param) { unsigned int id; diff --git a/modules/xcap_client/README b/modules/xcap_client/README index 6ca0313f9fb..3606046f9f5 100644 --- a/modules/xcap_client/README +++ b/modules/xcap_client/README @@ -119,7 +119,7 @@ Chapter 1. Admin Guide The database url. - Default value is “mysql://openser:openserrw@localhost/openser”. + Default value is “mysql://kamailio:kamailiorw@localhost/kamailio”. Example 1.1. Set db_url parameter ... diff --git a/modules/xcap_server/README b/modules/xcap_server/README index ae39965094b..b68559d0b2e 100644 --- a/modules/xcap_server/README +++ b/modules/xcap_server/README @@ -319,7 +319,7 @@ event_route[xhttp:request] { target, domain, uri_adoc. Exported pseudo-variables are documented at - http://www.kamailio.org/dokuwiki/. + http://www.kamailio.org/wiki/. Example 1.11. $xcapuri(...) PV ... diff --git a/modules/xhttp/README b/modules/xhttp/README index c40302b0a03..46d4e94f57f 100644 --- a/modules/xhttp/README +++ b/modules/xhttp/README @@ -16,7 +16,7 @@ Alex Balashov - Copyright 2010 asipto.com + Copyright © 2010 asipto.com __________________________________________________________________ Table of Contents @@ -169,7 +169,7 @@ modparam("xhttp", "url_match", "^/sip/") 5.1. xhttp_reply(code, reason, ctype, body) -5.1. xhttp_reply(code, reason, ctype, body) +5.1. xhttp_reply(code, reason, ctype, body) Send back a reply with content-type and body. diff --git a/modules/xhttp_rpc/README b/modules/xhttp_rpc/README index b85f033e012..13cdd50aafa 100644 --- a/modules/xhttp_rpc/README +++ b/modules/xhttp_rpc/README @@ -41,6 +41,8 @@ Alex Balashov 4.1. dispatch_xhttp_rpc() + 5. Usage + List of Examples 1.1. Set xhttp_rpc_root parameter @@ -69,6 +71,8 @@ Chapter 1. Admin Guide 4.1. dispatch_xhttp_rpc() + 5. Usage + 1. Overview 1.1. Limitations @@ -168,3 +172,15 @@ event_route[xhttp:request] { "Wrong URL $hu"); } ... + +5. Usage + + The module is not intended to be used in a "scripted" mode with command + line tools. It only provides a simple web interface with all the + available RPC commands. Point a web browser to + http://serverip:port/http_rpc and browse through the available rpc + commands. + + If you don't configure a dedicated port for HTTP, then you have to use + same port as for SIP TCP. If you load and configure TLS module, then + you can browse using HTTPS to the SIP TLS port. diff --git a/modules/xhttp_rpc/doc/xhttp_rpc_admin.xml b/modules/xhttp_rpc/doc/xhttp_rpc_admin.xml index ca02556045f..e40fbf9108d 100644 --- a/modules/xhttp_rpc/doc/xhttp_rpc_admin.xml +++ b/modules/xhttp_rpc/doc/xhttp_rpc_admin.xml @@ -166,5 +166,20 @@ event_route[xhttp:request] {
+
+ Usage + + The module is not intended to be used in a "scripted" mode with + command line tools. + It only provides a simple web interface with all the available + RPC commands. Point a web browser to http://serverip:port/http_rpc + and browse through the available rpc commands. + + + If you don't configure a dedicated port for HTTP, then you have + to use same port as for SIP TCP. If you load and configure TLS + module, then you can browse using HTTPS to the SIP TLS port. + +
diff --git a/modules/xmlops/README b/modules/xmlops/README index 51893bfaa76..0ecfcb5ca05 100644 --- a/modules/xmlops/README +++ b/modules/xmlops/README @@ -1,4 +1,3 @@ - XMLOPS Module Daniel-Constantin Mierla @@ -6,8 +5,8 @@ Daniel-Constantin Mierla asipto.com - Copyright 2009 asipto.com - _________________________________________________________________ + Copyright © 2009 asipto.com + __________________________________________________________________ Table of Contents @@ -26,7 +25,7 @@ Daniel-Constantin Mierla 4. Pseudo-Variables - 4.1. $xml(name=>spec) + 4.1. $xml(name=>spec) List of Examples @@ -51,11 +50,11 @@ Chapter 1. Admin Guide 4. Pseudo-Variables - 4.1. $xml(name=>spec) + 4.1. $xml(name=>spec) 1. Overview - This is a module implementing functions and pseudo-variables for XML + This is a module implementing functions and pseudo-variables for XML operations. 2. Dependencies @@ -70,7 +69,7 @@ Chapter 1. Admin Guide 2.2. External Libraries or Applications - The following libraries or applications must be installed before + The following libraries or applications must be installed before running kamailio with this module loaded: * libxml - for compilation from source, the development headers from this library are needed as well. @@ -93,7 +92,7 @@ modparam("xmlops", "buf_size", 8192) 3.2. xml_ns (str) - Register xml namespace prefix. Parameter value must have the format: + Register xml namespace prefix. Parameter value must have the format: 'prefix=uri'. Example 1.2. Set xml_ns parameter @@ -103,11 +102,11 @@ modparam("xmlops", "xml_ns", "rpid=urn:ietf:params:xml:ns:pidf:rpid") 4. Pseudo-Variables - 4.1. $xml(name=>spec) + 4.1. $xml(name=>spec) 4.1. $xml(name=>spec) - Pseudo-variable for XML document operations using xpath syntax. For + Pseudo-variable for XML document operations using xpath syntax. For more see the Pseudo-Variables Cookbook. Example 1.3. xml usage diff --git a/modules/xmlrpc/README b/modules/xmlrpc/README index 1baff31fb8a..52554848e00 100644 --- a/modules/xmlrpc/README +++ b/modules/xmlrpc/README @@ -4,7 +4,7 @@ Jan Janak iptelorg GmbH - Copyright 2005 iptelorg GmbH + Copyright © 2005 iptelorg GmbH __________________________________________________________________ Table of Contents @@ -430,7 +430,7 @@ Content-Length: 276 3.3. Type Conversion The data types of the RPC API are converted to the data types of - XML-RPC and vice versa. Table 1, "Data Type Conversion" shows for each + XML-RPC and vice versa. Table 1, “Data Type Conversion” shows for each RPC API data type corresponding XML-RPC data type. Table 1. Data Type Conversion @@ -512,6 +512,8 @@ route[XMLRPC]{ sends an XMLRPC request from its commandline parameters). * examples/xmlrpc_test.py (basic python application that builds and sends an XMLRPC request from its commandline parameters). + * examples/xmlrpc_test2.py (basic python application that builds and + sends an XMLRPC request from its commandline parameters). * ser_ctl (complex python application that uses the XML-RPC interface implemented by the xmlrpc module). * serweb (php application that can use the XML-RPC interface to call @@ -668,7 +670,7 @@ modparam("xmlrpc", "url_match", "^/RPC2") 3.1. dispatch_rpc() 3.2. xmlrpc_reply(code, reason) -3.1. dispatch_rpc() +3.1. dispatch_rpc() This function processes an XMLRPC request, found in the body of the request. @@ -695,7 +697,7 @@ route[XMLRPC]{ dispatch_rpc(); } -3.2. xmlrpc_reply(code, reason) +3.2. xmlrpc_reply(code, reason) This function can be called from the config script to directly generate an XML-RPC reply. diff --git a/modules/xmlrpc/xmlrpc.c b/modules/xmlrpc/xmlrpc.c index 8761c02f41d..98835f9d9b6 100644 --- a/modules/xmlrpc/xmlrpc.c +++ b/modules/xmlrpc/xmlrpc.c @@ -24,6 +24,7 @@ #endif #define _XOPEN_SOURCE_EXTENDED 1 /* solaris */ #define _SVID_SOURCE 1 /* timegm */ +#define _DEFAULT_SOURCE 1 /* _SVID_SOURCE is deprecated */ #include #include @@ -145,13 +146,6 @@ MODULE_VERSION -#if defined (__OS_darwin) || defined (__OS_freebsd) -/* redeclaration of functions from stdio.h throws errors */ -#else -int snprintf(char *str, size_t size, const char *format, ...); -int vsnprintf(char *str, size_t size, const char *format, va_list ap); -#endif - static int process_xmlrpc(sip_msg_t* msg); static int dispatch_rpc(sip_msg_t* msg, char* s1, char* s2); static int xmlrpc_reply(sip_msg_t* msg, char* code, char* reason); @@ -1407,6 +1401,7 @@ static int get_string(char** val, struct xmlrpc_reply* reply, return -1; } type=xml_get_type(dbl); + LM_DBG("xmrpc parameter type: %d\n", type); switch(type){ case XML_T_STR: case XML_T_TXT: @@ -1423,7 +1418,7 @@ static int get_string(char** val, struct xmlrpc_reply* reply, return -1; } if (type == XML_T_TXT) - val_str = (char*)dbl->content; + val_str = (char*)xmlNodeGetContent(dbl); else val_str = (char*)xmlNodeListGetString(doc, dbl->xmlChildrenNode, 1); diff --git a/modules/xmpp/README b/modules/xmpp/README index a5605a1fb8f..a42a56a1ed1 100644 --- a/modules/xmpp/README +++ b/modules/xmpp/README @@ -10,7 +10,7 @@ Edited by Andreea Spirea - Copyright 2006 Voice Sistem SRL + Copyright © 2006 Voice Sistem SRL __________________________________________________________________ Table of Contents @@ -153,11 +153,11 @@ Chapter 1. Admin Guide Unless 'gwmap' parameter is set, in both modes (server or component), the destination address must have the same pattern: - "sip:usernamejabber_server@gateway_domain" + “sip:usernamejabber_server@gateway_domain” From a jabber client's point of view, the destination will look like: - "sip_usernamesip_domain@xmpp_domain" + “sip_usernamesip_domain@xmpp_domain” 'delim' is a character that can be set via 'domain_separator' parameter. @@ -343,7 +343,7 @@ Chapter 1. Admin Guide 4.1. xmpp_send_message() -4.1. xmpp_send_message() +4.1. xmpp_send_message() Converts SIP messages to XMPP(jabber) messages, in order to be relayed to a XMPP(jabber) client. diff --git a/modules/xmpp/xmpp_server.c b/modules/xmpp/xmpp_server.c index 380dd6442fe..6a9dfbe64fb 100644 --- a/modules/xmpp/xmpp_server.c +++ b/modules/xmpp/xmpp_server.c @@ -451,7 +451,7 @@ int xmpp_server_child_process(int data_pipe) int listen_fd; fd_set fdset; struct xmpp_connection *conn; - + snprintf(local_secret, sizeof(local_secret), "%s", random_secret()); while ((listen_fd = net_listen(xmpp_domain, xmpp_port)) < 0) { @@ -463,13 +463,17 @@ int xmpp_server_child_process(int data_pipe) FD_ZERO(&fdset); FD_SET(data_pipe, &fdset); FD_SET(listen_fd, &fdset); - + /* check for dead connections */ for (conn = conn_list; conn; ) { struct xmpp_connection *next = conn->next; - if (conn->type == CONN_DEAD) + if (conn->type == CONN_DEAD) { + if(conn == conn_list) { + conn_list = next; + } conn_free(conn); + } conn = next; } @@ -488,7 +492,7 @@ int xmpp_server_child_process(int data_pipe) } else { conn->type = CONN_DEAD; } - } + } if (conn->fd != -1) FD_SET(conn->fd, &fdset); diff --git a/modules/xprint/README b/modules/xprint/README index 3688619ba5e..4b0b4ee8c40 100644 --- a/modules/xprint/README +++ b/modules/xprint/README @@ -1,12 +1,11 @@ - The Xprint Module Elena-Ramona Modroiu Asipto - Copyright 2003 FhG FOKUS - _________________________________________________________________ + Copyright © 2003 FhG FOKUS + __________________________________________________________________ Table of Contents @@ -20,8 +19,8 @@ Elena-Ramona Modroiu 4. Functions - 4.1. xplog(level, format) - 4.2. xpdbg(format) + 4.1. xplog(level, format) + 4.2. xpdbg(format) 2. Developer Guide @@ -29,21 +28,21 @@ Elena-Ramona Modroiu 1.1. Functions - 1.1.1. int xbind(xl_api_t *xl_api) - 1.1.2. int xparse(char *s, xl_elog_p *el) - 1.1.3. int shm_xparse(char *s, xl_elog_p *el) - 1.1.4. int xparse2(char *s, xl_elog_p *el, - xl_parse_cb cb) + 1.1.1. int xbind(xl_api_t *xl_api) + 1.1.2. int xparse(char *s, xl_elog_p *el) + 1.1.3. int shm_xparse(char *s, xl_elog_p *el) + 1.1.4. int xparse2(char *s, xl_elog_p *el, xl_parse_cb + cb) 1.1.5. int shm_xparse2(char *s, xl_elog_p *el, - xl_parse_cb cb) + xl_parse_cb cb) - 1.1.6. xfree(xl_elog_p el) - 1.1.7. shm_xfree(xl_elog_p el) + 1.1.6. xfree(xl_elog_p el) + 1.1.7. shm_xfree(xl_elog_p el) 1.1.8. int xprint(struct sip_msg* msg, xl_elog_p el, - char *buf, int *len) + char *buf, int *len) - 1.1.9. str *xnulstr() + 1.1.9. str *xnulstr() List of Examples @@ -63,20 +62,20 @@ Chapter 1. Admin Guide 4. Functions - 4.1. xplog(level, format) - 4.2. xpdbg(format) + 4.1. xplog(level, format) + 4.2. xpdbg(format) 1. Overview - IMPORTANT: this is former xlog module from SIP Express Router (SER) - kept because it is used by other modules via API to get the value for - strings with specifiers. If you want to print log messages from + IMPORTANT: this is former xlog module from SIP Express Router (SER) + kept because it is used by other modules via API to get the value for + strings with specifiers. If you want to print log messages from configuration file, use the real module named 'xlog'. - This module provides the possibility to print user formatted log or - debug messages from SER scripts, similar to printf function but now a - specifier is replaced with a part of the SIP request. Section 2, - "Implemented Specifiers" shows what can be printed out. + This module provides the possibility to print user formatted log or + debug messages from SER scripts, similar to printf function but now a + specifier is replaced with a part of the SIP request. Section 2, + “Implemented Specifiers” shows what can be printed out. 2. Implemented Specifiers @@ -86,14 +85,14 @@ Chapter 1. Admin Guide * %ci : call-id * %cs : cseq * %ct : contact header - * %Cxy : color printing based on escape sequences (x - foreground - color, y - background color). The values for colors: x - default - color of the terminal; s - Black; r - Red; g - Green; y - Yellow; - b - Blue; p - Purple; c - Cyan; w - White + * %Cxy : color printing based on escape sequences (x - foreground + color, y - background color). The values for colors: x - default + color of the terminal; s - Black; r - Red; g - Green; y - Yellow; b + - Blue; p - Purple; c - Cyan; w - White * %ds : destination set * %fu : 'From' uri * %ft : 'From' tag - * %Hn : host's hostname (if system hostname is FQDN, part before + * %Hn : host's hostname (if system hostname is FQDN, part before first .) * %Hd : host's domain (if system hosntame is FQDN, part behind first .) @@ -112,7 +111,7 @@ Chapter 1. Admin Guide * %rr : reply's reason * %rs : reply's status * %rt : 'Refer-To' uri - * %Ri : IP address of the interface where the request has been + * %Ri : IP address of the interface where the request has been received * %Rp : received port * %si : IP source address @@ -125,32 +124,32 @@ Chapter 1. Admin Guide * %ua : User agent header field * %uq : unique id (per SER's process) - to make really unique id use %uq-%px-%mx or %uq-%px-%Tx - * %{name[N]} : print the body of the Nth header identified by - 'name'. If [N] is omitted then the body of the first header is - printed. The first header is got when N=0, for the second N=1, - a.s.o. To print the last header of that type, use -1, no other - negative values are supported now. No white spaces are allowed - inside the specifier (before }, before or after {, [, ] symbols). - When N='*', all headers of that type are printed. - The module should identify most of compact header names (the ones + * %{name[N]} : print the body of the Nth header identified by 'name'. + If [N] is omitted then the body of the first header is printed. The + first header is got when N=0, for the second N=1, a.s.o. To print + the last header of that type, use -1, no other negative values are + supported now. No white spaces are allowed inside the specifier + (before }, before or after {, [, ] symbols). When N='*', all + headers of that type are printed. + The module should identify most of compact header names (the ones recognized by ser which should be all at this moment), if not, the compact form has to be specified explicitely. It is recommended to - use dedicated specifiers for headers (e.g., %ua for user agent + use dedicated specifiers for headers (e.g., %ua for user agent header), if they are available -- they are faster. * % : print the value of AVP optionally %indexed by the [N] value It uses AVPs subindexing, e.g. if you don't specify subindex and there are more AVPs with the same name, the result is NULL. To - specify first AVP use [1], negative values are indexes counted + specify first AVP use [1], negative values are indexes counted backward through the list. - * %@select.framework[N].value : print the value of select framework - call. For detailed info what calls are available see select + * %@select.framework[N].value : print the value of select framework + call. For detailed info what calls are available see select framework documentation (and modules documentation, as modules can extend select framework calls). * %| or %(space) : end of %@select.framework identifier. If you need - to concatenate select framework call and another non-whitespace - literal, you need to explicitelly set the end of the select + to concatenate select framework call and another non-whitespace + literal, you need to explicitelly set the end of the select framework identifier. - E.g. %@ruri.user%|@%@ruri.host converts all featured request uri + E.g. %@ruri.user%|@%@ruri.host converts all featured request uri into user@host form only. 3. Parameters @@ -170,8 +169,8 @@ modparam("xprint", "buf_size", 8192) 4. Functions - 4.1. xplog(level, format) - 4.2. xpdbg(format) + 4.1. xplog(level, format) + 4.2. xpdbg(format) 4.1. xplog(level, format) @@ -214,35 +213,35 @@ Chapter 2. Developer Guide 1.1. Functions - 1.1.1. int xbind(xl_api_t *xl_api) - 1.1.2. int xparse(char *s, xl_elog_p *el) - 1.1.3. int shm_xparse(char *s, xl_elog_p *el) - 1.1.4. int xparse2(char *s, xl_elog_p *el, xl_parse_cb cb) + 1.1.1. int xbind(xl_api_t *xl_api) + 1.1.2. int xparse(char *s, xl_elog_p *el) + 1.1.3. int shm_xparse(char *s, xl_elog_p *el) + 1.1.4. int xparse2(char *s, xl_elog_p *el, xl_parse_cb cb) 1.1.5. int shm_xparse2(char *s, xl_elog_p *el, xl_parse_cb - cb) + cb) - 1.1.6. xfree(xl_elog_p el) - 1.1.7. shm_xfree(xl_elog_p el) + 1.1.6. xfree(xl_elog_p el) + 1.1.7. shm_xfree(xl_elog_p el) 1.1.8. int xprint(struct sip_msg* msg, xl_elog_p el, char - *buf, int *len) + *buf, int *len) - 1.1.9. str *xnulstr() + 1.1.9. str *xnulstr() 1. Module API 1.1. Functions - 1.1.1. int xbind(xl_api_t *xl_api) - 1.1.2. int xparse(char *s, xl_elog_p *el) - 1.1.3. int shm_xparse(char *s, xl_elog_p *el) - 1.1.4. int xparse2(char *s, xl_elog_p *el, xl_parse_cb cb) - 1.1.5. int shm_xparse2(char *s, xl_elog_p *el, xl_parse_cb cb) - 1.1.6. xfree(xl_elog_p el) - 1.1.7. shm_xfree(xl_elog_p el) + 1.1.1. int xbind(xl_api_t *xl_api) + 1.1.2. int xparse(char *s, xl_elog_p *el) + 1.1.3. int shm_xparse(char *s, xl_elog_p *el) + 1.1.4. int xparse2(char *s, xl_elog_p *el, xl_parse_cb cb) + 1.1.5. int shm_xparse2(char *s, xl_elog_p *el, xl_parse_cb cb) + 1.1.6. xfree(xl_elog_p el) + 1.1.7. shm_xfree(xl_elog_p el) 1.1.8. int xprint(struct sip_msg* msg, xl_elog_p el, char *buf, - int *len) + int *len) - 1.1.9. str *xnulstr() + 1.1.9. str *xnulstr() 1.1. Functions @@ -251,8 +250,8 @@ Chapter 2. Developer Guide Bind to the xprint module API. Meaning of the parameters is as follows: - * xl_api - structure that the xprint module functions are bind to. - The functions can be executed as xl_api.xparse(), + * xl_api - structure that the xprint module functions are bind to. + The functions can be executed as xl_api.xparse(), xl_api.xprint()... Return value: 0 - success, <0 - error. @@ -269,28 +268,28 @@ Chapter 2. Developer Guide 1.1.3. int shm_xparse(char *s, xl_elog_p *el) - Parse an xl-formatted string in shared memory. See xparse() function + Parse an xl-formatted string in shared memory. See xparse() function for details. 1.1.4. int xparse2(char *s, xl_elog_p *el, xl_parse_cb cb) - Parse an xl-formatted string in private memory. This function is able - to identify regular expression back references, for example \1, \2, - \3... When a back reference is found the callback function is called - that is supposed to farther parse the back reference and fill in the + Parse an xl-formatted string in private memory. This function is able + to identify regular expression back references, for example \1, \2, + \3... When a back reference is found the callback function is called + that is supposed to farther parse the back reference and fill in the xl_elog structure. Meaning of the parameters is as follows: * s - string to be parsed. * el - returned xl-lib list. - * cb - callback function for parsing the regular expression back + * cb - callback function for parsing the regular expression back references. - The prototype of the callback function is: typedef int (*xl_parse_cb) + The prototype of the callback function is: typedef int (*xl_parse_cb) (str *s, int shm, xl_elog_p el); Parameters of the callback function: - * s - regular expression back reference to be parsed (without the + * s - regular expression back reference to be parsed (without the leading '\' character). * shm - indicates whether or not shared memory needs to be used. (1: shared memory, 0: private memory) @@ -301,7 +300,7 @@ Chapter 2. Developer Guide 1.1.5. int shm_xparse2(char *s, xl_elog_p *el, xl_parse_cb cb) - Parse an xl-formatted string in shared memory supporting regular + Parse an xl-formatted string in shared memory supporting regular expression back references. See xparse2() function for details. 1.1.6. xfree(xl_elog_p el) @@ -326,7 +325,7 @@ Chapter 2. Developer Guide * msg - SIP message pointer. * el - xl-lib list to be evaluated. * buf - pre-allocated buffer that is filled in with the result. - * len - length of the printed string. len needs to be set to the + * len - length of the printed string. len needs to be set to the maximum length of the result buffer before calling this function. Return value: 0 - success, <0 - error. diff --git a/msg_translator.c b/msg_translator.c index bc2c3b20453..7130efe8e5f 100644 --- a/msg_translator.c +++ b/msg_translator.c @@ -400,7 +400,7 @@ char* id_builder(struct sip_msg* msg, unsigned int *id_len) -char* clen_builder( struct sip_msg* msg, int *clen_len, int diff, +char* clen_builder( struct sip_msg* msg, int *clen_len, int diff, int body_only) { char* buf; @@ -414,7 +414,8 @@ char* clen_builder( struct sip_msg* msg, int *clen_len, int diff, body=get_body(msg); if (body==0){ ser_error=E_BAD_REQ; - LM_ERR("no message body found (missing crlf?)"); + LM_ERR("no message body found (missing crlf?) [[%.*s]]\n", + msg->len, msg->buf); return 0; } value=msg->len-(int)(body-msg->buf)+diff; @@ -1688,7 +1689,8 @@ int get_boundary(struct sip_msg* msg, str* boundary) msg->content_type->body.len); if (params.s == NULL) { - LM_ERR("Content-Type hdr has no params\n"); + LM_INFO("Content-Type hdr has no params <%.*s>\n", + msg->content_type->body.len, msg->content_type->body.s); return -1; } params.len = msg->content_type->body.len - @@ -1749,7 +1751,10 @@ int check_boundaries(struct sip_msg *msg, struct dest_info *send_info) } tmp.s = buf.s; t = tmp.len = buf.len; - if(get_boundary(msg, &ob)!=0) return -1; + if(get_boundary(msg, &ob)!=0) { + if(tmp.s) pkg_free(tmp.s); + return -1; + } if(str_append(&ob, &bsuffix, &b)!=0) { LM_ERR("Can't append suffix to boundary\n"); goto error; diff --git a/parser/hf.c b/parser/hf.c index 3f2f879da80..963dd147128 100644 --- a/parser/hf.c +++ b/parser/hf.c @@ -211,6 +211,7 @@ void free_hdr_field_lst(struct hdr_field* hf) hf=hf->next; clean_hdr_field(foo); pkg_free(foo); + foo = 0; } } diff --git a/parser/msg_parser.c b/parser/msg_parser.c index 21b3cc2f464..8b211789541 100644 --- a/parser/msg_parser.c +++ b/parser/msg_parser.c @@ -93,14 +93,14 @@ char* get_hdr_field(char* const buf, char* const end, struct hdr_field* const hd tmp=parse_hname(buf, end, hdr); if (hdr->type==HDR_ERROR_T){ - LOG(L_ERR, "ERROR: get_hdr_field: bad header\n"); + ERR("bad header\n"); goto error; } /* eliminate leading whitespace */ tmp=eat_lws_end(tmp, end); if (tmp>=end) { - LOG(L_ERR, "ERROR: get_hdr_field: HF empty\n"); + ERR("HF empty\n"); goto error; } @@ -115,14 +115,14 @@ char* get_hdr_field(char* const buf, char* const end, struct hdr_field* const hd via_cnt++; vb=pkg_malloc(sizeof(struct via_body)); if (vb==0){ - LOG(L_ERR, "get_hdr_field: out of memory\n"); + ERR("out of memory\n"); goto error; } memset(vb,0,sizeof(struct via_body)); hdr->body.s=tmp; tmp=parse_via(tmp, end, vb); if (vb->error==PARSE_ERROR){ - LOG(L_ERR, "ERROR: get_hdr_field: bad via\n"); + ERR("bad via\n"); free_via_list(vb); goto error; } @@ -134,69 +134,64 @@ char* get_hdr_field(char* const buf, char* const end, struct hdr_field* const hd case HDR_CSEQ_T: cseq_b=pkg_malloc(sizeof(struct cseq_body)); if (cseq_b==0){ - LOG(L_ERR, "get_hdr_field: out of memory\n"); + ERR("out of memory\n"); goto error; } memset(cseq_b, 0, sizeof(struct cseq_body)); hdr->body.s=tmp; tmp=parse_cseq(tmp, end, cseq_b); if (cseq_b->error==PARSE_ERROR){ - LOG(L_ERR, "ERROR: get_hdr_field: bad cseq\n"); + ERR("bad cseq\n"); free_cseq(cseq_b); goto error; } hdr->parsed=cseq_b; hdr->body.len=tmp-hdr->body.s; - DBG("get_hdr_field: cseq <%.*s>: <%.*s> <%.*s>\n", - hdr->name.len, ZSW(hdr->name.s), - cseq_b->number.len, ZSW(cseq_b->number.s), - cseq_b->method.len, cseq_b->method.s); + DBG("cseq <%.*s>: <%.*s> <%.*s>\n", hdr->name.len, ZSW(hdr->name.s), + cseq_b->number.len, ZSW(cseq_b->number.s), cseq_b->method.len, + cseq_b->method.s); break; case HDR_TO_T: to_b=pkg_malloc(sizeof(struct to_body)); if (to_b==0){ - LOG(L_ERR, "get_hdr_field: out of memory\n"); + ERR("out of memory\n"); goto error; } memset(to_b, 0, sizeof(struct to_body)); hdr->body.s=tmp; tmp=parse_to(tmp, end,to_b); if (to_b->error==PARSE_ERROR){ - LOG(L_ERR, "ERROR: get_hdr_field: bad to header\n"); + ERR("bad to header\n"); free_to(to_b); goto error; } hdr->parsed=to_b; hdr->body.len=tmp-hdr->body.s; - DBG("DEBUG: get_hdr_field: <%.*s> [%d]; uri=[%.*s] \n", - hdr->name.len, ZSW(hdr->name.s), - hdr->body.len, to_b->uri.len,ZSW(to_b->uri.s)); - DBG("DEBUG: to body [%.*s]\n",to_b->body.len, - ZSW(to_b->body.s)); + DBG("<%.*s> [%d]; uri=[%.*s]\n", hdr->name.len, ZSW(hdr->name.s), + hdr->body.len, to_b->uri.len, ZSW(to_b->uri.s)); + DBG("to body [%.*s]\n", to_b->body.len, ZSW(to_b->body.s)); break; case HDR_CONTENTLENGTH_T: hdr->body.s=tmp; tmp=parse_content_length(tmp,end, &integer); if (tmp==0){ - LOG(L_ERR, "ERROR:get_hdr_field: bad content_length header\n"); + ERR("bad content_length header\n"); goto error; } hdr->parsed=(void*)(long)integer; hdr->body.len=tmp-hdr->body.s; - DBG("DEBUG: get_hdr_body : content_length=%d\n", - (int)(long)hdr->parsed); + DBG("content_length=%d\n", (int)(long)hdr->parsed); break; case HDR_RETRY_AFTER_T: hdr->body.s=tmp; tmp=parse_retry_after(tmp,end, &uval, &err); if (err){ - LOG(L_ERR, "ERROR:get_hdr_field: bad retry_after header\n"); + ERR("bad retry_after header\n"); goto error; } hdr->parsed=(void*)(unsigned long)uval; hdr->body.len=tmp-hdr->body.s; - DBG("DEBUG: get_hdr_body : retry_after=%d\n", - (unsigned)(long)hdr->parsed); + DBG("retry_after=%d\n", (unsigned)(long)hdr->parsed); break; case HDR_IDENTITY_T: case HDR_DATE_T: @@ -255,9 +250,7 @@ char* get_hdr_field(char* const buf, char* const end, struct hdr_field* const hd if (match){ match++; }else { - LOG(L_ERR, - "ERROR: get_hdr_field: bad body for <%s>(%d)\n", - hdr->name.s, hdr->type); + ERR("bad body for <%s>(%d)\n", hdr->name.s, hdr->type); /* abort(); */ tmp=end; goto error; @@ -268,8 +261,7 @@ char* get_hdr_field(char* const buf, char* const end, struct hdr_field* const hd hdr->body.len=match-hdr->body.s; break; default: - LOG(L_CRIT, "BUG: get_hdr_field: unknown header type %d\n", - hdr->type); + BUG("unknown header type %d\n", hdr->type); goto error; } /* jku: if \r covered by current length, shrink it */ @@ -277,7 +269,7 @@ char* get_hdr_field(char* const buf, char* const end, struct hdr_field* const hd hdr->len=tmp-hdr->name.s; return tmp; error: - DBG("get_hdr_field: error exit\n"); + DBG("error exit\n"); STATS_BAD_MSG_HDR(); hdr->type=HDR_ERROR_T; hdr->len=tmp-hdr->name.s; @@ -319,14 +311,14 @@ int parse_headers(struct sip_msg* const msg, const hdr_flags_t flags, const int orig_flag=0; #ifdef EXTRA_DEBUG - DBG("parse_headers: flags=%llx\n", (unsigned long long)flags); + DBG("flags=%llx\n", (unsigned long long)flags); #endif while( tmpparsed_flag) != flags){ prefetch_loc_r(tmp+64, 1); hf=pkg_malloc(sizeof(struct hdr_field)); if (unlikely(hf==0)){ ser_error=E_OUT_OF_MEM; - LOG(L_ERR, "ERROR:parse_headers: memory allocation error\n"); + ERR("memory allocation error\n"); goto error; } memset(hf,0, sizeof(struct hdr_field)); @@ -334,8 +326,7 @@ int parse_headers(struct sip_msg* const msg, const hdr_flags_t flags, const int rest=get_hdr_field(tmp, end, hf); switch (hf->type){ case HDR_ERROR_T: - LOG(L_INFO,"ERROR: bad header field [%.*s]\n", - (end-tmp>20)?20:(int)(end-tmp), tmp); + ERR("bad header field [%.*s]\n", (end-tmp>20)?20:(int)(end-tmp), tmp); goto error; case HDR_EOH_T: msg->eoh=tmp; /* or rest?*/ @@ -492,10 +483,9 @@ int parse_headers(struct sip_msg* const msg, const hdr_flags_t flags, const int break; case HDR_VIA_T: msg->parsed_flag|=HDR_VIA_F; - DBG("parse_headers: Via found, flags=%llx\n", - (unsigned long long)flags); + DBG("Via found, flags=%llx\n", (unsigned long long)flags); if (msg->via1==0) { - DBG("parse_headers: this is the first via\n"); + DBG("this is the first via\n"); msg->h_via1=hf; msg->via1=hf->parsed; if (msg->via1->next){ @@ -506,7 +496,7 @@ int parse_headers(struct sip_msg* const msg, const hdr_flags_t flags, const int msg->h_via2=hf; msg->via2=hf->parsed; msg->parsed_flag|=HDR_VIA2_F; - DBG("parse_headers: this is the second via\n"); + DBG("this is the second via\n"); } break; case HDR_DATE_T: @@ -541,8 +531,7 @@ int parse_headers(struct sip_msg* const msg, const hdr_flags_t flags, const int msg->parsed_flag|=HDR_REASON_F; break; default: - LOG(L_CRIT, "BUG: parse_headers: unknown header type %d\n", - hf->type); + BUG("unknown header type %d\n", hf->type); goto error; } /* add the header to the list*/ @@ -554,10 +543,8 @@ int parse_headers(struct sip_msg* const msg, const hdr_flags_t flags, const int msg->last_header=hf; } #ifdef EXTRA_DEBUG - DBG("header field type %d, name=<%.*s>, body=<%.*s>\n", - hf->type, - hf->name.len, ZSW(hf->name.s), - hf->body.len, ZSW(hf->body.s)); + DBG("header field type %d, name=<%.*s>, body=<%.*s>\n", hf->type, + hf->name.len, ZSW(hf->name.s), hf->body.len, ZSW(hf->body.s)); #endif tmp=rest; } @@ -601,22 +588,22 @@ int parse_msg(char* const buf, const unsigned int len, struct sip_msg* const msg tmp=rest; switch(fl->type){ case SIP_INVALID: - DBG("parse_msg: invalid message\n"); + DBG("invalid message\n"); goto error; break; case SIP_REQUEST: DBG("SIP Request:\n"); - DBG(" method: <%.*s>\n",fl->u.request.method.len, - ZSW(fl->u.request.method.s)); - DBG(" uri: <%.*s>\n",fl->u.request.uri.len, - ZSW(fl->u.request.uri.s)); - DBG(" version: <%.*s>\n",fl->u.request.version.len, - ZSW(fl->u.request.version.s)); + DBG(" method: <%.*s>\n", fl->u.request.method.len, + ZSW(fl->u.request.method.s)); + DBG(" uri: <%.*s>\n", fl->u.request.uri.len, + ZSW(fl->u.request.uri.s)); + DBG(" version: <%.*s>\n", fl->u.request.version.len, + ZSW(fl->u.request.version.s)); flags=HDR_VIA_F; break; case SIP_REPLY: DBG("SIP Reply (status):\n"); - DBG(" version: <%.*s>\n",fl->u.reply.version.len, + DBG(" version: <%.*s>\n", fl->u.reply.version.len, ZSW(fl->u.reply.version.s)); DBG(" status: <%.*s>\n", fl->u.reply.status.len, ZSW(fl->u.reply.status.s)); @@ -627,7 +614,7 @@ int parse_msg(char* const buf, const unsigned int len, struct sip_msg* const msg flags=HDR_VIA_F; break; default: - DBG("unknown type %d\n",fl->type); + DBG("unknown type %d\n", fl->type); goto error; } msg->unparsed=tmp; @@ -638,41 +625,30 @@ int parse_msg(char* const buf, const unsigned int len, struct sip_msg* const msg /* dump parsed data */ if (msg->via1){ DBG("first via: <%.*s/%.*s/%.*s> <%.*s:%.*s(%d)>", - msg->via1->name.len, - ZSW(msg->via1->name.s), - msg->via1->version.len, - ZSW(msg->via1->version.s), - msg->via1->transport.len, - ZSW(msg->via1->transport.s), - msg->via1->host.len, - ZSW(msg->via1->host.s), - msg->via1->port_str.len, - ZSW(msg->via1->port_str.s), - msg->via1->port); - if (msg->via1->params.s) DBG(";<%.*s>", - msg->via1->params.len, ZSW(msg->via1->params.s)); + msg->via1->name.len, ZSW(msg->via1->name.s), + msg->via1->version.len, ZSW(msg->via1->version.s), + msg->via1->transport.len, ZSW(msg->via1->transport.s), + msg->via1->host.len, ZSW(msg->via1->host.s), + msg->via1->port_str.len, ZSW(msg->via1->port_str.s), + msg->via1->port); + if (msg->via1->params.s) + DBG(";<%.*s>", msg->via1->params.len, ZSW(msg->via1->params.s)); if (msg->via1->comment.s) - DBG(" <%.*s>", - msg->via1->comment.len, ZSW(msg->via1->comment.s)); + DBG(" <%.*s>", msg->via1->comment.len, ZSW(msg->via1->comment.s)); DBG ("\n"); } if (msg->via2){ DBG("second via: <%.*s/%.*s/%.*s> <%.*s:%.*s(%d)>", - msg->via2->name.len, - ZSW(msg->via2->name.s), - msg->via2->version.len, - ZSW(msg->via2->version.s), - msg->via2->transport.len, - ZSW(msg->via2->transport.s), - msg->via2->host.len, - ZSW(msg->via2->host.s), - msg->via2->port_str.len, - ZSW(msg->via2->port_str.s), - msg->via2->port); - if (msg->via2->params.s) DBG(";<%.*s>", - msg->via2->params.len, ZSW(msg->via2->params.s)); - if (msg->via2->comment.s) DBG(" <%.*s>", - msg->via2->comment.len, ZSW(msg->via2->comment.s)); + msg->via2->name.len, ZSW(msg->via2->name.s), + msg->via2->version.len, ZSW(msg->via2->version.s), + msg->via2->transport.len, ZSW(msg->via2->transport.s), + msg->via2->host.len, ZSW(msg->via2->host.s), + msg->via2->port_str.len, ZSW(msg->via2->port_str.s), + msg->via2->port); + if (msg->via2->params.s) + DBG(";<%.*s>", msg->via2->params.len, ZSW(msg->via2->params.s)); + if (msg->via2->comment.s) + DBG(" <%.*s>", msg->via2->comment.len, ZSW(msg->via2->comment.s)); DBG ("\n"); } #endif @@ -748,7 +724,7 @@ int set_dst_uri(struct sip_msg* const msg, const str* const uri) char* ptr; if (unlikely(!msg || !uri)) { - LOG(L_ERR, "set_dst_uri: Invalid parameter value\n"); + ERR("Invalid parameter value\n"); return -1; } @@ -760,7 +736,7 @@ int set_dst_uri(struct sip_msg* const msg, const str* const uri) } else { ptr = (char*)pkg_malloc(uri->len); if (!ptr) { - LOG(L_ERR, "set_dst_uri: Not enough memory\n"); + ERR("Not enough memory\n"); return -1; } @@ -787,7 +763,7 @@ int set_path_vector(struct sip_msg* msg, str* path) char* ptr; if (unlikely(!msg || !path)) { - LM_ERR("invalid parameter value\n"); + ERR("invalid parameter value\n"); return -1; } @@ -799,7 +775,7 @@ int set_path_vector(struct sip_msg* msg, str* path) } else { ptr = (char*)pkg_malloc(path->len); if (!ptr) { - LM_ERR("not enough pkg memory\n"); + ERR("not enough pkg memory\n"); return -1; } @@ -829,7 +805,7 @@ int set_instance(struct sip_msg* msg, str* instance) char* ptr; if (unlikely(!msg || !instance)) { - LM_ERR("invalid instance parameter value\n"); + ERR("invalid instance parameter value\n"); return -1; } @@ -841,7 +817,7 @@ int set_instance(struct sip_msg* msg, str* instance) } else { ptr = (char*)pkg_malloc(instance->len); if (!ptr) { - LM_ERR("not enough pkg memory for instance\n"); + ERR("not enough pkg memory for instance\n"); return -1; } memcpy(ptr, instance->s, instance->len); @@ -868,7 +844,7 @@ int set_ruid(struct sip_msg* msg, str* ruid) char* ptr; if (unlikely(!msg || !ruid)) { - LM_ERR("invalid ruid parameter value\n"); + ERR("invalid ruid parameter value\n"); return -1; } @@ -880,7 +856,7 @@ int set_ruid(struct sip_msg* msg, str* ruid) } else { ptr = (char*)pkg_malloc(ruid->len); if (!ptr) { - LM_ERR("not enough pkg memory for ruid\n"); + ERR("not enough pkg memory for ruid\n"); return -1; } memcpy(ptr, ruid->s, ruid->len); @@ -907,7 +883,7 @@ int set_ua(struct sip_msg* msg, str* location_ua) char* ptr; if (unlikely(!msg || !location_ua)) { - LM_ERR("invalid location_ua parameter value\n"); + ERR("invalid location_ua parameter value\n"); return -1; } @@ -919,7 +895,7 @@ int set_ua(struct sip_msg* msg, str* location_ua) } else { ptr = (char*)pkg_malloc(location_ua->len); if (!ptr) { - LM_ERR("not enough pkg memory for location_ua\n"); + ERR("not enough pkg memory for location_ua\n"); return -1; } memcpy(ptr, location_ua->s, location_ua->len); @@ -1049,7 +1025,7 @@ int get_src_uri(sip_msg_t *m, int tmode, str *uri) str proto; if (!uri || !m) { - LM_ERR("invalid parameter value\n"); + ERR("invalid parameter value\n"); return -1; } @@ -1062,13 +1038,13 @@ int get_src_uri(sip_msg_t *m, int tmode, str *uri) break; default: if(get_valid_proto_string(m->rcv.proto, 1, 0, &proto)<0) { - LM_ERR("unknown transport protocol\n"); + ERR("unknown transport protocol\n"); return -1; } } } else { if(get_valid_proto_string(m->rcv.proto, 1, 0, &proto)<0) { - LM_ERR("unknown transport protocol\n"); + ERR("unknown transport protocol\n"); return -1; } } @@ -1085,7 +1061,7 @@ int get_src_uri(sip_msg_t *m, int tmode, str *uri) } if (len > MAX_URI_SIZE) { - LM_ERR("buffer too small\n"); + ERR("buffer too small\n"); return -1; } @@ -1118,3 +1094,50 @@ int get_src_uri(sip_msg_t *m, int tmode, str *uri) return 0; } + +/*! \brief returns a pointer to the begining of the msg's body + */ +char* get_body(sip_msg_t* const msg) +{ + int offset; + unsigned int len; + + if ( parse_headers(msg, HDR_EOH_F, 0)==-1 ) { + LM_ERR("failed to parse to end of headers\n"); + return 0; + } + + if (msg->unparsed) { + len=(unsigned int)(msg->unparsed-msg->buf); + } else { + LM_ERR("unparsed hook for end of headers is not set\n"); + return 0; + } + + if ((len+2<=msg->len) && (strncmp(CRLF,msg->unparsed,CRLF_LEN)==0) ) { + offset = CRLF_LEN; + } else if ( (len+1<=msg->len) && + (*(msg->unparsed)=='\n' || *(msg->unparsed)=='\r' ) ) { + offset = 1; + } else { + LM_ERR("failed to locate end of headers (%p %p - %d %d [%s])\n", + msg->buf, msg->unparsed, msg->len, len, msg->unparsed); + return 0; + } + + return msg->unparsed + offset; +} + +/*! \brief make sure all HFs needed for transaction identification have been + * parsed; return 0 if those HFs can't be found +*/ +int check_transaction_quadruple(sip_msg_t* const msg) +{ + if ( parse_headers(msg, HDR_FROM_F|HDR_TO_F|HDR_CALLID_F|HDR_CSEQ_F,0)!=-1 + && msg->from && msg->to && msg->callid && msg->cseq ) { + return 1; + } else { + ser_error=E_BAD_TUPEL; + return 0; + } +} diff --git a/parser/msg_parser.h b/parser/msg_parser.h index c4e426a4131..8628670119d 100644 --- a/parser/msg_parser.h +++ b/parser/msg_parser.h @@ -19,7 +19,7 @@ * */ -/*! \file +/*! \file * \brief Parser :: ??? * * \ingroup parser @@ -83,9 +83,9 @@ typedef enum request_method { #define FL_SDP_PORT_AFS (1 << 3) /*!< SDP port rewritten */ #define FL_SHM_CLONE (1 << 4) /*!< msg cloned in SHM as a single chunk */ #define FL_TIMEOUT (1 << 5) /*!< message belongs to an "expired" branch - (for failure route use) */ + (for failure route use) */ #define FL_REPLIED (1 << 6) /*!< message branch received at least one reply - (for failure route use) */ + (for failure route use) */ #define FL_HASH_INDEX (1 << 7) /*!< msg->hash_index contains a valid value (tm use)*/ #define FL_MTU_TCP_FB (1 << 8) @@ -118,32 +118,32 @@ typedef enum request_method { #define IFISMETHOD(methodname,firstchar) \ if ( (*tmp==(firstchar) || *tmp==((firstchar) | 32)) && \ - strncasecmp( tmp+1, #methodname +1, methodname##_LEN-1)==0 && \ - *(tmp+methodname##_LEN)==' ') { \ - fl->type=SIP_REQUEST; \ - fl->u.request.method.len=methodname##_LEN; \ - fl->u.request.method_value=METHOD_##methodname; \ - tmp=buffer+methodname##_LEN; \ + strncasecmp( tmp+1, #methodname +1, methodname##_LEN-1)==0 && \ + *(tmp+methodname##_LEN)==' ') { \ + fl->type=SIP_REQUEST; \ + fl->u.request.method.len=methodname##_LEN; \ + fl->u.request.method_value=METHOD_##methodname; \ + tmp=buffer+methodname##_LEN; \ } #define IS_HTTP(req) \ - ((req)->first_line.u.request.version.len >= HTTP_VERSION_LEN && \ - !strncasecmp((req)->first_line.u.request.version.s, \ + ((req)->first_line.u.request.version.len >= HTTP_VERSION_LEN && \ + !strncasecmp((req)->first_line.u.request.version.s, \ HTTP_VERSION, HTTP_VERSION_LEN)) #define IS_SIP(req) \ - ((req)->first_line.u.request.version.len >= SIP_VERSION_LEN && \ - !strncasecmp((req)->first_line.u.request.version.s, \ + ((req)->first_line.u.request.version.len >= SIP_VERSION_LEN && \ + !strncasecmp((req)->first_line.u.request.version.s, \ SIP_VERSION, SIP_VERSION_LEN)) #define IS_HTTP_REPLY(rpl) \ - ((rpl)->first_line.u.reply.version.len >= HTTP_VERSION_LEN && \ - !strncasecmp((rpl)->first_line.u.reply.version.s, \ + ((rpl)->first_line.u.reply.version.len >= HTTP_VERSION_LEN && \ + !strncasecmp((rpl)->first_line.u.reply.version.s, \ HTTP_VERSION, HTTP_VERSION_LEN)) #define IS_SIP_REPLY(rpl) \ - ((rpl)->first_line.u.reply.version.len >= SIP_VERSION_LEN && \ - !strncasecmp((rpl)->first_line.u.reply.version.s, \ + ((rpl)->first_line.u.reply.version.len >= SIP_VERSION_LEN && \ + !strncasecmp((rpl)->first_line.u.reply.version.s, \ SIP_VERSION, SIP_VERSION_LEN)) /*! \brief @@ -184,10 +184,10 @@ struct sip_uri { str port; /*!< Port number */ str params; /*!< Parameters */ str sip_params; /*!< Parameters of the sip: URI. - * (If a tel: URI is embedded in a sip: URI, then - * params points to the parameters of the tel: URI, - * and sip_params to the parameters of the sip: URI. - */ + * (If a tel: URI is embedded in a sip: URI, then + * params points to the parameters of the tel: URI, + * and sip_params to the parameters of the sip: URI. + */ str headers; unsigned short port_no; unsigned short proto; /*!< from transport */ @@ -228,10 +228,10 @@ typedef enum msg_body_type { /*! \brief This structure represents a generic SIP message body, regardless of the * body type. - * + * * Body parsers are supposed to cast this structure to some other * body-type specific structure, but the body type specific structure must - * retain msg_body_type variable and a pointer to the free function as the + * retain msg_body_type variable and a pointer to the free function as the * first two variables within the structure. */ typedef struct msg_body { @@ -270,10 +270,10 @@ typedef struct sip_msg { struct hdr_field* last_header; /*!< Pointer to the last parsed header*/ hdr_flags_t parsed_flag; /*!< Already parsed header field types */ - /* Via, To, CSeq, Call-Id, From, end of header*/ - /* pointers to the first occurrences of these headers; - * everything is also saved in 'headers' - * (WARNING: do not deallocate them twice!)*/ + /* Via, To, CSeq, Call-Id, From, end of header*/ + /* pointers to the first occurrences of these headers; + * everything is also saved in 'headers' + * (WARNING: do not deallocate them twice!)*/ struct hdr_field* h_via1; struct hdr_field* h_via2; @@ -327,22 +327,22 @@ typedef struct sip_msg { struct receive_info rcv; /*!< source & dest ip, ports, proto a.s.o*/ char* buf; /*!< scratch pad, holds a modified message, - * via, etc. point into it */ + * via, etc. point into it */ unsigned int len; /*!< message len (orig) */ - /* modifications */ + /* modifications */ str new_uri; /*!< changed first line uri, when you change this - don't forget to set parsed_uri_ok to 0*/ + don't forget to set parsed_uri_ok to 0*/ str dst_uri; /*!< Destination URI, must be forwarded to this URI if len != 0 */ /* current uri */ int parsed_uri_ok; /*!< 1 if parsed_uri is valid, 0 if not, set if to 0 - if you modify the uri (e.g change new_uri)*/ + if you modify the uri (e.g change new_uri)*/ struct sip_uri parsed_uri; /*!< speed-up > keep here the parsed uri*/ int parsed_orig_ruri_ok; /*!< 1 if parsed_orig_uri is valid, 0 if not, set if to 0 - if you modify the uri (e.g change new_uri)*/ + if you modify the uri (e.g change new_uri)*/ struct sip_uri parsed_orig_ruri; /*!< speed-up > keep here the parsed orig uri*/ struct lump* add_rm; /*!< used for all the forwarded requests/replies */ @@ -350,11 +350,12 @@ typedef struct sip_msg { struct lump_rpl *reply_lump; /*!< only for localy generated replies !!!*/ /*! \brief str add_to_branch; - whatever whoever want to append to Via branch comes here */ + whatever whoever want to append to Via branch comes here */ char add_to_branch_s[MAX_BRANCH_PARAM_LEN]; int add_to_branch_len; - unsigned int hash_index; /*!< index to TM hash table; stored in core to avoid unnecessary calculations */ + unsigned int hash_index; /*!< index to TM hash table; stored in core + to avoid unnecessary calculations */ unsigned int msg_flags; /*!< internal flags used by core */ flag_t flags; /*!< config flags */ str set_global_address; @@ -378,8 +379,8 @@ typedef struct sip_msg { } sip_msg_t; /*! \brief pointer to a fakes message which was never received ; - (when this message is "relayed", it is generated out - of the original request) + (when this message is "relayed", it is generated out + of the original request) */ #define FAKED_REPLY ((struct sip_msg *) -1) @@ -401,44 +402,13 @@ char* get_hdr_field(char* const buf, char* const end, struct hdr_field* const hd void free_sip_msg(struct sip_msg* const msg); /*! \brief make sure all HFs needed for transaction identification have been - parsed; return 0 if those HFs can't be found + parsed; return 0 if those HFs can't be found */ -inline static int check_transaction_quadruple(struct sip_msg* const msg) -{ - if ( parse_headers(msg, HDR_FROM_F|HDR_TO_F|HDR_CALLID_F|HDR_CSEQ_F,0)!=-1 - && msg->from && msg->to && msg->callid && msg->cseq ) { - return 1; - } else { - ser_error=E_BAD_TUPEL; - return 0; - } -} - - +int check_transaction_quadruple(sip_msg_t* const msg); /*! \brief returns a pointer to the begining of the msg's body */ -inline static char* get_body(struct sip_msg* const msg) -{ - int offset; - unsigned int len; - - if ( parse_headers(msg, HDR_EOH_F, 0)==-1 ) - return 0; - - if (msg->unparsed){ - len=(unsigned int)(msg->unparsed-msg->buf); - }else return 0; - if ((len+2<=msg->len) && (strncmp(CRLF,msg->unparsed,CRLF_LEN)==0) ) - offset = CRLF_LEN; - else if ( (len+1<=msg->len) && - (*(msg->unparsed)=='\n' || *(msg->unparsed)=='\r' ) ) - offset = 1; - else - return 0; - - return msg->unparsed + offset; -} +char* get_body(sip_msg_t* const msg); /*! \brief If the new_uri is set, then reset it */ void reset_new_uri(struct sip_msg* const msg); @@ -454,7 +424,8 @@ void reset_dst_uri(struct sip_msg* const msg); hdr_field_t* get_hdr(const sip_msg_t* const msg, const enum _hdr_types_t ht); hdr_field_t* next_sibling_hdr(const hdr_field_t* const hf); /** not used yet */ -hdr_field_t* get_hdr_by_name(const sip_msg_t* const msg, const char* const name, const int name_len); +hdr_field_t* get_hdr_by_name(const sip_msg_t* const msg, const char* const name, + const int name_len); hdr_field_t* next_sibling_hdr_by_name(const hdr_field_t* const hf); int set_path_vector(struct sip_msg* msg, str* path); @@ -501,7 +472,7 @@ typedef struct msg_ctx_id { /** * set msg context id - * - return: -1 on error; 0 - on set + * - return: -1 on error; 0 - on set */ int msg_ctx_id_set(const sip_msg_t* const msg, msg_ctx_id_t* const mid); diff --git a/parser/parse_addr_spec.c b/parser/parse_addr_spec.c index 15d15cc2219..e82b48f1829 100644 --- a/parser/parse_addr_spec.c +++ b/parser/parse_addr_spec.c @@ -13,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -140,8 +140,7 @@ static char* parse_to_param(char* const buffer, const char* const end, status=saved_status; goto endofheader; default: - LOG( L_ERR , "ERROR: parse_to_param : " - "unexpected char [%c] in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status, (int)(tmp-buffer), ZSW(buffer)); goto error; } @@ -177,8 +176,7 @@ static char* parse_to_param(char* const buffer, const char* const end, status=saved_status; goto endofheader; default: - LOG( L_ERR , "ERROR: parse_to_param : " - "unexpected char [%c] in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status, (int)(tmp-buffer), ZSW(buffer)); goto error; } @@ -206,8 +204,7 @@ static char* parse_to_param(char* const buffer, const char* const end, goto endofheader; break; default: - LOG( L_ERR , "ERROR: parse_to_param : " - "unexpected char [%c] in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status, (int)(tmp-buffer), ZSW(buffer)); goto error; } @@ -225,8 +222,7 @@ static char* parse_to_param(char* const buffer, const char* const end, tmp++; } default: - LOG( L_ERR , "ERROR: parse_to_param : " - "unexpected char [%c] in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status, (int)(tmp-buffer), ZSW(buffer)); goto error; } @@ -249,8 +245,7 @@ static char* parse_to_param(char* const buffer, const char* const end, /*previous=crlf and now !=' '*/ goto endofheader; default: - LOG( L_ERR , "ERROR: parse_to_param :" - "unexpected char [%c] in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status,(int)(tmp-buffer), ZSW(buffer)); goto error; } @@ -280,8 +275,7 @@ static char* parse_to_param(char* const buffer, const char* const end, param = (struct to_param*) pkg_malloc(sizeof(struct to_param)); if (!param){ - LOG( L_ERR , "ERROR: parse_to_param" - " - out of memory\n" ); + LM_ERR("out of memory\n"); goto error; } memset(param,0,sizeof(struct to_param)); @@ -296,8 +290,7 @@ static char* parse_to_param(char* const buffer, const char* const end, /*previous=crlf and now !=' '*/ goto endofheader; default: - LOG( L_ERR , "ERROR: parse_to_param :" - "unexpected char [%c] in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status, (int)(tmp-buffer), ZSW(buffer)); goto error; } @@ -329,8 +322,7 @@ static char* parse_to_param(char* const buffer, const char* const end, /*previous=crlf and now !=' '*/ goto endofheader; default: - LOG( L_ERR , "ERROR: parse_to_param :" - "unexpected char [%c] in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status, (int)(tmp-buffer), ZSW(buffer)); goto error; } @@ -364,8 +356,7 @@ static char* parse_to_param(char* const buffer, const char* const end, /*previous=crlf and now !=' '*/ goto endofheader; default: - LOG( L_ERR , "ERROR: parse_to_param : " - "unexpected char [%c] in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status, (int)(tmp-buffer), ZSW(buffer)); goto error; } @@ -399,8 +390,7 @@ static char* parse_to_param(char* const buffer, const char* const end, /*previous=crlf and now !=' '*/ goto endofheader; default: - LOG( L_ERR , "ERROR: parse_to_param : " - "unexpected char [%c] in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status, (int)(tmp-buffer), ZSW(buffer)); goto error; } @@ -427,8 +417,7 @@ static char* parse_to_param(char* const buffer, const char* const end, /*previous=crlf and now !=' '*/ goto endofheader; default: - LOG( L_ERR , "ERROR: parse_to_param : " - "unexpected char [%c] in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status, (int)(tmp-buffer), ZSW(buffer)); goto error; } @@ -470,8 +459,7 @@ static char* parse_to_param(char* const buffer, const char* const end, status=saved_status; goto endofheader; default: - LOG( L_ERR , "ERROR: parse_to_param : " - "unexpected char [%c] in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status, (int)(tmp-buffer), ZSW(buffer)); goto error; } @@ -483,8 +471,7 @@ static char* parse_to_param(char* const buffer, const char* const end, * - some user agents use it */ break; } - LOG( L_ERR, "ERROR parse_to_param : " - "invalid character ',' in status %d: <<%.*s>>\n", + LM_ERR("invalid character ',' in status %d: [%.*s]\n", status, (int)(tmp-buffer), ZSW(buffer)); } default: @@ -513,8 +500,7 @@ static char* parse_to_param(char* const buffer, const char* const end, /*previous=crlf and now !=' '*/ goto endofheader; default: - LOG(L_ERR, "ERROR: parse_to_param: " - "spitting out [%c] in status %d\n",*tmp,status ); + LM_ERR("spitting out [%c] in status %d\n",*tmp,status); goto error; } }/*switch*/ @@ -560,8 +546,7 @@ static char* parse_to_param(char* const buffer, const char* const end, case E_PARA_VALUE: break; default: - LOG( L_ERR , "ERROR: parse_to_param : unexpected end of header," - " status %d: <<%.*s>> .\n", + LM_ERR("unexpected end of header, status %d: [%.*s] .\n", saved_status, (int)(tmp-buffer), ZSW(buffer)); goto error; } @@ -577,12 +562,13 @@ static char* parse_to_param(char* const buffer, const char* const end, -char* parse_addr_spec(char* const buffer, const char* const end, struct to_body* const to_b, const int allow_comma_sep) +char* parse_addr_spec(char* const buffer, const char* const end, + struct to_body* const to_b, const int allow_comma_sep) { int status; int saved_status; char *tmp,*foo; - + saved_status=START_TO; /* fixes gcc 4.x warning */ status=START_TO; memset(to_b, 0, sizeof(struct to_body)); @@ -643,8 +629,7 @@ char* parse_addr_spec(char* const buffer, const char* const end, struct to_body* status=saved_status; goto endofheader; default: - LOG( L_ERR , "ERROR: parse_to : unexpected char [%c] " - "in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status, (int)(tmp-buffer), ZSW(buffer)); goto error; } @@ -673,8 +658,7 @@ char* parse_addr_spec(char* const buffer, const char* const end, struct to_body* status=saved_status; goto endofheader; default: - LOG( L_ERR , "ERROR: parse_to : unexpected char [%c] " - "in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status, (int)(tmp-buffer), ZSW(buffer)); goto error; } @@ -689,8 +673,7 @@ char* parse_addr_spec(char* const buffer, const char* const end, struct to_body* saved_status = status = END; goto endofheader; default: - LOG( L_ERR , "ERROR: parse_to : unexpected char [%c] " - "in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status, (int)(tmp-buffer), ZSW(buffer)); goto error; } @@ -702,8 +685,7 @@ char* parse_addr_spec(char* const buffer, const char* const end, struct to_body* tmp++; /* jump over next char */ break; default: - LOG( L_ERR , "ERROR: parse_to : unexpected char [%c] " - "in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status, (int)(tmp-buffer), ZSW(buffer)); goto error; } @@ -736,8 +718,7 @@ char* parse_addr_spec(char* const buffer, const char* const end, struct to_body* /*previous=crlf and now !=' '*/ goto endofheader; default: - LOG( L_ERR , "ERROR: parse_to : unexpected char [%c] " - "in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status, (int)(tmp-buffer), ZSW(buffer)); goto error; } @@ -759,8 +740,7 @@ char* parse_addr_spec(char* const buffer, const char* const end, struct to_body* /*previous=crlf and now !=' '*/ goto endofheader; default: - LOG( L_ERR , "ERROR: parse_to : unexpected char [%c] " - "in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status, (int)(tmp-buffer), ZSW(buffer)); goto error; } @@ -783,8 +763,7 @@ char* parse_addr_spec(char* const buffer, const char* const end, struct to_body* /*previous=crlf and now !=' '*/ goto endofheader; default: - LOG( L_ERR , "ERROR: parse_to : unexpected char [%c] " - "in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status, (int)(tmp-buffer), buffer); goto error; } @@ -809,8 +788,7 @@ char* parse_addr_spec(char* const buffer, const char* const end, struct to_body* /*previous=crlf and now !=' '*/ goto endofheader; default: - LOG( L_ERR , "ERROR: parse_to : unexpected char [%c] " - "in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status, (int)(tmp-buffer), buffer); goto error; } @@ -837,8 +815,7 @@ char* parse_addr_spec(char* const buffer, const char* const end, struct to_body* /*previous=crlf and now !=' '*/ goto endofheader; default: - LOG( L_ERR , "ERROR: parse_to : unexpected char [%c] " - "in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: [%.*s] .\n", *tmp,status, (int)(tmp-buffer), buffer); goto error; } @@ -871,7 +848,7 @@ char* parse_addr_spec(char* const buffer, const char* const end, struct to_body* /*previous=crlf and now !=' '*/ goto endofheader; default: - DBG("DEBUG:parse_to: spitting out [%c] in status %d\n", + LM_DBG("spitting out [%c] in status %d\n", *tmp,status ); goto error; } @@ -891,7 +868,7 @@ char* parse_addr_spec(char* const buffer, const char* const end, struct to_body* endofheader: if (to_b->display.len==0) to_b->display.s=0; status=saved_status; - DBG("end of header reached, state=%d\n", status); + LM_DBG("end of header reached, state=%d\n", status); /* check if error*/ switch(status){ case URI_OR_TOKEN: @@ -902,7 +879,7 @@ char* parse_addr_spec(char* const buffer, const char* const end, struct to_body* case E_PARA_VALUE: break; default: - LOG(L_ERR, "ERROR: parse_to: invalid To - unexpected " + LM_ERR("invalid To - unexpected " "end of header in state %d\n", status); goto error; } diff --git a/parser/parse_content.c b/parser/parse_content.c index 3c10a5e6630..edb109a209a 100644 --- a/parser/parse_content.c +++ b/parser/parse_content.c @@ -13,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -38,7 +38,7 @@ #define is_mime_char(_c_) \ - (isalpha((int)_c_) || (_c_)=='-' || (_c_)=='+' || (_c_)=='.') + (isalpha((int)_c_) || (_c_)=='-' || (_c_)=='+' || (_c_)=='.' || (_c_)=='_') #define is_char_equal(_c_,_cs_) \ ( (isalpha((int)_c_)?(((_c_)|0x20)==(_cs_)):((_c_)==(_cs_)))==1 ) @@ -180,7 +180,7 @@ static type_node_t subtype_tree[] = { {'c',SUBTYPE_UNKNOWN,1,-1}, {'.',SUBTYPE_UNKNOWN,1,-1}, {'p',SUBTYPE_UNKNOWN,1,-1}, - {'i',SUBTYPE_UNKNOWN,1,-1}, + {'i',SUBTYPE_UNKNOWN,1,-1}, {'d',SUBTYPE_UNKNOWN,1,-1}, {'f',SUBTYPE_XML_MSRTC_PIDF,0,-1}, {'e',SUBTYPE_UNKNOWN,1,107}, /* 94 */ @@ -327,7 +327,7 @@ char* decode_mime_type(char* const start, const char* const end, unsigned int* c if (node!=-1) { type_candidate = subtype_tree[node].final; if (subtype_tree[node].nr_sons) - node++; + node++; else node = -1; } else { @@ -432,10 +432,10 @@ int parse_accept_body(struct hdr_field* const hdr) char *ret; if (!hdr) return -1; - + /* maybe the header is already parsed! */ if (hdr->parsed!=0) return 1; - + /* it seams we have to parse it! :-( */ ret = hdr->body.s; end = ret + hdr->body.len; diff --git a/parser/parse_disposition.c b/parser/parse_disposition.c index 3a39c42a508..686f7b438a8 100644 --- a/parser/parse_disposition.c +++ b/parser/parse_disposition.c @@ -52,6 +52,11 @@ int parse_disposition( str *s, struct disposition *disp) char *tmp; char *end; + if(s==NULL || s->s==NULL || s->len<=0) { + LM_ERR("invalid parameters\n"); + return -1; + } + state = saved_state = FIND_TYPE; end = s->s + s->len; disp_p = 0; @@ -114,8 +119,7 @@ int parse_disposition( str *s, struct disposition *disp) state=F_CRLF; break; default: - LOG(L_ERR,"ERROR:parse_disposition: unexpected " - "char [%c] in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: <<%.*s>>.\n", *tmp,state, (int)(tmp-s->s), s->s); goto error; } @@ -143,15 +147,13 @@ int parse_disposition( str *s, struct disposition *disp) state=F_CR; break; default: - LOG(L_ERR,"ERROR:parse_disposition: unexpected " - "char [%c] in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: <<%.*s>>.\n", *tmp,state, (int)(tmp-s->s), ZSW(s->s)); goto error; } break; case 0: - LOG(L_ERR,"ERROR:parse_disposition: unexpected " - "char [%c] in status %d: <<%.*s>> .\n", + LM_ERR("nexpected char [%c] in status %d: <<%.*s>>.\n", *tmp,state, (int)(tmp-s->s), ZSW(s->s)); goto error; break; @@ -180,8 +182,7 @@ int parse_disposition( str *s, struct disposition *disp) state = FIND_PARAM; break; default: - LOG(L_ERR,"ERROR:parse_disposition: unexpected " - "char [%c] in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: <<%.*s>>.\n", *tmp,state, (int)(tmp-s->s), ZSW(s->s)); goto error; } @@ -202,8 +203,7 @@ int parse_disposition( str *s, struct disposition *disp) state = FIND_VAL; break; default: - LOG(L_ERR,"ERROR:parse_disposition: unexpected " - "char [%c] in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: <<%.*s>>.\n", *tmp,state, (int)(tmp-s->s), ZSW(s->s)); goto error; } @@ -222,8 +222,7 @@ int parse_disposition( str *s, struct disposition *disp) state = END_VAL; break; default: - LOG(L_ERR,"ERROR:parse_disposition: unexpected " - "char [%c] in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: <<%.*s>>.\n", *tmp,state, (int)(tmp-s->s), ZSW(s->s)); goto error; } @@ -241,8 +240,7 @@ int parse_disposition( str *s, struct disposition *disp) state = SKIP_QUOTED_VAL; break; default: - LOG(L_ERR,"ERROR:parse_disposition: unexpected " - "char [%c] in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: <<%.*s>>.\n", *tmp,state, (int)(tmp-s->s), ZSW(s->s)); goto error; } @@ -270,8 +268,7 @@ int parse_disposition( str *s, struct disposition *disp) case QUOTED_VAL: break; default: - LOG(L_ERR,"ERROR:parse_disposition: unexpected " - "char [%c] in status %d: <<%.*s>> .\n", + LM_ERR("unexpected char [%c] in status %d: <<%.*s>>.\n", *tmp,state, (int)(tmp-s->s), ZSW(s->s)); goto error; } @@ -290,8 +287,7 @@ int parse_disposition( str *s, struct disposition *disp) new_p=(struct disposition_param*)pkg_malloc (sizeof(struct disposition_param)); if (new_p==0) { - LOG(L_ERR,"ERROR:parse_disposition: no more " - "pkg mem\n"); + LM_ERR("no more pkg mem\n"); goto error; } memset(new_p,0,sizeof(struct disposition_param)); @@ -331,7 +327,7 @@ int parse_disposition( str *s, struct disposition *disp) disp_p->body.len = tmp - disp_p->body.s; break; default: - LOG(L_ERR,"ERROR:parse_disposition: wrong final state (%d)\n", + LM_ERR("wrong final state (%d)\n", state); goto error; } @@ -375,7 +371,7 @@ int parse_content_disposition( struct sip_msg *msg ) if (parse_headers(msg, HDR_CONTENTDISPOSITION_F, 0)==-1) goto error; if (msg->content_disposition==0) { - DBG("DEBUG:parse_content_disposition: hdr not found\n"); + DBG("hdr not found\n"); return 1; } } @@ -389,7 +385,7 @@ int parse_content_disposition( struct sip_msg *msg ) /* parse the body */ disp = (struct disposition*)pkg_malloc(sizeof(struct disposition)); if (disp==0) { - LOG(L_ERR,"ERROR:parse_content_disposition: no more pkg memory\n"); + LM_ERR("no more pkg memory\n"); goto error; } memset(disp,0,sizeof(struct disposition)); diff --git a/parser/parse_diversion.c b/parser/parse_diversion.c index cc60600ebcc..45780876e6a 100644 --- a/parser/parse_diversion.c +++ b/parser/parse_diversion.c @@ -13,20 +13,21 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /*! \file * \brief Parser :: Diversion header - * + * * \ingroup parser */ - + #include -#include +#include #include "../dprint.h" #include "../ut.h" #include "../mem/mem.h" @@ -40,41 +41,49 @@ * params: msg : sip msg * returns 0 on success, * -1 on failure. + * + * limitations: it parses only the first occurence */ int parse_diversion_header(struct sip_msg *msg) { - struct to_body* diversion_b; - - if (!msg->diversion && (parse_headers(msg, HDR_DIVERSION_F, 0) == -1 || - !msg->diversion)) { - goto error; - } - - /* maybe the header is already parsed! */ - if (msg->diversion->parsed) - return 0; - - /* bad luck! :-( - we have to parse it */ - /* first, get some memory */ - diversion_b = pkg_malloc(sizeof(struct to_body)); - if (diversion_b == 0) { - LOG(L_ERR, "ERROR:parse_diversion_header: out of pkg_memory\n"); - goto error; - } - - /* now parse it!! */ - memset(diversion_b, 0, sizeof(struct to_body)); - parse_to(msg->diversion->body.s, msg->diversion->body.s + msg->diversion->body.len + 1, diversion_b); - if (diversion_b->error == PARSE_ERROR) { - LOG(L_ERR, "ERROR:parse_diversion_header: bad diversion header\n"); - free_to(diversion_b); - goto error; - } - msg->diversion->parsed = diversion_b; - - return 0; - error: - return -1; + struct to_body* diversion_b; + + if (!msg->diversion && (parse_headers(msg, HDR_DIVERSION_F, 0) == -1)) { + goto error; + } + + if (!msg->diversion) { + /* header not found */ + return -1; + } + + /* maybe the header is already parsed! */ + if (msg->diversion->parsed) + return 0; + + /* bad luck! :-( - we have to parse it */ + /* first, get some memory */ + diversion_b = pkg_malloc(sizeof(struct to_body)); + if (diversion_b == 0) { + LM_ERR("out of pkg_memory\n"); + goto error; + } + + /* now parse it!! */ + memset(diversion_b, 0, sizeof(struct to_body)); + parse_addr_spec(msg->diversion->body.s, + msg->diversion->body.s + msg->diversion->body.len + 1, + diversion_b, 1); + if (diversion_b->error == PARSE_ERROR) { + LM_ERR("bad diversion header\n"); + free_to(diversion_b); + goto error; + } + msg->diversion->parsed = diversion_b; + + return 0; +error: + return -1; } @@ -83,22 +92,22 @@ int parse_diversion_header(struct sip_msg *msg) */ str *get_diversion_param(struct sip_msg *msg, str* name) { - struct to_param *params; + struct to_param *params; - if (parse_diversion_header(msg) < 0) { - ERR("could not get diversion parameter\n"); + if (parse_diversion_header(msg) < 0) { + LM_ERR("could not get diversion parameter\n"); return 0; - } + } - params = ((struct to_body*)(msg->diversion->parsed))->param_lst; + params = ((struct to_body*)(msg->diversion->parsed))->param_lst; - while (params) { + while (params) { if ((params->name.len == name->len) && - (strncmp(params->name.s, name->s, name->len) == 0)) { + (strncmp(params->name.s, name->s, name->len) == 0)) { return ¶ms->value; } params = params->next; - } - - return 0; + } + + return 0; } diff --git a/parser/parse_identityinfo.c b/parser/parse_identityinfo.c index f8ec22dbbed..32f95da3809 100644 --- a/parser/parse_identityinfo.c +++ b/parser/parse_identityinfo.c @@ -53,14 +53,15 @@ void parse_identityinfo(char *buffer, char *end, struct identityinfo_body *ii_b) status=II_URI_BEGIN; mainstatus = II_M_URI_BEGIN; ii_b->uri.s = p + 1; - } else + } else { goto parseerror; - break; + } + break; case 'h': case 'H': /* "http://" or "https://" part */ switch (status) { case II_URI_BEGIN: - if (end - p <= 8 || strncasecmp(p,"http",strlen("http"))) + if (end - p <= 8 || strncasecmp(p, "http", 4)) goto parseerror; p+=4; if (*p == 's' || *p == 'S') p++; @@ -168,7 +169,7 @@ void parse_identityinfo(char *buffer, char *end, struct identityinfo_body *ii_b) p=eat_lws_end(p, end); /*check if the header ends here*/ if (p>=end) { - LOG(L_ERR, "ERROR: parse_identityinfo: strange EoHF\n"); + LM_ERR("strange EoHF\n"); goto parseerror; } ii_b->error=PARSE_OK; @@ -201,7 +202,8 @@ void parse_identityinfo(char *buffer, char *end, struct identityinfo_body *ii_b) if (mainstatus == II_M_SEMIC) { mainstatus = II_M_TAG; status = II_TAG; - if (end - p <= 3 || strncasecmp(p,"alg",strlen("alg"))) + if (end - p <= 3 + || strncasecmp(p,"alg",strlen("alg"))) goto parseerror; p+=2; } else @@ -293,9 +295,9 @@ void parse_identityinfo(char *buffer, char *end, struct identityinfo_body *ii_b) case II_URI_IPV4: case II_URI_IPV6: if (isalnum(*p) - || *p == '-' - || *p == '.' - || *p == ':' ) + || *p == '-' + || *p == '.' + || *p == ':' ) break; case II_START: goto parseerror; @@ -308,9 +310,8 @@ void parse_identityinfo(char *buffer, char *end, struct identityinfo_body *ii_b) return ; parseerror: - LOG( L_ERR , "ERROR: parse_identityinfo: " - "unexpected char [%c] in status %d: <<%.*s>> .\n", - *p,status, (int)(p-buffer), ZSW(p)); + LM_ERR("unexpected char [%c] in status %d: <<%.*s>> .\n", + *p,status, (int)(p-buffer), ZSW(p)); return ; } @@ -320,9 +321,9 @@ int parse_identityinfo_header(struct sip_msg *msg) if ( !msg->identity_info - && (parse_headers(msg,HDR_IDENTITY_INFO_F,0)==-1 - || !msg->identity_info) ) { - LOG(L_ERR,"ERROR:parse_identityinfo_header: bad msg or missing IDENTITY-INFO header\n"); + && (parse_headers(msg,HDR_IDENTITY_INFO_F,0)==-1 + || !msg->identity_info) ) { + LM_ERR("bad msg or missing IDENTITY-INFO header\n"); goto error; } @@ -338,8 +339,8 @@ int parse_identityinfo_header(struct sip_msg *msg) memset(identityinfo_b, 0, sizeof(*identityinfo_b)); parse_identityinfo(msg->identity_info->body.s, - msg->identity_info->body.s + msg->identity_info->body.len+1, - identityinfo_b); + msg->identity_info->body.s + msg->identity_info->body.len+1, + identityinfo_b); if (identityinfo_b->error==PARSE_ERROR){ free_identityinfo(identityinfo_b); goto error; diff --git a/parser/parse_rr.c b/parser/parse_rr.c index bcc518fea03..4fb32b02656 100644 --- a/parser/parse_rr.c +++ b/parser/parse_rr.c @@ -15,8 +15,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -46,7 +46,7 @@ static inline int do_parse_rr_body(char *buf, int len, rr_t **head) /* Make a temporary copy of the string pointer */ if(buf==0 || len<=0) { - DBG("parse_rr_body(): No body for record-route\n"); + DBG("No body for record-route\n"); *head = 0; return -2; } @@ -57,81 +57,82 @@ static inline int do_parse_rr_body(char *buf, int len, rr_t **head) last = 0; while(1) { - /* Allocate and clear rr structure */ + /* Allocate and clear rr structure */ r = (rr_t*)pkg_malloc(sizeof(rr_t)); if (!r) { - LOG(L_ERR, "parse_rr(): No memory left\n"); + LOG(L_ERR, "No memory left\n"); goto error; } memset(r, 0, sizeof(rr_t)); - - /* Parse name-addr part of the header */ + + /* Parse name-addr part of the header */ if (parse_nameaddr(&s, &r->nameaddr) < 0) { - LOG(L_ERR, "parse_rr(): Error while parsing name-addr (%.*s)\n", + LOG(L_ERR, "Error while parsing name-addr (%.*s)\n", s.len, ZSW(s.s)); goto error; } r->len = r->nameaddr.len; - /* Shift just behind the closing > */ + /* Shift just behind the closing > */ s.s = r->nameaddr.name.s + r->nameaddr.len; /* Point just behind > */ s.len -= r->nameaddr.len; trim_leading(&s); /* Skip any white-chars */ if (s.len == 0) goto ok; /* Nothing left, finish */ - + if (s.s[0] == ';') { /* Route parameter found */ s.s++; s.len--; trim_leading(&s); - + if (s.len == 0) { - LOG(L_ERR, "parse_rr(): Error while parsing params\n"); + LOG(L_ERR, "Error while parsing params\n"); goto error; } - /* Parse all parameters */ + /* Parse all parameters */ if (parse_params(&s, CLASS_ANY, &hooks, &r->params) < 0) { - LOG(L_ERR, "parse_rr(): Error while parsing params\n"); + LOG(L_ERR, "Error while parsing params\n"); goto error; } r->len = r->params->name.s + r->params->len - r->nameaddr.name.s; - /* Copy hooks */ - /*r->r2 = hooks.rr.r2; */ + /* Copy hooks */ + /*r->r2 = hooks.rr.r2; */ trim_leading(&s); if (s.len == 0) goto ok; } if (s.s[0] != ',') { - LOG(L_ERR, "parse_rr(): Invalid character '%c', comma expected\n", s.s[0]); + LOG(L_ERR, "Invalid character '%c', comma expected\n", s.s[0]); goto error; } - - /* Next character is comma or end of header*/ + + /* Next character is comma or end of header*/ s.s++; s.len--; trim_leading(&s); if (s.len == 0) { - LOG(L_ERR, "parse_rr(): Text after comma missing\n"); + LOG(L_ERR, "Text after comma missing\n"); goto error; } - /* Append the structure as last parameter of the linked list */ + /* Append the structure as last parameter of the linked list */ if (!*head) *head = r; if (last) last->next = r; last = r; } - error: +error: if (r) free_rr(&r); free_rr(head); /* Free any contacts created so far */ + LM_ERR("Failed parsing rr header body [%.*s]\n", len, ZSW(buf)); return -1; - ok: +ok: if (!*head) *head = r; if (last) last->next = r; return 0; @@ -153,12 +154,12 @@ int parse_rr(struct hdr_field* _h) rr_t* r = NULL; if (!_h) { - LOG(L_ERR, "parse_rr(): Invalid parameter value\n"); + LOG(L_ERR, "Invalid parameter value\n"); return -1; } if (_h->parsed) { - /* Already parsed, return */ + /* Already parsed, return */ return 0; } @@ -242,12 +243,12 @@ static inline void xlate_pointers(rr_t* _orig, rr_t* _r) { param_t* ptr; _r->nameaddr.uri.s = translate_pointer(_r->nameaddr.name.s, _orig->nameaddr.name.s, _r->nameaddr.uri.s); - + ptr = _r->params; while(ptr) { - /* if (ptr->type == P_R2) _r->r2 = ptr; */ + /* if (ptr->type == P_R2) _r->r2 = ptr; */ ptr->name.s = translate_pointer(_r->nameaddr.name.s, _orig->nameaddr.name.s, ptr->name.s); - ptr->body.s = translate_pointer(_r->nameaddr.name.s, _orig->nameaddr.name.s, ptr->body.s); + ptr->body.s = translate_pointer(_r->nameaddr.name.s, _orig->nameaddr.name.s, ptr->body.s); ptr = ptr->next; } } @@ -262,7 +263,7 @@ static inline int do_duplicate_rr(rr_t** _new, rr_t* _r, int _shm) rr_t* res, *prev, *it; if (!_new || !_r) { - LOG(L_ERR, "duplicate_rr(): Invalid parameter value\n"); + LOG(L_ERR, "Invalid parameter value\n"); return -1; } prev = NULL; @@ -279,7 +280,7 @@ static inline int do_duplicate_rr(rr_t** _new, rr_t* _r, int _shm) if (_shm) res = shm_malloc(sizeof(rr_t) + len); else res = pkg_malloc(sizeof(rr_t) + len); if (!res) { - LOG(L_ERR, "duplicate_rr(): No memory left\n"); + LOG(L_ERR, "No memory left\n"); return -2; } memcpy(res, it, sizeof(rr_t)); @@ -294,7 +295,7 @@ static inline int do_duplicate_rr(rr_t** _new, rr_t* _r, int _shm) } if (ret < 0) { - LOG(L_ERR, "duplicate_rr(): Error while duplicating parameters\n"); + LOG(L_ERR, "Error while duplicating parameters\n"); if (_shm) shm_free(res); else pkg_free(res); return -3; @@ -353,9 +354,9 @@ int print_rr_body(struct hdr_field *iroute, str *oroute, int order, route_len= 0; memset(route, 0, MAX_RR_HDRS*sizeof(str)); - while (iroute!=NULL) + while (iroute!=NULL) { - if (parse_rr(iroute) < 0) + if (parse_rr(iroute) < 0) { LM_ERR("failed to parse RR\n"); goto error; @@ -381,18 +382,18 @@ int print_rr_body(struct hdr_field *iroute, str *oroute, int order, } for(i=0;i=*nb_recs)) || (order && (i<=(n-*nb_recs)) )) ) ) + if(!nb_recs || (nb_recs + && ( (!order&& (i>=*nb_recs)) || (order && (i<=(n-*nb_recs)) )) ) ) { route_len+= route[i].len; nr++; } - + } if(nb_recs) LM_DBG("skipping %i route records\n", *nb_recs); - + route_len += --nr; /* for commas */ oroute->s=(char*)pkg_malloc(route_len); @@ -416,9 +417,9 @@ int print_rr_body(struct hdr_field *iroute, str *oroute, int order, *(cp++) = ','; } } else { - + i = (nb_recs == NULL) ? n-1 : (n-*nb_recs-1); - + while (i>=0) { memcpy(cp, route[i].s, route[i].len); @@ -442,7 +443,7 @@ int print_rr_body(struct hdr_field *iroute, str *oroute, int order, /*! - * Path must be available. Function returns the first uri + * Path must be available. Function returns the first uri * from Path without any duplication. */ int get_path_dst_uri(str *_p, str *_dst) @@ -450,7 +451,7 @@ int get_path_dst_uri(str *_p, str *_dst) rr_t *route = 0; LM_DBG("path for branch: '%.*s'\n", _p->len, _p->s); - if(parse_rr_body(_p->s, _p->len, &route) < 0) { + if(parse_rr_body(_p->s, _p->len, &route) < 0) { LM_ERR("failed to parse Path body\n"); return -1; } @@ -462,6 +463,6 @@ int get_path_dst_uri(str *_p, str *_dst) *_dst = route->nameaddr.uri; free_rr(&route); - + return 0; } diff --git a/parser/sdp/sdp.c b/parser/sdp/sdp.c index 1e539408318..e6708d8188e 100644 --- a/parser/sdp/sdp.c +++ b/parser/sdp/sdp.c @@ -375,6 +375,7 @@ static int parse_sdp_session(str *sdp_body, int session_num, str *cnt_disp, sdp_ * - shorcut useful for multi-part bodies and sdp operations */ _sdp->text = *sdp_body; + pf = AF_INET; /* * Parsing of SDP body. diff --git a/pass_fd.c b/pass_fd.c index edb1480f690..dbf93422d12 100644 --- a/pass_fd.c +++ b/pass_fd.c @@ -20,7 +20,7 @@ /*! * \file - * \brief Kamailio core :: + * \brief Kamailio core :: * \ingroup core * Module: \ref core */ @@ -46,17 +46,17 @@ /** receive all the data or returns error (handles EINTR etc.) * params: socket * data - buffer for the results - * data_len - + * data_len - * flags - recv flags for the first recv (see recv(2)), only * 0, MSG_WAITALL and MSG_DONTWAIT make sense * if flags is set to MSG_DONWAIT (or to 0 and the socket fd is non-blocking), - * and if no data is queued on the fd, recv_all will not wait (it will + * and if no data is queued on the fd, recv_all will not wait (it will * return error and set errno to EAGAIN/EWOULDBLOCK). However if even 1 byte * is queued, the call will block until the whole data_len was read or an * error or eof occured ("semi-nonblocking" behaviour, some tcp code * counts on it). * if flags is set to MSG_WAITALL it will block even if no byte is available. - * + * * returns: bytes read or error (<0) * can return < data_len if EOF */ int recv_all(int socket, void* data, int data_len, int flags) @@ -66,7 +66,7 @@ int recv_all(int socket, void* data, int data_len, int flags) #ifdef NO_MSG_WAITALL struct pollfd pfd; #endif /* NO_MSG_WAITALL */ - + b_read=0; again: #ifdef NO_MSG_WAITALL @@ -104,7 +104,7 @@ int recv_all(int socket, void* data, int data_len, int flags) pfd.events=POLLIN; poll_retry: n=poll(&pfd, 1, -1); - if (n<0){ + if (n<0){ if (errno==EINTR) goto poll_retry; LM_CRIT("poll on %d failed: %s\n", socket, strerror(errno)); @@ -128,7 +128,7 @@ int recv_all(int socket, void* data, int data_len, int flags) int send_all(int socket, void* data, int data_len) { int n; - + again: n=send(socket, data, data_len, 0); if (n<0){ @@ -156,12 +156,13 @@ int send_fd(int unix_socket, void* data, int data_len, int fd) struct cmsghdr cm; char control[CMSG_SPACE(sizeof(fd))]; }control_un; - + + memset(&msg, 0, sizeof(struct msghdr)); msg.msg_control=control_un.control; /* openbsd doesn't like "more space", msg_controllen must not * include the end padding */ msg.msg_controllen=CMSG_LEN(sizeof(fd)); - + cmsg=CMSG_FIRSTHDR(&msg); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; @@ -173,15 +174,15 @@ int send_fd(int unix_socket, void* data, int data_len, int fd) msg.msg_accrights=(caddr_t) &fd; msg.msg_accrightslen=sizeof(fd); #endif - + msg.msg_name=0; msg.msg_namelen=0; - + iov[0].iov_base=data; iov[0].iov_len=data_len; msg.msg_iov=iov; msg.msg_iovlen=1; - + again: ret=sendmsg(unix_socket, &msg, 0); if (ret<0){ @@ -190,14 +191,14 @@ int send_fd(int unix_socket, void* data, int data_len, int fd) LM_CRIT("sendmsg failed sending %d on %d: %s (%d)\n", fd, unix_socket, strerror(errno), errno); } - + return ret; } /** receives a fd and data_len data - * params: unix_socket + * params: unix_socket * data * data_len * fd - will be set to the passed fd value or -1 if no fd @@ -222,22 +223,23 @@ int receive_fd(int unix_socket, void* data, int data_len, int* fd, int flags) struct cmsghdr cm; char control[CMSG_SPACE(sizeof(new_fd))]; }control_un; - + + memset(&msg, 0, sizeof(struct msghdr)); msg.msg_control=control_un.control; msg.msg_controllen=sizeof(control_un.control); #else msg.msg_accrights=(caddr_t) &new_fd; msg.msg_accrightslen=sizeof(int); #endif - + msg.msg_name=0; msg.msg_namelen=0; - + iov[0].iov_base=data; iov[0].iov_len=data_len; msg.msg_iov=iov; msg.msg_iovlen=1; - + #ifdef NO_MSG_WAITALL f=flags & ~MSG_WAITALL; #endif /* NO_MSG_WAITALL */ @@ -286,7 +288,7 @@ int receive_fd(int unix_socket, void* data, int data_len, int* fd, int flags) goto error; } } - + #ifdef HAVE_MSGHDR_MSG_CONTROL cmsg=CMSG_FIRSTHDR(&msg); if ((cmsg!=0) && (cmsg->cmsg_len==CMSG_LEN(sizeof(new_fd)))){ @@ -317,7 +319,7 @@ int receive_fd(int unix_socket, void* data, int data_len, int* fd, int flags) *fd=-1; } #endif - + error: return ret; } diff --git a/pkg/kamailio/centos/6/kamailio.spec b/pkg/kamailio/centos/6/kamailio.spec index fa3039a59a1..c61e7cc9cfe 100644 --- a/pkg/kamailio/centos/6/kamailio.spec +++ b/pkg/kamailio/centos/6/kamailio.spec @@ -1,6 +1,6 @@ %define name kamailio -%define ver 4.2.0 -%define rel dev0.0%{dist} +%define ver 4.4.4 +%define rel 0.0%{dist} @@ -53,10 +53,19 @@ Group: System Environment/Daemons Requires: openssl, kamailio = %ver BuildRequires: openssl-devel -%description auth-ephemeral +%description auth-ephemeral Functions for authentication using ephemeral credentials. +%package auth-xkeys +Summary: Functions for authentication using shared keys. +Group: System Environment/Daemons +Requires: kamailio = %ver + +%description auth-xkeys +Functions for authentication using shared keys. + + %package bdb Summary: Berkeley database connectivity for Kamailio. Group: System Environment/Daemons @@ -77,6 +86,16 @@ BuildRequires: epel-release, libconfuse-devel The carrierroute module for Kamailio. +%package cnxcc +Summary: Module which provides a mechanism to limit call duration based on credit information parameters for Kamailio. +Group: System Environment/Daemons +Requires: libevent, hiredis, kamailio = %ver +BuildRequires: libevent-devel, hiredis-devel + +%description cnxcc +Module which provides a mechanism to limit call duration based on credit information parameters for Kamailio. + + %package cpl Summary: CPL (Call Processing Language) interpreter for Kamailio. Group: System Environment/Daemons @@ -97,6 +116,15 @@ BuildRequires: pcre-devel String translations based on rules for Kamailio. +%package dmq_userloc +Summary: User location (usrloc) records replication between multiple servers via DMQ module for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver + +%description dmq_userloc +User location (usrloc) records replication between multiple servers via DMQ module. + + %package dnssec Summary: DNSSEC support for Kamailio. Group: System Environment/Daemons @@ -299,6 +327,15 @@ BuildRequires: pcre-devel PCRE mtaching operations for Kamailio. +%package rtjson +Summary: SIP routing based on JSON specifications. +Group: System Environment/Daemons +Requires: kamailio = %ver + +%description rtjson +SIP routing based on JSON specifications. + + %package sctp Summary: SCTP transport for Kamailio. Group: System Environment/Daemons @@ -319,6 +356,15 @@ BuildRequires: net-snmp-devel SNMP management interface (scalar statistics) for Kamailio. +%package statsd +Summary: Send commands to statsd server. +Group: System Environment/Daemons +Requires: kamailio = %ver + +%description statsd +Send commands to statsd server. + + %package sqlite Summary: SQLite database connectivity for Kamailio. Group: System Environment/Daemons @@ -339,6 +385,15 @@ BuildRequires: openssl-devel TLS transport for Kamailio. +%package tcpops +Summary: On demand and per socket control to the TCP options. +Group: System Environment/Daemons +Requires: kamailio = %ver + +%description tcpops +On demand and per socket control to the TCP options. + + %package unixodbc Summary: unixODBC database connectivity for Kamailio. Group: System Environment/Daemons @@ -421,7 +476,7 @@ make cfg prefix=/usr cfg_prefix=$RPM_BUILD_ROOT basedir=$RPM_BUILD_ROOT \ make make every-module skip_modules="app_mono db_cassandra db_oracle iptrtpproxy \ jabber ndb_cassandra osp" \ - group_include="kstandard kautheph kberkeley kcarrierroute kcpl \ + group_include="kstandard kautheph kberkeley kcarrierroute kcnxcc kcpl \ kdnssec kgeoip kgzcompress kims kjava kjson kldap klua kmemcached \ kmi_xmlrpc kmysql koutbound kperl kpostgres kpresence kpurple kpython \ kradius kredis ksctp ksnmpstats ksqlite ktls kunixodbc kutils \ @@ -439,7 +494,7 @@ make utils make install make install-modules-all skip_modules="app_mono db_cassandra db_oracle \ iptrtpproxy jabber osp" \ - group_include="kstandard kautheph kberkeley kcarrierroute kcpl \ + group_include="kstandard kautheph kberkeley kcarrierroute kcnxcc kcpl \ kdnssec kgeoip kgzcompress kims kjava kjson kldap klua kmemcached \ kmi_xmlrpc kmysql koutbound kperl kpostgres kpresence kpurple kpython \ kradius kredis ksctp ksnmpstats ksqlite ktls kunixodbc kutils \ @@ -510,7 +565,6 @@ fi %doc %{_docdir}/kamailio/modules/README.cfg_db %doc %{_docdir}/kamailio/modules/README.cfg_rpc %doc %{_docdir}/kamailio/modules/README.cfgutils -%doc %{_docdir}/kamailio/modules/README.cnxcc %doc %{_docdir}/kamailio/modules/README.corex %doc %{_docdir}/kamailio/modules/README.counters %doc %{_docdir}/kamailio/modules/README.ctl @@ -654,7 +708,6 @@ fi %{_libdir}/kamailio/modules/cfg_db.so %{_libdir}/kamailio/modules/cfg_rpc.so %{_libdir}/kamailio/modules/cfgutils.so -%{_libdir}/kamailio/modules/cnxcc.so %{_libdir}/kamailio/modules/corex.so %{_libdir}/kamailio/modules/counters.so %{_libdir}/kamailio/modules/ctl.so @@ -789,6 +842,12 @@ fi %{_libdir}/kamailio/modules/auth_ephemeral.so +%files auth-xkeys +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.auth_xkeys +%{_libdir}/kamailio/modules/auth_xkeys.so + + %files bdb %defattr(-,root,root) %doc %{_docdir}/kamailio/modules/README.db_berkeley @@ -806,6 +865,11 @@ fi %{_libdir}/kamailio/modules/carrierroute.so +%files cnxcc +%defattr(-,root,root) +%{_docdir}/kamailio/modules/README.cnxcc +%{_libdir}/kamailio/modules/cnxcc.so + %files cpl %defattr(-,root,root) %{_docdir}/kamailio/modules/README.cpl-c @@ -818,6 +882,12 @@ fi %{_libdir}/kamailio/modules/dialplan.so +%files dmq_userloc +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.dmq_usrloc +%{_libdir}/kamailio/modules/dmq_usrloc.so + + %files dnssec %defattr(-,root,root) %doc %{_docdir}/kamailio/modules/README.dnssec @@ -850,7 +920,7 @@ fi %doc %{_docdir}/kamailio/modules/README.ims_isc %doc %{_docdir}/kamailio/modules/README.ims_qos #%doc %{_docdir}/kamailio/modules/README.ims_registrar_pcscf -#%doc %{_docdir}/kamailio/modules/README.ims_registrar_scscf +%doc %{_docdir}/kamailio/modules/README.ims_registrar_scscf %doc %{_docdir}/kamailio/modules/README.ims_usrloc_pcscf #%doc %{_docdir}/kamailio/modules/README.ims_usrloc_scscf %{_libdir}/kamailio/modules/cdp.so @@ -1045,6 +1115,12 @@ fi %{_libdir}/kamailio/modules/regex.so +%files rtjson +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.rtjson +%{_libdir}/kamailio/modules/rtjson.so + + %files sctp %defattr(-,root,root) %doc %{_docdir}/kamailio/modules/README.sctp @@ -1062,6 +1138,12 @@ fi %{_datadir}/snmp/mibs/KAMAILIO-TC +%files statsd +%defattr(-,root,root) +%{_docdir}/kamailio/modules/README.statsd +%{_libdir}/kamailio/modules/statsd.so + + %files sqlite %defattr(-,root,root) %doc %{_docdir}/kamailio/modules/README.db_sqlite @@ -1080,6 +1162,12 @@ fi %{_libdir}/kamailio/modules/tls.so +%files tcpops +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.tcpops +%{_libdir}/kamailio/modules/tcpops.so + + %files unixodbc %defattr(-,root,root) %doc %{_docdir}/kamailio/modules/README.db_unixodbc diff --git a/pkg/kamailio/deb/debian/backports/jessie b/pkg/kamailio/deb/debian/backports/jessie index 80cd6a65c74..cba77a58245 100755 --- a/pkg/kamailio/deb/debian/backports/jessie +++ b/pkg/kamailio/deb/debian/backports/jessie @@ -14,6 +14,10 @@ sed -i -e '/libxmlrpc-c3-dev/d' -e '/^Package: kamailio-xmlrpc-modules/,/^$/d' \ sed -i -e 's/ mi_xmlrpc[ ,$]*/ /' ${DIST}/rules sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ mi_xmlrpc/' ${DIST}/rules +# use old libfreeradius +sed -i 's/libradcli-dev/libfreeradius-client-dev/' ${DIST}/control +sed -i -e 's/RADCLI/FREERADIUS/' ${DIST}/rules + # clean backports scripts rm -rf ${DIST}/backports exit 0 diff --git a/pkg/kamailio/deb/debian/backports/precise b/pkg/kamailio/deb/debian/backports/precise index 8caca988163..8743d589dad 100755 --- a/pkg/kamailio/deb/debian/backports/precise +++ b/pkg/kamailio/deb/debian/backports/precise @@ -26,8 +26,8 @@ sed -i -e 's/ dnssec[ ,$]*/ /' ${DIST}/rules sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ dnssec/' ${DIST}/rules # use old radius-client-ng -sed -i 's/libfreeradius-client-dev/libradiusclient-ng-dev/' ${DIST}/control -sed -i -e '/FREERADIUS/d' ${DIST}/rules +sed -i 's/libradcli-dev/libradiusclient-ng-dev/' ${DIST}/control +sed -i -e '/RADCLI/d' ${DIST}/rules # use old json sed -i 's/libjson-c-dev/libjson0-dev/' ${DIST}/control diff --git a/pkg/kamailio/deb/debian/backports/squeeze b/pkg/kamailio/deb/debian/backports/squeeze index b20c2c9df2d..13542817d12 100755 --- a/pkg/kamailio/deb/debian/backports/squeeze +++ b/pkg/kamailio/deb/debian/backports/squeeze @@ -72,8 +72,8 @@ sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ mono/' ${DIST}/rules sed -i -e 's/db-util/db4.8-util/' ${DIST}/control # use old radius-client-ng -sed -i 's/libfreeradius-client-dev/libradiusclient-ng-dev/' ${DIST}/control -sed -i -e '/FREERADIUS/d' ${DIST}/rules +sed -i 's/libradcli-dev/libradiusclient-ng-dev/' ${DIST}/control +sed -i -e '/RADCLI/d' ${DIST}/rules # use old json sed -i 's/libjson-c-dev/libjson0-dev/' ${DIST}/control diff --git a/pkg/kamailio/deb/debian/backports/trusty b/pkg/kamailio/deb/debian/backports/trusty index 17065d8b957..6c05bc19ecf 100755 --- a/pkg/kamailio/deb/debian/backports/trusty +++ b/pkg/kamailio/deb/debian/backports/trusty @@ -19,6 +19,10 @@ sed -i -e '/libxmlrpc-c3-dev/d' -e '/^Package: kamailio-xmlrpc-modules/,/^$/d' \ sed -i -e 's/ mi_xmlrpc[ ,$]*/ /' ${DIST}/rules sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ mi_xmlrpc/' ${DIST}/rules +# use old libfreeradius +sed -i 's/libradcli-dev/libfreeradius-client-dev/' ${DIST}/control +sed -i -e 's/RADCLI/FREERADIUS/' ${DIST}/rules + # clean backports scripts rm -rf ${DIST}/backports exit 0 diff --git a/pkg/kamailio/deb/debian/backports/wheezy b/pkg/kamailio/deb/debian/backports/wheezy index 797512e38a4..c09abd5caf0 100755 --- a/pkg/kamailio/deb/debian/backports/wheezy +++ b/pkg/kamailio/deb/debian/backports/wheezy @@ -32,8 +32,8 @@ sed -i -e 's/ dnssec[ ,$]*/ /' ${DIST}/rules sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ dnssec/' ${DIST}/rules # use old radius-client-ng -sed -i 's/libfreeradius-client-dev/libradiusclient-ng-dev/' ${DIST}/control -sed -i -e '/FREERADIUS/d' ${DIST}/rules +sed -i 's/libradcli-dev/libradiusclient-ng-dev/' ${DIST}/control +sed -i -e '/RADCLI/d' ${DIST}/rules # use old json sed -i 's/libjson-c-dev/libjson0-dev/' ${DIST}/control diff --git a/pkg/kamailio/deb/debian/backports/xenial b/pkg/kamailio/deb/debian/backports/xenial new file mode 100755 index 00000000000..df824b089ab --- /dev/null +++ b/pkg/kamailio/deb/debian/backports/xenial @@ -0,0 +1,16 @@ +#!/bin/bash +# +# Hook for automatic backports at buildserver.net +# +# Target dist: Ubuntu xenial +DIST=xenial + +rm -rf ${DIST} +cp -r debian ${DIST} + +# mi_xmlrpc module +sed -i 's/libxmlrpc-c3-dev/libxmlrpc-core-c3-dev/' ${DIST}/control + +# clean backports scripts +rm -rf ${DIST}/backports +exit 0 diff --git a/pkg/kamailio/deb/debian/changelog b/pkg/kamailio/deb/debian/changelog index 032b4609123..e5a15da0e64 100644 --- a/pkg/kamailio/deb/debian/changelog +++ b/pkg/kamailio/deb/debian/changelog @@ -1,3 +1,51 @@ +kamailio (4.4.4) unstable; urgency=medium + + * version set to 4.4.4 + + -- Victor Seva Wed, 09 Nov 2016 13:02:31 +0100 + +kamailio (4.4.3) unstable; urgency=medium + + * version set to 4.4.3 + + -- Victor Seva Wed, 14 Sep 2016 15:27:24 +0200 + +kamailio (4.4.2) unstable; urgency=medium + + * version set to 4.4.2 + + -- Victor Seva Tue, 28 Jun 2016 14:22:03 +0200 + +kamailio (4.4.1) unstable; urgency=medium + + * version set to 4.4.1 + + -- Victor Seva Tue, 10 May 2016 12:07:19 +0200 + +kamailio (4.4.0) unstable; urgency=medium + + * version set to 4.4.0 + + -- Victor Seva Wed, 30 Mar 2016 14:20:42 +0100 + +kamailio (4.4.0~rc1) unstable; urgency=medium + + * version set to 4.4.0-rc1 + + -- Victor Seva Mon, 21 Mar 2016 22:22:22 +0100 + +kamailio (4.4.0~rc0) unstable; urgency=medium + + * version set to 4.4.0-rc0 + + -- Victor Seva Fri, 11 Mar 2016 09:20:14 +0100 + +kamailio (4.4.0~pre3) unstable; urgency=medium + + * version set to 4.4.0-pre3 + + -- Victor Seva Fri, 11 Mar 2016 09:18:29 +0100 + kamailio (4.4.0~pre2) unstable; urgency=medium * version set to 4.4.0-pre2 diff --git a/pkg/kamailio/deb/debian/control b/pkg/kamailio/deb/debian/control index a702956bfdb..7cf30100651 100644 --- a/pkg/kamailio/deb/debian/control +++ b/pkg/kamailio/deb/debian/control @@ -18,7 +18,6 @@ Build-Depends: bison, libev-dev, libevent-dev, libexpat1-dev, - libfreeradius-client-dev, libgeoip-dev (>= 1.4.5), libhiredis-dev (>= 0.10.0), libjansson-dev, @@ -34,6 +33,7 @@ Build-Depends: bison, libpq-dev, libpurple-dev, librabbitmq-dev, + libradcli-dev, libreadline-dev, libsasl2-dev, libsctp-dev, @@ -498,6 +498,8 @@ Description: Provides a set utility functions for Kamailio . Provides a set of utility functions for Kamailio, which are not related to the server configuration. + . + Includes http client (http_client) module too Package: kamailio-sctp-modules Architecture: linux-any diff --git a/pkg/kamailio/deb/debian/kamailio.examples b/pkg/kamailio/deb/debian/kamailio.examples index c48447a3e9c..e39721e20f0 100644 --- a/pkg/kamailio/deb/debian/kamailio.examples +++ b/pkg/kamailio/deb/debian/kamailio.examples @@ -1,2 +1 @@ examples/* - diff --git a/pkg/kamailio/deb/debian/rules b/pkg/kamailio/deb/debian/rules index b2301e04f6b..6cb058b5e8f 100755 --- a/pkg/kamailio/deb/debian/rules +++ b/pkg/kamailio/deb/debian/rules @@ -19,9 +19,7 @@ include /usr/share/dpkg/buildflags.mk #export DH_VERBOSE=1 export JAVA_HOME=/usr/lib/jvm/java-gcj - -# choose freeradius -export FREERADIUS=1 +export RADCLI=1 # modules not in the "main" kamailio package EXCLUDED_MODULES= @@ -59,12 +57,11 @@ mod_name=$(subst db_,,$(lastword $(subst /, ,$(1)))) define PACKAGE_GRP_BUILD_template # package all the modules in PACKAGE_GROUPS in separate packages - $(foreach grp,$(PACKAGE_GROUPS EXTRA_GROUPS),\ + $(foreach grp,$(PACKAGE_GROUPS),\ $(MAKE) every-module group_include="k$(grp)" ) endef - define PACKAGE_GRP_INSTALL_template $(foreach grp,$(PACKAGE_GROUPS),\ $(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \ @@ -83,6 +80,13 @@ define PACKAGE_GRP_INSTALL_template ) endef +define PACKAGE_EXTRA_BUILD_template + # package all the modules in EXTRA_GROUPS in separate packages + $(foreach grp,$(EXTRA_GROUPS),\ + $(MAKE) every-module group_include="k$(grp)" + ) +endef + define PACKAGE_EXTRA_INSTALL_template $(foreach grp,$(EXTRA_GROUPS),\ $(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \ @@ -135,6 +139,7 @@ build-stamp: configure-stamp $(MAKE) all # make groups $(call PACKAGE_GRP_BUILD_template) + $(call PACKAGE_EXTRA_BUILD_template) touch build-stamp clean: diff --git a/pkg/kamailio/deb/jessie/changelog b/pkg/kamailio/deb/jessie/changelog index 032b4609123..e5a15da0e64 100644 --- a/pkg/kamailio/deb/jessie/changelog +++ b/pkg/kamailio/deb/jessie/changelog @@ -1,3 +1,51 @@ +kamailio (4.4.4) unstable; urgency=medium + + * version set to 4.4.4 + + -- Victor Seva Wed, 09 Nov 2016 13:02:31 +0100 + +kamailio (4.4.3) unstable; urgency=medium + + * version set to 4.4.3 + + -- Victor Seva Wed, 14 Sep 2016 15:27:24 +0200 + +kamailio (4.4.2) unstable; urgency=medium + + * version set to 4.4.2 + + -- Victor Seva Tue, 28 Jun 2016 14:22:03 +0200 + +kamailio (4.4.1) unstable; urgency=medium + + * version set to 4.4.1 + + -- Victor Seva Tue, 10 May 2016 12:07:19 +0200 + +kamailio (4.4.0) unstable; urgency=medium + + * version set to 4.4.0 + + -- Victor Seva Wed, 30 Mar 2016 14:20:42 +0100 + +kamailio (4.4.0~rc1) unstable; urgency=medium + + * version set to 4.4.0-rc1 + + -- Victor Seva Mon, 21 Mar 2016 22:22:22 +0100 + +kamailio (4.4.0~rc0) unstable; urgency=medium + + * version set to 4.4.0-rc0 + + -- Victor Seva Fri, 11 Mar 2016 09:20:14 +0100 + +kamailio (4.4.0~pre3) unstable; urgency=medium + + * version set to 4.4.0-pre3 + + -- Victor Seva Fri, 11 Mar 2016 09:18:29 +0100 + kamailio (4.4.0~pre2) unstable; urgency=medium * version set to 4.4.0-pre2 diff --git a/pkg/kamailio/deb/jessie/control b/pkg/kamailio/deb/jessie/control index 84e5d4a4b4f..81835e65b8b 100644 --- a/pkg/kamailio/deb/jessie/control +++ b/pkg/kamailio/deb/jessie/control @@ -18,7 +18,6 @@ Build-Depends: bison, libev-dev, libevent-dev, libexpat1-dev, - libfreeradius-client-dev, libgeoip-dev (>= 1.4.5), libhiredis-dev (>= 0.10.0), libjansson-dev, @@ -34,6 +33,7 @@ Build-Depends: bison, libpq-dev, libpurple-dev, librabbitmq-dev, + libfreeradius-client-dev, libreadline-dev, libsasl2-dev, libsctp-dev, @@ -497,6 +497,8 @@ Description: Provides a set utility functions for Kamailio . Provides a set of utility functions for Kamailio, which are not related to the server configuration. + . + Includes http client (http_client) module too Package: kamailio-sctp-modules Architecture: linux-any diff --git a/pkg/kamailio/deb/jessie/kamailio.examples b/pkg/kamailio/deb/jessie/kamailio.examples index c48447a3e9c..e39721e20f0 100644 --- a/pkg/kamailio/deb/jessie/kamailio.examples +++ b/pkg/kamailio/deb/jessie/kamailio.examples @@ -1,2 +1 @@ examples/* - diff --git a/pkg/kamailio/deb/jessie/rules b/pkg/kamailio/deb/jessie/rules index 4cee767872d..c8c655ea4ec 100755 --- a/pkg/kamailio/deb/jessie/rules +++ b/pkg/kamailio/deb/jessie/rules @@ -19,8 +19,6 @@ include /usr/share/dpkg/buildflags.mk #export DH_VERBOSE=1 export JAVA_HOME=/usr/lib/jvm/java-gcj - -# choose freeradius export FREERADIUS=1 # modules not in the "main" kamailio package @@ -59,12 +57,11 @@ mod_name=$(subst db_,,$(lastword $(subst /, ,$(1)))) define PACKAGE_GRP_BUILD_template # package all the modules in PACKAGE_GROUPS in separate packages - $(foreach grp,$(PACKAGE_GROUPS EXTRA_GROUPS),\ + $(foreach grp,$(PACKAGE_GROUPS),\ $(MAKE) every-module group_include="k$(grp)" ) endef - define PACKAGE_GRP_INSTALL_template $(foreach grp,$(PACKAGE_GROUPS),\ $(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \ @@ -83,6 +80,13 @@ define PACKAGE_GRP_INSTALL_template ) endef +define PACKAGE_EXTRA_BUILD_template + # package all the modules in EXTRA_GROUPS in separate packages + $(foreach grp,$(EXTRA_GROUPS),\ + $(MAKE) every-module group_include="k$(grp)" + ) +endef + define PACKAGE_EXTRA_INSTALL_template $(foreach grp,$(EXTRA_GROUPS),\ $(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \ @@ -135,6 +139,7 @@ build-stamp: configure-stamp $(MAKE) all # make groups $(call PACKAGE_GRP_BUILD_template) + $(call PACKAGE_EXTRA_BUILD_template) touch build-stamp clean: diff --git a/pkg/kamailio/deb/precise/changelog b/pkg/kamailio/deb/precise/changelog index 032b4609123..e5a15da0e64 100644 --- a/pkg/kamailio/deb/precise/changelog +++ b/pkg/kamailio/deb/precise/changelog @@ -1,3 +1,51 @@ +kamailio (4.4.4) unstable; urgency=medium + + * version set to 4.4.4 + + -- Victor Seva Wed, 09 Nov 2016 13:02:31 +0100 + +kamailio (4.4.3) unstable; urgency=medium + + * version set to 4.4.3 + + -- Victor Seva Wed, 14 Sep 2016 15:27:24 +0200 + +kamailio (4.4.2) unstable; urgency=medium + + * version set to 4.4.2 + + -- Victor Seva Tue, 28 Jun 2016 14:22:03 +0200 + +kamailio (4.4.1) unstable; urgency=medium + + * version set to 4.4.1 + + -- Victor Seva Tue, 10 May 2016 12:07:19 +0200 + +kamailio (4.4.0) unstable; urgency=medium + + * version set to 4.4.0 + + -- Victor Seva Wed, 30 Mar 2016 14:20:42 +0100 + +kamailio (4.4.0~rc1) unstable; urgency=medium + + * version set to 4.4.0-rc1 + + -- Victor Seva Mon, 21 Mar 2016 22:22:22 +0100 + +kamailio (4.4.0~rc0) unstable; urgency=medium + + * version set to 4.4.0-rc0 + + -- Victor Seva Fri, 11 Mar 2016 09:20:14 +0100 + +kamailio (4.4.0~pre3) unstable; urgency=medium + + * version set to 4.4.0-pre3 + + -- Victor Seva Fri, 11 Mar 2016 09:18:29 +0100 + kamailio (4.4.0~pre2) unstable; urgency=medium * version set to 4.4.0-pre2 diff --git a/pkg/kamailio/deb/precise/control b/pkg/kamailio/deb/precise/control index e2bddc4557a..9d5789e3bd7 100644 --- a/pkg/kamailio/deb/precise/control +++ b/pkg/kamailio/deb/precise/control @@ -17,7 +17,6 @@ Build-Depends: bison, libev-dev, libevent-dev, libexpat1-dev, - libradiusclient-ng-dev, libgeoip-dev (>= 1.4.5), libhiredis-dev (>= 0.10.0), libjansson-dev, @@ -32,6 +31,7 @@ Build-Depends: bison, libperl-dev, libpq-dev, libpurple-dev, + libradiusclient-ng-dev, libreadline-dev, libsasl2-dev, libsctp-dev, @@ -494,6 +494,8 @@ Description: Provides a set utility functions for Kamailio . Provides a set of utility functions for Kamailio, which are not related to the server configuration. + . + Includes http client (http_client) module too Package: kamailio-sctp-modules Architecture: linux-any diff --git a/pkg/kamailio/deb/precise/kamailio.examples b/pkg/kamailio/deb/precise/kamailio.examples index c48447a3e9c..e39721e20f0 100644 --- a/pkg/kamailio/deb/precise/kamailio.examples +++ b/pkg/kamailio/deb/precise/kamailio.examples @@ -1,2 +1 @@ examples/* - diff --git a/pkg/kamailio/deb/precise/rules b/pkg/kamailio/deb/precise/rules index 579c1b55432..7bbf437c95f 100755 --- a/pkg/kamailio/deb/precise/rules +++ b/pkg/kamailio/deb/precise/rules @@ -20,8 +20,6 @@ include /usr/share/dpkg/buildflags.mk export JAVA_HOME=/usr/lib/jvm/java-gcj -# choose freeradius - # modules not in the "main" kamailio package EXCLUDED_MODULES= @@ -58,12 +56,11 @@ mod_name=$(subst db_,,$(lastword $(subst /, ,$(1)))) define PACKAGE_GRP_BUILD_template # package all the modules in PACKAGE_GROUPS in separate packages - $(foreach grp,$(PACKAGE_GROUPS EXTRA_GROUPS),\ + $(foreach grp,$(PACKAGE_GROUPS),\ $(MAKE) every-module group_include="k$(grp)" ) endef - define PACKAGE_GRP_INSTALL_template $(foreach grp,$(PACKAGE_GROUPS),\ $(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \ @@ -82,6 +79,13 @@ define PACKAGE_GRP_INSTALL_template ) endef +define PACKAGE_EXTRA_BUILD_template + # package all the modules in EXTRA_GROUPS in separate packages + $(foreach grp,$(EXTRA_GROUPS),\ + $(MAKE) every-module group_include="k$(grp)" + ) +endef + define PACKAGE_EXTRA_INSTALL_template $(foreach grp,$(EXTRA_GROUPS),\ $(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \ @@ -134,6 +138,7 @@ build-stamp: configure-stamp $(MAKE) all # make groups $(call PACKAGE_GRP_BUILD_template) + $(call PACKAGE_EXTRA_BUILD_template) touch build-stamp clean: diff --git a/pkg/kamailio/deb/sid/changelog b/pkg/kamailio/deb/sid/changelog index 032b4609123..e5a15da0e64 100644 --- a/pkg/kamailio/deb/sid/changelog +++ b/pkg/kamailio/deb/sid/changelog @@ -1,3 +1,51 @@ +kamailio (4.4.4) unstable; urgency=medium + + * version set to 4.4.4 + + -- Victor Seva Wed, 09 Nov 2016 13:02:31 +0100 + +kamailio (4.4.3) unstable; urgency=medium + + * version set to 4.4.3 + + -- Victor Seva Wed, 14 Sep 2016 15:27:24 +0200 + +kamailio (4.4.2) unstable; urgency=medium + + * version set to 4.4.2 + + -- Victor Seva Tue, 28 Jun 2016 14:22:03 +0200 + +kamailio (4.4.1) unstable; urgency=medium + + * version set to 4.4.1 + + -- Victor Seva Tue, 10 May 2016 12:07:19 +0200 + +kamailio (4.4.0) unstable; urgency=medium + + * version set to 4.4.0 + + -- Victor Seva Wed, 30 Mar 2016 14:20:42 +0100 + +kamailio (4.4.0~rc1) unstable; urgency=medium + + * version set to 4.4.0-rc1 + + -- Victor Seva Mon, 21 Mar 2016 22:22:22 +0100 + +kamailio (4.4.0~rc0) unstable; urgency=medium + + * version set to 4.4.0-rc0 + + -- Victor Seva Fri, 11 Mar 2016 09:20:14 +0100 + +kamailio (4.4.0~pre3) unstable; urgency=medium + + * version set to 4.4.0-pre3 + + -- Victor Seva Fri, 11 Mar 2016 09:18:29 +0100 + kamailio (4.4.0~pre2) unstable; urgency=medium * version set to 4.4.0-pre2 diff --git a/pkg/kamailio/deb/sid/control b/pkg/kamailio/deb/sid/control index 84e5d4a4b4f..810b8a2f64b 100644 --- a/pkg/kamailio/deb/sid/control +++ b/pkg/kamailio/deb/sid/control @@ -18,7 +18,6 @@ Build-Depends: bison, libev-dev, libevent-dev, libexpat1-dev, - libfreeradius-client-dev, libgeoip-dev (>= 1.4.5), libhiredis-dev (>= 0.10.0), libjansson-dev, @@ -34,6 +33,7 @@ Build-Depends: bison, libpq-dev, libpurple-dev, librabbitmq-dev, + libradcli-dev, libreadline-dev, libsasl2-dev, libsctp-dev, @@ -497,6 +497,8 @@ Description: Provides a set utility functions for Kamailio . Provides a set of utility functions for Kamailio, which are not related to the server configuration. + . + Includes http client (http_client) module too Package: kamailio-sctp-modules Architecture: linux-any diff --git a/pkg/kamailio/deb/sid/kamailio.examples b/pkg/kamailio/deb/sid/kamailio.examples index c48447a3e9c..e39721e20f0 100644 --- a/pkg/kamailio/deb/sid/kamailio.examples +++ b/pkg/kamailio/deb/sid/kamailio.examples @@ -1,2 +1 @@ examples/* - diff --git a/pkg/kamailio/deb/sid/rules b/pkg/kamailio/deb/sid/rules index 4cee767872d..a428e8997a8 100755 --- a/pkg/kamailio/deb/sid/rules +++ b/pkg/kamailio/deb/sid/rules @@ -19,9 +19,7 @@ include /usr/share/dpkg/buildflags.mk #export DH_VERBOSE=1 export JAVA_HOME=/usr/lib/jvm/java-gcj - -# choose freeradius -export FREERADIUS=1 +export RADCLI=1 # modules not in the "main" kamailio package EXCLUDED_MODULES= @@ -59,12 +57,11 @@ mod_name=$(subst db_,,$(lastword $(subst /, ,$(1)))) define PACKAGE_GRP_BUILD_template # package all the modules in PACKAGE_GROUPS in separate packages - $(foreach grp,$(PACKAGE_GROUPS EXTRA_GROUPS),\ + $(foreach grp,$(PACKAGE_GROUPS),\ $(MAKE) every-module group_include="k$(grp)" ) endef - define PACKAGE_GRP_INSTALL_template $(foreach grp,$(PACKAGE_GROUPS),\ $(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \ @@ -83,6 +80,13 @@ define PACKAGE_GRP_INSTALL_template ) endef +define PACKAGE_EXTRA_BUILD_template + # package all the modules in EXTRA_GROUPS in separate packages + $(foreach grp,$(EXTRA_GROUPS),\ + $(MAKE) every-module group_include="k$(grp)" + ) +endef + define PACKAGE_EXTRA_INSTALL_template $(foreach grp,$(EXTRA_GROUPS),\ $(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \ @@ -135,6 +139,7 @@ build-stamp: configure-stamp $(MAKE) all # make groups $(call PACKAGE_GRP_BUILD_template) + $(call PACKAGE_EXTRA_BUILD_template) touch build-stamp clean: diff --git a/pkg/kamailio/deb/squeeze/changelog b/pkg/kamailio/deb/squeeze/changelog index 032b4609123..e5a15da0e64 100644 --- a/pkg/kamailio/deb/squeeze/changelog +++ b/pkg/kamailio/deb/squeeze/changelog @@ -1,3 +1,51 @@ +kamailio (4.4.4) unstable; urgency=medium + + * version set to 4.4.4 + + -- Victor Seva Wed, 09 Nov 2016 13:02:31 +0100 + +kamailio (4.4.3) unstable; urgency=medium + + * version set to 4.4.3 + + -- Victor Seva Wed, 14 Sep 2016 15:27:24 +0200 + +kamailio (4.4.2) unstable; urgency=medium + + * version set to 4.4.2 + + -- Victor Seva Tue, 28 Jun 2016 14:22:03 +0200 + +kamailio (4.4.1) unstable; urgency=medium + + * version set to 4.4.1 + + -- Victor Seva Tue, 10 May 2016 12:07:19 +0200 + +kamailio (4.4.0) unstable; urgency=medium + + * version set to 4.4.0 + + -- Victor Seva Wed, 30 Mar 2016 14:20:42 +0100 + +kamailio (4.4.0~rc1) unstable; urgency=medium + + * version set to 4.4.0-rc1 + + -- Victor Seva Mon, 21 Mar 2016 22:22:22 +0100 + +kamailio (4.4.0~rc0) unstable; urgency=medium + + * version set to 4.4.0-rc0 + + -- Victor Seva Fri, 11 Mar 2016 09:20:14 +0100 + +kamailio (4.4.0~pre3) unstable; urgency=medium + + * version set to 4.4.0-pre3 + + -- Victor Seva Fri, 11 Mar 2016 09:18:29 +0100 + kamailio (4.4.0~pre2) unstable; urgency=medium * version set to 4.4.0-pre2 diff --git a/pkg/kamailio/deb/squeeze/control b/pkg/kamailio/deb/squeeze/control index 38d84869b5d..6c6691aae2d 100644 --- a/pkg/kamailio/deb/squeeze/control +++ b/pkg/kamailio/deb/squeeze/control @@ -15,7 +15,6 @@ Build-Depends: bison, libev-dev, libevent-dev, libexpat1-dev, - libradiusclient-ng-dev, libgeoip-dev (>= 1.4.5), libjson0-dev, libldap2-dev, @@ -26,6 +25,7 @@ Build-Depends: bison, libpcre3-dev, libperl-dev, libpq-dev, + libradiusclient-ng-dev, libreadline-dev, libsasl2-dev, libsnmp-dev, @@ -420,6 +420,8 @@ Description: Provides a set utility functions for Kamailio . Provides a set of utility functions for Kamailio, which are not related to the server configuration. + . + Includes http client (http_client) module too Package: kamailio-tls-modules Architecture: linux-any diff --git a/pkg/kamailio/deb/squeeze/kamailio.examples b/pkg/kamailio/deb/squeeze/kamailio.examples index c48447a3e9c..e39721e20f0 100644 --- a/pkg/kamailio/deb/squeeze/kamailio.examples +++ b/pkg/kamailio/deb/squeeze/kamailio.examples @@ -1,2 +1 @@ examples/* - diff --git a/pkg/kamailio/deb/squeeze/rules b/pkg/kamailio/deb/squeeze/rules index bb5ec8e4d3e..5d65503b40e 100755 --- a/pkg/kamailio/deb/squeeze/rules +++ b/pkg/kamailio/deb/squeeze/rules @@ -18,8 +18,6 @@ DPKG_EXPORT_BUILDFLAGS = 1 #export DH_VERBOSE=1 -# choose freeradius - # modules not in the "main" kamailio package EXCLUDED_MODULES= @@ -56,12 +54,11 @@ mod_name=$(subst db_,,$(lastword $(subst /, ,$(1)))) define PACKAGE_GRP_BUILD_template # package all the modules in PACKAGE_GROUPS in separate packages - $(foreach grp,$(PACKAGE_GROUPS EXTRA_GROUPS),\ + $(foreach grp,$(PACKAGE_GROUPS),\ $(MAKE) every-module group_include="k$(grp)" ) endef - define PACKAGE_GRP_INSTALL_template $(foreach grp,$(PACKAGE_GROUPS),\ $(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \ @@ -80,6 +77,13 @@ define PACKAGE_GRP_INSTALL_template ) endef +define PACKAGE_EXTRA_BUILD_template + # package all the modules in EXTRA_GROUPS in separate packages + $(foreach grp,$(EXTRA_GROUPS),\ + $(MAKE) every-module group_include="k$(grp)" + ) +endef + define PACKAGE_EXTRA_INSTALL_template $(foreach grp,$(EXTRA_GROUPS),\ $(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \ @@ -132,6 +136,7 @@ build-stamp: configure-stamp $(MAKE) all # make groups $(call PACKAGE_GRP_BUILD_template) + $(call PACKAGE_EXTRA_BUILD_template) touch build-stamp clean: diff --git a/pkg/kamailio/deb/stretch/changelog b/pkg/kamailio/deb/stretch/changelog index 032b4609123..e5a15da0e64 100644 --- a/pkg/kamailio/deb/stretch/changelog +++ b/pkg/kamailio/deb/stretch/changelog @@ -1,3 +1,51 @@ +kamailio (4.4.4) unstable; urgency=medium + + * version set to 4.4.4 + + -- Victor Seva Wed, 09 Nov 2016 13:02:31 +0100 + +kamailio (4.4.3) unstable; urgency=medium + + * version set to 4.4.3 + + -- Victor Seva Wed, 14 Sep 2016 15:27:24 +0200 + +kamailio (4.4.2) unstable; urgency=medium + + * version set to 4.4.2 + + -- Victor Seva Tue, 28 Jun 2016 14:22:03 +0200 + +kamailio (4.4.1) unstable; urgency=medium + + * version set to 4.4.1 + + -- Victor Seva Tue, 10 May 2016 12:07:19 +0200 + +kamailio (4.4.0) unstable; urgency=medium + + * version set to 4.4.0 + + -- Victor Seva Wed, 30 Mar 2016 14:20:42 +0100 + +kamailio (4.4.0~rc1) unstable; urgency=medium + + * version set to 4.4.0-rc1 + + -- Victor Seva Mon, 21 Mar 2016 22:22:22 +0100 + +kamailio (4.4.0~rc0) unstable; urgency=medium + + * version set to 4.4.0-rc0 + + -- Victor Seva Fri, 11 Mar 2016 09:20:14 +0100 + +kamailio (4.4.0~pre3) unstable; urgency=medium + + * version set to 4.4.0-pre3 + + -- Victor Seva Fri, 11 Mar 2016 09:18:29 +0100 + kamailio (4.4.0~pre2) unstable; urgency=medium * version set to 4.4.0-pre2 diff --git a/pkg/kamailio/deb/stretch/control b/pkg/kamailio/deb/stretch/control index 84e5d4a4b4f..810b8a2f64b 100644 --- a/pkg/kamailio/deb/stretch/control +++ b/pkg/kamailio/deb/stretch/control @@ -18,7 +18,6 @@ Build-Depends: bison, libev-dev, libevent-dev, libexpat1-dev, - libfreeradius-client-dev, libgeoip-dev (>= 1.4.5), libhiredis-dev (>= 0.10.0), libjansson-dev, @@ -34,6 +33,7 @@ Build-Depends: bison, libpq-dev, libpurple-dev, librabbitmq-dev, + libradcli-dev, libreadline-dev, libsasl2-dev, libsctp-dev, @@ -497,6 +497,8 @@ Description: Provides a set utility functions for Kamailio . Provides a set of utility functions for Kamailio, which are not related to the server configuration. + . + Includes http client (http_client) module too Package: kamailio-sctp-modules Architecture: linux-any diff --git a/pkg/kamailio/deb/stretch/kamailio.examples b/pkg/kamailio/deb/stretch/kamailio.examples index c48447a3e9c..e39721e20f0 100644 --- a/pkg/kamailio/deb/stretch/kamailio.examples +++ b/pkg/kamailio/deb/stretch/kamailio.examples @@ -1,2 +1 @@ examples/* - diff --git a/pkg/kamailio/deb/stretch/rules b/pkg/kamailio/deb/stretch/rules index 4cee767872d..a428e8997a8 100755 --- a/pkg/kamailio/deb/stretch/rules +++ b/pkg/kamailio/deb/stretch/rules @@ -19,9 +19,7 @@ include /usr/share/dpkg/buildflags.mk #export DH_VERBOSE=1 export JAVA_HOME=/usr/lib/jvm/java-gcj - -# choose freeradius -export FREERADIUS=1 +export RADCLI=1 # modules not in the "main" kamailio package EXCLUDED_MODULES= @@ -59,12 +57,11 @@ mod_name=$(subst db_,,$(lastword $(subst /, ,$(1)))) define PACKAGE_GRP_BUILD_template # package all the modules in PACKAGE_GROUPS in separate packages - $(foreach grp,$(PACKAGE_GROUPS EXTRA_GROUPS),\ + $(foreach grp,$(PACKAGE_GROUPS),\ $(MAKE) every-module group_include="k$(grp)" ) endef - define PACKAGE_GRP_INSTALL_template $(foreach grp,$(PACKAGE_GROUPS),\ $(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \ @@ -83,6 +80,13 @@ define PACKAGE_GRP_INSTALL_template ) endef +define PACKAGE_EXTRA_BUILD_template + # package all the modules in EXTRA_GROUPS in separate packages + $(foreach grp,$(EXTRA_GROUPS),\ + $(MAKE) every-module group_include="k$(grp)" + ) +endef + define PACKAGE_EXTRA_INSTALL_template $(foreach grp,$(EXTRA_GROUPS),\ $(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \ @@ -135,6 +139,7 @@ build-stamp: configure-stamp $(MAKE) all # make groups $(call PACKAGE_GRP_BUILD_template) + $(call PACKAGE_EXTRA_BUILD_template) touch build-stamp clean: diff --git a/pkg/kamailio/deb/trusty/changelog b/pkg/kamailio/deb/trusty/changelog index 032b4609123..e5a15da0e64 100644 --- a/pkg/kamailio/deb/trusty/changelog +++ b/pkg/kamailio/deb/trusty/changelog @@ -1,3 +1,51 @@ +kamailio (4.4.4) unstable; urgency=medium + + * version set to 4.4.4 + + -- Victor Seva Wed, 09 Nov 2016 13:02:31 +0100 + +kamailio (4.4.3) unstable; urgency=medium + + * version set to 4.4.3 + + -- Victor Seva Wed, 14 Sep 2016 15:27:24 +0200 + +kamailio (4.4.2) unstable; urgency=medium + + * version set to 4.4.2 + + -- Victor Seva Tue, 28 Jun 2016 14:22:03 +0200 + +kamailio (4.4.1) unstable; urgency=medium + + * version set to 4.4.1 + + -- Victor Seva Tue, 10 May 2016 12:07:19 +0200 + +kamailio (4.4.0) unstable; urgency=medium + + * version set to 4.4.0 + + -- Victor Seva Wed, 30 Mar 2016 14:20:42 +0100 + +kamailio (4.4.0~rc1) unstable; urgency=medium + + * version set to 4.4.0-rc1 + + -- Victor Seva Mon, 21 Mar 2016 22:22:22 +0100 + +kamailio (4.4.0~rc0) unstable; urgency=medium + + * version set to 4.4.0-rc0 + + -- Victor Seva Fri, 11 Mar 2016 09:20:14 +0100 + +kamailio (4.4.0~pre3) unstable; urgency=medium + + * version set to 4.4.0-pre3 + + -- Victor Seva Fri, 11 Mar 2016 09:18:29 +0100 + kamailio (4.4.0~pre2) unstable; urgency=medium * version set to 4.4.0-pre2 diff --git a/pkg/kamailio/deb/trusty/control b/pkg/kamailio/deb/trusty/control index 6a92105bddf..05965a0babe 100644 --- a/pkg/kamailio/deb/trusty/control +++ b/pkg/kamailio/deb/trusty/control @@ -17,7 +17,6 @@ Build-Depends: bison, libev-dev, libevent-dev, libexpat1-dev, - libfreeradius-client-dev, libgeoip-dev (>= 1.4.5), libhiredis-dev (>= 0.10.0), libjansson-dev, @@ -33,6 +32,7 @@ Build-Depends: bison, libpq-dev, libpurple-dev, librabbitmq-dev, + libfreeradius-client-dev, libreadline-dev, libsasl2-dev, libsctp-dev, @@ -496,6 +496,8 @@ Description: Provides a set utility functions for Kamailio . Provides a set of utility functions for Kamailio, which are not related to the server configuration. + . + Includes http client (http_client) module too Package: kamailio-sctp-modules Architecture: linux-any diff --git a/pkg/kamailio/deb/trusty/kamailio.examples b/pkg/kamailio/deb/trusty/kamailio.examples index c48447a3e9c..e39721e20f0 100644 --- a/pkg/kamailio/deb/trusty/kamailio.examples +++ b/pkg/kamailio/deb/trusty/kamailio.examples @@ -1,2 +1 @@ examples/* - diff --git a/pkg/kamailio/deb/trusty/rules b/pkg/kamailio/deb/trusty/rules index 6fc2ce691d0..139909a8189 100755 --- a/pkg/kamailio/deb/trusty/rules +++ b/pkg/kamailio/deb/trusty/rules @@ -19,8 +19,6 @@ include /usr/share/dpkg/buildflags.mk #export DH_VERBOSE=1 export JAVA_HOME=/usr/lib/jvm/java-gcj - -# choose freeradius export FREERADIUS=1 # modules not in the "main" kamailio package @@ -59,12 +57,11 @@ mod_name=$(subst db_,,$(lastword $(subst /, ,$(1)))) define PACKAGE_GRP_BUILD_template # package all the modules in PACKAGE_GROUPS in separate packages - $(foreach grp,$(PACKAGE_GROUPS EXTRA_GROUPS),\ + $(foreach grp,$(PACKAGE_GROUPS),\ $(MAKE) every-module group_include="k$(grp)" ) endef - define PACKAGE_GRP_INSTALL_template $(foreach grp,$(PACKAGE_GROUPS),\ $(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \ @@ -83,6 +80,13 @@ define PACKAGE_GRP_INSTALL_template ) endef +define PACKAGE_EXTRA_BUILD_template + # package all the modules in EXTRA_GROUPS in separate packages + $(foreach grp,$(EXTRA_GROUPS),\ + $(MAKE) every-module group_include="k$(grp)" + ) +endef + define PACKAGE_EXTRA_INSTALL_template $(foreach grp,$(EXTRA_GROUPS),\ $(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \ @@ -135,6 +139,7 @@ build-stamp: configure-stamp $(MAKE) all # make groups $(call PACKAGE_GRP_BUILD_template) + $(call PACKAGE_EXTRA_BUILD_template) touch build-stamp clean: diff --git a/pkg/kamailio/deb/wheezy/changelog b/pkg/kamailio/deb/wheezy/changelog index 032b4609123..e5a15da0e64 100644 --- a/pkg/kamailio/deb/wheezy/changelog +++ b/pkg/kamailio/deb/wheezy/changelog @@ -1,3 +1,51 @@ +kamailio (4.4.4) unstable; urgency=medium + + * version set to 4.4.4 + + -- Victor Seva Wed, 09 Nov 2016 13:02:31 +0100 + +kamailio (4.4.3) unstable; urgency=medium + + * version set to 4.4.3 + + -- Victor Seva Wed, 14 Sep 2016 15:27:24 +0200 + +kamailio (4.4.2) unstable; urgency=medium + + * version set to 4.4.2 + + -- Victor Seva Tue, 28 Jun 2016 14:22:03 +0200 + +kamailio (4.4.1) unstable; urgency=medium + + * version set to 4.4.1 + + -- Victor Seva Tue, 10 May 2016 12:07:19 +0200 + +kamailio (4.4.0) unstable; urgency=medium + + * version set to 4.4.0 + + -- Victor Seva Wed, 30 Mar 2016 14:20:42 +0100 + +kamailio (4.4.0~rc1) unstable; urgency=medium + + * version set to 4.4.0-rc1 + + -- Victor Seva Mon, 21 Mar 2016 22:22:22 +0100 + +kamailio (4.4.0~rc0) unstable; urgency=medium + + * version set to 4.4.0-rc0 + + -- Victor Seva Fri, 11 Mar 2016 09:20:14 +0100 + +kamailio (4.4.0~pre3) unstable; urgency=medium + + * version set to 4.4.0-pre3 + + -- Victor Seva Fri, 11 Mar 2016 09:18:29 +0100 + kamailio (4.4.0~pre2) unstable; urgency=medium * version set to 4.4.0-pre2 diff --git a/pkg/kamailio/deb/wheezy/control b/pkg/kamailio/deb/wheezy/control index e83528cd150..9518bb78c7c 100644 --- a/pkg/kamailio/deb/wheezy/control +++ b/pkg/kamailio/deb/wheezy/control @@ -17,7 +17,6 @@ Build-Depends: bison, libev-dev, libevent-dev, libexpat1-dev, - libradiusclient-ng-dev, libgeoip-dev (>= 1.4.5), libhiredis-dev (>= 0.10.0), libjansson-dev, @@ -31,6 +30,7 @@ Build-Depends: bison, libpcre3-dev, libperl-dev, libpq-dev, + libradiusclient-ng-dev, libreadline-dev, libsasl2-dev, libsctp-dev, @@ -478,6 +478,8 @@ Description: Provides a set utility functions for Kamailio . Provides a set of utility functions for Kamailio, which are not related to the server configuration. + . + Includes http client (http_client) module too Package: kamailio-sctp-modules Architecture: linux-any diff --git a/pkg/kamailio/deb/wheezy/kamailio.examples b/pkg/kamailio/deb/wheezy/kamailio.examples index c48447a3e9c..e39721e20f0 100644 --- a/pkg/kamailio/deb/wheezy/kamailio.examples +++ b/pkg/kamailio/deb/wheezy/kamailio.examples @@ -1,2 +1 @@ examples/* - diff --git a/pkg/kamailio/deb/wheezy/rules b/pkg/kamailio/deb/wheezy/rules index 0f38bebe6aa..570b8b87ffa 100755 --- a/pkg/kamailio/deb/wheezy/rules +++ b/pkg/kamailio/deb/wheezy/rules @@ -20,8 +20,6 @@ include /usr/share/dpkg/buildflags.mk export JAVA_HOME=/usr/lib/jvm/java-gcj -# choose freeradius - # modules not in the "main" kamailio package EXCLUDED_MODULES= @@ -58,12 +56,11 @@ mod_name=$(subst db_,,$(lastword $(subst /, ,$(1)))) define PACKAGE_GRP_BUILD_template # package all the modules in PACKAGE_GROUPS in separate packages - $(foreach grp,$(PACKAGE_GROUPS EXTRA_GROUPS),\ + $(foreach grp,$(PACKAGE_GROUPS),\ $(MAKE) every-module group_include="k$(grp)" ) endef - define PACKAGE_GRP_INSTALL_template $(foreach grp,$(PACKAGE_GROUPS),\ $(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \ @@ -82,6 +79,13 @@ define PACKAGE_GRP_INSTALL_template ) endef +define PACKAGE_EXTRA_BUILD_template + # package all the modules in EXTRA_GROUPS in separate packages + $(foreach grp,$(EXTRA_GROUPS),\ + $(MAKE) every-module group_include="k$(grp)" + ) +endef + define PACKAGE_EXTRA_INSTALL_template $(foreach grp,$(EXTRA_GROUPS),\ $(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \ @@ -134,6 +138,7 @@ build-stamp: configure-stamp $(MAKE) all # make groups $(call PACKAGE_GRP_BUILD_template) + $(call PACKAGE_EXTRA_BUILD_template) touch build-stamp clean: diff --git a/pkg/kamailio/deb/xenial/changelog b/pkg/kamailio/deb/xenial/changelog new file mode 100644 index 00000000000..e5a15da0e64 --- /dev/null +++ b/pkg/kamailio/deb/xenial/changelog @@ -0,0 +1,313 @@ +kamailio (4.4.4) unstable; urgency=medium + + * version set to 4.4.4 + + -- Victor Seva Wed, 09 Nov 2016 13:02:31 +0100 + +kamailio (4.4.3) unstable; urgency=medium + + * version set to 4.4.3 + + -- Victor Seva Wed, 14 Sep 2016 15:27:24 +0200 + +kamailio (4.4.2) unstable; urgency=medium + + * version set to 4.4.2 + + -- Victor Seva Tue, 28 Jun 2016 14:22:03 +0200 + +kamailio (4.4.1) unstable; urgency=medium + + * version set to 4.4.1 + + -- Victor Seva Tue, 10 May 2016 12:07:19 +0200 + +kamailio (4.4.0) unstable; urgency=medium + + * version set to 4.4.0 + + -- Victor Seva Wed, 30 Mar 2016 14:20:42 +0100 + +kamailio (4.4.0~rc1) unstable; urgency=medium + + * version set to 4.4.0-rc1 + + -- Victor Seva Mon, 21 Mar 2016 22:22:22 +0100 + +kamailio (4.4.0~rc0) unstable; urgency=medium + + * version set to 4.4.0-rc0 + + -- Victor Seva Fri, 11 Mar 2016 09:20:14 +0100 + +kamailio (4.4.0~pre3) unstable; urgency=medium + + * version set to 4.4.0-pre3 + + -- Victor Seva Fri, 11 Mar 2016 09:18:29 +0100 + +kamailio (4.4.0~pre2) unstable; urgency=medium + + * version set to 4.4.0-pre2 + + -- Victor Seva Thu, 10 Mar 2016 12:38:56 +0100 + +kamailio (4.4.0~pre1) unstable; urgency=medium + + * version set to 4.4.0-pre1 + + -- Victor Seva Tue, 23 Feb 2016 08:53:36 +0100 + +kamailio (4.4.0~pre0) unstable; urgency=medium + + * version set to 4.4.0-pre0 + + -- Victor Seva Thu, 04 Feb 2016 11:51:56 +0100 + +kamailio (4.4.0~dev9) unstable; urgency=medium + + * update version to 4.4.0~dev9 + + -- Victor Seva Wed, 03 Feb 2016 18:29:09 +0100 + +kamailio (4.4.0~dev8) unstable; urgency=medium + + * update version to 4.4.0~dev8 + + -- Victor Seva Fri, 18 Dec 2015 11:42:59 +0100 + +kamailio (4.4.0~dev6) unstable; urgency=medium + + * update version to 4.4.0~dev6 + + -- Victor Seva Thu, 05 Nov 2015 09:16:36 +0100 + +kamailio (4.4.0~dev5) unstable; urgency=medium + + * update version to 4.4.0~dev5 + + -- Victor Seva Fri, 02 Oct 2015 14:15:56 +0200 + +kamailio (4.4.0~dev3) unstable; urgency=medium + + * update version to 4.4.0~dev3 + + -- Victor Seva Thu, 10 Sep 2015 09:27:22 +0200 + +kamailio (4.4.0~dev2) unstable; urgency=medium + + * update version to 4.4.0~dev2 + + -- Victor Seva Tue, 14 Jul 2015 16:21:03 +0200 + +kamailio (4.4.0~dev0) unstable; urgency=medium + + * update version to 4.4.0~dev0 + + -- Victor Seva Tue, 26 May 2015 10:18:42 +0200 + +kamailio (4.3.0~pre2) unstable; urgency=medium + + * update version to 4.3.0~pre2 + + -- Victor Seva Mon, 18 May 2015 11:18:45 +0200 + +kamailio (4.3.0~pre1) unstable; urgency=medium + + * update version to 4.3.0~pre1 + + -- Victor Seva Tue, 05 May 2015 10:52:12 +0200 + +kamailio (4.3.0~pre0) unstable; urgency=medium + + * update version to 4.3.0~pre0 + + -- Victor Seva Thu, 23 Apr 2015 09:58:06 +0200 + +kamailio (4.3.0~dev5) unstable; urgency=medium + + * update version to 4.3.0~dev5 + + -- Victor Seva Thu, 12 Mar 2015 15:20:01 +0100 + +kamailio (4.3.0~dev4) unstable; urgency=medium + + * update version to 4.3.0~dev4 + + -- Victor Seva Sat, 07 Feb 2015 09:53:08 +0100 + +kamailio (4.3.0~dev3) unstable; urgency=medium + + * update version to 4.3.0~dev3 + + -- Victor Seva Sat, 03 Jan 2015 23:21:53 +0100 + +kamailio (4.3.0~dev1) unstable; urgency=medium + + * update version to 4.3.0~dev1 + + -- Victor Seva Mon, 13 Oct 2014 14:33:16 +0200 + +kamailio (4.3.0~dev0) unstable; urgency=medium + + * update version to 4.3.0~dev0 + + -- Victor Seva Thu, 09 Oct 2014 09:49:13 +0200 + +kamailio (4.2.0~pre1) UNRELEASED; urgency=medium + + * update version to 4.2.0~pre1 + + -- Victor Seva Mon, 29 Sep 2014 10:17:56 +0200 + +kamailio (4.2.0~pre0) UNRELEASED; urgency=medium + + * update version to 4.2.0~pre0 + + -- Victor Seva Fri, 12 Sep 2014 02:38:24 +0200 + +kamailio (4.2.0~dev9) unstable; urgency=medium + + * update version to 4.2.0~dev9 + + -- Victor Seva Tue, 02 Sep 2014 11:18:12 +0200 + +kamailio (4.2.0~dev8) unstable; urgency=medium + + * update version to 4.2.0~dev8 + + -- Victor Seva Sat, 26 Jul 2014 10:03:22 +0200 + +kamailio (4.2.0~dev7) unstable; urgency=medium + + * update version to 4.2.0~dev7 + + -- Victor Seva Thu, 12 Jun 2014 12:55:05 +0200 + +kamailio (4.2.0~dev6) unstable; urgency=medium + + * update version to 4.2.0~dev6 + + -- Victor Seva Sat, 03 May 2014 21:49:21 +0200 + +kamailio (4.2.0~dev5) unstable; urgency=medium + + * update version to 4.2.0~dev5 + + -- Victor Seva Mon, 21 Apr 2014 22:52:17 +0200 + +kamailio (4.2.0~dev4) unstable; urgency=medium + + * update version to 4.2.0~dev4 + + -- Victor Seva Tue, 08 Apr 2014 11:56:12 +0200 + +kamailio (4.2.0~dev3) unstable; urgency=medium + + * update version to 4.2.0~dev3 + + -- Victor Seva Fri, 21 Feb 2014 22:52:43 +0100 + +kamailio (4.2.0~dev2) unstable; urgency=medium + + * update version to 4.2.0~dev2 + + -- Victor Seva Mon, 03 Feb 2014 11:12:36 +0100 + +kamailio (4.2.0~dev1) unstable; urgency=medium + + * update version to 4.2.0~dev1 + + -- Victor Seva Wed, 08 Jan 2014 19:13:30 +0100 + +kamailio (4.2.0~dev0) unstable; urgency=low + + * Added packages: + - kamailio-autheph-modules + - kamailio-sctp-modules + - kamailio-java-modules + + -- Victor Seva Tue, 03 Dec 2013 14:26:58 +0100 + +kamailio (4.0.0) unstable; urgency=low + + * update to 4.0.0 from upstream + + -- Daniel-Constantin Mierla Mon, 11 Mar 2013 10:40:30 +0100 + +kamailio (3.4.0~dev0) unstable; urgency=low + + * update version to 3.4.0~dev0 + + -- Jon Bonilla Wed, 15 Jun 2012 03:15:00 +0100 + +kamailio (3.2.0) unstable; urgency=low + + * update to 3.2.0 from upstream + + -- Daniel-Constantin Mierla Fri, 29 Apr 2011 12:25:30 +0100 + +kamailio (3.1.1) unstable; urgency=low + + * update to 3.1.1 from upstream + + -- Jon Bonilla Fri, 3 Dec 2010 16:30:00 +0100 + +kamailio (3.1.0) unstable; urgency=low + + * update to 3.1.0 from upstream + + -- Jon Bonilla Wed, 6 Oct 2010 17:24:00 +0100 + +kamailio (3.0.2.99) unstable; urgency=low + + * update to 3.0.2.99 for development version builds + + -- Jon Bonilla Fri, 28 May 2010 22:26:00 +0100 + +kamailio (3.0.2) unstable; urgency=low + + * update to 3.0.2 from upstream + + -- Daniel-Constantin Mierla Thu, 27 May 2010 10:27:36 +0100 + +kamailio (3.0.1) unstable; urgency=low + + * update to 3.0.1 from upstream + + -- Daniel-Constantin Mierla Mon, 08 Mar 2010 20:30:48 +0100 + +kamailio (3.0.0) unstable; urgency=low + + * update to 3.0.0 from upstream + + -- Daniel-Constantin Mierla Mon, 11 Jan 2010 18:30:42 +0100 + +kamailio (3.0.0-rc3) unstable; urgency=low + + * update to 3.0.0-rc3 from upstream + * updated debian/rules to work with the SIP Router style module packaging + + -- Daniel-Constantin Mierla Fri, 10 Dec 2009 12:10:02 +0100 + +kamailio (3.0.0-rc2) unstable; urgency=low + + * update to 3.0.0-rc2 from upstream + * updated debian/rules to work with the new style module packaging + + -- Jonas Bergler Wed, 18 Nov 2009 12:30:02 +1300 + +kamailio (1.5.0-svn1) unstable; urgency=low + + * increment debian packaging for trunk + + -- Henning Westerholt Mon, 02 Mar 2009 17:40:02 +0100 + +kamailio (1.4.0-svn1) unstable; urgency=low + + [ Klaus Darilion ] + * first release of Kamailio (after renaming from Openser) + + -- Julien BLACHE Wed, 12 Dec 2007 17:25:31 +0100 + + diff --git a/pkg/kamailio/deb/xenial/compat b/pkg/kamailio/deb/xenial/compat new file mode 100644 index 00000000000..ec635144f60 --- /dev/null +++ b/pkg/kamailio/deb/xenial/compat @@ -0,0 +1 @@ +9 diff --git a/pkg/kamailio/deb/xenial/control b/pkg/kamailio/deb/xenial/control new file mode 100644 index 00000000000..7a6d8fcbd9f --- /dev/null +++ b/pkg/kamailio/deb/xenial/control @@ -0,0 +1,680 @@ +Source: kamailio +Section: net +Priority: optional +Maintainer: Debian VoIP Team +Uploaders: Victor Seva , + Tzafrir Cohen +Build-Depends: bison, + debhelper (>= 9), + dh-systemd (>= 1.5), + docbook-xml, + dpkg-dev (>= 1.16.1.1), + erlang-dev, + flex, + gcj-jdk, + libconfuse-dev, + libcurl4-openssl-dev, + libdb-dev (>= 4.6.19), + libev-dev, + libevent-dev, + libexpat1-dev, + libgeoip-dev (>= 1.4.5), + libhiredis-dev (>= 0.10.0), + libjansson-dev, + libjson-c-dev, + libldap2-dev, + liblua5.1-0-dev, + libmemcached-dev, + libmono-2.0-dev, + libmysqlclient-dev, + libncurses5-dev, + libpcre3-dev, + libperl-dev, + libpq-dev, + libpurple-dev, + librabbitmq-dev, + libradcli-dev, + libreadline-dev, + libsasl2-dev, + libsctp-dev, + libsnmp-dev, + libsqlite3-dev, + libunistring-dev, + libval-dev, + libxml2-dev, + libxmlrpc-core-c3-dev, + openssl, + pkg-config, + python, + python-dev, + unixodbc-dev, + uuid-dev, + xsltproc, + zlib1g-dev +Standards-Version: 3.9.5 +Homepage: http://www.kamailio.org/ +Vcs-git: git://anonscm.debian.org/pkg-voip/kamailio.git +Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-voip/kamailio.git + +Package: kamailio +Architecture: linux-any +Multi-Arch: foreign +Pre-Depends: ${misc:Pre-Depends} +Depends: adduser, + python, + ${misc:Depends}, + ${shlibs:Depends} +Suggests: kamailio-berkeley-modules, + kamailio-carrierroute-modules, + kamailio-cpl-modules, + kamailio-dbg, + kamailio-ldap-modules, + kamailio-lua-modules, + kamailio-mysql-modules, + kamailio-perl-modules, + kamailio-postgres-modules, + kamailio-presence-modules, + kamailio-python-modules, + kamailio-radius-modules, + kamailio-snmpstats-modules, + kamailio-tls-modules, + kamailio-unixodbc-modules, + kamailio-xml-modules, + kamailio-xmpp-modules +Description: very fast and configurable SIP proxy + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + C Shell-like scripting language provides full control over the server's + behaviour. Its modular architecture allows only required functionality to be + loaded. + . + Among others, the following modules are available: digest authentication, CPL + scripts, instant messaging, MySQL support, presence agent, RADIUS + authentication, record routing, SMS gateway, Jabber/XMPP gateway, transaction + module, registrar and user location, XML-RPC interface. + . + This package contains the main Kamailio binary along with the principal modules + and support binaries. + +Package: kamailio-dbg +Priority: extra +Section: debug +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends} +Description: very fast and configurable SIP proxy [debug symbols] + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package contains the debugging symbols for the Kamailio binaries and + modules. You only need to install it if you need to debug Kamailio. + +Package: kamailio-geoip-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: contains the geoip module + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the geoip module, an extension allowing to + use GeoIP API within configuration file. + +Package: kamailio-sqlite-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Recommends: sqlite3 +Description: SQLite database connectivity module for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the SQLite database driver for Kamailio. + +Package: kamailio-json-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: Json parser and jsonrpc modules for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides json parser for Kamailio's configuration file + and the JSON-RPC client over netstrings. + +Package: kamailio-memcached-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Replaces: kamailio-memcached-module +Description: Provides the memcached module, an interface to the memcached server + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the memcached module, an interface to the memcached + server, a high-performance, distributed memory object caching system. + +Package: kamailio-lua-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: contains the app_lua module + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the app_lua module, an extension allowing to + execute embedded Lua applications within configuration file. + +Package: kamailio-mono-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: contains the app_mono module + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the app_mono module, an extension allowing to + execute embedded Mono applications within configuration file. + +Package: kamailio-python-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + python-dev, + ${misc:Depends}, + ${shlibs:Depends} +Description: contains the app_python module + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the app_python module, an extension allowing to + execute embedded Python applications within configuration file. + +Package: kamailio-redis-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: Redis database connectivity module for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the Redis NOSQL database driver for Kamailio. + +Package: kamailio-mysql-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + mysql-client | virtual-mysql-client, + ${misc:Depends}, + ${shlibs:Depends} +Description: MySQL database connectivity module for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the MySQL database driver for Kamailio. + +Package: kamailio-postgres-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + postgresql-client, + ${misc:Depends}, + ${shlibs:Depends} +Description: PostgreSQL database connectivity module for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the PostgreSQL database driver for Kamailio. + +Package: kamailio-cpl-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: CPL module (CPL interpreter engine) for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides a CPL (Call Processing Language) interpreter for + Kamailio, turning Kamailio into a CPL server (storage and interpreter). + +Package: kamailio-radius-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: RADIUS modules for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides a set of RADIUS modules for Kamailio, for + authentication, peering, group membership and messages URIs checking against a + RADIUS server. + +Package: kamailio-unixodbc-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: unixODBC database connectivity module for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the unixODBC database driver for Kamailio. + +Package: kamailio-presence-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: SIMPLE presence modules for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides several Kamailio modules for implementing presence + server and presence user agent for RICH presence, registrar-based presence, + external triggered presence and XCAP support. + +Package: kamailio-perl-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: Perl extensions and database driver for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides an interface for Kamailio to write Perl extensions and + the perlvdb database driver for Kamailio. + +Package: kamailio-snmpstats-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + snmpd, + ${misc:Depends}, + ${shlibs:Depends} +Description: SNMP AgentX subagent module for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the snmpstats module for Kamailio. This module acts + as an AgentX subagent which connects to a master agent. + +Package: kamailio-purple-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: Provides the purple module, a multi-protocol IM gateway + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the purple module, a multi-protocol instant + messaging gateway module. + +Package: kamailio-xmpp-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: XMPP gateway module for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the SIP to XMPP IM translator module for Kamailio. + +Package: kamailio-xml-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Replaces: kamailio-xml-module, + kamailio-xmlrpc-module +Provides: kamailio-xmlrpc-modules +Description: XML based extensions for Kamailio's Management Interface + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides: + - the XMLRPC transport implementations for Kamailio's + Management and Control Interface. + - xmlops module for XPath operations in configuration file + +Package: kamailio-carrierroute-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: carrierroute module for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the carrierroute module for Kamailio, an integrated + solution for routing, balancing and blacklisting. + +Package: kamailio-berkeley-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: db5.1-util, + kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: Berkeley database module for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the Berkeley database module for Kamailio, a + high-performance embedded DB kernel. All database tables are stored + in files, no additional server is necessary. + +Package: kamailio-berkeley-bin +Architecture: linux-any +Multi-Arch: foreign +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, + ${shlibs:Depends} +Description: Berkeley database module for Kamailio - helper program + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides helper modules for the Berkeley database module for + Kamailio, a high-performance embedded DB kernel. You should normally + install kamailio-berkeley-modules and not this package directly. + +Package: kamailio-ldap-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: LDAP modules for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the ldap and h350 modules for Kamailio, enabling LDAP + queries from the Kamailio config and storage of SIP account data in an LDAP + directory. + +Package: kamailio-ims-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: IMS module for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package contains various Diameter interfaces and modules for Kamailio + to run as an IMS core. + +Package: kamailio-utils-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: Provides a set utility functions for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + Provides a set of utility functions for Kamailio, which are not related + to the server configuration. + . + Includes http client (http_client) module too + +Package: kamailio-sctp-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: sctp module for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the sctp module for Kamailio. + +Package: kamailio-java-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: gcj-jre, + kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: contains the app_java module + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the app_java module, an extension allowing to + execute embedded Java applications within configuration file. + +Package: kamailio-tls-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: contains the TLS kamailio transport module + This has been split out of the main kamailio package, so that kamailio will + not depend on openssl. This module will enable you to use the TLS transport. + +Package: kamailio-outbound-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: Outbound module for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package contains the module implementing SIP outbound extension. + +Package: kamailio-websocket-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: Websocket module for kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package contains the module implementing WebSocket transport layer. + +Package: kamailio-dnssec-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: contains the dnssec module + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the dnssec module for Kamailio. + +Package: kamailio-autheph-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: authentication using ephemeral credentials module for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the ephemeral module for Kamailio. + +Package: kamailio-kazoo-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: kazoo modules for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the kazoo module for Kamailio. + +Package: kamailio-cnxcc-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: cnxcc modules for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides the cnxcc module for Kamailio. + +Package: kamailio-erlang-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: erlang modules for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This module provides interact with Erlang node. The module allows sending, + receiving Erlang messages and RPC calls between each other. + +Package: kamailio-extra-modules +Architecture: linux-any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: kamailio (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: extra modules for Kamailio + Kamailio is a very fast and flexible SIP (RFC3261) + proxy server. Written entirely in C, Kamailio can handle thousands calls + per second even on low-budget hardware. + . + This package provides: gzcompress uuid ev jansson janssonrpc-c + +Package: kamailio-nth +Architecture: any +Pre-Depends: ${misc:Pre-Depends} +Depends: binutils, + bison, + bvi, + flex, + gcc, + gdb, + iftop, + lsof, + mc, + most, + ngrep, + psmisc, + screen, + sipsak, + tcpdump, + vim, + ${misc:Depends} +Description: Kamailio - package for "nice to have" installation + This is a metapackage for easy installation various useful tools that may be + handy on server with Kamailio installed. diff --git a/pkg/kamailio/deb/xenial/copyright b/pkg/kamailio/deb/xenial/copyright new file mode 100644 index 00000000000..ff31338b517 --- /dev/null +++ b/pkg/kamailio/deb/xenial/copyright @@ -0,0 +1,335 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Kamailio +Upstream-Contact: sr-dev@lists.sip-router.org +Source: http://www.kamailio.org/pub/kamailio/ + +Files: * +Copyright: + 2001-2003 FhG Fokus + 2006-2010 iptelorg GmbH + Various others (see AUTHORS file) +License: GPL-2.0+ + On Debian systems, the full text of the GNU General Public + License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. + +Files: debian/* +Copyright: 2012, 2013, 2014 Victor Seva + 2009, 2010, 2011, Daniel-Constantin Mierla + 2010, Jon Bonilla + 2009, Jonas Bergler + 2009, Henning Westerholt + 2007, Julien BLACHE +License: GPL-2+ + On Debian systems, the full text of the GNU General Public + License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. + + +Files: atomic/* atomic_ops.* basex.* bit_*.c char_msg_val.h compiler_opt.h + core_stats.h counters.* endianness.* futexlock.h hashes.h io_wait.* + kstats_types.h lib/kcore/kstats_wrapper.* lock_ops.c lock_ops_init.h + lvalue.* mem/ll_malloc.* mem/memdbg.h mem/sf_malloc.* mi/*.h mod_fix.* + modules/tm/rpc_uac.* modules/counters/counters.c modules/tls/sbufq.h + modules/tls/tls_bio.* modules/tls/tls_cfg.* modules/tls/tls_cfg.h + modules/tls/tls_ct_wrq.* modules/tls/tls_ct_q.h modules/tls/tls_domain.* + modules/tls/tls_server.h modules/tls/tls_locking.* modules/tls/tls_rpc.* + modules/tls/tls_server.c modules/malloc_test/malloc_test.c modules/blst/blst.c + parser/case_p_* parser/case_reas.h pvapi.h pv_core.* rand/fastrand.* raw_* + rpc_lookup.* rvalue.* sctp_* ser_time.h shm_init.* sip_msg_clone.* sock_ut.* + sr_compat.* str_hash.h switch.* tcp_ev.h tcp_int_send.h tcp_options.* + tcp_read.h tcp_stats.* timer_proc.* tls_hooks.* tls_hooks_init.h ver.* +Copyright: 2006-2010 iptelorg GmbH +License: ISC + +Files: modules/tls/tls_select.* modules/tls/tls_dump_vf.* +Copyright: 2005-2010 iptelorg GmbH +License: GPL-2 + OpenSSL exception + On Debian systems, the full text of the GNU General Public + License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. + * Exception: permission to copy, modify, propagate, and distribute a work + * formed by combining OpenSSL toolkit software and the code in this file, + * such as linking with software components and libraries released under + * OpenSSL project license. + +Files: modules/websocket/* modules/outbound/* modules/auth_ephemeral/* +Copyright: 2012-2013 Crocodile RCS Ltd +License: GPL-2 + OpenSSL exception + On Debian systems, the full text of the GNU General Public + License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. + * Exception: permission to copy, modify, propagate, and distribute a work + * formed by combining OpenSSL toolkit software and the code in this file, + * such as linking with software components and libraries released under + * OpenSSL project license. + +Files: daemonize.* fastlock.h lock_ops.h mem/mem.* mem/f_malloc.h + mem/meminfo.h mem/memtest.c mem/shm_mem.c mem/q_malloc.h mem/q_malloc.c + mem/shm_mem.h mem/f_malloc.c modules/tls/tls_rpc.c modules/tls/tls_server.c + modules/tls/tls_domain.c modules/tls/tls_domain.h modules/tls/tls_server.h + modules/tls/tls_rpc.h pt.c pt.h sched_yield.h ut.c ut.h +Copyright: 2001-2003 FhG Fokus +License: ISC + +Files: events.* modules/topoh/* +Copyright: 2009 SIP-Router.org +License: ISC + +Files: modules/mi_rpc/mi_rpc_mod.c modules/pv/pv_xavp.* + modules/usrloc/ul_rpc.* ppcfg.* xavp.* +Copyright: 2009-2010 Daniel-Constantin Mierla (asipto.com) +License: ISC + +Files: obsolete/jabber_k/tree234.* +Copyright: 1999, 2000, 2001, Simon Tatham +License: Expat + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + . + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +Files: modules/xmpp/xsnprintf.c obsolete/jabber_s/xsnprintf.c obsolete/jabber_k/xsnprintf.c +Copyright: 1995-1998, The Apache Group +License: Apache-1.0 + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + . + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + . + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the Apache Group + for use in the Apache HTTP server project (http://www.apache.org/)." + . + 4. The names "Apache Server" and "Apache Group" must not be used to + endorse or promote products derived from this software without + prior written permission. + . + 5. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the Apache Group + for use in the Apache HTTP server project (http://www.apache.org/)." + . + THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY + EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR + ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + +Files: modules/mi_xmlrpc/abyss* +Copyright: 2000, Moez Mahfoudh +License: BSD-3-clause + +Files: list.h +Copyright: 1991, 1993 The Regents of the University of California +License: BSD-3-clause + +Files: modules/tm/t_serial.* +Copyright: 2008 Juha Heinanen +License: BSD-2-clause + +Files: parser/sdp/sdp.* parser/sdp/sdp_helpr_funcs.* parser/sdp/sdp_cloner.h +Copyright: + 2008-2009 SOMA Networks, INC. + 2010 VoIP Embedded, Inc +License: BSD-2-clause + +Files: modules/tls/fixed_c_zlib.h +Copyright:1998-2005 The OpenSSL Project +Comment: file copied from OpenSSL 0.9.8, refers to OpenSSL License. Note that + this code will not build by default in the Debian packaging. +License: OpenSSL + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + . + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + . + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + . + 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + . + 5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + . + 6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + . + THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + +Files: md5.* md5utils.c +Copyright: 1991-2, RSA Data Security, Inc +Comment: Note that md5.c and md5.h have been replaced in the patches + plum_md5*.patch . + . + As for md5utils.c, according to a mail from Upstream (Daniel-Constantin + Mierla): while the initial commit log for it states that it is derived + from mddriver.c of RFC 1321, it seems that it was, in fact, written from + scratch by Jiri Kuthan (a core developer of SER at that time, working for + FhG Fokus Institute). As you can see it's rather trivial and uses a data + type of SER ("str"). I didn't reimplement it as it's too trivial and + looks like there's no other way to implement it. +License: RSA-MD5 + License to copy and use this software is granted provided that it + is identified as the "RSA Data Security, Inc. MD5 Message-Digest + Algorithm" in all material mentioning or referencing this software + or this function. + . + License is also granted to make and use derivative works provided + that such works are identified as "derived from the RSA Data + Security, Inc. MD5 Message-Digest Algorithm" in all material + mentioning or referencing the derived work. + . + RSA Data Security, Inc. makes no representations concerning either + the merchantability of this software or the suitability of this + software for any particular purpose. It is provided "as is" + without express or implied warranty of any kind. + . + These notices must be retained in any copies of any part of this + documentation and/or software. + +Files: mem/dl_* +Copyright: n/a +License: public-domain + This is a version (aka dlmalloc) of malloc/free/realloc written by + Doug Lea and released to the public domain, as explained at + http://creativecommons.org/licenses/publicdomain. Send questions, + comments, complaints, performance data, etc to dl@cs.oswego.edu + +Files: rand/isaac/* +Copyright: n/a +License: public-domain + By Bob Jenkins. My random number generator, ISAAC. Public Domain. + +License: ISC + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + . + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Files: lib/srutils/srjson.* +Copyright: 2009 Dave Gamble +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + , + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + +License: BSD-3-clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 4. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +License: BSD-2-clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + . + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + . + THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/pkg/kamailio/deb/xenial/kamailio-autheph-modules.lintian-overrides b/pkg/kamailio/deb/xenial/kamailio-autheph-modules.lintian-overrides new file mode 100644 index 00000000000..dcb3d18c6fd --- /dev/null +++ b/pkg/kamailio/deb/xenial/kamailio-autheph-modules.lintian-overrides @@ -0,0 +1 @@ +kamailio-autheph-modules binary: possible-gpl-code-linked-with-openssl diff --git a/pkg/kamailio/deb/xenial/kamailio-berkeley-bin.dirs b/pkg/kamailio/deb/xenial/kamailio-berkeley-bin.dirs new file mode 100644 index 00000000000..236670a2d0f --- /dev/null +++ b/pkg/kamailio/deb/xenial/kamailio-berkeley-bin.dirs @@ -0,0 +1 @@ +usr/sbin diff --git a/pkg/kamailio/deb/xenial/kamailio-dnssec-modules.lintian-overrides b/pkg/kamailio/deb/xenial/kamailio-dnssec-modules.lintian-overrides new file mode 100644 index 00000000000..10165fec95d --- /dev/null +++ b/pkg/kamailio/deb/xenial/kamailio-dnssec-modules.lintian-overrides @@ -0,0 +1 @@ +kamailio-dnssec-modules binary: possible-gpl-code-linked-with-openssl diff --git a/pkg/kamailio/deb/xenial/kamailio-outbound-modules.lintian-overrides b/pkg/kamailio/deb/xenial/kamailio-outbound-modules.lintian-overrides new file mode 100644 index 00000000000..3050cfeb4ca --- /dev/null +++ b/pkg/kamailio/deb/xenial/kamailio-outbound-modules.lintian-overrides @@ -0,0 +1 @@ +kamailio-outbound-modules binary: possible-gpl-code-linked-with-openssl diff --git a/pkg/kamailio/deb/xenial/kamailio-tls-modules.lintian-overrides b/pkg/kamailio/deb/xenial/kamailio-tls-modules.lintian-overrides new file mode 100644 index 00000000000..bbe0d3768ff --- /dev/null +++ b/pkg/kamailio/deb/xenial/kamailio-tls-modules.lintian-overrides @@ -0,0 +1 @@ +kamailio-tls-modules binary: possible-gpl-code-linked-with-openssl diff --git a/pkg/kamailio/deb/xenial/kamailio-websocket-modules.lintian-overrides b/pkg/kamailio/deb/xenial/kamailio-websocket-modules.lintian-overrides new file mode 100644 index 00000000000..8f384fbc379 --- /dev/null +++ b/pkg/kamailio/deb/xenial/kamailio-websocket-modules.lintian-overrides @@ -0,0 +1 @@ +kamailio-websocket-modules binary: possible-gpl-code-linked-with-openssl diff --git a/pkg/kamailio/deb/xenial/kamailio.README.Debian b/pkg/kamailio/deb/xenial/kamailio.README.Debian new file mode 100644 index 00000000000..d25769a9694 --- /dev/null +++ b/pkg/kamailio/deb/xenial/kamailio.README.Debian @@ -0,0 +1,39 @@ +Kamailio for Debian +------------------- + +* init script check for fork=no +------------------------------- + +The Kamailio init script will not start Kamailio on boot if fork=no is +specified in the config file. The check in the initscript will match +any occurrence of fork=no in the file, even inside C-style comments. + +You can disable this check in the init script if you wish; just comment +out the calls to the check_fork function in the script. Your changes to +the init script will be preserved upon upgrade, as the file is tagged +as a conffile. + + +* Kamailio setup +---------------- + +To setup Kamailio, you need to: + - configure Kamailio properly to suit your needs + - edit /etc/default/kamailio, adjust the MEMORY parameter and set + RUN_KAMAILIO to "yes" + +If you are building an HA cluster using heartbeat or similar, you'll want +to disable the init script by running: + + update-rc.d kamailio remove + +so that Kamailio will not be launched at system startup. You still need +to set RUN_KAMAILIO to "yes" if you want to use the /etc/init.d/kamailio init +script. + +Set the DUMP_CORE parameter in /etc/default/kamailio to "yes" if you want to +get a core dump in case Kamailio crashes. The debug symbols for Kamailio are +provided by the kamailio-dbg package. + + + -- Victor Seva Wed, 11 Dec 2013 16:07:11 +0100 diff --git a/pkg/kamailio/deb/xenial/kamailio.default b/pkg/kamailio/deb/xenial/kamailio.default new file mode 100644 index 00000000000..8b20fc00358 --- /dev/null +++ b/pkg/kamailio/deb/xenial/kamailio.default @@ -0,0 +1,28 @@ +# +# Kamailio startup options +# + +# Set to yes to enable kamailio, once configured properly. +#RUN_KAMAILIO=yes + +# User to run as +#USER=kamailio + +# Group to run as +#GROUP=kamailio + +# Amount of shared and private memory to allocate +# for the running Kamailio server (in Mb) +#SHM_MEMORY=64 +#PKG_MEMORY=8 + +# Config file +#CFGFILE=/etc/kamailio/kamailio.cfg + +# Enable the server to leave a core file when it crashes. +# Set this to 'yes' to enable Kamailio to leave a core file when it crashes +# or 'no' to disable this feature. This option is case sensitive and only +# accepts 'yes' and 'no' and only in lowercase letters. +# On some systems it is necessary to specify a directory for the core files +# to get a dump. Look into the kamailio init file for an example configuration. +#DUMP_CORE=yes diff --git a/pkg/kamailio/deb/xenial/kamailio.examples b/pkg/kamailio/deb/xenial/kamailio.examples new file mode 100644 index 00000000000..e39721e20f0 --- /dev/null +++ b/pkg/kamailio/deb/xenial/kamailio.examples @@ -0,0 +1 @@ +examples/* diff --git a/pkg/kamailio/deb/xenial/kamailio.init b/pkg/kamailio/deb/xenial/kamailio.init new file mode 100644 index 00000000000..b14f83a7ff4 --- /dev/null +++ b/pkg/kamailio/deb/xenial/kamailio.init @@ -0,0 +1,163 @@ +#! /bin/sh +# +### BEGIN INIT INFO +# Provides: kamailio +# Required-Start: $syslog $network $local_fs $remote_fs $time +# Should-Start: $named slapd mysql postgresql snmpd radiusd +# Should-Stop: $named slapd mysql postgresql snmpd radiusd +# Required-Stop: $syslog $network $local_fs $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start the Kamailio SIP proxy server +# Description: Start the Kamailio SIP proxy server +### END INIT INFO + +. /lib/lsb/init-functions + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/kamailio +NAME=`basename "$0"` +DESC="Kamailio SIP Server" +HOMEDIR=/var/run/$NAME +PIDFILE=$HOMEDIR/$NAME.pid +DEFAULTS=/etc/default/$NAME +CFGFILE=/etc/$NAME/kamailio.cfg +RUN_KAMAILIO=no +USER=kamailio +GROUP=kamailio +# Amount of shared and private memory to allocate +# for the running Kamailio server (in Mb) +SHM_MEMORY=64 +PKG_MEMORY=8 +DUMP_CORE=no + +# Do not start kamailio if fork=no is set in the config file +# otherwise the boot process will just stop +check_fork () +{ + if grep -q "^[[:space:]]*fork[[:space:]]*=[[:space:]]*no.*" $CFGFILE; then + log_failure_msg "Not starting $DESC: fork=no specified in config file; run /etc/init.d/kamailio debug instead" + exit 0 + fi +} + +check_kamailio_config () +{ + # Check if kamailio configuration is valid before starting the server + set +e + out=$($DAEMON -f $CFGFILE -M $PKG_MEMORY -c 2>&1 > /dev/null) + retcode=$? + set -e + if [ "$retcode" != '0' ]; then + log_failure_msg "Not starting $DESC: invalid configuration file!" + log_failure_msg + log_failure_msg "$out" + log_failure_msg + exit 1 + fi +} + +create_radius_seqfile () +{ + # Create a radius sequence file to be used by the radius client if + # radius accounting is enabled. This is needed to avoid any issue + # with the file not being writable if kamailio first starts as user + # root because DUMP_CORE is enabled and creates this file as user + # root and then later it switches back to user kamailio and cannot + # write to the file. If the file exists before kamailio starts, it + # won't change it's ownership and will be writable for both root + # and kamailio, no matter what options are chosen at install time + RADIUS_SEQ_FILE="$HOMEDIR/kamailio_radius.seq" + if [ -d $HOMEDIR ]; then + chown ${USER}:${GROUP} $HOMEDIR + + if [ ! -f $RADIUS_SEQ_FILE ]; then + touch $RADIUS_SEQ_FILE + fi + + chown ${USER}:${GROUP} $RADIUS_SEQ_FILE + chmod 660 $RADIUS_SEQ_FILE + fi +} + +test -f $DAEMON || exit 0 + +# Load startup options if available +if [ -f $DEFAULTS ]; then + . $DEFAULTS || true +fi + +if [ "$RUN_KAMAILIO" != "yes" ]; then + log_failure_msg "Kamailio not yet configured. Edit /etc/default/$NAME first." + exit 0 +fi + +set -e + +SHM_MEMORY=$((`echo $SHM_MEMORY | sed -e 's/[^0-9]//g'`)) +PKG_MEMORY=$((`echo $PKG_MEMORY | sed -e 's/[^0-9]//g'`)) +[ -z "$USER" ] && USER=kamailio +[ -z "$GROUP" ] && GROUP=kamailio +[ $SHM_MEMORY -le 0 ] && SHM_MEMORY=64 +[ $PKG_MEMORY -le 0 ] && PKG_MEMORY=4 + +if test "$DUMP_CORE" = "yes" ; then + # set proper ulimit + ulimit -c unlimited + + # directory for the core dump files + # COREDIR=/home/corefiles + # [ -d $COREDIR ] || mkdir $COREDIR + # chmod 777 $COREDIR + # echo "$COREDIR/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern +fi + +# /var/run can be a tmpfs +if [ ! -d $HOMEDIR ]; then + mkdir -p $HOMEDIR + chown ${USER}:${GROUP} $HOMEDIR +fi + +OPTIONS="-f $CFGFILE -P $PIDFILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP" + +case "$1" in + start|debug) + check_kamailio_config + create_radius_seqfile + + if [ "$1" != "debug" ]; then + check_fork + fi + + log_daemon_msg "Starting $DESC: $NAME" + start-stop-daemon --start --quiet --pidfile $PIDFILE \ + --exec $DAEMON -- $OPTIONS || log_failure_msg " already running" + log_end_msg 0 + ;; + stop) + log_daemon_msg "Stopping $DESC: $NAME" + start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \ + --exec $DAEMON + log_end_msg 0 + ;; + restart|force-reload) + check_kamailio_config + create_radius_seqfile + + $0 stop + sleep 1 + $0 start + ;; + status) + log_daemon_msg "Status of $DESC: " + + status_of_proc -p"$PIDFILE" $NAME $NAME + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|force-reload|status|debug}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/pkg/kamailio/deb/xenial/kamailio.lintian-overrides b/pkg/kamailio/deb/xenial/kamailio.lintian-overrides new file mode 100644 index 00000000000..18152ed1759 --- /dev/null +++ b/pkg/kamailio/deb/xenial/kamailio.lintian-overrides @@ -0,0 +1,2 @@ +kamailio binary: example-interpreter-not-absolute usr/share/doc/kamailio/examples/outbound/edge.cfg #!KAMAILIO +kamailio binary: example-interpreter-not-absolute usr/share/doc/kamailio/examples/outbound/registrar.cfg #!KAMAILIO diff --git a/pkg/kamailio/deb/xenial/kamailio.postinst b/pkg/kamailio/deb/xenial/kamailio.postinst new file mode 100644 index 00000000000..4ee38ecb13c --- /dev/null +++ b/pkg/kamailio/deb/xenial/kamailio.postinst @@ -0,0 +1,24 @@ +#! /bin/sh + +set -e + +case "$1" in + configure) + adduser --quiet --system --group --disabled-password \ + --shell /bin/false --gecos "Kamailio SIP Server" \ + --home /var/run/kamailio kamailio || true + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + diff --git a/pkg/kamailio/deb/xenial/kamailio.service b/pkg/kamailio/deb/xenial/kamailio.service new file mode 100644 index 00000000000..06c3334bd78 --- /dev/null +++ b/pkg/kamailio/deb/xenial/kamailio.service @@ -0,0 +1,21 @@ +[Unit] +Description=Kamailio (OpenSER) - the Open Source SIP Server +After=network.target + +[Service] +Type=forking +Environment='CFGFILE=/etc/kamailio/kamailio.cfg' +Environment='SHM_MEMORY=64' +Environment='PKG_MEMORY=8' +Environment='USER=kamailio' +Environment='GROUP=kamailio' +EnvironmentFile=-/etc/default/kamailio +EnvironmentFile=-/etc/default/kamailio.d/* +# PIDFile requires a full absolute path +PIDFile=/var/run/kamailio/kamailio.pid +# ExecStart requires a full absolute path +ExecStart=/usr/sbin/kamailio -P /var/run/kamailio/kamailio.pid -f $CFGFILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP +Restart=on-abort + +[Install] +WantedBy=multi-user.target diff --git a/pkg/kamailio/deb/xenial/rules b/pkg/kamailio/deb/xenial/rules new file mode 100755 index 00000000000..6cb058b5e8f --- /dev/null +++ b/pkg/kamailio/deb/xenial/rules @@ -0,0 +1,229 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +DEBVERSION:=$(shell head -n 1 debian/changelog \ + | sed -e 's/^[^(]*(\([^)]*\)).*/\1/') +UPVERSION:=$(shell dpkg-parsechangelog | sed -ne 's/^Version: \(\([0-9]\+\):\)\?\(.*\)-.*/\3/p') + +FILENAME := kamailio_$(UPVERSION).orig.tar.gz +URL := http://www.kamailio.org/pub/kamailio/$(UPVERSION)/src/kamailio-$(UPVERSION)_src.tar.gz + +DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) + +export DEB_BUILD_MAINT_OPTIONS = hardening=+all +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +export JAVA_HOME=/usr/lib/jvm/java-gcj +export RADCLI=1 + +# modules not in the "main" kamailio package +EXCLUDED_MODULES= + +# extra modules to skip, because they are not compilable now +# - regardless if they go to the main kamailio package or to some module package, +# they will be excluded from compile and install of all +EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy + +# module groups that are packaged in seperate packages +# (with the name kamailio-$(group_name)-modules) +# Note: the order is important (should be in dependency order, the one +# on which other depend first) +PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \ + ldap xml perl utils lua memcached \ + snmpstats carrierroute xmpp cpl redis python geoip\ + sqlite json mono ims sctp java \ + purple tls outbound websocket autheph dnssec kazoo cnxcc \ + erlang + +# module groups to be packaged onto kamailio-extra-modules +EXTRA_GROUPS=gzcompress uuid ev jansson + +# name of libdir in the path for libraries (e.g., lib for 32b, lib64 for 64b) +LIBDIR ?= lib/$(DEB_HOST_MULTIARCH) + +# directories with possible duplicate libraries (that should be deleted +# from current module* packages) +DUP_LIBS_DIRS=$(CURDIR)/debian/kamailio/usr/$(LIBDIR)/kamailio \ + $(CURDIR)/debian/kamailio-db-modules/usr/$(LIBDIR)/kamailio + +# "function" to get package short name out of a dir/module_name +# it also transforms db_foo into foo +mod_name=$(subst db_,,$(lastword $(subst /, ,$(1)))) + +define PACKAGE_GRP_BUILD_template + # package all the modules in PACKAGE_GROUPS in separate packages + $(foreach grp,$(PACKAGE_GROUPS),\ + $(MAKE) every-module group_include="k$(grp)" + ) +endef + +define PACKAGE_GRP_INSTALL_template + $(foreach grp,$(PACKAGE_GROUPS),\ + $(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \ + BASEDIR=$(CURDIR)/debian/kamailio-$(grp)-modules \ + cfg_prefix=$(CURDIR)/debian/kamailio-$(grp)-modules \ + doc-dir=share/doc/kamailio-$(grp)-modules + # eliminate duplicate libs + -for d in $(DUP_LIBS_DIRS); do \ + test "$$d" != "$(CURDIR)/debian/kamailio-$(grp)-modules/usr/$(LIBDIR)/kamailio" &&\ + for r in `find $$d -name 'lib*'|xargs`; do \ + echo "removing $(grp) lib `basename $$r` present also in $$d";\ + rm -f $(CURDIR)/debian/kamailio-$(grp)-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \ + done ; \ + done + find $(CURDIR)/debian/kamailio-$(grp)-modules -depth -empty -type d -exec rmdir {} \; + ) +endef + +define PACKAGE_EXTRA_BUILD_template + # package all the modules in EXTRA_GROUPS in separate packages + $(foreach grp,$(EXTRA_GROUPS),\ + $(MAKE) every-module group_include="k$(grp)" + ) +endef + +define PACKAGE_EXTRA_INSTALL_template + $(foreach grp,$(EXTRA_GROUPS),\ + $(MAKE) install-modules-all LIBDIR=$(LIBDIR) group_include="k$(grp)" \ + BASEDIR=$(CURDIR)/debian/kamailio-extra-modules \ + cfg_prefix=$(CURDIR)/debian/kamailio-extra-modules \ + doc-dir=share/doc/kamailio-extra-modules + ) + # eliminate duplicate libs + -for d in $(DUP_LIBS_DIRS); do \ + test "$$d" != "$(CURDIR)/debian/kamailio-extra-modules/usr/$(LIBDIR)/kamailio" &&\ + for r in `find $$d -name 'lib*'|xargs`; do \ + echo "removing extra lib `basename $$r` present also in $$d";\ + rm -f $(CURDIR)/debian/kamailio-extra-modules/usr/$(LIBDIR)/kamailio/`basename "$$r"` ; \ + done ; \ + done + find $(CURDIR)/debian/kamailio-extra-modules -depth -empty -type d -exec rmdir {} \; +endef + +# CFLAGS + CPPFLAGS -> CC_EXTRA_OPTS +CC_EXTRA_OPTS := $(shell dpkg-buildflags --get CPPFLAGS) +CC_EXTRA_OPTS += $(shell dpkg-buildflags --get CFLAGS) +CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) +# LDFLAGS -> LD_EXTRA_OPTS +LD_EXTRA_OPTS := $(shell dpkg-buildflags --get LDFLAGS) + +# https://wiki.debian.org/ReproducibleBuilds/ +CC_EXTRA_OPTS += -DVERSION_NODATE + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + $(MAKE) FLAVOUR=kamailio cfg prefix=/usr cfg_prefix=$(CURDIR)/debian/kamailio \ + cfg_target=/etc/kamailio/ \ + BASEDIR=$(CURDIR)/debian/kamailio \ + skip_modules="$(EXCLUDED_MODULES) $(EXTRA_EXCLUDED_MODULES)" \ + CC_EXTRA_OPTS="$(CC_EXTRA_OPTS)" \ + LD_EXTRA_OPTS="$(LD_EXTRA_OPTS)" \ + group_include="kstandard" + + touch configure-stamp + + +build: build-stamp +build-arch: build-stamp +build-indep: build-stamp +build-stamp: configure-stamp + dh_testdir + # Add here commands to compile the package. + $(MAKE) all + # make groups + $(call PACKAGE_GRP_BUILD_template) + $(call PACKAGE_EXTRA_BUILD_template) + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + # Add here commands to clean up after the build process. + $(MAKE) maintainer-clean + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + # Add here commands to install the package into debian/kamailio + $(MAKE) install LIBDIR=$(LIBDIR) group_include="kstandard" + # make group packages + $(call PACKAGE_GRP_INSTALL_template) + $(call PACKAGE_EXTRA_INSTALL_template) + mv $(CURDIR)/debian/kamailio-berkeley-modules/usr/sbin/kambdb_recover \ + $(CURDIR)/debian/kamailio-berkeley-bin/usr/sbin/kambdb_recover + # install /etc/default/kamailio file + mkdir -p $(CURDIR)/debian/kamailio/etc/default + cp -f debian/kamailio.default $(CURDIR)/debian/kamailio/etc/default/kamailio + # delete /var/run/kamailio dir + rm -rf $(CURDIR)/debian/kamailio/usr/local + + +# This single target is used to build all the packages, all at once, or +# one at a time. So keep in mind: any options passed to commands here will +# affect _all_ packages. Anything you want to only affect one package +# should be put in another target, such as the install target. +binary-common: + dh_testdir + dh_testroot + dh_installdebconf + dh_installdocs + dh_installexamples -Xobsoleted -Xsr + dh_installmenu + dh_systemd_enable -pkamailio + dh_installinit -pkamailio -- defaults 23 + dh_systemd_start -pkamailio + dh_installcron + dh_installman + dh_installinfo + dh_lintian + dh_installchangelogs ChangeLog + dh_link + dh_strip --dbg-package=kamailio-dbg + dh_compress + dh_fixperms + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture-independent packages using the common target +binary-indep: build install +# (Uncomment this next line if you have such packages.) +# $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common +# We have nothing to do by default. + + +# Build architecture-dependent packages using the common target +binary-arch: build install + $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common + +# Any other binary targets build just one binary package at a time. +binary-%: build install + $(MAKE) -f debian/rules binary-common DH_OPTIONS=-p$* + +print-version: + @@echo "Debian version: $(DEBVERSION)" + @@echo "Upstream version: $(UPVERSION)" + +get-orig-source: + @@dh_testdir + @@[ -d ../tarballs/. ]||mkdir -p ../tarballs + @@echo Downloading $(FILENAME) from $(URL) ... + @@wget -nv -T10 -t3 -O ../tarballs/$(FILENAME) $(URL) + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure + diff --git a/pkg/kamailio/deb/xenial/source.lintian-overrides b/pkg/kamailio/deb/xenial/source.lintian-overrides new file mode 100644 index 00000000000..620d9ffdd2c --- /dev/null +++ b/pkg/kamailio/deb/xenial/source.lintian-overrides @@ -0,0 +1 @@ +kamailio source: debian-watch-file-in-native-package diff --git a/pkg/kamailio/deb/xenial/source/format b/pkg/kamailio/deb/xenial/source/format new file mode 100644 index 00000000000..89ae9db8f88 --- /dev/null +++ b/pkg/kamailio/deb/xenial/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/pkg/kamailio/deb/xenial/watch b/pkg/kamailio/deb/xenial/watch new file mode 100644 index 00000000000..c50f31fd670 --- /dev/null +++ b/pkg/kamailio/deb/xenial/watch @@ -0,0 +1,3 @@ +version=3 +opts=dversionmangle=s/\~svn([\d]+)//; \ +http://www.kamailio.org/pub/kamailio/([\d.]+)/src/kamailio-([\d.]+)_src\.tar\.gz diff --git a/pkg/kamailio/fedora/17/kamailio.spec b/pkg/kamailio/fedora/17/kamailio.spec index 2ceb8eacc82..91a417a7e74 100644 --- a/pkg/kamailio/fedora/17/kamailio.spec +++ b/pkg/kamailio/fedora/17/kamailio.spec @@ -1,6 +1,6 @@ %define name kamailio -%define ver 4.1.0 -%define rel dev7.2%{dist} +%define ver 4.4.4 +%define rel 0%{dist} diff --git a/pkg/kamailio/freebsd/Makefile b/pkg/kamailio/freebsd/Makefile index dee636094d5..a22ab3bb76f 100644 --- a/pkg/kamailio/freebsd/Makefile +++ b/pkg/kamailio/freebsd/Makefile @@ -6,7 +6,7 @@ # PORTNAME= kamailio -PORTVERSION= 1.3.0 +PORTVERSION= 4.4.2 CATEGORIES= net MASTER_SITES= http://kamailio.org/pub/kamailio/${PORTVERSION}/src/ DISTNAME= ${PORTNAME}-${PORTVERSION}-tls_src diff --git a/pkg/kamailio/netbsd/Makefile b/pkg/kamailio/netbsd/Makefile index a5c62b06cf4..2d3b92ffcde 100644 --- a/pkg/kamailio/netbsd/Makefile +++ b/pkg/kamailio/netbsd/Makefile @@ -8,9 +8,9 @@ COMMENT= "Kamailio" PORTNAME= kamailio -PORTVERSION= 1.2.0-notls +PORTVERSION= 4.2.4 CATEGORIES= net -MASTER_SITES= http://kamailio.org/pub/kamailio/1.2.0/src/ +MASTER_SITES= http://kamailio.org/pub/kamailio/4.4.2/src/ MAINTAINER= miconda@gmail.com diff --git a/pkg/kamailio/openbsd/Makefile b/pkg/kamailio/openbsd/Makefile index cf481de8b97..727fb3d34f6 100644 --- a/pkg/kamailio/openbsd/Makefile +++ b/pkg/kamailio/openbsd/Makefile @@ -12,7 +12,7 @@ COMMENT-carrierroute = kamailio carrierroute module COMMENT-snmpstats = kamailio snmpstats module COMMENT-perl = kamailio perl modules -VERSION = 1.5.0 +VERSION = 4.4.2 DISTNAME = kamailio-${VERSION} PKGNAME-main = kamailio-${VERSION} PKGNAME-mysql = kamailio-mysql-${VERSION} diff --git a/pkg/kamailio/oracle/el6/kamailio.default b/pkg/kamailio/oracle/el6/kamailio.default new file mode 100644 index 00000000000..907028924da --- /dev/null +++ b/pkg/kamailio/oracle/el6/kamailio.default @@ -0,0 +1,30 @@ +# +# Kamailio startup options +# + +# Set to yes to enable kamailio, once configured properly. +RUN_KAMAILIO=yes + +# User to run as +USER=kamailio + +# Group to run as +GROUP=kamailio + +# Amount of shared memory to allocate for the running Kamailio server (in Mb) +SHM_MEMORY=64 + +# Amount of private memory to allocate for the running Kamailio server (in Mb) +PKG_MEMORY=8 + +# Enable the server to leave a core file when it crashes. +# Set this to 'yes' to enable kamailio to leave a core file when it crashes +# or 'no' to disable this feature. This option is case sensitive and only +# accepts 'yes' and 'no' and only in lowercase letters. +# On some systems (e.g. Ubuntu 6.10, Debian 4.0) it is necessary to specify +# a directory for the core files to get a dump. Look into the kamailio +# init file for an example configuration. +DUMP_CORE=no + +# Add extra command line parameters in the EXTRA_OPTIONS variable +# EXTRA_OPTIONS="-a no" diff --git a/pkg/kamailio/oracle/el6/kamailio.init b/pkg/kamailio/oracle/el6/kamailio.init new file mode 100644 index 00000000000..4f8192590d4 --- /dev/null +++ b/pkg/kamailio/oracle/el6/kamailio.init @@ -0,0 +1,128 @@ +#!/bin/bash +# +# Startup script for Kamailio +# +# chkconfig: 345 85 15 +# description: Kamailio is a fast SIP Server. +# +# processname: kamailio +# pidfile: /var/run/kamailio.pid +# config: /etc/kamailio/kamailio.cfg + +# Source function library. +. /etc/rc.d/init.d/functions + +KAM=/usr/sbin/kamailio +KAMCFG=/etc/kamailio/kamailio.cfg +PROG=kamailio +PID_FILE=/var/run/kamailio.pid +LOCK_FILE=/var/lock/subsys/kamailio +RETVAL=0 +DEFAULTS=/etc/default/kamailio +RUN_KAMAILIO=no + + +# Do not start kamailio if fork=no is set in the config file +# otherwise the boot process will just stop +check_fork () +{ + if grep -q "^[[:space:]]*fork[[:space:]]*=[[:space:]]*no.*" $KAMCFG; then + echo "Not starting $DESC: fork=no specified in config file; run /etc/init.d/kamailio debug instead" + exit 1 + fi +} + +check_kamailio_config () +{ + # Check if kamailio configuration is valid before starting the server + out=$($KAM -M $PKG_MEMORY -c 2>&1 > /dev/null) + retcode=$? + if [ "$retcode" != '0' ]; then + echo "Not starting $DESC: invalid configuration file!" + echo -e "\n$out\n" + exit 1 + fi +} + + +start() { + check_kamailio_config + if [ "$1" != "debug" ]; then + check_fork + fi + echo -n $"Starting $PROG: " + daemon $KAM $OPTIONS >/dev/null 2>/dev/null + RETVAL=$? + echo + [ $RETVAL = 0 ] && touch $LOCK_FILE && success + return $RETVAL +} + +stop() { + echo -n $"Stopping $PROG: " + killproc $KAM + RETVAL=$? + echo + [ $RETVAL = 0 ] && rm -f $LOCK_FILE $PID_FILE +} + +# Load startup options if available +if [ -f $DEFAULTS ]; then + . $DEFAULTS || true +fi + +if [ "$RUN_KAMAILIO" != "yes" ]; then + echo "Kamailio not yet configured. Edit /etc/default/kamailio first." + exit 0 +fi + + +SHM_MEMORY=$((`echo $SHM_MEMORY | sed -e 's/[^0-9]//g'`)) +PKG_MEMORY=$((`echo $PKG_MEMORY | sed -e 's/[^0-9]//g'`)) +[ -z "$USER" ] && USER=kamailio +[ -z "$GROUP" ] && GROUP=kamailio +[ $SHM_MEMORY -le 0 ] && SHM_MEMORY=64 +[ $PKG_MEMORY -le 0 ] && PKG_MEMORY=8 + +if test "$DUMP_CORE" = "yes" ; then + # set proper ulimit + ulimit -c unlimited + + # directory for the core dump files + # COREDIR=/home/corefiles + # [ -d $COREDIR ] || mkdir $COREDIR + # chmod 777 $COREDIR + # echo "$COREDIR/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern +fi + +OPTIONS="-P $PID_FILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP $EXTRA_OPTIONS" + + +# See how we were called. +case "$1" in + start|debug) + start + ;; + stop) + stop + ;; + status) + status $KAM + RETVAL=$? + ;; + restart) + stop + start + ;; + condrestart) + if [ -f $PID_FILE ] ; then + stop + start + fi + ;; + *) + echo $"Usage: $PROG {start|stop|restart|condrestart|status|debug|help}" + exit 1 +esac + +exit $RETVAL diff --git a/pkg/kamailio/oracle/el6/kamailio.spec b/pkg/kamailio/oracle/el6/kamailio.spec new file mode 100644 index 00000000000..399f8555617 --- /dev/null +++ b/pkg/kamailio/oracle/el6/kamailio.spec @@ -0,0 +1,855 @@ +%define name kamailio +%define ver 4.4.4 +%define rel 0 +%define _sharedir %{_prefix}/share + +%define MYSQL_MODULES mysql +%define POSTGRES_MODULES postgres +%define UNIXODBC_MODULES unixodbc +%define LDAP_MODULES ldap +%define XMLRPC_MODULES xml +%define PERL_MODULES perl +%define PYTHON_MODULES python +%define LUA_MODULES lua +%define UTILS_MODULES utils +%define PURPLE_MODULES purple +%define MEMCACHED_MODULES memcached +%define TLS_MODULES tls +%define XMPP_MODULES xmpp +%define CPL_MODULES cpl +%define SNMPSTATS_MODULES snmpstats +%define CARRIERROUTE_MODULES carrierroute +%define PRESENCE_MODULES presence +%define RADIUS_MODULES radius +%define GEOIP_MODULES geoip + +Summary: Kamailio, very fast and flexible SIP Server +Name: %name +Version: %ver +Release: %rel +Packager: Ovidiu Sas +License: GPL +Group: System Environment/Daemons +Source0: http://kamailio.org/pub/kamailio/%{ver}/%{name}-%{ver}_src.tar.gz +Source1: kamailio.init +Source2: kamailio.default +URL: http://kamailio.org/ +Vendor: kamailio.org +BuildRoot: %{_tmppath}/%{name}-%{ver}-buildroot +Conflicts: kamailio-mysql < %ver, kamailio-postgres < %ver, kamailio-unixodbc < %ver, kamailio-ldap < %ver, kamailio-xmlrpc < %ver, kamailio-perl < %ver, kamailio-python < %ver, kamailio-lua < %ver, kamailio-utils < %ver, kamailio-purple < %ver, kamailio-memcached < %ver, kamailio-tls < %ver, kamailio-xmpp < %ver, kamailio-cpl < %ver, kamailio-snmpstats < %ver, kamailio-carrierroute < %ver, kamailio-presence < %ver, kamailio-radius < %ver, kamailio-geoip < %ver +Requires: shadow-utils +BuildRequires: make flex bison pcre-devel + +%description +Kamailio is a very fast and flexible SIP (RFC3261) +proxy server. Written entirely in C, kamailio can handle thousands calls +per second even on low-budget hardware. A C Shell like scripting language +provides full control over the server's behaviour. It's modular +architecture allows only required functionality to be loaded. +Currently the following modules are available: digest authentication, +CPL scripts, instant messaging, MySQL and UNIXODBC support, a presence agent, +radius authentication, record routing, an SMS gateway, a +transaction and dialog module, OSP module, statistics support, +registrar and user location, SNMP, SIMPLE Presence and Perl programming +interface. + +%package mysql +Summary: MySQL connectivity for the Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: mysql-devel zlib-devel + +%description mysql +The kamailio-mysql package contains MySQL database connectivity that you +need to use digest authentication module or persistent user location +entries. + + +%package postgres +Summary: MPOSTGRES connectivity for the Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: postgresql-devel + +%description postgres +The kamailio-postgres package contains Postgres database connectivity that you +need to use digest authentication module or persistent user location +entries. + + +%package unixodbc +Summary: UNIXODBC connectivity for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: unixODBC-devel + +%description unixodbc +The kamailio-unixodbc package contains UNIXODBC database connectivity support +that is required by other modules with database dependencies. + + +%package utils +Summary: Utils for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver + +%description utils +The kamailio-utils package provides a set utility functions for Kamailio + + +%package cpl +Summary: CPL module (CPL interpreter engine) for Kamailio +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: libxml2-devel + +%description cpl +The kamailio-cpl package provides a CPL interpreter engine for Kamailio + + +%package radius +Summary: Kamailio radius support for AAA API. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: radiusclient-ng-devel + +%description radius +The kamailio-radius package contains modules for radius authentication, group +membership and uri checking. + + +%package snmpstats +Summary: SNMP AgentX subagent module for Kamailio +Group: System Environment/Daemons +Requires: kamailio = %ver, net-snmp-utils +BuildRequires: lm_sensors-devel net-snmp-devel + +%description snmpstats +The kamailio-snmpstats package snmpstats module for Kamailio. This module acts +as an AgentX subagent which connects to a master agent. + + +%package presence +Summary: sip presence user agent support for Kamailio +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: libxml2-devel, curl-devel + +%description presence +The kamailio-presence package contains a sip Presence Agent. + + +%package xmpp +Summary: SIP2XMPP message translation support for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: expat-devel + +%description xmpp +The kamailio-xmpp package contains a SIP to XMPP message translator. + + +%package tls +Summary: TLS transport protocol for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: openssl-devel + +%description tls +The kamailio-tls package contains the SIP TLSt transport mechanism for Kamailio. + + +%package carrierroute +Summary: Routing module for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: libconfuse-devel + +%description carrierroute +The kamailio-carrierroute package contains a fast routing engine. + + +%package purple +Summary: Provides the purple module, a multi-protocol IM gateway. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: libpurple-devel + +%description purple +The kamailio-purple package provides the purple module, a multi-protocol instant +messaging gateway module. + + +%package ldap +Summary: LDAP modules for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: openldap-devel + +%description ldap +The kamailio-ldap package provides the ldap and h350 modules for Kamailio, +enabling LDAP queries from the Kamailio config and storage of SIP account +data in an LDAP directory. + + +#%package memcached +#Summary: Distributed hash table for Kamailio. +#Group: System Environment/Daemons +#Requires: kamailio = %ver +#BuildRequires: libmemcached-devel +# +#%description memcached +#The kamailio-memcached package provides access to a distributed hash table memcached. + + +#%package xmlrpc +#Summary: XMLRPC support for Kamailio's Management Interface. +#Group: System Environment/Daemons +#Requires: kamailio = %ver +#BuildRequires: libxml2-devel xmlrpc-c-devel +# +#%description xmlrpc +#The kamailio-xmlrpc package provides the XMLRPC transport implementations for Kamailio's +#Management and Control Interface. + + +%package perl +Summary: Perl extensions and database driver for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: mod_perl-devel + +%description perl +The kamailio-perl package provides an interface for Kamailio to write Perl extensions and +the perlvdb database driver for Kamailio. + + +%package lua +Summary: Lua extensions for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: lua-devel + +%description lua +The kamailio-lua package provides an interface for Kamailio to write Python extensions + + +%package python +Summary: Python extensions for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: python-devel + +%description python +The kamailio-python package provides an interface for Kamailio to write Python extensions + + +%package geoip +Summary: GeoIP extensions for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: geoip-devel + +%description geoip +The kamailio-geoip package provides a GeoIP interface for Kamailio + + + + +%prep +%setup -n %{name}-%{ver} + +%build +make FLAVOUR=kamailio cfg prefix=/usr cfg_prefix=$RPM_BUILD_ROOT basedir=$RPM_BUILD_ROOT cfg_target=/%{_sysconfdir}/kamailio/ modules_dirs="modules" +make +make every-module skip_modules="iptrtpproxy" group_include="kstandard" +make every-module group_include="k%MYSQL_MODULES" +make every-module group_include="k%POSTGRES_MODULES" +make every-module group_include="k%UNIXODBC_MODULES" +make every-module group_include="k%UTILS_MODULES" +make every-module group_include="k%CPL_MODULES" +make every-module group_include="k%RADIUS_MODULES" +make every-module group_include="k%SNMPSTATS_MODULES" +make every-module group_include="k%PRESENCE_MODULES" +make every-module group_include="k%XMPP_MODULES" +make every-module group_include="k%TLS_MODULES" +make every-module group_include="k%CARRIERROUTE_MODULES" +make every-module group_include="k%PURPLE_MODULES" +make every-module group_include="k%LDAP_MODULES" +#make every-module group_include="k%MEMCACHED_MODULES" +#make every-module group_include="k%XMLRPC_MODULES" +make every-module group_include="k%PERL_MODULES" +make every-module group_include="k%LUA_MODULES" +make every-module group_include="k%PYTHON_MODULES" +make every-module group_include="k%GEOIP_MODULES" + +%install +[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT" + +make install +make install-modules-all skip_modules="iptrtpproxy" group_include="kstandard" +make install-modules-all group_include="k%MYSQL_MODULES" +make install-modules-all group_include="k%POSTGRES_MODULES" +make install-modules-all group_include="k%UNIXODBC_MODULES" +make install-modules-all group_include="k%UTILS_MODULES" +make install-modules-all group_include="k%CPL_MODULES" +make install-modules-all group_include="k%SNMPSTATS_MODULES" +make install-modules-all group_include="k%RADIUS_MODULES" +make install-modules-all group_include="k%PRESENCE_MODULES" +make install-modules-all group_include="k%XMPP_MODULES" +make install-modules-all group_include="k%TLS_MODULES" +make install-modules-all group_include="k%CARRIERROUTE_MODULES" +make install-modules-all group_include="k%PURPLE_MODULES" +make install-modules-all group_include="k%LDAP_MODULES" +#make install-modules-all group_include="k%MEMCACHED_MODULES" +#make install-modules-all group_include="k%XMLRPC_MODULES" +make install-modules-all group_include="k%PERL_MODULES" +make install-modules-all group_include="k%LUA_MODULES" +make install-modules-all group_include="k%PYTHON_MODULES" +make install-modules-all group_include="k%GEOIP_MODULES" + + +mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d +install -m755 $RPM_SOURCE_DIR/kamailio.init \ + $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/kamailio + +mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/default +install -m755 $RPM_SOURCE_DIR/kamailio.default \ + $RPM_BUILD_ROOT/%{_sysconfdir}/default/kamailio + + +%pre +/usr/sbin/groupadd -r kamailio 2> /dev/null || : +/usr/sbin/useradd -r -g kamailio -s /bin/false -c "Kamailio daemon" -d \ + %{_libdir}/kamailio kamailio 2> /dev/null || : + + +%clean +rm -rf "$RPM_BUILD_ROOT" + +%post +/sbin/chkconfig --add kamailio + +%preun +if [ $1 = 0 ]; then + /sbin/service kamailio stop > /dev/null 2>&1 + /sbin/chkconfig --del kamailio +fi + + +%files +%defattr(-,root,root) +%dir %{_docdir}/kamailio +%doc %{_docdir}/kamailio/AUTHORS +%doc %{_docdir}/kamailio/NEWS +%doc %{_docdir}/kamailio/INSTALL +%doc %{_docdir}/kamailio/README +%doc %{_docdir}/kamailio/README-MODULES +%doc %{_docdir}/kamailio/modules/README.auth +%doc %{_docdir}/kamailio/modules/README.avpops +%doc %{_docdir}/kamailio/modules/README.blst +%doc %{_docdir}/kamailio/modules/README.cfg_db +%doc %{_docdir}/kamailio/modules/README.cfg_rpc +%doc %{_docdir}/kamailio/modules/README.counters +%doc %{_docdir}/kamailio/modules/README.ctl +%doc %{_docdir}/kamailio/modules/README.db_flatstore +%doc %{_docdir}/kamailio/modules/README.debugger +%doc %{_docdir}/kamailio/modules/README.dialplan +%doc %{_docdir}/kamailio/modules/README.enum +%doc %{_docdir}/kamailio/modules/README.lcr +%doc %{_docdir}/kamailio/modules/README.malloc_test +%doc %{_docdir}/kamailio/modules/README.matrix +%doc %{_docdir}/kamailio/modules/README.mediaproxy +%doc %{_docdir}/kamailio/modules/README.mi_rpc +%doc %{_docdir}/kamailio/modules/README.mqueue +%doc %{_docdir}/kamailio/modules/README.mtree +%doc %{_docdir}/kamailio/modules/README.pdb +%doc %{_docdir}/kamailio/modules/README.pipelimit +%doc %{_docdir}/kamailio/modules/README.prefix_route +#%doc %{_docdir}/kamailio/modules/README.privacy +%doc %{_docdir}/kamailio/modules/README.ratelimit +%doc %{_docdir}/kamailio/modules/README.sanity +%doc %{_docdir}/kamailio/modules/README.sl +%doc %{_docdir}/kamailio/modules/README.sms +%doc %{_docdir}/kamailio/modules/README.textopsx +%doc %{_docdir}/kamailio/modules/README.tm +%doc %{_docdir}/kamailio/modules/README.topoh +%doc %{_docdir}/kamailio/modules/README.xhttp +%doc %{_docdir}/kamailio/modules/README.acc +%doc %{_docdir}/kamailio/modules/README.alias_db +%doc %{_docdir}/kamailio/modules/README.auth_db +%doc %{_docdir}/kamailio/modules/README.auth_diameter +%doc %{_docdir}/kamailio/modules/README.benchmark +%doc %{_docdir}/kamailio/modules/README.call_control +%doc %{_docdir}/kamailio/modules/README.cfgutils +%doc %{_docdir}/kamailio/modules/README.db_text +%doc %{_docdir}/kamailio/modules/README.dialog +%doc %{_docdir}/kamailio/modules/README.dispatcher +%doc %{_docdir}/kamailio/modules/README.diversion +%doc %{_docdir}/kamailio/modules/README.domain +%doc %{_docdir}/kamailio/modules/README.domainpolicy +%doc %{_docdir}/kamailio/modules/README.drouting +%doc %{_docdir}/kamailio/modules/README.exec +%doc %{_docdir}/kamailio/modules/README.group +%doc %{_docdir}/kamailio/modules/README.htable +%doc %{_docdir}/kamailio/modules/README.imc +%doc %{_docdir}/kamailio/modules/README.kex +%doc %{_docdir}/kamailio/modules/README.maxfwd +%doc %{_docdir}/kamailio/modules/README.mi_datagram +%doc %{_docdir}/kamailio/modules/README.mi_fifo +%doc %{_docdir}/kamailio/modules/README.msilo +%doc %{_docdir}/kamailio/modules/README.nat_traversal +%doc %{_docdir}/kamailio/modules/README.nathelper +%doc %{_docdir}/kamailio/modules/README.path +%doc %{_docdir}/kamailio/modules/README.pdt +%doc %{_docdir}/kamailio/modules/README.permissions +%doc %{_docdir}/kamailio/modules/README.pike +%doc %{_docdir}/kamailio/modules/README.pua_mi +%doc %{_docdir}/kamailio/modules/README.pv +%doc %{_docdir}/kamailio/modules/README.qos +%doc %{_docdir}/kamailio/modules/README.regex +%doc %{_docdir}/kamailio/modules/README.registrar +%doc %{_docdir}/kamailio/modules/README.rr +%doc %{_docdir}/kamailio/modules/README.rtimer +%doc %{_docdir}/kamailio/modules/README.rtpproxy +%doc %{_docdir}/kamailio/modules/README.seas +%doc %{_docdir}/kamailio/modules/README.siptrace +%doc %{_docdir}/kamailio/modules/README.siputils +%doc %{_docdir}/kamailio/modules/README.speeddial +%doc %{_docdir}/kamailio/modules/README.sqlops +%doc %{_docdir}/kamailio/modules/README.sst +%doc %{_docdir}/kamailio/modules/README.statistics +%doc %{_docdir}/kamailio/modules/README.textops +%doc %{_docdir}/kamailio/modules/README.tmx +%doc %{_docdir}/kamailio/modules/README.uac +%doc %{_docdir}/kamailio/modules/README.uac_redirect +%doc %{_docdir}/kamailio/modules/README.uri_db +%doc %{_docdir}/kamailio/modules/README.userblacklist +%doc %{_docdir}/kamailio/modules/README.usrloc +%doc %{_docdir}/kamailio/modules/README.xlog + +%doc %{_docdir}/kamailio/modules/README.app_perl +%doc %{_docdir}/kamailio/modules/README.async +%doc %{_docdir}/kamailio/modules/README.auth_identity +%doc %{_docdir}/kamailio/modules/README.auth_xkeys +%doc %{_docdir}/kamailio/modules/README.avp +%doc %{_docdir}/kamailio/modules/README.cfgt +%doc %{_docdir}/kamailio/modules/README.corex +%doc %{_docdir}/kamailio/modules/README.crypto +%doc %{_docdir}/kamailio/modules/README.db2_ldap +%doc %{_docdir}/kamailio/modules/README.db2_ops +%doc %{_docdir}/kamailio/modules/README.db_cluster +%doc %{_docdir}/kamailio/modules/README.db_mysql +%doc %{_docdir}/kamailio/modules/README.db_perlvdb +%doc %{_docdir}/kamailio/modules/README.dmq +%doc %{_docdir}/kamailio/modules/README.dmq_usrloc +%doc %{_docdir}/kamailio/modules/README.http_client +%doc %{_docdir}/kamailio/modules/README.ipops +%doc %{_docdir}/kamailio/modules/README.jsonrpc-s +%doc %{_docdir}/kamailio/modules/README.log_custom +%doc %{_docdir}/kamailio/modules/README.mangler +%doc %{_docdir}/kamailio/modules/README.mohqueue +%doc %{_docdir}/kamailio/modules/README.msrp +%doc %{_docdir}/kamailio/modules/README.nosip +%doc %{_docdir}/kamailio/modules/README.p_usrloc +%doc %{_docdir}/kamailio/modules/README.presence_profile +%doc %{_docdir}/kamailio/modules/README.presence_reginfo +%doc %{_docdir}/kamailio/modules/README.print +%doc %{_docdir}/kamailio/modules/README.print_lib +%doc %{_docdir}/kamailio/modules/README.pua_reginfo +%doc %{_docdir}/kamailio/modules/README.rtjson +%doc %{_docdir}/kamailio/modules/README.rtpengine +%doc %{_docdir}/kamailio/modules/README.sca +%doc %{_docdir}/kamailio/modules/README.sdpops +%doc %{_docdir}/kamailio/modules/README.sipcapture +%doc %{_docdir}/kamailio/modules/README.sipt +%doc %{_docdir}/kamailio/modules/README.smsops +%doc %{_docdir}/kamailio/modules/README.statsc +%doc %{_docdir}/kamailio/modules/README.statsd +%doc %{_docdir}/kamailio/modules/README.stun +%doc %{_docdir}/kamailio/modules/README.tcpops +%doc %{_docdir}/kamailio/modules/README.timer +%doc %{_docdir}/kamailio/modules/README.tmrec +%doc %{_docdir}/kamailio/modules/README.topos +%doc %{_docdir}/kamailio/modules/README.tsilo +%doc %{_docdir}/kamailio/modules/README.uid_auth_db +%doc %{_docdir}/kamailio/modules/README.uid_avp_db +%doc %{_docdir}/kamailio/modules/README.uid_domain +%doc %{_docdir}/kamailio/modules/README.uid_gflags +%doc %{_docdir}/kamailio/modules/README.uid_uri_db +%doc %{_docdir}/kamailio/modules/README.xhttp_rpc +%doc %{_docdir}/kamailio/modules/README.xprint + +%{_datarootdir}/snmp/mibs/KAMAILIO-MIB +%{_datarootdir}/snmp/mibs/KAMAILIO-REG-MIB +%{_datarootdir}/snmp/mibs/KAMAILIO-SIP-COMMON-MIB +%{_datarootdir}/snmp/mibs/KAMAILIO-SIP-SERVER-MIB +%{_datarootdir}/snmp/mibs/KAMAILIO-TC + +%dir %{_sysconfdir}/kamailio +%config(noreplace) %{_sysconfdir}/kamailio/* +%config %{_sysconfdir}/rc.d/init.d/* +%config %{_sysconfdir}/default/* + +%dir %{_libdir}/kamailio +%{_libdir}/kamailio/libbinrpc.so +%{_libdir}/kamailio/libbinrpc.so.0 +%{_libdir}/kamailio/libbinrpc.so.0.1 +%{_libdir}/kamailio/libkcore.so +%{_libdir}/kamailio/libkcore.so.1 +%{_libdir}/kamailio/libkcore.so.1.0 +%{_libdir}/kamailio/libkmi.so +%{_libdir}/kamailio/libkmi.so.1 +%{_libdir}/kamailio/libkmi.so.1.0 +%{_libdir}/kamailio/libprint.so +%{_libdir}/kamailio/libprint.so.1 +%{_libdir}/kamailio/libprint.so.1.2 +%{_libdir}/kamailio/libsrdb1.so +%{_libdir}/kamailio/libsrdb1.so.1 +%{_libdir}/kamailio/libsrdb1.so.1.0 +%{_libdir}/kamailio/libsrdb2.so +%{_libdir}/kamailio/libsrdb2.so.1 +%{_libdir}/kamailio/libsrdb2.so.1.0 +%{_libdir}/kamailio/libsrutils.so +%{_libdir}/kamailio/libsrutils.so.1 +%{_libdir}/kamailio/libsrutils.so.1.0 +%{_libdir}/kamailio/libtrie.so +%{_libdir}/kamailio/libtrie.so.1 +%{_libdir}/kamailio/libtrie.so.1.0 + +%dir %{_libdir}/kamailio/modules +%{_libdir}/kamailio/modules/auth.so +%{_libdir}/kamailio/modules/avpops.so +%{_libdir}/kamailio/modules/blst.so +%{_libdir}/kamailio/modules/cfg_db.so +%{_libdir}/kamailio/modules/cfg_rpc.so +%{_libdir}/kamailio/modules/counters.so +%{_libdir}/kamailio/modules/ctl.so +%{_libdir}/kamailio/modules/db_flatstore.so +%{_libdir}/kamailio/modules/debugger.so +%{_libdir}/kamailio/modules/dialplan.so +%{_libdir}/kamailio/modules/enum.so +%{_libdir}/kamailio/modules/lcr.so +%{_libdir}/kamailio/modules/malloc_test.so +%{_libdir}/kamailio/modules/matrix.so +%{_libdir}/kamailio/modules/mediaproxy.so +%{_libdir}/kamailio/modules/mi_rpc.so +%{_libdir}/kamailio/modules/mqueue.so +%{_libdir}/kamailio/modules/mtree.so +%{_libdir}/kamailio/modules/pdb.so +%{_libdir}/kamailio/modules/pipelimit.so +%{_libdir}/kamailio/modules/prefix_route.so +#%{_libdir}/kamailio/modules/privacy.so +%{_libdir}/kamailio/modules/ratelimit.so +%{_libdir}/kamailio/modules/sanity.so +%{_libdir}/kamailio/modules/sl.so +%{_libdir}/kamailio/modules/sms.so +%{_libdir}/kamailio/modules/tm.so +%{_libdir}/kamailio/modules/textopsx.so +%{_libdir}/kamailio/modules/topoh.so +%{_libdir}/kamailio/modules/xhttp.so +%{_libdir}/kamailio/modules/acc.so +%{_libdir}/kamailio/modules/alias_db.so +%{_libdir}/kamailio/modules/auth_db.so +%{_libdir}/kamailio/modules/auth_diameter.so +%{_libdir}/kamailio/modules/benchmark.so +%{_libdir}/kamailio/modules/call_control.so +%{_libdir}/kamailio/modules/cfgutils.so +%{_libdir}/kamailio/modules/db_text.so +%{_libdir}/kamailio/modules/dialog.so +%{_libdir}/kamailio/modules/dispatcher.so +%{_libdir}/kamailio/modules/diversion.so +%{_libdir}/kamailio/modules/domain.so +%{_libdir}/kamailio/modules/domainpolicy.so +%{_libdir}/kamailio/modules/drouting.so +%{_libdir}/kamailio/modules/exec.so +%{_libdir}/kamailio/modules/group.so +%{_libdir}/kamailio/modules/htable.so +%{_libdir}/kamailio/modules/imc.so +%{_libdir}/kamailio/modules/kex.so +%{_libdir}/kamailio/modules/maxfwd.so +%{_libdir}/kamailio/modules/mi_datagram.so +%{_libdir}/kamailio/modules/mi_fifo.so +%{_libdir}/kamailio/modules/msilo.so +%{_libdir}/kamailio/modules/nat_traversal.so +%{_libdir}/kamailio/modules/nathelper.so +%{_libdir}/kamailio/modules/path.so +%{_libdir}/kamailio/modules/pdt.so +%{_libdir}/kamailio/modules/permissions.so +%{_libdir}/kamailio/modules/pike.so +%{_libdir}/kamailio/modules/pua_mi.so +%{_libdir}/kamailio/modules/pv.so +%{_libdir}/kamailio/modules/qos.so +%{_libdir}/kamailio/modules/regex.so +%{_libdir}/kamailio/modules/registrar.so +%{_libdir}/kamailio/modules/rr.so +%{_libdir}/kamailio/modules/rtimer.so +%{_libdir}/kamailio/modules/rtpproxy.so +%{_libdir}/kamailio/modules/seas.so +%{_libdir}/kamailio/modules/siptrace.so +%{_libdir}/kamailio/modules/siputils.so +%{_libdir}/kamailio/modules/speeddial.so +%{_libdir}/kamailio/modules/sqlops.so +%{_libdir}/kamailio/modules/sst.so +%{_libdir}/kamailio/modules/statistics.so +%{_libdir}/kamailio/modules/textops.so +%{_libdir}/kamailio/modules/tmx.so +%{_libdir}/kamailio/modules/uac.so +%{_libdir}/kamailio/modules/uac_redirect.so +%{_libdir}/kamailio/modules/uri_db.so +%{_libdir}/kamailio/modules/userblacklist.so +%{_libdir}/kamailio/modules/usrloc.so +%{_libdir}/kamailio/modules/xlog.so +%{_libdir}/kamailio/modules/async.so +%{_libdir}/kamailio/modules/auth_identity.so +%{_libdir}/kamailio/modules/auth_xkeys.so +%{_libdir}/kamailio/modules/avp.so +%{_libdir}/kamailio/modules/cfgt.so +%{_libdir}/kamailio/modules/corex.so +%{_libdir}/kamailio/modules/crypto.so +%{_libdir}/kamailio/modules/db2_ldap.so +%{_libdir}/kamailio/modules/db2_ops.so +%{_libdir}/kamailio/modules/db_cluster.so +%{_libdir}/kamailio/modules/dmq.so +%{_libdir}/kamailio/modules/dmq_usrloc.so +%{_libdir}/kamailio/modules/http_client.so +%{_libdir}/kamailio/modules/ipops.so +%{_libdir}/kamailio/modules/jsonrpc-s.so +%{_libdir}/kamailio/modules/log_custom.so +%{_libdir}/kamailio/modules/mangler.so +%{_libdir}/kamailio/modules/mohqueue.so +%{_libdir}/kamailio/modules/msrp.so +%{_libdir}/kamailio/modules/nosip.so +%{_libdir}/kamailio/modules/p_usrloc.so +%{_libdir}/kamailio/modules/presence_profile.so +%{_libdir}/kamailio/modules/presence_reginfo.so +%{_libdir}/kamailio/modules/print.so +%{_libdir}/kamailio/modules/print_lib.so +%{_libdir}/kamailio/modules/pua_reginfo.so +%{_libdir}/kamailio/modules/rtjson.so +%{_libdir}/kamailio/modules/rtpengine.so +%{_libdir}/kamailio/modules/sca.so +%{_libdir}/kamailio/modules/sdpops.so +%{_libdir}/kamailio/modules/sipcapture.so +%{_libdir}/kamailio/modules/sipt.so +%{_libdir}/kamailio/modules/smsops.so +%{_libdir}/kamailio/modules/statsc.so +%{_libdir}/kamailio/modules/statsd.so +%{_libdir}/kamailio/modules/stun.so +%{_libdir}/kamailio/modules/tcpops.so +%{_libdir}/kamailio/modules/timer.so +%{_libdir}/kamailio/modules/tmrec.so +%{_libdir}/kamailio/modules/topos.so +%{_libdir}/kamailio/modules/tsilo.so +%{_libdir}/kamailio/modules/uid_auth_db.so +%{_libdir}/kamailio/modules/uid_avp_db.so +%{_libdir}/kamailio/modules/uid_domain.so +%{_libdir}/kamailio/modules/uid_gflags.so +%{_libdir}/kamailio/modules/uid_uri_db.so +%{_libdir}/kamailio/modules/xhttp_rpc.so +%{_libdir}/kamailio/modules/xprint.so + + +%{_sbindir}/kamailio +%{_sbindir}/kamctl +%{_sbindir}/kamdbctl +%{_sbindir}/kamcmd +%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.py +%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.pyc +%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.pyo +%{_libdir}/kamailio/kamctl/kamctl.base +%{_libdir}/kamailio/kamctl/kamctl.ctlbase +%{_libdir}/kamailio/kamctl/kamctl.dbtext +%{_libdir}/kamailio/kamctl/kamctl.fifo +%{_libdir}/kamailio/kamctl/kamctl.ser +%{_libdir}/kamailio/kamctl/kamctl.ser_mi +%{_libdir}/kamailio/kamctl/kamctl.sqlbase +%{_libdir}/kamailio/kamctl/kamctl.unixsock +%{_libdir}/kamailio/kamctl/kamdbctl.base +%{_libdir}/kamailio/kamctl/kamdbctl.dbtext + +%{_mandir}/man5/* +%{_mandir}/man8/* + +%{_sharedir}/kamailio/dbtext/kamailio/* + + +%files mysql +%defattr(-,root,root) +%{_libdir}/kamailio/modules/db_mysql.so +%{_libdir}/kamailio/kamctl/kamctl.mysql +%{_libdir}/kamailio/kamctl/kamdbctl.mysql +%{_sharedir}/kamailio/mysql/* + + +%files postgres +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.db_postgres +%{_libdir}/kamailio/modules/db_postgres.so +%{_libdir}/kamailio/kamctl/kamctl.pgsql +%{_libdir}/kamailio/kamctl/kamdbctl.pgsql +%{_sharedir}/kamailio/postgres/* + + +%files unixodbc +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.db_unixodbc +%{_libdir}/kamailio/modules/db_unixodbc.so + + +%files utils +%defattr(-,root,root) +%{_docdir}/kamailio/modules/README.utils +%{_libdir}/kamailio/modules/utils.so + + +%files cpl +%defattr(-,root,root) +%{_docdir}/kamailio/modules/README.cpl-c +%{_libdir}/kamailio/modules/cpl-c.so + + +%files radius +%defattr(-,root,root) +%{_docdir}/kamailio/modules/README.acc_radius +%{_docdir}/kamailio/modules/README.auth_radius +%{_docdir}/kamailio/modules/README.misc_radius +%{_docdir}/kamailio/modules/README.peering +%{_libdir}/kamailio/modules/acc_radius.so +%{_libdir}/kamailio/modules/auth_radius.so +%{_libdir}/kamailio/modules/misc_radius.so +%{_libdir}/kamailio/modules/peering.so + + +%files snmpstats +%defattr(-,root,root) +%{_docdir}/kamailio/modules/README.snmpstats +%{_libdir}/kamailio/modules/snmpstats.so + + +%files presence +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.presence +%doc %{_docdir}/kamailio/modules/README.presence_conference +%doc %{_docdir}/kamailio/modules/README.presence_dialoginfo +%doc %{_docdir}/kamailio/modules/README.presence_mwi +%doc %{_docdir}/kamailio/modules/README.presence_xml +%doc %{_docdir}/kamailio/modules/README.pua +%doc %{_docdir}/kamailio/modules/README.pua_bla +%doc %{_docdir}/kamailio/modules/README.pua_dialoginfo +%doc %{_docdir}/kamailio/modules/README.pua_mi +%doc %{_docdir}/kamailio/modules/README.pua_usrloc +%doc %{_docdir}/kamailio/modules/README.pua_xmpp +%doc %{_docdir}/kamailio/modules/README.rls +%doc %{_docdir}/kamailio/modules/README.xcap_client +%doc %{_docdir}/kamailio/modules/README.xcap_server +%{_libdir}/kamailio/modules/presence.so +%{_libdir}/kamailio/modules/presence_conference.so +%{_libdir}/kamailio/modules/presence_dialoginfo.so +%{_libdir}/kamailio/modules/presence_mwi.so +%{_libdir}/kamailio/modules/presence_xml.so +%{_libdir}/kamailio/modules/pua.so +%{_libdir}/kamailio/modules/pua_bla.so +%{_libdir}/kamailio/modules/pua_dialoginfo.so +%{_libdir}/kamailio/modules/pua_mi.so +%{_libdir}/kamailio/modules/pua_usrloc.so +%{_libdir}/kamailio/modules/pua_xmpp.so +%{_libdir}/kamailio/modules/rls.so +%{_libdir}/kamailio/modules/xcap_client.so +%{_libdir}/kamailio/modules/xcap_server.so + + +%files xmpp +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.xmpp +%{_libdir}/kamailio/modules/xmpp.so + + +%files tls +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.tls +%{_libdir}/kamailio/modules/tls.so + + +%files carrierroute +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.carrierroute +%{_libdir}/kamailio/modules/carrierroute.so + + +%files purple +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.purple +%{_libdir}/kamailio/modules/purple.so + + +%files ldap +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.h350 +%doc %{_docdir}/kamailio/modules/README.ldap +%{_libdir}/kamailio/modules/h350.so +%{_libdir}/kamailio/modules/ldap.so + + +#%files memcached +#%defattr(-,root,root) +#%doc %{_docdir}/kamailio/modules/README.memcached +#%{_libdir}/kamailio/modules/memcached.so + + +#%files xmlrpc +#%defattr(-,root,root) +#%doc %{_docdir}/kamailio/modules/README.memcached +#%{_libdir}/kamailio/modules/memcached.so + + +%files perl +%defattr(-,root,root) +%{_libdir}/kamailio/modules/app_perl.so +%{_libdir}/kamailio/modules/db_perlvdb.so +%{_libdir}/kamailio/perl/Kamailio.pm +%{_libdir}/kamailio/perl/Kamailio/Constants.pm +%{_libdir}/kamailio/perl/Kamailio/LDAPUtils/LDAPConf.pm +%{_libdir}/kamailio/perl/Kamailio/LDAPUtils/LDAPConnection.pm +%{_libdir}/kamailio/perl/Kamailio/Message.pm +%{_libdir}/kamailio/perl/Kamailio/Utils/Debug.pm +%{_libdir}/kamailio/perl/Kamailio/Utils/PhoneNumbers.pm +%{_libdir}/kamailio/perl/Kamailio/VDB.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/AccountingSIPtrace.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/Alias.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/Auth.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/Describe.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/Speeddial.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/TableVersions.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Column.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Pair.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/ReqCond.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Result.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/VTab.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Value.pm + +%files lua +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.app_lua +%{_libdir}/kamailio/modules/app_lua.so + + +%files python +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.app_python +%{_libdir}/kamailio/modules/app_python.so + + +%files geoip +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.geoip +%{_libdir}/kamailio/modules/geoip.so + + + +%changelog +* Mon Oct 4 2010 Ovidiu Sas + - Update for kamailio 3.1 + +* Tue Mar 23 2010 Ovidiu Sas + - First version of the spec file for kamailio 3.0 diff --git a/pkg/kamailio/oracle/el7/kamailio.service b/pkg/kamailio/oracle/el7/kamailio.service new file mode 100644 index 00000000000..63d6da747c0 --- /dev/null +++ b/pkg/kamailio/oracle/el7/kamailio.service @@ -0,0 +1,17 @@ +[Unit] +Description=Kamailio SIP router server daemon +After=syslog.target network.target auditd.service + +[Service] +EnvironmentFile=/etc/sysconfig/kamailio +ExecStartPre=/usr/bin/mkdir -m=2770 -p /var/run/kamailio +ExecStartPre=/usr/bin/chown kamailio:kamailio /var/run/kamailio +ExecStart=/usr/sbin/kamailio -f $CFG_FILE -P $PID_FILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP $EXTRA_OPTIONS +ExecReload=/bin/kill -HUP $MAINPID +KillMode=control-group +Restart=on-failure +RestartSec=42s +Type=forking + +[Install] +WantedBy=multi-user.target diff --git a/pkg/kamailio/oracle/el7/kamailio.spec b/pkg/kamailio/oracle/el7/kamailio.spec new file mode 100644 index 00000000000..9c7548173cf --- /dev/null +++ b/pkg/kamailio/oracle/el7/kamailio.spec @@ -0,0 +1,854 @@ +%define name kamailio +%define ver 4.4.4 +%define rel 0 +%define _sharedir %{_prefix}/share + +%define MYSQL_MODULES mysql +%define POSTGRES_MODULES postgres +%define UNIXODBC_MODULES unixodbc +%define LDAP_MODULES ldap +%define XMLRPC_MODULES xml +%define PERL_MODULES perl +%define PYTHON_MODULES python +%define LUA_MODULES lua +%define UTILS_MODULES utils +%define PURPLE_MODULES purple +%define MEMCACHED_MODULES memcached +%define TLS_MODULES tls +%define XMPP_MODULES xmpp +%define CPL_MODULES cpl +%define SNMPSTATS_MODULES snmpstats +%define CARRIERROUTE_MODULES carrierroute +%define PRESENCE_MODULES presence +%define RADIUS_MODULES radius +%define GEOIP_MODULES geoip + +Summary: Kamailio, very fast and flexible SIP Server +Name: %name +Version: %ver +Release: %rel +Packager: Ovidiu Sas +License: GPL +Group: System Environment/Daemons +Source0: http://kamailio.org/pub/kamailio/%{ver}/%{name}-%{ver}_src.tar.gz +Source1: kamailio.service +Source2: kamailio.sysconfig +URL: http://kamailio.org/ +Vendor: kamailio.org +BuildRoot: %{_tmppath}/%{name}-%{ver}-buildroot +Conflicts: kamailio-mysql < %ver, kamailio-postgres < %ver, kamailio-unixodbc < %ver, kamailio-ldap < %ver, kamailio-xmlrpc < %ver, kamailio-perl < %ver, kamailio-python < %ver, kamailio-lua < %ver, kamailio-utils < %ver, kamailio-purple < %ver, kamailio-memcached < %ver, kamailio-tls < %ver, kamailio-xmpp < %ver, kamailio-cpl < %ver, kamailio-snmpstats < %ver, kamailio-carrierroute < %ver, kamailio-presence < %ver, kamailio-radius < %ver, kamailio-geoip < %ver +Requires: shadow-utils +BuildRequires: make flex bison pcre-devel + +%description +Kamailio is a very fast and flexible SIP (RFC3261) +proxy server. Written entirely in C, kamailio can handle thousands calls +per second even on low-budget hardware. A C Shell like scripting language +provides full control over the server's behaviour. It's modular +architecture allows only required functionality to be loaded. +Currently the following modules are available: digest authentication, +CPL scripts, instant messaging, MySQL and UNIXODBC support, a presence agent, +radius authentication, record routing, an SMS gateway, a +transaction and dialog module, OSP module, statistics support, +registrar and user location, SNMP, SIMPLE Presence and Perl programming +interface. + +%package mysql +Summary: MySQL connectivity for the Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: mysql-devel zlib-devel + +%description mysql +The kamailio-mysql package contains MySQL database connectivity that you +need to use digest authentication module or persistent user location +entries. + + +%package postgres +Summary: MPOSTGRES connectivity for the Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: postgresql-devel + +%description postgres +The kamailio-postgres package contains Postgres database connectivity that you +need to use digest authentication module or persistent user location +entries. + + +%package unixodbc +Summary: UNIXODBC connectivity for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: unixODBC-devel + +%description unixodbc +The kamailio-unixodbc package contains UNIXODBC database connectivity support +that is required by other modules with database dependencies. + + +%package utils +Summary: Utils for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver + +%description utils +The kamailio-utils package provides a set utility functions for Kamailio + + +%package cpl +Summary: CPL module (CPL interpreter engine) for Kamailio +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: libxml2-devel + +%description cpl +The kamailio-cpl package provides a CPL interpreter engine for Kamailio + + +%package radius +Summary: Kamailio radius support for AAA API. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: radiusclient-ng-devel + +%description radius +The kamailio-radius package contains modules for radius authentication, group +membership and uri checking. + + +%package snmpstats +Summary: SNMP AgentX subagent module for Kamailio +Group: System Environment/Daemons +Requires: kamailio = %ver, net-snmp-utils +BuildRequires: lm_sensors-devel net-snmp-devel + +%description snmpstats +The kamailio-snmpstats package snmpstats module for Kamailio. This module acts +as an AgentX subagent which connects to a master agent. + + +%package presence +Summary: sip presence user agent support for Kamailio +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: libxml2-devel, curl-devel + +%description presence +The kamailio-presence package contains a sip Presence Agent. + + +%package xmpp +Summary: SIP2XMPP message translation support for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: expat-devel + +%description xmpp +The kamailio-xmpp package contains a SIP to XMPP message translator. + + +%package tls +Summary: TLS transport protocol for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: openssl-devel + +%description tls +The kamailio-tls package contains the SIP TLSt transport mechanism for Kamailio. + + +%package carrierroute +Summary: Routing module for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: libconfuse-devel + +%description carrierroute +The kamailio-carrierroute package contains a fast routing engine. + + +%package purple +Summary: Provides the purple module, a multi-protocol IM gateway. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: libpurple-devel + +%description purple +The kamailio-purple package provides the purple module, a multi-protocol instant +messaging gateway module. + + +%package ldap +Summary: LDAP modules for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: openldap-devel + +%description ldap +The kamailio-ldap package provides the ldap and h350 modules for Kamailio, +enabling LDAP queries from the Kamailio config and storage of SIP account +data in an LDAP directory. + + +#%package memcached +#Summary: Distributed hash table for Kamailio. +#Group: System Environment/Daemons +#Requires: kamailio = %ver +#BuildRequires: libmemcached-devel +# +#%description memcached +#The kamailio-memcached package provides access to a distributed hash table memcached. + + +#%package xmlrpc +#Summary: XMLRPC support for Kamailio's Management Interface. +#Group: System Environment/Daemons +#Requires: kamailio = %ver +#BuildRequires: libxml2-devel xmlrpc-c-devel +# +#%description xmlrpc +#The kamailio-xmlrpc package provides the XMLRPC transport implementations for Kamailio's +#Management and Control Interface. + + +%package perl +Summary: Perl extensions and database driver for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: mod_perl-devel + +%description perl +The kamailio-perl package provides an interface for Kamailio to write Perl extensions and +the perlvdb database driver for Kamailio. + + +%package lua +Summary: Lua extensions for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: lua-devel + +%description lua +The kamailio-lua package provides an interface for Kamailio to write Python extensions + + +%package python +Summary: Python extensions for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: python-devel + +%description python +The kamailio-python package provides an interface for Kamailio to write Python extensions + + +%package geoip +Summary: GeoIP extensions for Kamailio. +Group: System Environment/Daemons +Requires: kamailio = %ver +BuildRequires: geoip-devel + +%description geoip +The kamailio-geoip package provides a GeoIP interface for Kamailio + + + + +%prep +%setup -n %{name}-%{ver} + +%build +make FLAVOUR=kamailio cfg prefix=/usr cfg_prefix=$RPM_BUILD_ROOT basedir=$RPM_BUILD_ROOT cfg_target=/%{_sysconfdir}/kamailio/ modules_dirs="modules" +make +make every-module skip_modules="iptrtpproxy" group_include="kstandard" +make every-module group_include="k%MYSQL_MODULES" +make every-module group_include="k%POSTGRES_MODULES" +make every-module group_include="k%UNIXODBC_MODULES" +make every-module group_include="k%UTILS_MODULES" +make every-module group_include="k%CPL_MODULES" +make every-module group_include="k%RADIUS_MODULES" +make every-module group_include="k%SNMPSTATS_MODULES" +make every-module group_include="k%PRESENCE_MODULES" +make every-module group_include="k%XMPP_MODULES" +make every-module group_include="k%TLS_MODULES" +make every-module group_include="k%CARRIERROUTE_MODULES" +make every-module group_include="k%PURPLE_MODULES" +make every-module group_include="k%LDAP_MODULES" +#make every-module group_include="k%MEMCACHED_MODULES" +#make every-module group_include="k%XMLRPC_MODULES" +make every-module group_include="k%PERL_MODULES" +make every-module group_include="k%LUA_MODULES" +make every-module group_include="k%PYTHON_MODULES" +make every-module group_include="k%GEOIP_MODULES" + +%install +[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT" + +make install +make install-modules-all skip_modules="iptrtpproxy" group_include="kstandard" +make install-modules-all group_include="k%MYSQL_MODULES" +make install-modules-all group_include="k%POSTGRES_MODULES" +make install-modules-all group_include="k%UNIXODBC_MODULES" +make install-modules-all group_include="k%UTILS_MODULES" +make install-modules-all group_include="k%CPL_MODULES" +make install-modules-all group_include="k%SNMPSTATS_MODULES" +make install-modules-all group_include="k%RADIUS_MODULES" +make install-modules-all group_include="k%PRESENCE_MODULES" +make install-modules-all group_include="k%XMPP_MODULES" +make install-modules-all group_include="k%TLS_MODULES" +make install-modules-all group_include="k%CARRIERROUTE_MODULES" +make install-modules-all group_include="k%PURPLE_MODULES" +make install-modules-all group_include="k%LDAP_MODULES" +#make install-modules-all group_include="k%MEMCACHED_MODULES" +#make install-modules-all group_include="k%XMLRPC_MODULES" +make install-modules-all group_include="k%PERL_MODULES" +make install-modules-all group_include="k%LUA_MODULES" +make install-modules-all group_include="k%PYTHON_MODULES" +make install-modules-all group_include="k%GEOIP_MODULES" + + +mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system/service +install -m644 $RPM_SOURCE_DIR/kamailio.service \ + $RPM_BUILD_ROOT/usr/lib/systemd/system/service/kamailio.service + +mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig +install -m644 $RPM_SOURCE_DIR/kamailio.sysconfig \ + $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/kamailio + + +%pre +/sbin/groupadd -r kamailio 2> /dev/null || : +/sbin/useradd -r -g kamailio -s /bin/false -c "Kamailio daemon" -d \ + %{_libdir}/kamailio kamailio 2> /dev/null || : + + +%clean +rm -rf "$RPM_BUILD_ROOT" + +%post +/bin/systemctl daemon-reload + +%preun +if [ $1 = 0 ]; then + /bin/systemctl stop kamailio > /dev/null 2>&1 + /bin/systemctl disable kamailio +fi + +%files +%defattr(-,root,root) +%dir %{_docdir}/kamailio +%doc %{_docdir}/kamailio/AUTHORS +%doc %{_docdir}/kamailio/NEWS +%doc %{_docdir}/kamailio/INSTALL +%doc %{_docdir}/kamailio/README +%doc %{_docdir}/kamailio/README-MODULES +%doc %{_docdir}/kamailio/modules/README.auth +%doc %{_docdir}/kamailio/modules/README.avpops +%doc %{_docdir}/kamailio/modules/README.blst +%doc %{_docdir}/kamailio/modules/README.cfg_db +%doc %{_docdir}/kamailio/modules/README.cfg_rpc +%doc %{_docdir}/kamailio/modules/README.counters +%doc %{_docdir}/kamailio/modules/README.ctl +%doc %{_docdir}/kamailio/modules/README.db_flatstore +%doc %{_docdir}/kamailio/modules/README.debugger +%doc %{_docdir}/kamailio/modules/README.dialplan +%doc %{_docdir}/kamailio/modules/README.enum +%doc %{_docdir}/kamailio/modules/README.lcr +%doc %{_docdir}/kamailio/modules/README.malloc_test +%doc %{_docdir}/kamailio/modules/README.matrix +%doc %{_docdir}/kamailio/modules/README.mediaproxy +%doc %{_docdir}/kamailio/modules/README.mi_rpc +%doc %{_docdir}/kamailio/modules/README.mqueue +%doc %{_docdir}/kamailio/modules/README.mtree +%doc %{_docdir}/kamailio/modules/README.pdb +%doc %{_docdir}/kamailio/modules/README.pipelimit +%doc %{_docdir}/kamailio/modules/README.prefix_route +#%doc %{_docdir}/kamailio/modules/README.privacy +%doc %{_docdir}/kamailio/modules/README.ratelimit +%doc %{_docdir}/kamailio/modules/README.sanity +%doc %{_docdir}/kamailio/modules/README.sl +%doc %{_docdir}/kamailio/modules/README.sms +%doc %{_docdir}/kamailio/modules/README.textopsx +%doc %{_docdir}/kamailio/modules/README.tm +%doc %{_docdir}/kamailio/modules/README.topoh +%doc %{_docdir}/kamailio/modules/README.xhttp +%doc %{_docdir}/kamailio/modules/README.acc +%doc %{_docdir}/kamailio/modules/README.alias_db +%doc %{_docdir}/kamailio/modules/README.auth_db +%doc %{_docdir}/kamailio/modules/README.auth_diameter +%doc %{_docdir}/kamailio/modules/README.benchmark +%doc %{_docdir}/kamailio/modules/README.call_control +%doc %{_docdir}/kamailio/modules/README.cfgutils +%doc %{_docdir}/kamailio/modules/README.db_text +%doc %{_docdir}/kamailio/modules/README.dialog +%doc %{_docdir}/kamailio/modules/README.dispatcher +%doc %{_docdir}/kamailio/modules/README.diversion +%doc %{_docdir}/kamailio/modules/README.domain +%doc %{_docdir}/kamailio/modules/README.domainpolicy +%doc %{_docdir}/kamailio/modules/README.drouting +%doc %{_docdir}/kamailio/modules/README.exec +%doc %{_docdir}/kamailio/modules/README.group +%doc %{_docdir}/kamailio/modules/README.htable +%doc %{_docdir}/kamailio/modules/README.imc +%doc %{_docdir}/kamailio/modules/README.kex +%doc %{_docdir}/kamailio/modules/README.maxfwd +%doc %{_docdir}/kamailio/modules/README.mi_datagram +%doc %{_docdir}/kamailio/modules/README.mi_fifo +%doc %{_docdir}/kamailio/modules/README.msilo +%doc %{_docdir}/kamailio/modules/README.nat_traversal +%doc %{_docdir}/kamailio/modules/README.nathelper +%doc %{_docdir}/kamailio/modules/README.path +%doc %{_docdir}/kamailio/modules/README.pdt +%doc %{_docdir}/kamailio/modules/README.permissions +%doc %{_docdir}/kamailio/modules/README.pike +%doc %{_docdir}/kamailio/modules/README.pua_mi +%doc %{_docdir}/kamailio/modules/README.pv +%doc %{_docdir}/kamailio/modules/README.qos +%doc %{_docdir}/kamailio/modules/README.regex +%doc %{_docdir}/kamailio/modules/README.registrar +%doc %{_docdir}/kamailio/modules/README.rr +%doc %{_docdir}/kamailio/modules/README.rtimer +%doc %{_docdir}/kamailio/modules/README.rtpproxy +%doc %{_docdir}/kamailio/modules/README.seas +%doc %{_docdir}/kamailio/modules/README.siptrace +%doc %{_docdir}/kamailio/modules/README.siputils +%doc %{_docdir}/kamailio/modules/README.speeddial +%doc %{_docdir}/kamailio/modules/README.sqlops +%doc %{_docdir}/kamailio/modules/README.sst +%doc %{_docdir}/kamailio/modules/README.statistics +%doc %{_docdir}/kamailio/modules/README.textops +%doc %{_docdir}/kamailio/modules/README.tmx +%doc %{_docdir}/kamailio/modules/README.uac +%doc %{_docdir}/kamailio/modules/README.uac_redirect +%doc %{_docdir}/kamailio/modules/README.uri_db +%doc %{_docdir}/kamailio/modules/README.userblacklist +%doc %{_docdir}/kamailio/modules/README.usrloc +%doc %{_docdir}/kamailio/modules/README.xlog + +%doc %{_docdir}/kamailio/modules/README.app_perl +%doc %{_docdir}/kamailio/modules/README.async +%doc %{_docdir}/kamailio/modules/README.auth_identity +%doc %{_docdir}/kamailio/modules/README.auth_xkeys +%doc %{_docdir}/kamailio/modules/README.avp +%doc %{_docdir}/kamailio/modules/README.cfgt +%doc %{_docdir}/kamailio/modules/README.corex +%doc %{_docdir}/kamailio/modules/README.crypto +%doc %{_docdir}/kamailio/modules/README.db2_ldap +%doc %{_docdir}/kamailio/modules/README.db2_ops +%doc %{_docdir}/kamailio/modules/README.db_cluster +%doc %{_docdir}/kamailio/modules/README.db_mysql +%doc %{_docdir}/kamailio/modules/README.db_perlvdb +%doc %{_docdir}/kamailio/modules/README.dmq +%doc %{_docdir}/kamailio/modules/README.dmq_usrloc +%doc %{_docdir}/kamailio/modules/README.http_client +%doc %{_docdir}/kamailio/modules/README.ipops +%doc %{_docdir}/kamailio/modules/README.jsonrpc-s +%doc %{_docdir}/kamailio/modules/README.log_custom +%doc %{_docdir}/kamailio/modules/README.mangler +%doc %{_docdir}/kamailio/modules/README.mohqueue +%doc %{_docdir}/kamailio/modules/README.msrp +%doc %{_docdir}/kamailio/modules/README.nosip +%doc %{_docdir}/kamailio/modules/README.p_usrloc +%doc %{_docdir}/kamailio/modules/README.presence_profile +%doc %{_docdir}/kamailio/modules/README.presence_reginfo +%doc %{_docdir}/kamailio/modules/README.print +%doc %{_docdir}/kamailio/modules/README.print_lib +%doc %{_docdir}/kamailio/modules/README.pua_reginfo +%doc %{_docdir}/kamailio/modules/README.rtjson +%doc %{_docdir}/kamailio/modules/README.rtpengine +%doc %{_docdir}/kamailio/modules/README.sca +%doc %{_docdir}/kamailio/modules/README.sdpops +%doc %{_docdir}/kamailio/modules/README.sipcapture +%doc %{_docdir}/kamailio/modules/README.sipt +%doc %{_docdir}/kamailio/modules/README.smsops +%doc %{_docdir}/kamailio/modules/README.statsc +%doc %{_docdir}/kamailio/modules/README.statsd +%doc %{_docdir}/kamailio/modules/README.stun +%doc %{_docdir}/kamailio/modules/README.tcpops +%doc %{_docdir}/kamailio/modules/README.timer +%doc %{_docdir}/kamailio/modules/README.tmrec +%doc %{_docdir}/kamailio/modules/README.topos +%doc %{_docdir}/kamailio/modules/README.tsilo +%doc %{_docdir}/kamailio/modules/README.uid_auth_db +%doc %{_docdir}/kamailio/modules/README.uid_avp_db +%doc %{_docdir}/kamailio/modules/README.uid_domain +%doc %{_docdir}/kamailio/modules/README.uid_gflags +%doc %{_docdir}/kamailio/modules/README.uid_uri_db +%doc %{_docdir}/kamailio/modules/README.xhttp_rpc +%doc %{_docdir}/kamailio/modules/README.xprint + +%{_datarootdir}/snmp/mibs/KAMAILIO-MIB +%{_datarootdir}/snmp/mibs/KAMAILIO-REG-MIB +%{_datarootdir}/snmp/mibs/KAMAILIO-SIP-COMMON-MIB +%{_datarootdir}/snmp/mibs/KAMAILIO-SIP-SERVER-MIB +%{_datarootdir}/snmp/mibs/KAMAILIO-TC + +%dir %{_sysconfdir}/kamailio +%config(noreplace) %{_sysconfdir}/kamailio/* +%config /usr/lib/systemd/system/service/kamailio.service +%config %{_sysconfdir}/sysconfg/kamailio + +%dir %{_libdir}/kamailio +%{_libdir}/kamailio/libbinrpc.so +%{_libdir}/kamailio/libbinrpc.so.0 +%{_libdir}/kamailio/libbinrpc.so.0.1 +%{_libdir}/kamailio/libkcore.so +%{_libdir}/kamailio/libkcore.so.1 +%{_libdir}/kamailio/libkcore.so.1.0 +%{_libdir}/kamailio/libkmi.so +%{_libdir}/kamailio/libkmi.so.1 +%{_libdir}/kamailio/libkmi.so.1.0 +%{_libdir}/kamailio/libprint.so +%{_libdir}/kamailio/libprint.so.1 +%{_libdir}/kamailio/libprint.so.1.2 +%{_libdir}/kamailio/libsrdb1.so +%{_libdir}/kamailio/libsrdb1.so.1 +%{_libdir}/kamailio/libsrdb1.so.1.0 +%{_libdir}/kamailio/libsrdb2.so +%{_libdir}/kamailio/libsrdb2.so.1 +%{_libdir}/kamailio/libsrdb2.so.1.0 +%{_libdir}/kamailio/libsrutils.so +%{_libdir}/kamailio/libsrutils.so.1 +%{_libdir}/kamailio/libsrutils.so.1.0 +%{_libdir}/kamailio/libtrie.so +%{_libdir}/kamailio/libtrie.so.1 +%{_libdir}/kamailio/libtrie.so.1.0 + +%dir %{_libdir}/kamailio/modules +%{_libdir}/kamailio/modules/auth.so +%{_libdir}/kamailio/modules/avpops.so +%{_libdir}/kamailio/modules/blst.so +%{_libdir}/kamailio/modules/cfg_db.so +%{_libdir}/kamailio/modules/cfg_rpc.so +%{_libdir}/kamailio/modules/counters.so +%{_libdir}/kamailio/modules/ctl.so +%{_libdir}/kamailio/modules/db_flatstore.so +%{_libdir}/kamailio/modules/debugger.so +%{_libdir}/kamailio/modules/dialplan.so +%{_libdir}/kamailio/modules/enum.so +%{_libdir}/kamailio/modules/lcr.so +%{_libdir}/kamailio/modules/malloc_test.so +%{_libdir}/kamailio/modules/matrix.so +%{_libdir}/kamailio/modules/mediaproxy.so +%{_libdir}/kamailio/modules/mi_rpc.so +%{_libdir}/kamailio/modules/mqueue.so +%{_libdir}/kamailio/modules/mtree.so +%{_libdir}/kamailio/modules/pdb.so +%{_libdir}/kamailio/modules/pipelimit.so +%{_libdir}/kamailio/modules/prefix_route.so +#%{_libdir}/kamailio/modules/privacy.so +%{_libdir}/kamailio/modules/ratelimit.so +%{_libdir}/kamailio/modules/sanity.so +%{_libdir}/kamailio/modules/sl.so +%{_libdir}/kamailio/modules/sms.so +%{_libdir}/kamailio/modules/tm.so +%{_libdir}/kamailio/modules/textopsx.so +%{_libdir}/kamailio/modules/topoh.so +%{_libdir}/kamailio/modules/xhttp.so +%{_libdir}/kamailio/modules/acc.so +%{_libdir}/kamailio/modules/alias_db.so +%{_libdir}/kamailio/modules/auth_db.so +%{_libdir}/kamailio/modules/auth_diameter.so +%{_libdir}/kamailio/modules/benchmark.so +%{_libdir}/kamailio/modules/call_control.so +%{_libdir}/kamailio/modules/cfgutils.so +%{_libdir}/kamailio/modules/db_text.so +%{_libdir}/kamailio/modules/dialog.so +%{_libdir}/kamailio/modules/dispatcher.so +%{_libdir}/kamailio/modules/diversion.so +%{_libdir}/kamailio/modules/domain.so +%{_libdir}/kamailio/modules/domainpolicy.so +%{_libdir}/kamailio/modules/drouting.so +%{_libdir}/kamailio/modules/exec.so +%{_libdir}/kamailio/modules/group.so +%{_libdir}/kamailio/modules/htable.so +%{_libdir}/kamailio/modules/imc.so +%{_libdir}/kamailio/modules/kex.so +%{_libdir}/kamailio/modules/maxfwd.so +%{_libdir}/kamailio/modules/mi_datagram.so +%{_libdir}/kamailio/modules/mi_fifo.so +%{_libdir}/kamailio/modules/msilo.so +%{_libdir}/kamailio/modules/nat_traversal.so +%{_libdir}/kamailio/modules/nathelper.so +%{_libdir}/kamailio/modules/path.so +%{_libdir}/kamailio/modules/pdt.so +%{_libdir}/kamailio/modules/permissions.so +%{_libdir}/kamailio/modules/pike.so +%{_libdir}/kamailio/modules/pua_mi.so +%{_libdir}/kamailio/modules/pv.so +%{_libdir}/kamailio/modules/qos.so +%{_libdir}/kamailio/modules/regex.so +%{_libdir}/kamailio/modules/registrar.so +%{_libdir}/kamailio/modules/rr.so +%{_libdir}/kamailio/modules/rtimer.so +%{_libdir}/kamailio/modules/rtpproxy.so +%{_libdir}/kamailio/modules/seas.so +%{_libdir}/kamailio/modules/siptrace.so +%{_libdir}/kamailio/modules/siputils.so +%{_libdir}/kamailio/modules/speeddial.so +%{_libdir}/kamailio/modules/sqlops.so +%{_libdir}/kamailio/modules/sst.so +%{_libdir}/kamailio/modules/statistics.so +%{_libdir}/kamailio/modules/textops.so +%{_libdir}/kamailio/modules/tmx.so +%{_libdir}/kamailio/modules/uac.so +%{_libdir}/kamailio/modules/uac_redirect.so +%{_libdir}/kamailio/modules/uri_db.so +%{_libdir}/kamailio/modules/userblacklist.so +%{_libdir}/kamailio/modules/usrloc.so +%{_libdir}/kamailio/modules/xlog.so +%{_libdir}/kamailio/modules/async.so +%{_libdir}/kamailio/modules/auth_identity.so +%{_libdir}/kamailio/modules/auth_xkeys.so +%{_libdir}/kamailio/modules/avp.so +%{_libdir}/kamailio/modules/cfgt.so +%{_libdir}/kamailio/modules/corex.so +%{_libdir}/kamailio/modules/crypto.so +%{_libdir}/kamailio/modules/db2_ldap.so +%{_libdir}/kamailio/modules/db2_ops.so +%{_libdir}/kamailio/modules/db_cluster.so +%{_libdir}/kamailio/modules/dmq.so +%{_libdir}/kamailio/modules/dmq_usrloc.so +%{_libdir}/kamailio/modules/http_client.so +%{_libdir}/kamailio/modules/ipops.so +%{_libdir}/kamailio/modules/jsonrpc-s.so +%{_libdir}/kamailio/modules/log_custom.so +%{_libdir}/kamailio/modules/mangler.so +%{_libdir}/kamailio/modules/mohqueue.so +%{_libdir}/kamailio/modules/msrp.so +%{_libdir}/kamailio/modules/nosip.so +%{_libdir}/kamailio/modules/p_usrloc.so +%{_libdir}/kamailio/modules/presence_profile.so +%{_libdir}/kamailio/modules/presence_reginfo.so +%{_libdir}/kamailio/modules/print.so +%{_libdir}/kamailio/modules/print_lib.so +%{_libdir}/kamailio/modules/pua_reginfo.so +%{_libdir}/kamailio/modules/rtjson.so +%{_libdir}/kamailio/modules/rtpengine.so +%{_libdir}/kamailio/modules/sca.so +%{_libdir}/kamailio/modules/sdpops.so +%{_libdir}/kamailio/modules/sipcapture.so +%{_libdir}/kamailio/modules/sipt.so +%{_libdir}/kamailio/modules/smsops.so +%{_libdir}/kamailio/modules/statsc.so +%{_libdir}/kamailio/modules/statsd.so +%{_libdir}/kamailio/modules/stun.so +%{_libdir}/kamailio/modules/tcpops.so +%{_libdir}/kamailio/modules/timer.so +%{_libdir}/kamailio/modules/tmrec.so +%{_libdir}/kamailio/modules/topos.so +%{_libdir}/kamailio/modules/tsilo.so +%{_libdir}/kamailio/modules/uid_auth_db.so +%{_libdir}/kamailio/modules/uid_avp_db.so +%{_libdir}/kamailio/modules/uid_domain.so +%{_libdir}/kamailio/modules/uid_gflags.so +%{_libdir}/kamailio/modules/uid_uri_db.so +%{_libdir}/kamailio/modules/xhttp_rpc.so +%{_libdir}/kamailio/modules/xprint.so + + +%{_sbindir}/kamailio +%{_sbindir}/kamctl +%{_sbindir}/kamdbctl +%{_sbindir}/kamcmd +%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.py +%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.pyc +%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.pyo +%{_libdir}/kamailio/kamctl/kamctl.base +%{_libdir}/kamailio/kamctl/kamctl.ctlbase +%{_libdir}/kamailio/kamctl/kamctl.dbtext +%{_libdir}/kamailio/kamctl/kamctl.fifo +%{_libdir}/kamailio/kamctl/kamctl.ser +%{_libdir}/kamailio/kamctl/kamctl.ser_mi +%{_libdir}/kamailio/kamctl/kamctl.sqlbase +%{_libdir}/kamailio/kamctl/kamctl.unixsock +%{_libdir}/kamailio/kamctl/kamdbctl.base +%{_libdir}/kamailio/kamctl/kamdbctl.dbtext + +%{_mandir}/man5/* +%{_mandir}/man8/* + +%{_sharedir}/kamailio/dbtext/kamailio/* + + +%files mysql +%defattr(-,root,root) +%{_libdir}/kamailio/modules/db_mysql.so +%{_libdir}/kamailio/kamctl/kamctl.mysql +%{_libdir}/kamailio/kamctl/kamdbctl.mysql +%{_sharedir}/kamailio/mysql/* + + +%files postgres +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.db_postgres +%{_libdir}/kamailio/modules/db_postgres.so +%{_libdir}/kamailio/kamctl/kamctl.pgsql +%{_libdir}/kamailio/kamctl/kamdbctl.pgsql +%{_sharedir}/kamailio/postgres/* + + +%files unixodbc +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.db_unixodbc +%{_libdir}/kamailio/modules/db_unixodbc.so + + +%files utils +%defattr(-,root,root) +%{_docdir}/kamailio/modules/README.utils +%{_libdir}/kamailio/modules/utils.so + + +%files cpl +%defattr(-,root,root) +%{_docdir}/kamailio/modules/README.cpl-c +%{_libdir}/kamailio/modules/cpl-c.so + + +%files radius +%defattr(-,root,root) +%{_docdir}/kamailio/modules/README.acc_radius +%{_docdir}/kamailio/modules/README.auth_radius +%{_docdir}/kamailio/modules/README.misc_radius +%{_docdir}/kamailio/modules/README.peering +%{_libdir}/kamailio/modules/acc_radius.so +%{_libdir}/kamailio/modules/auth_radius.so +%{_libdir}/kamailio/modules/misc_radius.so +%{_libdir}/kamailio/modules/peering.so + + +%files snmpstats +%defattr(-,root,root) +%{_docdir}/kamailio/modules/README.snmpstats +%{_libdir}/kamailio/modules/snmpstats.so + + +%files presence +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.presence +%doc %{_docdir}/kamailio/modules/README.presence_conference +%doc %{_docdir}/kamailio/modules/README.presence_dialoginfo +%doc %{_docdir}/kamailio/modules/README.presence_mwi +%doc %{_docdir}/kamailio/modules/README.presence_xml +%doc %{_docdir}/kamailio/modules/README.pua +%doc %{_docdir}/kamailio/modules/README.pua_bla +%doc %{_docdir}/kamailio/modules/README.pua_dialoginfo +%doc %{_docdir}/kamailio/modules/README.pua_mi +%doc %{_docdir}/kamailio/modules/README.pua_usrloc +%doc %{_docdir}/kamailio/modules/README.pua_xmpp +%doc %{_docdir}/kamailio/modules/README.rls +%doc %{_docdir}/kamailio/modules/README.xcap_client +%doc %{_docdir}/kamailio/modules/README.xcap_server +%{_libdir}/kamailio/modules/presence.so +%{_libdir}/kamailio/modules/presence_conference.so +%{_libdir}/kamailio/modules/presence_dialoginfo.so +%{_libdir}/kamailio/modules/presence_mwi.so +%{_libdir}/kamailio/modules/presence_xml.so +%{_libdir}/kamailio/modules/pua.so +%{_libdir}/kamailio/modules/pua_bla.so +%{_libdir}/kamailio/modules/pua_dialoginfo.so +%{_libdir}/kamailio/modules/pua_mi.so +%{_libdir}/kamailio/modules/pua_usrloc.so +%{_libdir}/kamailio/modules/pua_xmpp.so +%{_libdir}/kamailio/modules/rls.so +%{_libdir}/kamailio/modules/xcap_client.so +%{_libdir}/kamailio/modules/xcap_server.so + + +%files xmpp +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.xmpp +%{_libdir}/kamailio/modules/xmpp.so + + +%files tls +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.tls +%{_libdir}/kamailio/modules/tls.so + + +%files carrierroute +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.carrierroute +%{_libdir}/kamailio/modules/carrierroute.so + + +%files purple +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.purple +%{_libdir}/kamailio/modules/purple.so + + +%files ldap +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.h350 +%doc %{_docdir}/kamailio/modules/README.ldap +%{_libdir}/kamailio/modules/h350.so +%{_libdir}/kamailio/modules/ldap.so + + +#%files memcached +#%defattr(-,root,root) +#%doc %{_docdir}/kamailio/modules/README.memcached +#%{_libdir}/kamailio/modules/memcached.so + + +#%files xmlrpc +#%defattr(-,root,root) +#%doc %{_docdir}/kamailio/modules/README.memcached +#%{_libdir}/kamailio/modules/memcached.so + + +%files perl +%defattr(-,root,root) +%{_libdir}/kamailio/modules/app_perl.so +%{_libdir}/kamailio/modules/db_perlvdb.so +%{_libdir}/kamailio/perl/Kamailio.pm +%{_libdir}/kamailio/perl/Kamailio/Constants.pm +%{_libdir}/kamailio/perl/Kamailio/LDAPUtils/LDAPConf.pm +%{_libdir}/kamailio/perl/Kamailio/LDAPUtils/LDAPConnection.pm +%{_libdir}/kamailio/perl/Kamailio/Message.pm +%{_libdir}/kamailio/perl/Kamailio/Utils/Debug.pm +%{_libdir}/kamailio/perl/Kamailio/Utils/PhoneNumbers.pm +%{_libdir}/kamailio/perl/Kamailio/VDB.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/AccountingSIPtrace.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/Alias.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/Auth.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/Describe.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/Speeddial.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Adapter/TableVersions.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Column.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Pair.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/ReqCond.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Result.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/VTab.pm +%{_libdir}/kamailio/perl/Kamailio/VDB/Value.pm + +%files lua +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.app_lua +%{_libdir}/kamailio/modules/app_lua.so + + +%files python +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.app_python +%{_libdir}/kamailio/modules/app_python.so + + +%files geoip +%defattr(-,root,root) +%doc %{_docdir}/kamailio/modules/README.geoip +%{_libdir}/kamailio/modules/geoip.so + + + +%changelog +* Mon Oct 4 2010 Ovidiu Sas + - Update for kamailio 3.1 + +* Tue Mar 23 2010 Ovidiu Sas + - First version of the spec file for kamailio 3.0 diff --git a/pkg/kamailio/oracle/el7/kamailio.sysconfig b/pkg/kamailio/oracle/el7/kamailio.sysconfig new file mode 100644 index 00000000000..d451d3486b4 --- /dev/null +++ b/pkg/kamailio/oracle/el7/kamailio.sysconfig @@ -0,0 +1,36 @@ +# +# Kamailio startup options +# + +# Set to yes to enable kamailio, once configured properly. +RUN_KAMAILIO=yes + +# User to run as +USER=kamailio + +# Group to run as +GROUP=kamailio + +# Amount of shared memory to allocate for the running Kamailio server (in Mb) +SHM_MEMORY=32 + +# Amount of per-process (package) memory to allocate for Kamailio (in Mb) +PKG_MEMORY=4 + +# Enable the server to leave a core file when it crashes. +# Set this to 'yes' to enable kamailio to leave a core file when it crashes +# or 'no' to disable this feature. This option is case sensitive and only +# accepts 'yes' and 'no' and only in lowercase letters. +# On some systems (e.g. Ubuntu 6.10, Debian 4.0) it is necessary to specify +# a directory for the core files to get a dump. Look into the kamailio +# init file for an example configuration. +DUMP_CORE=no + +# Add extra command line parameters in the EXTRA_OPTIONS variable +# EXTRA_OPTIONS="-a no" + +CFG_FILE=/etc/kamailio/kamailio.cfg + +PID_FILE=/var/run/kamailio/kamailio.pid + +LOCK_FILE=/var/lock/subsys/kamailio diff --git a/pkg/kamailio/oracle/kamailio.logrotate b/pkg/kamailio/oracle/kamailio.logrotate new file mode 100644 index 00000000000..cf18c647471 --- /dev/null +++ b/pkg/kamailio/oracle/kamailio.logrotate @@ -0,0 +1,7 @@ +/var/log/kamailio +{ + sharedscripts + postrotate + /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true + endscript +} diff --git a/pkg/kamailio/oracle/kamailio.rsyslog b/pkg/kamailio/oracle/kamailio.rsyslog new file mode 100644 index 00000000000..273cc3bb976 --- /dev/null +++ b/pkg/kamailio/oracle/kamailio.rsyslog @@ -0,0 +1,2 @@ +# Kamailio (OpenSER) messages, make sure this spacing is done with tabs, spaces may cause errors +local0.* -/var/log/kamailio diff --git a/pkg/kamailio/rpm/kamailio.spec-4.1 b/pkg/kamailio/rpm/kamailio.spec-4.1 index 12b02f0c690..1bb03168451 100644 --- a/pkg/kamailio/rpm/kamailio.spec-4.1 +++ b/pkg/kamailio/rpm/kamailio.spec-4.1 @@ -1,5 +1,5 @@ %define name kamailio -%define ver 1.2.0 +%define ver 4.4.4 %define rel 0 %define EXCLUDED_MODULES mysql jabber cpl-c avp_radius auth_radius group_radius uri_radius pa postgres osp tlsops unixodbc diff --git a/pkg/kamailio/rpm/kamailio.spec.CenOS b/pkg/kamailio/rpm/kamailio.spec.CenOS index 6b396c73876..2b4f43748a8 100644 --- a/pkg/kamailio/rpm/kamailio.spec.CenOS +++ b/pkg/kamailio/rpm/kamailio.spec.CenOS @@ -1,5 +1,5 @@ %define name kamailio -%define ver 3.2.0 +%define ver 4.4.4 %define rel 0 %define _sharedir %{_prefix}/share diff --git a/pkg/kamailio/rpm/kamailio.spec.SuSE b/pkg/kamailio/rpm/kamailio.spec.SuSE index 77af948901f..bec54a73c7e 100644 --- a/pkg/kamailio/rpm/kamailio.spec.SuSE +++ b/pkg/kamailio/rpm/kamailio.spec.SuSE @@ -1,5 +1,5 @@ %define name kamailio -%define ver 1.2.0 +%define ver 4.4.4 %define rel 0 %define EXCLUDED_MODULES mysql jabber cpl-c auth_radius misc_radius peering postgress pa unixodbc osp tlsops diff --git a/pv_core.c b/pv_core.c index c50de35df41..3d495526066 100644 --- a/pv_core.c +++ b/pv_core.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2009 iptelorg GmbH * * Permission to use, copy, modify, and distribute this software for any @@ -35,19 +35,19 @@ static pv_export_t core_pvs[] = { { STR_STATIC_INIT("?"), PVT_OTHER, pv_get_retcode, 0, 0, 0, 0, 0 }, { STR_STATIC_INIT("rc"), PVT_OTHER, pv_get_retcode, 0, 0, 0, 0, 0 }, { STR_STATIC_INIT("retcode"), PVT_OTHER, pv_get_retcode, 0, 0, 0, 0, 0 }, - + { {0, 0}, 0, 0, 0, 0, 0, 0, 0 } }; /** ugly hack to get the return code, needed because the PVs do not know (yet) - about the script context */ + * about the script context */ extern int _last_returned_code; static int pv_get_retcode(struct sip_msg* msg, pv_param_t* p, pv_value_t* res) { /* FIXME: as soon as PVs support script context, use it instead of the - return in global variable hack */ + * return in global variable hack */ return pv_get_sintval(msg, p, res, _last_returned_code); } @@ -55,7 +55,7 @@ static int pv_get_retcode(struct sip_msg* msg, pv_param_t* p, pv_value_t* res) /** register built-in core pvars. * should be called before parsing the config script. - * @return 0 on success + * @return 0 on success */ int pv_register_core_vars(void) { diff --git a/pv_core.h b/pv_core.h index 5f80556ccf0..ef90b7eacaa 100644 --- a/pv_core.h +++ b/pv_core.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2009 iptelorg GmbH * * Permission to use, copy, modify, and distribute this software for any diff --git a/pvapi.c b/pvapi.c index e9b557e12f8..93f07a57556 100644 --- a/pvapi.c +++ b/pvapi.c @@ -13,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -193,14 +193,14 @@ int pv_table_add(pv_export_t *e) LM_ERR("invalid parameters\n"); return -1; } - + if(_pv_table_set==0) { LM_DBG("PV table not initialized, doing it now\n"); pv_init_table(); } in = &(e->name); - p = in->s; + p = in->s; while(is_in_str(p,in) && is_pv_valid_char(*p)) p++; if(is_in_str(p,in)) @@ -462,7 +462,7 @@ int pv_table_free(void) } memset(_pv_table, 0, sizeof(pv_item_t*)*PV_TABLE_SIZE); _pv_table_set = 0; - + return 0; } @@ -601,7 +601,7 @@ int pv_get_null(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { if(res==NULL) return -1; - + res->rs = pv_str_empty; res->ri = 0; res->flags = PV_VAL_NULL; @@ -757,7 +757,7 @@ char* pv_parse_spec2(str *in, pv_spec_p e, int silent) if (!silent) LM_ERR("bad parameters\n"); return NULL; } - + /* LM_DBG("***** input [%.*s] (%d)\n", in->len, in->s, in->len); */ tr = 0; pvstate = 0; @@ -806,7 +806,7 @@ char* pv_parse_spec2(str *in, pv_spec_p e, int silent) *p, in->len, in->s, pvstate); goto error; } - } else { + } else { if(!is_in_str(p, in)) { p--; goto done_inm; @@ -824,13 +824,13 @@ char* pv_parse_spec2(str *in, pv_spec_p e, int silent) done_inm: if((pte = pv_lookup_spec_name(&pvname, e))==NULL) { - if (!silent) + if (!silent) LM_ERR("error searching pvar \"%.*s\"\n", pvname.len, pvname.s); goto error; } if(pte->parse_name!=NULL && pvstate!=2 && pvstate!=5) { - if (!silent) + if (!silent) LM_ERR("pvar \"%.*s\" expects an inner name\n", pvname.len, pvname.s); goto error; @@ -1054,7 +1054,7 @@ int pv_parse_format(str *in, pv_elem_p *el) return -1; /*LM_DBG("parsing [%.*s]\n", in->len, in->s);*/ - + if(in->len == 0) { *el = pkg_malloc(sizeof(pv_elem_t)); @@ -1081,12 +1081,12 @@ int pv_parse_format(str *in, pv_elem_p *el) *el = e; if(e0) e0->next = e; - + e->text.s = p; while(is_in_str(p,in) && *p!=PV_MARKER) p++; e->text.len = p - e->text.s; - + if(*p == '\0' || !is_in_str(p,in)) break; s.s = p; @@ -1095,7 +1095,7 @@ int pv_parse_format(str *in, pv_elem_p *el) if(e->spec==NULL) goto error; p0 = p + len; - + if(p0==NULL) goto error; if(*p0 == '\0') @@ -1189,7 +1189,7 @@ int pv_parse_avp_name(pv_spec_p sp, str *in) } /*LM_DBG("static name [%.*s]\n", in->len, in->s);*/ if(km_parse_avp_spec(in, &sp->pvp.pvn.u.isname.type, - &sp->pvp.pvn.u.isname.name)!=0) + &sp->pvp.pvn.u.isname.name)!=0) { LM_ERR("bad avp name [%.*s]\n", in->len, in->s); return -1; @@ -1236,7 +1236,7 @@ int pv_get_avp_name(struct sip_msg* msg, pv_param_p ip, int_str *avp_name, LM_ERR("null or empty name\n"); return -1; } - + if((tv.flags&PV_TYPE_INT) && (tv.flags&PV_VAL_INT)) { avp_name->n = tv.ri; @@ -1301,13 +1301,13 @@ int pv_get_spec_value(struct sip_msg* msg, pv_spec_p sp, pv_value_t *value) LM_ERR("bad parameters\n"); return -1; } - + memset(value, 0, sizeof(pv_value_t)); ret = (*sp->getf)(msg, &(sp->pvp), value); if(ret!=0) return ret; - + if(sp->trans) return tr_exec(msg, (trans_t*)sp->trans, value); return ret; @@ -1335,7 +1335,7 @@ int pv_printf(struct sip_msg* msg, pv_elem_p list, char *buf, int *len) pv_value_t tok; pv_elem_p it; char *cur; - + if(msg==NULL || list==NULL || buf==NULL || len==NULL) return -1; @@ -1344,7 +1344,7 @@ int pv_printf(struct sip_msg* msg, pv_elem_p list, char *buf, int *len) *buf = '\0'; cur = buf; - + n = 0; for (it=list; it; it=it->next) { @@ -1383,7 +1383,7 @@ int pv_printf(struct sip_msg* msg, pv_elem_p list, char *buf, int *len) } goto done; - + overflow: LM_ERR("buffer overflow -- increase the buffer size...\n"); return -1; @@ -1572,14 +1572,14 @@ char* tr_lookup(str *in, trans_t **tr) char *p; char *p0; str tclass; - tr_export_t *te = NULL; + tr_export_t *te = NULL; trans_t *t = NULL; trans_t *t0 = NULL; str s; if(in==NULL || in->s==NULL || tr==NULL) return NULL; - + p = in->s; do { while(is_in_str(p, in) && (*p==' ' || *p=='\t' || *p=='\n')) p++; @@ -1675,7 +1675,7 @@ int tr_exec(struct sip_msg *msg, trans_t *t, pv_value_t *v) LM_DBG("invalid parameters\n"); return -1; } - + for(i = t; i!=NULL; i=i->next) { r = (*i->trf)(msg, i->params, i->subtype, v); @@ -1758,7 +1758,7 @@ int tr_table_add(tr_export_t *e) LM_ERR("invalid parameters\n"); return -1; } - + if(_tr_table_set==0) { LM_DBG("TR table not initialized, doing it now\n"); @@ -1853,7 +1853,7 @@ int tr_table_free(void) } memset(_tr_table, 0, sizeof(tr_item_t*)*TR_TABLE_SIZE); _tr_table_set = 0; - + return 0; } diff --git a/pvar.h b/pvar.h index 8cc84887a2c..6ad3d8cc14f 100644 --- a/pvar.h +++ b/pvar.h @@ -13,8 +13,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -70,8 +70,8 @@ && (pv)->pvp.pvn.u.isname.type&AVP_NAME_STR) #define pv_is_w(pv) ((pv)->setf!=NULL) -enum _pv_type { - PVT_NONE=0, PVT_EMPTY, PVT_NULL, +enum _pv_type { + PVT_NONE=0, PVT_EMPTY, PVT_NULL, PVT_MARKER, PVT_AVP, PVT_HDR, PVT_RURI, PVT_RURI_USERNAME, PVT_RURI_DOMAIN, PVT_DSTURI, PVT_COLOR, PVT_BRANCH, @@ -280,7 +280,7 @@ typedef struct _trans { typedef char* (*tr_parsef_t)(str *, trans_t *); typedef struct _tr_export { str tclass; - tr_parsef_t tparse; + tr_parsef_t tparse; } tr_export_t, *tr_export_p; char* tr_lookup(str *in, trans_t **tr); diff --git a/receive.c b/receive.c index 1c65266e4bd..0904de13b63 100644 --- a/receive.c +++ b/receive.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2001-2003 FhG Fokus * * This file is part of Kamailio, a free SIP server. @@ -13,15 +13,15 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ /*! * \file - * \brief Kamailio core :: + * \brief Kamailio core :: * \ingroup core * Module: \ref core */ @@ -109,17 +109,17 @@ int sip_check_fline(char* buf, unsigned int len) } /** Receive message - * WARNING: buf must be 0 terminated (buf[len]=0) or some things might + * WARNING: buf must be 0 terminated (buf[len]=0) or some things might * break (e.g.: modules/textops) */ -int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info) +int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info) { struct sip_msg* msg; struct run_act_ctx ctx; int ret; #ifdef STATS int skipped = 1; - struct timeval tvb, tve; + struct timeval tvb, tve; struct timezone tz; unsigned int diff; #endif @@ -155,14 +155,14 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info) msg->buf=buf; msg->len=len; /* zero termination (termination of orig message bellow not that - useful as most of the work is done with scratch-pad; -jiri */ + * useful as most of the work is done with scratch-pad; -jiri */ /* buf[len]=0; */ /* WARNING: zero term removed! */ msg->rcv=*rcv_info; msg->id=msg_no; msg->pid=my_pid(); msg->set_global_address=default_global_address; msg->set_global_port=default_global_port; - + if(likely(sr_msg_time==1)) msg_set_time(msg); if (parse_msg(buf,len, msg)!=0){ @@ -202,7 +202,7 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info) /* check if necessary to add receive?->moved to forward_req */ /* check for the alias stuff */ #ifdef USE_TCP - if (msg->via1->alias && cfg_get(tcp, tcp_cfg, accept_aliases) && + if (msg->via1->alias && cfg_get(tcp, tcp_cfg, accept_aliases) && (((rcv_info->proto==PROTO_TCP) && !tcp_disable) #ifdef USE_TLS || ((rcv_info->proto==PROTO_TLS) && !tls_disable) @@ -224,10 +224,10 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info) #endif /* execute pre-script callbacks, if any; -jiri */ /* if some of the callbacks said not to continue with - script processing, don't do so - if we are here basic sanity checks are already done - (like presence of at least one via), so you can count - on via1 being parsed in a pre-script callback --andrei + * script processing, don't do so + * if we are here basic sanity checks are already done + * (like presence of at least one via), so you can count + * on via1 being parsed in a pre-script callback --andrei */ if (exec_pre_script_cb(msg, REQUEST_CB_TYPE)==0 ) { @@ -266,13 +266,13 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info) gettimeofday( & tvb, &tz ); STATS_RX_RESPONSE ( msg->first_line.u.reply.statuscode / 100 ); #endif - + /* execute pre-script callbacks, if any; -jiri */ /* if some of the callbacks said not to continue with - script processing, don't do so - if we are here basic sanity checks are already done - (like presence of at least one via), so you can count - on via1 being parsed in a pre-script callback --andrei + * script processing, don't do so + * if we are here basic sanity checks are already done + * (like presence of at least one via), so you can count + * on via1 being parsed in a pre-script callback --andrei */ if (exec_pre_script_cb(msg, ONREPLY_CB_TYPE)==0 ) { diff --git a/resolve.c b/resolve.c index 0af1be3eb9e..3d574182e9f 100644 --- a/resolve.c +++ b/resolve.c @@ -1335,7 +1335,7 @@ struct hostent* srv_sip_resolvehost(str* name, int zt, unsigned short* port, -#ifdef USE_NAPTR +#ifdef USE_NAPTR /** iterates over a naptr rr list, returning each time a "good" naptr record @@ -1343,7 +1343,7 @@ struct hostent* srv_sip_resolvehost(str* name, int zt, unsigned short* port, * params: * naptr_head - naptr rr list head * tried - bitmap used to keep track of the already tried records - * (no more then sizeof(tried)*8 valid records are + * (no more then sizeof(tried)*8 valid records are * ever walked * srv_name - if succesfull, it will be set to the selected record * srv name (naptr repl.) @@ -1351,10 +1351,10 @@ struct hostent* srv_sip_resolvehost(str* name, int zt, unsigned short* port, * protocol * returns 0 if no more records found or a pointer to the selected record * and sets protocol and srv_name - * WARNING: when calling first time make sure you run first + * WARNING: when calling first time make sure you run first * naptr_iterate_init(&tried) */ -struct rdata* naptr_sip_iterate(struct rdata* naptr_head, +struct rdata* naptr_sip_iterate(struct rdata* naptr_head, naptr_bmp_t* tried, str* srv_name, char* proto) { @@ -1373,7 +1373,7 @@ struct rdata* naptr_sip_iterate(struct rdata* naptr_head, saved_proto=0; i=0; for(l=naptr_head; l && (inext){ - if (l->type!=T_NAPTR) continue; + if (l->type!=T_NAPTR) continue; naptr=(struct naptr_rdata*) l->rdata; if (naptr==0){ LM_CRIT("null rdata\n"); @@ -1391,17 +1391,18 @@ struct rdata* naptr_sip_iterate(struct rdata* naptr_head, #endif if ((naptr_proto_supported(naptr_proto))){ if (naptr_choose(&naptr_saved, &saved_proto, - naptr, naptr_proto)) + naptr, naptr_proto)) { idx=i; l_saved=l; } + } i++; } if (naptr_saved){ /* found something */ #ifdef NAPTR_DBG LM_DBG("choosed NAPTR rr %.*s, proto %d tried: 0x%x\n", - naptr_saved->repl_len, + naptr_saved->repl_len, naptr_saved->repl, (int)saved_proto, *tried); #endif *tried|=1< /* fake sched_yield */ -#ifndef sched_yield() +#ifndef sched_yield #define sched_yield() sleep(0) #endif #endif diff --git a/socket_info.c b/socket_info.c index d06fdcfd2c8..ee48e11d8e6 100644 --- a/socket_info.c +++ b/socket_info.c @@ -1205,13 +1205,21 @@ int add_interfaces(char* if_name, int family, unsigned short port, for (ifa = ifap; ifa; ifa = ifa->ifa_next) { + /* skip if no IP addr associated with the interface */ + if (ifa->ifa_addr==0) + continue; +#ifdef AF_PACKET + /* skip AF_PACKET addr family since it is of no use later on */ + if (ifa->ifa_addr->sa_family == AF_PACKET) + continue; +#endif if (if_name && strcmp(if_name, ifa->ifa_name)) continue; if (family && family != ifa->ifa_addr->sa_family) continue; sockaddr2ip_addr(&addr, (struct sockaddr*)ifa->ifa_addr); tmp=ip_addr2a(&addr); - if (ifa->ifa_flags & IFF_LOOPBACK) + if (ifa->ifa_flags & IFF_LOOPBACK) flags = SI_IS_LO; else flags = SI_NONE; @@ -1398,8 +1406,8 @@ static int fix_socket_list(struct socket_info **list, int* type_flags) for (si=*list;si;){ next=si->next; ai_lst=0; - if (add_interfaces(si->name.s, 0, si->port_no, - si->proto, &ai_lst)!=-1){ + if (add_interfaces(si->name.s, auto_bind_ipv6 ? 0 : AF_INET, + si->port_no, si->proto, &ai_lst)!=-1){ if (si->flags & SI_IS_MHOMED){ if((new_si=new_sock2list_after(ai_lst->name.s, 0, si->port_no, si->proto, si->useinfo.name.s, diff --git a/socket_info.h b/socket_info.h index eec9dd4749e..03225acb6df 100644 --- a/socket_info.h +++ b/socket_info.h @@ -44,6 +44,8 @@ int socket2str(char* s, int* len, struct socket_info* si); int socketinfo2str(char* s, int* len, struct socket_info* si, int mode); +/* Helper macro that results in the default port based on the protocol */ +#define proto_default_port(proto) ((proto==PROTO_TLS)?SIPS_PORT:SIP_PORT) /* struct socket_info is defined in ip_addr.h */ diff --git a/sr_module.h b/sr_module.h index 6eb42fb6227..e42ccdf1dd3 100644 --- a/sr_module.h +++ b/sr_module.h @@ -208,7 +208,7 @@ struct ser_cmd_export_ { int param_no; /**< number of parameters used by the function */ fixup_function fixup; /**< pointer to the function called to "fix" the parameters */ - int flags; /**< Function flags */ + unsigned int flags; /**< Function flags */ }; @@ -221,7 +221,7 @@ struct kam_cmd_export_ { parameters */ free_fixup_function free_fixup; /**< function called to free the "fixed" parameters */ - int flags; /**< Function flags */ + unsigned int flags; /**< Function flags */ }; /** sip-router version */ @@ -233,8 +233,8 @@ struct sr31_cmd_export_ { parameters */ free_fixup_function free_fixup; /**< function called to free the "fixed" parameters */ - int flags; /**< Function flags */ - int fixup_flags; + unsigned int flags; /**< Function flags */ + unsigned int fixup_flags; void* module_exports; /**< pointer to module structure */ }; diff --git a/srapi.c b/srapi.c index a84762e7b08..e01659b15e9 100644 --- a/srapi.c +++ b/srapi.c @@ -44,3 +44,24 @@ sr_generate_callid_f sr_get_callid_func(void) { return _sr_generate_callid_func; } + +/** + * + */ +static sr_cfgenv_t _sr_cfgenv; + +/** + * + */ +void sr_cfgenv_init(void) +{ + memset(&_sr_cfgenv, 0, sizeof(sr_cfgenv_t)); +} + +/** + * + */ +sr_cfgenv_t* sr_cfgenv_get(void) +{ + return &_sr_cfgenv; +} diff --git a/srapi.h b/srapi.h index e0f7867ee5f..d480fbfa268 100644 --- a/srapi.h +++ b/srapi.h @@ -20,6 +20,7 @@ #define __SRAPI_H__ #include "str.h" +#include "parser/msg_parser.h" typedef void (*sr_generate_callid_f)(str*); @@ -27,4 +28,12 @@ int sr_register_callid_func(sr_generate_callid_f f); sr_generate_callid_f sr_get_callid_func(void); +typedef int (*sr_cseq_update_f)(sip_msg_t*); +typedef struct sr_cfgenv { + sr_cseq_update_f cb_cseq_update; +} sr_cfgenv_t; + +void sr_cfgenv_init(void); +sr_cfgenv_t* sr_cfgenv_get(void); + #endif diff --git a/str.c b/str.c index c9c4d3325ce..fda76c90593 100644 --- a/str.c +++ b/str.c @@ -1,5 +1,6 @@ /* * + * Copyright (C) 2015 kamailio.org * Copyright (C) 2014 Victor Seva * * This file is part of kamailio, a free SIP server. @@ -48,3 +49,53 @@ int str_append(str *orig, str *suffix, str *dest) memcpy(dest->s+orig->len, suffix->s, suffix->len); return 0; } + +/* +* Find the first occurrence of find in s, where the search is limited to the +* first slen characters of s. +*/ +char * _strnstr(const char* s, const char* find, size_t slen) +{ + char c, sc; + size_t len; + + if ((c = *find++) != '\0') { + len = strlen(find); + do { + do { + if (slen-- < 1 || (sc = *s++) == '\0') + return (NULL); + } while (sc != c); + if (len > slen) + return (NULL); + } while (strncmp(s, find, len) != 0); + s--; + } + return ((char *)s); +} + +/* + * Find the first case insensitive occurrence of find in s, where the + * search is limited to the first slen characters of s. + * Based on FreeBSD strnstr. + */ +char* _strnistr(const char *s, const char *find, size_t slen) +{ + char c, sc; + size_t len; + + if ((c = *find++) != '\0') { + len = strlen(find); + do { + do { + if ((sc = *s++) == '\0' || slen-- < 1) + return (NULL); + } while (sc != c); + if (len > slen) + return (NULL); + } while (strncasecmp(s, find, len) != 0); + s--; + } + return ((char *)s); +} + diff --git a/str.h b/str.h index 9ef8809b9ca..de226c7b9e5 100644 --- a/str.h +++ b/str.h @@ -21,6 +21,8 @@ #ifndef str_h #define str_h +#include + /** @defgroup str_string Counted-Length Strings * @{ * @@ -125,4 +127,7 @@ typedef struct _str str; */ int str_append(str *orig, str *suffix, str *dest); +char* _strnstr(const char *s, const char *find, size_t slen); +char* _strnistr(const char *s, const char *find, size_t slen); + #endif diff --git a/tcp_main.c b/tcp_main.c index 578f7d27a60..5b647e17cd5 100644 --- a/tcp_main.c +++ b/tcp_main.c @@ -2707,7 +2707,7 @@ int tcp_init(struct socket_info* sock_info) } } #endif - + addr=&sock_info->su; /* sock_info->proto=PROTO_TCP; */ if (init_su(addr, &sock_info->address, sock_info->port_no)<0){ @@ -2749,10 +2749,18 @@ int tcp_init(struct socket_info* sock_info) #endif /* tos */ optval = tos; - if (setsockopt(sock_info->socket, IPPROTO_IP, IP_TOS, (void*)&optval, - sizeof(optval)) ==-1){ - LM_WARN("setsockopt tos: %s\n", strerror(errno)); - /* continue since this is not critical */ + if(sock_info->address.af==AF_INET){ + if (setsockopt(sock_info->socket, IPPROTO_IP, IP_TOS, (void*)&optval, + sizeof(optval)) ==-1){ + LM_WARN("setsockopt tos: %s (%d)\n", strerror(errno), tos); + /* continue since this is not critical */ + } + } else if(sock_info->address.af==AF_INET6){ + if (setsockopt(sock_info->socket, IPPROTO_IPV6, IPV6_TCLASS, + (void*)&optval, sizeof(optval)) ==-1) { + LM_WARN("setsockopt v6 tos: %s (%d)\n", strerror(errno), tos); + /* continue since this is not critical */ + } } #ifdef HAVE_TCP_DEFER_ACCEPT /* linux only */ diff --git a/tcp_read.c b/tcp_read.c index 84ddf90ffc3..5590f921ba9 100644 --- a/tcp_read.c +++ b/tcp_read.c @@ -287,11 +287,10 @@ int tcp_read_data(int fd, struct tcp_connection *c, } } LOG(cfg_get(core, core_cfg, corelog), - "error reading: %s (%d) ([%s]:%u -> [%s]:%u)\n", + "error reading: %s (%d) ([%s]:%u ->", strerror(errno), errno, - ip_addr2a(&c->rcv.src_ip), c->rcv.src_port, - ip_addr2a(&c->rcv.dst_ip), c->rcv.dst_port); - + ip_addr2a(&c->rcv.src_ip), c->rcv.src_port); + LOG(cfg_get(core, core_cfg, corelog),"-> [%s]:%u)\n", ip_addr2a(&c->rcv.dst_ip), c->rcv.dst_port); if((errno == ECONNRESET || errno == ETIMEDOUT) && likely(c->rcv.proto_reserved1 != 0)){ tcp_make_closed_event(&c->rcv, c); } @@ -305,9 +304,8 @@ int tcp_read_data(int fd, struct tcp_connection *c, if (likely(c->rcv.proto_reserved1 != 0)){ tcp_make_closed_event(&c->rcv, c); } - LM_DBG("EOF on %p, FD %d ([%s]:%u -> [%s]:%u)\n", c, fd, - ip_addr2a(&c->rcv.src_ip), c->rcv.src_port, - ip_addr2a(&c->rcv.dst_ip), c->rcv.dst_port); + LM_DBG("EOF on %p, FD %d ([%s]:%u ->", c, fd, ip_addr2a(&c->rcv.src_ip), c->rcv.src_port); + LM_DBG("-> [%s]:%u)\n", ip_addr2a(&c->rcv.dst_ip), c->rcv.dst_port); }else{ if (unlikely(c->state==S_CONN_CONNECT || c->state==S_CONN_ACCEPT)){ TCP_STATS_ESTABLISHED(c->state); @@ -1302,7 +1300,7 @@ int tcp_read_req(struct tcp_connection* con, int* bytes_read, int* read_flags) struct dest_info dst; char c; int ret; - + bytes=-1; total_bytes=0; resp=CONN_RELEASE; @@ -1316,6 +1314,15 @@ int tcp_read_req(struct tcp_connection* con, int* bytes_read, int* read_flags) else #endif bytes=tcp_read_headers(con, read_flags); + + if (unlikely(bytes==-1)){ + LOG(cfg_get(core, core_cfg, corelog), + "ERROR: tcp_read_req: error reading - c: %p r: %p\n", + con, req); + resp=CONN_ERROR; + goto end_req; + } + #ifdef EXTRA_DEBUG /* if timeout state=0; goto end__req; */ LM_DBG("read= %d bytes, parsed=%d, state=%d, error=%d\n", @@ -1325,19 +1332,13 @@ int tcp_read_req(struct tcp_connection* con, int* bytes_read, int* read_flags) *(req->parsed-1), (int)(req->parsed-req->start), req->start); #endif - if (unlikely(bytes==-1)){ - LOG(cfg_get(core, core_cfg, corelog), - "ERROR: tcp_read_req: error reading \n"); - resp=CONN_ERROR; - goto end_req; - } total_bytes+=bytes; /* eof check: * is EOF if eof on fd and req. not complete yet, * if req. is complete we might have a second unparsed * request after it, so postpone release_with_eof */ - if (unlikely((con->state==S_CONN_EOF) && + if (unlikely((con->state==S_CONN_EOF) && (! TCP_REQ_COMPLETE(req)))) { LM_DBG("EOF\n"); resp=CONN_EOF; @@ -1345,10 +1346,19 @@ int tcp_read_req(struct tcp_connection* con, int* bytes_read, int* read_flags) } } if (unlikely(req->error!=TCP_REQ_OK)){ - LM_ERR("bad request, state=%d, error=%d buf:\n%.*s\nparsed:\n%.*s\n", + if(req->buf!=NULL && req->start!=NULL && req->pos!=NULL + && req->pos>=req->buf && req->parsed>=req->start) { + LM_ERR("bad request, state=%d, error=%d buf:\n%.*s\nparsed:\n%.*s\n", req->state, req->error, (int)(req->pos-req->buf), req->buf, (int)(req->parsed-req->start), req->start); + } else { + LM_ERR("bad request, state=%d, error=%d buf:%d - %p," + " parsed:%d - %p\n", + req->state, req->error, + (int)(req->pos-req->buf), req->buf, + (int)(req->parsed-req->start), req->start); + } LM_DBG("received from: port %d\n", con->rcv.src_port); print_ip("received from: ip", &con->rcv.src_ip, "\n"); resp=CONN_ERROR; diff --git a/test/travis/build_travis.sh b/test/travis/build_travis.sh index 1d0944e39a3..44a0ffe3f1f 100755 --- a/test/travis/build_travis.sh +++ b/test/travis/build_travis.sh @@ -17,13 +17,26 @@ else rm -rf /code/debian ln -s /code/pkg/kamailio/deb/"${DIST}" /code/debian fi -function build { + +function _clean { echo "make clean" make -f debian/rules clean +} + +function _build { echo "make build" make -f debian/rules build } +function _install { + if [[ "$CC" =~ gcc ]] ; then + echo "make install" + make install + else + echo "skip make install step" + fi +} + if [[ "${CC}" =~ clang ]] ; then CLANG=$(find /usr/bin -type l -name 'clang-[0-9]*' | sort -r | head -1) echo "setting clang to ${CLANG}" @@ -33,18 +46,6 @@ fi echo "environment DIST=$DIST CC=$CC" ${CC} --version -# build flags -export MEMDBG=0 -echo "build with MEMDBG=0" -build - -export MEMDBG=1 -echo "build with MEMDBG=1" -build - -if [[ "$CC" =~ gcc ]] ; then - echo "make install" - make install -else - echo "skip make install step" -fi +_clean +_build +_install diff --git a/tls_hooks.c b/tls_hooks.c index b46a4296296..62ddda2811a 100644 --- a/tls_hooks.c +++ b/tls_hooks.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007 iptelorg GmbH + * Copyright (C) 2007 iptelorg GmbH * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -34,7 +34,7 @@ static int tls_hooks_loaded=0; int register_tls_hooks(struct tls_hooks* h) { - if (!tls_disable){ + if (!tls_disable) { tls_hook=*h; tls_hooks_loaded++; return 0; @@ -47,7 +47,7 @@ int tls_init(struct socket_info* si) { if (tls_hook.init_si) return tls_hook.init_si(si); - return -1; + return -1; } int tls_has_init_si() diff --git a/tls_hooks.h b/tls_hooks.h index 3ac5bd28348..a789a496f4f 100644 --- a/tls_hooks.h +++ b/tls_hooks.h @@ -84,7 +84,7 @@ extern struct tls_hooks tls_hook; #ifdef __SUNPRO_C #define tls_hook_call(name, ret_not_set, ...) \ ((tls_hook.name)?(tls_hook.name(__VA_ARGS__)): (ret_not_set)) - #define tls_hook_call_v(name, __VA_ARGS__) \ + #define tls_hook_call_v(name, ...) \ do{ \ if (tls_hook.name) tls_hook.name(__VA_ARGS__); \ }while(0) diff --git a/trim.h b/trim.h index 4989075a735..baee6a0fb82 100644 --- a/trim.h +++ b/trim.h @@ -105,5 +105,19 @@ static inline void trim(str* _s) for(;(_s_).s[0]==' ';(_s_).s=(_s_).s+1,(_s_).len--); \ \ } while(0); - + +/* + * right and left zero trimming + * + * WARNING: String structure will be modified ! + * Make a copy otherwise you might be + * unable to free _s_->s for example ! + */ +#define trim_zeros_lr(_s_) \ + do{ \ + for(;(_s_)->s[(_s_)->len-1]=='\0';(_s_)->s[--(_s_)->len]=0); \ + for(;(_s_)->s[0]=='\0';(_s_)->s=(_s_)->s+1,(_s_)->len--); \ + \ + } while(0); + #endif /* TRIM_H */ diff --git a/ut.c b/ut.c index 71907b48cf2..9856b722eaf 100644 --- a/ut.c +++ b/ut.c @@ -47,7 +47,7 @@ int user2uid(int* uid, int* gid, char* user) { char* tmp; struct passwd *pw_entry; - + if (user){ *uid=strtol(user, &tmp, 10); if ((tmp==0) ||(*tmp)){ @@ -73,7 +73,7 @@ int group2gid(int* gid, char* group) { char* tmp; struct group *gr_entry; - + if (group){ *gid=strtol(group, &tmp, 10); if ((tmp==0) ||(*tmp)){ @@ -93,7 +93,7 @@ int group2gid(int* gid, char* group) /* * Replacement of timegm (does not exists on all platforms - * Taken from + * Taken from * http://lists.samba.org/archive/samba-technical/2002-November/025737.html */ time_t _timegm(struct tm* t) @@ -111,7 +111,7 @@ time_t _timegm(struct tm* t) } tl += 3600; } - + tg = gmtime(&tl); tg->tm_isdst = 0; tb = mktime(tg); @@ -173,7 +173,7 @@ char* as_asciiz(str* s) /* return system version (major.minor.minor2) as * (major<<16)|(minor)<<8|(minor2) * (if some of them are missing, they are set to 0) - * if the parameters are not null they are set to the coresp. part + * if the parameters are not null they are set to the coresp. part */ unsigned int get_sys_version(int* major, int* minor, int* minor2) { @@ -182,7 +182,7 @@ unsigned int get_sys_version(int* major, int* minor, int* minor2) int m2; int m3; char* p; - + memset (&un, 0, sizeof(un)); m1=m2=m3=0; /* get sys version */ @@ -218,24 +218,24 @@ char* get_abs_pathname(str* base, str* file) str ser_cfg; char* buf, *dir, *res; int len; - + if (base == NULL) { ser_cfg.s = cfg_file; ser_cfg.len = strlen(cfg_file); base = &ser_cfg; } - + if (!base->s || base->len <= 0 || base->s[0] != '/') { BUG("get_abs_pathname: Base file must be absolute pathname: " "'%.*s'\n", STR_FMT(base)); return NULL; } - + if (!file || !file->s || file->len <= 0) { BUG("get_abs_pathname: Invalid 'file' parameter\n"); return NULL; } - + if (file->s[0] == '/') { /* This is an absolute pathname, make a zero terminated * copy and use it as it is */ @@ -257,7 +257,7 @@ char* get_abs_pathname(str* base, str* file) memcpy(buf, base->s, base->len); buf[base->len]=0; dir = dirname(buf); - + len = strlen(dir); if ((res = pkg_malloc(len + 1 + file->len + 1)) == NULL) { ERR("get_abs_pathname: No memory left (pkg_malloc failed)\n"); @@ -321,7 +321,7 @@ void * ser_memmem(const void *b1, const void *b2, size_t len1, size_t len2) if (memcmp(sp, pp, len2) == 0) return sp; - sp++; + sp++; } return NULL; @@ -352,7 +352,7 @@ void * ser_memrmem(const void *b1, const void *b2, size_t len1, size_t len2) if (memcmp(sp, pp, len2) == 0) return sp; - sp--; + sp--; } return NULL; diff --git a/utils/kamcmd/kamcmd.c b/utils/kamcmd/kamcmd.c index 33816312316..4211741deb8 100644 --- a/utils/kamcmd/kamcmd.c +++ b/utils/kamcmd/kamcmd.c @@ -82,7 +82,7 @@ #ifndef UNIX_PATH_MAX -#define UNIX_PATH_MAX 100 +#define UNIX_PATH_MAX 104 #endif static char id[]="$Id$"; diff --git a/utils/kamctl/Makefile b/utils/kamctl/Makefile index efbda6ca34f..5b70ab4e087 100644 --- a/utils/kamctl/Makefile +++ b/utils/kamctl/Makefile @@ -1,4 +1,3 @@ -# $Id$ COREPATH=../.. include $(COREPATH)/Makefile.defs include $(COREPATH)/config.mak diff --git a/utils/kamctl/db_berkeley/kamailio/topos_d b/utils/kamctl/db_berkeley/kamailio/topos_d index 969e5a4367d..5cfb4ab630e 100644 --- a/utils/kamctl/db_berkeley/kamailio/topos_d +++ b/utils/kamctl/db_berkeley/kamailio/topos_d @@ -1,10 +1,10 @@ METADATA_COLUMNS -id(int) rectime(datetime) a_callid(str) a_uuid(str) b_uuid(str) a_contact(str) b_contact(str) as_contact(str) bs_contact(str) a_tag(str) b_tag(str) a_rr(str) b_rr(str) iflags(int) a_uri(str) b_uri(str) r_uri(str) a_srcip(str) b_srcip(str) +id(int) rectime(datetime) s_method(str) s_cseq(str) a_callid(str) a_uuid(str) b_uuid(str) a_contact(str) b_contact(str) as_contact(str) bs_contact(str) a_tag(str) b_tag(str) a_rr(str) b_rr(str) s_rr(str) iflags(int) a_uri(str) b_uri(str) r_uri(str) a_srcaddr(str) b_srcaddr(str) a_socket(str) b_socket(str) METADATA_KEY -2 3 4 +4 5 6 METADATA_READONLY 0 METADATA_LOGFLAGS 0 METADATA_DEFAULTS -NIL|NIL|''|''|''|''|''|''|''|''|''|''|''|0|''|''|''|''|'' +NIL|NIL|''|''|''|''|''|''|''|''|''|''|''|NIL|NIL|NIL|0|''|''|''|''|''|''|'' diff --git a/utils/kamctl/db_berkeley/kamailio/topos_t b/utils/kamctl/db_berkeley/kamailio/topos_t index 42772ee54e4..ff197134c29 100644 --- a/utils/kamctl/db_berkeley/kamailio/topos_t +++ b/utils/kamctl/db_berkeley/kamailio/topos_t @@ -1,10 +1,10 @@ METADATA_COLUMNS -id(int) rectime(datetime) a_callid(str) a_uuid(str) b_uuid(str) direction(int) x_via(str) x_vbranch(str) x_rr(str) x_uri(str) x_tag(str) +id(int) rectime(datetime) s_method(str) s_cseq(str) a_callid(str) a_uuid(str) b_uuid(str) direction(int) x_via(str) x_vbranch(str) x_rr(str) y_rr(str) s_rr(str) x_uri(str) a_contact(str) b_contact(str) as_contact(str) bs_contact(str) x_tag(str) a_tag(str) b_tag(str) a_srcaddr(str) b_srcaddr(str) a_socket(str) b_socket(str) METADATA_KEY -2 3 4 5 7 +4 5 6 7 9 METADATA_READONLY 0 METADATA_LOGFLAGS 0 METADATA_DEFAULTS -NIL|NIL|''|''|''|0|''|''|''|''|'' +NIL|NIL|''|''|''|''|''|0|NIL|''|NIL|NIL|NIL|''|''|''|''|''|''|''|''|''|''|''|'' diff --git a/utils/kamctl/db_sqlite/topos-create.sql b/utils/kamctl/db_sqlite/topos-create.sql index ea2d624e550..d36c5b62ac4 100644 --- a/utils/kamctl/db_sqlite/topos-create.sql +++ b/utils/kamctl/db_sqlite/topos-create.sql @@ -1,6 +1,8 @@ CREATE TABLE topos_d ( id INTEGER PRIMARY KEY NOT NULL, rectime TIMESTAMP WITHOUT TIME ZONE NOT NULL, + s_method VARCHAR(64) DEFAULT '' NOT NULL, + s_cseq VARCHAR(64) DEFAULT '' NOT NULL, a_callid VARCHAR(255) DEFAULT '' NOT NULL, a_uuid VARCHAR(255) DEFAULT '' NOT NULL, b_uuid VARCHAR(255) DEFAULT '' NOT NULL, @@ -8,16 +10,19 @@ CREATE TABLE topos_d ( b_contact VARCHAR(128) DEFAULT '' NOT NULL, as_contact VARCHAR(128) DEFAULT '' NOT NULL, bs_contact VARCHAR(128) DEFAULT '' NOT NULL, - a_tag VARCHAR(64) DEFAULT '' NOT NULL, - b_tag VARCHAR(64) DEFAULT '' NOT NULL, - a_rr TEXT DEFAULT '' NOT NULL, - b_rr TEXT DEFAULT '' NOT NULL, + a_tag VARCHAR(255) DEFAULT '' NOT NULL, + b_tag VARCHAR(255) DEFAULT '' NOT NULL, + a_rr TEXT, + b_rr TEXT, + s_rr TEXT, iflags INTEGER DEFAULT 0 NOT NULL, a_uri VARCHAR(128) DEFAULT '' NOT NULL, b_uri VARCHAR(128) DEFAULT '' NOT NULL, r_uri VARCHAR(128) DEFAULT '' NOT NULL, - a_srcip VARCHAR(50) DEFAULT '' NOT NULL, - b_srcip VARCHAR(50) DEFAULT '' NOT NULL + a_srcaddr VARCHAR(128) DEFAULT '' NOT NULL, + b_srcaddr VARCHAR(128) DEFAULT '' NOT NULL, + a_socket VARCHAR(128) DEFAULT '' NOT NULL, + b_socket VARCHAR(128) DEFAULT '' NOT NULL ); CREATE INDEX topos_d_rectime_idx ON topos_d (rectime); @@ -28,15 +33,29 @@ INSERT INTO version (table_name, table_version) values ('topos_d','1'); CREATE TABLE topos_t ( id INTEGER PRIMARY KEY NOT NULL, rectime TIMESTAMP WITHOUT TIME ZONE NOT NULL, + s_method VARCHAR(64) DEFAULT '' NOT NULL, + s_cseq VARCHAR(64) DEFAULT '' NOT NULL, a_callid VARCHAR(255) DEFAULT '' NOT NULL, a_uuid VARCHAR(255) DEFAULT '' NOT NULL, b_uuid VARCHAR(255) DEFAULT '' NOT NULL, direction INTEGER DEFAULT 0 NOT NULL, - x_via TEXT DEFAULT '' NOT NULL, + x_via TEXT, x_vbranch VARCHAR(255) DEFAULT '' NOT NULL, - x_rr TEXT DEFAULT '' NOT NULL, + x_rr TEXT, + y_rr TEXT, + s_rr TEXT, x_uri VARCHAR(128) DEFAULT '' NOT NULL, - x_tag VARCHAR(64) DEFAULT '' NOT NULL + a_contact VARCHAR(128) DEFAULT '' NOT NULL, + b_contact VARCHAR(128) DEFAULT '' NOT NULL, + as_contact VARCHAR(128) DEFAULT '' NOT NULL, + bs_contact VARCHAR(128) DEFAULT '' NOT NULL, + x_tag VARCHAR(255) DEFAULT '' NOT NULL, + a_tag VARCHAR(255) DEFAULT '' NOT NULL, + b_tag VARCHAR(255) DEFAULT '' NOT NULL, + a_srcaddr VARCHAR(128) DEFAULT '' NOT NULL, + b_srcaddr VARCHAR(128) DEFAULT '' NOT NULL, + a_socket VARCHAR(128) DEFAULT '' NOT NULL, + b_socket VARCHAR(128) DEFAULT '' NOT NULL ); CREATE INDEX topos_t_rectime_idx ON topos_t (rectime); diff --git a/utils/kamctl/db_sqlite/usrloc-create.sql b/utils/kamctl/db_sqlite/usrloc-create.sql index 50f6894b35b..6cbfbdd217d 100644 --- a/utils/kamctl/db_sqlite/usrloc-create.sql +++ b/utils/kamctl/db_sqlite/usrloc-create.sql @@ -22,12 +22,12 @@ CREATE TABLE location ( connection_id INTEGER DEFAULT 0 NOT NULL, keepalive INTEGER DEFAULT 0 NOT NULL, partition INTEGER DEFAULT 0 NOT NULL, - CONSTRAINT location_ruid_idx UNIQUE (ruid), - CONSTRAINT location_connection_idx UNIQUE (server_id, connection_id) + CONSTRAINT location_ruid_idx UNIQUE (ruid) ); CREATE INDEX location_account_contact_idx ON location (username, domain, contact); CREATE INDEX location_expires_idx ON location (expires); +CREATE INDEX location_connection_idx ON location (server_id, connection_id); INSERT INTO version (table_name, table_version) values ('location','8'); diff --git a/utils/kamctl/dbtext/kamailio/topos_d b/utils/kamctl/dbtext/kamailio/topos_d index f2cb97b729f..aa4edb0ac14 100644 --- a/utils/kamctl/dbtext/kamailio/topos_d +++ b/utils/kamctl/dbtext/kamailio/topos_d @@ -1 +1 @@ -id(int,auto) rectime(int) a_callid(string) a_uuid(string) b_uuid(string) a_contact(string) b_contact(string) as_contact(string) bs_contact(string) a_tag(string) b_tag(string) a_rr(string) b_rr(string) iflags(int) a_uri(string) b_uri(string) r_uri(string) a_srcip(string) b_srcip(string) +id(int,auto) rectime(int) s_method(string) s_cseq(string) a_callid(string) a_uuid(string) b_uuid(string) a_contact(string) b_contact(string) as_contact(string) bs_contact(string) a_tag(string) b_tag(string) a_rr(string,null) b_rr(string,null) s_rr(string,null) iflags(int) a_uri(string) b_uri(string) r_uri(string) a_srcaddr(string) b_srcaddr(string) a_socket(string) b_socket(string) diff --git a/utils/kamctl/dbtext/kamailio/topos_t b/utils/kamctl/dbtext/kamailio/topos_t index cab00af6457..c74edbb62a0 100644 --- a/utils/kamctl/dbtext/kamailio/topos_t +++ b/utils/kamctl/dbtext/kamailio/topos_t @@ -1 +1 @@ -id(int,auto) rectime(int) a_callid(string) a_uuid(string) b_uuid(string) direction(int) x_via(string) x_vbranch(string) x_rr(string) x_uri(string) x_tag(string) +id(int,auto) rectime(int) s_method(string) s_cseq(string) a_callid(string) a_uuid(string) b_uuid(string) direction(int) x_via(string,null) x_vbranch(string) x_rr(string,null) y_rr(string,null) s_rr(string,null) x_uri(string) a_contact(string) b_contact(string) as_contact(string) bs_contact(string) x_tag(string) a_tag(string) b_tag(string) a_srcaddr(string) b_srcaddr(string) a_socket(string) b_socket(string) diff --git a/utils/kamctl/kamctl.base b/utils/kamctl/kamctl.base index bd2817b5c27..fba5784e825 100644 --- a/utils/kamctl/kamctl.base +++ b/utils/kamctl/kamctl.base @@ -1,6 +1,4 @@ # -# $Id$ -# # control tool for maintaining Kamailio # #=================================================================== diff --git a/utils/kamctl/kamctl.ctlbase b/utils/kamctl/kamctl.ctlbase index a605b100900..a668e22d18a 100644 --- a/utils/kamctl/kamctl.ctlbase +++ b/utils/kamctl/kamctl.ctlbase @@ -1,6 +1,4 @@ # -# $Id$ -# # control tool for maintaining Kamailio # #=================================================================== diff --git a/utils/kamctl/kamctl.db_berkeley b/utils/kamctl/kamctl.db_berkeley index 8eaf80aab01..c8b77ec16fe 100644 --- a/utils/kamctl/kamctl.db_berkeley +++ b/utils/kamctl/kamctl.db_berkeley @@ -1,10 +1,6 @@ -# $Id$ # # control tool for maintaining Kamailio # -# History: -# -------- -# 2007-11-05 genesis (wiquan) #=================================================================== diff --git a/utils/kamctl/kamctl.dbtext b/utils/kamctl/kamctl.dbtext index 0c1ac9aa923..2198d30db24 100644 --- a/utils/kamctl/kamctl.dbtext +++ b/utils/kamctl/kamctl.dbtext @@ -1,4 +1,3 @@ -# $Id$ # # control tool for maintaining Kamailio # diff --git a/utils/kamctl/kamctl.fifo b/utils/kamctl/kamctl.fifo index c94a5cc724c..b71c5fcfc77 100644 --- a/utils/kamctl/kamctl.fifo +++ b/utils/kamctl/kamctl.fifo @@ -1,5 +1,4 @@ # -# $Id$ # # control tool for maintaining Kamailio # diff --git a/utils/kamctl/kamctl.mysql b/utils/kamctl/kamctl.mysql index 1b25d2ae2a9..7fda5e7f44c 100644 --- a/utils/kamctl/kamctl.mysql +++ b/utils/kamctl/kamctl.mysql @@ -1,5 +1,4 @@ # -# $Id$ # # control tool for maintaining Kamailio # diff --git a/utils/kamctl/kamctl.oracle b/utils/kamctl/kamctl.oracle index f602404d6e1..edf70b76f20 100644 --- a/utils/kamctl/kamctl.oracle +++ b/utils/kamctl/kamctl.oracle @@ -1,7 +1,5 @@ #!/bin/sh # -# $Id$ -# # control tool for maintaining Kamailio # #=================================================================== diff --git a/utils/kamctl/kamctl.pgsql b/utils/kamctl/kamctl.pgsql index 7112d396281..60cbd92f06b 100644 --- a/utils/kamctl/kamctl.pgsql +++ b/utils/kamctl/kamctl.pgsql @@ -1,5 +1,4 @@ # -# $Id$ # # control tool for maintaining Kamailio # diff --git a/utils/kamctl/kamctl.ser b/utils/kamctl/kamctl.ser index 25f226449b6..045709e51b0 100644 --- a/utils/kamctl/kamctl.ser +++ b/utils/kamctl/kamctl.ser @@ -1,5 +1,4 @@ # -# $Id$ # # control tool for maintaining Kamailio # diff --git a/utils/kamctl/kamctl.ser_mi b/utils/kamctl/kamctl.ser_mi index 13f1117694d..acb0f2655bb 100644 --- a/utils/kamctl/kamctl.ser_mi +++ b/utils/kamctl/kamctl.ser_mi @@ -1,5 +1,4 @@ # -# $Id$ # # control tool for maintaining Kamailio # diff --git a/utils/kamctl/kamctl.sqlbase b/utils/kamctl/kamctl.sqlbase index 06481e77522..2aef9801afe 100644 --- a/utils/kamctl/kamctl.sqlbase +++ b/utils/kamctl/kamctl.sqlbase @@ -1,5 +1,4 @@ # -# $Id$ # # control tool for maintaining Kamailio # diff --git a/utils/kamctl/kamctl.sqlite b/utils/kamctl/kamctl.sqlite index 35cf45a27c5..c2ea07171ce 100644 --- a/utils/kamctl/kamctl.sqlite +++ b/utils/kamctl/kamctl.sqlite @@ -1,5 +1,4 @@ # -# $Id$ # # control tool for maintaining Kamailio # diff --git a/utils/kamctl/kamctl.unixsock b/utils/kamctl/kamctl.unixsock index 4d5d17dd5d6..d82e66042f4 100644 --- a/utils/kamctl/kamctl.unixsock +++ b/utils/kamctl/kamctl.unixsock @@ -1,5 +1,4 @@ # -# $Id$ # # control tool for maintaining Kamailio # diff --git a/utils/kamctl/kamctlrc b/utils/kamctl/kamctlrc index f96cab6f120..c54947a2f18 100644 --- a/utils/kamctl/kamctlrc +++ b/utils/kamctl/kamctlrc @@ -1,5 +1,3 @@ -# $Id$ -# # The Kamailio configuration file for the control tools. # # Here you can set variables used in the kamctl and kamdbctl setup diff --git a/utils/kamctl/kamdbctl.db_berkeley b/utils/kamctl/kamdbctl.db_berkeley index e11e783db5b..8e5b4a60e73 100644 --- a/utils/kamctl/kamdbctl.db_berkeley +++ b/utils/kamctl/kamdbctl.db_berkeley @@ -18,9 +18,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # -# History: -# -------- -# 2007-09-19 genesis (wiquan) # #constants diff --git a/utils/kamctl/kamdbctl.dbtext b/utils/kamctl/kamdbctl.dbtext index bd40e034cb7..8c2019ec3e2 100644 --- a/utils/kamctl/kamdbctl.dbtext +++ b/utils/kamctl/kamdbctl.dbtext @@ -1,4 +1,3 @@ -# $Id$ # # Script for adding and dropping Kamailio DBTEXT tables # diff --git a/utils/kamctl/kamdbctl.mysql b/utils/kamctl/kamdbctl.mysql index dea0d957cac..f8fea39a108 100644 --- a/utils/kamctl/kamdbctl.mysql +++ b/utils/kamctl/kamdbctl.mysql @@ -1,4 +1,3 @@ -# $Id$ # # Script for adding and dropping Kamailio MySQL tables # diff --git a/utils/kamctl/kamdbctl.oracle b/utils/kamctl/kamdbctl.oracle index e074006ce9c..0b65027d66c 100644 --- a/utils/kamctl/kamdbctl.oracle +++ b/utils/kamctl/kamdbctl.oracle @@ -1,5 +1,4 @@ #!/bin/sh -# $Id$ # # Script for adding and dropping Kamailio Oracle tables # diff --git a/utils/kamctl/kamdbctl.pgsql b/utils/kamctl/kamdbctl.pgsql index ae39f62e14c..cf3309c6592 100644 --- a/utils/kamctl/kamdbctl.pgsql +++ b/utils/kamctl/kamdbctl.pgsql @@ -1,4 +1,3 @@ -# $Id$ # # Script for adding and dropping Kamailio Postgres tables # @@ -44,8 +43,10 @@ fi if [ -z "$DBROOTUSER" ]; then DBROOTUSER="postgres" if [ ! -r ~/.pgpass ]; then - merr "~./pgpass does not exist, please create this file and support proper credentials for user postgres." + merr "~/.pgpass does not exist" + merr "create this file and add proper credentials for user postgres" merr "Note: you need at least postgresql>= 7.3" + merr "Hint: .pgpass hostname must match DBHOST" exit 1 fi fi diff --git a/utils/kamctl/kamdbctl.sqlite b/utils/kamctl/kamdbctl.sqlite index 5209493bcb5..4915b81a403 100644 --- a/utils/kamctl/kamdbctl.sqlite +++ b/utils/kamctl/kamdbctl.sqlite @@ -1,4 +1,3 @@ -# $Id$ # # Script for adding and dropping Kamailio sqlite tables # diff --git a/utils/kamctl/kamdbfunc.oracle b/utils/kamctl/kamdbfunc.oracle index 3061991b90c..db71fe42c4e 100644 --- a/utils/kamctl/kamdbfunc.oracle +++ b/utils/kamctl/kamdbfunc.oracle @@ -1,5 +1,4 @@ #!/bin/sh -# $Id$ # # Script for common functions for Oracle engine in Kamailio # diff --git a/utils/kamctl/mysql/topos-create.sql b/utils/kamctl/mysql/topos-create.sql index 5e21bc25007..db305752c64 100644 --- a/utils/kamctl/mysql/topos-create.sql +++ b/utils/kamctl/mysql/topos-create.sql @@ -1,6 +1,8 @@ CREATE TABLE `topos_d` ( `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL, `rectime` DATETIME NOT NULL, + `s_method` VARCHAR(64) DEFAULT '' NOT NULL, + `s_cseq` VARCHAR(64) DEFAULT '' NOT NULL, `a_callid` VARCHAR(255) DEFAULT '' NOT NULL, `a_uuid` VARCHAR(255) DEFAULT '' NOT NULL, `b_uuid` VARCHAR(255) DEFAULT '' NOT NULL, @@ -8,16 +10,19 @@ CREATE TABLE `topos_d` ( `b_contact` VARCHAR(128) DEFAULT '' NOT NULL, `as_contact` VARCHAR(128) DEFAULT '' NOT NULL, `bs_contact` VARCHAR(128) DEFAULT '' NOT NULL, - `a_tag` VARCHAR(64) DEFAULT '' NOT NULL, - `b_tag` VARCHAR(64) DEFAULT '' NOT NULL, - `a_rr` MEDIUMTEXT DEFAULT '' NOT NULL, - `b_rr` MEDIUMTEXT DEFAULT '' NOT NULL, + `a_tag` VARCHAR(255) DEFAULT '' NOT NULL, + `b_tag` VARCHAR(255) DEFAULT '' NOT NULL, + `a_rr` MEDIUMTEXT, + `b_rr` MEDIUMTEXT, + `s_rr` MEDIUMTEXT, `iflags` INT(10) UNSIGNED DEFAULT 0 NOT NULL, `a_uri` VARCHAR(128) DEFAULT '' NOT NULL, `b_uri` VARCHAR(128) DEFAULT '' NOT NULL, `r_uri` VARCHAR(128) DEFAULT '' NOT NULL, - `a_srcip` VARCHAR(50) DEFAULT '' NOT NULL, - `b_srcip` VARCHAR(50) DEFAULT '' NOT NULL + `a_srcaddr` VARCHAR(128) DEFAULT '' NOT NULL, + `b_srcaddr` VARCHAR(128) DEFAULT '' NOT NULL, + `a_socket` VARCHAR(128) DEFAULT '' NOT NULL, + `b_socket` VARCHAR(128) DEFAULT '' NOT NULL ); CREATE INDEX rectime_idx ON topos_d (`rectime`); @@ -28,15 +33,29 @@ INSERT INTO version (table_name, table_version) values ('topos_d','1'); CREATE TABLE `topos_t` ( `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL, `rectime` DATETIME NOT NULL, + `s_method` VARCHAR(64) DEFAULT '' NOT NULL, + `s_cseq` VARCHAR(64) DEFAULT '' NOT NULL, `a_callid` VARCHAR(255) DEFAULT '' NOT NULL, `a_uuid` VARCHAR(255) DEFAULT '' NOT NULL, `b_uuid` VARCHAR(255) DEFAULT '' NOT NULL, `direction` INT DEFAULT 0 NOT NULL, - `x_via` MEDIUMTEXT DEFAULT '' NOT NULL, + `x_via` MEDIUMTEXT, `x_vbranch` VARCHAR(255) DEFAULT '' NOT NULL, - `x_rr` MEDIUMTEXT DEFAULT '' NOT NULL, + `x_rr` MEDIUMTEXT, + `y_rr` MEDIUMTEXT, + `s_rr` MEDIUMTEXT, `x_uri` VARCHAR(128) DEFAULT '' NOT NULL, - `x_tag` VARCHAR(64) DEFAULT '' NOT NULL + `a_contact` VARCHAR(128) DEFAULT '' NOT NULL, + `b_contact` VARCHAR(128) DEFAULT '' NOT NULL, + `as_contact` VARCHAR(128) DEFAULT '' NOT NULL, + `bs_contact` VARCHAR(128) DEFAULT '' NOT NULL, + `x_tag` VARCHAR(255) DEFAULT '' NOT NULL, + `a_tag` VARCHAR(255) DEFAULT '' NOT NULL, + `b_tag` VARCHAR(255) DEFAULT '' NOT NULL, + `a_srcaddr` VARCHAR(128) DEFAULT '' NOT NULL, + `b_srcaddr` VARCHAR(128) DEFAULT '' NOT NULL, + `a_socket` VARCHAR(128) DEFAULT '' NOT NULL, + `b_socket` VARCHAR(128) DEFAULT '' NOT NULL ); CREATE INDEX rectime_idx ON topos_t (`rectime`); diff --git a/utils/kamctl/mysql/usrloc-create.sql b/utils/kamctl/mysql/usrloc-create.sql index f7edfbb3b44..a300661f965 100644 --- a/utils/kamctl/mysql/usrloc-create.sql +++ b/utils/kamctl/mysql/usrloc-create.sql @@ -22,12 +22,12 @@ CREATE TABLE `location` ( `connection_id` INT(11) DEFAULT 0 NOT NULL, `keepalive` INT(11) DEFAULT 0 NOT NULL, `partition` INT(11) DEFAULT 0 NOT NULL, - CONSTRAINT ruid_idx UNIQUE (`ruid`), - CONSTRAINT connection_idx UNIQUE (`server_id`, `connection_id`) + CONSTRAINT ruid_idx UNIQUE (`ruid`) ); CREATE INDEX account_contact_idx ON location (`username`, `domain`, `contact`); CREATE INDEX expires_idx ON location (`expires`); +CREATE INDEX connection_idx ON location (`server_id`, `connection_id`); INSERT INTO version (table_name, table_version) values ('location','8'); diff --git a/utils/kamctl/oracle/topos-create.sql b/utils/kamctl/oracle/topos-create.sql index 1552d5e168d..b0f0aa47d59 100644 --- a/utils/kamctl/oracle/topos-create.sql +++ b/utils/kamctl/oracle/topos-create.sql @@ -1,6 +1,8 @@ CREATE TABLE topos_d ( id NUMBER(10) PRIMARY KEY, rectime DATE, + s_method VARCHAR2(64) DEFAULT '', + s_cseq VARCHAR2(64) DEFAULT '', a_callid VARCHAR2(255) DEFAULT '', a_uuid VARCHAR2(255) DEFAULT '', b_uuid VARCHAR2(255) DEFAULT '', @@ -8,16 +10,19 @@ CREATE TABLE topos_d ( b_contact VARCHAR2(128) DEFAULT '', as_contact VARCHAR2(128) DEFAULT '', bs_contact VARCHAR2(128) DEFAULT '', - a_tag VARCHAR2(64) DEFAULT '', - b_tag VARCHAR2(64) DEFAULT '', - a_rr CLOB DEFAULT '', - b_rr CLOB DEFAULT '', + a_tag VARCHAR2(255) DEFAULT '', + b_tag VARCHAR2(255) DEFAULT '', + a_rr CLOB, + b_rr CLOB, + s_rr CLOB, iflags NUMBER(10) DEFAULT 0 NOT NULL, a_uri VARCHAR2(128) DEFAULT '', b_uri VARCHAR2(128) DEFAULT '', r_uri VARCHAR2(128) DEFAULT '', - a_srcip VARCHAR2(50) DEFAULT '', - b_srcip VARCHAR2(50) DEFAULT '' + a_srcaddr VARCHAR2(128) DEFAULT '', + b_srcaddr VARCHAR2(128) DEFAULT '', + a_socket VARCHAR2(128) DEFAULT '', + b_socket VARCHAR2(128) DEFAULT '' ); CREATE OR REPLACE TRIGGER topos_d_tr @@ -36,15 +41,29 @@ INSERT INTO version (table_name, table_version) values ('topos_d','1'); CREATE TABLE topos_t ( id NUMBER(10) PRIMARY KEY, rectime DATE, + s_method VARCHAR2(64) DEFAULT '', + s_cseq VARCHAR2(64) DEFAULT '', a_callid VARCHAR2(255) DEFAULT '', a_uuid VARCHAR2(255) DEFAULT '', b_uuid VARCHAR2(255) DEFAULT '', direction NUMBER(10) DEFAULT 0 NOT NULL, - x_via CLOB DEFAULT '', + x_via CLOB, x_vbranch VARCHAR2(255) DEFAULT '', - x_rr CLOB DEFAULT '', + x_rr CLOB, + y_rr CLOB, + s_rr CLOB, x_uri VARCHAR2(128) DEFAULT '', - x_tag VARCHAR2(64) DEFAULT '' + a_contact VARCHAR2(128) DEFAULT '', + b_contact VARCHAR2(128) DEFAULT '', + as_contact VARCHAR2(128) DEFAULT '', + bs_contact VARCHAR2(128) DEFAULT '', + x_tag VARCHAR2(255) DEFAULT '', + a_tag VARCHAR2(255) DEFAULT '', + b_tag VARCHAR2(255) DEFAULT '', + a_srcaddr VARCHAR2(128) DEFAULT '', + b_srcaddr VARCHAR2(128) DEFAULT '', + a_socket VARCHAR2(128) DEFAULT '', + b_socket VARCHAR2(128) DEFAULT '' ); CREATE OR REPLACE TRIGGER topos_t_tr diff --git a/utils/kamctl/oracle/usrloc-create.sql b/utils/kamctl/oracle/usrloc-create.sql index 8ab1d98d83a..792322963d7 100644 --- a/utils/kamctl/oracle/usrloc-create.sql +++ b/utils/kamctl/oracle/usrloc-create.sql @@ -22,8 +22,7 @@ CREATE TABLE location ( connection_id NUMBER(10) DEFAULT 0 NOT NULL, keepalive NUMBER(10) DEFAULT 0 NOT NULL, partition NUMBER(10) DEFAULT 0 NOT NULL, - CONSTRAINT location_ruid_idx UNIQUE (ruid), - CONSTRAINT location_connection_idx UNIQUE (server_id, connection_id) + CONSTRAINT location_ruid_idx UNIQUE (ruid) ); CREATE OR REPLACE TRIGGER location_tr @@ -36,6 +35,7 @@ BEGIN map2users('location'); END; / CREATE INDEX location_account_contact_idx ON location (username, domain, contact); CREATE INDEX location_expires_idx ON location (expires); +CREATE INDEX location_connection_idx ON location (server_id, connection_id); INSERT INTO version (table_name, table_version) values ('location','8'); diff --git a/utils/kamctl/postgres/topos-create.sql b/utils/kamctl/postgres/topos-create.sql index 602bcc71463..d98dda3fad4 100644 --- a/utils/kamctl/postgres/topos-create.sql +++ b/utils/kamctl/postgres/topos-create.sql @@ -1,6 +1,8 @@ CREATE TABLE topos_d ( id SERIAL PRIMARY KEY NOT NULL, rectime TIMESTAMP WITHOUT TIME ZONE NOT NULL, + s_method VARCHAR(64) DEFAULT '' NOT NULL, + s_cseq VARCHAR(64) DEFAULT '' NOT NULL, a_callid VARCHAR(255) DEFAULT '' NOT NULL, a_uuid VARCHAR(255) DEFAULT '' NOT NULL, b_uuid VARCHAR(255) DEFAULT '' NOT NULL, @@ -8,16 +10,19 @@ CREATE TABLE topos_d ( b_contact VARCHAR(128) DEFAULT '' NOT NULL, as_contact VARCHAR(128) DEFAULT '' NOT NULL, bs_contact VARCHAR(128) DEFAULT '' NOT NULL, - a_tag VARCHAR(64) DEFAULT '' NOT NULL, - b_tag VARCHAR(64) DEFAULT '' NOT NULL, - a_rr TEXT DEFAULT '' NOT NULL, - b_rr TEXT DEFAULT '' NOT NULL, + a_tag VARCHAR(255) DEFAULT '' NOT NULL, + b_tag VARCHAR(255) DEFAULT '' NOT NULL, + a_rr TEXT, + b_rr TEXT, + s_rr TEXT, iflags INTEGER DEFAULT 0 NOT NULL, a_uri VARCHAR(128) DEFAULT '' NOT NULL, b_uri VARCHAR(128) DEFAULT '' NOT NULL, r_uri VARCHAR(128) DEFAULT '' NOT NULL, - a_srcip VARCHAR(50) DEFAULT '' NOT NULL, - b_srcip VARCHAR(50) DEFAULT '' NOT NULL + a_srcaddr VARCHAR(128) DEFAULT '' NOT NULL, + b_srcaddr VARCHAR(128) DEFAULT '' NOT NULL, + a_socket VARCHAR(128) DEFAULT '' NOT NULL, + b_socket VARCHAR(128) DEFAULT '' NOT NULL ); CREATE INDEX topos_d_rectime_idx ON topos_d (rectime); @@ -28,15 +33,29 @@ INSERT INTO version (table_name, table_version) values ('topos_d','1'); CREATE TABLE topos_t ( id SERIAL PRIMARY KEY NOT NULL, rectime TIMESTAMP WITHOUT TIME ZONE NOT NULL, + s_method VARCHAR(64) DEFAULT '' NOT NULL, + s_cseq VARCHAR(64) DEFAULT '' NOT NULL, a_callid VARCHAR(255) DEFAULT '' NOT NULL, a_uuid VARCHAR(255) DEFAULT '' NOT NULL, b_uuid VARCHAR(255) DEFAULT '' NOT NULL, direction INTEGER DEFAULT 0 NOT NULL, - x_via TEXT DEFAULT '' NOT NULL, + x_via TEXT, x_vbranch VARCHAR(255) DEFAULT '' NOT NULL, - x_rr TEXT DEFAULT '' NOT NULL, + x_rr TEXT, + y_rr TEXT, + s_rr TEXT, x_uri VARCHAR(128) DEFAULT '' NOT NULL, - x_tag VARCHAR(64) DEFAULT '' NOT NULL + a_contact VARCHAR(128) DEFAULT '' NOT NULL, + b_contact VARCHAR(128) DEFAULT '' NOT NULL, + as_contact VARCHAR(128) DEFAULT '' NOT NULL, + bs_contact VARCHAR(128) DEFAULT '' NOT NULL, + x_tag VARCHAR(255) DEFAULT '' NOT NULL, + a_tag VARCHAR(255) DEFAULT '' NOT NULL, + b_tag VARCHAR(255) DEFAULT '' NOT NULL, + a_srcaddr VARCHAR(128) DEFAULT '' NOT NULL, + b_srcaddr VARCHAR(128) DEFAULT '' NOT NULL, + a_socket VARCHAR(128) DEFAULT '' NOT NULL, + b_socket VARCHAR(128) DEFAULT '' NOT NULL ); CREATE INDEX topos_t_rectime_idx ON topos_t (rectime); diff --git a/utils/kamctl/postgres/usrloc-create.sql b/utils/kamctl/postgres/usrloc-create.sql index a8102e38b64..9a56326d7fd 100644 --- a/utils/kamctl/postgres/usrloc-create.sql +++ b/utils/kamctl/postgres/usrloc-create.sql @@ -22,12 +22,12 @@ CREATE TABLE location ( connection_id INTEGER DEFAULT 0 NOT NULL, keepalive INTEGER DEFAULT 0 NOT NULL, partition INTEGER DEFAULT 0 NOT NULL, - CONSTRAINT location_ruid_idx UNIQUE (ruid), - CONSTRAINT location_connection_idx UNIQUE (server_id, connection_id) + CONSTRAINT location_ruid_idx UNIQUE (ruid) ); CREATE INDEX location_account_contact_idx ON location (username, domain, contact); CREATE INDEX location_expires_idx ON location (expires); +CREATE INDEX location_connection_idx ON location (server_id, connection_id); INSERT INTO version (table_name, table_version) values ('location','8'); diff --git a/utils/kamctl/xhttp_pi/pi_framework.xml b/utils/kamctl/xhttp_pi/pi_framework.xml index 65596206e68..bb5ba7e1b41 100644 --- a/utils/kamctl/xhttp_pi/pi_framework.xml +++ b/utils/kamctl/xhttp_pi/pi_framework.xml @@ -754,6 +754,8 @@ mysql idDB1_INT rectimeDB1_DATETIME + s_methodDB1_STR + s_cseqDB1_STR a_callidDB1_STR a_uuidDB1_STR b_uuidDB1_STR @@ -765,12 +767,15 @@ b_tagDB1_STR a_rrDB1_BLOB b_rrDB1_BLOB + s_rrDB1_BLOB iflagsDB1_INT a_uriDB1_STR b_uriDB1_STR r_uriDB1_STR - a_srcipDB1_STR - b_srcipDB1_STR + a_srcaddrDB1_STR + b_srcaddrDB1_STR + a_socketDB1_STR + b_socketDB1_STR @@ -778,6 +783,8 @@ mysql idDB1_INT rectimeDB1_DATETIME + s_methodDB1_STR + s_cseqDB1_STR a_callidDB1_STR a_uuidDB1_STR b_uuidDB1_STR @@ -785,8 +792,20 @@ x_viaDB1_BLOB x_vbranchDB1_STR x_rrDB1_BLOB + y_rrDB1_BLOB + s_rrDB1_BLOB x_uriDB1_STR + a_contactDB1_STR + b_contactDB1_STR + as_contactDB1_STR + bs_contactDB1_STR x_tagDB1_STR + a_tagDB1_STR + b_tagDB1_STR + a_srcaddrDB1_STR + b_srcaddrDB1_STR + a_socketDB1_STR + b_socketDB1_STR @@ -3879,6 +3898,8 @@
idupdaterectime + s_method + s_cseqa_callida_uuidb_uuid @@ -3890,12 +3911,15 @@ b_taga_rrb_rr + s_rriflagsa_urib_urir_uri - a_srcip - b_srcip + a_srcaddr + b_srcaddr + a_socket + b_socketadd @@ -3903,6 +3927,8 @@ DB1_INSERT rectime + s_method + s_cseqa_callida_uuidb_uuid @@ -3914,12 +3940,15 @@ b_taga_rrb_rr + s_rriflagsa_urib_urir_uri - a_srcip - b_srcip + a_srcaddr + b_srcaddr + a_socket + b_socketupdate @@ -3930,6 +3959,8 @@ rectime + s_method + s_cseqa_callida_uuidb_uuid @@ -3941,12 +3972,15 @@ b_taga_rrb_rr + s_rriflagsa_urib_urir_uri - a_srcip - b_srcip + a_srcaddr + b_srcaddr + a_socket + b_socketdelete @@ -3965,6 +3999,8 @@ idupdaterectime + s_method + s_cseqa_callida_uuidb_uuid @@ -3972,8 +4008,20 @@ x_viax_vbranchx_rr + y_rr + s_rrx_uri + a_contact + b_contact + as_contact + bs_contactx_tag + a_tag + b_tag + a_srcaddr + b_srcaddr + a_socket + b_socketadd @@ -3981,6 +4029,8 @@ DB1_INSERT rectime + s_method + s_cseqa_callida_uuidb_uuid @@ -3988,8 +4038,20 @@ x_viax_vbranchx_rr + y_rr + s_rrx_uri + a_contact + b_contact + as_contact + bs_contactx_tag + a_tag + b_tag + a_srcaddr + b_srcaddr + a_socket + b_socketupdate @@ -4000,6 +4062,8 @@ rectime + s_method + s_cseqa_callida_uuidb_uuid @@ -4007,8 +4071,20 @@ x_viax_vbranchx_rr + y_rr + s_rrx_uri + a_contact + b_contact + as_contact + bs_contactx_tag + a_tag + b_tag + a_srcaddr + b_srcaddr + a_socket + b_socketdelete diff --git a/utils/kamctl/xhttp_pi/topos-mod b/utils/kamctl/xhttp_pi/topos-mod index fd6c3051f66..71ef999e18f 100644 --- a/utils/kamctl/xhttp_pi/topos-mod +++ b/utils/kamctl/xhttp_pi/topos-mod @@ -6,6 +6,8 @@ idupdaterectime + s_method + s_cseqa_callida_uuidb_uuid @@ -17,12 +19,15 @@ b_taga_rrb_rr + s_rriflagsa_urib_urir_uri - a_srcip - b_srcip + a_srcaddr + b_srcaddr + a_socket + b_socketadd @@ -30,6 +35,8 @@ DB1_INSERT rectime + s_method + s_cseqa_callida_uuidb_uuid @@ -41,12 +48,15 @@ b_taga_rrb_rr + s_rriflagsa_urib_urir_uri - a_srcip - b_srcip + a_srcaddr + b_srcaddr + a_socket + b_socketupdate @@ -57,6 +67,8 @@ rectime + s_method + s_cseqa_callida_uuidb_uuid @@ -68,12 +80,15 @@ b_taga_rrb_rr + s_rriflagsa_urib_urir_uri - a_srcip - b_srcip + a_srcaddr + b_srcaddr + a_socket + b_socketdelete @@ -92,6 +107,8 @@ idupdaterectime + s_method + s_cseqa_callida_uuidb_uuid @@ -99,8 +116,20 @@ x_viax_vbranchx_rr + y_rr + s_rrx_uri + a_contact + b_contact + as_contact + bs_contactx_tag + a_tag + b_tag + a_srcaddr + b_srcaddr + a_socket + b_socketadd @@ -108,6 +137,8 @@ DB1_INSERT rectime + s_method + s_cseqa_callida_uuidb_uuid @@ -115,8 +146,20 @@ x_viax_vbranchx_rr + y_rr + s_rrx_uri + a_contact + b_contact + as_contact + bs_contactx_tag + a_tag + b_tag + a_srcaddr + b_srcaddr + a_socket + b_socketupdate @@ -127,6 +170,8 @@ rectime + s_method + s_cseqa_callida_uuidb_uuid @@ -134,8 +179,20 @@ x_viax_vbranchx_rr + y_rr + s_rrx_uri + a_contact + b_contact + as_contact + bs_contactx_tag + a_tag + b_tag + a_srcaddr + b_srcaddr + a_socket + b_socketdelete diff --git a/utils/kamctl/xhttp_pi/topos-table b/utils/kamctl/xhttp_pi/topos-table index 2273680c4b7..cafb219782c 100644 --- a/utils/kamctl/xhttp_pi/topos-table +++ b/utils/kamctl/xhttp_pi/topos-table @@ -4,6 +4,8 @@ mysql idDB1_INT rectimeDB1_DATETIME + s_methodDB1_STR + s_cseqDB1_STR a_callidDB1_STR a_uuidDB1_STR b_uuidDB1_STR @@ -15,12 +17,15 @@ b_tagDB1_STR a_rrDB1_BLOB b_rrDB1_BLOB + s_rrDB1_BLOB iflagsDB1_INT a_uriDB1_STR b_uriDB1_STR r_uriDB1_STR - a_srcipDB1_STR - b_srcipDB1_STR + a_srcaddrDB1_STR + b_srcaddrDB1_STR + a_socketDB1_STR + b_socketDB1_STR @@ -28,6 +33,8 @@ mysql idDB1_INT rectimeDB1_DATETIME + s_methodDB1_STR + s_cseqDB1_STR a_callidDB1_STR a_uuidDB1_STR b_uuidDB1_STR @@ -35,6 +42,18 @@ x_viaDB1_BLOB x_vbranchDB1_STR x_rrDB1_BLOB + y_rrDB1_BLOB + s_rrDB1_BLOB x_uriDB1_STR + a_contactDB1_STR + b_contactDB1_STR + as_contactDB1_STR + bs_contactDB1_STR x_tagDB1_STR + a_tagDB1_STR + b_tagDB1_STR + a_srcaddrDB1_STR + b_srcaddrDB1_STR + a_socketDB1_STR + b_socketDB1_STR diff --git a/utils/misc/vim/syntax/kamailio.vim b/utils/misc/vim/syntax/kamailio.vim index 6bad5f77663..b32a1256473 100644 --- a/utils/misc/vim/syntax/kamailio.vim +++ b/utils/misc/vim/syntax/kamailio.vim @@ -45,7 +45,7 @@ syn region kamailioString matchgroup=Normal start='"' skip='\\"' end='"' conta syn match kamailioVariable "$[a-zA-Z_][a-zA-Z0-9_]*\(([^)]\+)\)\?" contained syn match kamailioIdentifier '[a-zA-Z_][a-zA-Z0-9_]*' contained syn keyword kamailioStatement route if else switch case default break exit return drop while include_file import_file contained -syn keyword kamailioSpecial yes no on off true false enabled disabled contained +syn keyword kamailioSpecial yes no on off true false enabled disabled LOG_LOCAL0 LOG_LOCAL1 LOG_LOCAL2 LOG_LOCAL3 LOG_LOCAL4 LOG_LOCAL5 LOG_LOCAL6 LOG_LOCAL7 contained syn keyword kamailioCoreKeyword af dst_ip dst_port from_uri method msg:len proto status snd_af snd_ip snd_port snd_proto src_ip src_port to_af to_ip to_port to_proto to_uri uri uri:host uri:port contained @@ -53,7 +53,7 @@ syn keyword kamailioCoreValue udp UDP tcp TCP tls TLS sctp SCTP ws WS wss WSS i syn keyword kamailioCoreFunction forward forward_tcp forward_udp forward_tls forward_sctp send send_tcp log error exec force_rport add_rport force_tcp_alias add_tcp_alias udp_mtu udp_mtu_try_proto setflag resetflag isflagset flags bool setavpflag resetavpflag isavpflagset avpflags rewritehost sethost seth rewritehostport sethostport sethp rewritehostporttrans sethostporttrans sethpt rewriteuser setuser setu rewriteuserpass setuserpass setup rewriteport setport setp rewriteuri seturi revert_uri prefix strip strip_tail userphone append_branch set_advertised_address set_advertised_port force_send_socket remove_branch clear_branches cfg_select cfg_reset contained -syn keyword kamailioCoreParameter debug fork log_stderror log_facility log_name log_color log_prefix listen alias auto_aliases dns rev_dns dns_try_ipv6 dns_try_naptr dns_srv_lb dns_srv_loadbalancing dns_udp_pref dns_udp_preference dns_tcp_pref dns_tcp_preference dns_tls_pref dns_tls_preference dns_sctp_pref dns_sctp_preference dns_retr_time dns_retr_no dns_servers_no dns_use_search_list dns_search_full_match dns_cache_init use_dns_cache use_dns_failover dns_cache_flags dns_cache_negative_ttl dns_cache_min_ttl dns_cache_max_ttl dns_cache_mem dns_cache_gc_interval dns_cache_del_nonexp dns_cache_delete_nonexpired dst_blacklist_init use_dst_blacklist dst_blacklist_mem dst_blacklist_expire dst_blacklist_ttl dst_blacklist_gc_interval port statistics maxbuffer children check_via phone2tel syn_branch memlog mem_log memdbg mem_dbg sip_warning server_signature reply_to_via user uid group gid chroot workdir wdir mhomed disable_tcp tcp_children tcp_accept_aliases tcp_send_timeout tcp_connect_timeout tcp_connection_lifetime tcp_poll_method tcp_max_connections tcp_no_connect tcp_source_ipv4 tcp_source_ipv6 tcp_fd_cache tcp_buf_write tcp_async tcp_conn_wq_max tcp_wq_max tcp_rd_buf_size tcp_wq_blk_size tcp_defer_accept tcp_delayed_ack tcp_syncnt tcp_linger2 tcp_keepalive tcp_keepidle tcp_keepintvl tcp_keepcnt tcp_crlf_ping disable_tls tls_disable enable_tls tls_enable tlslog tls_log tls_port_no tls_method tls_verify tls_require_certificate tls_certificate tls_private_key tls_ca_list tls_handshake_timeout tls_send_timeout disable_sctp enable_sctp sctp_children sctp_socket_rcvbuf sctp_socket_receive_buffer sctp_socket_sndbuf sctp_socket_send_buffer sctp_autoclose sctp_send_ttl sctp_send_retries socket_workers advertised_address advertised_port disable_core_dump open_files_limit shm_force_alloc mlock_pages real_time rt_prio rt_policy rt_timer1_prio rt_fast_timer_prio rt_ftimer_prio rt_timer1_policy rt_ftimer_policy rt_timer2_prio rt_stimer_prio rt_timer2_policy rt_stimer_policy mcast_loopback mcast_ttl tos pmtu_discovery exit_timeout ser_kill_timeout max_while_loops stun_refresh_interval stun_allow_stun stun_allow_fp server_id description descr desc loadpath mpath fork_delay modinit_delay http_reply_hack latency_log latency_limit_action latency_limit_db mem_join mem_safety msg_time tcp_clone_rcvbuf tls_max_connections async_workers max_recursive_level dns_naptr_ignore_rfc http_reply_parse version_table tcp_accept_no_cl advertise auto_bind_ipv6 sql_buffer_size pv_buffer_size pv_buffer_slots corelog core_log udp4_raw udp4_raw_mtu udp4_raw_ttl onsend_route_reply max_branches dns_cache_rec_pref run_dir async_usleep log_engine_type log_engine_data contained +syn keyword kamailioCoreParameter debug fork log_stderror log_facility log_name log_color log_prefix log_prefix_mode listen alias auto_aliases dns rev_dns dns_try_ipv6 dns_try_naptr dns_srv_lb dns_srv_loadbalancing dns_udp_pref dns_udp_preference dns_tcp_pref dns_tcp_preference dns_tls_pref dns_tls_preference dns_sctp_pref dns_sctp_preference dns_retr_time dns_retr_no dns_servers_no dns_use_search_list dns_search_full_match dns_cache_init use_dns_cache use_dns_failover dns_cache_flags dns_cache_negative_ttl dns_cache_min_ttl dns_cache_max_ttl dns_cache_mem dns_cache_gc_interval dns_cache_del_nonexp dns_cache_delete_nonexpired dst_blacklist_init use_dst_blacklist dst_blacklist_mem dst_blacklist_expire dst_blacklist_ttl dst_blacklist_gc_interval port statistics maxbuffer children check_via phone2tel syn_branch memlog mem_log memdbg mem_dbg sip_warning server_signature reply_to_via user uid group gid chroot workdir wdir mhomed disable_tcp tcp_children tcp_accept_aliases tcp_send_timeout tcp_connect_timeout tcp_connection_lifetime tcp_poll_method tcp_max_connections tcp_no_connect tcp_source_ipv4 tcp_source_ipv6 tcp_fd_cache tcp_buf_write tcp_async tcp_conn_wq_max tcp_wq_max tcp_rd_buf_size tcp_wq_blk_size tcp_defer_accept tcp_delayed_ack tcp_syncnt tcp_linger2 tcp_keepalive tcp_keepidle tcp_keepintvl tcp_keepcnt tcp_crlf_ping disable_tls tls_disable enable_tls tls_enable tlslog tls_log tls_port_no tls_method tls_verify tls_require_certificate tls_certificate tls_private_key tls_ca_list tls_handshake_timeout tls_send_timeout disable_sctp enable_sctp sctp_children sctp_socket_rcvbuf sctp_socket_receive_buffer sctp_socket_sndbuf sctp_socket_send_buffer sctp_autoclose sctp_send_ttl sctp_send_retries socket_workers advertised_address advertised_port disable_core_dump open_files_limit shm_force_alloc mlock_pages real_time rt_prio rt_policy rt_timer1_prio rt_fast_timer_prio rt_ftimer_prio rt_timer1_policy rt_ftimer_policy rt_timer2_prio rt_stimer_prio rt_timer2_policy rt_stimer_policy mcast_loopback mcast_ttl tos pmtu_discovery exit_timeout ser_kill_timeout max_while_loops stun_refresh_interval stun_allow_stun stun_allow_fp server_id description descr desc loadpath mpath fork_delay modinit_delay http_reply_hack latency_log latency_cfg_log latency_limit_action latency_limit_db mem_join mem_safety msg_time tcp_clone_rcvbuf tls_max_connections async_workers max_recursive_level dns_naptr_ignore_rfc http_reply_parse version_table tcp_accept_no_cl advertise auto_bind_ipv6 sql_buffer_size pv_buffer_size pv_buffer_slots corelog core_log udp4_raw udp4_raw_mtu udp4_raw_ttl onsend_route_reply max_branches dns_cache_rec_pref run_dir async_usleep log_engine_type log_engine_data cfgengine contained syn region kamailioBlock start='{' end='}' contained contains=kamailioBlock,@kamailioCodeElements