Skip to content

Commit

Permalink
Dont send bye on early dialog (#2521)
Browse files Browse the repository at this point in the history
  • Loading branch information
zayim committed Jan 20, 2021
1 parent 2141d9b commit 62d75ab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/janus_sip.c
Original file line number Diff line number Diff line change
Expand Up @@ -2528,7 +2528,12 @@ static void janus_sip_hangup_media_internal(janus_plugin_session *handle) {
session->media.ready = FALSE;
session->media.on_hold = FALSE;
janus_sip_call_update_status(session, janus_sip_call_status_closing);
nua_bye(session->stack->s_nh_i, TAG_END());

if(g_atomic_int_get(&session->established))
nua_bye(session->stack->s_nh_i, TAG_END());
else
nua_respond(session->stack->s_nh_i, 480, sip_status_phrase(480), TAG_END());

/* Notify the operation */
json_t *event = json_object();
json_object_set_new(event, "sip", json_string("event"));
Expand Down

0 comments on commit 62d75ab

Please sign in to comment.