Explorar o código

dialog(k): run event route after setting cfg dlg vars

- in this way they (e.g., $DLG_lifetime) should be accessible in event
  route
Daniel-Constantin Mierla %!s(int64=13) %!d(string=hai) anos
pai
achega
2cdded28d9
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      modules_k/dialog/dlg_handlers.c

+ 2 - 1
modules_k/dialog/dlg_handlers.c

@@ -1186,12 +1186,13 @@ void dlg_onroute(struct sip_msg* req, str *route_params, void *param)
 	}
 
 	next_state_dlg( dlg, event, &old_state, &new_state, &unref);
-	dlg_run_event_route(dlg, req, old_state, new_state);
 
 	CURR_DLG_ID = req->id;
 	CURR_DLG_LIFETIME = (unsigned int)(time(0))-dlg->start_ts;
 	CURR_DLG_STATUS = new_state;
 
+	dlg_run_event_route(dlg, req, old_state, new_state);
+
 	/* delay deletion of dialog until transaction has died off in order
 	 * to absorb in-air messages */
 	if (new_state==DLG_STATE_DELETED && old_state!=DLG_STATE_DELETED) {