WWW.DUMAIS.IO
ARTICLES
OVERLAY NETWORKS WITH MY SDN CONTROLLERSIMPLE LEARNING SWITCH WITH OPENFLOWINSTALLING KUBERNETES MANUALLYWRITING A HYPERVISOR WITH INTEL VT-X CREATING YOUR OWN LINUX CONTAINERSVIRTIO DRIVER IMPLEMENTATIONNETWORKING IN MY OSESP8266 BASED IRRIGATION CONTROLLERLED STRIP CONTROLLER USING ESP8266.OPENVSWITCH ON SLACKWARESHA256 ASSEMBLY IMPLEMENTATIONPROCESS CONTEXT ID AND THE TLBTHREAD MANAGEMENT IN MY HOBBY OSENABLING MULTI-PROCESSORS IN MY HOBBY OSNEW HOME AUTOMATION SYSTEMINSTALLING AND USING DOCKER ON SLACKWARESYSTEM ON A CHIP EMULATORUSING JSSIP AND ASTERISK TO MAKE A WEBPHONEC++ WEBSOCKET SERVERSIP ATTACK BANNINGBLOCK CACHING AND WRITEBACKBEAGLEBONE BLACK BARE METAL DEVELOPEMENTARM BARE METAL DEVELOPMENTUSING EPOLLMEMORY PAGINGIMPLEMENTING HTTP DIGEST AUTHENTICATIONSTACK FRAME AND THE RED ZONE (X86_64)AVX/SSE AND CONTEXT SWITCHINGHOW TO ANSWER A QUESTION THE SMART WAY.REALTEK 8139 NETWORK CARD DRIVERREST INTERFACE ENGINECISCO 1760 AS AN FXS GATEWAYHOME AUTOMATION SYSTEMEZFLORA IRRIGATION SYSTEMSUMP PUMP MONITORINGBUILDING A HOSTED MAILSERVER SERVICEI AM NOW HOSTING MY OWN DNS AND MAIL SERVERS ON AMAZON EC2DEPLOYING A LAYER3 SWITCH ON MY NETWORKACD SERVER WITH RESIPROCATEC++ JSON LIBRARYIMPLEMENTING YOUR OWN MUTEX WITH CMPXCHGWAKEUPCALL SERVER USING RESIPROCATEFFT ON AMD64CLONING A HARD DRIVECONFIGURING AND USING KVM-QEMUUSING COUCHDBINSTALLING COUCHDB ON SLACKWARENGW100 MY OS AND EDXS/LSENGW100 - MY OSASTERISK FILTER APPLICATIONCISCO ROUTER CONFIGURATIONAASTRA 411 XML APPLICATIONSPA941 PHONEBOOKSPEEDTOUCH 780 DOCUMENTATIONAASTRA CONTACT LIST XML APPLICATIONAVR32 OS FOR NGW100ASTERISK SOUND INJECTION APPLICATIONNGW100 - DIFFERENT PROBLEMS AND SOLUTIONSAASTRA PRIME RATE XML APPLICATIONSPEEDTOUCH 780 CONFIGURATIONUSING COUCHDB WITH PHPAVR32 ASSEMBLY TIPAP7000 AND NGW100 ARCHITECTUREAASTRA WEATHER XML APPLICATIONNGW100 - GETTING STARTEDAASTRA ALI XML APPLICATION

ASTERISK SOUND INJECTION APPLICATION

2012-02-25

Sound injection Application

This application, while not very usefull, is quite funny. I use it to inject sounds on an arbitrary channel, part of an active call, and will not be heard by the other peer. This will act a bit like ChanSpy, except that when pressing on a digit on your keypad, a sound file will be played on the specified channel. For example, let's say that ipphone1 is currently talking talking to ipphone2. With ipphone3, you call an extention that executes Inject(SIP/ipphone2). This will allow you to hear the conversation between ipphone1 and ipphone2. Now you would like to inject a sample that says "What is your name?" (a sound file recorded with the voice of the user using ipphone1). This can now be done by pressing a digit on your keypad. Not only they will not hear you on the other end, but the sound file that you have just injected will be heard by ipphone2 only. This could create a lot of confusion for both users.

Compiling and Installing

First, get a copy of the source code. Untar in any folder you like. With this one, the source code doesn't need to reside in the asterisk source tree, but you will need the asterisk sources on your computer. You might need to change the Makefile since the folders in there are good for my installation, but might not be good for yours. It's a one-line change anyway. Next, just type "make" to build the app, or "make load" to automatically build,install and load the module into asterisk. so basically:

wget http://www.dumaisnet.ca/files/app_inject.tar tar -xf app_inject.tar # you might need to modify the ASTMODULES and INCLUDES paths in Makefile make load

Configuration

No configuration files are needed. The only thing you need to setup is the dialplan. You only need to call Inject(CHANNEL). No need to answer first, the application will take care of it.

exten => *7,1,Inject(SIP/ipphone) exten => *7,2,Hangup()

You will need to provide sound files for when you will press digits to play the different sounds that you need. You need to copy 10 sound files in your sound folder (usualy /var/lib/asterisk/sounds). They MUST follow the name scheme "injection0.gsm", "injection1.gsm", ... "injection9.gsm". Of course, you could use .wav or .gsm. As you guessed it, pressing on "5" will play injection5.gsm. It is not necessary to provide all sound files.

Download

app_inject.tar