adriano ghezzi
2007-Apr-25 15:12 UTC
[asterisk-users] call dispatching - legacy application
Hy all need to preprocess 1) incoming call get caller id lookup some info in my db, 2) based on the result dispatch the call to the right operator step 1 is ok I developped a small .php script that connect manager and parse events, now I have to tell AAH do dispatch call to the right operator questions 1) is this the right practice ? 2) where to find a complete manager api reference, (to buy too) note that there is a legacy application that query the db actually php script send the request to this app and wait for response I'm a programmer at very first installation of AAH , just testing capabilities thanks in advance for any help and suggestion.
Then you take the number you get from your database and put it into the asterisk spooler. Remember, the temp file you create has to be moved to the spooler using the mv command. Nothing else works. There might be one other step, I am not sure with Asterisk 1.4. I had a friend help me do it before and he said he had to write a little piece of python code to make it work properly (we were making asterisk call phone automatically). I am not sure if you will need this or not. I know the process because I had it done for me before. I am at the beginning trying to do the same thing, though my php is rusty. Maybe you can hook a brother up with the proper code to "grab caller id and query mysql? To answer your question, Yes, you are on the right track! Brad brads@ftnco.com -----Original Message----- From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of adriano ghezzi Sent: Wednesday, April 25, 2007 6:13 PM To: asterisk users Subject: [asterisk-users] call dispatching - legacy application Hy all need to preprocess 1) incoming call get caller id lookup some info in my db, 2) based on the result dispatch the call to the right operator step 1 is ok I developped a small .php script that connect manager and parse events, now I have to tell AAH do dispatch call to the right operator questions 1) is this the right practice ? 2) where to find a complete manager api reference, (to buy too) note that there is a legacy application that query the db actually php script send the request to this app and wait for response I'm a programmer at very first installation of AAH , just testing capabilities thanks in advance for any help and suggestion. _______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
> need to preprocess > 1) incoming call get caller id lookup some info in my db, > 2) based on the result dispatch the call to the right operator > > step 1 is ok I developped a small .php script that connect manager and > parse events, now I have to tell AAH do dispatch call to the right > operator >From your incoming context, call an AGI and pass it the CallerID. Inthe AGI, query your DB to find your destination then set an Asterisk variable with the destination. In your dialplan, take that destination and dial it. Something like exten => s,1,Answer ; Answer the line exten => s,n,Wait,1 exten => s,n,AGI(aginame.php,${CALLERID(num)}) exten => s,n,Dial(Local/${MYDESTINATION}) exten => s,n,Hangup() N.B.: Code not tested and written from the top of my head N.B.2: Since you're using AAH, you should put that in extension_custom.conf Also, have a look at the PHPAGI class : http://phpagi.sourceforge.net/ hth
adriano ghezzi
2007-Apr-26 15:20 UTC
[asterisk-users] Re: call dispatching - legacy application
well more indeep the actual process is myparser a php script connected "telnet" to aah manager get and parse events it grab cid from manager event (incoming call) it passes cid to a legacy visual basic app that query a db on ibm as/400 the query return info about customer's status and opened tickets now it should instruct asterisk to send the call to the right operator, because at the moment I'm not able to do it i do: the call get dispatched "Normal way" i wait the call ends, the php parser inform another (master vb app) that open a pop-up on the pc of the operator that processed the call and update the customer'ts ticket what i would like is to dispatch the call to a specific operator eg the "preferred" customer's operator. thanks to Brad. ciao! 2007/4/26, adriano ghezzi <adriano.ghezzi@gmail.com>:> Hy all > > need to preprocess > 1) incoming call get caller id lookup some info in my db, > 2) based on the result dispatch the call to the right operator > > step 1 is ok I developped a small .php script that connect manager and > parse events, now I have to tell AAH do dispatch call to the right > operator > > questions > 1) is this the right practice ? > 2) where to find a complete manager api reference, (to buy too) > > note that > there is a legacy application that query the db actually php script > send the request to this app and wait for response > > I'm a programmer at very first installation of AAH , just testing capabilities > > thanks in advance for any help and suggestion. >