diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2010-09-27 00:07:09 +0900 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-09-27 00:07:09 +0900 |
commit | 97b98fc9bf5aeb2201f9634dd807fc6763173295 (patch) | |
tree | b58debf52bc7810309ab8bdb7340279a0dee1fb1 /drivers/huaweimodem | |
parent | c201ffd1974c463c568a1421187513d89d5cf29d (diff) | |
download | ofono-97b98fc9bf5aeb2201f9634dd807fc6763173295.tar.gz |
huaweimodem: Register for voice call specific notifications
Diffstat (limited to 'drivers/huaweimodem')
-rw-r--r-- | drivers/huaweimodem/voicecall.c | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/drivers/huaweimodem/voicecall.c b/drivers/huaweimodem/voicecall.c index e9e4fa5c..85d07811 100644 --- a/drivers/huaweimodem/voicecall.c +++ b/drivers/huaweimodem/voicecall.c @@ -139,6 +139,86 @@ static void ccwa_notify(GAtResult *result, gpointer user_data) DBG("%s %d %d %d", num, num_type, cls, validity); } +static void orig_notify(GAtResult *result, gpointer user_data) +{ + GAtResultIter iter; + gint call_id, call_type; + + g_at_result_iter_init(&iter, result); + + if (!g_at_result_iter_next(&iter, "^ORIG:")) + return; + + if (!g_at_result_iter_next_number(&iter, &call_id)) + return; + + if (!g_at_result_iter_next_number(&iter, &call_type)) + return; + + ofono_info("Call origin: id %d type %d", call_id, call_type); +} + +static void conf_notify(GAtResult *result, gpointer user_data) +{ + GAtResultIter iter; + gint call_id; + + g_at_result_iter_init(&iter, result); + + if (!g_at_result_iter_next(&iter, "^CONF:")) + return; + + if (!g_at_result_iter_next_number(&iter, &call_id)) + return; + + ofono_info("Call setup: id %d", call_id); +} + +static void conn_notify(GAtResult *result, gpointer user_data) +{ + GAtResultIter iter; + gint call_id, call_type; + + g_at_result_iter_init(&iter, result); + + if (!g_at_result_iter_next(&iter, "^CONN:")) + return; + + if (!g_at_result_iter_next_number(&iter, &call_id)) + return; + + if (!g_at_result_iter_next_number(&iter, &call_type)) + return; + + ofono_info("Call connect: id %d type %d", call_id, call_type); +} + +static void cend_notify(GAtResult *result, gpointer user_data) +{ + GAtResultIter iter; + gint call_id, duration, end_status, cc_pause; + + g_at_result_iter_init(&iter, result); + + if (!g_at_result_iter_next(&iter, "^CEND:")) + return; + + if (!g_at_result_iter_next_number(&iter, &call_id)) + return; + + if (!g_at_result_iter_next_number(&iter, &duration)) + return; + + if (!g_at_result_iter_next_number(&iter, &end_status)) + return; + + if (!g_at_result_iter_next_number(&iter, &cc_pause)) + return; + + ofono_info("Call end: id %d duration %ds status %d control %d", + call_id, duration, end_status, cc_pause); +} + static void huawei_voicecall_initialized(gboolean ok, GAtResult *result, gpointer user_data) { @@ -151,6 +231,11 @@ static void huawei_voicecall_initialized(gboolean ok, GAtResult *result, g_at_chat_register(vd->chat, "+CLIP:", clip_notify, FALSE, vc, NULL); g_at_chat_register(vd->chat, "+CCWA:", ccwa_notify, FALSE, vc, NULL); + g_at_chat_register(vd->chat, "^ORIG:", orig_notify, FALSE, vc, NULL); + g_at_chat_register(vd->chat, "^CONF:", conf_notify, FALSE, vc, NULL); + g_at_chat_register(vd->chat, "^CONN:", conn_notify, FALSE, vc, NULL); + g_at_chat_register(vd->chat, "^CEND:", cend_notify, FALSE, vc, NULL); + ofono_voicecall_register(vc); } |