diff options
author | Pekka Pessi <Pekka.Pessi@nokia.com> | 2010-11-26 17:14:49 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-12-03 13:21:32 -0600 |
commit | da444beb2d101e46988743e40794189e26b10407 (patch) | |
tree | 1fb9eea69b15f382769ce5e7e2dfb26d3cd0162d /src | |
parent | 7c3a800267c74e8cf56bf18bfac241385570a0f2 (diff) | |
download | ofono-da444beb2d101e46988743e40794189e26b10407.tar.bz2 |
voicecall: fix dial result handling
The existing call will be automatically put on hold if there is an
existing active call when dialing. On some modems the dial request
returns only after the dialed call is active and the existing call has
been put on hold.
However, on isimodem driver the dial request returns immediately before
the existing call has changed its status. With isimodem driver the
dial_handle_result() selected the existing call from the list when it
should have created a new one.
The dial result handling now guards againt returning a previously dialed
active call as result.
Diffstat (limited to 'src')
-rw-r--r-- | src/voicecall.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/voicecall.c b/src/voicecall.c index d52428f8..dbf3e9ad 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -68,6 +68,7 @@ struct voicecall { char *message; uint8_t icon_id; gboolean untracked; + gboolean dial_result_handled; }; struct dial_request { @@ -1092,9 +1093,18 @@ static struct voicecall *dial_handle_result(struct ofono_voicecall *vc, v = l->data; if (v->call->status == CALL_STATUS_DIALING || - v->call->status == CALL_STATUS_ALERTING || - v->call->status == CALL_STATUS_ACTIVE) - return v; + v->call->status == CALL_STATUS_ALERTING) + goto handled; + + /* + * Dial request may return before existing active call + * is put on hold or after dialed call has got active + */ + if (v->call->status == CALL_STATUS_ACTIVE && + v->call->direction == + CALL_DIRECTION_MOBILE_ORIGINATED && + !v->dial_result_handled) + goto handled; } call = synthesize_outgoing_call(vc, number); @@ -1115,6 +1125,9 @@ static struct voicecall *dial_handle_result(struct ofono_voicecall *vc, *need_to_emit = TRUE; +handled: + v->dial_result_handled = TRUE; + return v; } |