Open Source Telephony
 help / color / mirror / Atom feed
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis <frederic.danis@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH 3/3] voicecall: remove usage of em_atd_number
Date: Tue, 19 Jul 2011 18:49:11 +0200	[thread overview]
Message-ID: <1311094151-9765-3-git-send-email-frederic.danis@linux.intel.com> (raw)
In-Reply-To: <1311094151-9765-1-git-send-email-frederic.danis@linux.intel.com>

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

as emulator atom can only run with a 'ready' SIM,
use saved number instead of em_atd_number
---
 src/voicecall.c |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/voicecall.c b/src/voicecall.c
index 8815d9e..3e9b5e5 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -74,7 +74,6 @@ struct ofono_voicecall {
 	ofono_voicecall_cb_t release_queue_done_cb;
 	struct ofono_emulator *pending_em;
 	unsigned int pending_id;
-	char *em_atd_number;
 };
 
 struct voicecall {
@@ -1506,14 +1505,14 @@ static int voicecall_dial(struct ofono_voicecall *vc, const char *number,
 
 	string_to_phone_number(number, &ph);
 
-	vc->driver->dial(vc, &ph, clir, cb, vc);
-
 	if (vc->settings) {
 		g_key_file_set_string(vc->settings, SETTINGS_GROUP,
 					"Number", number);
 		storage_sync(vc->imsi, SETTINGS_STORE, vc->settings);
 	}
 
+	vc->driver->dial(vc, &ph, clir, cb, vc);
+
 	return 0;
 }
 
@@ -3153,13 +3152,18 @@ static void emulator_dial_callback(const struct ofono_error *error, void *data)
 	struct ofono_voicecall *vc = data;
 	gboolean need_to_emit;
 	struct voicecall *v;
+	const char *number;
+	GError *err = NULL;
+
+	number = g_key_file_get_string(vc->settings, SETTINGS_GROUP,
+					"Number", &err);
 
-	v = dial_handle_result(vc, error, vc->em_atd_number, &need_to_emit);
+	v = dial_handle_result(vc, error, number, &need_to_emit);
 
 	if (v == NULL) {
 		struct ofono_modem *modem = __ofono_atom_get_modem(vc->atom);
 
-		if (is_emergency_number(vc, vc->em_atd_number) == TRUE)
+		if (is_emergency_number(vc, number) == TRUE)
 			__ofono_modem_dec_emergency_mode(modem);
 	}
 
@@ -3167,8 +3171,6 @@ static void emulator_dial_callback(const struct ofono_error *error, void *data)
 		ofono_emulator_send_final(vc->pending_em, error);
 
 	vc->pending_em = NULL;
-	g_free(vc->em_atd_number);
-	vc->em_atd_number = NULL;
 
 	notify_emulator_call_status(vc);
 
@@ -3190,7 +3192,6 @@ static void emulator_dial(struct ofono_emulator *em, struct ofono_voicecall *vc,
 	}
 
 	vc->pending_em = em;
-	vc->em_atd_number = g_strdup(number);
 
 	err = voicecall_dial(vc, number, OFONO_CLIR_OPTION_DEFAULT,
 					emulator_dial_callback, vc);
@@ -3199,8 +3200,6 @@ static void emulator_dial(struct ofono_emulator *em, struct ofono_voicecall *vc,
 		return;
 
 	vc->pending_em = NULL;
-	g_free(vc->em_atd_number);
-	vc->em_atd_number = NULL;
 
 	switch (err) {
 	case -ENETDOWN:
-- 
1.7.1


  parent reply	other threads:[~2011-07-19 16:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-19 16:49 [PATCH 1/3] voicecall: fix +BLDN in case of SIM not 'ready' =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-07-19 16:49 ` [PATCH 2/3] hfp_ag: start server on sim 'ready' state =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-07-19 17:41   ` Denis Kenzior
2011-07-19 16:49 ` =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis [this message]
2011-07-19 17:56 ` [PATCH 1/3] voicecall: fix +BLDN in case of SIM not 'ready' 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=1311094151-9765-3-git-send-email-frederic.danis@linux.intel.com \
    --to=frederic.danis@linux.intel.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