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

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2023-09-26T13:30:56+02:00

tm: print af and proto as strings in log messages

---

Modified: src/modules/tm/t_fwd.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/6f332ba8329f1dcbeeb00badc499580eb1ff98cf.diff
Patch: 
https://github.com/kamailio/kamailio/commit/6f332ba8329f1dcbeeb00badc499580eb1ff98cf.patch

---

diff --git a/src/modules/tm/t_fwd.c b/src/modules/tm/t_fwd.c
index ae5f7c04805..816568b18ea 100644
--- a/src/modules/tm/t_fwd.c
+++ b/src/modules/tm/t_fwd.c
@@ -470,9 +470,11 @@ static int prepare_new_uac(struct cell *t, struct sip_msg 
*i_req, int branch,
 
        /* check if send_sock is ok */
        if(t->uac[branch].request.dst.send_sock == 0) {
-               LM_ERR("can't fwd to af %d, proto %d "
+               LM_ERR("can't fwd to af %d (%s), proto %d (%s)"
                           " (no corresponding listening socket)\n",
-                               dst->to.s.sa_family, dst->proto);
+                               dst->to.s.sa_family,
+                               get_af_name((unsigned int)dst->to.s.sa_family), 
dst->proto,
+                               get_proto_name((unsigned int)dst->proto));
                ret = E_NO_SOCKET;
                goto error01;
        }
@@ -878,10 +880,13 @@ static int add_uac_from_buf(struct cell *t, struct 
sip_msg *request, str *uri,
 
        /* check if send_sock is ok */
        if(t->uac[branch].request.dst.send_sock == 0) {
-               LM_ERR("can't fwd to af %d, proto %d"
+               LM_ERR("can't fwd to af %d (%s), proto %d (%s)"
                           " (no corresponding listening socket)\n",
                                t->uac[branch].request.dst.to.s.sa_family,
-                               t->uac[branch].request.dst.proto);
+                               get_af_name((unsigned int)t->uac[branch]
+                                                                       
.request.dst.to.s.sa_family),
+                               t->uac[branch].request.dst.proto,
+                               get_proto_name((unsigned 
int)t->uac[branch].request.dst.proto));
                ret = ser_error = E_NO_SOCKET;
                goto error;
        }

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

Reply via email to