Module: kamailio
Branch: master
Commit: 20787d75ded26dcb0958cb74c546137c59d3a4ec
URL:
https://github.com/kamailio/kamailio/commit/20787d75ded26dcb0958cb74c546137…
Author: jaybeepee <jason.penton(a)gmail.com>
Committer: jaybeepee <jason.penton(a)gmail.com>
Date: 2016-03-29T15:53:06+02:00
modules/ims_dialog: only create dlg_out on response codes < 299
---
Modified: modules/ims_dialog/dlg_handlers.c
---
Diff:
https://github.com/kamailio/kamailio/commit/20787d75ded26dcb0958cb74c546137…
Patch:
https://github.com/kamailio/kamailio/commit/20787d75ded26dcb0958cb74c546137…
---
diff --git a/modules/ims_dialog/dlg_handlers.c b/modules/ims_dialog/dlg_handlers.c
index b4b5592..dd23154 100644
--- a/modules/ims_dialog/dlg_handlers.c
+++ b/modules/ims_dialog/dlg_handlers.c
@@ -1341,25 +1341,27 @@ void dlg_onreply(struct cell* t, int type, struct tmcb_params
*param) {
lock_release(dlg->dlg_out_entries_lock);
if (!dlg_out) {
- if (rpl->via1->branch &&
(&rpl->via1->branch->value) && (rpl->via1->branch->value.len
> 0)) {
- branch = rpl->via1->branch->value;
- }
-
- LM_DBG("No dlg_out entry found - creating a new dialog_out entry on
dialog [%p]\n", dlg);
- dlg_out = build_new_dlg_out(dlg, &to_uri, &to_tag, &branch);
+ if (rpl->first_line.u.reply.statuscode < 299) { /*we don't care
about failure responses to dialog - not necessary to create dialog out...*/
+ if (rpl->via1->branch &&
(&rpl->via1->branch->value) && (rpl->via1->branch->value.len
> 0)) {
+ branch = rpl->via1->branch->value;
+ }
- link_dlg_out(dlg, dlg_out, 0);
+ LM_DBG("No dlg_out entry found - creating a new dialog_out entry on
dialog [%p]\n", dlg);
+ dlg_out = build_new_dlg_out(dlg, &to_uri, &to_tag, &branch);
- /* save callee's cseq, caller cseq, callee contact and callee record
route*/
- if (populate_leg_info(dlg, rpl, t, DLG_CALLEE_LEG, &to_tag) != 0) {
- LM_ERR("could not add further info to the dlg out\n");
- }
+ link_dlg_out(dlg, dlg_out, 0);
- if (!dlg_out) {
- LM_ERR("failed to create new dialog out structure\n");
- goto done;
- //TODO do something on this error!
+ /* save callee's cseq, caller cseq, callee contact and callee record
route*/
+ if (populate_leg_info(dlg, rpl, t, DLG_CALLEE_LEG, &to_tag) != 0) {
+ LM_ERR("could not add further info to the dlg out\n");
+ }
+ if (!dlg_out) {
+ LM_ERR("failed to create new dialog out structure\n");
+ goto done;
+ //TODO do something on this error!
+
+ }
}
} else {
//This dlg_out already exists, update cseq and contact if present