Asterisk call notification
Created by: JustRumours,Last modification on Sun 30 of Mar, 2008 [23:02 UTC] by michigantelephone
Call notification tools
Possible instant messaging (and other) tools you could employ:- smbclient (SAMBA)
- YAC (windows & TiVo listener)
- YAACID (open source in .NET/C#): Yet Another Asterisk Caller ID
- Jabber (various methods), ICQ, MSN, ...
- Covide (CRM software)
- FOP (Flash Operator Panel)
- HooDaHek (collection of CallerID scripts and tools for Asterisk)
- app_notify network caller notification. Mac OSX client available (3rd party tool)
- app_broadcast: Works with YAC etc. (3rd party tool)
- asteriod (Open source, JAVA)
- iBCallerID (windows task bar)
- PL Call Notify
- MythTV OSD
- NetCID (talking callerid)
- Emerald Caller-ID Search
- ADM - Asterisk Desktop Manager
- U-Rang II (Screen Pop Utility for Windows)
- ADAT Asterisk Dial & Announce Tool. Free Windows call-notifier with CRM-integration & click-to-dial.
- Pbx Screen Popper (Opens a web page on incoming calls based on specific matching criteria)
- StarJunction Free Edition Caller ID pop. Integration with Salesforce and SugarCRM
- OutCall (Pop-Up as well as Outlook integration, free and open source)
- CallerIDpop Perl Script
1. smbclient
The smbclient is part of SAMBA.;Extension 200 Call ID Popup Example
exten => 200,1,NoOp(${CALLERID} ${DATETIME})
exten => 200,2,System(/bin/echo -e "'Incoming Call From: ${CALLERID} \\r Received: ${DATETIME}'"|/usr/bin/smbclient -M target_netbiosname)
exten => 200,3,Dial,sip/tom|30|t ; Ring, 30 secs max
exten => 200,4,Congestion
The above does nothing to prevent somebody from slipping bad code into their Call ID string, but as I'm running a private system and only taking Call ID's directly off the PSTN on a single low volume zap channel, or assigning them myself at this point. I'm not too worried someone is going to put in something like ''""bad command""'' in their string. It would be nice to know if there is a check someplace up the food chain in the application to qualify valid Call ID's- or if that's something possible?
Warning: Before folks get too carried away with this, the smb messaging function is considered a 'vulnerability' by most corp security folks and have it disabled at the workstation level.
Example 2
If you have Windows machines and would like to send people messages when a call is coming in for them, you can use the following macro:[macro-stdexten]
; Standard extension macro:
; ${ARG1} - Mailbox
; ${ARG2} - Device(s) to ring
; ${ARG3} - Who the call is for
; ${ARG4} - The smb address to send a winpop message to
;
; THE FOLLOWING LINE IS SUPPOSED TO BE ONE LINE
;
exten => s,1,System(/bin/echo -e "'Incoming Call From: ${CALLERIDNUM} To:${ARG3} Received: ${DATETIME:0:2}/${DATETIME:3:2}/${DATETIME:4:4} at ${DATETIME:9}'"|/usr/bin/smbclient -M ${ARG4})
exten => s,2,Dial(${ARG2},40,m)
exten => s,3,Voicemail(u${ARG1})
exten => s,4,Goto(default,s,1)
exten => s,103,Voicemail(b${ARG1})
An example of it's use would be
exten => 277906,1,macro(stdexten|4|ZAP/3r2|FWD - 277906|Zx81_windesk)
That means: when 277906 is dialed, run the stdexten macro, pass 4 as the mailbox, Zap/3r2 as the channel to ring, FWD - 277906 as the destination (i.e. someone dialed that to get here) and Zx81_windesk as the SMB hostname.
The SMB hostname is the computer name of your computer under windows networking.
You will also need to run winpopup on the console.
2. YAC
We only need the YAC client (listener), which is available for Windows and TiVo. However, YAC (the client, not the listener) can also be used to display TAPI information, so you could combine it with e.g. SIPTAPI.a) Using GNU netcat
The -q argument of nc doesn't exist in GNU netcat and is to be replaced by -c in comparison to "nc".Testing interaction of netcat and YAC:
echo -n -e "@CALLTestcall from Asterisk ~1234" | netcat -c 192.168.0.1 10629
echo -n -e "Hello, how are you?" | netcat -c 192.168.0.1 10629
Hint: Start the YAC listener with "yax.exe listen" on Win98
extensons.conf:
exten => 1234,1,DBget(USERx_IP=SIP/Registry/userx)
exten => 1234,2,Cut(USERx_IP=USERx_IP,:,1)
exten => 1234,3,System(/bin/echo -n -e "'@CALL${CALLERIDNAME} ${CALLERIDNUM}'" | netcat -c -w 1 ${USERx_IP} 10629)
exten => 1234,4,Macro(stdexten,1234,SIP/userx)
b) Using "nc" (original netcat)
exten => s,4,System(/bin/echo -n -e "'@CALL${CALLERIDNAME} ~${CALLERIDNUM}'" | nc -q 0 -w 1 hostname 10629)The options are -q (quit after EOF), and -w 1 (only wait for connect for 1 second...)
Update: I just tried the dialplan string below with asterisk@home 2.5 ISO and Windows XP Media Center 2005 running MCE YAC listener...worked flawlessly!!!
The dialplan should be modified as below.
exten => s,4,System(/bin/echo -n -e "'@CALL${CALLERIDNAME} ~${CALLERIDNUM}'" | nc -w 1 hostname 10629)
because nc v1.10 does not support the -q (quit after EOF) any more...
c) Excerpts of the YAC FAQ:
Q: What's a listener?A: A listener is simply a program that listens to a specific TCP port (in YAC's default case, this is port 10629), accepts connections, and then displays whatever text was sent to the port in whatever way makes sense to the device.
Q: Can I control how long the YAC call notification window stays up?
A: Sure, as long as you're using the YAC user interface and not the old-style balloon option available in Win2K and XP. Open the registry key HKEY_LOCAL_MACHINE\Software\YAC, and set: DisplayTime = [time in milliseconds]. The default is 20000 (20 seconds).
Q: Can YAC use a different port?
A: Yes. Open HKEY_LOCAL_MACHINE\Software\YAC, and set Port = [PortNumber]. This key needs to be a string of type REG_SZ. The default is TCP port 10629.
2.1 Variant of YAC for Xbox Media Center
If you own an Xbox and have XBMC on it, there is a very Python script for poping up while watching a movie.CallerID for XBMC: http://ca.geocities.com/farside@rogers.com/Scripts/callerid.html
extensions.conf:
exten => 100,1,System(/bin/echo -n -e ".....${CALLERIDNUM}~${CALLERIDNAME}" | netcat -w 1 ${XBOX_IP} 10629)
To make this work easily with freePBX, add the following lines to /etc/asterisk/extensions_custom.conf
custom-xboxcallerid
exten => s,1,System(/bin/echo -n -e ".....${CALLERIDNUM}~${CALLERIDNAME}" | netcat -w 1 10.100.100.1 10629)
exten => s,1,System(/bin/echo -n -e ".....${CALLERIDNUM}~${CALLERIDNAME}" | netcat -w 1 10.100.100.1 10629)
replace the IP address of 10.100.100.1 with the IP address of your asterisk server, the name of the context can be anything you like.
Then, in freePBX, add an entry in Misc Applications, set the 'feature code' field to an unused extention, and type "custom-xboxcallerid,s,1" in the 'custom app' field, ensuring the context here is the same as in the lines above.
Then, add the extention for the custom app to your dial plan. So if inbound calls hit a ring group of extentions 101 and 102, then add your new extention to that, for example 101, 102 and 199. (if you called your custom app 199)
This will make asterisk send the caller id info to your custom app, which sends the data to the xbox.
3. YAACID
Open source for Windows - see YAACID- sits in notification bar and pops up when a call comes in
- has the ability to play any custom wav sound when a call comes in and it pops up
- has the ability to spawn a web browser and when a call comes in, and it can pass variables to a given web page
4. Jabber
Method 1: Asterisk JabberMethod 2: For these examples i'm using SendXMPP.
exten => 6001,1,System(/bin/echo -e "'Incoming Call \\r Received: ${DATETIME}'"|/usr/bin/sendxmpp -f /etc/sendxmpp welby@sm-irc.info -s "You Have an incoming call" -t &)
exten => 6001,2,Dial(SIP/welby)
exten => 6001,2,Dial(SIP/welby)
The example above uses TLS to connect to the jabber server (-t) and stores its JID and password in /etc/sendxmpp in the format
jid@whatever pass
it has to be chmod 600 'ed
Method 3: by Andrew Kohlsmith
A little Perl script that uses the Net::Jabber module — It pops up an online (presence) notification via Jabber. I use Psi (psi.affinix.com) for my Jabber client and it works quite well.
http://www.mixdown.ca/~andrew/astbot/
I wrote this up (very) quickly, but it is expandable and can be used to provide service to many people with some simple changes to the mechanism (i.e. use directed presence messages).
Method 4: Asterisk-IM
Integration component to Asterisk for Jive's Jabber/XMPP server
See Asterisk-IM - Jive Software Integration
5. Covide
by Michiel van Baak:
I have put a small tarball online with the files that do the trick for me to integrate the Covide CRM (customer relationship management) tool and Asterisk. I slightly modified them. To get the original files you can check out the cvs tree of the Covide project:
http://sourceforge.net/projects/covide
The small tarball is at: http://michiel.vanbaak.info/Files/cidXML.tar.gz
The agi script searches in the CRM database for records that match the phone nr.
The tel1.php makes a XML file from the info in the table that is filled with the agi script.
tell.php is a php script that uses XMLHttpRequest to reload this XML file all the time without blocking/reloading your web application. showtel.php is the popup window. All is very basic, but it seems to work perfectly here at our company.
Feel free to burn it down or to make adjustments.
6. FOP - Asterisk Flash Operator Panel
This nice tool can be "mis-used" to only display caller ID coupled with CRM-like info. See the FOP documentation for details.7. HooDaHek - Download and Information
HooDaHek (hoo-dah-hek, as in 'who-the-heck?') is a collection of Asterisk AGI scripts, CGI scripts, and MySQL tables intended to implement your own in-house Caller ID database and notification services. I wrote these scripts originally to enable my household phone system to identify who was calling, be able to modify and specify my own custom CallerID labels, and to have the phone system alert us via AOL Instant Messenger or MSN Messenger as to who was calling (or had called).8. app_notify (3rd party tool)
app_notify sends messages via UDP to machines on your network.
9. app_broadcast (3rd party tool)
http://psg.com/~begg/projects/Broadcast is an Asterisk application which you may use to send a generic message over TCP/IP to any number of computers running software configured to listen for these types of messages. Being written in C, Broadcast will be dynamically loaded onto the Asterisk program on startup, making it a highly reliable and scalable option when compared with other solutions based on the Asterisk Gateway Interface (AGI) system...
You would like a nice window to pop up with say the caller id details of an incoming call. With this same software, you may "selectively" broadcast messages for example, you may only want the sales crew to see information about a given caller and not other groups. For example:
[sales-context]
exten => s,1,Answer
exten => s,2,Broadcast(This is a sales call|group=sales)
exten => s,3,Dial(whatever)
In such a case, you will need to have configured the "sales computers"
with a group attribute set to sales for example:
[192.168.1.1]
port = 10296
group = sales
[192.168.1.2]
port = 10345
group = sales
[192.168.1.3]
port = 19002
group = technical
In such a case as above, onlye the first two machines (192.168.1.1 and 192.168.1.2) will be notified.
All you need configured on the machines that need to receive these messages is software like YAC ("Yet Another Callerid program") which you may get from http://sunflowerhead.com/software/yac/
You will only need to configure the broadcast application to connect to the right port.
10. Asteriod
Asteriod: Pop-up note-taking windows based on caller-ID, outgoing call dialing from directory lookup selection11. iBCallerID
See iBCallerID12. PL Call Notify
suvault: Java jar which allows you to use the asterisk manager API to receive a basic message box with the Caller ID and the Caller ID name.The site is not pretty to look at but the app does its job.
13. MythTV OSD
Using mythtvosd you can broadcast a message to be displayed on a mythtv box. See Asterisk tips MythTV integration, and FreePBX MythTV OSD14. NetCID
NetCID is a free network talking callerid popup program that Asterisk can use to send notifications to windows computersSee Asterisk NetCID
15. Emerald Caller-ID Search
A callerid search popup application allowing the callers number to be looked up automatically via a HTTP URL and the results displayed in the popup window. Supports Asterisk Manager API, YAC and direct modem listening. Avaliable at no charge here16. U-Rang II
U-Rang II is a free screen pop utility that Asterisk can use to send notifications to windows computers. It uses the Asterisk Call Manager to monitor incoming calls, and is relatively easy to set up and use, but is not very configurable. Still, it will get the job done for many users. It does NOT require changes to any system files on the Asterisk box other than /etc/asterisk/manager_custom.conf (or the equivalent Call Manager configuration file), making it an ideal choice for use on Trixbox and FreePBX systems. The software download and instructions are available at the Best of Nerd Vittles site.17. ADAT - Asterisk Dial & Announce Tool
TTTelecom has developed a CTI-integration tool for the Open Source Asterisk PBX. ADAT ("Asterisk Dial & Announce Tool) enables users to monitor and control their extension. CRM-integration is also part of the software. Although ADAT is still in development, the following list of features are already fully supported:- Balloon notification of incoming and outgoing calls (incl. caller id and name if available)
- CRM-integration through popup URL (both incoming and outgoing calls)
- Manual Dialer
- Copy & Paster dialer
- Internet Explorer context-menu dialer. Easily dial any number you find on the web with a simple select and dial feature.
- Click-To-Dial handles callto: hyperlinks
- Call History. Calls received and dialed are logged for easy lookup and (re)dial.
Dowload ADAT Asterisk Dial & Announce Tool. Free Windows call-notifier with CRM-integration & click-to-dial. Click here for a configuration guide?.
18. PBX Screen Popper
http://www.codesonics.com- Opens a web page to a specified URL when you receive a phone call to your Asterisk extension.
- Use all or part of the CallerID as a formfield in the URL
- Specify conditions under which the page is opened
- Uses the Asterisk Manager API
- Opens page on answer, ring or when asked
- Open page for any CallerID or if matched to a specific value, starts with, contains or ends with a specific value
- Allows you to strip characters from the start or end of CallerID
19. StarJunction Free Edition
Star Outlook Dialer is a Microsoft Office Outlook add-in. It automatically detects contacts and telephone numbers in outlook and provides one-click dialing facility right from your inbox. It gives popup Caller ID on incoming calls using StarJunction. It integrates with any IP PBX including Cisco, Avaya, Brekeke, PbxnSip, Asterisk, SER, Axon, 3Cx etc to initiate call to your contact while reading its email in Microsoft Outlook. It displays a nice toolbar in outlook to give quick access to its functions. It is compatible with Microsoft Windows Vista . Star outlook dialer free edition is free for life. StarJunction optionally installs with Star Outlook Dialer and provides caller ID pop as well as CRM integration features. (Integration with Salesforce and SugarCRM.)20. OutCall
Pop-Up as well as Outlook integration, free and open source21. Email notifications for missed calls in Asterisk
"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."22. CallerIDpop Perl Script
This Perl script polls a Linksys or Sipura VoIP adapter or phone once per second, and when a call arrives it displays a popup notification (Caller Name, Caller Number, Line called, Date and Time) using an existing notification system - for example, on Mac OS X it uses the popular Growl notifications system, on Win32 systems it uses Snarl, and on Linux systems it uses libnotify. There is a separate script and instruction file for each of the mentioned operating systems, and because it is a Perl script it would be easy to modify if it doesn't quite meet the user's needs as is. At present it will take its options from command line arguments or from a configuration file, and there's an option to send received Caller ID data to log files (plain text or comma-quote delimited), although the logs are somewhat limited since they only show calls that actually reach the adapter. This might be a solution for Linksys/Sipura endpoints that for one reason or another cannot connect directly to the Asterisk server to receive Caller ID notifications using one of the other methods shown here.See also
- Asterisk cmd sendtext: Send a text message to text-capable phones (and channels)
- Asterisk GUI, section "User interfaces"
- Asterisk cmd System
- Asterisk cmd TrySystem
- Messengers with VoIP function like
- MSN PHP: AGI script in PHP for MSN notification
- FireFly (IAX and SIP),
- pulver.communicator (SIP)
- PhoneGaim (SIP)
- ... and Skype, of course....
Go back to Asterisk GUI


Comments
333finally i found the error
exten => s,111,SetVar(spooldir=/var/spool/asterisk)
exten => s,n,System(echo "Channel: Zap/2/"${phonenumber} > ${spooldir}/${ARG1}.call)
exten => s,n,System(echo "MaxRetries: 5" >> ${spooldir}/${ARG1}.call)
exten => s,n,System(echo "RetryTime: 60" >> ${spooldir}/${ARG1}.call)
exten => s,n,System(echo "WaitTime: 50" >> ${spooldir}/${ARG1}.call)
exten => s,n,System(echo "Context: macro-vm-notify" >> ${spooldir}/${ARG1}.call)
exten => s,n,System(echo "Extension: vmcall" >> ${spooldir}/${ARG1}.call)
exten => s,n,System(echo "Priority: 1" >> ${spooldir}/${ARG1}.call)
exten => s,n,System(echo "Setvar: vmext="${ARG1} >> ${spooldir}/${ARG1}.call)
exten => s,n,System(mv ${spooldir}/${ARG1}.call ${spooldir}/outgoing/)
these lines created a .call and send to var/spool/asterisk/outgoing/ and then:
Attempting call on Zap/2/033112511123 for vmcall@macro-vm-notify:1 (Retry 1)
it made the call.
but when i tried to make the second call:
;now build a .call file and then move it into the spool
exten => s,111,SetVar(spooldir=/var/spool/asterisk)
exten => s,n,System(echo "Channel: Zap/2/"${phonenumber1} > ${spooldir}/${ARG1}.call)
exten => s,n,System(echo "MaxRetries: 5" >> ${spooldir}/${ARG1}.call)
exten => s,n,System(echo "RetryTime: 60" >> ${spooldir}/${ARG1}.call)
exten => s,n,System(echo "WaitTime: 50" >> ${spooldir}/${ARG1}.call)
exten => s,n,System(echo "Context: macro-vm-notify2" >> ${spooldir}/${ARG1}.call)
exten => s,n,System(echo "Extension: vmcall" >> ${spooldir}/${ARG1}.call)
exten => s,n,System(echo "Priority: 2" >> ${spooldir}/${ARG1}.call)
exten => s,n,System(echo "Setvar: vmext="${ARG1} >> ${spooldir}/${ARG1}.call)
exten => s,n,System(mv ${spooldir}/${ARG1}.call ${spooldir}/outgoing/)
it executed all lines but it didn´t created a .call to be sent to var/spool/asterisk/outgoing/ ,
i dont´know why?
this is the result of Asterisk CLI when executed the Previous line code:
Executing Macro("SIP/172-09711b80", "vm-notify|172") in new stack
— Executing Set("SIP/172-09711b80", "phonenumber=033112511123") in new stack
— Executing GotoIf("SIP/172-09711b80", "0?0:10") in new stack
— Goto (macro-vm-notify,s,10)
— Executing HasNewVoicemail("SIP/172-09711b80", "172") in new stack
— Executing SetVar("SIP/172-09711b80", "spooldir=/var/spool/asterisk") in new stack
— Executing System("SIP/172-09711b80", "echo "Channel: Zap/2/"033112511123 > /var/spool/asterisk/172.call") in new stack
— Executing System("SIP/172-09711b80", "echo "MaxRetries: 5" >> /var/spool/asterisk/172.call") in new stack
— Executing System("SIP/172-09711b80", "echo "RetryTime: 60" >> /var/spool/asterisk/172.call") in new stack
— Executing System("SIP/172-09711b80", "echo "WaitTime: 50" >> /var/spool/asterisk/172.call") in new stack
— Executing System("SIP/172-09711b80", "echo "Context: macro-vm-notify" >> /var/spool/asterisk/172.call") in new stack
— Executing System("SIP/172-09711b80", "echo "Extension: vmcall" >> /var/spool/asterisk/172.call") in new stack
— Executing System("SIP/172-09711b80", "echo "Priority: 1" >> /var/spool/asterisk/172.call") in new stack
— Executing System("SIP/172-09711b80", "echo "Setvar: vmext="172 >> /var/spool/asterisk/172.call") in new stack
— Executing System("SIP/172-09711b80", "mv /var/spool/asterisk/172.call /var/spool/asterisk/outgoing/") in new stack
— Executing Set("SIP/172-09711b80", "DB(test/count)=172") in new stack
— Attempting call on Zap/2/033112511123 for vmcall@macro-vm-notify:1 (Retry 1)
— Executing Answer("Zap/2-1", "") in new stack
— Executing NoOp("Zap/2-1", " Waiting for Answer ") in new stack
— Executing WaitForSilence("Zap/2-1", "2000") in new stack
— Waiting 1 time(s) for 2000 ms silence
— Exiting with 2000ms silence > 2000ms required
— Executing NoOp("Zap/2-1", " Hello ") in new stack
— Executing Goto("Zap/2-1", "talk|1") in new stack
— Goto (macro-vm-notify,talk,1)
— Executing Wait("Zap/2-1", "3") in new stack
— Executing BackGround("Zap/2-1", "this-is-the-voice-mail-system") in new stack
— Executing BackGround("Zap/2-1", "to-log-in-to-voice-mail") in new stack
— Playing 'to-log-in-to-voice-mail' (language 'es')
— Executing BackGround("Zap/2-1", "press-1") in new stack
— Playing 'press-1' (language 'es')
— Executing BackGround("Zap/2-1", "or") in new stack
— Playing 'or' (language 'es')
— Executing BackGround("Zap/2-1", "to-hang-up") in new stack
— Playing 'to-hang-up' (language 'es')
— Executing BackGround("Zap/2-1", "press-2") in new stack
— Playing 'press-2' (language 'es')
— Timeout on Zap/2-1
== CDR updated on Zap/2-1
— Executing Hangup("Zap/2-1", "") in new stack
== Spawn extension (macro-vm-notify, t, 1) exited non-zero on 'Zap/2-1'
— Executing Set("Zap/2-1", "COUNT=172") in new stack
— Executing Macro("Zap/2-1", "vm-notify2|172") in new stack
— Executing Set("Zap/2-1", "phonenumber1=033112511108") in new stack
— Executing GotoIf("Zap/2-1", "0?0:10") in new stack
— Goto (macro-vm-notify2,s,10)
— Executing HasNewVoicemail("Zap/2-1", "172") in new stack
— Executing SetVar("Zap/2-1", "spooldir=/var/spool/asterisk") in new stack
— Executing System("Zap/2-1", "echo "Channel: Zap/2/"033112511108 > /var/spool/asterisk/172.call") in new stack
— Executing System("Zap/2-1", "echo "MaxRetries: 5" >> /var/spool/asterisk/172.call") in new stack
— Executing System("Zap/2-1", "echo "RetryTime: 60" >> /var/spool/asterisk/172.call") in new stack
— Executing System("Zap/2-1", "echo "WaitTime: 50" >> /var/spool/asterisk/172.call") in new stack
— Executing System("Zap/2-1", "echo "Context: macro-vm-notify2" >> /var/spool/asterisk/172.call") in new stack
— Executing System("Zap/2-1", "echo "Extension: vmcall" >> /var/spool/asterisk/172.call") in new stack
— Executing System("Zap/2-1", "echo "Priority: 2" >> /var/spool/asterisk/172.call") in new stack
— Executing System("Zap/2-1", "echo "Setvar: vmext="172 >> /var/spool/asterisk/172.call") in new stack
— Executing System("Zap/2-1", "mv /var/spool/asterisk/172.call /var/spool/asterisk/outgoing/") in new stack
— Executing Set("Zap/2-1", "DB(test/count)=172") in new stack
— Hungup 'Zap/2-1'
i´m very close to make this work. Regards carlosmg
333Modify Call ID
i want to modify the Call id for example
Executing Answer("Zap/2-1", "") change to Executing Answer(""SIP/172-08882318"", "")
this "Zap/2-1" to "SIP/172-08882318"
there is a command to set this change
thanks
333Show incoming Calls in a Linux Console or MacOS X Popup
I have modified the source from "Asterisk tips MythTV integration" made available by "gregmac" the way
that any incoming call pops up a console window on my Linux box and on my MacOSX machine.
Quit usefull and no extra software needed to install on the desktop computers.
A short description can be found here http://www.freecx.com/Asterisk-call-notification.html
Cheers,
Karl-Uwe
333Link Broken
May you put the information again in this URL?
Tjank you in advance,
Juanjo
333Could this be used with call queues!