I tried out mod_avmd 6+ months back and had some success.  However, I cannot seem to get it to trip any longer on newer builds of FS. The avmd_detect variable is blank and no event fires on multiple carriers and destination phones. Does anybody else have success on current/recent builds of FS?

 

Thanks,
Jason

 

Example code:

function onInput(s, type, obj, arg)

{

   try {

        if(type == "event" && session.getVariable("avmd_detect") == "TRUE")

        {

              console_log("info", "Voicemail Detected\n");

              session.execute("avmd", "stop");

              session.execute("sleep", "200");

              session.streamFile('/usr/local/freeswitch/recordings/playbackfile.wav');

              if(session.ready()) //Only hangup if onDTMF code has finished.

            {

                session.execute("hangup","ORIGINATOR_CANCEL"); //session.hangup doesn't give the code we want

            }

            return false; // don’t allow original playback file to continue

        }

   }  catch (e) {

      console_log("err", e + "\n");

   }

   return true;

}

 

session = new Session('{ origination_caller_id_number=[deleted]}sofia/gateway/[deleted]/'+argv[0]);

 

if (session.ready()) {

    session.execute("sleep","500");

    session.execute("avmd", "start");

    console_log("info", "avmd started\n");

 

    session.streamFile('/usr/local/freeswitch/recordings/playbackfile.wav', onInput);

    console_log("info","avmd_detect value is:"+session.getVariable("avmd_detect")+"\n");

    if ( session.ready( ) ) {

        session.hangup( );

    }

}