* [PATCH] callmanager: change state of waiting call
@ 2011-04-15 12:29 Nicolas Bertrand
2011-04-19 17:01 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Bertrand @ 2011-04-15 12:29 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2536 bytes --]
becomes incoming when all active and held are released
---
src/callmanager.cpp | 25 +++++++++++++++++++++----
src/callmanager.h | 3 +++
2 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/src/callmanager.cpp b/src/callmanager.cpp
index be17b83..929c182 100644
--- a/src/callmanager.cpp
+++ b/src/callmanager.cpp
@@ -409,6 +409,9 @@ void CallManager::hangupConnected()
}
}
callList = newCallList;
+
+ if ( !hasCall( CallState_Held ) )
+ waitingToIncoming();
}
void CallManager::hangupHeld()
@@ -423,6 +426,9 @@ void CallManager::hangupHeld()
}
}
callList = newCallList;
+
+ if ( !hasCall( CallState_Active ) )
+ waitingToIncoming();
}
void CallManager::hangupConnectedAndHeld()
@@ -438,6 +444,7 @@ void CallManager::hangupConnectedAndHeld()
}
}
callList = newCallList;
+ waitingToIncoming();
}
void CallManager::hangupCall( int id )
@@ -508,10 +515,6 @@ bool CallManager::chld1()
// We only have active calls - hang them up.
hangupConnected();
return true;
- } else if ( hasCall( CallState_Active ) ) {
- // We only have active calls - hang them up.
- hangupConnected();
- return true;
} else if ( ( id = idForDialing() ) >= 0 ) {
// We have a dialing call.
hangupCall(id);
@@ -544,6 +547,10 @@ bool CallManager::chld1x( int x )
}
}
callList = newCallList;
+
+ if ( !hasCall( CallState_Active ) && !hasCall( CallState_Held ) )
+ waitingToIncoming();
+
return found;
}
@@ -709,6 +716,16 @@ void CallManager::dialingToAlerting()
sendState( callList[index] );
}
+void CallManager::waitingToIncoming()
+{
+ int index = indexForId( idForState( CallState_Waiting ) );
+ if ( index < 0 )
+ return;
+
+ callList[index].state = CallState_Incoming;
+ sendState( callList[index] );
+}
+
void CallManager::dialBack()
{
startIncomingCall( "1234567", "7654321", "Alice", true );
diff --git a/src/callmanager.h b/src/callmanager.h
index 90cb9bd..5876c87 100644
--- a/src/callmanager.h
+++ b/src/callmanager.h
@@ -121,6 +121,9 @@ private slots:
// Transition the active dialing call to alerting.
void dialingToAlerting();
+ // Transition the waiting call to incoming.
+ void waitingToIncoming();
+
// Handle dial-backs.
void dialBack();
void dialBackWithHangup5();
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] callmanager: change state of waiting call
2011-04-15 12:29 [PATCH] callmanager: change state of waiting call Nicolas Bertrand
@ 2011-04-19 17:01 ` Denis Kenzior
0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2011-04-19 17:01 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1084 bytes --]
Hi Nicolas,
On 04/15/2011 07:29 AM, Nicolas Bertrand wrote:
> becomes incoming when all active and held are released
>
> ---
> src/callmanager.cpp | 25 +++++++++++++++++++++----
> src/callmanager.h | 3 +++
> 2 files changed, 24 insertions(+), 4 deletions(-)
>
Patch has been applied, thanks.
> @@ -709,6 +716,16 @@ void CallManager::dialingToAlerting()
> sendState( callList[index] );
> }
>
> +void CallManager::waitingToIncoming()
> +{
> + int index = indexForId( idForState( CallState_Waiting ) );
> + if ( index < 0 )
> + return;
Quick nitpick: could you please make sure to use spaces for indentation
in phonesim. Phonesim codebase was developed according to a different
coding style and we should just conform to it, at least as much as
possible. I fixed this for you and amended the commit.
> +
> + callList[index].state = CallState_Incoming;
> + sendState( callList[index] );
> +}
> +
> void CallManager::dialBack()
> {
> startIncomingCall( "1234567", "7654321", "Alice", true );
Regards,
-Denis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-04-19 17:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-15 12:29 [PATCH] callmanager: change state of waiting call Nicolas Bertrand
2011-04-19 17:01 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.