<div dir="ltr">To add to that fun, some states have multiple timezones! <div><br></div><div>I completely agree with Anthony regarding his first point, I myself have a cell phone with a phone number thats about 15 years old and I don't live anywhere near it. If you go this route, consider this as a helper, rather than an absolute and confirm with the user at some point.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 23, 2017 at 10:05 PM, Anthony Holloway <span dir="ltr"><<a href="mailto:avholloway+cisco-voip@gmail.com" target="_blank">avholloway+cisco-voip@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have never done this before.<div><br></div><div>Seems to me like there are two major hurdles here:</div><div><br></div><div>1) How do you know that the caller is actually in that timezone at the time of the call?  For instance, I could be visiting a relative in another state/timezone, but using my cell to call in, OR I could be using their home phone, but trying to schedule service in my home timezone.  Furthermore, business SIP Trunks are national DID serviced, and I could call "from anywhere in the country" from my office SIP trunk.</div><div><br></div><div>2) How will you keep the data current?  The best option is to let someone else keep the data current and subscribe to their web api service.  However, from a quick glance, no one is mapping area code to timezone, rather it seems to be lat/long to timezone.  So, you need to pull twice: 1) area code to lat/long (if that even exists), 2) lat/long to timezone.  But then what will you do when that service is discontinued?</div><div><br></div><div>I guess, if nothing else, you could roughly divide up the country's timezones by state borders, and for those border areas, they get to suffer +/- 1 hour to ease your administration.</div><div><br></div><div>E.g., </div><div><br></div><div>Scrap the small south west corner of North Dakota that's in Mountain Time and just make the entire ND state in Central Time.</div><div><br></div><div>The only states you'd "really" be messing with are:</div><div><br></div><div>OR, ID, ND, SD, NE, KY, TN, FL</div><div><br></div><div>All the rest are practically, or exactly, in one single timezone.</div><div><br></div><div>Just make a decision on a heat map of population density, or timezone coverage to see which way you go in those borderline states.</div><div><br></div><div>And now you can create mapping for state to timezone approximations with just four simple String variables, and four simple If steps like this:</div><div><br></div><div><font face="monospace"><b>String eastern_states = "NY,NJ,MD,etc.";</b></font></div><div><font face="monospace"><b>String central_states = "ND,SD,NE,etc..";</b></font></div><div><font face="monospace"><b>String mountain_states = "MT,AZ,ID,etc.";</b></font></div><div><font face="monospace"><b>String pacific_states = "WA,CA,NV,etc.";</b></font></div><div><font face="monospace"><b><br></b></font></div><div><div><font face="monospace"><b>if (eastern_states.contains(<wbr>calling_state)) {</b></font></div><div><font face="monospace"><b>  /* Eastern TimeZone State */</b></font></div><div><font face="monospace"><b>}</b></font></div></div><div><font face="monospace"><b>if (central_states.contains(<wbr>calling_state)) {</b></font></div><div><font face="monospace"><b>  /* Central TimeZone State */</b></font></div><div><font face="monospace"><b>}</b></font></div><div><div><font face="monospace"><b>if (mountain_states.contains(<wbr>calling_state)) {</b></font></div><div><font face="monospace"><b>  /* Mountain TimeZone State */</b></font></div><div><font face="monospace"><b>}</b></font></div></div><div><div><font face="monospace"><b>if (pacific_states.contains(<wbr>calling_state)) {</b></font></div><div><font face="monospace"><b>  /* Pacific TimeZone State */</b></font></div><div><font face="monospace"><b>}</b></font></div><div><br class="m_6982846713117738442inbox-inbox-Apple-interchange-newline"></div></div><div><div>But you'll still have to convert area code to state first , so, pull up the list of area codes by state on wikipedia:<br></div></div><div><br></div><div><a href="https://en.wikipedia.org/wiki/List_of_North_American_Numbering_Plan_area_codes#United_States" target="_blank">https://en.wikipedia.org/wiki/<wbr>List_of_North_American_<wbr>Numbering_Plan_area_codes#<wbr>United_States</a><br></div><div><br></div><div>And get to creating your area code to state mapping.  This one is a little bigger data set, so maybe not a String variable setup like above, but rather a nice little XML file?  TIP: Notepad++ Regex Find/Replace, or if you're feeling really progressive, periodic Python web scraping, which generates the XML for you.</div><div><br></div><div><div><font face="monospace"><b><?xml version="1.0" encoding="UTF-8"?></b></font></div><div><font face="monospace"><b><area_codes></b></font></div><div><font face="monospace"><b><span class="m_6982846713117738442Apple-tab-span" style="white-space:pre-wrap">       </span><area_code id="612">MN</area_code></b></font></div><div><font face="monospace"><b><span style="font-size:10.5625px"><span class="m_6982846713117738442inbox-inbox-Apple-tab-span" style="white-space:pre-wrap">      </span></span>...etc... </b></font><br></div><div><font face="monospace"><b></area_codes></b></font></div></div><div><font face="monospace"><b><br></b></font></div><div><font face="monospace"><b>calling_state = Get XML Document Data ("//area_code[@id="' + area_code + '"]")</b></font><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div><div class="h5"><div dir="ltr">On Mon, Jan 23, 2017 at 3:12 PM Matthew Loraditch <<a href="mailto:MLoraditch@heliontechnologies.com" target="_blank">MLoraditch@<wbr>heliontechnologies.com</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">





<div lang="EN-US" link="#0563C1" vlink="#954F72" class="m_6982846713117738442gmail_msg">
<div class="m_6982846713117738442m_7182456678746004595WordSection1 m_6982846713117738442gmail_msg">
<p class="MsoNormal m_6982846713117738442gmail_msg">Anyone ever written one of to get Time zone from Caller ID area code? I know how it would work, but hoping maybe there is a template (especially for the database side somewhere)<u class="m_6982846713117738442gmail_msg"></u><u class="m_6982846713117738442gmail_msg"></u></p>
<p class="MsoNormal m_6982846713117738442gmail_msg"><u class="m_6982846713117738442gmail_msg"></u> <u class="m_6982846713117738442gmail_msg"></u></p>
<p class="MsoNormal m_6982846713117738442gmail_msg"><span style="font-size:10.0pt;color:#1f497d" class="m_6982846713117738442gmail_msg">Matthew G. Loraditch – CCNP-Voice, CCNA-R&S, CCDA<br class="m_6982846713117738442gmail_msg">
Network Engineer<br class="m_6982846713117738442gmail_msg">
Direct Voice: <a href="tel:(443)%20541-1518" value="+14435411518" class="m_6982846713117738442gmail_msg" target="_blank">443.541.1518</a></span><span style="color:#1f497d" class="m_6982846713117738442gmail_msg"><br class="m_6982846713117738442gmail_msg">
<img width="170" height="99" style="width:1.7708in;height:1.0312in" id="m_6982846713117738442m_7182456678746004595Picture_x0020_1" alt="Email_Sig_Template_H_shortcopy_UPDATED" class="m_6982846713117738442gmail_msg"><u class="m_6982846713117738442gmail_msg"></u><u class="m_6982846713117738442gmail_msg"></u></span></p>
<p class="MsoNormal m_6982846713117738442gmail_msg"><a href="https://www.facebook.com/heliontech?ref=hl" class="m_6982846713117738442gmail_msg" target="_blank"><span style="font-size:8.0pt;color:blue" class="m_6982846713117738442gmail_msg">Facebook</span></a><span style="font-size:8.0pt;color:#1f497d" class="m_6982846713117738442gmail_msg"> |
</span><a href="https://twitter.com/HelionTech" class="m_6982846713117738442gmail_msg" target="_blank"><span style="font-size:8.0pt;color:blue" class="m_6982846713117738442gmail_msg">Twitter</span></a><span style="font-size:8.0pt;color:#1f497d" class="m_6982846713117738442gmail_msg"> |
</span><a href="https://www.linkedin.com/company/helion-technologies?trk=top_nav_home" class="m_6982846713117738442gmail_msg" target="_blank"><span style="font-size:8.0pt;color:blue" class="m_6982846713117738442gmail_msg">LinkedIn</span></a><span style="font-size:8.0pt;color:#1f497d" class="m_6982846713117738442gmail_msg"> |
</span><a href="https://plus.google.com/+Heliontechnologies/posts" class="m_6982846713117738442gmail_msg" target="_blank"><span style="font-size:8.0pt;color:blue" class="m_6982846713117738442gmail_msg">G+</span></a><span style="color:#1f497d" class="m_6982846713117738442gmail_msg"><u class="m_6982846713117738442gmail_msg"></u><u class="m_6982846713117738442gmail_msg"></u></span></p>
<p class="MsoNormal m_6982846713117738442gmail_msg"><u class="m_6982846713117738442gmail_msg"></u> <u class="m_6982846713117738442gmail_msg"></u></p>
</div>
</div></div></div>

______________________________<wbr>_________________<br class="m_6982846713117738442gmail_msg">
cisco-voip mailing list<br class="m_6982846713117738442gmail_msg">
<a href="mailto:cisco-voip@puck.nether.net" class="m_6982846713117738442gmail_msg" target="_blank">cisco-voip@puck.nether.net</a><br class="m_6982846713117738442gmail_msg">
<a href="https://puck.nether.net/mailman/listinfo/cisco-voip" rel="noreferrer" class="m_6982846713117738442gmail_msg" target="_blank">https://puck.nether.net/<wbr>mailman/listinfo/cisco-voip</a><br class="m_6982846713117738442gmail_msg">
</blockquote></div>
<br>______________________________<wbr>_________________<br>
cisco-voip mailing list<br>
<a href="mailto:cisco-voip@puck.nether.net">cisco-voip@puck.nether.net</a><br>
<a href="https://puck.nether.net/mailman/listinfo/cisco-voip" rel="noreferrer" target="_blank">https://puck.nether.net/<wbr>mailman/listinfo/cisco-voip</a><br>
<br></blockquote></div><br></div>