瀏覽代碼

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
Daniel-Constantin Mierla 13 年之前
父節點
當前提交
b49134a38c
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      modules_k/dialog/dlg_var.c

+ 8 - 2
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);