g_dbus_send_message(conn, signal);
}
+static void cancel_pending_dtmf(struct ofono_stk *stk)
+{
+ struct ofono_voicecall *vc = NULL;
+ struct ofono_atom *vc_atom;
+
+ vc_atom = __ofono_modem_find_atom(__ofono_atom_get_modem(stk->atom),
+ OFONO_ATOM_TYPE_VOICECALL);
+ if (vc_atom)
+ vc = __ofono_atom_get_data(vc_atom);
+
+ if (vc) /* Should be always true here */
+ __ofono_voicecall_tone_cancel(vc, stk->dtmf_id);
+}
+
static void user_termination_cb(enum stk_agent_result result, void *user_data)
{
struct ofono_stk *stk = user_data;
- if (result == STK_AGENT_RESULT_TERMINATE)
- send_simple_response(stk, STK_RESULT_TYPE_USER_TERMINATED);
+ if (result != STK_AGENT_RESULT_TERMINATE)
+ return;
+
+ switch (stk->pending_cmd->type) {
+ case STK_COMMAND_TYPE_SEND_DTMF:
+ cancel_pending_dtmf(stk);
+ break;
+ }
+
+ send_simple_response(stk, STK_RESULT_TYPE_USER_TERMINATED);
}
static void stk_alpha_id_set(struct ofono_stk *stk,
static void send_dtmf_cancel(struct ofono_stk *stk)
{
- struct ofono_voicecall *vc = NULL;
- struct ofono_atom *vc_atom;
-
- vc_atom = __ofono_modem_find_atom(__ofono_atom_get_modem(stk->atom),
- OFONO_ATOM_TYPE_VOICECALL);
- if (vc_atom)
- vc = __ofono_atom_get_data(vc_atom);
-
- if (vc) /* Should be always true here */
- __ofono_voicecall_tone_cancel(vc, stk->dtmf_id);
-
+ cancel_pending_dtmf(stk);
stk_alpha_id_unset(stk);
}