[Asterisk-Dev] CallerIDName missign in manager events in * 1.0.7 or how to pass parameters using Asterisk like data gateway (proposal)

Fernando Romo pop at cofradia.org
Wed Apr 6 00:01:55 MST 2005


Dear Developers:

i'm development two projects than involved the asterisk manager API: one 
cti server and a Predictive Dialer, (the first must be GPL soon), but a 
found one interesting scenario, let me explain:

i take from a postgres DB a set of numbers to dial with have a campaign 
number, for example phone number 5585909000 but the same number are 
involved in two simultaneus campaigns, and we need to diference each.

the CTI application is a noforker and no block socket server write in 
Perl and is optimazed to cach the Asterisk events and deal with many 
clients, this client is a Flash app (Nicolás Gudiño wrote the basic 
flash piece) than take XML messages fron the cti Server and send a URL 
with parameters like the callerid and the calleridname and invoque a cgi 
who read the SQL to make the "Screen Pop" efect.

Well the goal of cti server is be fast and avoid contention, The dialer 
in other hand, can do the same, but velocity is not a principal design, 
beacouse each time to fetch a number from the DB, put in contention the 
aplicaction and make "latency" to clients, then i decide to split the 
software in two, one fast to attend the clients and one dedicate to 
dial... but something are needed here!... I found the best way to pass 
new parameters between the two applications are Asterisk using the 
CallerIDName to pass arbitrary Values like the CampaignID related to 
Phone number dialed.

I must do this beacouse i send a few simultaneous calls (90 to be 
exact), and the answer of the calls not be the same order of dialing 
(some people don't answer fast, or not in home, etc) and is imposible to 
keep the dial-answer order, then i think the only way to pass the 
parameter required without any order involved in the call process is 
using the CallerIDName in the Originate action of Manager API.

In the CVS Head works beautiful, but i have a little crash issue of 
asterisk in ACD production system (bug 0003748), then i decide to use 
the estable version 1.0.7 but when a "packet" of the manager arrive to 
catch a Agent event, the callerIDName are missing. For example:

     in CVS Head the packet come with this info:

                 Event: Newchannel
                 Channel: Agent/1001
                 State: Up
                 CallerID: 5585909000
                 CallerIDName: C23   <= This is my campaign info!
                 Uniqueid: 1108862578.40

     in the cvs version v1-0-7 the packet appear in this way:

                 Event: Newchannel
                 Channel: Agent/1001
                 State: Up
                 CallerID: 5585909000
                 Uniqueid: 1308862900.23

I check the chan_agent.c and app_dial.c to figure out who to patch and 
add the missing CalleIdName field in the stable version.

My question are: in which files are the definitions of the CallerIDName? 
and ... how to implement in the 1.0.7 branch?

i read the include/callerid.h and i don't have the knowladge (well not 
right now) to find the source involved.

If you can comment any idea or guide about it, i appreciate the info... 
and in other side, i can propose to put and extra info field in the 
manager API to handle custom values for aplications, maybe something 
like this:

                 Event: Newchannel
                 Channel: Agent/1001
                 State: Up
                 CallerID: 5585909000
                 CallerIDName: Foo
                 Values: Bar           <= This is the proposal
                 Uniqueid: 1108862578.40

Comments are welcome.

Thanks in advanced..... Fernando Romo



More information about the asterisk-dev mailing list