All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] isimodem: use a specific call id when answering
@ 2011-04-27 12:45 Pekka.Pessi
  2011-04-28 14:28 ` Denis Kenzior
  0 siblings, 1 reply; 3+ messages in thread
From: Pekka.Pessi @ 2011-04-27 12:45 UTC (permalink / raw)
  To: ofono

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

From: Pekka Pessi <Pekka.Pessi@nokia.com>

---
 drivers/isimodem/voicecall.c |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/drivers/isimodem/voicecall.c b/drivers/isimodem/voicecall.c
index 333f9b8..4d4e16b 100644
--- a/drivers/isimodem/voicecall.c
+++ b/drivers/isimodem/voicecall.c
@@ -1480,7 +1480,27 @@ static void isi_dial(struct ofono_voicecall *ovc,
 static void isi_answer(struct ofono_voicecall *ovc, ofono_voicecall_cb_t cb,
 			void *data)
 {
-	isi_call_answer_req(ovc, CALL_ID_ALL, cb, data);
+	struct isi_voicecall *ivc = ofono_voicecall_get_data(ovc);
+	int id;
+
+	for (id = 1; id <= 7; id++) {
+		switch (ivc->calls[id].status) {
+		case CALL_STATUS_COMING:
+		case CALL_STATUS_MT_ALERTING:
+		case CALL_STATUS_WAITING:
+			goto answer;
+		case CALL_STATUS_PROCEEDING:
+			if (ivc->calls[id].mode_info & CALL_MODE_ORIGINATOR)
+				goto answer;
+			break;
+		}
+	}
+
+	CALLBACK_WITH_FAILURE(cb, data);
+	return;
+
+answer:
+	isi_call_answer_req(ovc, id, cb, data);
 }
 
 static void isi_hangup_current(struct ofono_voicecall *ovc,
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] isimodem: use a specific call id when answering
  2011-04-27 12:45 [PATCH] isimodem: use a specific call id when answering Pekka.Pessi
@ 2011-04-28 14:28 ` Denis Kenzior
  2011-05-03 19:10   ` Pekka Pessi
  0 siblings, 1 reply; 3+ messages in thread
From: Denis Kenzior @ 2011-04-28 14:28 UTC (permalink / raw)
  To: ofono

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

Hi Pekka,

On 04/27/2011 07:45 AM, Pekka.Pessi(a)nokia.com wrote:
> From: Pekka Pessi <Pekka.Pessi@nokia.com>
> 
> ---
>  drivers/isimodem/voicecall.c |   22 +++++++++++++++++++++-
>  1 files changed, 21 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/isimodem/voicecall.c b/drivers/isimodem/voicecall.c
> index 333f9b8..4d4e16b 100644
> --- a/drivers/isimodem/voicecall.c
> +++ b/drivers/isimodem/voicecall.c
> @@ -1480,7 +1480,27 @@ static void isi_dial(struct ofono_voicecall *ovc,
>  static void isi_answer(struct ofono_voicecall *ovc, ofono_voicecall_cb_t cb,
>  			void *data)
>  {
> -	isi_call_answer_req(ovc, CALL_ID_ALL, cb, data);
> +	struct isi_voicecall *ivc = ofono_voicecall_get_data(ovc);
> +	int id;
> +
> +	for (id = 1; id <= 7; id++) {
> +		switch (ivc->calls[id].status) {
> +		case CALL_STATUS_COMING:
> +		case CALL_STATUS_MT_ALERTING:
> +		case CALL_STATUS_WAITING:

oFono expects answer to only work on 'incoming' calls in the traditional
sense.  Is waiting status equivalent to CCWA here? If so, it might be
better to leave it out here.

> +			goto answer;
> +		case CALL_STATUS_PROCEEDING:
> +			if (ivc->calls[id].mode_info & CALL_MODE_ORIGINATOR)
> +				goto answer;
> +			break;
> +		}
> +	}
> +
> +	CALLBACK_WITH_FAILURE(cb, data);
> +	return;
> +
> +answer:
> +	isi_call_answer_req(ovc, id, cb, data);
>  }
>  
>  static void isi_hangup_current(struct ofono_voicecall *ovc,

Regards,
-Denis

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] isimodem: use a specific call id when answering
  2011-04-28 14:28 ` Denis Kenzior
@ 2011-05-03 19:10   ` Pekka Pessi
  0 siblings, 0 replies; 3+ messages in thread
From: Pekka Pessi @ 2011-05-03 19:10 UTC (permalink / raw)
  To: ofono

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

Hi Denis,

2011/4/28 Denis Kenzior <denkenz@gmail.com>:
'>> +     for (id = 1; id <= 7; id++) {
>> +             switch (ivc->calls[id].status) {
>> +             case CALL_STATUS_COMING:
>> +             case CALL_STATUS_MT_ALERTING:
>> +             case CALL_STATUS_WAITING:
>
> oFono expects answer to only work on 'incoming' calls in the traditional
> sense.  Is waiting status equivalent to CCWA here? If so, it might be
> better to leave it out here.

isi_answer() is called by both .answer and .release_all_active
methods, so I included the WAITING state here, too.

Answering a waiting call is a tricky, I'll try to see if it can be
made in a more robust manner.

-- 
Pekka.Pessi mail at nokia.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-03 19:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-27 12:45 [PATCH] isimodem: use a specific call id when answering Pekka.Pessi
2011-04-28 14:28 ` Denis Kenzior
2011-05-03 19:10   ` Pekka Pessi

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.