asterisk


execute a command when extension ringing asterisk


I used these commands for save CallerID in database :
exten => s,1,MYSQL(Connect connid localhost root 123456 CallerID)
exten => s,2,Set(idcaller=${CALLERID(name)})
exten => s,3,MYSQL(Query resultid ${connid} INSERT INTO CallerID SET Num="${idcaller}")
exten => s,4,MYSQL(Disconnect ${connid})
Now i want to execute these commands when extension is ringing ...
It means that first IVR works then the diall extension Id then these Commands have to work ...
where i have to put my commands ?
thanks alot .
You can't do anything on ringing state, it is not implemented in asterisk
You can do that when extension entered before dial - just put that before dial command like
exten => 100,1,MYSQL(Connect connid localhost root 123456 CallerID)
exten => 100,2,Set(idcaller=${CALLERID(name)})
exten => 100,3,MYSQL(Query resultid ${connid} INSERT INTO CallerID SET Num="${idcaller}")
exten => 100,4,MYSQL(Disconnect ${connid})
exten => 100,n,Dial(SIP/100,,ro)
NOTE, MYSQL command is depricated. User func_odbc or realtime.
To do something when extension is ringing you have to use AMI interface and write your own application using it to detect ringing state and write it to database (or do anything else you like).
https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=4817239

Related Links

asterisk SIP User-to-User
Asterisk unable to lookup hostname
how to handle multiple instance of asterisk in single freepbx for load sharing?
Asterisk AMD doesn't start on outbound call
Asterisk AMI - How to simulate a DTMF sending action over AMI
Asterisk - Digium fax for asterisk add-on - receive fax?
Elastux: Apache 500 eror after fresh install
Receiving “Wrong Password” while trying to connect to Asterisk using SIP users
Route Call in Asterisk Server
Asterisk Server - Call Back 3 way script
Asterisk who is calling every minute?
How to know that which extension is calling which one in Asterisk?
Elastix issue with sipgate and anonymous calls
extension line: add specific header if RPID privacy=full
Asterisk Call Transfer to Playback then resume back call
Astarisk Call File_Can wait or get response to start playback?

Categories

HOME
javafx
algolia
intellij-idea
grpc
xamarin.forms
ibm
mifare
itext7
assign
yuv
schema
pdf-generation
osclass
drush
javascript-debugger
logstash-configuration
swift3.1
responsive
reportlab
udeploy
android-wifi
descriptor
git-branch
ajaxcontroltoolkit
rvm
functional-dependencies
adobe-captivate
angular2-changedetection
scripting-language
boosting
typeclass
openoffice-impress
undo
postgresql-9.6
microstrategy
zimbra
certbot
pymunk
word-wrap
armadillo
azure-web-roles
file-descriptor
autodesk-data-management
bzip2
definition
html-entities
weld
yank
playframework-1.x
nsalert
printer-control-language
alarmmanager
android-tabs
mavlink
netlink
patching
queuing
system-integration
sbt-proguard
user-profile
radar-chart
bbedit
skbio
containstable
imageicon
angular-promise
tvp
javapackager
android-togglebutton
syncano
autopep8
accpac
wingdb
chunks
crtdbg.h
caption
api-eveonline
indic
lastinsertid
misfire-instruction
pymel
phone-state-listener
gpl
wpml
php-gettext
motorola-droid
commonsware
automapper-2
soapexception
netbeans7.0
cinder
azure-appfabric
miniport
lts
expander
cons
scalable

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App