Browse code

dialog: Correctly detect and handle state in DLG_DMQ_UPDATE

Alex Hermann authored on 26/08/2014 14:28:29
Showing 1 changed files
... ...
@@ -97,7 +97,7 @@ int dlg_dmq_handle_msg(struct sip_msg* msg, peer_reponse_t* resp)
97 97
 	str profiles = {0, 0}, callid = {0, 0};
98 98
 	str dummy = {0, 0};
99 99
 	unsigned int init_ts = 0, start_ts = 0, lifetime = 0;
100
-	unsigned int state = 0;
100
+	unsigned int state = 1;
101 101
 
102 102
 	/* received dmq message */
103 103
 	LM_DBG("dmq message received\n");
... ...
@@ -194,8 +194,6 @@ int dlg_dmq_handle_msg(struct sip_msg* msg, peer_reponse_t* resp)
194 194
 				dlg->h_id = iuid.h_id;
195 195
 				/* prevent DB sync */
196 196
 				dlg->dflags &= ~(DLG_FLAG_NEW|DLG_FLAG_CHANGED);
197
-				dlg->init_ts = init_ts;
198
-				dlg->start_ts = start_ts;
199 197
 			} else {
200 198
 				/* remove existing profiles */
201 199
 				if (dlg->profile_links!=NULL) {
... ...
@@ -204,6 +202,9 @@ int dlg_dmq_handle_msg(struct sip_msg* msg, peer_reponse_t* resp)
204 202
 				}
205 203
 			}
206 204
 
205
+			dlg->init_ts = init_ts;
206
+			dlg->start_ts = start_ts;
207
+
207 208
 			/* add profiles */
208 209
 			if(profiles.s!=NULL) {
209 210
 				srjson_InitDoc(&prof_jdoc, NULL);