Commit f61ee617 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

[#1312] Able to fetch to differentiate incoming/ringing call state

useful when two clients are running. It is now possible to query the call state at any given state.
Function: getStateStr in call.cpp
parent e77a6d08
......@@ -108,9 +108,16 @@ void create_new_call_from_details (const gchar *call_id, GHashTable *details, ca
peer_name = g_strdup ("");
state_str = g_hash_table_lookup (details, "CALL_STATE");
if (g_strcasecmp (state_str, "CURRENT") == 0)
state = CALL_STATE_CURRENT;
else if (g_strcasecmp (state_str, "RINGING") == 0)
state = CALL_STATE_RINGING;
else if (g_strcasecmp (state_str, "INCOMING") == 0)
state = CALL_STATE_INCOMING;
else if (g_strcasecmp (state_str, "HOLD") == 0)
state = CALL_STATE_HOLD;
......
......@@ -486,7 +486,6 @@ AudioRtpRTX::sendSessionFromMic (int timestamp)
int compSize = processDataEncode();
_debug ("compSize: %i ", compSize);
// putData put the data on RTP queue, sendImmediate bypass this queue
_session->putData (timestamp, micDataEncoded, compSize);
// _session->sendImmediate(timestamp, micDataEncoded, compSize);
......
......@@ -86,14 +86,25 @@ std::string
Call::getStateStr ()
{
CallState state = getState();
_debug ("getStateStr , state = %d\n", state);
ConnectionState connection = getConnectionState ();
CallType type = _type;
std::string state_str;
switch (state) {
case Active:
state_str = "CURRENT";
break;
switch (connection) {
case Ringing:
(type == Incoming)? state_str = "INCOMING":state_str = "RINGING";
break;
case Connected:
state_str = "CURRENT";
break;
default:
state_str = "CURRENT";
break;
}
break;
case Hold:
state_str = "HOLD";
......@@ -104,7 +115,17 @@ Call::getStateStr ()
break;
case Inactive:
state_str = "INACTIVE";
switch (connection) {
case Ringing:
(type == Incoming)? state_str = "INCOMING":state_str = "RINGING";
break;
case Connected:
state_str = "CURRENT";
break;
default:
state_str = "INACTIVE";
break;
}
break;
case Refused:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment