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"><<a href="mailto:spencer@5ninesolutions.com" target="_blank">spencer@5ninesolutions.com</a>></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 = 'cidlookup %s' % (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("caller_id_number")</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("effective_caller_id_name", 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 "Pizza & Kina Expressen" 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> 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>{ "title" : "Gule Sider firma API", "query" : "<a href="http://api.eniro.com/cs/search/basic?country=no&search_word=22222222&to_list=1&version=1.1.3&from_list=1" target="_blank">http://api.eniro.com/cs/search/basic?country=no&search_word=22222222&to_list=1&version=1.1.3&from_list=1</a>", "totalHits" : 1 , "totalCount" : 1 , "startIndex" : 1, "itemsPerPage" : 1, "adverts" : [ { "eniroId" : "P10000836357" , "companyInfo" : { "companyName" : "Pizza & Kina Expressen" , "orgNumber" : null , "companyText" : null }, "address" : { "streetName" : "Vitaminveien 11 B" , "postCode" : "0485" , "postArea" : "Oslo" , "postBox" : null }, "location" : { "coordinates" : [ { "longitude" : 10.7725744944096 , "latitude" : 59.9471107465998 }, { "use" : "route", "longitude" : 10.7725744944096 , "latitude" : 59.9471107465998 } ] }, "phoneNumbers" : [ { "type" : "std" , "phoneNumber" : "22 22 22 22" , "label" : null } ], "companyReviews" : "<a href="http://www.anbefalt.no/omtale/0003292695/22222222" target="_blank">http://www.anbefalt.no/omtale/0003292695/22222222</a>" , "homepage" : "<a href="http://api.eniro.com/proxy/homepage/uANwPf5aVK3QsMrfdwYjz8Olp1PSJ6L1-mCsL3_LC0d9Yem9mkC025y22P034JmT" target="_blank">http://api.eniro.com/proxy/homepage/uANwPf5aVK3QsMrfdwYjz8Olp1PSJ6L1-mCsL3_LC0d9Yem9mkC025y22P034JmT</a>" , "infoPageLink" : "<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>" } ] }</div>
<div>freeswitch@--hidden-ip--@internal></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>