mod_avmd beep detected event or session variable
Prior to mod_avmd getting updated, I would call avmd with the "start" command and find the detection in javascript via: function onDTMFOrEvent(s, type, obj, arg) { try { if(type == "event" && session.getVariable("avmd_detect") == "TRUE") { console_log("info", "Voicemail Detected\n"); //session.execute("avmd", "stop"); //Deprecated session.execute("avmd_stop"); return false; } } catch (e) { console_log("err", e + "\n"); } return true; } The key line was if(type == "event" && session.getVariable("avmd_detect") == "TRUE"), but the new documentation mentions the "beep detected" event name which can be subscribed with "event plain CUSTOM avmd::beep" which will have the Beep-Status custom field which should have "DETECTED" . Finding that particular event and status is not straightforward. I cannot use obj.Beep-Status as that is invalid JS. Does the "avmd_detect" session variable continue to get populated as before?
Hi Jason, Thank you for the message. Yes. Module avmd still sets avmd_detect variable to TRUE on detected event: switch_channel_set_variable(channel, "avmd_detect", "TRUE"); and fires event of type avmd::beep. You can still detect the beep in the same way as in the oldest versions, that is searching for avmd_detect variable set to TRUE. There are three types of events at this point: enum avmd_event { AVMD_EVENT_BEEP = 0, AVMD_EVENT_SESSION_START = 1, AVMD_EVENT_SESSION_STOP = 2 }; The name of the BEEP event in the documentation table of events in Events section of avmd pages is not the exact identifier used to enumerate events in the code but it's human version. This should be made clear on the Confluence page or exact name should be used. This is now fixed. cheers, Piotr
participants (2)
-
Jason Moran
-
Piotr Gregor