[Asterisk-Users] CallerID name lookup AGI script

Jay Milk jay at skimmilk.net
Thu Jun 23 10:36:07 MST 2005


Sure thing, that's easy.

1- in web_lookup.php, in function get_411 change
      { $result[ "name" ] = "!" . $parser->ExtractTo( "based phone
number" ); }
To 
      { $result[ "name" ] = $parser->ExtractTo( "based phone number" );
}

And in function get_google, change
      $result[ "name" ] = "!" . $result[ "name" ];
To
      $result[ "name" ] = $result[ "name" ];

2- in inc_phonenum.php, change

    elseif( strlen( $number ) == 10 )
    { $formatted = "1" . $number; }
    else
    { $formatted = $number; }

To

    elseif( strlen( $number ) == 10 )
    { $formatted = $number; }
    else
    { $formatted = substr( $number, 1, 10 ); }

> -----Original Message-----
> From: Oswaldo Arratia [mailto:oarratia at workersequity.net] 
> Sent: Thursday, June 23, 2005 10:22 AM
> To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
> Subject: RE: [Asterisk-Users] CallerID name lookup AGI script
> 
> 
> Hi List, 
> I've managed to install this great sript and it's working fine.
> 
> I am using this in the US, just want to know if this is 
> possible and if so,
> how:
> 
> 1- Remove the '!' before the name when the calling number is 
> a Cell phone
> 2- Remove the '1' before the number. I'd like the number to 
> appear as xxx-xxx-xxxx  instead of 1-xxx-xxx-xxxx.
> 
> Thanks very much for your answers.
> 
> Oswaldo A.
> 
>  
> 
> -----Original Message-----
> From: asterisk-users-bounces at lists.digium.com
> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Jay Milk
> Sent: Friday, May 20, 2005 9:01 PM
> To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
> Subject: RE: [Asterisk-Users] CallerID name lookup AGI script
> 
> Good find -- this could WELL be the case.  I'll spend a 
> little time this weekend gettting this to work on php4 as 
> well.  There's no good reason to restrict to php5, other than 
> that the code actually looks better.
> 
> > -----Original Message-----
> > From: Chris Coulthurst [mailto:asterisk at shuksan.com]
> > Sent: Friday, May 20, 2005 2:09 PM
> > To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
> > Subject: RE: [Asterisk-Users] CallerID name lookup AGI script
> > 
> > 
> > 	I don't know if you ran in to the same thing I did, but did you
> > upgrade your PHP to 5.0.4 to make this work?  I found that the 
> > cid_rewrite.php script calls the php from /usr/bin, whereas the PHP 
> > 5.0.4 install defaults to /usr/local/bin if you don't 
> specify --prefix 
> > on the build. So you might still be running the old php4.  I just 
> > renamed /usr/bin/php to /usr/bin/php.old, symlinked the 
> > /usr/local/bin/php to /usr/bin, and did the same for pear, and it 
> > worked.
> > 
> > 
> > Chris Coulthurst
> > chris at shuksan.com
> >  
> > 
> > |-----Original Message-----
> > |From: asterisk-users-bounces at lists.digium.com
> > [mailto:asterisk-users-
> > |bounces at lists.digium.com] On Behalf Of Oswaldo Arratia
> > |Sent: Friday, May 20, 2005 11:34 AM
> > |To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
> > |Subject: RE: [Asterisk-Users] CallerID name lookup AGI script
> > |
> > |Hi there,
> > |
> > |I am trying to the the cid_rewrite.php script but if I run
> > it from the
> > |directly I get this error:
> > |
> > |./cid_rewrite.php
> > |
> > |<br />
> > |<b>Parse error</b>:  parse error, expecting `T_OLD_FUNCTION' or
> > |`T_FUNCTION' or `T_VAR' or `'}'' in <b>/var/lib/asterisk 
> > |/agi-bin/astlib_jm.php</b> on line <b>73</b><br /> <br /> <b>Fatal 
> > |error</b>:  Cannot instantiate non-existent class:  agi in 
> > |<b>/var/lib/asterisk/agi-bin/cid_rewrite.php</b> on line 
> <b>60</b><br 
> > |/>
> > |
> > |
> > |
> > |Here is the PHP version I am using:
> > |PHP 5.0.4 (cgi) (built: May 20 2005 14:08:40) Copyright 
> (c) 1997-2004
> > |The PHP Group Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend 
> > |Technologies
> > |
> > |Does anybody know what my problem is or if I am missing
> > anythiong here?
> > |
> > |Thanks!!
> > |
> > |Oswaldo
> > |
> > |
> > |
> > |_______________________________________________
> > |Asterisk-Users mailing list
> > |Asterisk-Users at 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
> > 
> > _______________________________________________
> > Asterisk-Users mailing list
> > Asterisk-Users at lists.digium.com 
> > http://lists.digium.com/mailman/listinfo/aster> isk-users To 
> > UNSUBSCRIBE or update options visit:
> >    
> http://lists.digium.com/mailman/listinfo/asterisk-users
> 
> 
> 
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com 
> http://lists.digium.com/mailman/listinfo/aster> isk-users
> To 
> UNSUBSCRIBE or update options visit:
>    
http://lists.digium.com/mailman/listinfo/asterisk-users



_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at 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






More information about the asterisk-users mailing list