diff options
author | Pekka Pessi <Pekka.Pessi@nokia.com> | 2010-10-06 17:52:16 +0300 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-10-10 05:52:30 -0500 |
commit | b654e723c7002d07f4d702beeb27e325e2996201 (patch) | |
tree | fb68a1af4e9a4eb1582e4101c52c4046e90a7a66 /src/ussd.c | |
parent | 919e305aa157f2f283f46ec83d47f11415a96fac (diff) | |
download | ofono-b654e723c7002d07f4d702beeb27e325e2996201.tar.bz2 |
ussd: pass call_in_progress to valid_ussd_string
Query the voicecall atom whether a call is in progress and pass this
information along to valid_ussd_string.
Diffstat (limited to 'src/ussd.c')
-rw-r--r-- | src/ussd.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -545,6 +545,9 @@ static DBusMessage *ussd_initiate(DBusConnection *conn, DBusMessage *msg, void *data) { struct ofono_ussd *ussd = data; + struct ofono_modem *modem = __ofono_atom_get_modem(ussd->atom); + struct ofono_atom *vca; + gboolean call_in_progress; const char *str; int dcs = 0x0f; unsigned char buf[160]; @@ -564,8 +567,17 @@ static DBusMessage *ussd_initiate(DBusConnection *conn, DBusMessage *msg, if (recognized_control_string(ussd, str, msg)) return NULL; + vca = __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_VOICECALL); + + if (vca) + call_in_progress = + __ofono_voicecall_is_busy(__ofono_atom_get_data(vca), + OFONO_VOICECALL_INTERACTION_NONE); + else + call_in_progress = FALSE; + DBG("No.., checking if this is a USSD string"); - if (!valid_ussd_string(str, FALSE)) + if (!valid_ussd_string(str, call_in_progress)) return __ofono_error_invalid_format(msg); if (!ussd_encode(str, &num_packed, buf)) |