SOLVED Voice Mail Auto Call (Call extension when extension has new VM)

Discussion in 'Open Discussion' started by PBXinmyhouse, Jan 8, 2019.

  1. PBXinmyhouse

    PBXinmyhouse New Member

    Joined:
    Dec 26, 2018
    Messages:
    7
    Likes Received:
    1
    Is there a way to daily check if a extension has voicemail and if so, call that person attempting to force them to check their voicemail.

    It seems possible.
     
  2. PBXinmyhouse

    PBXinmyhouse New Member

    Joined:
    Dec 26, 2018
    Messages:
    7
    Likes Received:
    1
    Well, looking at how the reminder system works, this should be pretty straight forward. I'll work on it and post my results.

    If someone else has done this, no sense in me repeating the work.
     
    #2 PBXinmyhouse, Jan 8, 2019
    Last edited: Jan 8, 2019
    ostridge likes this.
  3. ostridge

    ostridge Guru

    Joined:
    Jan 22, 2015
    Messages:
    350
    Likes Received:
    61
    This doesn't directly answer the question; just to remind that the extension settings includes the email asddress that voicemails are sent to, and also a setting for the format to send.
     
  4. phonebuff

    phonebuff Guru

    Joined:
    Feb 7, 2008
    Messages:
    863
    Likes Received:
    51
    Yes,

    Schedule something in CRON ---

    Use find to see to see if there are new / non-listened to files in the INbox..

    Based on your business rules create a Call file and move it to the /var/spool/asterisk/outgoing/ directory.

    Might also want to look at some of this code -- https://community.freepbx.org/t/managing-full-voicemail-inboxes/22562/9

    Good luck --
     
    PBXinmyhouse likes this.
  5. qtlnx

    qtlnx Member

    Joined:
    Mar 9, 2016
    Messages:
    121
    Likes Received:
    6
    Apologize if off topic, but I can't get into freshly installed reminder system since both web and phone access are asking for credentials.
    I found item 25 on http://nerdvittles.com/?p=24058 but there is nothing about resetting initial passwords.
     
  6. PBXinmyhouse

    PBXinmyhouse New Member

    Joined:
    Dec 26, 2018
    Messages:
    7
    Likes Received:
    1
    Okay, finished. It comes in 3 parts. Pretty happy with myself. Seems to work great. Turning debug on writes the call file to the /tmp file rather than the asterisk/outgoing folder, so you can look over the file.

    1. Entry within /etc/crontab file
    2. /var/lib/asterisk/agi-bin/pushvm.php script i wrote
    3. Context created in extensions_custom.conf

    There is a config option at the beginning of the pushvm.php. The mapping one is important if you want to call an extension different than the voicemail box number. The other options are self explanatory.

    $RequirePassword = 0; //REQUIRE PASSWORD FOR VOICEMAIL (0=NO 1=YES)
    $CallerName = "Voice Mail Push"; //CALLER ID NAME
    $Context = "vmpush"; //CONTEXT CALLED IN CUSTOM EXTENSIONS
    $MaxRetries = 0; //AFTER INITIAL CALL, HOW MANY REATTEMPTS.
    $WaitTime = 30; //TIME TO WAIT BETWEEN RETRIES
    $MailboxMAP = "1000>1001,9999>1003"; //MAPPING VOICEMAIL # CALLS EXTENSION
    $Debug = 0; // 0 = USE call_dir 1 = USE tmp_dir


    Also, the next option - You can call the pushvm.php with an argument. If no argument is given, it will check all voicemail accounts. But, you can also give a argument of the voice mail box # and it will only process that one. Any second argument (no matter what the value) will put it in debug mode.

    Example : pushvm.php 1000 : It will only process voicemail box 1000.
    Exampe : pushvm.php 1000 1 : process 1000 but in debug mode.

    This way, you may not want to have this process for every user, and/or you might want it to call the people at different times. (Different time zones)

    cronttab example :

    #Daily @ 7pm
    0 19 * * * root /var/lib/asterisk/agi-bin/pushvm.php 1000

    #Daily @ 10pm
    0 22 * * * root /var/lib/asterisk/agi-bin/pushvm.php 9008

    #Daily @ 10pm - With LOGGING
    0 22 * * * root /var/lib/asterisk/agi-bin/pushvm.php 9008 >> /var/log/vmpush.log

    Here is the context as within the extensions_custom.conf

    [vmpush]
    exten => s,1,Answer
    exten => s,n,VoiceMailMain(${vmuser}@default)

    Here is the php script (placed in the /var/lib/asterisk/agi-bin/ )
    http://s000.tinyupload.com/?file_id=24726890365358724698

    Ps. Thank you PhoneBuff. The link you posted aided me in ideas.
     
    #6 PBXinmyhouse, Jan 11, 2019
    Last edited: Jan 12, 2019