Nice, 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. Best regards Peter On 12/06/13 10:46, Andrew Cassidy wrote:
No, you literally just put a regex in sofia.conf.xml in the profile clients register to (internal in the default configuration) , for example:
<param name="user-agent-filter" value="SipDroid" />
Brian, the variable isn't documented so noone was to know it existed!
On 6 December 2013 05:58, Mehroz Ashraf <mehroz.ashraf85@gmail.com <mailto:mehroz.ashraf85@gmail.com>> wrote:
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?
A code snippet : if (user_agent_filter) { if (switch_regex_match(user_agent, user_agent_filter) == SWITCH_STATUS_SUCCESS) { if (sofia_test_pflag(profile, PFLAG_LOG_AUTH_FAIL)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
"SIP auth OK (REGISTER) due to user-agent-filter. Filter \"%s\" User-Agent \"%s\"\n", user_agent_filter, user_agent); } } else { ret = AUTH_FORBIDDEN; if (sofia_test_pflag(profile, PFLAG_LOG_AUTH_FAIL)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"SIP auth failure (REGISTER) due to user-agent-filter. Filter \"%s\" User-Agent \"%s\"\n", user_agent_filter,
user_agent); } goto end; } }
can block a specific User-agent comparing that value in the first nested IF condition. But my vote goes to xml_curl method !
On Fri, Dec 6, 2013 at 1:41 AM, Brian West <brian@freeswitch.org <mailto:brian@freeswitch.org>> wrote:
You guys try way too hard.
sofia_reg.c: if (!strcasecmp(var, "user-agent-filter")) {
This is a sofia profile param that you can put a regex in and filter it out. ;)
-- Brian West brian@freeswitch.org <mailto:brian@freeswitch.org> FreeSWITCH Solutions, LLC PO BOX 2531 Brookfield, WI 53008-2531 Twitter: @FreeSWITCH_Wire , @briankwest http://www.freeswitchbook.com http://www.freeswitchcookbook.com
T: +1.918.420.9001 <tel:%2B1.918.420.9001> | F: +1.918.420.9002 <tel:%2B1.918.420.9002> | M: +1.918.424.WEST iNUM: +883 5100 1420 9001 <tel:%2B883%205100%201420%209001> ISN: 410*543 Skype:briankwest PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED)
On Dec 5, 2013, at 11:59 AM, Peter Steinbach <lists@telefaks.de <mailto:lists@telefaks.de>> wrote:
> xml_curl looks a server URL with the registration params. > > 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. > Some programming skills will be needed for that. > > Best regards > Peter
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- *Andrew Cassidy BSc (Hons) MBCS SSCA* Managing Director
*T <mailto:info@cassidywebservices.co.uk> *03300 100 960 *F <mailto:info@cassidywebservices.co.uk> *03300 100 961 *E <mailto:info@cassidywebservices.co.uk> *andrew@cassidywebservices.co.uk <mailto:andrew@cassidywebservices.co.uk> *W <mailto:info@cassidywebservices.co.uk> *www.cassidywebservices.co.uk <http://www.cassidywebservices.co.uk>
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- With kind regards Peter Steinbach Telefaks Services GmbH mailto:lists (att) telefaks.de Internet: www.telefaks.de