From: Pete F. <pj...@ca...> - 2005-11-01 13:16:06
|
Mike, here is the code I use to gather cid from my audrey (been working for over 2 years now). It isn't the prettiest code .... ----------Code - audrey_cid.pl ----------- # Category = Phone # =begin comment This will recv callerid msgs from an audrey running the acid (audrey caller id) version 2.0. You also need the 'caller waiting id' service. More info at http://www.timemocksme.com/acid/ Use these mh.ini parm(s) -- 1 line for each audrey: audrey_callerid_ip_1 = 192.168.1.143 # audrey_callerid_ip_2 = 192.168.1.67:4550 (w/ optional port, dflt is 4550) =cut use audrey_cid; my $audrey_ip; my $cid_name; my $cid_number; ($cid_name,$cid_number)=&audrey_cid::read(); if($cid_number){ # did we get anything? my $caller_id_data; # Speak incoming callerID data and log it my $caller=$cid_name; #probably need to reformat this. print_log "callerid info : $cid_number [$cid_name]"; # If we have other callerID interfaces (e.g. phone_modem.pl) # lets not repeat ourselfs here. unless ($Time - $Save{phone_callerid_Time} < 3) { $Save{phone_callerid_nmbr} = $cid_number; # Save last caller for display in lcdproc.pl $Save{phone_callerid_time} = "$Hour:$Minute"; $Save{phone_callerid_Time} = $Time; play rooms => 'all', file => 'ringin.wav'; # Simulate a phone ring speak("rooms=all_and_out mode=unmuted $caller"); # speak("address=piano $caller"); # If you want to make them announce callers # speak("address=kitchen $caller"); # speak("address=bedroom $caller"); # Here we make the audreys we want to show the callerid MH page run 'get_url -quiet "http://192.168.0.138/cgi-bin/channelURL?CH=MH-Phone" /dev/null' ; run 'get_url -quiet "http://192.168.0.142/cgi-bin/channelURL?CH=MH-Phone" /dev/null' ; # get "http://192.168.0.143/cgi-bin/channelURL?CH=MH-Phone"; ### This is the CID Audrey run 'get_url -quiet "http://192.168.0.148/cgi-bin/channelURL?CH=MH-Phone" /dev/null' ; # and of course we really need to log the data to the callerid logs logit("$config_parms{data_dir}/phone/logs/callerid.$Year_Month_Now.log", "$cid_number name=$cid_name data=NA line=2 type=2"); logit_dbm("$config_parms{data_dir}/phone/callerid.dbm", $cid_number, "$Time_Now $Date_Now $Year name=$cid_name"); } } ----------/Code - audrey_cid.pl ----------- Pete http://www.mraudrey.net On Sun, 2005-10-30 at 21:50 +0000, Michael Noble wrote: > Could someone eliighten me as to what im going wrong. > I have a few Audreys and have one of them set up as the acid server on > the default port. Set the others as clients and they all work > perfectly. Then tried to activate the Audrey_cid.pl by copying it from > \code\public to Code/Common then set the mh.ini params to > "audrey_callerid_ip_1 =192.168.0.27" then activated it. I am > running the latest version of both MH and Acid for the audrey. This is > what happens when i reload MH. ... > > Error in user code file ./../data/mh_temp.user_code > 10/30/05 03:39:26 PM: > 10/30/05 03:39:26 PM Oops1: String found where operator expected at > (eval 23283) line 2284, near ""; > if ( $list eq 'all' ) { > for ( $AC= 0;$AC < $Acount + 1 ;$AC++){ > $list2 = "" > (Might be a runaway multi-line "" string starting on line 2281) > (eval 23283) has too many errors. > Line 2279: # # make up a list of all the entries Name only > Line 2280: # # $list = 'Kitchen,Piano,Desk,Bedroom' if $list eq > 'all'; > Line 2281: $list2 =""; > Line 2282: if ( $list eq 'all' ) { > Line 2283: for ( $AC= 0;$AC < $Acount + 1 ;$AC++){ > Line 2284: $list2 = "$list2 $Aname[$AC],$Aip[$AC]"; > Line 2285: #$list2 = "$list2 $Aname[$AC]"; > Line 2286: #$list2 = "$list2 $Aip[$AC]"; > Line 2287: $list2 = "$list2," if ($Aname[$AC + 1] ne '') ; > Line 2288: } > Line 2289: print "$Acount - List name - $list2 \n"; > > Is there something that i need to activate prior to activating > audrey_cid.pl > > Any help will be appreciated. > > Mike > > ------------------------------------------------------- This SF.Net > email is sponsored by the JBoss Inc. Get Certified Today * Register > for a JBoss Training Course Free Certification Exam for All Training > Attendees Through End of 2005 Visit > http://www.jboss.com/services/certification for more information > ________________________________________________________ To > unsubscribe from this list, go to: > http://sourceforge.net/mail/?group_id=1365 |