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

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.