summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Zabaluev <mikhail.zabaluev@nokia.com>2008-03-18 16:59:09 +0000
committerMikhail Zabaluev <mikhail.zabaluev@nokia.com>2008-03-18 16:59:09 +0000
commitcc9ea218883cba698cdc22feb77153690dfd926e (patch)
treee2db54fc8b9a2bd6df0bcf8a2d61bf146d65b2cc
parent7eb904a55c0a1c9439e27fc6f7595869aba6bf3f (diff)
TpsipMediaChannel: handle session termination in a nua_i_terminated callback.
This is to eliminate a warning about the event delivered for a retired NUA handle. 20080318165909-5b6ca-29322f8b0593313b3b47e4888ae197e1b1471306.gz
-rw-r--r--src/sip-media-channel.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/sip-media-channel.c b/src/sip-media-channel.c
index 67862f5..05b11ff 100644
--- a/src/sip-media-channel.c
+++ b/src/sip-media-channel.c
@@ -1095,9 +1095,9 @@ priv_nua_i_state_cb (TpsipMediaChannel *self,
break;
case nua_callstate_terminated:
- tpsip_media_session_change_state (priv->session,
- TPSIP_MEDIA_SESSION_STATE_ENDED);
+ /* handled by the nua_i_terminated handler */
break;
+
default:
break;
}
@@ -1105,6 +1105,19 @@ priv_nua_i_state_cb (TpsipMediaChannel *self,
return TRUE;
}
+static gboolean
+priv_nua_i_terminated_cb (TpsipMediaChannel *self,
+ const TpsipNuaEvent *ev,
+ tagi_t tags[],
+ gpointer foo)
+{
+ TpsipMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self);
+ g_return_val_if_fail (priv->session != NULL, FALSE);
+ tpsip_media_session_change_state (priv->session,
+ TPSIP_MEDIA_SESSION_STATE_ENDED);
+ return TRUE;
+}
+
static void priv_session_state_changed_cb (TpsipMediaSession *session,
guint old_state,
guint state,
@@ -1218,6 +1231,10 @@ priv_connect_nua_handlers (TpsipMediaChannel *self, nua_handle_t *nh)
"nua-event::nua_i_state",
G_CALLBACK (priv_nua_i_state_cb),
NULL);
+ g_signal_connect (self,
+ "nua-event::nua_i_terminated",
+ G_CALLBACK (priv_nua_i_terminated_cb),
+ NULL);
}