[telepathy-sofiasip/master] More elaborate handling of 404: regard the call state
Mikhail Zabaluev
mikhail.zabaluev at nokia.com
Wed Apr 8 10:21:39 PDT 2009
If the peer is known to have been contacted, emit the member removal reason
NoAnswer. Otherwise, emit Offline.
---
src/sip-media-channel.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/src/sip-media-channel.c b/src/sip-media-channel.c
index 79db4c2..befef29 100644
--- a/src/sip-media-channel.c
+++ b/src/sip-media-channel.c
@@ -939,6 +939,16 @@ priv_nua_i_invite_cb (TpsipMediaChannel *self,
return TRUE;
}
+static guint
+tpsip_media_channel_get_call_state (TpsipMediaChannel *self,
+ TpHandle peer)
+{
+ TpsipMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self);
+
+ return GPOINTER_TO_UINT (g_hash_table_lookup (priv->call_states,
+ GUINT_TO_POINTER (peer)));
+}
+
static void
tpsip_media_channel_peer_error (TpsipMediaChannel *self,
TpHandle peer,
@@ -966,6 +976,12 @@ tpsip_media_channel_peer_error (TpsipMediaChannel *self,
case 480:
reason = TP_CHANNEL_GROUP_CHANGE_REASON_OFFLINE;
break;
+ case 404:
+ reason = (tpsip_media_channel_get_call_state (self, peer)
+ & (TP_CHANNEL_CALL_STATE_RINGING | TP_CHANNEL_CALL_STATE_QUEUED))
+ ? TP_CHANNEL_GROUP_CHANGE_REASON_NO_ANSWER
+ : TP_CHANNEL_GROUP_CHANGE_REASON_OFFLINE;
+ break;
case 603:
/* No reason means roughly "rejected" */
reason = TP_CHANNEL_GROUP_CHANGE_REASON_NONE;
--
1.5.6.5
More information about the telepathy-commits
mailing list