login | register
Sat 17 of May, 2008 [09:06 UTC]

voip-info.org

Search with Google
Search this site with Google. Results may not include recent changes.
 
Google Ads
Shoutbox
  • Juan Ortega, Thu 15 of May, 2008 [10:33 UTC]: Hi everybody, I'm Juan, an ITCom student, and I need to know what basic elements I need to create a VoIP network. Can anybody helpme, please?,Thank you very much
  • gineta, Wed 14 of May, 2008 [03:58 UTC]: any here not fine the configuration of firewall juniper -screem for VOIP asterisk????
  • Anoop Prabhakaran, Tue 13 of May, 2008 [12:16 UTC]: I am developing Asterisk IVR, Whenever i make a internation call to the IVR system, the DTMF is not getting detected properly, this happens only for the first time, second call onwards system works fine. why this is happening
  • joe, Mon 12 of May, 2008 [04:27 UTC]: Is there an opensource browser based softphone, or a system like Busta where everything is not manages through their website?
  • Nick Barnes, Fri 09 of May, 2008 [11:36 UTC]: Christopher - yesterday I tried an Asterisk install on a CentOS 5.1 box with stock GUI and it all worked fine. Sorry I can't help.
  • aero, Fri 09 of May, 2008 [08:20 UTC]: can someone help me out on this, i tried to play some sound files on my asterisk box and this is the error message i got. WARNING[4429]: format_wav.c:169 check_header: Unexpected freqency 22050 May 8 11:17:39 WARNING[4433]: codec_gsm.c:194 gsmtolin_fra
  • Christopher Faust, Thu 08 of May, 2008 [14:15 UTC]: I beleive that I may have to change something in the xserver configuration. Please advise
  • Christopher Faust, Thu 08 of May, 2008 [14:14 UTC]: Everything was perfect. In the bios I have increased the memory allocated Still receive input not supported on my display.
  • Christopher Faust, Thu 08 of May, 2008 [14:13 UTC]: This would not be my main box. I am doing some testing to see if I can install zaptel and asterisk 1.4 on a full centos 5.1 box with development software Its bizzare, because before I went through the asterisk and zaptel installation everything was perfe
  • Nick Barnes, Thu 08 of May, 2008 [13:44 UTC]: Christopher - I can't see any way in which an Asterisk installation would muck your GUI, but remember that it is advised not to use a GUI on an Asterisk box anyway.
Server Stats
  • Execution time: 0.43s
  • Memory usage: 2.23MB
  • Database queries: 34
  • GZIP: Disabled
  • Server load: 2.08

Asterisk tips callback

!How to create callback voicemail
by Jpiterak

Here are a couple of scripts I use to do callback voicemail to my users. This was a request from a customer who was looking at a similar feature on an Avaya system.

How it works:

    • Instead of calling Voicemail() directly, I set up a macro 'macro-leave_voicemail' that makes the Voicemail() call, then checks to see if you want to send a call to the user.
    • If callback is set, the macro calls a bash script that creates the call file. This script:
      • Checks the voicemail.conf file for a specially formatted comment line after the mailbox definition with the telephone numbers to call for this user.
      • Creates a call file for each of these phone numbers. Note that the call file:
        • Puts the callee into a context in extensions.conf that tells them that they have a call waiting, and allows them to press 1 to go directly to voicemail.
        • Sets a variable '${mailbox}', which is used to enter the correct voicemailbox if the user chooses to listen to the voicemail.


/var/lib/asterisk/scripts:

Usage:
 voicemail_callback.sh <voicemailbox>

Requires that you add a line after each entry in voicemail.conf where you want the mailbox to get a callback, in the format
  315 => 4513,Jim Doh,doh@megacorp.com,5555555555@messaging.nextel.com
  callme = 5555555555,6666666666




  TODO:
 #  Allow for different contexts, as the config file does.
 #   Right now, anyone with the same mailbox # will get called :-)



 get_phone_numbers()
 {
     if [ "x$1" != "x" ];then voicemailbox="$1"; else return 1; fi
        cfg_line=$(grep -A 1 "^$voicemailbox" "$VOICEMAIL_CFG")
        if ( echo "$cfg_line"|grep -E 'callme\W*=\W*[[:digit:]]+'>/dev/null);then
               phnum_list=$(echo "$cfg_line"|grep -E 'callme = '|cut -d'=' -f 2|sed -e 's/,/ /g')
               echo "$phnum_list"
         else
                 return 1
         fi
 }

 make_callfile()
 {
     if [ "x$1" != "x" ];then mailbox="$1"; else return 1; fi
     if [ "x$2" != "x" ];then phone_number="$2"; else return 1; fi

      #note use of '-' in '-EOF1' - Escapes tab at beginning of lines
      CALLFILE=$(cat <<-EOF1
       Channel: Zap/g1/$phone_number
       MaxRetries: 2
       # Retry in 5 min
       RetryTime: 300
       WaitTime: 45

       Context: feature-voicemail_callback
       Extension: s
       Priority: 1
       SetVar: mailbox=$mailbox

 EOF1)

       echo "$CALLFILE" >> "$CALL_SPOOL_DIR"/$(date +%Y%mNaVI%M%S)-$phone_number

 }

 #CONSTANTS
 ASTERISK_CFG="/etc/asterisk"
 VOICEMAIL_CFG="$ASTERISK_CFG/voicemail.conf"
 CALL_SPOOL_DIR="/var/spool/asterisk/outgoing"

 #CALL_SPOOL_DIR=tst/
 #VOICEMAIL_CFG="./asterisk/voicemail.conf"


 #*********MAIN*******************************************************

 if [ "x$1" != "x" ];then voicemailbox="$1"; else exit 1; fi

 if ph_numbers=$(get_phone_numbers $voicemailbox) ;then
       for ph_num in $ph_numbers; do
               make_callfile "$voicemailbox" "$ph_num"
       done
 fi




In extensions.conf:

  • A macro that is used to call app_voicemail, and which calls the bash script to initiate the call out.


 [macro-leave_voicemail]
 ; Leave a voicemail message, then do post-processing.
 ;   o Call configured phones, with an announcement that a message
 ;      is waiting, and the option to listen to the voicemail(s)
 ;        ${ARG1} = u or b for 'unavailable' or 'busy' message
 ;        ${ARG2} = mailbox
 ;  ${ARG3} = Call user flag
 ; USAGE:
 ; exten => s,15,Macro(leave_voicemail,u,310,1)

 exten => s,1,ResponseTimeout(30)
 exten => s,2,Voicemail2(${ARG1}${ARG2})
 exten => s,3,GoToIf($[${ARG3} = 0]?s|5)
 exten => s,4,system(${SCRIPTS_DIR}/voicemail_callback.sh ${ARG2})
 exten => s,5,NoOp

 exten => h,1,GoToIf($${ARG3} = 0?h|3)
 exten => h,2,system(${SCRIPTS_DIR}/voicemail_callback.sh ${ARG2})
 exten => h,3,NoOp
 exten => t,1,GoToIf($${ARG3} = 0?t|3)
 exten => t,2,system(${SCRIPTS_DIR}/voicemail_callback.sh ${ARG2})
 exten => t,3,NoOp


  • Note that the h and t extensions may not be necessary... I used them for troubleshooting problems with call progress detection on FXO cards (More on that later... Down in 'Please Note!')
and...
  • The context that is connected to by the call file:

 [feature-voicemail_callback]
 exten => s,1,ResponseTimeout(2)
 exten => s,2,Background(vm_callback-announcement)
 exten => s,3,Background(vm_callback-options)
 exten => t,1,Goto(s|2)

 exten => 1,1,VoicemailMain2(s${mailbox})


  • Finally, the sound file contents:

 vm_callback-announcement: "You have new voicemail"
 vm_callback-options: "To listen to this voicemail, press 1"



Created by oej, Last modification by gramels on Sat 10 of Mar, 2007 [21:04 UTC]

Comments Filter

To: ip_works

by Barry Drake on Thursday 05 of July, 2007 [18:11:23 UTC]
Make sure you have set your script as "executable":
chmod +x /var/lib/scripts/voicemail_callback.sh

--Barry

by ip_works on Sunday 17 of June, 2007 [23:13:16 UTC]
Hi,
I have set this up and am getting error
:Unable to execute '/voicemail_callback.sh 3001"

I have the script in /var/lib/asterisk/scripts
Asterisk 1.4.4
Centos 4.5

any thoughts are appreciated.

Thank you

Jimmy

by ip_works on Sunday 17 of June, 2007 [23:12:59 UTC]
Hi,
I have set this up and am getting error
:Unable to execute '/voicemail_callback.sh 3001"

I have the script in /var/lib/asterisk/scripts
Asterisk 1.4.4
Centos 4.5

any thoughts are appreciated.

Thank you

Jimmy

by ip_works on Sunday 17 of June, 2007 [23:11:41 UTC]
Hi,
I have set this up and am getting error
:Unable to execute '/voicemail_callback.sh 3001"

I have the script in /var/lib/asterisk/scripts
Asterisk 1.4.4
Centos 4.5

any thoughts are appreciated.

Thank you

Jimmy

Re: no send on hangup

by geekfly on Wednesday 17 of August, 2005 [16:06:20 UTC]
Use DEADAGI on a dead channel....
http://www.voip-info.org/tiki-index.php?page=Asterisk%20cmd%20AGI
Edit

no send on hangup

by Anonymous on Thursday 13 of January, 2005 [23:19:41 UTC]
Has anyone figured out the Hangup issue? Same as the first comment; When a user hangs up the script is not run. I have tried with the h extension to no avail so would love a pointer or two.

what's wrong?

by goolem on Thursday 07 of October, 2004 [11:35:30 UTC]
When the Caller press # at the end of message it's all ok.
But when the caller hangs up then the script dont run.

what is wrong?

wish for this awesome app'

by sjobeck on Tuesday 20 of July, 2004 [06:42:33 UTC]
I wonder how hard it would be to add some more complexity to this for the users to customize some variables before the out-call is made? (by the way, AltiGen offers this feature also, just FYI). What I had in mind was something like:
_ make out-call if voicemail is urgent
_ make out-call is voicemail from certain callerid
_ make out-call if between certain hours
_ make out-call if not listened to voicemail in the last hour

but these are way above my head at this time.

Thanks for the great tip, though, will be deploying it soon.


Please update this page with new information, just login and click on the "Edit" or "Add Comment" button above. Get a free login here: Register Thanks! - support@voip-info.org

Page Changes | Comments

Sponsored by:

Terms of Service Privacy Policy
© 2003-2008 VOIP-Info.org LLC

Powered by bitweaver