FreeSwitch: add outgoing profile and gateway

Add a profile called Outgoing and a gateway for the
Internal VOIP gateway server.

Also making way into the patch is the addition of a private repo
for fs sounds
This commit is contained in:
Wile E. Coyote 2017-09-25 17:06:07 +00:00
parent 7cf8ce0b3b
commit 44753f67c6
3 changed files with 176 additions and 0 deletions

View file

@ -0,0 +1,97 @@
<profile name="outgoing">
<!-- http://wiki.freeswitch.org/wiki/Sofia_Configuration_Files -->
<!-- This profile is only for outbound registrations to providers -->
<gateways>
<X-PRE-PROCESS cmd="include" data="outgoing/*.xml"/>
</gateways>
<aliases>
<!--
<alias name="outbound"/>
<alias name="nat"/>
-->
</aliases>
<domains>
<domain name="all" alias="false" parse="false"/>
</domains>
<settings>
<param name="debug" value="0"/>
<!-- If you want FreeSWITCH to shutdown if this profile fails to load, uncomment the next line. -->
<!-- <param name="shutdown-on-fail" value="true"/> -->
<param name="sip-trace" value="no"/>
<param name="sip-capture" value="no"/>
<param name="rfc2833-pt" value="101"/>
<!-- RFC 5626 : Send reg-id and sip.instance -->
<!--<param name="enable-rfc-5626" value="true"/> -->
<param name="sip-port" value="$${external_sip_port}"/>
<param name="dialplan" value="XML"/>
<param name="context" value="public"/>
<param name="dtmf-duration" value="2000"/>
<param name="inbound-codec-prefs" value="G729,PCMA,PCMU"/>
<param name="outbound-codec-prefs" value="G729,PCMA,PCMU"/>
<!--<param name="hold-music" value="$${hold_music}"/>-->
<param name="rtp-timer-name" value="soft"/>
<!--<param name="enable-100rel" value="true"/>-->
<!--<param name="disable-srv503" value="true"/>-->
<!-- This could be set to "passive" -->
<param name="local-network-acl" value="localnet.auto"/>
<param name="manage-presence" value="false"/>
<!-- used to share presence info across sofia profiles
manage-presence needs to be set to passive on this profile
if you want it to behave as if it were the internal profile
for presence.
-->
<!-- Name of the db to use for this profile -->
<!--<param name="dbname" value="share_presence"/>-->
<!--<param name="presence-hosts" value="$${domain}"/>-->
<!--<param name="force-register-domain" value="$${domain}"/>-->
<!--all inbound reg will stored in the db using this domain -->
<!--<param name="force-register-db-domain" value="$${domain}"/>-->
<!-- ************************************************* -->
<param name="aggressive-nat-detection" value="false"/>
<param name="nat-options-ping" value="false"/>
<param name="inbound-codec-negotiation" value="greedy"/>
<param name="nonce-ttl" value="60"/>
<param name="auth-calls" value="false"/>
<param name="inbound-late-negotiation" value="true"/>
<param name="inbound-zrtp-passthru" value="true"/> <!-- (also enables late negotiation) -->
<!--
DO NOT USE HOSTNAMES, ONLY IP ADDRESSES IN THESE SETTINGS!
-->
<param name="rtp-ip" value="$${local_ip_v4}"/>
<param name="sip-ip" value="$${local_ip_v4}"/>
<param name="ext-rtp-ip" value="$${local_ip_v4}"/>
<param name="ext-sip-ip" value="$${local_ip_v4}"/>
<param name="rtp-timeout-sec" value="90"/>
<param name="rtp-hold-timeout-sec" value="1800"/>
<!--<param name="enable-3pcc" value="true"/>-->
<!-- TLS: disabled by default, set to "true" to enable -->
<param name="tls" value="$${external_ssl_enable}"/>
<!-- Set to true to not bind on the normal sip-port but only on the TLS port -->
<param name="tls-only" value="false"/>
<!-- additional bind parameters for TLS -->
<param name="tls-bind-params" value="transport=tls"/>
<!-- Port to listen on for TLS requests. (5081 will be used if unspecified) -->
<param name="tls-sip-port" value="$${external_tls_port}"/>
<!-- Location of the agent.pem and cafile.pem ssl certificates (needed for TLS server) -->
<!--<param name="tls-cert-dir" value=""/>-->
<!-- Optionally set the passphrase password used by openSSL to encrypt/decrypt TLS private key files -->
<param name="tls-passphrase" value=""/>
<!-- Verify the date on TLS certificates -->
<param name="tls-verify-date" value="true"/>
<!-- TLS verify policy, when registering/inviting gateways with other servers (outbound) or handling inbound registration/invite requests how should we verify their certificate -->
<!-- set to 'in' to only verify incoming connections, 'out' to only verify outgoing connections, 'all' to verify all connections, also 'in_subjects', 'out_subjects' and 'all_subjects' for subject validation. Multiple policies can be split with a '|' pipe -->
<param name="tls-verify-policy" value="none"/>
<!-- Certificate max verify depth to use for validating peer TLS certificates when the verify policy is not none -->
<param name="tls-verify-depth" value="2"/>
<!-- If the tls-verify-policy is set to subjects_all or subjects_in this sets which subjects are allowed, multiple subjects can be split with a '|' pipe -->
<param name="tls-verify-in-subjects" value=""/>
<!-- TLS version ("sslv23" (default), "tlsv1"). NOTE: Phones may not work with TLSv1 -->
<param name="tls-version" value="$${sip_tls_version}"/>
</settings>
</profile>

View file

@ -80,6 +80,7 @@ class rhizo_base::freeswitch::common {
$voip_fromuser = $rhizo_base::voip_fromuser
$voip_password = $rhizo_base::voip_password
$voip_proxy = $rhizo_base::voip_proxy
$sip_central_ip_address = $rhizo_base::sip_central_ip_address
package {
['freeswitch', 'freeswitch-lang-en',
@ -132,8 +133,46 @@ class rhizo_base::freeswitch::common {
File['/etc/freeswitch/sip_profiles/external'] ],
}
file {'/etc/freeswitch/sip_profiles/outgoing':
ensure => directory,
}
file { '/etc/freeswitch/sip_profiles/outgoing/rhizomatica.xml':
content => template('rhizo_base/rhizomatica.xml.erb'),
require =>
[ Package['freeswitch'],
File['/etc/freeswitch/sip_profiles/outgoing'] ],
}
file { '/etc/freeswitch/autoload_configs/cdr_pg_csv.conf.xml':
content => template('rhizo_base/cdr_pg_csv.conf.xml.erb'),
require => Package['freeswitch'],
}
# SSH Deploy key and config for gitlab
file { '/root/.ssh/bsc_dev':
ensure => present,
mode => '0600',
content => hiera('rhizo::bsc_dev_deploy_key'),
}
file { '/root/.ssh/config':
ensure => present,
source => 'puppet:///modules/rhizo_base/ssh/config',
}
sshkey { 'dev_host_key':
name => 'dev.rhizomatica.org',
ensure => present,
key => hiera('rhizo::dev_host_key'),
type => 'ssh-rsa',
}
vcsrepo { '/usr/share/freeswitch/sounds/rccn':
ensure => latest,
provider => git,
source => 'git@dev.rhizomatica.org:rhizomatica/ticac_sounds.git',
require => File['/root/.ssh/bsc_dev'],
}
}

View file

@ -0,0 +1,40 @@
<include>
<gateway name="rhizomatica">
<!--/// account username *required* ///-->
<param name="username" value="rhizomatica"/>
<!--/// auth realm: *optional* same as gateway name, if blank ///-->
<!--<param name="realm" value="asterlink.com"/>-->
<!--/// username to use in from: *optional* same as username, if blank ///-->
<param name="from-user" value="<%= @voip_fromuser %>"/>
<!--/// domain to use in from: *optional* same as realm, if blank ///-->
<!--<param name="from-domain" value="asterlink.com"/>-->
<!--/// account password *required* ///-->
<param name="password" value="<%= @voip_password %>"/>
<!--/// extension for inbound calls: *optional* same as username, if blank ///-->
<!--<param name="extension" value="cluecon"/>-->
<!--/// proxy host: *optional* same as realm, if blank ///-->
<!--<param name="proxy" value="66.33.146.52"/>-->
<param name="proxy" value="<%= @sip_central_ip_address %>"/>
<!--/// send register to this proxy: *optional* same as proxy, if blank ///-->
<!--<param name="register-proxy" value="mysbc.com"/>-->
<!--/// expire in seconds: *optional* 3600, if blank ///-->
<!--<param name="expire-seconds" value="60"/>-->
<!--/// do not register ///-->
<!--<param name="register" value="false"/>-->
<!-- which transport to use for register -->
<!--<param name="register-transport" value="udp"/>-->
<!--How many seconds before a retry when a failure or timeout occurs -->
<!--<param name="retry-seconds" value="30"/>-->
<!--Use the callerid of an inbound call in the from field on outbound calls via this gateway -->
<param name="caller-id-in-from" value="true"/>
<!--extra sip params to send in the contact-->
<!--<param name="contact-params" value="tport=tcp"/>-->
<!--send an options ping every x seconds, failure will unregister and/or mark it down-->
<!--<param name="ping" value="25"/>-->
<!--</gateway>-->
<!--rfc5626 : Abilitazione rfc5626 ///-->
<!--<param name="rfc-5626" value="true"/>-->
<!--rfc5626 : extra sip params to send in the contact-->
<!--<param name="reg-id" value="1"/>-->
</gateway>
</include>