Using Dialplan Functions through ARI

I saw that there was a set of dialplan functions here Asterisk 18 Dialplan Functions - Asterisk Project - Asterisk Project Wiki, and I wanted to ask how can i use the speech ones? I managed to use the TALK_DETECT like this

h *ari.ChannelHandle

if err := h.SetVariable("TALK_DETECT(set)", "3000"); err != nil {
	log.Error("that variable doesn't exist", "error", err)
	return
}

for {
select {
case <-ctx.Done():
log.Info(“Application ended”)
return
case event := <-subscription.Events():
switch event.GetType() {
case ari.Events.ChannelTalkingStarted:
log.Info(“Speech detected on channel:”, “channel”, h.ID())
case ari.Events.ChannelTalkingFinished:
log.Info(“Speech ended on channel:”, “channel”, h.ID())
}
}
}

But I have no idea of how to use the speech ones.

The speech ones can’t really be used from ARI. They control the dialplan applications or exist as a result of them, and dialplan applications are not executable in ARI. You would have to send the channel to the dialplan.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.