<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Nice,<br>
<br>
wouldn't it make sense then to include this filter also in the
<directory>.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
cite="mid:CAMbW9o+EndMST1DOQwPcn6yCvT1BDmejGo2BHcRP6jjMGFeySg@mail.gmail.com"
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><param name="<span
style="font-family:arial,sans-serif;font-size:13px">user-agent-filter"
value="SipDroid" /></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'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"><<a moz-do-not-send="true"
href="mailto:mehroz.ashraf85@gmail.com" target="_blank">mehroz.ashraf85@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">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">
"SIP auth OK
(REGISTER) due to user-agent-filter. Filter
\"%s\" User-Agent \"%s\"\n", 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">
"SIP auth failure
(REGISTER) due to user-agent-filter. Filter
\"%s\" User-Agent \"%s\"\n", 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 class="h5">On Fri, Dec 6, 2013 at 1:41 AM, Brian
West <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:brian@freeswitch.org"
target="_blank">brian@freeswitch.org</a>></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 class="h5">You guys try way too hard.<br>
<br>
sofia_reg.c: if
(!strcasecmp(var, "user-agent-filter")) {<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 moz-do-not-send="true"
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 moz-do-not-send="true"
href="http://www.freeswitchbook.com"
target="_blank">http://www.freeswitchbook.com</a><br>
<a moz-do-not-send="true"
href="http://www.freeswitchcookbook.com"
target="_blank">http://www.freeswitchcookbook.com</a><br>
<br>
T: <a moz-do-not-send="true"
href="tel:%2B1.918.420.9001"
value="+19184209001" target="_blank">+1.918.420.9001</a>
| F: <a moz-do-not-send="true"
href="tel:%2B1.918.420.9002"
value="+19184209002" target="_blank">+1.918.420.9002</a>
| M: +1.918.424.WEST<br>
iNUM: <a moz-do-not-send="true"
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 moz-do-not-send="true"
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
<<a moz-do-not-send="true"
href="mailto:lists@telefaks.de"
target="_blank">lists@telefaks.de</a>>
wrote:<br>
<br>
> xml_curl looks a server URL with the
registration params.<br>
><br>
> 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>
> Some programming skills will be needed
for that.<br>
><br>
> Best regards<br>
> Peter<br>
<br>
</div>
</div>
<br>
</div>
</div>
<div class="im">_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a moz-do-not-send="true"
href="mailto:consulting@freeswitch.org"
target="_blank">consulting@freeswitch.org</a><br>
<a moz-do-not-send="true"
href="http://www.freeswitchsolutions.com"
target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication
Server<br>
<a moz-do-not-send="true"
href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a moz-do-not-send="true"
href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a moz-do-not-send="true"
href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a moz-do-not-send="true"
href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a moz-do-not-send="true"
href="mailto:FreeSWITCH-users@lists.freeswitch.org"
target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a moz-do-not-send="true"
href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a moz-do-not-send="true"
href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a moz-do-not-send="true"
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 moz-do-not-send="true"
href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a moz-do-not-send="true"
href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a moz-do-not-send="true" href="http://www.cudatel.com"
target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a moz-do-not-send="true" href="http://www.freeswitch.org"
target="_blank">http://www.freeswitch.org</a><br>
<a moz-do-not-send="true" href="http://wiki.freeswitch.org"
target="_blank">http://wiki.freeswitch.org</a><br>
<a moz-do-not-send="true" href="http://www.cluecon.com"
target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a moz-do-not-send="true"
href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a moz-do-not-send="true"
href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a moz-do-not-send="true"
href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a moz-do-not-send="true" 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 moz-do-not-send="true"
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
moz-do-not-send="true"
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
moz-do-not-send="true"
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
moz-do-not-send="true"
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 moz-do-not-send="true"
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
moz-do-not-send="true"
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 moz-do-not-send="true"
href="http://www.cassidywebservices.co.uk"
target="_blank">www.cassidywebservices.co.uk</a></div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a class="moz-txt-link-abbreviated" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a class="moz-txt-link-freetext" href="http://www.cudatel.com">http://www.cudatel.com</a>
Official FreeSWITCH Sites
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://wiki.freeswitch.org">http://wiki.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.cluecon.com">http://www.cluecon.com</a>
FreeSWITCH-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
With kind regards
Peter Steinbach
Telefaks Services GmbH
<a class="moz-txt-link-freetext" href="mailto:lists">mailto:lists</a> (att) telefaks.de
Internet: <a class="moz-txt-link-abbreviated" href="http://www.telefaks.de">www.telefaks.de</a>
</pre>
</body>
</html>