From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH] Synchronize call status in case of Hangup error
Date: Tue, 04 Aug 2015 23:34:29 -0500 [thread overview]
Message-ID: <55C19255.9080604@gmail.com> (raw)
In-Reply-To: <1438704016-24150-1-git-send-email-kubax.t.pawlak@intel.com>
[-- Attachment #1: Type: text/plain, Size: 2058 bytes --]
Hi Kuba,
On 08/04/2015 11:00 AM, Kuba Pawlak wrote:
> It is possible for the phone to accept Dial request
> but not actually dial. This leaves a voicecall object
> in state 'dialling' that cannot be removed.
> Proposed workaround is to trigger AT+CLCC when an error
> is returned for Hangup. As the call is not on the list,
> this would remove this hanging object and signal CallRemoved.
> ---
> drivers/hfpmodem/voicecall.c | 16 +++++++++++++---
> 1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/hfpmodem/voicecall.c b/drivers/hfpmodem/voicecall.c
> index e3e6e0f5eccbbd61972c4b823c8093dd227e4bb9..06ad216b91bcbe99f9632f3c129a8f61756fd585 100644
> --- a/drivers/hfpmodem/voicecall.c
> +++ b/drivers/hfpmodem/voicecall.c
> @@ -318,21 +318,31 @@ static void generic_cb(gboolean ok, GAtResult *result, gpointer user_data)
> struct change_state_req *req = user_data;
> struct voicecall_data *vd = ofono_voicecall_get_data(req->vc);
> struct ofono_error error;
> + unsigned int num_calls = 0;
>
> decode_at_error(&error, g_at_result_final_response(result));
>
> - if (ok && req->affected_types) {
> + if (req->affected_types) {
Would it not be far easier to simply add an if statement at the end.
Something like:
if (!ok && vd->calls)
g_at_chat_send(vd->chat, "AT+CLCC", clcc_prefix,
clcc_poll_cb, req->vc, NULL);
> GSList *l;
> struct ofono_call *call;
>
> for (l = vd->calls; l; l = l->next) {
> call = l->data;
>
> - if (req->affected_types & (1 << call->status))
> - vd->local_release |= (1 << call->id);
> + if (req->affected_types & (1 << call->status)) {
> + if (ok)
> + vd->local_release |= (1 << call->id);
> + else
> + num_calls++;
> + }
> }
> }
>
> + /* AG returned an error, but some calls are present, resync*/
> + if (num_calls)
> + g_at_chat_send(vd->chat, "AT+CLCC", clcc_prefix,
> + clcc_poll_cb, req->vc, NULL);
> +
> req->cb(&error, req->data);
> }
>
>
Regards,
-Denis
prev parent reply other threads:[~2015-08-05 4:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-04 16:00 [PATCH] Synchronize call status in case of Hangup error Kuba Pawlak
2015-08-05 4:34 ` Denis Kenzior [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55C19255.9080604@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox