[asterisk-users] set(CALLERID(name) not working

Doug Lytle support at drdos.info
Wed Nov 12 15:49:26 CST 2008

sean darcy wrote:
> Tried it with and with quotes. Same result - exactly. Works with dummy 
> variable, doesn't if set in subroutine.

It works fine for me, I use the below:

exten => 3175797960,1,Gosub(get_name,s,1)


;* Connect to local MySQL database to match-
;* against speed dial database for Caller*ID
;* name.  If no match, check against Corporate
;* Database.  If a match, jump to incoming
;* Context.

exten => s,1,MYSQL(Connect connid localhost anonymous '' speeddials)
exten => s,n,GosubIf($["${MYSQL_STATUS}" = "-1"]?mysql_failed,s,6)
exten => s,n,MYSQL(Query resultid ${connid} SELECT name FROM 
Indianapolis WHERE phone = 1${CALLERID(num)})
exten => s,n,MYSQL(Fetch fetchid ${resultid} caller.name)
exten => s,n,MYSQL(Disconnect ${connid})
exten => s,n,MYSQL(Clear ${resultid})
exten => s,n,Set(CALLERID(name)=${caller.name})
exten => s,n,Set(CALLERID(num)=${CALLERID(num)})
exten => s,n,GotoIf($["${caller.name}" != ""]?10:100)
exten => s,n,NoOP(${DIALSTATUS})
exten => s,n,Return

Ben Franklin quote:

"Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."

More information about the asterisk-users mailing list