Asterisk cmd MYSQL

hi

Can anyone explain these lines (especially the second one)

exten => _X.,1,MYSQL(Connect connid localhost dbuser dbpass dbname) exten => _X.,2,MYSQL(Query resultid ${connid} SELECT\ scriptname\ from\ mac2pin\ where\ userid=${CALLERIDNAME}) exten => _X.,3,MYSQL(Fetch fetchid ${resultid} AGIScript) exten => _X.,4,GotoIf($[${AGIScript} = NULL]?5:7) exten => _X.,5,AGI(${DefaultAGIScript},${EXTEN}) exten => _X.,6,Goto(_X.,8) exten => _X.,7,AGI(${AGIScript},${EXTEN}) exten => _X.,8,MYSQL(Clear ${resultid}) exten => _X.,9,MYSQL(Disconnect ${connid}) exten => _X.,10,Hangup

Best Regards,

It connect to dbname and do a query to obtain the scripttname from table mac2pin where the userid its the CallerID Name :mrgreen:

Thanks, and what is the scriptname.
If I have to get value of (balance) from database and if it > 1$ so dial($EXTEN) after that start reduce balance according to call rate, do you have any idea about that?

The name of the AGI Script to run.

All of this will have been custom written. You need to find the author.

Hi, thanks for interesting,is there a way to do that without agi

Do what?

[quote=“tholog”]
If I have to get value of (balance) from database and if it > 1$ so dial($EXTEN) after that start reduce balance according to call rate, do you have any idea about that?[/quote]

maybe using cdr?