<p dir="ltr"> <condition field="effective_caller_id_name" expression="TM" ></p>
<p dir="ltr">You need to use ${effective_caller_id_name} here.</p>
<p dir="ltr">But I would do the whole logic in mod_lua or mod_perl, as it's much easier to program there.</p>
<div class="gmail_quote">On Jul 23, 2015 11:45 PM, "David S. Dee" <<a href="mailto:dsdee@dsba.net">dsdee@dsba.net</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div><div>Hello;<br></div>
<div> </div>
<div>I've been a freeswitch user for some time, but I am finally getting around to trying to get idea working again.<br></div>
<div> </div>
<div>I have an in-house CID lookup routine that works fine... it sets caller_id_name and effective_caller_id_name and those modified names show up fine on my telephones when the calls come in.<br></div>
<div> </div>
<div>That lookup routine adds a prefix of TM: if its a telemarketer, or VM: if i want the caller to go directly to voicemail... Basically, if the original CID from my provider shows up as "FOO Marketing", then after the cid-extension runs, the caller_id_name and effective_caller_name to "TM:FOO Marketing"....<br></div>
<div> </div>
<div>What is -not- working is the routing.<br></div>
<div> </div>
<div>I have an extension right after the CID Lookup that I want to do the routing directly to voicemail. Watching the debug logs, it appears that the field is already parsed and is set to the *original* callerid name that was available when the call came in... Trying different variations of field="caller_id_name" and field="${caller_id_name}" (and same with effective_caller_id_name) still yields no joy.<br></div>
<div> </div>
<div>Any guidance? The snippets from my dialplan are below.<br></div>
<div> </div>
<div>Thanks!<br></div>
<div> </div>
<div> </div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <extension name="CID Inbound Lookup" continue="true"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <condition field="ani" expression="(\d{10})"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="log" data="INFO In CID Inbound Lookup '$1' -- The Second Time"/><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="log" data="INFO CIDLookup(before): CID Num: '${caller_id_number}' CID Name: '${caller_id_name}' Orig CID Name: '${original_caller_id_name}' Dest: '${destination_number}'"/><br></span></div>
<div> </div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="set" data="url=num=${caller_id_number}&name=${url_encode(${caller_id_name})}&did=${destination_number}"/><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="log" data="INFO CIDLookup(before): url: '${url}'"/><br></span></div>
<div> </div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="curl" data="</span><a href="http://www.dsba.net/voip/cidlookup.php?$%7Burl%7D%22/" target="_blank"><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif">http://MYDOMAIN.com/MYCIDLOOKUP.php?${url}"/</span></a><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif">><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="info"/><br></span></div>
<div> </div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="log" data="INFO CIDLookup(after ): curl_response_code: ${curl_response_code}"/><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="log" data="INFO CIDLookup(after ): curl_response_data: ${curl_response_data}"/><br></span></div>
<div> </div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="set" data="caller_id_name=${curl_response_data}"/><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="set" data="effective_caller_id_name=${curl_response_data}"/><br></span></div>
<div> </div>
<div> </div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="log" data="INFO CIDLookup(after ): CID Num: '${caller_id_number}' CID Name: '${caller_id_name}' Orig CID Name: '${original_caller_id_name}' Dest: '${destination_number}'"/><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="log" data="INFO CIDLookup(after ): caller_id_name: '${caller_id_name}', original_caller_id_name: '${original_caller_id_name}', effective_caller_id_name: '${effective_caller_id_name}'" /><br></span></div>
<div> </div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <!-- This event will be picked up by HB-Bot for announcing --><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="event" data="Event-Name=CUSTOM,Event-Subclass=CallAnnounce,ani=${destination_number},cidnum=${caller_id_number},cidname=${caller_id_name}"/><br></span></div>
<div> </div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> </condition><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> </extension><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif">and here are my test cases that are *right* after the above... but yet can't pick up the change in variables. *ONE* of these (I expect '3b' or '1') should fire... none do.<br></span></div>
<div> </div>
<div> </div>
<div> </div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <extension name="cid_test_0" continue="true"></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <condition field="original_caller_id_name" expression="TM" ></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="log" data="INFO cid_test_0: : '${original_caller_id_name}'"/></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> </condition></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> </extension></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div> </div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <extension name="cid_test_1" continue="true"></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <condition field="caller_id_name" expression="TM" ></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="log" data="INFO cid_test_1: : '${caller_id_name}'"/></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> </condition></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> </extension></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div> </div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <extension name="cid_test_2" continue="true"></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <condition field="effective_caller_id_name" expression="TM" ></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="log" data="INFO cid_test_2: : '${effective_caller_id_name}'"/></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> </condition></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> </extension></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div> </div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <extension name="cid_test_3" continue="true"></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <condition field='${caller_id_name}' expression="TM" ></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="log" data="INFO cid_test_3: : '${caller_id_name}'"/></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> </condition></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> </extension></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div> </div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <extension name="cid_test_3b" continue="true"></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <condition field="${caller_id_name}" expression="TM" ></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="log" data="INFO cid_test_3b: : '${caller_id_name}'"/></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> </condition></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> </extension></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div> </div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <extension name="cid_test_4" continue="true"></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <condition field='${effective_caller_id_name}' expression="TM" ></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="log" data="INFO cid_test_4: : '${effective_caller_id_name}'"/></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> </condition></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> </extension></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div> </div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <extension name="cid_test_5" continue="true"></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <condition field='${effective_caller_id_name}' expression="TM" ></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> <action application="log" data="INFO cid_test_5: : '${effective_caller_id_name}'"/></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> </condition></span><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"><br></span></div>
<div><span style="font-family:menlo,consolas,"courier new",monospace,sans-serif"> </extension></span><br></div>
</div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div>