Kevin Nguyen wrote:> I am working for Accudata Technologies. We
> provide CNAM via http request or raw TCP/IP connection.
> We would like to provide the same capability to Asterisk. I installed
> Asterisk on Fedora 2.0
> and did reading about AGI and AGI application at
> http://www.voip-info.org/tiki-index.php?page=Asterisk+AGI,
> http://www.voip-info.org/wiki-Asterisk+Manager+API, and The Asterisk
> Handbook Version2
> but still not clear on how to interface a new application to Asterisk.
What you need to do is create a small resource module (res_accudata
would be a good name), and have that module register a dialplan function
using the new function system just recently posted in Mantis and
committed to CVS.
If the module will require configuration (for example, to specify the
server to query, or username/password for authentication), then it can
read a config file named accudata.conf for that info (you will have to
define the format, but I'd suggest just putting variables into the
[general] section).
Finally, your function can accept a single parameter (10-digit NANPA
number) and return a string. Usage would be something like:
exten => 5000,1,SetCIDName($(accudata_CNAM 6025551212))
There is no need for an external daemon; the res_accudata module can
open a socket to your server and send/receive data like any other C
program would do.
If you need help doing this, join the #asterisk-dev IRC channel, or if
you don't have the skills to do it, ask to have one of the Asterisk
development team members do it for you (but expect to either have to
wait until they have time, or to offer a bounty as an incentive <G>).