Richard Reina
2005-Mar-27 19:57 UTC
[Asterisk-Users] pass caller ID to another application or machine.
I would like to have asterisk pass along the caller ID phone number to a database server on a my local network (the same network that the * server resides on ) so that our customer service app. can pull up customer data automatially. Asterisk passes along caller ID to the phones fine, can someone tell me how to make it pass this info to my database server? Any suggestions would be greatly appreciated. Thanks, Richard __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/
Damon Estep
2005-Mar-27 20:04 UTC
[Asterisk-Users] pass caller ID to another application or machine.
-----Original Message-----> From: asterisk-users-bounces@lists.digium.com > [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of > Richard Reina > Sent: Sunday, March 27, 2005 7:58 PM > To: asterisk-users@lists.digium.com > Subject: [Asterisk-Users] pass caller ID to another > application or machine. > > I would like to have asterisk pass along the caller ID phone > number to a database server on a my local network (the same > network that the * server resides on > ) so that our customer service app. can pull up customer > data automatially. Asterisk passes along caller ID to the > phones fine, can someone tell me how to make it pass this > info to my database server? > > Any suggestions would be greatly appreciated. > > Thanks, > > Richard >This requires some programming http://www.voip-info.org/wiki-Asterisk+cmd+AGI
C F
2005-Mar-27 20:15 UTC
[Asterisk-Users] pass caller ID to another application or machine.
Try FOP, www.asternic.org On Sun, 27 Mar 2005 18:57:38 -0800 (PST), Richard Reina <rf_reina@yahoo.com> wrote:> I would like to have asterisk pass along the caller ID > phone number to a database server on a my local > network (the same network that the * server resides on > ) so that our customer service app. can pull up > customer data automatially. Asterisk passes along > caller ID to the phones fine, can someone tell me how > to make it pass this info to my database server? > > Any suggestions would be greatly appreciated. > > Thanks, > > Richard > > __________________________________ > Do you Yahoo!? > Yahoo! Small Business - Try our new resources site! > http://smallbusiness.yahoo.com/resources/ > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
Michiel van Baak
2005-Mar-28 01:55 UTC
[Asterisk-Users] pass caller ID to another application or machine.
On 18:57, Sun 27 Mar 05, Richard Reina wrote:> I would like to have asterisk pass along the caller ID > phone number to a database server on a my local > network (the same network that the * server resides on > ) so that our customer service app. can pull up > customer data automatially. Asterisk passes along > caller ID to the phones fine, can someone tell me how > to make it pass this info to my database server? >Hi, You can do this with an agi script. We are doing this in our app too. We have a webbased crm app and * looks up the number there and inserts a record into a table so our app can read that. When the call hangs up, the record is deleted from the database. It's not really that hard to make. -- Michiel van Baak http://lunteren.vanbaak.info michiel@vanbaak.info GnuPG key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7E0B9A2D "Two of the most famous products of Berkeley are LSD and BSD. I don't think that this is a coincidence."
Richard Reina
2005-Mar-28 05:07 UTC
[Asterisk-Users] pass caller ID to another application or machine.
> > You can do this with an agi script. > We are doing this in our app too. > We have a webbased crm app and * looks up the number > there > and inserts a record into a table so our app can > read that. > When the call hangs up, the record is deleted from > the > database. > > It's not really that hard to make.DO you happen to rember the name of the agi command that thansfers the record into the table? Or do you know where I can find some sample sripts to look at? Thanks, RIchard __________________________________ Do you Yahoo!? Yahoo! Sports - Sign up for Fantasy Baseball. http://baseball.fantasysports.yahoo.com/
Richard Reina
2005-Mar-28 06:14 UTC
[Asterisk-Users] pass caller ID to another application or machine.
Michiel, Thanks very much for the resonse. I am confused however by "fopen("/var/log/asterisk/my_agi.log"" my * system has not such log file only the Master.cvs which only seems to log a call one its teminated? --- Michiel van Baak <michiel@vanbaak.info> wrote:> On 04:07, Mon 28 Mar 05, Richard Reina wrote: > > DO you happen to rember the name of the agi > command > > that thansfers the record into the table? Or do > you > > know where I can find some sample sripts to look > at? > > Hi, > > Here are some snippets from my php-based agi: > > #!/usr/bin/php4 -q > <?php > ob_implicit_flush(true); > set_time_limit(6); > $in = fopen("php://stdin","r"); > $stdlog = fopen("/var/log/asterisk/my_agi.log", > "w"); > // toggle debugging output (more verbose) > $debug = false; > // Do function definitions before we start the main > loop > function read() { > global $in, $debug, $stdlog; > $input = str_replace("\n", "", fgets($in, 4096)); > if ($debug) fputs($stdlog, "read: $input\n"); > return $input; > } > > // parse agi headers into array > while ($env=read()) { > $s = split(": ",$env); > $agi[str_replace("agi_","",$s[0])] = trim($s[1]); > if (($env == "") || ($env == "\n")) { > break; > } > } > .........<snip>........ > // lookup id and name > $sql = "SELECT a.id,a.bedrijfsnaam FROM adres as > a,bcards as b WHERE a.id=b.bedrijfs_id AND > (replace(replace(a.telnr,'-',''), ' ','') ILIKE > '%".$agi["callerid"]."')"; > .........<snip>........ > // put the stuff into our table > $sql = "INSERT INTO active_calls VALUES >('".$row["bedrijfsnaam"]."',".$row["id"].",".mktime().")";> .........<snip>........ > ?> > > > > have fun! > -- > Michiel van Baak > http://lunteren.vanbaak.info > michiel@vanbaak.info > GnuPG key: >http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7E0B9A2D> > "Two of the most famous products of Berkeley are LSD > and BSD. I don't think that this is a coincidence." > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com >http://lists.digium.com/mailman/listinfo/asterisk-users> To UNSUBSCRIBE or update options visit: > >http://lists.digium.com/mailman/listinfo/asterisk-users>__________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/
Richard Reina
2005-Mar-28 08:50 UTC
[Asterisk-Users] pass caller ID to another application or machine.
--- Michiel van Baak <michiel@vanbaak.info> wrote:> I created that file myself. > That way I can put debug information into that > logfile while > developing that agi script. > It's part of my skeleton agi script ;) > >Please pardon my ignorance, but how did you get asterisk to pass that into to your log file. That is in essence the part I'm haveing the most difficulty with. Thanks, Richard __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/