[asterisk-users] Re: Asterisk Database

Rushowr rushowr at phreaker.net
Fri Jul 14 00:39:29 MST 2006


> If Asterisk database can handle large amount of data, I would prefer it
> because of stability and speed. If Asterisk database can't handle that then
> I'll have to use MYSQL (or MSSQL which I prefer because I already store CDR
> to MSSQL).
>
> With internal database I have code like this.
>
> exten => _1XX,1,LookupCIDName
> exten => _1XX,n,Dial(SIP/${EXTEN},30,wt)
>
> How will it look like with mysql? Like this?
>
> exten => s,1,MYSQL(SELECT * FROM whatever)
> exten => s,n,Dial(SIP/${EXTEN},30,wt)

It would look like this:

exten => s,1,MYSQL(Connect dbcxnid HOST USER PASS DB)
exten => s,n,MYSQL(Query resultid ${cbcxnid} SELECT\ \*\ FROM\ whatever)
exten => s,n,MYSQL(Fetch fetchid ${resultid} VAR1\ VAR2\ VAR3\)
exten => s,n,MYSQL(Clear ${resultid})
exten => s,n,MYSQL(Disconnect ${dbcxnid})

That's a general idea...check the voip-info wiki (asterisk cmd MYSQL)




More information about the asterisk-users mailing list