[sr-dev] git:master: dialog: lookup dialog by (entry, label) if available for $dlg()

Daniel-Constantin Mierla miconda at gmail.com
Fri Feb 17 09:37:44 CET 2012


Module: sip-router
Branch: master
Commit: b49134a38c9aacd5416b219c377df7c03776fd1d
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b49134a38c9aacd5416b219c377df7c03776fd1d

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Wed Feb 15 23:44:42 2012 +0100

dialog: lookup dialog by (entry, label) if available for $dlg()

- useful for timeout route where there is no SIP message passing through
  for the dialog

---

 modules_k/dialog/dlg_var.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules_k/dialog/dlg_var.c b/modules_k/dialog/dlg_var.c
index 31afc10..d7645b8 100644
--- a/modules_k/dialog/dlg_var.c
+++ b/modules_k/dialog/dlg_var.c
@@ -520,8 +520,14 @@ int pv_get_dlg(struct sip_msg *msg, pv_param_t *param,
 	if(param==NULL)
 		return -1;
 
-	/* Retrieve the dialog for current message */
-	dlg=dlg_get_msg_dialog( msg);
+	if(_dlg_ctx.iuid.h_id==0)
+	{
+		/* Retrieve the dialog for current message */
+		dlg=dlg_get_msg_dialog(msg);
+	} else {
+		/* Retrieve the dialog for current context */
+		dlg=dlg_get_by_iuid(&_dlg_ctx.iuid);
+	}
 	if(dlg == NULL)
 		return pv_get_null(msg, param, res);
 




More information about the sr-dev mailing list