RTP 時鐘名稱
<param name="rtp-ip" value="$${local_ip_v4}"/>
RTP 的 IP 地址,僅支持 IP 地址而不支持域名。雖然 RTP 標(biāo)準(zhǔn)說應(yīng)該域名,但實際情況是域名解析有時不可靠。
<param name="sip-ip" value="$${local_ip_v4}"/>
SIP 的 IP。不支持域名。
<param name="hold-music" value="$${hold_music}"/>
UA 進(jìn)行 hold 狀態(tài)時默認(rèn)播放的音樂。
<param name="apply-nat-acl" value="nat.auto"/>
使用哪個 NAT ACL。
<!-- <param name="extended-info-parsing" value="true"/> -->
擴(kuò)展 INFO 解析支持。
<!--<param name="aggressive-nat-detection" value="true"/>-->
NAT穿越,檢測 SIP 消息中的 IP 地址與實際的 IP 地址是否相符,詳見 NAT穿越。
<!--
There are known issues (asserts and segfaults) when 100rel is enabled.
It is not recommended to enable 100rel at this time.
-->
<!--<param name="enable-100rel" value="true"/>-->
該功能暫時還不推薦使用。
<!--<param name="enable-compact-headers" value="true"/>-->
支持壓縮 SIP 頭。
<!--<param name="enable-timer" value="false"/>-->
開啟、關(guān)閉 SIP 時鐘。
<!--<param name="minimum-session-expires" value="120"/>-->
SIP 會話超時值,在 SIP 消息中設(shè)置 Min-SE。
<param name="apply-inbound-acl" value="domains"/>
對來話采用哪個 ACL。詳見 ACL。
<param name="local-network-acl" value="localnet.auto"/>
默認(rèn)情況下,F(xiàn)reeSWITCH 會自動檢測本地網(wǎng)絡(luò),并創(chuàng)建一條 localnet.auto ACL 規(guī)則。
<!--<param name="apply-register-acl" value="domains"/>-->
對注冊請求采用哪個 ACL。
<!--<param name="dtmf-type" value="info"/>-->
DTMF 收號的類型。有三種方式,info、inband、rfc2833。
info 方式是采用 SIP 的 INFO 消息傳送 DTMF 按鍵信息的,由于 SIP 和 RTP 是分開走的,所以,可能會造成不同步。
inband 是在 RTP 包中象普通語音數(shù)據(jù)那樣進(jìn)行帶內(nèi)傳送,由于需要對所有包進(jìn)行鑒別和提取,需要占用更多的資源。
rfc2833 也是在帶內(nèi)傳送,但它的 RTP 包有特殊的標(biāo)記,因而比 inband 方式節(jié)省資源。它是在 RFC2833 中定義的。
<!-- 'true' means every time 'first-only' means on the first register -->
<!--<param name="send-message-query-on-register" value="true"/>-->
如何發(fā)送請求消息。true 是每次都發(fā)送,而 first-only 只是首次注冊時發(fā)送。
<!--<param name="caller-id-type" value="rpid|pid|none"/>-->
設(shè)置來電顯示的類型,rpid 將會在 SIP 消息中設(shè)置 Remote-Party-ID,而 pid 則會設(shè)置 P-*-Identity,如果不需要這些,可以設(shè)置成 none。
<param name="record-path" value="$${recordings_dir}"/>
錄音文件的默認(rèn)存放路徑。
<param name="record-template" value="${caller_id_number}.${target_domain}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
錄音文件名模板。
<param name="manage-presence" value="true"/>
是否支持列席。
<!--<param name="manage-shared-appearance" value="true"/>-->
是否支持 SLA - Shared Line Apperance。
<!--<param name="dbname" value="share_presence"/>-->
<!--<param name="presence-hosts" value="$${domain}"/>-->
這兩個參數(shù)用以在多個 profile 間共享列席信息。
<!-- This setting is for AAL2 bitpacking on G726 -->
<!-- <param name="bitpacking" value="aal2"/> -->
<!--<param name="max-proceeding" value="1000"/>-->
最大的開放對話(SIP Dialog)數(shù)。
<!--session timers for all call to expire after the specified seconds -->
<!--<param name="session-timeout" value="120"/>-->
會話超時時間。
<!-- Can be 'true' or 'contact' -->
<!--<param name="multiple-registrations" value="contact"/>-->
是否支持多點(diǎn)注冊,可以是 contact 或 true。開啟多點(diǎn)注冊后多個 UA 可以注冊上來,有人呼叫這些 UA 時所有 UA 都會振鈴。
<!--set to 'greedy' if you want your codec list to take precedence -->
<param name="inbound-codec-negotiation" value="generous"/>
SDP 中的語音編協(xié)商,如果設(shè)成 greedy,則自己提供的語音編碼列表會有優(yōu)先權(quán).
<!-- if you want to send any special bind params of your own -->
<!--<param name="bind-params" value="transport=udp"/>-->
<!--<param name="unregister-on-options-fail" value="true"/>-->
為了 NAT 穿越或 keep alive,如果 FreeSWITCH 向其它網(wǎng)關(guān)注冊時,可以周期性地發(fā)一些 OPTIONS 包,相當(dāng)于 ping 功能。該參數(shù)說明當(dāng) ping 失敗時是否自動取消注冊。
<param name="tls" value="$${internal_ssl_enable}"/>
是否支持 TLS,默認(rèn)否。
<!-- 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="$${internal_ssl_dir}"/>
<!-- TLS version ("sslv23" (default), "tlsv1"). NOTE: Phones may not work with TLSv1 -->
<param name="tls-version" value="$${sip_tls_version}"/>
下面都是與 TLS 有關(guān)的參數(shù),略。
<!--<param name="rtp-autoflush-during-bridge" value="false"/>-->
該選項默認(rèn)為 true。即在橋接電話是是否自動 flush 媒體數(shù)據(jù)(如果套接字上已有數(shù)據(jù)時,它會忽略定時器睡眠,能有效減少延遲)。
<!--<param name="rtp-rewrite-timestamps" value="true"/>-->
是否透傳 RTP 時間戳。
<!--<param name="pass-rfc2833" value="true"/>-->
是否透傳 RFC2833 DTMF 包。
<!--<param name="odbc-dsn" value="dsn:user:pass"/>-->
使用 ODBC 數(shù)據(jù)庫代替默認(rèn)的 SQLite。
<!--<param name="inbound-bypass-media" value="true"/>-->
將所有來電設(shè)置為媒體繞過。
<!--<param name="inbound-proxy-media" value="true"/>-->
將所有來電設(shè)置為媒體透傳。
<!--Uncomment to let calls hit the dialplan *before* you decide if the codec is ok-->
<!--<param name="inbound-late-negotiation" value="true"/>-->
對所有來電來講,晚協(xié)商有助于在協(xié)商媒體編碼之前,先前電話送到 Dialplan,因而在 Dialplan 中可以進(jìn)行個性化的媒體協(xié)商。
<!-- <param name="accept-blind-reg" value="true"/> -->
該選項允許任何電話注冊,而不檢查用戶和密碼及其它設(shè)置。
<!-- <param name="accept-blind-auth" value="true"/> -->
與上一條類似,該選項允許任何電話通過認(rèn)證。
<!-- <param name="suppress-cng" value="true"/> -->
抑制 CNG。
<param name="nonce-ttl" value="60"/>
SIP 認(rèn)證中 nonce 的生存時間。
<!--<param name="disable-transcoding" value="true"/>-->
禁止譯碼,如果該項為 true 則在 bridge 其它電話時,只提供與 a-leg 兼容或相同的語音編碼列表進(jìn)行協(xié)商,以避免譯碼。
<!--<param name="manual-redirect" value="true"/> -->
允許在 Dialplan 中進(jìn)行人工轉(zhuǎn)向。
<!--<param name="disable-transfer" value="true"/> -->
禁止轉(zhuǎn)移。
<!--<param name="disable-register" value="true"/> -->
禁止注冊。
<!-- Used for when phones respond to a challenged ACK with method INVITE in the hash -->
<!--<param name="NDLB-broken-auth-hash" value="true"/>-->
<!-- add a ;received="<ip>:<port>" to the contact when replying to register for nat handling -->
<!--<param name="NDLB-received-in-nat-reg-contact" value="true"/>-->
<param name="auth-calls" value="$${internal_auth_calls}"/>
是否對電話進(jìn)行認(rèn)證。
<!-- Force the user and auth-user to match. -->
<param name="inbound-reg-force-matching-username" value="true"/>
強(qiáng)制用戶與認(rèn)證用戶必須相同。
<param name="auth-all-packets" value="false"/>
在認(rèn)證時,對所有 SIP 消息都進(jìn)行認(rèn)證,而不是僅針對 INVITE 消息。
<!-- external_sip_ip
Used as the public IP address for SDP.
Can be an one of:
ip address - "12.34.56.78"
a stun server lookup - "stun:stun.server.com"
a DNS name - "host:host.server.com"
auto - Use guessed ip.
auto-nat - Use ip learned from NAT-PMP or UPNP
-->
<param name="ext-rtp-ip" value="auto-nat"/>
<param name="ext-sip-ip" value="auto-nat"/>
設(shè)置 NAT 環(huán)境中公網(wǎng)的 RTP IP。該設(shè)置會影響 SDP 中的 IP 地址。有以下幾種可能:
一個IP 地址,如 12.34.56.78
一個 stun 服務(wù)器,它會使用 stun 協(xié)議獲得公網(wǎng) IP, 如 stun:stun.server.com
一個 DNS 名稱,如 host:host.server.com
auto , 它會自動檢測 IP 地址
auto-nat,如果路由器支持 NAT-PMP 或 UPNP,則可以使用這些協(xié)議獲取公網(wǎng) IP。
<param name="rtp-timeout-sec" value="300"/>
指定的時間內(nèi) RTP 沒有數(shù)據(jù)傳送,則掛機(jī)。
<param name="rtp-hold-timeout-sec" value="1800"/>
RTP 處理保持狀態(tài)的最大時長。
<!-- <param name="vad" value="in"/> -->
<!-- <param name="vad" value="out"/> -->
<!-- <param name="vad" value="both"/> -->
語音活動狀態(tài)檢測,有三種可能,可設(shè)為入、出,或雙向,通常來說“出”(out)是一個比較好的選擇。
<!--<param name="alias" value="sip:10.0.1.251:5555"/>-->
給本 sip profile 設(shè)置別名。
<!--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}"/>
<!--force suscription expires to a lower value than requested-->
<!--<param name="force-subscription-expires" value="60"/>-->
以上選項默認(rèn)是起作用的,這有助于默認(rèn)的例子更好的工作。它們會在注冊及訂閱時在數(shù)據(jù)庫中寫入同樣的域信息。如果你在使用一個 FreeSWITCH 支持多個域時,不要選這些選項。
<!--<param name="enable-3pcc" value="true"/>-->
該選項有兩個值,true 或 poxy。 true 則直接接受 3pcc 來電;如果選 proxy,則會一直等待電話應(yīng)答后才回送接受。
<!-- use at your own risk or if you know what this does.-->
<!--<param name="NDLB-force-rport" value="true"/>-->
在 NAT 時強(qiáng)制 rport。除非你很了解該參數(shù),否則后果自負(fù)。
<param name="challenge-realm" value="auto_from"/>
設(shè)置 SIP Challenge 是使用的 realm 字段是從哪個域獲取,auto_from 和 auto_to 分別是從 from 和 to 中獲取,除了這兩者,也可以是任意的值,如 freeswitch.org.cn。
<!--<param name="disable-rtp-auto-adjust" value="true"/>-->
大多數(shù)情況下,為了更好的穿越 NAT,F(xiàn)reeSWITCH 會自動調(diào)整 RTP 包的 IP 地址,但在某些情況下(尤其是在 mod_dingaling 中會有多個候選 IP),F(xiàn)reeSWITCH 可能會改變本來正確的 IP 地址。該參數(shù)禁用此功能。
<!--<param name="inbound-use-callid-as-uuid" value="true"/>-->
在 FreeSWITCH 是,每一個 Channel 都有一個 UUID, 該 UUID 是由系統(tǒng)生成的全局唯一的。對于來話,你可以使用 SIP 中的 callid 字段來做 UUID. 在某些情況下對于信令的跟蹤分析比較有用。
<!--<param name="outbound-use-uuid-as-callid" value="true"/>-->
與上一個參數(shù)差不多,只是在去話時可以使用 UUID 作為 callid。
<!--<param name="rtp-autofix-timing" value="false"/>-->
RTP 自動定時。如果語音質(zhì)量有問題,可以嘗試將該值設(shè)成 false。
<!--<param name="pass-callee-id" value="false"/>-->
默認(rèn)情況下 FreeSWITCH 會設(shè)置額外的 X- SIP 消息頭,在 SIP 標(biāo)準(zhǔn)中,所有 X- 打頭的消息頭都是應(yīng)該忽略的。但并不是所有的實現(xiàn)都符合標(biāo)準(zhǔn),所以在對方的網(wǎng)關(guān)不支持這種 SIP 頭時,該選項允許你關(guān)掉它。
<!-- clear clears them all or supply the name to add or the name prefixed with ~ to remove
valid values:
clear
CISCO_SKIP_MARK_BIT_2833
SONUS_SEND_INVALID_TIMESTAMP_2833
-->
<!--<param name="auto-rtp-bugs" data="clear"/>-->
某些運(yùn)營商的設(shè)備不符合標(biāo)準(zhǔn)。為了最大限度的支持這些設(shè)備,F(xiàn)reeSWITCH 在這方面進(jìn)行了妥協(xié)。使用該參數(shù)時要小心。
<!-- the following can be used as workaround with bogus SRV/NAPTR records -->
<!--<param name="disable-srv" value="false" />-->
<!--<param name="disable-naptr" value="false" />-->
這兩個參數(shù)可以規(guī)避 DNS 中某些錯誤的 SRV 或 NAPTR 記錄。
最后的這幾個參數(shù)允許根據(jù)需要調(diào)整 sofia 庫中底層的時鐘,一般情況下不需要改動。
<!-- The following can be used to fine-tune timers within sofia's transport layer
Those settings are for advanced users and can safely be left as-is -->
<!-- Initial retransmission interval (in milliseconds).
Set the T1 retransmission interval used by the SIP transaction engine.
The T1 is the initial duration used by request retransmission timers A and E (UDP) as well as response retransmission timer G. -->
<!-- <param name="timer-T1" value="500" /> -->
<!-- Transaction timeout (defaults to T1 * 64).
Set the T1x64 timeout value used by the SIP transaction engine.
The T1x64 is duration used for timers B, F, H, and J (UDP) by the SIP transaction engine.
The timeout value T1x64 can be adjusted separately from the initial retransmission interval T1. -->
<!-- <param name="timer-T1X64" value="32000" /> -->
<!-- Maximum retransmission interval (in milliseconds).
Set the maximum retransmission interval used by the SIP transaction engine.
The T2 is the maximum duration used for the timers E (UDP) and G by the SIP transaction engine.
Note that the timer A is not capped by T2. Retransmission interval of INVITE requests grows exponentially
until the timer B fires. -->
<!-- <param name="timer-T2" value="4000" /> -->
<!--
Transaction lifetime (in milliseconds).
Set the lifetime for completed transactions used by the SIP transaction engine.
A completed transaction is kept around for the duration of T4 in order to catch late responses.
The T4 is the maximum duration for the messages to stay in the network and the duration of SIP timer K. -->
<!-- <param name="timer-T4" value="4000" /> -->
</settings>
</profile>
external.xml
它是另一個 UA 配置文件,它默認(rèn)使用端口 5080。你可以看到,大部分參數(shù)都與 internal.xml 相同。最大的不同是 auth-calls 參數(shù)。在 internal.xml 中,auth-calls 默認(rèn)是 true;而在 external.xml 中,默認(rèn)是 false。也就是說,發(fā)往 5060 端口的 SIP 消息(一般只有 INVITE 消息)需要認(rèn)證,而發(fā)往 5080 的消息則不需要認(rèn)證。我們一般把本地用戶都注冊到 5060 上,所以,它們打電話時要經(jīng)過認(rèn)證,保證只有在們用戶 directory 中配置的用戶能打電話。而 5080 則不同,任何人均可以向該端口發(fā)送 SIP 請求。