<p>That is just great and a nice suggestion by peter. What other secrets does FS have for us? :-)</p>
<div class="gmail_quote">On Dec 6, 2013 9:25 PM, &quot;Peter Steinbach&quot; &lt;<a href="mailto:lists@telefaks.de">lists@telefaks.de</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Nice,<br>
      <br>
      wouldn&#39;t it make sense then to include this filter also in the
      &lt;directory&gt;.xml. Thus we are able to restrict a certain
      extension to a certain phone type.<br>
      <br>
      Best regards<br>
      Peter<br>
      <br>
      On 12/06/13 10:46, Andrew Cassidy wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">No, you literally just put a regex in
        sofia.conf.xml in the profile clients register to (internal in
        the default configuration) , for example:
        <div><br>
        </div>
        <div>&lt;param name=&quot;<span style="font-family:arial,sans-serif;font-size:13px">user-agent-filter&quot;
            value=&quot;SipDroid&quot; /&gt;</span></div>
        <div><span style="font-family:arial,sans-serif;font-size:13px"><br>
          </span></div>
        <div><span style="font-family:arial,sans-serif;font-size:13px">Brian,
            the variable isn&#39;t documented so noone was to know it
            existed!</span></div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On 6 December 2013 05:58, Mehroz Ashraf
          <span dir="ltr">&lt;<a href="mailto:mehroz.ashraf85@gmail.com" target="_blank">mehroz.ashraf85@gmail.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 dir="ltr">Brian ,It looks interesting but you should be
              confident enough altering a FS source code :) , that I
              wont bother at least. And I guess, you have to recompile
              FS each time you are making a change in that string?
              <div>
                <br>
              </div>
              <div>A code snippet :
                <div>
                  <div> <font size="1">if (user_agent_filter) {</font></div>
                  <div><font size="1">                if
                      (switch_regex_match(user_agent, user_agent_filter)
                      == SWITCH_STATUS_SUCCESS) {</font></div>
                  <div><font size="1">                        if
                      (sofia_test_pflag(profile, PFLAG_LOG_AUTH_FAIL)) {</font></div>
                  <div><font size="1">                               
                      switch_log_printf(SWITCH_CHANNEL_LOG,
                      SWITCH_LOG_DEBUG,</font></div>
                  <div><font size="1">                                 
                                                      &quot;SIP auth OK
                      (REGISTER) due to user-agent-filter.  Filter
                      \&quot;%s\&quot; User-Agent \&quot;%s\&quot;\n&quot;, user_agent_filter,
                      user_agent);</font></div>
                  <div><font size="1">                        }</font></div>
                  <div><font size="1">                } else {</font></div>
                  <div><font size="1">                        ret =
                      AUTH_FORBIDDEN;</font></div>
                  <div><font size="1">                        if
                      (sofia_test_pflag(profile, PFLAG_LOG_AUTH_FAIL)) {</font></div>
                  <div><font size="1">                               
                      switch_log_printf(SWITCH_CHANNEL_LOG,
                      SWITCH_LOG_WARNING,</font></div>
                  <div><font size="1">                                 
                                                      &quot;SIP auth failure
                      (REGISTER) due to user-agent-filter.  Filter
                      \&quot;%s\&quot; User-Agent \&quot;%s\&quot;\n&quot;, user_agent_filter,</font></div>
                  <div><font size="1">                                 
                                                      user_agent);</font></div>
                  <div><font size="1">                        }</font></div>
                  <div><font size="1">                        goto end;</font></div>
                  <div><font size="1">                }</font></div>
                  <div><font size="1">        }</font></div>
                </div>
                <div><font size="1"><br>
                  </font></div>
                <div> can block a specific User-agent comparing that
                  value in the first nested IF condition.</div>
                <div>But my vote goes to xml_curl method !</div>
                <div><br>
                </div>
                <div><br>
                </div>
              </div>
            </div>
            <div class="gmail_extra"><br>
              <br>
              <div class="gmail_quote">
                <div>
                  <div>On Fri, Dec 6, 2013 at 1:41 AM, Brian
                    West <span dir="ltr">&lt;<a href="mailto:brian@freeswitch.org" target="_blank">brian@freeswitch.org</a>&gt;</span>
                    wrote:<br>
                  </div>
                </div>
                <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  <div>
                    <div>You guys try way too hard.<br>
                      <br>
                      sofia_reg.c:                    if
                      (!strcasecmp(var, &quot;user-agent-filter&quot;)) {<br>
                      <br>
                      This is a sofia profile param that you can put a
                      regex in and filter it out.  ;)<br>
                      <br>
                      --<br>
                      Brian West<br>
                      <a href="mailto:brian@freeswitch.org" target="_blank">brian@freeswitch.org</a><br>
                      FreeSWITCH Solutions, LLC<br>
                      PO BOX 2531<br>
                      Brookfield, WI 53008-2531<br>
                      Twitter: @FreeSWITCH_Wire , @briankwest<br>
                      <a href="http://www.freeswitchbook.com" target="_blank">http://www.freeswitchbook.com</a><br>
                      <a href="http://www.freeswitchcookbook.com" target="_blank">http://www.freeswitchcookbook.com</a><br>
                      <br>
                      T: <a href="tel:%2B1.918.420.9001" value="+19184209001" target="_blank">+1.918.420.9001</a>
                       |  F: <a href="tel:%2B1.918.420.9002" value="+19184209002" target="_blank">+1.918.420.9002</a>
                       |  M: +1.918.424.WEST<br>
                      iNUM: <a href="tel:%2B883%205100%201420%209001" value="+883510014209001" target="_blank">+883
                        5100 1420 9001</a><br>
                      ISN: 410*543<br>
                      Skype:briankwest<br>
                      PGP Key: <a href="http://www.bkw.org/key.txt" target="_blank">http://www.bkw.org/key.txt</a>
                      (AB93356707C76CED)<br>
                      <div>
                        <div><br>
                          <br>
                          <br>
                          <br>
                          <br>
                          <br>
                          <br>
                          <br>
                          <br>
                          <br>
                          <br>
                          <br>
                          On Dec 5, 2013, at 11:59 AM, Peter Steinbach
                          &lt;<a href="mailto:lists@telefaks.de" target="_blank">lists@telefaks.de</a>&gt;
                          wrote:<br>
                          <br>
                          &gt; xml_curl looks a server URL with the
                          registration params.<br>
                          &gt;<br>
                          &gt; So you will need to set up a web server
                          (e.g. with apache/php, Ruby, Perl, Python or
                          anything else), manage these parameters and
                          return an XML to Freeswitch based on the
                          parameters.<br>
                          &gt; Some programming skills will be needed
                          for that.<br>
                          &gt;<br>
                          &gt; Best regards<br>
                          &gt; Peter<br>
                          <br>
                        </div>
                      </div>
                      <br>
                    </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>
                    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>
                    <br>
                  </div>
                </blockquote>
              </div>
              <br>
            </div>
            <br>
_________________________________________________________________________<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>
            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>
            <br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <b>Andrew Cassidy BSc (Hons) MBCS SSCA</b>
        <div>Managing Director
          <div>
            <div><img src="http://c1170247.r47.cf3.rackcdn.com/emailsig.png"><br>
            </div>
            <div><br>
              <div>
                <b style="color:rgb(51,135,171);text-decoration:none;font-family:sans-serif"><a href="mailto:info@cassidywebservices.co.uk" style="color:rgb(51,135,171);text-decoration:none;font-family:sans-serif" target="_blank">T</a> </b>03300 100 960 
                <b style="color:rgb(51,135,171);text-decoration:none;font-family:sans-serif"><a href="mailto:info@cassidywebservices.co.uk" style="color:rgb(51,135,171);text-decoration:none;font-family:sans-serif" target="_blank">F</a> </b>03300 100 961</div>

              <div><b style="text-decoration:none;font-family:sans-serif"><a href="mailto:info@cassidywebservices.co.uk" style="color:rgb(51,135,171);text-decoration:none;font-family:sans-serif" target="_blank">E</a> </b><a href="mailto:andrew@cassidywebservices.co.uk" target="_blank">andrew@cassidywebservices.co.uk</a></div>

              <div><b style="text-decoration:none;font-family:sans-serif"><a href="mailto:info@cassidywebservices.co.uk" style="color:rgb(51,135,171);text-decoration:none;font-family:sans-serif" target="_blank">W</a> </b><a href="http://www.cassidywebservices.co.uk" target="_blank">www.cassidywebservices.co.uk</a></div>

            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a>

Official FreeSWITCH Sites
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>

FreeSWITCH-users mailing list
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre cols="72">-- 
With kind regards
Peter Steinbach 

Telefaks Services GmbH
<a href="mailto:lists" target="_blank">mailto:lists</a> (att) <a href="http://telefaks.de" target="_blank">telefaks.de</a>
Internet: <a href="http://www.telefaks.de" target="_blank">www.telefaks.de</a>

</pre>
  </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>
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>