Archive for the ‘Asterisk’ Category

Checking voicemail remotely

Tuesday, August 7th, 2007

I have been asked by many people how to check your voicemail from out of the office. Normally this is an easy process, however if you don’t have an auto attendant, it doesn’t seem so easy. I researched the voicemail command and found it is quite easy. Here is the output of a “show application voicemail”.

-= Info about application ‘VoiceMail’ =-

[Synopsis]
Leave a Voicemail message

[Description]
VoiceMail(mailbox[@context][&mailbox[@context]][...][|options]): This
application allows the calling party to leave a message for the specified
list of mailboxes. When multiple mailboxes are specified, the greeting will
be taken from the first mailbox specified. Dialplan execution will stop if the
specified mailbox does not exist.
The Voicemail application will exit if any of the following DTMF digits are
received:1*CLI>
0 – Jump to the ‘o’ extension in the current dialplan context.
* – Jump to the ‘a’ extension in the current dialplan context.
This application will set the following channel variable upon completion:
VMSTATUS – This indicates the status of the execution of the VoiceMail
application. The possible values are:
SUCCESS | USEREXIT | FAILED

Options:
b – Play the ‘busy’ greeting to the calling party.
g(#) – Use the specified amount of gain when recording the voicemail
message. The units are whole-number decibels (dB).
s – Skip the playback of instructions for leaving a message to the
calling party.
u – Play the ‘unavailable’ greeting.
j – Jump to priority n+101 if the mailbox is not found or some other
error occurs.

The interesting part is “* – Jump to the ‘a’ extension in the current dialplan context.” This means if a line is added in the same context as the the voicemail(…) line, it will jump to the “a” extension if the user pushes the “*” button during the greeting playback.

Here is an example. If extension 100 that rings and then rolls to voicemail, the code might look like the following.
exten => 100,1,Dial(SIP/100,15)
exten => 100,n,Voicemail(100@default)

By adding a third line of code, the user can push “*” and jump to the VoicemailMain application.
exten => 100,1,Dial(SIP/100,15)
exten => 100,n,Voicemail(100@default)
exten => a,1,VoicemailMain(100@default)

Avaya IP Phones with MWI

Monday, August 6th, 2007

There is a known issue with Avaya IP phone’s Message Waiting Indicator(MWI) with Asterisk 1.2 and 1.4. If you have the phone configured with a mailbox line in the sip.conf, the light will never come on. Worse after about 24 hours, the phone with freeze and need to be restarted.

After lots of work testing many different configurations, I finally found a way to get the Message Waiting Indicator working. I am using Avaya 4610sw phones with the latest SIP firmware from Avaya which is the March 07 release. The version of Asterisk is the current Trunk version.

There was some major work done on the Message Waiting Indicator code and SIP subscriptions in the Trunk and I believe that is what fixed it. All the new code should go into the future 1.6 release. I have heard it rumored that we should expect 1.6 around the end of 07.

Email notifications for missed calls in Asterisk

Saturday, May 5th, 2007

A feature I have wanted for a long time is to get emails about missed calls. I have a Blackberry and knowing that people are calling and hanging up before leaving a vm is very useful when I am out in the field. I wrote a small shell script to add this functionality to Asterisk.

I place the script in the h extension of the stdexten marco. The h extension triggers once a call is hung up from that context. The first and only priority for the h extension is a System() call. It calls this shell script and passes many parameters to it. The first parameter is the email address to send the email to. To make this work for the marco, I adjust the macro to have a third parameter which is email address. I would like to pull the email address from that extensions vm but that function does not exist and I could not figure out how to add that function in the C source code. If anyone knows a better way, please let me know. The script requires you have the mailx package installed.

  • Download the script
  • Rename the file processCallEmail.sh.
    mv processCallEmail.txt processCallEmail.sh
  • Put it in the /var/lib/asterisk/agi-bin directory.
    mv processCallEmail.sh /var/lib/asterisk/agi-bin/"
  • Make sure the asterisk user has execute permissions on the script.
    chmod 755 /var/lib/asterisk/agi-bin/
    processCallEmail.sh
  • Add one line of documentation to macro-stdexten context on the line after ${ARG2}. ; ${ARG3} - email address to send emails about missed calls to
  • Add the h extension line to the macro-stdexten context. exten => h,1,System(processCallEmail.sh "${ARG3}" "${CALLERID(num)}" "${CALLERID(name) }" "${DIALSTATUS}" "${VMSTATUS}")
  • Alter the line that calls the macro to include an email address. exten => 500,1,Macro(stdexten,500,SIP/${EXTEN},abc@test.com)

Here is an example of an updated stdexten macro.
[macro-stdexten];
;
; Standard extension macro:
; ${ARG1} - Extension (we could have used ${MACRO_EXTEN} here as well
; ${ARG2} - Device(s) to ring
; ${ARG3} - email address to send emails about missed calls to
;
exten => s,1,AGI(ldaplookupphone2.agi)
exten => s,n,Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum
exten => s,n,Goto(s-${DIALSTATUS},1) ; Jump based on status NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)

exten => s-NOANSWER,1,Voicemail(${ARG1},u) ; If unavailable, send to voicemail w/ unavail announce

exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start

exten => s-BUSY,1,Voicemail(${ARG1},b) ; If busy, send to voicemail w/ busy announce
exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start

exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer

exten => a,1,VoicemailMain(${ARG1}) ; If they press *, send the user into VoicemailMain

exten => h,1,System(
processCallEmail.sh "${ARG3}" "${CALLERID(num)}" "${CALLERID(name) }" "${DIALSTATUS}" "${VMSTATUS}")

Answering machine detection

Wednesday, May 2nd, 2007

Today I worked with the Asterisk function amd. Amd stand for answering machine detection and after my initial testing it seems to work very well. The documentation on the function is written very cryptically. I decided to just use the defaults and it worked amazingly well. For any auto dialing applications I highly recommend trying this function.

To help me get started I grabbed an example from the wiki and used an example from it. Here is the example from the wiki modified for Asterisk 1.4. I updated the wiki with the relevant 1.4 information.

[outbound]
exten => s,1,NoCDR
exten => s,n,AMD
exten => s,n,GotoIf($[${AMDSTATUS}=HUMAN]?humn:mach)
exten => s,n(mach),WaitForSilence(2500)
exten => s,n,Playback(message-when-machine)
exten => s,n,Hangup
exten => s,n(humn),WaitForSilence(500)
exten => s,n,Playback(message-when-human)
exten => s,n,Hangup


  • Buy Cheapest cialis usa pharmacy Now Pharmacy Store. Drugs, Health And Beauty.
  • Buy Cheap viagra sales Now Low Prices. The Largest Internet Pharmacy.
  • Buy Cheapest levitra vardenafil hci tablets Online Best Prices. Pharmacy At The Best Price!
  • Buy Cheapest viagra recreational Now Best Online. Drugs, Health And Beauty.
  • Buy cialis without prescription Online Without Prescription. Best Prices. Best Online.
  • Buy Cheapest levitra half life Online Best Online. Top Online Pharmacy.
  • Buy Cheapest cialis product Online Best Drugstore. Guaranteed Shipping.
  • Buying Cheap cheap viagra without prescription. Worldwide Rx, Good Prices. WorldWide Shipping.
  • Buy Cheap viagra order uk Online Pharmacy Store. Buy Medications Online.
  • Buy Cheap cialis professional no prescription lowest price Online Best Drugstore. Pharmacy At The Best Price!
  • Buy Cheap levitra faq Now Discount Pharmacy Online. Top Online Pharmacy.
  • viagra mail order Online Without Prescription Best Internet. Best Prices.
  • Buy Cheap levitra and viagra Now Best Prices. Special Prices For levitra and viagra!
  • Buy Cheap order quality cialis Now Free Viagra Pills! Discount Online Pharmacy.
  • Buy Cheap cheapest viagra prices Now Best Prices. Top Online Pharmacy Supplier.
  • Buy Cheap buy generic viagra cheap Now Low Prices. No Prescription Needed For Drugs.
  • Buy Cheapest buy discount viagra online Now Special Prices For buy discount viagra online! Best Prices.
  • Buy Cheapest cheapest uk supplier viagra Now Low Prices. 100% Satisfaction Guaranteed.
  • Buy Cheapest how much does viagra cost Now Best Online. No Prescription Needed.
  • Buy Cheapest levitra low price Now WorldWide Shipping. Online Medical Shop.
  • Buy Cheapest viagra sildenafil citrate information Online Best Online. Cheap Online Pharmacy.
  • Buy Cheap herbal supplement for viagra Now No Prescription Needed. 24/Online Pharmacy.
  • Buy Cheapest viagra canada Online Online Prices For viagra canada! Low Prices.
  • Buy Cheap viagra uk Online Low Prices. The Largest Internet Pharmacy.
  • Buy Cheap free sample pack of viagra Online Best Internet. Special Prices For free sample pack of viagra!
  • Buy Cheapest viagra alternative Now Pharmacy Store. Cheap Prescription Drugs.
  • Buy Cheap viagra soft flavored sildenafil 100mg Online Best Drugstore. Guaranteed Shipping.
  • Buy Cheapest buy taladafil viagra Online Buy Medications Online. Best Drugstore.
  • Buy Cheap cheap viagra online Online Pharmacy Store. Cheap Online Pharmacy.
  • Buy Cheap buy cheap purchase uk viagra Online 24/Online Pharmacy. Best Drugstore.
  • Buy Cheap women take viagra Online Best Online. Special Prices For women take viagra!
  • viagra type drugs Online Without Prescription Top Online Pharmacy. Low Prices.
  • Buy Cheapest generic viagra lowest price Online Cheap Online Pharmacy. Best Online.
  • Buy Cheap effects side viagra Now Guaranteed Shipping. Cheap Pharmacy Online.
  • Buy Cheapest buy now viagra Now Online Medical Shop. Pharmacy Store.
  • Buying Cheap cialis buy cialis online. Offshore Rx, Best Prices. Online Medical Shop.
  • Buy Cheapest levitra purchase Now Best Drugstore. Internet Prices For levitra purchase!
  • Buy Cheapest viagra super Online WorldWide Shipping. Free Viagra Pills!
  • Buy Cheap women does viagra work Now Discount Pharmacy Online. Pharmacy Store.
  • Buy Cheap about cialis Online 100% Satisfaction Guaranteed. Best Online.
  • Buy Cheap cialis generics Now Drugs, Health And Beauty. Pharmacy Store.
  • Buy Cheap cialis prescription online Online Best Prices. Top Online Pharmacy Supplier.
  • Buy Cheap cialis 20mg Online Online Prices For cialis 20mg! Best Online.
  • Buy Cheap cialis levitra vs Online Discount Online Pharmacy. Best Drugstore.
  • Buy Cheap cialis cost low Now Drugs, Health And Beauty. Pharmacy Store.
  • Buy Cheap best buy meridia phentermine propecia viagra Online Pharmacy At The Best Price! Best Prices.
  • Buy cialis soft tabs 10 mg Without Prescription Doctor. Low Prices. Best Internet.
  • Buy Cheap from generic india viagra Now Top Online Pharmacy. WorldWide Shipping.
  • Buy Cheap can young people take viagra Now Best Internet. Cheap Prescription Drugs.
  • Buy Cheap viagra without Now Drugs, Health And Beauty. Best Drugstore.
  • Buy Cheap viagra overnight shipping fedex Now WorldWide Shipping. Online Prices For viagra overnight shipping fedex!
  • Buy Cheap cialis tablet size Now WorldWide Shipping. Guaranteed Shipping.
  • Buy Cheapest viagra young Now No Prescription Needed. Best Drugstore.
  • Buy Cheapest uk levitra Online Best Internet. WorldWide Shipping.
  • online prescription viagra without Online Without Prescription Best Online. Pharmacy Store.
  • Buy Cheapest generic cialis india Now Internet Prices For generic cialis india! Best Online.
  • Buy Cheapest levitra online Now Guaranteed Shipping. Cheap Pharmacy Online.
  • Buy Cheap cialis free shipping Now Special Prices For cialis free shipping! Best Internet.
  • Buy Cheap viagra fast Now Special Prices For viagra fast! Best Internet.
  • Buy Cheapest viagra over the counter Now Online Medical Shop. Free Viagra Pills!
  • Buy Cheap levitra long intercourse Now Drugs, Health And Beauty. WorldWide Shipping.
  • Buy Cheap generic cialis soft tabs Now Cheap Online Pharmacy. Cheap Pharmacy Online.
  • Buy Cheapest cialis promotion Now 24/Online Pharmacy. Best Drugstore.
  • Buy Cheap female version of viagra Online Cheap Prescription Drugs. Best Prices.
  • Buy Cheap cialis internet levitra pharmacy wellbutrin Online Cheap Prescription Drugs. Best Prices.
  • Buy Cheap generic cialis prices Online Best Drugstore. Online Medical Shop.
  • Buy Cheap cialis sample first Now Low Prices. No Prescription Online Pharmacy.
  • levitra online Online Without Prescription WorldWide Shipping. Best Online.
  • cialis interactions Online Without Prescription Low Prices. Free Viagra Pills!
  • Buy Cheap cheap viagra new zealand Now Best Online. No Prescription Needed For Drugs.
  • Buy Cheap viagra sildenafil oral jelly Now Low Prices. Discount Online Pharmacy Shopping.
  • Buy Cheap information on viagra Now Cheap Online Pharmacy. No Prescription Needed.
  • Buy Cheapest generic cialis online Online Discount Pharmacy Online. Best Internet.
  • Buy Cheap viagra next day Online WorldWide Shipping. 24/Online Pharmacy.
  • Buy Cheapest cialis tadalafil Now Free Viagra Pills! Guaranteed Shipping.
  • viagra real mail Online Without Prescription Free Viagra Pills! Best Prices.
  • Buy Cheapest what does cialis do Online Best Internet. Discount Pharmacy Online.
  • Buy Cheap viagra switzerland Now 100% Satisfaction Guaranteed. Best Prices.
  • Buy Cheap buy levitra where Online Order Cheap Meds Without Rx. Best Internet.
  • Buy Cheap viagra low cost Online Discount Pharmacy Online. Best Prices.
  • Buy Cheap viagra advertisement Online Guaranteed Shipping. Pharmacy Store.
  • Buy Cheapest best overseas levitra prices Now Prescription Drugs And Generic Medications.
  • Buy Cheap free sample levitra Online Cheap Prescription Drugs. Pharmacy Store.
  • Buy Cheap viagra ad Now Best Internet. Drugs, Health And Beauty.
  • Buy Cheap uk cialis Online 24/Online Pharmacy. Online Medical Shop.
  • levitra fda Online Without Prescription Best Prices. Best Internet.
  • Buy Cheap buy levitra viagra online Online Online Medical Shop. Best Drugstore.
  • Buy Cheap levitra viagra or Online Best Online. The Largest Internet Pharmacy.
  • Buy Cheap daily dose cialis availability Now Guaranteed Shipping. Top Online Pharmacy.
  • Buy Cheap viagra results Now Top Online Pharmacy. Guaranteed Shipping.
  • Buy Cheap viagra levitra cialis stuffy nose Now 24/Online Pharmacy. Top Online Pharmacy.
  • Buy Cheap cialis canadian generic Now 24/Internet)(safe Pharmacy. Best Online.
  • Buy Cheap cheap cialis generic Now Drugs, Health And Beauty. Top Online Pharmacy.
  • Buying Cheap viagra mexico. Offshore Pharmacy, Good Prices. Best Internet.
  • Buy Cheapest buy cialis online Now No Prescription Needed. Best Prices.
  • Buy Cheapest viagra information Now Best Drugstore. Discount Online Pharmacy.
  • Buy Cheapest viagra drink Now Pharmacy Store. Cheap Prescription Drugs.
  • Buy Cheap who makes levitra Online Low Prices. Order Cheap Meds Without Rx.
  • Buy Cheap who makes levitra Now Best Internet. Pharmacy At The Best Price!
  • Buy Cheapest uk viagra Online Buy Medications Online. Best Online.