<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 08.00.0681.000">
<TITLE>RE: Setting effecting_caller_id_name</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Hi Michael,</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Good eye. I actually</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">edited the fix_cidnam_plus entry</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> a while back when it wasn</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">’</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">t working correctly for a DID that sends the</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">‘</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">+</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">’</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> at the beginning.</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> </FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">The edited expression is below the original one</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">in public.xml</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">which is commented out. Now I don</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">’</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">t remember if the original expression was in there by default or if I pasted it in from somewhere</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"></FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">due to my</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"></FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">lack of experience with</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">FreeSWITCH</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> at the time</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">,</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">but</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">the original regex</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> wasn</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">’</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">t quite right since</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">OpenCNAM</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> does</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">not accept the leading</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">‘</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">1</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">’</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">. I was only worried about numbers with the leading</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">‘</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">+</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">’</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> since the other case is</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">handled by the previous entry.</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Your fix is certainly more elegant.</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> When I start to feel like I</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">’</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">m becoming reasonably proficient with regexes, I</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">subsequently</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">wind up not doing anything with them for a</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">long time and then</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">almost</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">forget what little I</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">’</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">ve</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> learned. :)</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">I</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">’</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">ve been learning a lot about Linux and FreeSWITCH at the same time</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> in the</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">past</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> months</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">,</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">it</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">’</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">s a lot</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">of information</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">for my aging mind to take in all at once.</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> I</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">really</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#1F497D" FACE="Calibri">wish I could have done this 20 years ago</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">!</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Cheer</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">s,</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">- Phil</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> <extension name="outside_call" continue="true"></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> <!--make sure the module is loaded, or else loading it will kill our call!--></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> <!-- Simple case: name=number or name is empty --></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> <!-- and number is a 10digit (excluding optional leading 1), in nanpa nxx-nxx-xxxx form --></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> <!-- will skipurl lookup if not a 10digit # (don't lookup INTL), and instead just query the SQL --></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> <condition field="${module_exists(mod_cidlookup)}" expression="true"/></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> <condition field="caller_id_name" expression="^${caller_id_number}$|^$"/></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> <condition field="caller_id_number" expression="^1?([2-9]\d\d[2-9]\d{6})$"></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> <!-- action application="cidlookup" data="1$1"/> --></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> <action application="cidlookup" data="$1"/></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> <anti-action application="cidlookup" data="${caller_id_number} skipurl skipcitystate"/></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> </condition></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> </extension></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> <extension name="fix_cidnam_plus" continue="true"></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> <!-- if the name starts with + followed by digits, strip the</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> + and then pass the number --></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> <!-- condition field="caller_id_name" expression="^\+(1[2-9]\d\d[2-9]\d{6})$"> --></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> <condition field="caller_id_name" expression="^\+1?([2-9]\d\d[2-9]\d{6})$"></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> <action application="cidlookup" data="$1"/></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> </condition></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri"> </extension></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><B><FONT FACE="Calibri">Michael Collins</FONT></B></SPAN><SPAN LANG="en-us"><BR>
<I><FONT FACE="Calibri">Tue Jul 31 20:44:00 MSD 2012</FONT></I></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri"> </FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">Phil,</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">I have a question about this line from your trace:</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">Dialplan: sofia/external/</FONT></SPAN><SPAN LANG="en-us"></SPAN><A HREF="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"><SPAN LANG="en-us"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">4435551212 at 140.239.xx.x</FONT></U></SPAN><SPAN LANG="en-us"></SPAN></A><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New"> Regex (FAIL)</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">[fix_cidnam_plus] caller_id_name(4435551212) =~</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">/^\+1?([2-9]\d\d[2-9]\d{6})$/ break=on-false</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">Are you thinking that "4435551212" should match the regex in extension</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">"fix_cidnam_plus"? The reason I ask is that I think your regex may have a</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">small gotcha. It looks to my like you are making the leading "1" optional</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">by having "1?" in front of the rest of the regex. However, it looks to me</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">like the "+" is not optional, so unless the phone number is "+4435551212"</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">it won't match that regex. If the + is meant to be optional then the easy</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">way to test would be to add a "?" right after the "+":</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New"><condition field="caller_id_name" expression="^\+?1?([2-9]\d\d[2-9]\d{6})$"></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">Of course, if you were banking on having the + in there then I'm all wet</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">and you can ignore me...</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">-MC</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">_____________________________________________<BR>
</FONT></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B><FONT SIZE=2 FACE="Tahoma">From:</FONT></B></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> Phil Quesinberry<BR>
</FONT></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B><FONT SIZE=2 FACE="Tahoma">Sent:</FONT></B></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> Tuesday, July 31, 2012 12:20 PM<BR>
</FONT></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B><FONT SIZE=2 FACE="Tahoma">To:</FONT></B></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> 'freeswitch-users@lists.freeswitch.org'<BR>
</FONT></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B><FONT SIZE=2 FACE="Tahoma">Subject:</FONT></B></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> RE: Setting effecting_caller_id_name</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Ok, the problem here is that the variable caller_id_name contains the Caller ID number instead of the CNAM that was looked up. Is there a variable to look at and change for the CNAM info? Info shows the CNAM info in Caller-Caller-ID-Name but attempts to match on variations of that have failed. Obviously I’m missing some basic piece of info here but I haven’t been able to find it, even within the FreeSwitch book.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">I’ve pasted a small section of the relevant console output below.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">I should also mention that I’m doing this check within public.xml since I want it to apply to all incoming calls.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Thanks,</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">- Phil</FONT></SPAN></P>
<BR>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">2012-07-31 11:33:30.800571 [INFO] mod_dialplan_xml.c:485 Processing 4435551212 <4435551212>->4105551212 in context public</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Dialplan: sofia/external/4435551212@140.239.xx.x parsing [public->outside_call] continue=true</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Dialplan: sofia/external/4435551212@140.239.xx.x Absolute Condition [outside_call]</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Dialplan: sofia/external/4435551212@140.239.xx.x Regex (PASS) [outside_call] ${module_exists(mod_cidlookup)}(true) =~ /true/ break=on-false</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Dialplan: sofia/external/4435551212@140.239.xx.x Regex (PASS) [outside_call] caller_id_name(4435551212) =~ /^4435551212$|^$/ break=on-false</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Dialplan: sofia/external/4435551212@140.239.xx.x Regex (PASS) [outside_call] caller_id_number(4435551212) =~ /^1?([2-9]\d\d[2-9]\d{6})$/ break=on-false</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Dialplan: sofia/external/4435551212@140.239.xx.x Action cidlookup(4435551212)</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Dialplan: sofia/external/4435551212@140.239.xx.x parsing [public->fix_cidnam_plus] continue=true</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Dialplan: sofia/external/4435551212@140.239.xx.x Regex (FAIL) [fix_cidnam_plus] caller_id_name(4435551212) =~ /^\+1?([2-9]\d\d[2-9]\d{6})$/ break=on-false</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Dialplan: sofia/external/4435551212@140.239.xx.x parsing [public->currently_running] continue=true</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Dialplan: sofia/external/4435551212@140.239.xx.x Absolute Condition [currently_running]</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Dialplan: sofia/external/4435551212@140.239.xx.x Action info()</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Dialplan: sofia/external/4435551212@140.239.xx.x Regex (FAIL) [currently_running] caller_id_name(4435551212) =~ /^Currently running a lookup/ break=on-false</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Caller-Direction: [inbound]</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Caller-Username: [4435551212]</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Caller-Dialplan: [XML]</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Caller-Caller-ID-Name: [SMITH,JOHN]</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Caller-Caller-ID-Number: [4435551212]</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Caller-Network-Addr: [140.239.xx.x]</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Caller-ANI: [4435551212]</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Caller-Destination-Number: [4105551212]</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">_____________________________________________<BR>
</FONT></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B><FONT SIZE=2 FACE="Tahoma">From:</FONT></B></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> Phil Quesinberry<BR>
</FONT></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B><FONT SIZE=2 FACE="Tahoma">Sent:</FONT></B></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> Thursday, July 26, 2012 10:29 PM<BR>
</FONT></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B><FONT SIZE=2 FACE="Tahoma">To:</FONT></B></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> 'freeswitch-users@lists.freeswitch.org'<BR>
</FONT></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B><FONT SIZE=2 FACE="Tahoma">Subject:</FONT></B></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> RE: Setting effecting_caller_id_name</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">The reply is different each time, depending upon the number being looked up. So, I just want to look at the first part of the string. If FS can’t do a regex match without the trailing $, I’m guessing there’s a way to just do it in XML.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">I’ll try and see what I can find after the storm passes unless you have a better idea, I need to shut this computer down right now.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Thanks,</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">- Phil</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">You can just not use a regex.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">Do you need to escape the spaces?</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">Brian Foster</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">Endigo Computer LLC</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">_____________________________________________<BR>
</FONT></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B><FONT SIZE=2 FACE="Tahoma">From:</FONT></B></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> Phil Quesinberry</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B><FONT SIZE=2 FACE="Tahoma">Sent:</FONT></B></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> Thursday, July 26, 2012 5:46 PM<BR>
</FONT></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B><FONT SIZE=2 FACE="Tahoma">To:</FONT></B></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> 'freeswitch-users@lists.freeswitch.org'<BR>
</FONT></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B><FONT SIZE=2 FACE="Tahoma">Subject:</FONT></B></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> RE: Setting effecting_caller_id_name</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">If you put the $ at the end then it will try to match the entire string instead of just the beginning of it, which won’t work in this case. Is there a way to match just the beginning of the string in FS?</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">Thanks,</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#1F497D" FACE="Calibri">- Phil</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">You need a $ after 'lookup' for it to be a regex.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">Brian Foster</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Courier New">Endigo Computer LLC</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma">_____________________________________________<BR>
</FONT></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B><FONT SIZE=2 FACE="Tahoma">From:</FONT></B></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> Phil Quesinberry<BR>
</FONT></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B><FONT SIZE=2 FACE="Tahoma">Sent:</FONT></B></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> Thursday, July 26, 2012 3:59 PM<BR>
</FONT></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B><FONT SIZE=2 FACE="Tahoma">To:</FONT></B></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> 'freeswitch-users@lists.freeswitch.org'<BR>
</FONT></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B></B></SPAN><SPAN LANG="en-us"><B><FONT SIZE=2 FACE="Tahoma">Subject:</FONT></B></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Tahoma"> Setting effecting_caller_id_name</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">And while I’m asking dumb questions…</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">When doing CNAM dips from opencnam.com, often you get a result of “Currently running a lookup for phone ‘xxxxxxxxxx’… on incoming calls, typically for wireless or other unknown name callers and I wanted to change that to “Wireless/Unknown” Since caller_id_name is apparently read-only, I am attempting to set effective_caller_id_name. I put the following in public.xml right below the “fix_cidnam_plus” entry, in other words after a CNAM lookup has been performed.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri"> <extension name="fix_currently_running" continue="true"></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri"> <condition field="caller_id_name" expression="^Currently running a lookup"></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri"> <action application="set" data="effective_caller_id_name=Wireless/Unknown"/></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri"> </condition></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri"> </extension></FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">If I crafted my regex properly, then it should be matching on the first part of the string and setting the variable appropriately. Is ‘effective_caller_id_name’ the variable I should be setting?</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">Many thanks,</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><I></I></SPAN><SPAN LANG="en-us"><I></I></SPAN><SPAN LANG="en-us"><I></I></SPAN><I><SPAN LANG="en-us"><FONT FACE="Times New Roman">Phil Quesinberry</FONT></SPAN></I><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">Q Systems Engineering, Inc.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">Electronic Controls and Embedded Systems Development</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">(410) 969-8002</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><A HREF="http://www.qsystemsengineering.com"><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><U></U></SPAN><U><SPAN LANG="en-us"><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://www.qsystemsengineering.com</FONT></SPAN></U><SPAN LANG="en-us"></SPAN></A><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
</BODY>
</HTML>