diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-12-04 16:25:41 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-12-04 16:52:31 -0600 |
commit | 752c5af2f0a52be788dbceb62e6bed91a87f5194 (patch) | |
tree | 49775b4bea410c24a3907cd47b5674e106649ef9 | |
parent | 8e258ff54bf9242168fea5e8c9ae680b0edd7d9a (diff) | |
download | ofono-752c5af2f0a52be788dbceb62e6bed91a87f5194.tar.bz2 |
Update voicecall atom to use new callid api
-rw-r--r-- | src/voicecall.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/voicecall.c b/src/voicecall.c index 8a73de27..82fcbc62 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -854,7 +854,7 @@ static struct ofono_call *synthesize_outgoing_call(struct ofono_voicecall *vc, if (!call) return call; - call->id = __ofono_modem_alloc_callid(modem); + call->id = __ofono_modem_callid_next(modem); if (call->id == 0) { ofono_error("Failed to alloc callid, too many calls"); @@ -862,6 +862,8 @@ static struct ofono_call *synthesize_outgoing_call(struct ofono_voicecall *vc, return NULL; } + __ofono_modem_callid_hold(modem, call->id); + if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &number, DBUS_TYPE_INVALID) == FALSE) number = ""; @@ -1473,6 +1475,8 @@ void ofono_voicecall_disconnected(struct ofono_voicecall *vc, int id, ofono_debug("Got disconnection event for id: %d, reason: %d", id, reason); + __ofono_modem_callid_release(modem, id); + l = g_slist_find_custom(vc->call_list, GUINT_TO_POINTER(id), call_compare_by_id); @@ -1504,8 +1508,6 @@ void ofono_voicecall_disconnected(struct ofono_voicecall *vc, int id, vc->release_list = g_slist_remove(vc->release_list, call); - __ofono_modem_release_callid(modem, id); - if (reason != OFONO_DISCONNECT_REASON_UNKNOWN) voicecall_emit_disconnect_reason(call, reason); @@ -1550,6 +1552,8 @@ void ofono_voicecall_notify(struct ofono_voicecall *vc, ofono_debug("Did not find a call with id: %d\n", call->id); + __ofono_modem_callid_hold(modem, call->id); + newcall = g_memdup(call, sizeof(struct ofono_call)); if (!newcall) { @@ -1557,12 +1561,6 @@ void ofono_voicecall_notify(struct ofono_voicecall *vc, goto err; } - if (__ofono_modem_alloc_callid(modem) != call->id) { - ofono_error("Warning: Call id and internally tracked id" - " do not correspond"); - goto err; - } - v = voicecall_create(vc, newcall); if (!v) { |