mirror of git://git.sysmocom.de/ofono
Add call waiting support in CDMA voice call
This commit is contained in:
parent
1dc0597f36
commit
42c50e2dc3
|
@ -40,6 +40,7 @@ static GSList *g_drivers;
|
|||
|
||||
struct ofono_cdma_voicecall {
|
||||
struct ofono_cdma_phone_number phone_number;
|
||||
struct ofono_cdma_phone_number waiting_number;
|
||||
int direction;
|
||||
enum cdma_call_status status;
|
||||
time_t start_time;
|
||||
|
@ -108,14 +109,33 @@ static void append_voicecall_properties(struct ofono_cdma_voicecall *vc,
|
|||
{
|
||||
const char *status;
|
||||
const char *lineid;
|
||||
const char *waiting_call = NULL;
|
||||
ofono_bool_t call_waiting;
|
||||
|
||||
status = cdma_call_status_to_string(vc->status);
|
||||
lineid = cdma_phone_number_to_string(&vc->phone_number);
|
||||
|
||||
ofono_dbus_dict_append(dict, "State", DBUS_TYPE_STRING, &status);
|
||||
|
||||
ofono_dbus_dict_append(dict, "LineIdentification",
|
||||
DBUS_TYPE_STRING, &lineid);
|
||||
if (vc->status != CDMA_CALL_STATUS_DISCONNECTED) {
|
||||
if (vc->phone_number.number[0] != '\0') {
|
||||
lineid = cdma_phone_number_to_string(&vc->phone_number);
|
||||
ofono_dbus_dict_append(dict, "LineIdentification",
|
||||
DBUS_TYPE_STRING, &lineid);
|
||||
}
|
||||
|
||||
if (vc->waiting_number.number[0] != '\0') {
|
||||
waiting_call = cdma_phone_number_to_string(
|
||||
&vc->waiting_number);
|
||||
|
||||
ofono_dbus_dict_append(dict, "CallWaitingNumber",
|
||||
DBUS_TYPE_STRING, &waiting_call);
|
||||
}
|
||||
}
|
||||
|
||||
call_waiting = (waiting_call != NULL);
|
||||
|
||||
ofono_dbus_dict_append(dict, "CallWaiting",
|
||||
DBUS_TYPE_BOOLEAN, &call_waiting);
|
||||
|
||||
if (vc->status == CDMA_CALL_STATUS_ACTIVE) {
|
||||
const char *timestr = time_to_str(&vc->start_time);
|
||||
|
@ -172,6 +192,7 @@ static void voicecall_set_call_status(struct ofono_cdma_voicecall *vc,
|
|||
const char *status_str;
|
||||
enum cdma_call_status old_status;
|
||||
|
||||
DBG("status: %s", cdma_call_status_to_string(status));
|
||||
if (vc->status == status)
|
||||
return;
|
||||
|
||||
|
@ -198,6 +219,14 @@ static void voicecall_set_call_status(struct ofono_cdma_voicecall *vc,
|
|||
"StartTime", DBUS_TYPE_STRING,
|
||||
×tr);
|
||||
}
|
||||
|
||||
if (status == CDMA_CALL_STATUS_DISCONNECTED) {
|
||||
memset(&vc->phone_number, 0,
|
||||
sizeof(struct ofono_cdma_phone_number));
|
||||
|
||||
memset(&vc->waiting_number, 0,
|
||||
sizeof(struct ofono_cdma_phone_number));
|
||||
}
|
||||
}
|
||||
|
||||
static void voicecall_set_call_lineid(struct ofono_cdma_voicecall *vc)
|
||||
|
|
Loading…
Reference in New Issue