kamailio.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
List overview
Download
sr-dev
April 2022
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
sr-dev@lists.kamailio.org
17 participants
284 discussions
Start a n
N
ew thread
git:master:61b32b46: core: count and store global index for listen sockets at startup
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 61b32b46afd7cc0a82f33aa3d92a5e76c4d87fee URL:
https://github.com/kamailio/kamailio/commit/61b32b46afd7cc0a82f33aa3d92a5e7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2022-04-06T13:54:59+02:00 core: count and store global index for listen sockets at startup --- Modified: src/core/ip_addr.h Modified: src/core/socket_info.c Modified: src/core/socket_info.h Modified: src/main.c --- Diff:
https://github.com/kamailio/kamailio/commit/61b32b46afd7cc0a82f33aa3d92a5e7…
Patch:
https://github.com/kamailio/kamailio/commit/61b32b46afd7cc0a82f33aa3d92a5e7…
--- diff --git a/src/core/ip_addr.h b/src/core/ip_addr.h index 9205def123..c3f423123e 100644 --- a/src/core/ip_addr.h +++ b/src/core/ip_addr.h @@ -110,6 +110,7 @@ typedef struct advertise_info { typedef struct socket_info { int socket; + int gindex; /* global index in the lists of all sockets */ str name; /* name - eg.: foo.bar or 10.0.0.1 */ struct ip_addr address; /* ip address */ str address_str; /*ip address converted to string -- optimization*/ diff --git a/src/core/socket_info.c b/src/core/socket_info.c index 500945a22a..a60c4c5678 100644 --- a/src/core/socket_info.c +++ b/src/core/socket_info.c @@ -762,6 +762,54 @@ struct socket_info* grep_sock_info(str* host, unsigned short port, return si; } +/** + * + */ +static int _ksr_sockets_no = 0; + +/** + * + */ +int ksr_sockets_no_get(void) +{ + return _ksr_sockets_no; +} + +/** + * + */ +void ksr_sockets_index(void) +{ + socket_info_t *si = NULL; + struct socket_info** list; + unsigned short c_proto; + + if(_ksr_sockets_no > 0) { + return; + } + + c_proto = PROTO_UDP; + do { + /* get the proper sock_list */ + list=get_sock_info_list(c_proto); + + if (list==0) { + /* disabled or unknown protocol */ + continue; + } + + for (si=*list; si; si=si->next) { + if(si->sockname.s == NULL) { + continue; + } + si->gindex = _ksr_sockets_no; + _ksr_sockets_no++; + } + } while((c_proto = next_proto(c_proto))!=0); + + LM_DBG("number of listen sockets: %d\n", _ksr_sockets_no); +} + socket_info_t* ksr_get_socket_by_name(str *sockname) { socket_info_t *si = NULL; diff --git a/src/core/socket_info.h b/src/core/socket_info.h index 50e4a063c1..77baeb42fb 100644 --- a/src/core/socket_info.h +++ b/src/core/socket_info.h @@ -163,4 +163,7 @@ int parse_protohostport(str* ins, sr_phostp_t *r); unsigned int ipv6_get_netif_scope(char *ipval); +int ksr_sockets_no_get(void); +void ksr_sockets_index(void); + #endif diff --git a/src/main.c b/src/main.c index 016a90cabe..2a268a689b 100644 --- a/src/main.c +++ b/src/main.c @@ -2851,6 +2851,7 @@ int main(int argc, char** argv) fprintf(stderr, "failed to initialize list addresses\n"); goto error; } + ksr_sockets_index(); if (default_core_cfg.dns_try_ipv6 && !(socket_types & SOCKET_T_IPV6)){ /* if we are not listening on any ipv6 address => no point * to try to resovle ipv6 addresses */
2 years, 8 months
1
0
0
0
least cost routing module activation error
by bayu p
Dear Kamailio Expert, I already add module lcr, but found error when searching pvar "ddn" inside source code core/pvapi.c at line 923, as shown error log captured below : Apr 6 10:26:50 kamal /usr/sbin/kamailio[180954]: ERROR: <core> [core/pvapi.c:923]: pv_parse_spec2(): error searching pvar "ddn" Apr 6 10:26:50 kamal /usr/sbin/kamailio[180954]: ERROR: <core> [core/pvapi.c:1126]: pv_parse_spec2(): wrong char [n/110] in [$ddn] at [3 (0)] Apr 6 10:26:50 kamal /usr/sbin/kamailio[180954]: ERROR: xlog [xlog.c:511]: xdbg_fixup_helper(): wrong format[Domain of destination: $ddn] Apr 6 10:26:50 kamal /usr/sbin/kamailio[180954]: ERROR: <core> [core/route.c:1166]: fix_actions(): fixing failed (code=-1) at cfg:/etc/kamailio/kamailio.cfg:901 Apr 6 10:26:50 kamal /usr/sbin/kamailio[180954]: ERROR: <core> [core/route.c:1166]: fix_actions(): fixing failed (code=-1) at cfg:/etc/kamailio/kamailio.cfg:903 Apr 6 10:26:50 kamal /usr/sbin/kamailio[180954]: ERROR: <core> [core/route.c:1166]: fix_actions(): fixing failed (code=-1) at cfg:/etc/kamailio/kamailio.cfg:918 The question are, how to define correct "INVITE" methode (or correct format) inside route[LCR] which is already defined inside kamailio.cfg: route[LCR] { if (status=="200") { xlog("LCR: Inside the LCR routen"); } if(method=="INVITE") { xlog("We got an invite"); if(!load_gws(1, $rU, $var(caller_uri))) { xlog("Couldn't load gateways"); sl_send_reply("500", "Server Internal Error - Cannot load gateways"); exit; } else { xlog("GW Selected '$avp(i:709)'n"); xlog("Domain of destination: $ddn"); xlog("To URI: $tun"); } if(!next_gw()) { xlog("Couldn't proceed to next gateway"); sl_send_reply("503", "Service not available, no gateways found"); exit; } else { xlog("Calling the first matched gatewayn"); xlog("ruri_user_avp: '$avp(i:500)'n"); xlog("To URI after next_gw: $tun"); xlog("Request URI: $rUn"); } } } Kind Regards
2 years, 8 months
1
0
0
0
git:master:b3bdfa61: modules: readme files regenerated - dispatcher ... [skip ci]
by Kamailio Dev
Module: kamailio Branch: master Commit: b3bdfa61aabfaf4f546f899b2afe2d288a9849c5 URL:
https://github.com/kamailio/kamailio/commit/b3bdfa61aabfaf4f546f899b2afe2d2…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org> Committer: Kamailio Dev <kamailio.dev(a)kamailio.org> Date: 2022-04-05T21:16:16+02:00 modules: readme files regenerated - dispatcher ... [skip ci] --- Modified: src/modules/dispatcher/README --- Diff:
https://github.com/kamailio/kamailio/commit/b3bdfa61aabfaf4f546f899b2afe2d2…
Patch:
https://github.com/kamailio/kamailio/commit/b3bdfa61aabfaf4f546f899b2afe2d2…
--- diff --git a/src/modules/dispatcher/README b/src/modules/dispatcher/README index 6f9146b8d6..ff24e03f26 100644 --- a/src/modules/dispatcher/README +++ b/src/modules/dispatcher/README @@ -1569,11 +1569,14 @@ kamcmd dispatcher.set_duid_state ip 2 xyz 5.3. dispatcher.list - Lists the groups and included destinations. + Lists the routing groups with destination addresses and corresponding + attributes. Name: dispatcher.list - Parameters: none + Parameters: + * _rmode_ - (optional) response mode - can be 'short' to get a + shorter version of groups and destinations Example: kamcmd dispatcher.list
2 years, 8 months
1
0
0
0
git:master:3f84e45e: dispatcher: docs updated for rpc dispatcher.list
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 3f84e45edc0d00866b76b7f35d569f02ff72eff2 URL:
https://github.com/kamailio/kamailio/commit/3f84e45edc0d00866b76b7f35d569f0…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2022-04-05T21:07:31+02:00 dispatcher: docs updated for rpc dispatcher.list --- Modified: src/modules/dispatcher/doc/dispatcher_admin.xml --- Diff:
https://github.com/kamailio/kamailio/commit/3f84e45edc0d00866b76b7f35d569f0…
Patch:
https://github.com/kamailio/kamailio/commit/3f84e45edc0d00866b76b7f35d569f0…
--- diff --git a/src/modules/dispatcher/doc/dispatcher_admin.xml b/src/modules/dispatcher/doc/dispatcher_admin.xml index 78523a7c1b..bcd0a49a71 100644 --- a/src/modules/dispatcher/doc/dispatcher_admin.xml +++ b/src/modules/dispatcher/doc/dispatcher_admin.xml @@ -1923,12 +1923,19 @@ onreply_route { <function moreinfo="none">dispatcher.list</function> </title> <para> - Lists the groups and included destinations. + Lists the routing groups with destination addresses and corresponding + attributes. </para> <para> Name: <emphasis>dispatcher.list</emphasis> </para> - <para>Parameters: <emphasis>none</emphasis></para> + <para>Parameters:</para> + <itemizedlist> + <listitem> + <para>_rmode_ - (optional) response mode - can be 'short' to get a + shorter version of groups and destinations</para> + </listitem> + </itemizedlist> <para> Example: </para>
2 years, 8 months
1
0
0
0
git:master:2e5b8167: dispatcher: option to get shorter result for rpc list command
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 2e5b81676c91f9c39ba8613f1116a7f8e0e06453 URL:
https://github.com/kamailio/kamailio/commit/2e5b81676c91f9c39ba8613f1116a7f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2022-04-05T18:11:50+02:00 dispatcher: option to get shorter result for rpc list command --- Modified: src/modules/dispatcher/dispatcher.c --- Diff:
https://github.com/kamailio/kamailio/commit/2e5b81676c91f9c39ba8613f1116a7f…
Patch:
https://github.com/kamailio/kamailio/commit/2e5b81676c91f9c39ba8613f1116a7f…
--- diff --git a/src/modules/dispatcher/dispatcher.c b/src/modules/dispatcher/dispatcher.c index 8ff3307548..ccb8b1334a 100644 --- a/src/modules/dispatcher/dispatcher.c +++ b/src/modules/dispatcher/dispatcher.c @@ -1584,10 +1584,15 @@ static void dispatcher_rpc_reload(rpc_t *rpc, void *ctx) static const char *dispatcher_rpc_list_doc[2] = { "Return the content of dispatcher sets", 0}; + +#define DS_RPC_PRINT_NORMAL 1 +#define DS_RPC_PRINT_SHORT 2 + /** * */ -int ds_rpc_print_set(ds_set_t *node, rpc_t *rpc, void *ctx, void *rpc_handle) +int ds_rpc_print_set(ds_set_t *node, rpc_t *rpc, void *ctx, void *rpc_handle, + int mode) { int i = 0, rc = 0; void *rh; @@ -1604,7 +1609,7 @@ int ds_rpc_print_set(ds_set_t *node, rpc_t *rpc, void *ctx, void *rpc_handle) return 0; for(; i < 2; ++i) { - rc = ds_rpc_print_set(node->next[i], rpc, ctx, rpc_handle); + rc = ds_rpc_print_set(node->next[i], rpc, ctx, rpc_handle, mode); if(rc != 0) return rc; } @@ -1639,7 +1644,7 @@ int ds_rpc_print_set(ds_set_t *node, rpc_t *rpc, void *ctx, void *rpc_handle) else c[1] = 'X'; - if(node->dlist[j].attrs.body.s) { + if(mode != DS_RPC_PRINT_SHORT && node->dlist[j].attrs.body.s!=NULL) { if(rpc->struct_add(vh, "Ssd{", "URI", &node->dlist[j].uri, "FLAGS", c, "PRIORITY", node->dlist[j].priority, @@ -1709,6 +1714,16 @@ static void dispatcher_rpc_list(rpc_t *rpc, void *ctx) { void *th; void *ih; + int n; + str smode; + int vmode = DS_RPC_PRINT_NORMAL; + + n = rpc->scan(ctx, "*S", &smode); + if(n == 1) { + if(smode.len==5 && strncasecmp(smode.s, "short", 5)==0) { + vmode = DS_RPC_PRINT_SHORT; + } + } ds_set_t *dslist = ds_get_list(); int dslistnr = ds_get_list_nr(); @@ -1729,7 +1744,7 @@ static void dispatcher_rpc_list(rpc_t *rpc, void *ctx) return; } - ds_rpc_print_set(dslist, rpc, ctx, ih); + ds_rpc_print_set(dslist, rpc, ctx, ih, vmode); return; }
2 years, 8 months
1
0
0
0
git:master:e680b6b7: dispatcher: option to do srv dns query for target addresses
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: e680b6b7f7fc33c98720b928b505e8ac96980186 URL:
https://github.com/kamailio/kamailio/commit/e680b6b7f7fc33c98720b928b505e8a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2022-04-05T13:02:06+02:00 dispatcher: option to do srv dns query for target addresses --- Modified: src/modules/dispatcher/dispatch.c Modified: src/modules/dispatcher/dispatch.h --- Diff:
https://github.com/kamailio/kamailio/commit/e680b6b7f7fc33c98720b928b505e8a…
Patch:
https://github.com/kamailio/kamailio/commit/e680b6b7f7fc33c98720b928b505e8a…
2 years, 8 months
1
0
0
0
git:master:03f844bb: dispatcher: fix compile error by previous commit pushing unsaved files
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 03f844bbe842107ad09cbf46bfcbff722e788937 URL:
https://github.com/kamailio/kamailio/commit/03f844bbe842107ad09cbf46bfcbff7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2022-04-05T11:07:56+02:00 dispatcher: fix compile error by previous commit pushing unsaved files --- Modified: src/modules/dispatcher/dispatch.c Modified: src/modules/dispatcher/dispatcher.c --- Diff:
https://github.com/kamailio/kamailio/commit/03f844bbe842107ad09cbf46bfcbff7…
Patch:
https://github.com/kamailio/kamailio/commit/03f844bbe842107ad09cbf46bfcbff7…
--- diff --git a/src/modules/dispatcher/dispatch.c b/src/modules/dispatcher/dispatch.c index b770a02a40..c62f484b8f 100644 --- a/src/modules/dispatcher/dispatch.c +++ b/src/modules/dispatcher/dispatch.c @@ -3352,7 +3352,7 @@ int ds_is_addr_from_set(sip_msg_t *_m, struct ip_addr *pipaddr, /* dst record using hotname with dns not done - no ip to match */ continue; } - if(ds_dns_mode != DS_DNS_MODE_ALWAYS) { + if(!(ds_dns_mode & DS_DNS_MODE_ALWAYS)) { ipa = &node->dlist[j].ip_address; } else { memcpy(hn, node->dlist[j].host.s, node->dlist[j].host.len); diff --git a/src/modules/dispatcher/dispatcher.c b/src/modules/dispatcher/dispatcher.c index 6a1b88c484..8ff3307548 100644 --- a/src/modules/dispatcher/dispatcher.c +++ b/src/modules/dispatcher/dispatcher.c @@ -120,7 +120,7 @@ int ds_hash_check_interval = 30; int ds_timer_mode = 0; int ds_attrs_none = 0; int ds_load_mode = 0; -uint32_t ds_dns_mode = DS_DNS_INIT; +uint32_t ds_dns_mode = DS_DNS_MODE_INIT; static int ds_dns_mode_param = 0; str ds_outbound_proxy = STR_NULL;
2 years, 8 months
1
0
0
0
git:master:bf6b1fef: dispatcher: turned ds_dns_mode values in bit flags
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: bf6b1feffeef81f43c9bffc75f7a1fbf5cd9caa7 URL:
https://github.com/kamailio/kamailio/commit/bf6b1feffeef81f43c9bffc75f7a1fb…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2022-04-05T10:29:57+02:00 dispatcher: turned ds_dns_mode values in bit flags --- Modified: src/modules/dispatcher/dispatch.c Modified: src/modules/dispatcher/dispatch.h Modified: src/modules/dispatcher/dispatcher.c --- Diff:
https://github.com/kamailio/kamailio/commit/bf6b1feffeef81f43c9bffc75f7a1fb…
Patch:
https://github.com/kamailio/kamailio/commit/bf6b1feffeef81f43c9bffc75f7a1fb…
--- diff --git a/src/modules/dispatcher/dispatch.c b/src/modules/dispatcher/dispatch.c index d59eebe23e..b770a02a40 100644 --- a/src/modules/dispatcher/dispatch.c +++ b/src/modules/dispatcher/dispatch.c @@ -111,7 +111,7 @@ extern float ds_latency_estimator_alpha; extern int ds_attrs_none; extern param_t *ds_db_extra_attrs_list; extern int ds_load_mode; -extern int ds_dns_mode; +extern uint32_t ds_dns_mode; static db_func_t ds_dbf; static db1_con_t *ds_db_handle = NULL; @@ -486,7 +486,7 @@ ds_dest_t *pack_dest(str iuri, int flags, int priority, str *attrs, int dload) /* Do a DNS-Lookup for the Host-Name, if not disabled via dst flags */ if(dp->flags & DS_NODNSARES_DST) { dp->irmode |= DS_IRMODE_NOIPADDR; - } else if (ds_dns_mode==DS_DNS_MODE_INIT || ds_dns_mode==DS_DNS_MODE_TIMER) { + } else if (ds_dns_mode & (DS_DNS_MODE_INIT|DS_DNS_MODE_TIMER)) { he = resolvehost(hn); if(he == 0) { LM_ERR("could not resolve %.*s (missing no-probing flag?!?)\n", diff --git a/src/modules/dispatcher/dispatch.h b/src/modules/dispatcher/dispatch.h index 36e01e96ef..0d79386906 100644 --- a/src/modules/dispatcher/dispatch.h +++ b/src/modules/dispatcher/dispatch.h @@ -74,9 +74,9 @@ #define DS_IRMODE_NOIPADDR 1 -#define DS_DNS_MODE_INIT 0 -#define DS_DNS_MODE_ALWAYS 1 -#define DS_DNS_MODE_TIMER 2 +#define DS_DNS_MODE_INIT 1 +#define DS_DNS_MODE_ALWAYS (1<<1) +#define DS_DNS_MODE_TIMER (1<<2) /* clang-format on */ typedef struct ds_rctx { diff --git a/src/modules/dispatcher/dispatcher.c b/src/modules/dispatcher/dispatcher.c index 6317334fba..6a1b88c484 100644 --- a/src/modules/dispatcher/dispatcher.c +++ b/src/modules/dispatcher/dispatcher.c @@ -120,7 +120,8 @@ int ds_hash_check_interval = 30; int ds_timer_mode = 0; int ds_attrs_none = 0; int ds_load_mode = 0; -int ds_dns_mode = 0; +uint32_t ds_dns_mode = DS_DNS_INIT; +static int ds_dns_mode_param = 0; str ds_outbound_proxy = STR_NULL; @@ -297,7 +298,7 @@ static param_export_t params[]={ {"ds_db_extra_attrs", PARAM_STR, &ds_db_extra_attrs}, {"ds_load_mode", PARAM_INT, &ds_load_mode}, {"reload_delta", PARAM_INT, &ds_reload_delta }, - {"ds_dns_mode", PARAM_INT, &ds_dns_mode}, + {"ds_dns_mode", PARAM_INT, &ds_dns_mode_param}, {0,0,0} }; @@ -327,11 +328,7 @@ static int mod_init(void) param_hooks_t phooks; param_t *pit = NULL; - if(ds_dns_mode!=DS_DNS_MODE_INIT && ds_dns_mode!=DS_DNS_MODE_ALWAYS - && ds_dns_mode!=DS_DNS_MODE_TIMER) { - LM_ERR("invalid dns mode %d\n", ds_dns_mode); - return -1; - } + ds_dns_mode = 1U<<(unsigned int)ds_dns_mode_param; if(ds_ping_active_init() < 0) { return -1;
2 years, 8 months
1
0
0
0
git:master:cdf8cb64: dispatcher: check valid values for ds_dns_mode
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: cdf8cb6444f3b3f9aeb76053edc05bf595d4a583 URL:
https://github.com/kamailio/kamailio/commit/cdf8cb6444f3b3f9aeb76053edc05bf…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2022-04-05T07:54:15+02:00 dispatcher: check valid values for ds_dns_mode --- Modified: src/modules/dispatcher/dispatch.c Modified: src/modules/dispatcher/dispatch.h Modified: src/modules/dispatcher/dispatcher.c --- Diff:
https://github.com/kamailio/kamailio/commit/cdf8cb6444f3b3f9aeb76053edc05bf…
Patch:
https://github.com/kamailio/kamailio/commit/cdf8cb6444f3b3f9aeb76053edc05bf…
--- diff --git a/src/modules/dispatcher/dispatch.c b/src/modules/dispatcher/dispatch.c index 0ca8839c89..d59eebe23e 100644 --- a/src/modules/dispatcher/dispatch.c +++ b/src/modules/dispatcher/dispatch.c @@ -82,10 +82,6 @@ #define DS_HN_SIZE 256 -#define DS_DNS_MODE_INIT 0 -#define DS_DNS_MODE_ALWAYS 1 -#define DS_DNS_MODE_CACHE 2 - /* increment call load */ #define DS_LOAD_INC(dgrp, didx) do { \ lock_get(&(dgrp)->lock); \ @@ -490,7 +486,7 @@ ds_dest_t *pack_dest(str iuri, int flags, int priority, str *attrs, int dload) /* Do a DNS-Lookup for the Host-Name, if not disabled via dst flags */ if(dp->flags & DS_NODNSARES_DST) { dp->irmode |= DS_IRMODE_NOIPADDR; - } else if (ds_dns_mode==DS_DNS_MODE_INIT || ds_dns_mode==DS_DNS_MODE_CACHE) { + } else if (ds_dns_mode==DS_DNS_MODE_INIT || ds_dns_mode==DS_DNS_MODE_TIMER) { he = resolvehost(hn); if(he == 0) { LM_ERR("could not resolve %.*s (missing no-probing flag?!?)\n", diff --git a/src/modules/dispatcher/dispatch.h b/src/modules/dispatcher/dispatch.h index e360e67592..36e01e96ef 100644 --- a/src/modules/dispatcher/dispatch.h +++ b/src/modules/dispatcher/dispatch.h @@ -73,8 +73,12 @@ #define DS_XAVP_CTX_SKIP_CNT 1 #define DS_IRMODE_NOIPADDR 1 -/* clang-format on */ +#define DS_DNS_MODE_INIT 0 +#define DS_DNS_MODE_ALWAYS 1 +#define DS_DNS_MODE_TIMER 2 + +/* clang-format on */ typedef struct ds_rctx { int flags; int code; diff --git a/src/modules/dispatcher/dispatcher.c b/src/modules/dispatcher/dispatcher.c index 42b1a41aa8..6317334fba 100644 --- a/src/modules/dispatcher/dispatcher.c +++ b/src/modules/dispatcher/dispatcher.c @@ -327,6 +327,12 @@ static int mod_init(void) param_hooks_t phooks; param_t *pit = NULL; + if(ds_dns_mode!=DS_DNS_MODE_INIT && ds_dns_mode!=DS_DNS_MODE_ALWAYS + && ds_dns_mode!=DS_DNS_MODE_TIMER) { + LM_ERR("invalid dns mode %d\n", ds_dns_mode); + return -1; + } + if(ds_ping_active_init() < 0) { return -1; }
2 years, 8 months
1
0
0
0
git:master:1b5b0aa9: dispatcher: added ds_dns_mode parameter
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 1b5b0aa94b82845995791a356b68ed6e1cbc3491 URL:
https://github.com/kamailio/kamailio/commit/1b5b0aa94b82845995791a356b68ed6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2022-04-04T19:34:55+02:00 dispatcher: added ds_dns_mode parameter - control when dns resolving is done for hostnames in target addresses from dispatcher groups (wip) --- Modified: src/modules/dispatcher/dispatch.c Modified: src/modules/dispatcher/dispatch.h Modified: src/modules/dispatcher/dispatcher.c --- Diff:
https://github.com/kamailio/kamailio/commit/1b5b0aa94b82845995791a356b68ed6…
Patch:
https://github.com/kamailio/kamailio/commit/1b5b0aa94b82845995791a356b68ed6…
2 years, 8 months
1
0
0
0
← Newer
1
...
24
25
26
27
28
29
Older →
Jump to page:
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
26
27
28
29
Results per page:
10
25
50
100
200