summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2011-01-12 09:27:40 -0200
committerDenis Kenzior <denkenz@gmail.com>2011-01-18 16:09:27 -0600
commit2f5afc9410047a40eee156a95573e2dd8a2971ce (patch)
treeba5b9d2060cb89a77634e0cc8d4ffb9f74fc2062 /src
parenta3438e0c6dde22cd61bf44f6a5125a854bd1f4e8 (diff)
downloadofono-2f5afc9410047a40eee156a95573e2dd8a2971ce.tar.bz2
voicecall: add support for cdip
Enable oFono to show the identification informed with CDIP.
Diffstat (limited to 'src')
-rw-r--r--src/voicecall.c38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/voicecall.c b/src/voicecall.c
index 97fc36b8..b96c417d 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -370,6 +370,14 @@ static void append_voicecall_properties(struct voicecall *v,
ofono_dbus_dict_append(dict, "LineIdentification",
DBUS_TYPE_STRING, &callerid);
+ if (call->called_number.number[0] != '\0') {
+ const char *calledid;
+
+ calledid = phone_number_to_string(&call->called_number);
+ ofono_dbus_dict_append(dict, "CalledLineIdentification",
+ DBUS_TYPE_STRING, &calledid);
+ }
+
ofono_dbus_dict_append(dict, "Name", DBUS_TYPE_STRING, &name);
if (call->status == CALL_STATUS_ACTIVE ||
@@ -781,6 +789,30 @@ static void voicecall_set_call_lineid(struct voicecall *v,
}
}
+static void voicecall_set_call_calledid(struct voicecall *v,
+ const struct ofono_phone_number *ph)
+{
+ struct ofono_call *call = v->call;
+ DBusConnection *conn = ofono_dbus_get_connection();
+ const char *path;
+ const char *calledid_str;
+
+ if (!strcmp(call->called_number.number, ph->number) &&
+ call->called_number.type == ph->type)
+ return;
+
+ strcpy(call->called_number.number, ph->number);
+ call->called_number.type = ph->type;
+
+ path = voicecall_build_path(v->vc, call);
+ calledid_str = phone_number_to_string(ph);
+
+ ofono_dbus_signal_property_changed(conn, path,
+ OFONO_VOICECALL_INTERFACE, "CalledLineIdentification",
+ DBUS_TYPE_STRING, &calledid_str);
+}
+
+
static void voicecall_set_call_name(struct voicecall *v,
const char *name,
int cnap_validity)
@@ -1916,8 +1948,9 @@ void ofono_voicecall_notify(struct ofono_voicecall *vc,
struct voicecall *v = NULL;
struct ofono_call *newcall;
- DBG("Got a voicecall event, status: %d, id: %u, number: %s",
- call->status, call->id, call->phone_number.number);
+ DBG("Got a voicecall event, status: %d, id: %u, number: %s"
+ " called_number: %s", call->status, call->id,
+ call->phone_number.number, call->called_number.number);
l = g_slist_find_custom(vc->call_list, GUINT_TO_POINTER(call->id),
call_compare_by_id);
@@ -1927,6 +1960,7 @@ void ofono_voicecall_notify(struct ofono_voicecall *vc,
voicecall_set_call_status(l->data, call->status);
voicecall_set_call_lineid(l->data, &call->phone_number,
call->clip_validity);
+ voicecall_set_call_calledid(l->data, &call->called_number);
voicecall_set_call_name(l->data, call->name,
call->cnap_validity);