diff --git a/drivers/stemodem/voicecall.c b/drivers/stemodem/voicecall.c index db3b7219..aa5a071a 100644 --- a/drivers/stemodem/voicecall.c +++ b/drivers/stemodem/voicecall.c @@ -533,6 +533,16 @@ static void ecav_notify(GAtResult *result, gpointer user_data) } } +static void ste_voicecall_initialized(gboolean ok, GAtResult *result, + gpointer user_data) +{ + struct ofono_voicecall *vc = user_data; + struct voicecall_data *vd = ofono_voicecall_get_data(vc); + + g_at_chat_register(vd->chat, "*ECAV:", ecav_notify, FALSE, vc, NULL); + ofono_voicecall_register(vc); +} + static int ste_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor, void *data) { @@ -544,9 +554,8 @@ static int ste_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor, ofono_voicecall_set_data(vc, vd); - g_at_chat_send(vd->chat, "AT*ECAM=1", NULL, NULL, NULL, NULL); - g_at_chat_register(vd->chat, "*ECAV:", ecav_notify, FALSE, vc, NULL); - ofono_voicecall_register(vc); + g_at_chat_send(vd->chat, "AT*ECAM=1", none_prefix, + ste_voicecall_initialized, vc, NULL); return 0; }