Thank you.<div>I will try this route !</div><div><br></div><div>Best regards</div><div>Torstein</div><div><br><div class="gmail_quote">On 11 July 2012 21:48, Spencer Thomason <span dir="ltr">&lt;<a href="mailto:spencer@5ninesolutions.com" target="_blank">spencer@5ninesolutions.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Torstein,<div>I ran into a similar problem with a US provider.</div><div><br></div>
<div>I used a python script that wraps the api command and then parses the json response and sets effective_caller_id_name.</div><div><br></div><div>in python e.g.</div><div><br></div><div>import json</div><div>from freeswitch import API</div>
<div><br></div><div><br></div><div>def cidlookup(number):<br><br>    api = API()<br>    number = str(number)<br>    cmd = &#39;cidlookup %s&#39; % (number)<br>    return api.executeString(cmd).strip()</div><div><br></div>
<div>def handler(session, args):</div><div><br></div><div>    caller_num = session.getVariable(&quot;caller_id_number&quot;)</div><div>    cnam_data = json.loads(cidlookup(caller_num))</div><div># get caller name from cnam_data here..</div>
<div><br></div><div><br></div><div><br></div><div>    session.setVariable(&quot;effective_caller_id_name&quot;, caller_name)</div><div>    return</div><div><br></div><div><br></div><div>(You could also do the api lookup in you script and bypass mod_cidlookup)</div>
<div><br></div><div><br></div><div>I hope that helps,</div><div>Spencer</div><div><br></div><div><br></div><div> <br><div><div><div class="h5"><div>On Jul 11, 2012, at 11:38 AM, Torstein Knutsen wrote:</div><br></div></div>
<blockquote type="cite"><div><div class="h5">Hi<div><br></div><div>I have cidlookup partly working.</div><div>Im using a norwegian service, which returns a whole lot more than just the number.</div><div><br></div><div>Anybody here have some Ideas on how I could proceed to map &quot;Pizza &amp; Kina Expressen&quot; to the calling_id_name ?</div>

<div><br></div><div>Thank you!</div><div>Torstein</div><div><br></div><div>snipplet ***</div><div>:</div><div><br></div><div> freeswitch@--hidden-ip--@internal&gt; cidlookup <a href="tel:22222222" value="+4722222222" target="_blank">22222222</a></div>
<div><br></div><div><br></div><div>
<br></div><div><br></div><div>{ &quot;title&quot; : &quot;Gule Sider firma API&quot;, &quot;query&quot; : &quot;<a href="http://api.eniro.com/cs/search/basic?country=no&amp;search_word=22222222&amp;to_list=1&amp;version=1.1.3&amp;from_list=1" target="_blank">http://api.eniro.com/cs/search/basic?country=no&amp;search_word=22222222&amp;to_list=1&amp;version=1.1.3&amp;from_list=1</a>&quot;, &quot;totalHits&quot; : 1 , &quot;totalCount&quot; : 1 , &quot;startIndex&quot; : 1, &quot;itemsPerPage&quot; : 1, &quot;adverts&quot; : [ { &quot;eniroId&quot; : &quot;P10000836357&quot; , &quot;companyInfo&quot; : { &quot;companyName&quot; : &quot;Pizza &amp; Kina Expressen&quot; , &quot;orgNumber&quot; : null , &quot;companyText&quot; : null }, &quot;address&quot; : { &quot;streetName&quot; : &quot;Vitaminveien 11 B&quot; , &quot;postCode&quot; : &quot;0485&quot; , &quot;postArea&quot; : &quot;Oslo&quot; , &quot;postBox&quot; : null }, &quot;location&quot; : { &quot;coordinates&quot; : [ { &quot;longitude&quot; : 10.7725744944096 , &quot;latitude&quot; : 59.9471107465998 }, { &quot;use&quot; : &quot;route&quot;, &quot;longitude&quot; : 10.7725744944096 , &quot;latitude&quot; : 59.9471107465998 } ] }, &quot;phoneNumbers&quot; : [ { &quot;type&quot; : &quot;std&quot; , &quot;phoneNumber&quot; : &quot;22 22 22 22&quot; , &quot;label&quot; : null } ], &quot;companyReviews&quot; : &quot;<a href="http://www.anbefalt.no/omtale/0003292695/22222222" target="_blank">http://www.anbefalt.no/omtale/0003292695/22222222</a>&quot; , &quot;homepage&quot; : &quot;<a href="http://api.eniro.com/proxy/homepage/uANwPf5aVK3QsMrfdwYjz8Olp1PSJ6L1-mCsL3_LC0d9Yem9mkC025y22P034JmT" target="_blank">http://api.eniro.com/proxy/homepage/uANwPf5aVK3QsMrfdwYjz8Olp1PSJ6L1-mCsL3_LC0d9Yem9mkC025y22P034JmT</a>&quot; , &quot;infoPageLink&quot; : &quot;<a href="http://www.gulesider.no/firma/pizza-kina-expressen:p10000836357?search_word=22222222" target="_blank">http://www.gulesider.no/firma/pizza-kina-expressen:p10000836357?search_word=22222222</a>&quot; } ] }</div>

<div>freeswitch@--hidden-ip--@internal&gt;</div></div></div>
_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services:<br><a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br><a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br><a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br><br>Official FreeSWITCH Sites<br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br><a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br><br>Join Us At ClueCon - Aug 7-9, 2012<br><br>FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><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" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
Join Us At ClueCon - Aug 7-9, 2012<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" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>