Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [isi-voicecall-fix PATCHv3 4/6] isi/voicecall: fix answering early incoming calls
Date: Mon, 22 Nov 2010 08:19:10 -0600	[thread overview]
Message-ID: <4CEA7BDE.9060405@gmail.com> (raw)
In-Reply-To: <1289927124-30133-4-git-send-email-Pekka.Pessi@nokia.com>

[-- Attachment #1: Type: text/plain, Size: 2887 bytes --]

Hi Pekka,

On 11/16/2010 11:05 AM, Pekka.Pessi(a)nokia.com wrote:
> From: Pekka Pessi <Pekka.Pessi@nokia.com>
> 
> The voicecall driver must wait until the incoming call is mt-alerting or
> waiting before answering.
> ---
>  drivers/isimodem/voicecall.c |   49 +++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 48 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/isimodem/voicecall.c b/drivers/isimodem/voicecall.c
> index 60052d4..76aa8f5 100644
> --- a/drivers/isimodem/voicecall.c
> +++ b/drivers/isimodem/voicecall.c
> @@ -671,18 +671,65 @@ static void isi_call_status_ind_cb(GIsiClient *client,
>  		isi_call_notify(ovc, call);
>  }
>  
> +static void isi_wait_incoming(struct isi_call_req_context *irc, int event);
> +

Why is there a forward declaration for a static function?

>  static struct isi_call_req_context *
>  isi_call_answer_req(struct ofono_voicecall *ovc,
>  			uint8_t call_id, ofono_voicecall_cb_t cb, void *data)
>  {
> +	struct isi_voicecall *ivc = ofono_voicecall_get_data(ovc);
> +	int id;
> +
>  	uint8_t const req[] = {
>  		CALL_ANSWER_REQ, call_id, 0
>  	};
>  	size_t rlen = sizeof req;
>  
> +	for (id = 1; id <= 7; id++) {
> +		struct isi_call_req_context *irc;
> +
> +		if (!(ivc->calls[id].mode_info & CALL_MODE_ORIGINATOR))
> +			continue;
> +
> +		if (ivc->calls[id].status != CALL_STATUS_PROCEEDING &&
> +				ivc->calls[id].status != CALL_STATUS_COMING)
> +			continue;
> +
> +		irc = isi_call_req_new(ovc, cb, data);
> +		if (irc)

Why not simply

if (irc == NULL)
	return NULL

> +			isi_ctx_queue(irc, isi_wait_incoming, id);
> +
> +		return irc;
> +	}
> +
>  	return isi_call_req(ovc, req, rlen, isi_call_answer_resp, cb, data);
>  }
>  
> +static void isi_wait_incoming(struct isi_call_req_context *irc,
> +				int event)
> +{
> +	struct isi_voicecall *ivc;
> +
> +	DBG("irc=%p event=%u", (void *)irc, event);
> +
> +	switch (event) {
> +	case CALL_STATUS_MT_ALERTING:
> +	case CALL_STATUS_WAITING:
> +		isi_call_answer_req(irc->ovc, irc->id, irc->cb, irc->data);
> +		isi_ctx_free(irc);
> +		return;
> +	}
> +
> +	ivc = ofono_voicecall_get_data(irc->ovc);

Rule M1 again

> +	switch (ivc->calls[irc->id].status) {
> +	case CALL_STATUS_MO_RELEASE:
> +	case CALL_STATUS_MT_RELEASE:
> +	case CALL_STATUS_TERMINATED:
> +	case CALL_STATUS_IDLE:
> +		isi_ctx_return_failure(irc);
> +	}
> +}
> +
>  static gboolean isi_call_answer_resp(GIsiClient *client,
>  					void const *restrict data,
>  					size_t len,
> @@ -1018,7 +1065,7 @@ static void isi_hangup_current(struct ofono_voicecall *ovc,
>  	 * active calls or calls in progress.
>  	 */
>  	struct isi_voicecall *ivc = ofono_voicecall_get_data(ovc);
> -	int id = 0;
> +	int id;
>  
>  	for (id = 1; id <= 7; id++) {
>  		if (ivc->calls[id].call_id & CALL_ID_WAITING)


  parent reply	other threads:[~2010-11-22 14:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16 17:05 [isi-voicecall-fix PATCHv3 1/6] voicecall: fix dial result handling Pekka.Pessi
2010-11-16 17:05 ` [isi-voicecall-fix PATCHv3 2/6] isi/voicecall: fix status reporting Pekka.Pessi
2010-11-16 17:05   ` [isi-voicecall-fix PATCHv3 3/6] isi/voicecall: save call id when queueing requests Pekka.Pessi
2010-11-16 17:05     ` [isi-voicecall-fix PATCHv3 4/6] isi/voicecall: fix answering early incoming calls Pekka.Pessi
2010-11-16 17:05       ` [isi-voicecall-fix PATCHv3 5/6] isi/voicecall: release COMING calls with BUSY cause Pekka.Pessi
2010-11-16 17:05         ` [isi-voicecall-fix PATCHv3 6/6] isi/voicecall: fix isi_release_all_active() Pekka.Pessi
2010-11-22 14:21         ` [isi-voicecall-fix PATCHv3 5/6] isi/voicecall: release COMING calls with BUSY cause Denis Kenzior
2010-11-22 14:19       ` Denis Kenzior [this message]
2010-11-22 16:22         ` [isi-voicecall-fix PATCHv3 4/6] isi/voicecall: fix answering early incoming calls Pekka Pessi
2010-11-22 16:38           ` Denis Kenzior
2010-11-22 14:16     ` [isi-voicecall-fix PATCHv3 3/6] isi/voicecall: save call id when queueing requests Denis Kenzior
2010-11-22 14:14   ` [isi-voicecall-fix PATCHv3 2/6] isi/voicecall: fix status reporting Denis Kenzior
2010-11-22 16:09     ` Pekka Pessi
2010-11-22 16:37       ` Denis Kenzior
2010-11-22 13:43 ` [isi-voicecall-fix PATCHv3 1/6] voicecall: fix dial result handling Denis Kenzior
2010-11-22 16:50   ` Pekka Pessi
2010-11-22 17:27     ` Denis Kenzior

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=4CEA7BDE.9060405@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