[Asterisk-Users] Caller ID from Database

Dan dtoma at fx.ro
Sat Dec 6 12:29:43 MST 2003


Hi,

----- Original Message ----- 
From: "Jim Paraschou" <algogr at yahoo.com>
To: <asterisk-users at lists.digium.com>
Sent: Saturday, December 06, 2003 8:13 PM
Subject: [Asterisk-Users] Caller ID from Database


> Hi all,
> Does anybody know a way to set callerid to a channel
> by searching the incoming cid to a database and return
> the name of the caller and set the callerid to the
> channel.
> I tried it with agi script in C but the problem is
> that agi command SET CALLERID did not work for me with
> a variable.
> What i mean is that printf("SET CALLERID 123<JIM>")
> for example works fine printf("SET CALLERID %s",clid)
> where clid is a string variable does not work.
> Anyone can help?

I use a very simple workaround with the internal Asterisk database.
This is the context for the incoming calls on X100P:

[incoming]
exten => s,1,Answer
exten => s,2,Ringing
exten => s,3,DBget(CIDTMP=phonebook/${CALLERIDNUM})
exten => s,4,SetCallerID(${CALLERIDNUM})
exten => s,5,SetCIDNAME(${CIDTMP})
exten => s,6,Dial(..

To add records use something like that from the * console:
database put phonebook 2530123 MyHome

It works perfect for me ( I do not have a very large database)

Best regards,
Dan




> Thanks
> Dimitris
> 
> __________________________________
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing.
> http://photos.yahoo.com/
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> 




More information about the asterisk-users mailing list