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

Author: Victor Seva <linuxman...@torreviejawireless.org>
Committer: Victor Seva <linuxman...@torreviejawireless.org>
Date: 2025-08-01T16:16:57+02:00

ims_qos: print string value of reg_state

This helps a bit while debugging

---

Modified: src/modules/ims_qos/ims_qos_mod.c
Modified: src/modules/ims_qos/rx_aar.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/912e211cd152e21475785e4e9a86040a6d5f6623.diff
Patch: 
https://github.com/kamailio/kamailio/commit/912e211cd152e21475785e4e9a86040a6d5f6623.patch

---

diff --git a/src/modules/ims_qos/ims_qos_mod.c 
b/src/modules/ims_qos/ims_qos_mod.c
index 894972cc54e..c7fe1ba3753 100644
--- a/src/modules/ims_qos/ims_qos_mod.c
+++ b/src/modules/ims_qos/ims_qos_mod.c
@@ -675,15 +675,17 @@ void callback_pcscf_contact_cb(struct pcontact *c, int 
type, void *param)
        LM_DBG("PCSCF Contact Callback!\n");
        LM_DBG("Contact AOR: [%.*s]\n", c->aor.len, c->aor.s);
        LM_DBG("Callback type [%d]\n", type);
+       LM_DBG("Reg state [%s]\n", reg_state_to_string(c->reg_state));
 
 
        if(type == PCSCF_CONTACT_EXPIRE || type == PCSCF_CONTACT_DELETE) {
                // we don't need to send STR if no QoS was ever successfully 
registered!
                if(must_send_str && (c->reg_state != PCONTACT_REG_PENDING)
                                && (c->reg_state != PCONTACT_REG_PENDING_AAR)) {
-                       LM_DBG("Received notification of contact (in state [%d] 
deleted "
+                       LM_DBG("Received notification of contact (in state [%s] 
deleted "
                                   "for signalling bearer with  with Rx session 
ID: [%.*s]\n",
-                                       c->reg_state, c->rx_session_id.len, 
c->rx_session_id.s);
+                                       reg_state_to_string(c->reg_state), 
c->rx_session_id.len,
+                                       c->rx_session_id.s);
                        LM_DBG("Sending STR\n");
                        rx_send_str(&c->rx_session_id);
                }
@@ -1502,8 +1504,7 @@ static int w_rx_aar_register(
        LM_DBG("Message via is [%d://%.*s:%d]\n", vb->proto, vb->host.len,
                        vb->host.s, via_port);
 
-       lock_get(
-                       saved_t_data
+       lock_get(saved_t_data
                                        ->lock); //we lock here to make sure we 
send all requests before processing replies asynchronously
        for(h = msg->contact; h; h = h->next) {
                if(h->type == HDR_CONTACT_T && h->parsed) {
@@ -1529,9 +1530,10 @@ static int w_rx_aar_register(
                                } else if(pcontact->reg_state == 
PCONTACT_REG_PENDING
                                                  || pcontact->reg_state
                                                                         == 
PCONTACT_REGISTERED) { //NEW reg request
-                                       LM_DBG("Contact [%.*s] exists and is in 
state "
-                                                  "PCONTACT_REG_PENDING or 
PCONTACT_REGISTERED\n",
-                                                       pcontact->aor.len, 
pcontact->aor.s);
+                                       LM_DBG("Contact [%.*s] exists and is in 
state %s or %s\n",
+                                                       pcontact->aor.len, 
pcontact->aor.s,
+                                                       
reg_state_to_string(PCONTACT_REG_PENDING),
+                                                       
reg_state_to_string(PCONTACT_REGISTERED));
 
                                        //check for existing Rx session
                                        if(pcontact->rx_session_id.len > 0
diff --git a/src/modules/ims_qos/rx_aar.c b/src/modules/ims_qos/rx_aar.c
index 923c0ab94bb..6aba4cdbc57 100644
--- a/src/modules/ims_qos/rx_aar.c
+++ b/src/modules/ims_qos/rx_aar.c
@@ -401,8 +401,8 @@ void async_aar_reg_callback(
                ci.reg_state = PCONTACT_REG_PENDING_AAR;
                ci.num_service_routes = 0;
                ci.num_public_ids = 0;
-               LM_DBG("impu: [%.*s] updating status to PCONTACT_REG_PENDING\n",
-                               pcontact->aor.len, pcontact->aor.s);
+               LM_DBG("impu: [%.*s] updating status to %s\n", 
pcontact->aor.len,
+                               pcontact->aor.s, 
reg_state_to_string(ci.reg_state));
                ul.update_pcontact(domain_t, &ci, pcontact);
                //register for callbacks on contact
                ul.register_ulcb(pcontact, PCSCF_CONTACT_DELETE | 
PCSCF_CONTACT_EXPIRE,

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to