[Asterisk-Users] Re: Polycom CID (name + number)

Adam Goryachev mailinglists at websitemanagers.com.au
Wed Jan 19 20:27:44 MST 2005


On Wed, 2005-01-19 at 19:33 -0500, Matt Gibson wrote:
> Adam Goryachev wrote:
> > On Wed, 2005-01-19 at 12:02 -0500, Matthew Marlowe wrote:
> > 
> >>I'm still waiting for them to release a firmware update that shows caller id 
> >>name and number at the same time while the phone is ringing.  That should be 
> >>submitted as a feature request as well I assume.
> > 
> > 
> > This is working for me already... on my polycom IP300 on my desk...
> > 
> > I recently used the asterisk-addons to add mysql to my asterisk, it
> > looks up CND to find the client name, and then displays both data.
> 
> Could you show us an example of this?

[macro-fixcallerid]
exten => s,1,NoOp(${CALLERIDNUM})
exten => s,2,GotoIF($["${CALLERIDNUM}" = ""]?20:3)
exten => s,3,SetCIDNum(0${CALLERIDNUM})
exten => s,4,NoOp(${CALLERIDNUM})
exten => s,5,NoOp
exten => s,6,MYSQL(Connect connid ${MYSQLHOST} ${MYSQLUSER} ${MYSQLPASS}
${MYSQLDB})
exten => s,7,MYSQL(Query resultid ${connid} select Name from
myob_customers\,myob_address where Phone = \'${CALLERIDNUM}\' AND
myob_customers.CardRecordID=myob_address.CardRecordID)
exten => s,8,MYSQL(Fetch fetchid ${resultid} Name)
exten => s,9,SetCIDNum(9${CALLERIDNUM})
exten => s,10,GotoIf(${fetchid}?11:20)
exten => s,11,NoOp("Callers Company name is ${Name}.")
exten => s,12,SetCIDName(${Name})
exten => s,13,MYSQL(Clear ${resultid})
exten => s,14,MYSQL(Disconnect ${connid})
exten => s,15,NoOp
exten => s,16,NoOp
exten => s,17,NoOp
exten => s,18,NoOp
exten => s,19,Goto(21)
exten => s,20,SetCIDName(Not Available)
exten => s,21,NoOp(${CALLERID})

I simply call this macro on all incoming calls like this:
exten => 12345678,1,SetAccount(12345678)
exten => 12345678,2,Macro(fixcallerid)
exten => 12345678,3,Goto(s,1)

It works quite nicely for me.

Regards,
Adam

-- 
 -- 
Adam Goryachev
Website Managers
Ph:  +61 2 8304 0000                        adam at websitemanagers.com.au
Fax: +61 2 9345 4396                        www.websitemanagers.com.au




More information about the asterisk-users mailing list