Missed calls notification send to database

Hello,
I like to know if there is way to send query to database, when the call is not answered?
What i mean is how to get info about caller (I’m using Cisco IP Phone 7960/7940 and chan sccp b)
and then send query to database (e.g. MySQL), so i can view missed calls on 7960/7940 via web service feathure.
I’m using Asterisk ver. 11.

The web service is almost done so all i need is how to get info from Asterisk to database.

Thanks

asteriskdocs.org/en/3rd_Edit … sk-DB.html

Basically is check the the value of ${DIALSTATUS} variable and then insert the value on a DB using a logic condition, an easy way to write on the DB is using system CMD System().

NOTE this example is using SIP channel driver

Here it is an example modify it according to your needs.

exten => 1013,1,Dial(SIP/${myphone},10)

same => n,GotoIf($["${DIALSTATUS}" = “BUSY”]?busy:unavail)

same => n(unavail),System(mysql --user=root --password=‘123456’ asterisk -e ‘INSERT INTO conference(conference_id , callerid , destination , conference_room , date )VALUES (NULL ,"${CALLERID(num)}", “${CDR(dst)}”, “${UNIQUEID}”, NULL)’)
same => n,Hangup()

same => n(busy),System(mysql --user=root --password=‘123456’ asterisk -e ‘INSERT INTO conference(conference_id , callerid , destination , conference_room , date )VALUES (NULL ,"${CALLERID(num)}", “${CDR(dst)}”, “${UNIQUEID}”, NULL)’)
same => n,Hangup()

I hope its will be working in every mobile good work i like your software thanks for the nice sharing

1 Like