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 logs in Graylog2
Vtiger Crm recording links broken
Error Regarding Festival-Asterisk
Elastix - how to insert custom field
Asterisk 13 ARI not firing “ChannelTalkingStart” events
Accessing Asterisk Recorded Calls , built in solution
Setting a Dialplan for guests?
telnet command not listening asterisk manager events
Asterisk ARI call from external to external
Asterisk execute Async AGI
DEVICE_STATE(SIP/mypeer) in Asterisk returning only UNAVIALABLE and NOT_INUSE not returning other status why?
Asterisk & Freepbx : Multiple Day Night Toggles?
Asterisk 1.8 dial multiple number at the same time for outdound conference
How to execute an AGI script during a call by pressing a key
how to access call detail records via asterisk rest api?
Asterisk ARI / phpari - Bridge recording: “Recording not found”

Categories

HOME
repository
ssh
azure-eventhub
python-requests
comments
kendo-asp.net-mvc
collision-detection
rename
runtime
mongoimport
virtualenv
camunda
bookmarklet
android-actionbar
views
scotty
caldav
summernote
rvm
android-wear-2.0
nsopenpanel
symlink
android-6.0-marshmallow
checkmarx
edirectory
boost-log
availability
minitest
certbot
kepserverex
matrix-multiplication
stencyl
framebuffer
jibx
bzip2
contenteditable
serialversionuid
audio-fingerprinting
perldoc
nservicebus6
dmalloc
try-catch-finally
vertex-shader
google-scholar
lattice
stripes
qudpsocket
gdi
aws-kms
ooad
webservices-client
gitk
lytro
personality-insights
android-togglebutton
log4cxx
roslyn-code-analysis
stereotype
cakephp-2.6
tidesdk
jad
douglas-peucker
indices
esri-arc-engine
qxorm
quickfixn
xcode5
launcher
nsnotificationcenter
twitter-finagle
azure-caching
carrier
grunt-wiredep
randomaccessfile
nsnumber
dynamic-expresso
pymel
ntdll
blotter
rfc822
configurationsection
freeimage
ios6-maps
systrace
animationdrawable
advanceddatagrid
stl-algorithm
scriptmanager
sipdroid
zipstream
subdirectories
dgml
projectgen

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