Module: kamailio
Branch: master
Commit: e51ccd11fe51f2d53dd7719b8fdec561a6ba7494
URL: 
https://github.com/kamailio/kamailio/commit/e51ccd11fe51f2d53dd7719b8fdec561a6ba7494

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@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/e51ccd11fe51f2d53dd7719b8fdec561a6ba7494.diff
Patch: 
https://github.com/kamailio/kamailio/commit/e51ccd11fe51f2d53dd7719b8fdec561a6ba7494.patch

---

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;

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to