Hi All, We already know that we can allow/deny a SIP end point to get registered to FreeSWITCH on the basis of IP , but what about if we want it to filter "User-Agent" field in REGISTER packets to be the key for registration. Since , we can also use TLS based registration but some soft phones does not have that capability. In that case , is there any way of passing only specified USER AGENT SIP client? Thanks -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Restrict-SIP-registration-tp75... Sent from the freeswitch-users mailing list archive at Nabble.com.
IPtables string matching is probably the easiest way (assuming no tls on these clients) http://www.netfilter.org/documentation/HOWTO/netfilter-extensions-HOWTO-3.ht... On 4 December 2013 07:52, mehroz <mehroz.ashraf85@gmail.com> wrote:
Hi All,
We already know that we can allow/deny a SIP end point to get registered to FreeSWITCH on the basis of IP , but what about if we want it to filter "User-Agent" field in REGISTER packets to be the key for registration.
Since , we can also use TLS based registration but some soft phones does not have that capability. In that case , is there any way of passing only specified USER AGENT SIP client?
Thanks
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Restrict-SIP-registration-tp75... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ 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
-- *Andrew Cassidy BSc (Hons) MBCS SSCA* Managing Director *T <info@cassidywebservices.co.uk> *03300 100 960 *F <info@cassidywebservices.co.uk> *03300 100 961 *E <info@cassidywebservices.co.uk> *andrew@cassidywebservices.co.uk *W <info@cassidywebservices.co.uk> *www.cassidywebservices.co.uk
Hello Andrew, if you manage your SIP registrations via xml_curl instead of a static dialplan, you have the variable "sip_user_agent" (e.g. sip_user_agent=Aastra%206739i/3.2.2.2044) available in the params, and then you can restrict the registrations based on the content in this variable. Best regards Peter On 12/04/13 10:33, Andrew Cassidy wrote:
IPtables string matching is probably the easiest way (assuming no tls on these clients)
http://www.netfilter.org/documentation/HOWTO/netfilter-extensions-HOWTO-3.ht...
On 4 December 2013 07:52, mehroz <mehroz.ashraf85@gmail.com <mailto:mehroz.ashraf85@gmail.com>> wrote:
Hi All,
We already know that we can allow/deny a SIP end point to get registered to FreeSWITCH on the basis of IP , but what about if we want it to filter "User-Agent" field in REGISTER packets to be the key for registration.
Since , we can also use TLS based registration but some soft phones does not have that capability. In that case , is there any way of passing only specified USER AGENT SIP client?
Thanks
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Restrict-SIP-registration-tp75... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ 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
Remember that the User-Agent can be changed by the caller, they can send anything they choose. Don't authenticate on it alone. On 4 December 2013 11:46, Peter Steinbach <lists@telefaks.de> wrote:
Hello Andrew,
if you manage your SIP registrations via xml_curl instead of a static dialplan, you have the variable "sip_user_agent" (e.g. sip_user_agent=Aastra%206739i/3.2.2.2044) available in the params, and then you can restrict the registrations based on the content in this variable.
Best regards Peter
On 12/04/13 10:33, Andrew Cassidy wrote:
IPtables string matching is probably the easiest way (assuming no tls on these clients)
http://www.netfilter.org/documentation/HOWTO/netfilter-extensions-HOWTO-3.ht...
On 4 December 2013 07:52, mehroz <mehroz.ashraf85@gmail.com> wrote:
Hi All,
We already know that we can allow/deny a SIP end point to get registered to FreeSWITCH on the basis of IP , but what about if we want it to filter "User-Agent" field in REGISTER packets to be the key for registration.
Since , we can also use TLS based registration but some soft phones does not have that capability. In that case , is there any way of passing only specified USER AGENT SIP client?
Thanks
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Restrict-SIP-registration-tp75... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ 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
-- *Andrew Cassidy BSc (Hons) MBCS SSCA* Managing Director
*T <info@cassidywebservices.co.uk> *03300 100 960 *F <info@cassidywebservices.co.uk> *03300 100 961 *E <info@cassidywebservices.co.uk> *andrew@cassidywebservices.co.uk *W <info@cassidywebservices.co.uk> *www.cassidywebservices.co.uk
_________________________________________________________________________ Professional FreeSWITCH Consulting Services:consulting@freeswitch.orghttp://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Serverhttp://www.cudatel.com
Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com
FreeSWITCH-users mailing listFreeSWITCH-users@lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.frees...
-- With kind regards Peter Steinbach
Telefaks Services GmbHmailto:lists <lists> (att) telefaks.de Internet: www.telefaks.de
_________________________________________________________________________ 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
Thats great . Thanks guys. Well looking into xml_curl , i cant see where am i getting that param. It says that the xml file is posted on the binding url. Do i have to write a script that can handle that xml file and retrieve my interested parameters? Correct? And do we have any such script on wiki? On Dec 4, 2013 10:40 PM, "Steven Ayre" <steveayre@gmail.com> wrote:
Remember that the User-Agent can be changed by the caller, they can send anything they choose. Don't authenticate on it alone.
On 4 December 2013 11:46, Peter Steinbach <lists@telefaks.de> wrote:
Hello Andrew,
if you manage your SIP registrations via xml_curl instead of a static dialplan, you have the variable "sip_user_agent" (e.g. sip_user_agent=Aastra%206739i/3.2.2.2044) available in the params, and then you can restrict the registrations based on the content in this variable.
Best regards Peter
On 12/04/13 10:33, Andrew Cassidy wrote:
IPtables string matching is probably the easiest way (assuming no tls on these clients)
http://www.netfilter.org/documentation/HOWTO/netfilter-extensions-HOWTO-3.ht...
On 4 December 2013 07:52, mehroz <mehroz.ashraf85@gmail.com> wrote:
Hi All,
We already know that we can allow/deny a SIP end point to get registered to FreeSWITCH on the basis of IP , but what about if we want it to filter "User-Agent" field in REGISTER packets to be the key for registration.
Since , we can also use TLS based registration but some soft phones does not have that capability. In that case , is there any way of passing only specified USER AGENT SIP client?
Thanks
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Restrict-SIP-registration-tp75... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ 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
-- *Andrew Cassidy BSc (Hons) MBCS SSCA* Managing Director
*T <info@cassidywebservices.co.uk> *03300 100 960 *F <info@cassidywebservices.co.uk> *03300 100 961 *E <info@cassidywebservices.co.uk> *andrew@cassidywebservices.co.uk *W <info@cassidywebservices.co.uk> *www.cassidywebservices.co.uk
_________________________________________________________________________ Professional FreeSWITCH Consulting Services:consulting@freeswitch.orghttp://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Serverhttp://www.cudatel.com
Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com
FreeSWITCH-users mailing listFreeSWITCH-users@lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.frees...
-- With kind regards Peter Steinbach
Telefaks Services GmbHmailto:lists <lists> (att) telefaks.de Internet: www.telefaks.de
_________________________________________________________________________ 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
_________________________________________________________________________ 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
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 On 12/05/13 17:47, Mehroz Ashraf wrote:
Thats great . Thanks guys. Well looking into xml_curl , i cant see where am i getting that param. It says that the xml file is posted on the binding url. Do i have to write a script that can handle that xml file and retrieve my interested parameters? Correct? And do we have any such script on wiki?
On Dec 4, 2013 10:40 PM, "Steven Ayre" <steveayre@gmail.com <mailto:steveayre@gmail.com>> wrote:
Remember that the User-Agent can be changed by the caller, they can send anything they choose. Don't authenticate on it alone.
On 4 December 2013 11:46, Peter Steinbach <lists@telefaks.de <mailto:lists@telefaks.de>> wrote:
Hello Andrew,
if you manage your SIP registrations via xml_curl instead of a static dialplan, you have the variable "sip_user_agent" (e.g. sip_user_agent=Aastra%206739i/3.2.2.2044) available in the params, and then you can restrict the registrations based on the content in this variable.
Best regards Peter
On 12/04/13 10:33, Andrew Cassidy wrote:
IPtables string matching is probably the easiest way (assuming no tls on these clients)
http://www.netfilter.org/documentation/HOWTO/netfilter-extensions-HOWTO-3.ht...
On 4 December 2013 07:52, mehroz <mehroz.ashraf85@gmail.com <mailto:mehroz.ashraf85@gmail.com>> wrote:
Hi All,
We already know that we can allow/deny a SIP end point to get registered to FreeSWITCH on the basis of IP , but what about if we want it to filter "User-Agent" field in REGISTER packets to be the key for registration.
Since , we can also use TLS based registration but some soft phones does not have that capability. In that case , is there any way of passing only specified USER AGENT SIP client?
Thanks
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Restrict-SIP-registration-tp75... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ 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 <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
-- With kind regards Peter Steinbach
Telefaks Services GmbH mailto:lists (att) telefaks.de <http://telefaks.de> Internet: www.telefaks.de <http://www.telefaks.de>
_________________________________________________________________________ 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
_________________________________________________________________________ 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
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 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 | F: +1.918.420.9002 | M: +1.918.424.WEST iNUM: +883 5100 1420 9001 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> 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
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> 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 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 | F: +1.918.420.9002 | M: +1.918.424.WEST iNUM: +883 5100 1420 9001 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> 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 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
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> 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> 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 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 | F: +1.918.420.9002 | M: +1.918.424.WEST iNUM: +883 5100 1420 9001 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> 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 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
_________________________________________________________________________ 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
-- *Andrew Cassidy BSc (Hons) MBCS SSCA* Managing Director *T <info@cassidywebservices.co.uk> *03300 100 960 *F <info@cassidywebservices.co.uk> *03300 100 961 *E <info@cassidywebservices.co.uk> *andrew@cassidywebservices.co.uk *W <info@cassidywebservices.co.uk> *www.cassidywebservices.co.uk
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
That is just great and a nice suggestion by peter. What other secrets does FS have for us? :-) On Dec 6, 2013 9:25 PM, "Peter Steinbach" <lists@telefaks.de> wrote:
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> 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> 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 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 | F: +1.918.420.9002 | M: +1.918.424.WEST iNUM: +883 5100 1420 9001 <%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> 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 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
_________________________________________________________________________ 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
-- *Andrew Cassidy BSc (Hons) MBCS SSCA* Managing Director
*T <info@cassidywebservices.co.uk> *03300 100 960 *F <info@cassidywebservices.co.uk> *03300 100 961 *E <info@cassidywebservices.co.uk> *andrew@cassidywebservices.co.uk *W <info@cassidywebservices.co.uk> *www.cassidywebservices.co.uk
_________________________________________________________________________ Professional FreeSWITCH Consulting Services:consulting@freeswitch.orghttp://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Serverhttp://www.cudatel.com
Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com
FreeSWITCH-users mailing listFreeSWITCH-users@lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.frees...
-- With kind regards Peter Steinbach
Telefaks Services GmbHmailto:lists <lists> (att) telefaks.de Internet: www.telefaks.de
_________________________________________________________________________ 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
participants (6)
-
Andrew Cassidy
-
Brian West
-
mehroz
-
Mehroz Ashraf
-
Peter Steinbach
-
Steven Ayre