Asterisk Source/My Sql
AsteriskSource/MySql ¶* asterisk-addons-1.0.1
static char *descrip = "MYSQL(): Do several mySQLy things\n" "Syntax:\n" " MYSQL(Connect connid dhhost dbuser dbpass dbname)\n" " Connects to a database. Arguments contain standard MySQL parameters\n" " passed to function mysql_real_connect. Connection identifer returned\n" " in ${var}\n" " MYSQL(Query resultid ${connid} query-string)\n" " Executes standard MySQL query contained in query-string using established\n" " connection identified by ${connection_identifier}. Result of query is\n" " is stored in ${var}.\n" " MYSQL(Fetch fetchid ${resultid} var1 var2 ... varN)\n" " Fetches a single row from a result set contained in ${result_identifier}.\n" " Assigns returned fields to ${var1} ... ${varn}. ${fetchid} is set TRUE\n" " if additional rows exist in result set.\n" " MYSQL(Clear ${resultid})\n" " Frees memory and datastructures associated with result set.\n" " MYSQL(Disconnect ${connid})\n" " Disconnects from named connection to MySQL.\n" ; /* EXAMPLES OF USE : exten => s,2,MYSQL(Connect connid localhost asterisk mypass credit) exten => s,3,MYSQL(Query resultid ${connid} SELECT username,credit FROM credit WHERE callerid=${CALLERIDNUM}) exten => s,4,MYSQL(Fetch fetchid ${resultid} datavar1 datavar2) exten => s,5,GotoIf(${fetchid}?6:8) exten => s,6,Festival("User ${datavar1} currently has credit balance of ${datavar2} dollars.") exten => s,7,Goto(s,4) exten => s,8,MYSQL(Clear ${resultid}) exten => s,9,MYSQL(Disconnect ${connid}) */ asterisk-addons-1.4.9 ¶* cdr/cdr_addon_mysql.c
By default, asterisk will write or post your call detail record (CDR) at the end of every calls. This help keeping track of all calls including bill seconds. But if you have too many calls, the load of your server writing CDR or inserting in the database can become enormous. You can add some options in /etc/asterisk/cdr.conf. For example, asterisk can just collect the cdr and after 10 calls ou 5 minutes, write the call details in a file or insert them in the database. * asterisk
call detailed record (CDR) ¶* main
|
You will soon meet a person who will play an important role in your life. |