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

what entries need to do in .conf files for call forwarding
what should be entries in extensions /& sip /& queue conf in Asterisk for call forwarding by default?
To make two door phones, extensions 105 and 106 dial a single extension 104 through an asterisk pbx
Asterisk Move the bridged call in to meete conference
Asterisk - Push-to-talk feature
FreePBX / Asterisk queue leastrecent Breaks on transfer
To play an asterisk IVR in meetme conference
Waiting for extra digit when it's clear that there's no other matching rule
Asterisk Realtime configuration issue
Missing user Profile ,But in Conbridge.conf it is present Asterisk-11.5.1 app_confbridge
Asterisk - what does “make menuconfig” command do?
Segmentation fault when more calls come in asterisk
How widely used is Asterisk PBX?
Multiple DTMFs defined to leave_conference
Asterisk AMI Atxfer on explicitely bridged channels
Appkonference not getting installed

Categories

HOME
airflow
autohotkey
http
youtube-api
typo3
salesforce
postgresql-9.3
casting
reference
magento-1.9.2.1
watson-iot
promotions
pyodbc
runtime
guidewire
github-flavored-markdown
owncloud
hapijs
spring-webflow
google-drive-android-api
ng-tags-input
screen-scraping
rancher
android-6.0-marshmallow
large-files
resx
launchd
custom-fields
git-submodules
csproj
traitsui
dom4j
maven-2
scip
scalamock
azure-web-roles
rbac
mtm
vpython
api-key
django-tables2
monaca
photoshop-script
sp
r-commander
aot
multi-targeting
iban
alarmmanager
firebase-job-dispatcher
jira-agile
require-handlebars
tinybox2
falcon
airwatch
transaction-isolation
mod
clique
web-optimization
videoview
jain-sip
openhab
strcpy
xmla
touch-typing
report-builder2.0
pytz
sendy
power-management
html5-filesystem
windows-phone-store
mixradio
code-complete
pudb
ntdll
zepto
netbiscuits
diazo
mvcmailer
jmesa
nsundomanager
fileoutputstream
xcdatamodel
user-preferences

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