Call a remote extension on specific domain
Hello I have two multi-domains freeswitch servers 1 and 2 and i want to interconnect them for internal calls I read https://wiki.freeswitch.org/wiki/Connect_Two_FreeSWITCH_Boxes but it did not fully fit to my need because I want to call from freeswitch1 a specific extension of freeswitch2 on a specific domain ( and not just default ). In short i want to tell to freeswitch2: Connect me with extension 1000@domain-name and not just connect me with extension 1000 My guess is send custom sip headers from freeswitch1 and parse X-domainname on freeswitch2 dialplan <action application="set" data="sip_h_X-domainname=somedomain"/> <action application="bridge" data="sofia/internal/${destination_number}@freeswitch2.company.com "/> This will probably work, but is there a clean way to do it without using non standard headers ? Best Regards
Try dial as originate {sip_invite_to_uri=<sip:${destination_number}@mydomain.org>}user/ reg_user@mydomain.org & park or <action application="bridge" data="{sip_invite_to_uri=<sip:${ destination_number}@mydomain.org>}user/reg_user@mydomain.org"/> Also check sip_invite_req_uri variable. On Tue, Sep 15, 2015, 23:50 Tanguy <phenix@vfemail.net> wrote:
Hello
I have two multi-domains freeswitch servers 1 and 2 and i want to interconnect them for internal calls
I read https://wiki.freeswitch.org/wiki/Connect_Two_FreeSWITCH_Boxes but it did not fully fit to my need because I want to call from freeswitch1 a specific extension of freeswitch2 on a specific domain ( and not just default ). In short i want to tell to freeswitch2: Connect me with extension 1000@domain-name and not just connect me with extension 1000
My guess is send custom sip headers from freeswitch1 and parse X-domainname on freeswitch2 dialplan
<action application="set" data="sip_h_X-domainname=somedomain"/> <action application="bridge" data="sofia/internal/${destination_number}@freeswitch2.company.com "/>
This will probably work, but is there a clean way to do it without using non standard headers ?
Best Regards
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.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
Hello Sergey Thanks for your reply but i am not sure to userstand what you mean. What is reg_user@mydomain.org <mailto:reg_user@mydomain.org> ? I don't want to call a locally registered user. Alternatively i tried to mix my original idea and yours <action application="bridge" data="{sip_invite_to_uri=<sip:${destination_number}@somedomain>}sofia/internal/${destination_number}@freeswitch2.company.com" /> I will probably able to parse the To header on freeswitch2 dialplan. INVITE sip:5003@freeswitch2.company.com SIP/2.0 Via: SIP/2.0/UDP 94.125.x.x;rport;branch=z9hG4bK5F1Z6rc8jK96H Max-Forwards: 69 From: "Tanguy bureau" <sip:5002@94.125.x.x>;tag=D5978NDrZ39ae To: <sip:5003@somedomain.voip.company.com> Regards On 16/09/2015 04:36, Sergey Safarov wrote:
Try dial as
originate {sip_invite_to_uri=<sip:${destination_number}@mydomain.org <mailto:destination_number%7D@mydomain.org>>}user/reg_user@mydomain.org <mailto:reg_user@mydomain.org> & park
or
<action application="bridge" data="{sip_invite_to_uri=<sip:${destination_number}@mydomain.org <mailto:destination_number%7D@mydomain.org>>}user/reg_user@mydomain.org <mailto:reg_user@mydomain.org>"/>
Also check sip_invite_req_uri variable.
On Tue, Sep 15, 2015, 23:50 Tanguy <phenix@vfemail.net <mailto:phenix@vfemail.net>> wrote:
Hello
I have two multi-domains freeswitch servers 1 and 2 and i want to interconnect them for internal calls
I read https://wiki.freeswitch.org/wiki/Connect_Two_FreeSWITCH_Boxes but it did not fully fit to my need because I want to call from freeswitch1 a specific extension of freeswitch2 on a specific domain ( and not just default ). In short i want to tell to freeswitch2: Connect me with extension 1000@domain-name and not just connect me with extension 1000
My guess is send custom sip headers from freeswitch1 and parse X-domainname on freeswitch2 dialplan
<action application="set" data="sip_h_X-domainname=somedomain"/> <action application="bridge" data="sofia/internal/${destination_number}@freeswitch2.company.com <mailto:destination_number%7D@freeswitch2.company.com> "/>
This will probably work, but is there a clean way to do it without using non standard headers ?
Best Regards
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.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
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.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
I am now able to call a extension from a remote server, for those who are interested i used theses options on freeswitch2 public dialplan <action application="set" data="call_direction=inbound"/> <action application="set" data="domain_name=${sip_to_host}" > <action application="set" data="domain=${sip_to_host}"/> <action application="transfer" data="${sip_to_user} XML ${sip_to_host}" /> On 16/09/2015 19:39, Tanguy wrote:
Hello Sergey
Thanks for your reply but i am not sure to userstand what you mean. What is reg_user@mydomain.org <mailto:reg_user@mydomain.org> ? I don't want to call a locally registered user.
Alternatively i tried to mix my original idea and yours
<action application="bridge" data="{sip_invite_to_uri=<sip:${destination_number}@somedomain>}sofia/internal/${destination_number}@freeswitch2.company.com" />
I will probably able to parse the To header on freeswitch2 dialplan.
INVITE sip:5003@freeswitch2.company.com SIP/2.0 Via: SIP/2.0/UDP 94.125.x.x;rport;branch=z9hG4bK5F1Z6rc8jK96H Max-Forwards: 69 From: "Tanguy bureau" <sip:5002@94.125.x.x>;tag=D5978NDrZ39ae To: <sip:5003@somedomain.voip.company.com>
Regards
On 16/09/2015 04:36, Sergey Safarov wrote:
Try dial as
originate {sip_invite_to_uri=<sip:${destination_number}@mydomain.org <mailto:destination_number%7D@mydomain.org>>}user/reg_user@mydomain.org <mailto:reg_user@mydomain.org> & park
or
<action application="bridge" data="{sip_invite_to_uri=<sip:${destination_number}@mydomain.org <mailto:destination_number%7D@mydomain.org>>}user/reg_user@mydomain.org <mailto:reg_user@mydomain.org>"/>
Also check sip_invite_req_uri variable.
On Tue, Sep 15, 2015, 23:50 Tanguy <phenix@vfemail.net <mailto:phenix@vfemail.net>> wrote:
Hello
I have two multi-domains freeswitch servers 1 and 2 and i want to interconnect them for internal calls
I read https://wiki.freeswitch.org/wiki/Connect_Two_FreeSWITCH_Boxes but it did not fully fit to my need because I want to call from freeswitch1 a specific extension of freeswitch2 on a specific domain ( and not just default ). In short i want to tell to freeswitch2: Connect me with extension 1000@domain-name and not just connect me with extension 1000
My guess is send custom sip headers from freeswitch1 and parse X-domainname on freeswitch2 dialplan
<action application="set" data="sip_h_X-domainname=somedomain"/> <action application="bridge" data="sofia/internal/${destination_number}@freeswitch2.company.com <mailto:destination_number%7D@freeswitch2.company.com> "/>
This will probably work, but is there a clean way to do it without using non standard headers ?
Best Regards
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.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
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.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
1) I recommend not use "domain" and dereviated variables. This variables may be used in bridge and other application. 2) try send invite as in example provided early. On Thu, Sep 17, 2015, 23:22 Tanguy <phenix@vfemail.net> wrote:
I am now able to call a extension from a remote server, for those who are interested i used theses options on freeswitch2 public dialplan
<action application="set" data="call_direction=inbound"/> <action application="set" data="domain_name=${sip_to_host}" > <action application="set" data="domain=${sip_to_host}"/> <action application="transfer" data="${sip_to_user} XML ${sip_to_host}" />
On 16/09/2015 19:39, Tanguy wrote:
Hello Sergey
Thanks for your reply but i am not sure to userstand what you mean. What is reg_user@mydomain.org ? I don't want to call a locally registered user.
Alternatively i tried to mix my original idea and yours
<action application="bridge" data="{sip_invite_to_uri=<sip:${destination_number}@somedomain
}sofia/internal/${destination_number}@freeswitch2.company.com" />
I will probably able to parse the To header on freeswitch2 dialplan.
INVITE sip:5003@freeswitch2.company.com SIP/2.0 Via: SIP/2.0/UDP 94.125.x.x;rport;branch=z9hG4bK5F1Z6rc8jK96H Max-Forwards: 69 From: "Tanguy bureau" <sip:5002@94.125.x.x> <sip:5002@94.125.x.x>;tag=D5978NDrZ39ae
To: <sip:5003@somedomain.voip.company.com> <sip:5003@somedomain.voip.company.com>
Regards
On 16/09/2015 04:36, Sergey Safarov wrote:
Try dial as
originate {sip_invite_to_uri=<sip:${destination_number}@mydomain.org
}user/reg_user@mydomain.org & park
or
<action application="bridge" data="{sip_invite_to_uri=<sip:${ destination_number}@mydomain.org>}user/reg_user@mydomain.org"/>
Also check sip_invite_req_uri variable.
On Tue, Sep 15, 2015, 23:50 Tanguy <phenix@vfemail.net> wrote:
Hello
I have two multi-domains freeswitch servers 1 and 2 and i want to interconnect them for internal calls
I read https://wiki.freeswitch.org/wiki/Connect_Two_FreeSWITCH_Boxes but it did not fully fit to my need because I want to call from freeswitch1 a specific extension of freeswitch2 on a specific domain ( and not just default ). In short i want to tell to freeswitch2: Connect me with extension 1000@domain-name and not just connect me with extension 1000
My guess is send custom sip headers from freeswitch1 and parse X-domainname on freeswitch2 dialplan
<action application="set" data="sip_h_X-domainname=somedomain"/> <action application="bridge" data="sofia/internal/${destination_number}@freeswitch2.company.com "/>
This will probably work, but is there a clean way to do it without using non standard headers ?
Best Regards
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.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.orghttp://www.freeswitchsolutions.com
Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://confluence.freeswitch.orghttp://www.cluecon....
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...
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.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
Hello Sergey I am agree with you that my dial plan can be risky I used ACL but this can be not sufficient. I want to be able to call any internal sip extension, but i don't want that this piece dialplan to be usable reach external numbers. I probably need to protect theses variables ( sip_to_user must be only a locally registered sip extension ) or avoid using them ( maybe using multiple conditions field for each domain ? ) I don't fully understand your initial example: <action application="bridge" data="{sip_invite_to_uri=<sip:${destination_number}@mydomain.org <mailto:destination_number%7D@mydomain.org>>}user/reg_user@mydomain.org <mailto:reg_user@mydomain.org>"/> What is *reg_user* for freeswitch1 ? What should i use on freeswitch2 dialplan to recognize the inbound call ? Thanks On 18/09/2015 07:10, Sergey Safarov wrote:
1) I recommend not use "domain" and dereviated variables. This variables may be used in bridge and other application. 2) try send invite as in example provided early.
On Thu, Sep 17, 2015, 23:22 Tanguy <phenix@vfemail.net <mailto:phenix@vfemail.net>> wrote:
I am now able to call a extension from a remote server, for those who are interested i used theses options on freeswitch2 public dialplan
<action application="set" data="call_direction=inbound"/> <action application="set" data="domain_name=${sip_to_host}" > <action application="set" data="domain=${sip_to_host}"/> <action application="transfer" data="${sip_to_user} XML ${sip_to_host}" />
what is wrong with: <action application="bridge" data="sofia/profile/sip:someone@somedomain.com "/> ??? On Fri, Sep 18, 2015 at 12:23 PM, Tanguy <phenix@vfemail.net> wrote:
Hello Sergey
I am agree with you that my dial plan can be risky I used ACL but this can be not sufficient. I want to be able to call any internal sip extension, but i don't want that this piece dialplan to be usable reach external numbers.
I probably need to protect theses variables ( sip_to_user must be only a locally registered sip extension ) or avoid using them ( maybe using multiple conditions field for each domain ? )
I don't fully understand your initial example:
<action application="bridge" data="{sip_invite_to_uri=<sip:${ destination_number}@mydomain.org>}user/reg_user@mydomain.org"/>
What is *reg_user* for freeswitch1 ? What should i use on freeswitch2 dialplan to recognize the inbound call ?
Thanks
On 18/09/2015 07:10, Sergey Safarov wrote:
1) I recommend not use "domain" and dereviated variables. This variables may be used in bridge and other application. 2) try send invite as in example provided early.
On Thu, Sep 17, 2015, 23:22 Tanguy <phenix@vfemail.net> wrote:
I am now able to call a extension from a remote server, for those who are interested i used theses options on freeswitch2 public dialplan
<action application="set" data="call_direction=inbound"/> <action application="set" data="domain_name=${sip_to_host}" > <action application="set" data="domain=${sip_to_host}"/> <action application="transfer" data="${sip_to_user} XML ${sip_to_host}" />
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.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
-- *Brian West* brian@freeswitch.org *Twitter: @FreeSWITCH , @briankwest* http://www.freeswitchbook.com http://www.freeswitchcookbook.com Got Bugs? Report them here <https://freeswitch.org/jira>! | Reddit: /r/freeswitch <https://www.reddit.com/r/freeswitch> *T:*+19184209001 | *F:*+19184209002 | *M:*+1918424WEST (9378) *iNUM:*+883 5100 1420 9001 | *ISN:*410*543 | *Skype:*briankwest
Hello Brian I did not specify this detail because i did not though this was important a the beginning, but the same domains are installed on freeswitch1 and freeswitch2 and mydomain.org is in fact a DNS SRV record witch point to freeswitch1 and freeswitch2. When someone on freeswitch1 wan't to call extension@domain, if it's not registered on freeswitch1 (i check using sofia_contact ) i want to forward the call to freeswitch2 and vice versa. So i think i can't do a this with a original sofia bridge but it was possible by using sip_invite_to_uri as suggested by Sergey. Now i need to secure it :-) It's probably possible to use opensips, but it's seems more complex than a pure freeswitch. On 18/09/2015 21:49, Brian West wrote:
what is wrong with:
<action application="bridge" data="sofia/profile/sip:someone@somedomain.com <mailto:sip%3Asomeone@somedomain.com>"/>
???
On Fri, Sep 18, 2015 at 12:23 PM, Tanguy <phenix@vfemail.net <mailto:phenix@vfemail.net>> wrote:
Hello Sergey
I am agree with you that my dial plan can be risky I used ACL but this can be not sufficient. I want to be able to call any internal sip extension, but i don't want that this piece dialplan to be usable reach external numbers.
I probably need to protect theses variables ( sip_to_user must be only a locally registered sip extension ) or avoid using them ( maybe using multiple conditions field for each domain ? )
I don't fully understand your initial example:
<action application="bridge" data="{sip_invite_to_uri=<sip:${destination_number}@mydomain.org <mailto:destination_number%7D@mydomain.org>>}user/reg_user@mydomain.org <mailto:reg_user@mydomain.org>"/>
What is *reg_user* for freeswitch1 ? What should i use on freeswitch2 dialplan to recognize the inbound call ?
Thanks
On 18/09/2015 07:10, Sergey Safarov wrote:
1) I recommend not use "domain" and dereviated variables. This variables may be used in bridge and other application. 2) try send invite as in example provided early.
On Thu, Sep 17, 2015, 23:22 Tanguy <phenix@vfemail.net <mailto:phenix@vfemail.net>> wrote:
I am now able to call a extension from a remote server, for those who are interested i used theses options on freeswitch2 public dialplan
<action application="set" data="call_direction=inbound"/> <action application="set" data="domain_name=${sip_to_host}" > <action application="set" data="domain=${sip_to_host}"/> <action application="transfer" data="${sip_to_user} XML ${sip_to_host}" />
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.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
--
*/Brian West/* brian@freeswitch.org <mailto:brian@freeswitch.org>
*/Twitter: @FreeSWITCH , @briankwest/* http://www.freeswitchbook.com http://www.freeswitchcookbook.com
Got Bugs? Report them here <https://freeswitch.org/jira>! | Reddit: /r/freeswitch <https://www.reddit.com/r/freeswitch>
*T:*+19184209001 | *F:*+19184209002 | *M:*+1918424WEST (9378) *iNUM:*+883 5100 1420 9001 | *ISN:*410*543 | *Skype:*briankwest
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.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
At present time i use kazoo <https://github.com/2600hz/kazoo> cluster for hosting virtual PBX and can recommend use it for you. On Fri, Sep 18, 2015 at 11:25 PM, Tanguy <phenix@vfemail.net> wrote:
Hello Brian
I did not specify this detail because i did not though this was important a the beginning, but the same domains are installed on freeswitch1 and freeswitch2 and mydomain.org is in fact a DNS SRV record witch point to freeswitch1 and freeswitch2.
When someone on freeswitch1 wan't to call extension@domain, if it's not registered on freeswitch1 (i check using sofia_contact ) i want to forward the call to freeswitch2 and vice versa.
So i think i can't do a this with a original sofia bridge but it was possible by using sip_invite_to_uri as suggested by Sergey. Now i need to secure it :-)
It's probably possible to use opensips, but it's seems more complex than a pure freeswitch.
On Fri, Sep 18, 2015 at 8:23 PM, Tanguy <phenix@vfemail.net> wrote:
Hello Sergey
I am agree with you that my dial plan can be risky I used ACL but this can be not sufficient. I want to be able to call any internal sip extension, but i don't want that this piece dialplan to be usable reach external numbers.
For extra protection, add into dialplan <extension name="blockCallToNonExistenDomain"> <condition regex="any"> <regex field="${sip_to_host}" expression="^[\d\.]+$"/> <regex field="${domain_exists(${sip_to_host})}" expression="^false$" /> <action application="info"/> <action application="log" data="ERR Unauthorised call with uuid "${uuid}" is processed in context "${context}"! Source IP: ${network_addr}"/> <action application="hangup" data="INCOMING_CALL_BARRED"/> </condition> </extension> <extension name="checkUserExist"> <condition field="${user_exists(id ${destination_number} ${sip_to_host})}" expression="^false$"> <action application="hangup" data="UNALLOCATED_NUMBER"/> </condition> </extension>
I probably need to protect theses variables ( sip_to_user must be only a locally registered sip extension ) or avoid using them ( maybe using multiple conditions field for each domain ? )
"user_exists" function allow you block call to non existed destination. On my FS host created personal dialplan for each domain. Most of domain related checks related located in this dialplans.
I don't fully understand your initial example:
<action application="bridge" data="{sip_invite_to_uri=<sip:${ destination_number}@mydomain.org>}user/reg_user@mydomain.org"/>
It is copied from http://lists.freeswitch.org/pipermail/freeswitch-users/2015-August/115047.ht... message Is is response I write via my mobile phone and cannot edit correctly.
What is *reg_user* for freeswitch1?
reg_user related to message http://lists.freeswitch.org/pipermail/freeswitch-users/2015-August/115047.ht...
What should i use on freeswitch2 dialplan to recognize the inbound call ?
What is I may recommend to block unauthorised calls and fraud control I write above. Also I can recommend configure 1) fail2ban 2) nibblebill 3) destination_number format checks
Thanks
Ok thanks, i will try your dialplan. My actuals voip productions servers ( still running asterisk ) don't use fail2ban but i have restrictive firewall rules to allow only a predetermined list of IP and subnets but is not a reason to not use fail2ban on future servers. I also think about filtering by sip domains -A PREROUTING -i eth+ -p tcp --dport 5060:5082 -m string --string "sip:YOUR_HOSTNAME.no-ip.com" --algo bm --icase -j NEWSIP http://blog.ls20.com/securing-your-asterisk-voip-server-with-iptables/ nibblebil will be very useful for me, because i was looking since a long time a lightweight software ( not like astpp or a2billing ) for disabling a extension in case of probable fraud. On 20/09/2015 11:26, Sergey Safarov wrote:
On Fri, Sep 18, 2015 at 8:23 PM, Tanguy <phenix@vfemail.net <mailto:phenix@vfemail.net>> wrote:
Hello Sergey
I am agree with you that my dial plan can be risky I used ACL but this can be not sufficient. I want to be able to call any internal sip extension, but i don't want that this piece dialplan to be usable reach external numbers.
For extra protection, add into dialplan
<extensionname="blockCallToNonExistenDomain"> <conditionregex="any"> <regexfield="${sip_to_host}"expression="^[\d\.]+$"/> <regexfield="${domain_exists(${sip_to_host})}"expression="^false$"/> <actionapplication="info"/> <actionapplication="log" data="ERR Unauthorised call with uuid "${uuid}" is processed in context "${context}"! Source IP: ${network_addr}"/> <actionapplication="hangup"data="INCOMING_CALL_BARRED"/> </condition> </extension>
<extensionname="checkUserExist"> <conditionfield="${user_exists(id ${destination_number} ${sip_to_host})}" expression="^false$"> <actionapplication="hangup"data="UNALLOCATED_NUMBER"/> </condition> </extension>
I probably need to protect theses variables ( sip_to_user must be only a locally registered sip extension ) or avoid using them ( maybe using multiple conditions field for each domain ? )
"user_exists" function allow you block call to non existed destination. On my FS host created personal dialplan for each domain. Most of domain related checks related located in this dialplans.
I don't fully understand your initial example:
<action application="bridge" data="{sip_invite_to_uri=<sip:${destination_number}@mydomain.org <mailto:destination_number%7D@mydomain.org>>}user/reg_user@mydomain.org <mailto:reg_user@mydomain.org>"/>
It is copied from http://lists.freeswitch.org/pipermail/freeswitch-users/2015-August/115047.ht... message Is is response I write via my mobile phone and cannot edit correctly.
What is *reg_user* for freeswitch1?
reg_user related to message http://lists.freeswitch.org/pipermail/freeswitch-users/2015-August/115047.ht...
What should i use on freeswitch2 dialplan to recognize the inbound call ?
What is I may recommend to block unauthorised calls and fraud control I write above. Also I can recommend configure 1) fail2ban 2) nibblebill 3) destination_number format checks
Thanks
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.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
You might find this tutorial that describes how to configure FreeSWITCH for multi-tenant use to be helpful: https://freeswitch.org/confluence/display/FREESWITCH/FreeSWITCH+PBX+Example Basically, each profile listens on different ports, sends calls through different contexts and thus different dialplans to reach different tenants. The vanilla configuration that ships with FS is merely an example, but by no means should limit what you can do. FreeSWITCH is incredibly configurable. Bote
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch- users-bounces@lists.freeswitch.org] On Behalf Of Tanguy Sent: Tuesday, 15 September, 2015 16:49 To: FreeSWITCH Users Help Subject: [Freeswitch-users] Call a remote extension on specific domain
Hello
I have two multi-domains freeswitch servers 1 and 2 and i want to interconnect them for internal calls
I read https://wiki.freeswitch.org/wiki/Connect_Two_FreeSWITCH_Boxes but it did not fully fit to my need because I want to call from freeswitch1 a specific extension of freeswitch2 on a specific domain ( and not just default ). In short i want to tell to freeswitch2: Connect me with extension 1000@domain-name and not just connect me with extension 1000
My guess is send custom sip headers from freeswitch1 and parse X-domainname on freeswitch2 dialplan
<action application="set" data="sip_h_X-domainname=somedomain"/> <action application="bridge" data="sofia/internal/${destination_number}@freeswitch2.company.com "/>
This will probably work, but is there a clean way to do it without using non standard headers ?
Best Regards
participants (4)
-
Bote Man
-
Brian West
-
Sergey Safarov
-
Tanguy