summaryrefslogtreecommitdiffstats
path: root/drivers/huaweimodem
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-09-26 22:34:24 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-09-26 22:34:24 -0500
commit7d101199463ab3235d87418d60ea591d38569a5a (patch)
treea1b8b2338c4b3d16fa0403f5405cc93f0a5e6f25 /drivers/huaweimodem
parent9d1aac47e7ab60b72dbfe5909784c089d903ff0c (diff)
downloadofono-7d101199463ab3235d87418d60ea591d38569a5a.tar.bz2
huawei: Track outgoing calls
Diffstat (limited to 'drivers/huaweimodem')
-rw-r--r--drivers/huaweimodem/voicecall.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/huaweimodem/voicecall.c b/drivers/huaweimodem/voicecall.c
index 63f60312..547fd522 100644
--- a/drivers/huaweimodem/voicecall.c
+++ b/drivers/huaweimodem/voicecall.c
@@ -49,7 +49,8 @@ struct voicecall_data {
static struct ofono_call *create_call(struct ofono_voicecall *vc, int type,
int direction, int status,
- const char *num, int num_type, int clip)
+ const char *num, int num_type,
+ int clip, int id)
{
struct voicecall_data *d = ofono_voicecall_get_data(vc);
struct ofono_call *call;
@@ -59,7 +60,7 @@ static struct ofono_call *create_call(struct ofono_voicecall *vc, int type,
if (!call)
return NULL;
- call->id = ofono_voicecall_get_next_callid(vc);
+ call->id = id;
call->type = type;
call->direction = direction;
call->status = status;
@@ -168,6 +169,7 @@ static void cring_notify(GAtResult *result, gpointer user_data)
GAtResultIter iter;
const char *line;
int type;
+ int id;
/* CRING can repeat, ignore if we already have an incoming call */
if (g_slist_find_custom(vd->calls, GINT_TO_POINTER(4),
@@ -189,8 +191,10 @@ static void cring_notify(GAtResult *result, gpointer user_data)
else
type = 9;
+ id = ofono_voicecall_get_next_callid(vc);
+
/* Generate an incoming call */
- create_call(vc, type, 1, 4, NULL, 128, 2);
+ create_call(vc, type, 1, 4, NULL, 128, 2, id);
/* Assume the CLIP always arrives, and we signal the call there */
DBG("%d", type);
@@ -287,8 +291,10 @@ static void ccwa_notify(GAtResult *result, gpointer user_data)
static void orig_notify(GAtResult *result, gpointer user_data)
{
+ struct ofono_voicecall *vc = user_data;
GAtResultIter iter;
gint call_id, call_type;
+ struct ofono_call *call;
g_at_result_iter_init(&iter, result);
@@ -302,6 +308,15 @@ static void orig_notify(GAtResult *result, gpointer user_data)
return;
ofono_info("Call origin: id %d type %d", call_id, call_type);
+
+ call = create_call(vc, call_type, 0, 2, NULL, 128, 2, call_id);
+ if (!call) {
+ ofono_error("Unable to malloc, call tracking will fail!");
+ return;
+ }
+
+ if (call_type == 0)
+ ofono_voicecall_notify(vc, call);
}
static void conf_notify(GAtResult *result, gpointer user_data)