<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div>I now have the following lines added in&nbsp;</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">lua.conf ---</div><div><span style="background-color: transparent;">&lt;param name="xml-handler-script" value="$${base_dir}/scripts/dir.lua"/&gt;</span><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">&lt;param name="xml-handler-bindings" value="directory" /&gt;</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial,
 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">dir.lua ---</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span style="background-color: transparent;">freeswitch.consoleLog("info", params:serialize("xml") .. "\n")</span><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span style="background-color: transparent;">// Do some api check here to decide allow REGISTER or not</span></div><div style="color: rgb(0, 0, 0);
 font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span style="background-color: transparent;">session:hangup();</span><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">I am able to see the custom header with the consoleLog on params<br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">but if I try to stop this incoming REGISTER request using
 the hangup() call<br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">I get FS complaining about "attempt to index global 'session' (a nil value)"</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">How can I go about locating this incoming REGISTER that's not a session yet?</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent;
 font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">thanks again for the help,</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">Mark&nbsp;</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><br></div><div class="yahoo_quoted" style="display: block;"> <br> <br> <div style="font-family:
 HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> On Thursday, November 14, 2013 3:20 PM, Mark Tsai &lt;twkid@yahoo.com&gt; wrote:<br> </font> </div>  <div class="y_msg_container"><div id="yiv5888190119"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"><div><span>Thanks for the quick reply.&nbsp;</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue,
 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span>I've tried using mod_xml_curl with directory binding. My observation is that the xml fetch only happens once - when FS starts up. Is this configurable?</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span>I would need this curl fetch to happen for each REGISTER request that comes in.&nbsp;</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color:
 transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span>thanks again for the help,</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span>Miz&nbsp;</span></div><div class="yiv5888190119yahoo_quoted" style="display: block;"> <br> <br> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> On Thursday, November 14, 2013 5:01 AM, Michael Jerris &lt;mike@jerris.com&gt;
 wrote:<br> </font> </div>  <div class="yiv5888190119y_msg_container"><div id="yiv5888190119"><div>use xml_curl to handle the directory request, and if its not already in there, make sure the x headers get in to the directory lookup params.<div><br clear="none"><div><div class="yiv5888190119yqt7777934297" id="yiv5888190119yqtfd76413"><div>On Nov 12, 2013, at 6:32 PM, Mark Tsai &lt;<a rel="nofollow" shape="rect" ymailto="mailto:twkid@yahoo.com" target="_blank" href="mailto:twkid@yahoo.com">twkid@yahoo.com</a>&gt; wrote:</div><br clear="none" class="yiv5888190119Apple-interchange-newline"></div><blockquote type="cite"><div class="yiv5888190119yqt7777934297" id="yiv5888190119yqtfd75160"><div><div style="background-color: rgb(255, 255, 255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"><div>Hi All,</div><div><br clear="none"></div><div style="font-size: 16px; font-family: HelveticaNeue,
 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">In my REGISTER packets that's sent towards a FreeSwitch server, I am adding a custom header "X-CustomHeaderName: auth_token". The goal for my project is to access that token and conduct a verification through another API before allowing the REGISTER to pass.&nbsp;</div><div style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><br clear="none"></div><div style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">What's the best way to accomplish this?</div><div style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style:
 normal;">thanks,</div><div style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">Miz</div></div></div></div>_________________________________________________________________________<br clear="none">Professional FreeSWITCH Consulting Services:<br clear="none"><a rel="nofollow" shape="rect" ymailto="mailto:consulting@freeswitch.org" target="_blank" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br clear="none">http://www.freeswitchsolutions.com<br clear="none"><br clear="none">FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br clear="none">http://www.cudatel.com<br clear="none"><br clear="none">Official FreeSWITCH Sites<br clear="none">http://www.freeswitch.org<br clear="none">http://wiki.freeswitch.org<br clear="none">http://www.cluecon.com<br clear="none"><br clear="none">FreeSWITCH-dev mailing list<br
 clear="none">FreeSWITCH-dev@lists.freeswitch.org<br clear="none">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev<br clear="none">UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev<br clear="none">http://www.freeswitch.org<div class="yiv5888190119yqt7777934297" id="yiv5888190119yqtfd69669"><br clear="none"></div></blockquote></div><div class="yiv5888190119yqt7777934297" id="yiv5888190119yqtfd62608"><br clear="none"></div></div></div></div><br>_________________________________________________________________________<br clear="none">Professional FreeSWITCH Consulting Services:<br clear="none"><a rel="nofollow" shape="rect" ymailto="mailto:consulting@freeswitch.org" target="_blank" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://www.freeswitchsolutions.com/">http://www.freeswitchsolutions.com</a><br clear="none"><br
 clear="none">FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://www.cudatel.com/">http://www.cudatel.com</a><br clear="none"><br clear="none">Official FreeSWITCH Sites<br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://www.freeswitch.org/">http://www.freeswitch.org</a><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://wiki.freeswitch.org/">http://wiki.freeswitch.org</a><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://www.cluecon.com/">http://www.cluecon.com</a><br clear="none"><br clear="none">FreeSWITCH-dev mailing list<br clear="none"><a rel="nofollow" shape="rect" ymailto="mailto:FreeSWITCH-dev@lists.freeswitch.org" target="_blank" href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br clear="none"><a rel="nofollow" shape="rect" target="_blank"
 href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br clear="none">UNSUBSCRIBE:<a rel="nofollow" shape="rect" target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-dev">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://www.freeswitch.org/">http://www.freeswitch.org</a><div class="yiv5888190119yqt7777934297" id="yiv5888190119yqtfd31177"><br clear="none"></div><br><br></div>  </div> </div>  </div> </div></div></div><br><br></div>  </div> </div>  </div> </div></body></html>