Module: kamailio Branch: master Commit: e51ccd11fe51f2d53dd7719b8fdec561a6ba7494 URL: https://github.com/kamailio/kamailio/commit/e51ccd11fe51f2d53dd7719b8fdec561...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2023-11-20T10:07:50+01:00
core: set proto on fixing forward actions
---
Modified: src/core/route.c
---
Diff: https://github.com/kamailio/kamailio/commit/e51ccd11fe51f2d53dd7719b8fdec561... Patch: https://github.com/kamailio/kamailio/commit/e51ccd11fe51f2d53dd7719b8fdec561...
---
diff --git a/src/core/route.c b/src/core/route.c index f6c8c681d29..a03330b6c04 100644 --- a/src/core/route.c +++ b/src/core/route.c @@ -619,6 +619,7 @@ int fix_actions(struct action *a) enum rval_type rve_type, err_type, expected_type; struct rvalue *rv; int rve_param_no; + int proto;
if(a == 0) { LM_CRIT("null pointer\n"); @@ -646,8 +647,23 @@ int fix_actions(struct action *a) case STRING_ST: s.s = t->val[0].u.string; s.len = strlen(s.s); - p = add_proxy( - &s, t->val[1].u.number, 0); /* FIXME proto*/ + switch(t->type) { + case FORWARD_TCP_T: + proto = PROTO_TCP; + break; + case FORWARD_TLS_T: + proto = PROTO_TCP; + break; + case FORWARD_SCTP_T: + proto = PROTO_TCP; + break; + case FORWARD_UDP_T: + proto = PROTO_TCP; + break; + default: + proto = 0; + } + p = add_proxy(&s, t->val[1].u.number, proto); if(p == 0) { ret = E_BAD_ADDRESS; goto error;