|
@@ -774,16 +774,20 @@ int dlg_new_dialog(struct sip_msg *req, struct cell *t, const int run_initial_cb
|
|
|
dlg = get_dlg(&callid, &ftag, &ttag, &dir);
|
|
|
if (dlg)
|
|
|
{
|
|
|
- LM_DBG("Callid '%.*s' found, must be a spiraled request\n",
|
|
|
- callid.len, callid.s);
|
|
|
- spiral_detected = 1;
|
|
|
-
|
|
|
- if (run_initial_cbs)
|
|
|
- run_dlg_callbacks( DLGCB_SPIRALED, dlg, req, NULL,
|
|
|
- DLG_DIR_DOWNSTREAM, 0);
|
|
|
- /* get_dlg() has incremented the ref count by 1
|
|
|
- * - it's ok, dlg will be unref at the end of function */
|
|
|
- goto finish;
|
|
|
+ if ( dlg->state != DLG_STATE_DELETED )
|
|
|
+ {
|
|
|
+ LM_DBG("Callid '%.*s' found, must be a spiraled request\n",
|
|
|
+ callid.len, callid.s);
|
|
|
+ spiral_detected = 1;
|
|
|
+
|
|
|
+ if (run_initial_cbs)
|
|
|
+ run_dlg_callbacks( DLGCB_SPIRALED, dlg, req, NULL,
|
|
|
+ DLG_DIR_DOWNSTREAM, 0);
|
|
|
+ /* get_dlg() has incremented the ref count by 1
|
|
|
+ * - it's ok, dlg will be unref at the end of function */
|
|
|
+ goto finish;
|
|
|
+ }
|
|
|
+ dlg_release(dlg);
|
|
|
}
|
|
|
}
|
|
|
spiral_detected = 0;
|