From a9906a602583ae945fdc0f2f91c4bd2e184f62f0 Mon Sep 17 00:00:00 2001 From: Pekka Pessi Date: Wed, 5 Nov 2008 11:14:33 +0200 Subject: Subscribe signals before requesting instance status --- audio/telephony-maemo.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'audio/telephony-maemo.c') diff --git a/audio/telephony-maemo.c b/audio/telephony-maemo.c index 713a618d..20ce8825 100644 --- a/audio/telephony-maemo.c +++ b/audio/telephony-maemo.c @@ -1417,6 +1417,18 @@ int telephony_init(void) return -EIO; } + snprintf(match_string, sizeof(match_string), + "type=signal,interface=%s", CSD_CALL_INTERFACE); + dbus_bus_add_match(connection, match_string, NULL); + + snprintf(match_string, sizeof(match_string), + "type=signal,interface=%s", CSD_CALL_INSTANCE); + dbus_bus_add_match(connection, match_string, NULL); + + snprintf(match_string, sizeof(match_string), + "type=signal,interface=%s", NETWORK_INTERFACE); + dbus_bus_add_match(connection, match_string, NULL); + msg = dbus_message_new_method_call(CSD_CALL_BUS_NAME, CSD_CALL_PATH, CSD_CALL_INTERFACE, "GetCallInfoAll"); @@ -1435,22 +1447,6 @@ int telephony_init(void) dbus_pending_call_unref(call); dbus_message_unref(msg); - snprintf(match_string, sizeof(match_string), - "type=signal,interface=%s", CSD_CALL_INTERFACE); - dbus_bus_add_match(connection, match_string, NULL); - - snprintf(match_string, sizeof(match_string), - "type=signal,interface=%s", CSD_CALL_INSTANCE); - dbus_bus_add_match(connection, match_string, NULL); - - snprintf(match_string, sizeof(match_string), - "type=signal,interface=%s", CSD_CALL_INSTANCE); - dbus_bus_add_match(connection, match_string, NULL); - - snprintf(match_string, sizeof(match_string), - "type=signal,interface=%s", NETWORK_INTERFACE); - dbus_bus_add_match(connection, match_string, NULL); - return 0; } -- cgit