diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index 24dc581e47..58fc3499cd 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -1113,6 +1113,7 @@ static void attach_jsock(jsock_t *jsock) switch_core_hash_delete(globals.jsock_hash, jsock->uuid_str); ws_write_json(jp, &msg, SWITCH_TRUE); cJSON_Delete(msg); + jp->nodelete = 1; jp->drop = 1; } } @@ -1126,6 +1127,10 @@ static void attach_jsock(jsock_t *jsock) static void detach_jsock(jsock_t *jsock) { + if (jsock->nodelete) { + return; + } + switch_mutex_lock(globals.jsock_mutex); switch_core_hash_delete(globals.jsock_hash, jsock->uuid_str); switch_mutex_unlock(globals.jsock_mutex); diff --git a/src/mod/endpoints/mod_verto/mod_verto.h b/src/mod/endpoints/mod_verto/mod_verto.h index eccd095369..b144e70a29 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.h +++ b/src/mod/endpoints/mod_verto/mod_verto.h @@ -112,7 +112,8 @@ struct jsock_s { struct passwd pw; #endif - int drop; + uint8_t drop; + uint8_t nodelete; ws_socket_t local_sock; SSL *ssl;