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

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2023-12-19T10:57:40+01:00

tm: clearer reply code handling for uac dlg

---

Modified: src/modules/tm/dlg.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/19572a828ffeb08b190dab5ae4aee93f03d9a7f2.diff
Patch: 
https://github.com/kamailio/kamailio/commit/19572a828ffeb08b190dab5ae4aee93f03d9a7f2.patch

---

diff --git a/src/modules/tm/dlg.c b/src/modules/tm/dlg.c
index 420f95a98d2..29b8d50769f 100644
--- a/src/modules/tm/dlg.c
+++ b/src/modules/tm/dlg.c
@@ -666,7 +666,7 @@ static inline int dlg_new_resp_uac(dlg_t *_d, struct 
sip_msg *_m)
        code = _m->first_line.u.reply.statuscode;
 
        if(code < 200) {
-               /* A provisional response, do nothing, we could
+               /* 100-199: a provisional response, do nothing, we could
                 * update remote tag and route set but we will do that
                 * for a positive final response anyway and I don't want
                 * bet on presence of these fields in provisional responses
@@ -674,8 +674,8 @@ static inline int dlg_new_resp_uac(dlg_t *_d, struct 
sip_msg *_m)
                 * Send a request to j...@iptel.org if you need to update
                 * the structures here
                 */
-       } else if((code >= 200) && (code < 299)) {
-               /* A final response, update the structures and transit
+       } else if(code < 299) {
+               /* 200-299: a final response, update the structures and transit
                 * into DLG_CONFIRMED
                 */
                if(response2dlg(_m, _d) < 0)
@@ -687,7 +687,7 @@ static inline int dlg_new_resp_uac(dlg_t *_d, struct 
sip_msg *_m)
                        return -2;
                }
        } else {
-               /* A negative final response, mark the dialog as destroyed
+               /* 300-699: a negative final response, mark the dialog as 
destroyed
                 * Again, I do not update the structures here because it
                 * makes no sense to me, a dialog shouldn't be used after
                 * it is destroyed

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

Reply via email to