SIP配置文件目录。一般每个文件描述一个Profile
1.external.xml:一般用于外部网关。
2.internal.xml:一般用于本地用户。
external.xml
external.xml加载了子目录
<gateways>
<X-PRE-PROCESS cmd="include" data="external/*.xml"/>
</gateways>
因此我们只需要配置external/*.xml,在配置上如果是ipv6配置对于的ipv6的xml
<include>
<!--<gateway name="asterlink.com">-->
<!--/// account username *required* ///-->
<!--<param name="username" value="cluecon"/>-->
<!--/// 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="cluecon"/>-->
<!--/// 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="2007"/>-->
<!--/// 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="asterlink.com"/>-->
<!--/// 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="false"/>-->
<!--extra sip params to send in the contact-->
<!--<param name="contact-params" value=""/>-->
<!-- Put the extension in the contact -->
<!--<param name="extension-in-contact" value="true"/>-->
<!--send an options ping every x seconds, failure will unregister and/or mark it down-->
<!--<param name="ping" value="25"/>-->
<!--<param name="cid-type" value="rpid"/>-->
<!--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>
对应的参数
username:必须;用户名,会出现在SIP消息的Authorization头中;
realm:必需; SIP网关服务器地址。可为域名或IP,如果端口不是5060则需加上“:端口”。省略取gateway的name值;
from-user:SIP的From首部的用户信息。省略取username;
from-domain:SIP的From首部的domain值。省略取realm;
password:必需; 密码;
extension:来话中的分机号,即被叫号码。省略取username;
proxy:代理服务器地址。省略取realm;
register-proxy:注册使用的代理服务器。省略取realm;
expire-seconds:SIP的REGISTER消息的Expires首部。省略则为3600。单位为秒;
register:是否注册到网关。省略则为true。如果是中继,则不需要注册;
register-transport:SIP消息的承载,可为:tcp、udp。在auto_config下sip.conf下默认是udp;
retry-seconds:注册失败或超时后,重新注册的等待秒数;
caller-id-in-from:是否将主叫号码放到SIP的From首部。省略则为false,即放到Remote-Party-ID首部;
contact-params:SIP的Contact首部的额外参数;
extension-in-contact: 控制是否在SIP的Contact头部中使用扩展号码,true可能会暴露号码;
ping:发送SIP的OPTIONS消息的时间间隔。如果失败,则从该网关注销,并将其设置为down状态;
cid-type:指定呼叫者ID;
rfc-5626: 默认false;RFC是关于SIP URI处理的一个规范;如果一个SIP URI中没有明确指定端口号,那么默认应该使用5060端口(对于TCP)或5061端口(对于TLS/SSL);
reg-id: 指定一个特定的注册ID,这在多租户环境或者需要为不同的服务或用户组使用不同的注册信息时区分;
internal.xml
对内网关
<profile name="internal">
<aliases>
<!--
<alias name="default"/>
-->
</aliases>
<!-- Outbound Registrations -->
<gateways>
</gateways>
<domains>
<domain name="all" alias="true" 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="watchdog-enabled" value="no"/>
<param name="watchdog-step-timeout" value="30000"/>
<param name="watchdog-event-timeout" value="30000"/>
<param name="log-auth-failures" value="false"/>
<param name="forward-unsolicited-mwi-notify" value="false"/>
<param name="context" value="public"/>
<param name="rfc2833-pt" value="101"/>
<!-- port to bind to for sip traffic -->
<param name="sip-port" value="$${internal_sip_port}"/>
<param name="dialplan" value="XML"/>
<param name="dtmf-duration" value="2000"/>
<param name="inbound-codec-prefs" value="$${global_codec_prefs}"/>
<param name="outbound-codec-prefs" value="$${global_codec_prefs}"/>
<param name="rtp-timer-name" value="soft"/>
<!-- ip address to use for rtp, DO NOT USE HOSTNAMES ONLY IP ADDRESSES -->
<param name="rtp-ip" value="$${local_ip_v4}"/>
<!-- ip address to bind to, DO NOT USE HOSTNAMES ONLY IP ADDRESSES -->
<param name="sip-ip" value="$${local_ip_v4}"/>
<param name="hold-music" value="$${hold_music}"/>
<param name="apply-nat-acl" value="nat.auto"/>
<param name="apply-inbound-acl" value="domains"/>
<param name="local-network-acl" value="localnet.auto"/>
<param name="record-path" value="$${recordings_dir}"/>
<param name="record-template" value="${caller_id_number}.${target_domain}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
<!--enable to use presence -->
<param name="manage-presence" value="true"/>
<param name="presence-hosts" value="$${domain},$${local_ip_v4}"/>
<param name="presence-privacy" value="$${presence_privacy}"/>
<param name="inbound-codec-negotiation" value="generous"/>
<param name="tls" value="$${internal_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. (5061 will be used if unspecified) -->
<param name="tls-sip-port" value="$${internal_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 'subjects_in', 'subjects_out' and 'subjects_all' 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 default: tlsv1,tlsv1.1,tlsv1.2 -->
<param name="tls-version" value="$${sip_tls_version}"/>
<!-- TLS ciphers default: ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH -->
<param name="tls-ciphers" value="$${sip_tls_ciphers}"/>
<param name="inbound-late-negotiation" value="true"/>
<!--TTL for nonce in sip auth-->
<param name="nonce-ttl" value="60"/>
<param name="auth-calls" value="$${internal_auth_calls}"/>
<!-- Force subscription requests to require authentication -->
<param name="auth-subscriptions" value="true"/>
<!-- Force the user and auth-user to match. -->
<param name="inbound-reg-force-matching-username" value="true"/>
<!-- on authed calls, authenticate *all* the packets not just invite -->
<param name="auth-all-packets" value="false"/>
<param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
<param name="ext-sip-ip" value="$${external_sip_ip}"/>
<!-- rtp inactivity timeout -->
<param name="rtp-timeout-sec" value="300"/>
<param name="rtp-hold-timeout-sec" value="1800"/>
<!--all inbound reg will look in this domain for the users -->
<param name="force-register-domain" value="$${domain}"/>
<!--force the domain in subscriptions to this value -->
<param name="force-subscription-domain" value="$${domain}"/>
<!--all inbound reg will stored in the db using this domain -->
<param name="force-register-db-domain" value="$${domain}"/>
<!-- for sip over websocket support -->
<param name="ws-binding" value=":5066"/>
<!-- for sip over secure websocket support -->
<!-- You need wss.pem in $${certs_dir} for wss or one will be created for you -->
<param name="wss-binding" value=":7443"/>
<param name="challenge-realm" value="auto_from"/>
</settings>
</profile>
- aggressive-nat-detection:对SIP包进行深度NAT检测,以决定使用那个IP地址。
- apply-inbound-acl:SIP来话的ACL鉴权方式。
- apply-nat-acl:处理SIP包NAT的ACL鉴权方式。nat.auto为使用RFC1918规定的私网地址并去掉本地网络的地址来替换Contact信息。
- auth-calls:是否对来话进行鉴权。即所有从该Profile进来的INVITE请求都需要经过Digest验证。
- codec-prefs:来话和去话支持的媒体编码列表。
- context:来话进入Dialplan中哪个Context进行路由。本地用户设置的user_context的优先级更高。
- dialplan:Dialplan类型。
- disable-rtp-auto-adjust:是否禁用RTP自动调整。
- dtmf-type:DTMF类型。inband为使用带内DTMF,info为使用SIP的INFO消息。
- enable-100rel:是否 在收到183消息时发送PRACK证实消息。
- ext-rtp-ip:NAT环境中公网的RTP IP。该设置会影响SDP中的IP。可为:IP地址(直接指定公网IP)、autonat:IP地址(直接指定公网IP,更智能)、stun:STUN服务器地址(使用STUN服务器获取公网IP)、host:域名(通过DNS域名解析获取公网IP)、auto(自动检测公网IP)、auto-nat(如路由器支持NAT-PMP或uPnP,则自动使用这些协议获取公网IP)。
- ext-sip-ip:NAT环境中公网的SIP IP。该设置会影响SDP中的IP。可为:IP地址(直接指定公网IP)、autonat:IP地址(直接指定公网IP,更智能)、stun:STUN服务器地址(使用STUN服务器获取公网IP)、host:域名(通过DNS域名解析获取公网IP)、auto(自动检测公网IP)、auto-nat(如路由器支持NAT-PMP或uPnP,则自动使用这些协议获取公网IP)。
- force-register-db-domain:强制注册使用此域存储在数据库中。可删除。
- force-register-domain:强制注册使用此域。可删除。
- force-subscription-domain:强制订阅使用此域。可删除。
- inbound-codec-prefs:来话支持的媒体编码列表。
- inbound-bypass-media:来话是否启用媒体绕过模式。
- inbound-late-negotiation:是否使用晚协商。
- manage-presence:是否启用列席。
- manage-shared-appearence:是否启用共享线路呈现。
- media-option:媒体选项。为resume-media-on-hold表示,如果FreeSWITCH处于媒体绕过状态,当话机按下Hold键时,FreeSWITCH将回到有媒体的状态。为bypass-media-after-att-xfer表示,如在执行出席转移前处于媒体绕过状态,转接执行时通过re-INVITE要回媒体,等到转接结束后再回到媒体绕过状态。
- NDLB-force-rport:是否使用NDLB配置启用rport参数支持。
- odbc-dsn:数据库ODBC的DSN。格式为:[odbc://]NAME:[USERNAME]:[PASSWORD]。
- outbound-codec-prefs:去话支持的媒体编码列表。
- rtp-ip:RTP的IP地址。
- sip-capture:是否使用Homer方式进行抓包。
- sip-ip:SIP的IP地址。
- sip-port:该Profile监听的SIP端口。
- track-calls:是否将通话的当前状态实时写到数据库中。
8308

被折叠的 条评论
为什么被折叠?



