From: Victor Seva <vseva@sipwise.com>
Date: Fri, 4 Nov 2022 11:23:59 +0100
Subject: MT#55631 dialog: dlg_set_var() support empty totag parameter

* support setting vars for non established dialogs
---
 src/modules/dialog/dialog.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c
index aedf8a7..8f4c806 100644
--- a/src/modules/dialog/dialog.c
+++ b/src/modules/dialog/dialog.c
@@ -1663,7 +1663,7 @@ static int ki_dlg_set_var(sip_msg_t *msg, str *sc, str *sf, str *st, str *key, s
 		LM_ERR("invalid From tag parameter\n");
 		return -1;
 	}
-	if(st==NULL || st->s==NULL || st->len == 0) {
+	if(st==NULL) {
 		LM_ERR("invalid To tag parameter\n");
 		return -1;
 	}
@@ -1707,11 +1707,7 @@ static int w_dlg_set_var(struct sip_msg *msg, char *ci, char *ft, char *tt, char
 		LM_ERR("unable to get To Tag\n");
 		return -1;
 	}
-	if(st.s==NULL || st.len == 0)
-	{
-		LM_ERR("invalid To tag parameter\n");
-		return -1;
-	}
+
 	if(fixup_get_svalue(msg, (gparam_p)key, &k)!=0)
 	{
 		LM_ERR("unable to get key name\n");
