- 信道变量(Channel Variables)
- INFO应用中的变量名
- ${variable}和 $${variable}的区别
- CDR相关的变量
- 挂断原因相关的变量:
- DTMF相关的变量:
- 媒体处理相关的变量
- 超时相关的变量
- 保持音乐相关的
- 语言相关的:
- 桥接相关的:
- api_after_bridge
- auto_hunt
- bridge_early_media
- bridge_filter_dtmf
- bridge_terminate_key
- continue_on_fail
- transfer_on_fail
- enable_file_write_buffering
- failure_causes
- force_transfer_context
- force_transfer_diaplan
- hangup_after_bridge
- hold_hangup_xfer_exten
- last_bridge_to
- loopback_bowout_on_execute
- loopback_export
- outbound_redirect_fatal
- originate_timeout
- park_after_bridge
- signal_bond
- no_throttle_limits
- rtp_jitter_buffer_during_bridge
- uuid_bridge_continue_on_cancel
- 会议相关的变量:
- conference_auto_outcall_announce
- conference_auto_outcall_caller_id_name
- conference_auto_outcall_caller_id_number
- conference_auto_outcall_flags
- conference_auto_outcall_prefix
- conference_auto_outcall_timeout
- conference_auto_outcall_maxwait
- conference_controls
- conference_enter_sound
- conference_last_matching_digits
- last_transferred_conference
- conference_member_id
- conference_uuid
- hangup_after_conference
- 代码执行相关的变量:
- api_hangup_hook
- bridge_pre_execure_aleg_app
- bridge_pre_execute_aleg_data
- bridge_pre_execute_bleg_app
- bridge_pre_execute_bleg_data
- exec_after_bridge_app
- exec_after_bridge_arg
- origination_nested_vars
- execute_on家族
- execute_on_answer
- execute_on_media
- execute_on_media_timeout
- execute_on_pre_answer
- execute_on_ring
- execute_on_sip_reinvite
- api_on族的相关变量:
- 主叫ID相关的变量:
- 被叫ID相关的变量:
- 呼叫记录相关的变量
- 编码相关的变量:
- IVR(交互式语音应答系统)相关的变量
- SIP相关的变量
- rtp_disable_hold
- sip_acl_authed_by
- sip_acl_token
- sip_copy_multipart
- sip_invite_params
- sip_invite_domain
- sip_from_display
- sip_invite_from_params
- sip_invite_to_params
- sip_invite_contact_params
- sip_invite_tel_params
- sip_network_destination
- sip_auth_username
- sip_auth_password
- sip_auth_simplify
- sip_force_audio_fmtp
- sip_invite_req_uri
- sip_invite_record_toute
- sip_invite_route_uri
- sip_invite_full_from
- sip_invite_full_to
- sip_handle_full_from
- sip_handle_full_to
- sip_force_full_from
- sip_force_full_to
- sip_recover_contact
- sip_recover_via
- sip_invite_from_uri
- sip_invite_to_uri
- sip_ignore_reinvites
- sip_has_crypto
- rtp_sdes_suites
- rtp_secure_media
- rtp_secure_media_inbound
- rtp_secure_media_outbound
- sip_wait_for_aleg_ack
- timer_name
- deny_refer_requests
- SDP操作相关的变量
- FIFO相关的变量:
- 播放(playback)相关的变量:
- 呼叫(Originate)相关的变量
- RTP/媒体相关的变量
- RTCP相关的变量
- 呼叫保留(Camp-on)相关的变量
- 应答确认相关的变量
- 语音信箱相关变量
- 事件相关的变量
- 系统相关的变量
- OpenZap相关的变量
fs中dialplan中的condition变量可以是channel变量、内置变量
内置变量有:
The following variables, called ‘caller profile fields’, can be accessed from condition statements directly:
- context Why can we use the context as a field? Give us examples of usages please.
- rdnis Redirected Number, the directory number to which the call was last presented.
- destination_number Called Number, the number this call is trying to reach (within a given context)
- dialplan Name of the dialplan module that are used, the name is provided by each dialplan module. Example: XML
- caller_id_name Name of the caller (provided by the User Agent that has called us).
- caller_id_number Directory Number of the party who called (caller) — can be masked (hidden)
- ani Automatic Number Identification, the number of the calling party (caller) — cannot be masked
- aniii The type of device placing the call ANI2
- uuid Unique identifier of the current call? (looks like a GUID)
- source Name of the FreeSWITCH module that received the call (e.g. PortAudio)
- chan_name Name of the current channel (Example: PortAudio/1234). Give us examples when this one can be used.
- network_addr IP address of the signaling source for a VoIP call.
- year Calendar year, 0-9999
- yday Day of year, 1-366
- mon Month, 1-12 (Jan = 1, etc.)
- mday Day of month, 1-31
- week Week of year, 1-53
- mweek Week of month, 1-6
- wday Day of week, 1-7 (Sun = 1, Mon = 2, etc.) or “sun”, “mon”, “tue”, etc.
- hour Hour, 0-23
- minute Minute (of the hour), 0-59
- minute-of-day Minute of the day, (1-1440) (midnight = 1, 1am = 60, noon = 720, etc.)
- time-of-day Time range formatted: hh:mm[:ss]-hh:mm[:ss] (seconds optional) Example: “08:00-17:00”
- date-time Date/time range formatted: YYYY-MM-DD hh:mm[:ss]~YYYY-MM-DD hh:mm[:ss] (seconds optional, note tilde between dates) Example: 2010-10-01 00:00:01~2010-10-15 23:59:59
信道变量(Channel Variables)
简介:信道变量是一种局部变量,作用范围为整个会话期(session)。根据局部变量的定义,可以在一个应用(APP)执行期间设置信道变量。该信道(channel)中的其他应用也可以使用这些变量。
不同符号在拨号串中的信道变量中的含义:
{foo=bar} | 仅用在拨号串的开始位置有效,它将会在所有信道中设置相同名字的变量,但是在bridge/originate中无效 |
---|---|
仅用在拨号串的开始位置有效,它将会在所有信道中设置相同名字的变量,包括bridge/originate | |
[foo=bar] | 在拨号串之前即有效,但仅在当前信道中有效 |
以下设置中,chan=1仅对blah有效,chan=2仅对blah2有效,foo-bar对两者都有效
{foo=bar}[chan=1]sofia/default/blah@baz.com,[chan=2]sofia/default/blah2@baz.com |
---|
多个变量的设置可以用逗号隔开
[var1=abc,var2=def,var3=ghi]sofia/default/blah@baz.com |
---|
如果想要用[]覆盖{}中的某个变量,可以在{}中设置“local_var_clobber=true”即可
{local_var_clobber=true,rtp_secure_media=true}sofia/default/blah1@baz.com|sofia/default/johndoe@example.com|[rtp_secure_media=false]sofia/default/janedoe@acme.com |
---|
当你想覆盖拨号计划中的由其他地方导入b-legs的变量时,你就必须设置{local_var_clobber=true}
在上述例子中,blah1@baz.com和johndeo@example的legs将提供SRTP(RTP/SAVP)服务,但是janedoe@acme.com不会收到接收到SRTP(但是会接收到RTP/AVP)
多个变量中的逗号——延伸阅读
因为在{}和[]中,默认的分割符为逗号,但是如果参数中带逗号应该如何处理呢?当然FreeSwitch可以设置不同的变量间隔符。
语法前面添加一个前缀”^^”,就可以将分隔符“,”替换成冒号“:”。这样参数中的逗号将不再被解释成分隔符了。
当然也可以用其他分割符,但是开头必须要有“^^”。,例如
absolute_codec_string=^^:PCMA@8000h@20i@64000b:PCMU@8000h@20i@64000b:G729@8000h@20i@8000b,leg_time_out=10,process_cdr=b_only} |
---|
当设置开头带有siph,sip_rh,sip_ph的变量时以上方法将不再适用。如果想在文本中传递一个逗号,可以通过转义的形式来设置,例如
{sip_h_X-My-Header=one\,two\,three,leg_time_out=10,process_cdr=b_only} |
---|
在桥接(bridge)操作中导出信道变量:
可以用过”export_vars”将变量从a-legs导到b-leg,多个变量要用逗号“,”隔开,例如:
当然,也可以在a-leg上通过”export”一步导出:
普通的信道变量:
可通过“set”来设置信道变量。当然也可以记录到呼叫详情单(CDR)中。可以在XML-RFC中设信道变量,当然可以可以通过事件套接字来设置,例如:
originate {ignore_early_media=true}sofia/mydomain.com/18005551212@1.2.3.4 15555551212 |
---|
如果值中有空格,可以用引号来标注起来:
originate {fax_ident=1231231234,fax_header=’Fax Test’}sofia/gateway/outbound.fax/1004 &txfax(/tmp/fax.tiff) |
---|
以下是一些变量设置的示例
<!—在当前信道中设置变量 —> <!—在当前信道中设置变量,并导出到桥接对象的信道中(b-leg)—> <!—仅在给定的信道中设置新变量—> |
---|
在其他环境中访问信道变量
C环境下:
switch_channel_set_variable(channel,”name”,”value”); char result = switch_channel_get_variable(channel,”name”); char result = switch_channel_get_variable_partner(channel,”name”); |
---|
命令行环境下:
uid_getvar <uuid> <name> uuid_setvar <uuid> <name> [<value>] uuid_setvar_multi <uuid> <name>=<value>[;<name>=<value>[;...]] |
---|
当然,也可以使用uuiddump获得信道中的所有变量。也可以使用eval命令,通过添加variable前缀获得特定的变量,使用方法如下:
uuiddump |
---|
在事件套接字中,需要在所有命令前面添加api前缀:
api uuid_getvar |
---|
在LUA脚本中,有多种方式跟这些变量交互。通过freeswitch.Session()创建一个Session对象,变量将存储在方括号中:
s = freeswitch.Session(“[myname=myvars]sofia/localhost/1003”); |
---|
有个Session对象后,可以通过以下方法存取变量:
result = session:getVariable(“name”); session:setVariable(“name”,”value”); |
---|
这些变量实际上是属于session中的信道对象(channel object),但是由于存在一对一的绑定,LUA脚本把session和channel当成一个整体。
INFO应用中的变量名
一些info的变量,可能带有类似variable_的前缀。例如,你传递一个叫”type”的变量给代理服务器,在FreeSWITCH中就变成了“variable_sip_h_type”。以下为变量对应表:
Info 变量名 | 信道变量名 | 描述 |
---|---|---|
Channel-State | state | 当前呼叫状态 |
Channel-State-Number | state_number | 整型 |
Channel-Name | channel_name | 信道名 |
Unique-ID | uuid | 当前信道leg的uuid |
Call-Direction | direction | Inbound模式或者Outbound模式 |
Answer-State | state | 应答状态 |
Channel-Read-Codec-Name | read_codec | 读取编码名 |
Channel-Read-Codec-Rate | read_rate | 读取编码采样率 |
Channel-Write-Codec-Name | write_codec | 目标编码名称 |
Channel-Write-Codec-Rate | write_rate | 目标编码采样率 |
Caller-Username | username | 主叫用户名 |
Caller-Dialplan | dialplan | 使用的dialplan,如xml, lua, enum, lcr |
Caller-Caller-ID-Name | caller_id_name | . |
Caller-Caller-ID-Number | caller_id_number | . |
Caller-ANI | ani | 主叫的ANI, 通常于呼叫ID号一致 |
Caller-ANI-II | aniii | 主叫ANI II |
Caller-Network-Addr | network_addr | 主叫的IP地址 |
Caller-Destination-Number | destination_number | 被叫号码 |
Caller-Unique-ID | uuid | 当前信道的uuid |
Caller-Source | source | 源模块,如mod_sofia, mod_openzap等等 |
Caller-Context | context | Dialplan内容 |
Caller-RDNIS | rdnis | Redirected DNIS info. See transfer application |
Caller-Channel-Name | channel_name | . |
Caller-Profile-Index | profile_index | . |
Caller-Channel-Created-Time | created_time | . |
Caller-Channel-Answered-Time | answered_time | . |
Caller-Channel-Hangup-Time | hangup_time | . |
Caller-Channel-Transfer-Time | transfer_time | . |
Caller-Screen-Bit | screen_bit | . |
Caller-Privacy-Hide-Name | privacy_hide_name | . |
Caller-Privacy-Hide-Number | privacy_hide_number | inbound模式下呼叫是否请求CLIR(主叫线路识别限制) (或是匿名anonymous模式, Privacy:id模式) |
initial_callee_id_name | Sets the callee id name during the 183. This allows the phone to see a name of who they are calling prior to the phone being answered. An example of setting this to the caller id name of the number being dialled: |
|
variable_sip_received_ip | sip_received_ip | . |
variable_sip_received_port | sip_received_port | . |
variable_sip_authorized | sip_authorized | . |
variable_sip_mailbox | sip_mailbox | . |
variable_sip_auth_username | sip_auth_username | . |
variable_sip_auth_realm | sip_auth_realm | . |
variable_mailbox | mailbox | . |
variable_user_name | user_name | . |
variable_domain_name | domain_name | . |
variable_record_stereo | record_stereo | . |
variable_accountcode | accountcode | 本次呼叫的呼叫代号。这是一个任意值,可以在directory的用户变量中定义,或者在dialplan中被设置或者修改。呼叫代号可能被用于CDR CSV的模板中 |
variable_user_context | user_context | . |
variable_effective_caller_id_name | effective_caller_id_name | . |
variable_effective_caller_id_number | effective_caller_id_number | . |
variable_caller_domain | caller_domain | . |
variable_sip_from_user | sip_from_user | . |
variable_sip_from_uri | sip_from_uri | . |
variable_sip_from_host | sip_from_host | . |
variable_sip_from_user_stripped | sip_from_user_stripped | . |
variable_sip_from_tag | sip_from_tag | . |
variable_sofia_profile_name | sofia_profile_name | . |
variable_sofia_profile_domain_name | sofia_profile_domain_name | . |
variable_sip_full_route | sip_full_route | Route: header的全部内容 |
variable_sip_full_via | sip_full_via | Via: header的全部内容 |
variable_sip_full_from | sip_full_from | From: header的全部内容 |
variable_sip_full_to | sip_full_to | To: header的全部内容 |
variable_sip_req_params | sip_req_params | . |
variable_sip_req_user | sip_req_user | . |
variable_sip_req_uri | sip_req_uri | . |
variable_sip_req_host | sip_req_host | . |
variable_sip_to_params | sip_to_params | . |
variable_sip_to_tag | sip_to_tag | . |
variable_sip_to_user | sip_to_user | . |
variable_sip_to_uri | sip_to_uri | . |
variable_sip_to_host | sip_to_host | . |
variable_sip_contact_params | sip_contact_params | . |
variable_sip_contact_user | sip_contact_user | . |
variable_sip_contact_port | sip_contact_port | . |
variable_sip_contact_uri | sip_contact_uri | . |
variable_sip_contact_host | sip_contact_host | . |
variable_sip_invite_domain | sip_invite_domain | . |
variable_channel_name | channel_name | . |
variable_sip_call_id | sip_call_id | . |
variable_sip_user_agent | sip_user_agent | . |
variable_sip_via_host | sip_via_host | . |
variable_sip_via_port | sip_via_port | . |
variable_sip_via_rport | sip_via_rport | . |
variable_presence_id | presence_id | . |
variable_sip_h_P-Key-Flags | sip_h_p-key-flags | 包含可选项P-Key-Flags header(s),可能从呼叫终端中接收 |
variable_switch_r_sdp | switch_r_sdp | 从呼叫终端接收到的完整的SDP |
variable_remote_media_ip | remote_media_ip | . |
variable_remote_media_port | remote_media_port | . |
variable_write_codec | write_codec | . |
variable_write_rate | write_rate | . |
variable_endpoint_disposition | endpoint_disposition | . |
variable_dialed_ext | dialed_ext | . |
variable_transfer_ringback | transfer_ringback | . |
variable_call_timeout | call_timeout | . |
variable_hangup_after_bridge | hangup_after_bridge | . |
variable_continue_on_fail | continue_on_fail | . |
variable_dialed_user | dialed_user | . |
variable_dialed_domain | dialed_domain | . |
variable_sip_redirect_contact_user_0 | sip_redirect_contact_user_0 | . |
variable_sip_redirect_contact_host_0 | sip_redirect_contact_host_0 | . |
variable_sip_h_Referred-By | sip_h_referred-by | . |
variable_sip_refer_to | sip_refer_to | 从 SIP Refer-To: response接收到的SIP URI |
variable_max_forwards | max_forwards | . |
variable_originate_disposition | originate_disposition | . |
variable_read_codec | read_codec | . |
variable_read_rate | read_rate | . |
variable_open | open | . |
variable_use_profile | use_profile | . |
variable_current_application | current_application | . |
variable_ep_codec_string | ep_codec_string | 该变量仅在配置文件激活晚协商(late negotiation)的情况下有效。该变量可以被呼叫终端读取,包含了所有的可用编码。dialplan也能很好的解析它 |
variable_rtp_disable_hold | rtp_disable_hold | 该变量被设置后,将禁止接(hold)电话功能 |
variable_sip_acl_authed_by | sip_acl_authed_by | 显示 ACL允许的呼叫规则 |
variable_curl_response_data | curl_response_data | 保存最后一次curl操作的输出 |
variable_drop_dtmf | drop_dtmf | 关闭信道的DTMF事件 |
variable_drop_dtmf_masking_file | drop_dtmf_masking_file | 如果DTMF被关闭了(值为true),当收到每个音键将播放一个特定的音乐 |
variable_drop_dtmf_masking_digits | drop_dtmf_masking_digits | If drop_dtmf is true play specified tone for every tone received. |
sip_codec_negotiation | sip_codec_negotiation | sip_codec_negotiation is basically a channel variable equivalent of inbound-codec-negotiation. sip_codec_negotiation accepts “scrooge” & “greedy” as values. This means you can change codec negotiation on a per call basis. |
Caller-Callee-ID-Name | - | - |
Caller-Callee-ID-Number | - | - |
Caller-Channel-Progress-Media-Time | - | - |
Caller-Channel-Progress-Time | - | - |
Caller-Direction | - | - |
Caller-Profile-Created-Time | profile_created | - |
Caller-Transfer-Source | - | - |
Channel-Call-State | - | - |
Channel-Call-UUID | - | - |
Channel-HIT-Dialplan | - | - |
Channel-Read-Codec-Bit-Rate | - | - |
Channel-Write-Codec-Bit-Rate | - | - |
Core-UUID | - | - |
Event-Calling-File | - | - |
Event-Calling-Function | - | - |
Event-Calling-Line-Number | - | - |
Event-Date-GMT | - | - |
Event-Date-Local | - | - |
Event-Date-Timestamp | - | - |
Event-Name | - | - |
Event-Sequence | - | - |
FreeSWITCH-Hostname | - | - |
FreeSWITCH-IPv4 | - | - |
FreeSWITCH-IPv6 | - | - |
FreeSWITCH-Switchname | - | - |
Hunt-ANI | - | - |
Hunt-Callee-ID-Name | - | - |
Hunt-Callee-ID-Number | - | - |
Hunt-Caller-ID-Name | - | - |
Hunt-Caller-ID-Number | - | - |
Hunt-Channel-Answered-Time | - | - |
Hunt-Channel-Created-Time | - | - |
Hunt-Channel-Hangup-Time | - | - |
Hunt-Channel-Name | - | - |
Hunt-Channel-Progress-Media-Time | - | - |
Hunt-Channel-Progress-Time | - | - |
Hunt-Channel-Transfer-Time | - | - |
Hunt-Context | - | - |
Hunt-Destination-Number | - | - |
Hunt-Dialplan | - | - |
Hunt-Direction | - | - |
Hunt-Network-Addr | - | - |
Hunt-Privacy-Hide-Name | - | - |
Hunt-Privacy-Hide-Number | - | - |
Hunt-Profile-Created-Time | profile_created | - |
Hunt-Profile-Index | - | - |
Hunt-RDNIS | - | - |
Hunt-Screen-Bit | - | - |
Hunt-Source | - | - |
Hunt-Transfer-Source | - | - |
Hunt-Unique-ID | - | - |
Hunt-Username | - | - |
Presence-Call-Direction | - | - |
variable_DIALSTATUS | - | - |
variable_absolute_codec_string | - | - |
variable_advertised_media_ip | - | - |
variable_bridge_channel | - | - |
variable_bridge_hangup_cause | - | - |
variable_bridge_uuid | - | - |
variable_call_uuid | - | - |
variable_current_application_response | - | - |
variable_direction | - | - |
variable_inherit_codec | - | - |
variable_is_outbound | - | - |
variable_last_bridge_to | - | - |
variable_last_sent_callee_id_name | - | - |
variable_last_sent_callee_id_number | - | - |
variable_local_media_ip | - | - |
variable_local_media_port | - | - |
variable_number_alias | - | - |
variable_originate_early_media | - | - |
variable_originating_leg_uuid | - | - |
variable_originator | - | - |
variable_originator_codec | - | - |
variable_outbound_caller_id_number | - | - |
variable_recovery_profile_name | - | - |
variable_rtp_use_ssrc | - | - |
variable_session_id | - | - |
variable_sip_2833_recv_payload | - | - |
variable_sip_2833_send_payload | - | - |
variable_sip_P-Asserted-Identity | - | - |
variable_sip_Privacy | - | - |
variable_sip_audio_recv_pt | - | - |
variable_sip_cid_type | - | - |
variable_sip_cseq | - | - |
variable_sip_destination_url | - | - |
variable_sip_from_display | sip_from_display | ‘User’ element of SIP From: line |
variable_sip_from_port | - | - |
variable_sip_gateway | - | - |
variable_sip_gateway_name | - | - |
variable_sip_h_P-Charging-Vector | - | - |
variable_sip_local_network_addr | - | - |
variable_sip_local_sdp_str | - | - |
variable_sip_network_ip | - | - |
variable_sip_network_port | - | - |
variable_sip_number_alias | - | - |
variable_sip_outgoing_contact_uri | - | - |
variable_sip_ph_P-Charging-Vector | - | - |
variable_sip_profile_name | - | - |
variable_sip_recover_contact | - | - |
variable_sip_recover_via | - | - |
variable_sip_reply_host | - | - |
variable_sip_reply_port | - | - |
variable_sip_req_port | - | - |
variable_sip_to_port | - | - |
variable_sip_use_codec_name | - | - |
variable_sip_use_codec_ptime | - | - |
variable_sip_use_codec_rate | - | - |
variable_sip_use_pt | - | - |
variable_sip_via_protocol | - | - |
variable_switch_m_sdp | - | - |
variable_transfer_history | - | - |
variable_transfer_source | - | - |
variable_uuid | - | - |
${variable}和 $${variable}的区别
${variables}:设置在dialplan、application、directory中的信道变量。
{variables}:当freeswitch.xml被编译后值将被绑定。这个绑定操作发生在启动阶段,或者是调用了reloadxml命令。
{variables}预处理后将绑定到对应的值上,不可改变。而${variables}会在每次被执行的时候更新它的值
CDR相关的变量
process_cdr
用法:
作用:说明如何执行CDR记录,这些变量为无条件导出
取值:false,true,a_only,b-only
accountcode
用法:
作用:值为任意值,可以在任意leg上分配其值。它的一个重要特性为其值必须匹配于cdr_csv.conf.xml中定义的CDR CSV模板(template)。当生成CSV CDR时CDR模板将被用到。
skip_cdr_causes
hold_event
用法:
作用:显示每个通话的起止时间
示例:
variable_hold_events: [{{1347487292379229,1347487293856872},{1347487288539686,1347487290757780}}] |
---|
transfer_to
挂断原因相关的变量:
bridge_hangup_cause
用法:
作用:设置最后一个桥接的B-leg的挂断原因。如果设置了continue_on_fail=true和hangup_after_bridge=false,可检查该变量的值检验看该呼叫到底发生了什么。也可以在执行桥接命令(bridge)后添加一个条件检查${bridge_hangup_cause}看看是否包含了MEDIA_TIMEOUT然后触发重播功能。
disable_q850_reason
用法:
作用:设置为true后,将不会发送原因包含Q.850原因码、应答、BYE的头域。
hangup_cause
用法:
作用:设置A-leg挂断的原因(要注意的是未挂断通话前不起作用)。其值通常是B-leg上的挂断原因。
hangup_cause_q850
用法:
作用:设置A-leg的挂断原因的Q850数字码(注意在通话结束前不起作用)。其值通常是B-leg上的挂断原因。
sip_hangup_disposition
用法:可以在CDR中看它的值,仅在呼叫结束后有效。
作用:该变量包含了SIP BYE发送者的信息。以下为一些XML CDRs:
proto_specific_hangup_cause
用法:
作用:当挂断电话后,该变量将强制让FreeSwitch的SIP应答绑定到一个特定的设置上。
示例:SIP的应答映射
last_bridge_hangup_cause
用法:
作用:B-leg桥接成功后的挂断原因
last_bridge_proto_specific_hangup_cause
用法:
作用:显示最后一次桥接挂断后的SIP应答码,例如”sip:404”
DTMF相关的变量:
pass_rfc2833
用法:
作用:如果设置了该值,它将传递RFC 2833的DTMF键给桥接的另一端。
注意:如果设置了bypass_media或者proxy_media,该变量将不起作用
dtmf_type
用法:
作用:用于带内DTMF,使用前必须要在Dialplan中使用start_dtmf
drop_dtmf
用法:
作用:在answer,bridge,originate前设置该变量,可防止将DTMF事件发送到channel上。仅在RFC2833上通过测试。
drop_dtmf_masking_digits
用法(每个a-leg的输入将被丢弃,然后发送d给b-leg):
用法(在b-leg上替代dtmf):
作用:如果drop_dtmf的值为true,那将为每个接收到的音调指定特定的音调
drop_dtmf_masking_file
用法:
作用:如果drop_dtmf的值为true,那么每次接收到按键时播放指定的文件
媒体处理相关的变量
monitor_early_media_fail
用法:
作用:检测早期媒体的失败条件,例如一个忙时信号。在忽略早期媒体的情况下,可以更快的处理失败的呼叫。
参数格式:
condition_name:number_of_hits:tone_detect_frequencies |
---|
参数详解:
condition_name | 用户定义的错误条件名称 |
---|---|
number_of_hits | 失败阈值,达到该阈值后即视为错误 |
tone_detect_frequencies | 监听的频率 (分隔符为+). 具体内容可见 tone_detect |
注意:该变量只有在ingore_early_media为true时才有效
monitor_early_media_ring
用法:
作用:为用户指明的铃声监听早期媒体。每次铃声响起时,交换器将增加对应LEG上的计数。一旦计数达到了变量值monitor_early_media_ring_total(或者这个变量未设置),早期媒体将被发送。
参数格式:
condition_name:number_of_hits:tone_detect_frequencies |
---|
参数说明:
condition_name | 可选项,用户定义的错误条件名称 |
---|---|
number_of_hits | 铃声阈值。 1:400.0+480.0 表示当400hz或者480Hz被监听到时增加铃声计数。2:400.0+480.0表示当400Hz和480Hz被监测到时增加铃声计数 |
tone_detect_frequencies | 监听频率分隔符为”+“例如 400.0+480.0 [美国铃声] 具体信息可见 tone_detect |
注意:该本来仅当igonore_early_media还未出现时有效
超时相关的变量
call_timeout
用法:
作用:当应用bridge生效时控制呼叫中B-LEG的响铃时长(单位:秒)。该变量设置在A-LEG上,应用于任何该信道桥接出去的信道。
如果要在一个没有A-LEG的呼叫中设置超时,可使用变量originate_timeout(默认60)
如果要在内核bridge/originate中设置超时,可使用变量originate_timeout
如果要在一条腿的基础上(区别于目标LEG),使用leg_timeout参数
默认值为60秒
leg_timeout
用法:
作用:在拨号字符串中为每条腿设置超时时间。可以用于单条腿上[],但不能以{}设置全局。如果要设置全局可使用originate_timeout。
也可以使用leg_progree_timeout来指明等待媒体(早期媒体、铃声或者应答)前的最大等待时间,避免专线的语音信箱。
如果使用了组确认可使用信道变量group_confirm_cancel_timeout来取消超时。如果已经使用了delay_start,leg_timeout将在extension被桥接后开始计时。
originate_continue_on_timeout
用法:
作用:控制超时后是否要继续桥接。默认值为false,该变量设置后将在每次超时后重置时间
park_timeout
用法:
作用:park的超时时间,单位为秒。如果未设置park将无限等待直到被uuid_transfer移除。
可以设置hangup_cause,设置如下:
保持音乐相关的
hold_music
用法:
可以将值设置为indicate_hold,那么它将会传递持有请求而不是SDP,也可以设置为:
对于多租户环境,为了有不同的保持音乐,可以如下设置
作用:每个信道上的保持音乐。支持任何音频格式或者音频流。该变量也可以在vars.xml中设置全局变量。
temp_hold_music
用法:
语言相关的:
default_language
用法:
timezone
用法:
或者
作用:设置时区。时区格式例如America/New_York,具体可以见/usr/share/zoneinfo/zone.tab。
可以在/conf/vars.xml添加,即设置全局性
或者在dialplan中设置
最后就可以在/conf/directory/default/‘extension’.xml中的extension设置了
tod_tz_offset
用法:
作用:设置GMT偏移。
可在conf/vars.xml中设置全局变量
或者在dialplan中设置
桥接相关的:
api_after_bridge
用法:
auto_hunt
用法:
作用:将其值设置为true将会改变dialplan中所有extension的正常处理队列。该变量将让dialplan跳到指定名称的extension,而不是处理其他extension,因此destination_number必须和extension的中的一样。条件必须匹配,但是extension的名称才是最关键的元素。
在下述例子中,如果没有auto_hunt参数,是无法到达extension 333中的。
bridge_early_media
作用:默认值为false。设置为true后,bridge将使用b-leg的现场原声作为反馈给a-leg的铃声。因此设置该值后早期媒体将被缓存。设置该值后将带来更高的资源消耗,但是也将得到更高质量的早期媒体
注意:要在bridge前设置该变量,或在bridge的拨号串中设置
bridge_filter_dtmf
用法:
拨号串中:
{bridge_filter_dtmf=true}sofia/default/blah@baz.com |
---|
作用:将该值设置成true将防止当桥接至其他信道还接收到之前的DTMF按键。
bridge_terminate_key
用法:可以在任意LEG上设置该参数。
作用:如果DTMF按键匹配按下该键后终止bridge。
continue_on_fail
用法:
或者Q.850原因码
作用:当呼叫无法接通(忙时或在离线状态)时决定将发生什么。如果设置为true将继续执行dialplan。如果设置为false将直接终止,可以在continue_on_fail中设置返回消息。
transfer_on_fail
作用:当呼叫由于指定的原因(例如unallocated_number)不可达时,stransfer呼叫流。
用法:
在上述例子中,如果桥接的结果为”UNALLOCATED_NUMBER”,dialplan将transfer到当前dialplan中名称叫”UNALLOCATED_NUMBER”的extension中
用法2:
用法3:
enable_file_write_buffering
用法:
作用:当记录文件时激活缓冲功能。默认为true。缓冲区大小默认为SWITCH_DEFAULT_FILE_BUFFER_LEN,但是这个值可以被覆盖,即true的值改成想要的数值大小。
failure_causes
用法:
Q.850错误代码:
作用:桥接失败后的失败原因。除非continue_on_fail的值为true,否则该值将会被改变(This will change the valuesfor which continue_on_fail willfail by default unless continue_on_fail isset to true.)
force_transfer_context
用法:
作用:当处理transfer/REFER时FreeSWITCH正常情况下将从原始信道中继承context。设置该值后将强制使用设置的context
force_transfer_diaplan
用法:
作用:当处理transfer/REFER时FreeSWITCH正常情况下将从原始信道中继承dialplan。设置该值后将强制使用设置的dialplan
hangup_after_bridge
用法:
作用:当在桥接状态下,B-LEG挂断后控制A-LEG将发生的操作。如果设置为“true”,当B-LEG挂断后A-LEG也会结束,不会执行其他任何dialplan。如果设置为”false”(默认值),当B-LEG挂断后dialplan将继续执行后续操作。
hold_hangup_xfer_exten
用法:
作用:在桥接状态下,当B-LEG处于hold状态时控制对A-LEG的操作。如果未在B-LEG上设置(默认),A-leg将挂断。如果在B-LEG上设置,A-leg将被transfer到指定的extension中。
last_bridge_to
loopback_bowout_on_execute
用法:
作用:设置为true将在呼叫中有一条腿的回路信道“bow out”(移除loopback leg)
备注:该参数仅在单腿呼叫中有效,你永远不需要去设置它,因为loopback_bowout默认值为true,它会尝试使用uuid_bridge来移除loopback
如果loopback_bowout=false,一个桥接后的回路呼叫将会有四条腿(a-leg, loopback-a, loopback-b, b-leg)
如果loopback_bowout=true,一个桥接后的回路呼叫只有两条腿。
即使设置了loopback_bowout_true也会产生四条腿,但是当a-leg和b-leg成功连接后loopback-a和loopback-b会自动被移除掉。
loopback_export
用法:
作用:将一个信道变量列表从loopback-a传到Loopback-b
outbound_redirect_fatal
用法:
作用:当同时呼叫多个端点时,一个302 重定向可以导致所有终端停止响铃并且重定向。当该信道变量设置后,它将会向一个终端发送一个302重定向,然后该终端将被移除呼叫列表,其他终端将继续响铃。
originate_timeout
用法:
示例:
作用:决定bridge或者originate应用在”originate”状态持续多长时间。实际上,这是一种向多终端发起呼叫时控制超时时间的一种方式。默认值为60秒
park_after_bridge
用法:
作用:当bridge返回时park呼叫,默认为false。该应用会先于transfer_after_bridge和hangup_after_bridge被选中。
signal_bond
用法:
作用:当前信道要桥接对象的信道的UUID。在单腿呼叫中不起作用。
no_throttle_limits
用法:
{no_throttle_limits=true} |
---|
作用:将它设置为true后将不在外呼(外联呼叫)中的SPS计数
rtp_jitter_buffer_during_bridge
用法:
作用:激活/取消激活桥接期间的抖动缓冲(jitter buffer)
uuid_bridge_continue_on_cancel
用法:
作用:如果命中一个差的b-leg系统将其移动到diaplan中。默认值为false,因为该操作不推荐使用。你可能在Dialplan_FollowMe发现该变量的用途
会议相关的变量:
conference_auto_outcall_announce
用法:
作用:当有成员加入会议时播放的音频消息文件,由应用conference_set_auto_outcall调用。
conference_auto_outcall_caller_id_name
用法:
作用:当拨打终端加入会议时显示的呼叫名称,由应用conference_set_auto_outcall调用
conference_auto_outcall_caller_id_number
用法:
作用:当拨打终端加入会议时显示的呼叫号码,由应用conference_set_auto_outcall调用
conference_auto_outcall_flags
用法:
作用:用户加入时的会议标记,由应用conference_set_auto_outcall调用
conference_auto_outcall_prefix
用法:
作用:应用conference_set_auto_outcall的前缀,可能不止一个。
conference_auto_outcall_timeout
用法:
作用:邀请一个成员加入会议呼叫超时时间,由conference_set_auto_outcall调用。
conference_auto_outcall_maxwait
用法:
作用:信道发起conference_set_auto_outcall后等待成员加入会议的最大等待时间(单位:秒),超时后自动关闭?
conference_controls
用法:
作用:指定将呼叫者tansfer到conference中的会议控制方式。例如,可以设置会议支持人或者其他对常规会员成员的控制方式。设置成主持人(moderator)可以有权利对成员静音、提出等操作。
注意:必须创建想要的会议控制方式,如果未设置默认情况下任何成员都有会议控制的权利。
conference_enter_sound
用法:
作用:如果设置了该变量,会议的配置文件(profile)中的enter_sound参数将被修改。该参数的作用为呼叫leg转移到会议后的进入音乐。
conference_last_matching_digits
用法:
last_transferred_conference
用法:
conference_member_id
conference_uuid
用法:
作用:会议的UUID。该变量在信道进入会议时创建,并将在XML CDRs和uuid_dump calls中显示,就像其他显示信道变量的事件一样。
hangup_after_conference
用法:
作用:当会议结束后是否结束。默认为true,如果设置为false,程序将在会议结束后执行后续的conference的dialplan。
代码执行相关的变量:
api_hangup_hook
用法:
action application=”set” data=”api_hangup_hook=jsrun cleanup.js ${uuid}”/> |
---|
作用:挂断后执行的API命令
可参考:session_in_hangup_hook
bridge_pre_execure_aleg_app
用法:
作用:在A-LEG桥接两个信道前执行的命令或者API
注意:该应用执行于桥接前呼叫建立后!
bridge_pre_execute_aleg_data
用法:
作用:bridge_pre_execute_aleg_app的参数
bridge_pre_execute_bleg_app
用法:
作用:在桥接两个信道前B-LEG执行的命令或者API。当从事件套接字、CLI、XML-RPC发起呼叫时十分有用。
当在脚本中HTTP GET或者mod_http时,唤醒一个IP电话呼叫时可以做增大铃声的操作。
也可以用在B-LEG的绑定DTMF按键的APP上,这样它仍然可以转移
bridge_pre_execute_bleg_data
用法:
作用:bridge_pre_execute_bleg_app的参数
exec_after_bridge_app
用法:
作用:当桥接结束后执行一个APP。与exec_after_bridge_arg配合使用。类似的,可以用execute_on_answer来实现当桥接成立时执行的APP。
exec_after_bridge_arg
用法:
作用:exec_after_bridge_app的参数
origination_nested_vars
execute_on家族
用法:
作用:变量execute_on_xx会根据不同的条件执行dialplan应用。比如April 1,2011这些变量支持一个新语法即支持一个条件下执行多个应用。
注意:注意不要乱用这个特性!这些cases可能导致会话线程的阻塞或者其他不好的事情发生。
execute_on_answer
作用:当被叫方应答时执行一个APP应用(不是API)。如果要执行API可参见api_on_answer。execute_on_answer允许你在处理没有应答条件时有更多的控制选择,但是此时不能忽略早期媒体。
该命令仅在信道未被应答时执行。使用export或者带nolocal:prefix的export确保它在b-leg应答前执行。
第二种使用方法如下,发起一个外部呼叫和本地extension,当手工忽略媒体时等待30秒,这种情况下将使用set而不是用export应用
用法(第一种):
用法(第二种):
originate {ignore_early_media=true}sofia/gateway/my_gateway/5551212 885551212 |
---|
execute_on_media
作用:当远端发送媒体过来时执行一个APP。例如铃声或者183/SDP
该应用仅在信道未被应答时执行。使用export或者带nolocal:prefix的export确保它在b-leg应答前执行。
第二种使用方法如下,发起一个外部呼叫和本地extension,当手工忽略媒体时等待30秒,这种情况下将使用set而不是用export应用
用法(第一种):
用法(第二种):
originate sofia/gateway/my_gateway/5551212 885551212 |
---|
execute_on_media_timeout
用法:
execute_on_pre_answer
作用:当被叫处于预应答(preanswers)状态时(某个形式的早期媒体到来或者远端发送一个180铃声)执行一个应用(APP)
该应用仅在信道未被应答时执行。使用export或者带nolocal:prefix的export确保它在b-leg应答前执行。
第二种使用方法如下,发起一个外部呼叫和本地extension,当手工忽略媒体时等待30秒,这种情况下将使用set而不是用export应用
用法(第一种):
用法(第一种):
用法(第二种):
originate sofia/gateway/my_gw/5551212 885551212 |
---|
execute_on_ring
用法:
execute_on_sip_reinvite
用法:
作用:当SIP重新邀请时(reinvite)执行一个命令
api_on族的相关变量:
api_on_answer
用法:
或
作用:当被叫应答时执行的一个API(不是一个应用),可使用execute_on_answer设置执行应用
api_on_media
用法:
作用:当远端发送媒体例如铃声或者183/SDP时执行的API
api_on_originate
api_on_post_originate
api_on_pre_originate
api_on_ring
api_on_sip_extra_headers
api_on_tone_detect
failed_xml_cdr_prefix
用法:
作用:
If you set that on the A leg and any andall failed B originates generate a full XML CDR report and set it as avariable, this includes during a forked dial.
So say you try to callsofia/profile/a@xxxxxxx,sofia/profile/b@xxxxxxx
And it fails completely, before you makethe call you set failed_xml_cdr_prefix to “bad_call”
Then you end up with ${bad_call_1} and${bad_call_2} which are each a full XML report including all the vars etc.
failed_on_single_reject
用法:
[plain] view plain copy
或者
或者
或者用一个列表
或者一个拒绝列表
intercept_unbridged_only
用法:
作用:设置为true后,信道仅在没有桥接的情况下才能被intercepted。默认为false
intercept_unanswered_only
用法:
作用:设置为true后仅在信道没有被应答的情况下被intercepted。默认值为false
session_in_hangup_hook
用法:
主叫ID相关的变量:
caller_id_name
用法:
作用:由呼入呼叫设置的呼叫方名称,不是一个真正的变量。实际上它是只读的
caller_id_number
用法:
作用:由呼入呼叫设置的呼叫方号码,不是一个真正的变量,只读不可写。
effective_caller_id_name
effective_caller_id_numer
用法:
作用:设置实际的呼叫方名称,该变量自动导出到B-LEG。但是在拨号串中不起作用。换而言之,在桥接前使用该变量,或者用变量origination_caller_id_name
effective_caller_id_number
用法:
作用:设置实际的呼叫方号码,该变量自动导出到B-LEG。但是在拨号串中不起作用。换而言之,在桥接前使用该变量,或者用变量origination_caller_id_number
sip_cip_type
用法(不带额外的呼叫方ID信息):
{sip_cid_type=none}sofia/default/user@example.com |
---|
用法(发送Remote-Party-ID,默认):
{sip_cid_type=rpid}sofia/default/user@example.com |
---|
用法3:
{sip_cid_type=rpid,origination_caller_id_name=test,origination_caller_id_number=1234,origination_privacy=screen+hide_name+hide_number}sofia/default/user@example.com |
---|
用法4:
{sip_cid_type=rpid,origination_caller_id_name=test,origination_caller_id_number=1234}sofia/default/user@example.com |
---|
作用:修改在呼出LEG的SIP头部中如何显示呼叫ID
注意:在网关中(或者是配置文件中的SIP呼叫),这将不起作用。可以用caller_id_in_from=true在网关中设置。
effective_sip_cip_in_1xx
用法:
作用:防止FreeSwitch在给A-LEG发送183之前从B-LEG上接收到183后自动插入RPID
被叫ID相关的变量:
initial_callee_id_name
用法:
作用:在183期间设置被叫方姓名。该变量允许被叫方应答前看到被叫方的名字。
origination_callee_id_name
用法:
作用:在呼入中设置在呼叫方话机的显示屏上显示的呼叫方号码。可以查看 ignore_diplay_updates了解那些进程影响了这些变量。
注意:如果发现该变量无法使用,请使用export代替。
origination_callee_id_number
用法:
作用:在呼入中设置在呼叫方话机的显示屏上显示的呼叫方名称。可以查看 ignore_diplay_updates了解那些进程影响了这些变量。
呼叫记录相关的变量
Audio File Metadata
RECORD_TITLE
RECORD_COPYRIGHT
RECORD_SOFTWARE
RECORD_ARTIST
RECORD_COMMENT
RECORD_DATE
RECORD_STEREO
详情可见Misc._Dialplan_Tools_record_session
record_fill_cng
用法:
RECORD_HANGUP_ON_ERROR
用法:
作用:设置为true后,如果尝试记录呼叫时发生错误,将会挂断呼叫。这个是不被推荐的特性,但是在商业场景中这个应用十分有必要!因为商业场景中要根据CDR来计费。
RECORD_DISCARDED
用法:
作用:如果记录被停止或者被丢弃,该变量将被设置成true。在诊断的时候该变量特别有用。
record_post_process_exec_api
record_post_process_exec_app
用法1:
用法2:
作用:该变量允许记录音频后进行后续操作。这个变量存在的理由是如果在一个呼叫中先挂断的是A-LEG,dialplan将停止运行,这样就无法执行记录的操作。
record_restart_limit_on_dtmf
record_sample_rate
用法:
record_waste_resources
用法:
作用:默认情况下记录不发送RTP包。该变量允许该操作,但是长时间录音或者依赖网关上的RTP计时器,信道可能会因为MEDIA_TIMEOUT的原因挂断。设置该变量将在录音期间“浪费”带宽来发送RTP事件。其值可以为true/false/<希望的默音因子>,如果设置了值设置了true,默认的默音因子为1400
recording_follow_transfer
用法:
作用:如果tranfser要继续记录,就要将该值设置为true
编码相关的变量:
absolute_codec_string
用法:
codec_string
用法:
inherit_codec
用法:
作用:如果晚期协商(late negotiation)设置为on,并且在A-LEG上设置了inherit_codec=true,B-LEG上的codecs将被强制设置成跟A-LEG一样的值
media_mix_inbound_outbound_codecs
用法:
作用:设置B-LEG上使用什么编码器列表。默认情况下B-LEG的codecs跟A-LEG一样。但是过长的codecs列表可能会超出UDP的MTU(最大传输单元),那将引起呼叫建立失败。
read_codec
write_codec
passthru_ptime_mismatch
用法(如果在桥接前使用export可能不起作用):
作用:如果A-LEG的ptime和B-LEG的不一致且调用了mod_com_g729,呼叫将使用该codec来重新打包RTP流。
如果使用了该参数,mod_com_g729将重新打包,而没有在外部编解码,因为mod_com_g729内部会自动编解码。
注意:该变量也可在vars.xml中设置为全局变量
sip_renegotiate_codec_on_reinvite
用法:
作用:允许SDP编码在re-INVITE时改变。
注意:该变量也可在vars.xml中设置为全局变量或者设置在sip配置文件中()
conference_enforce_security
用法(呼入):
用法(呼出):
originate {conference_enforce_security=true}sofia/internal/1001 &conference(3000) |
---|
作用:允许重写会议安全模式。该变量可应用在两种场景,呼入和呼出。默认情况下会议安全仅应用在呼入呼叫中而总是在呼出呼叫中略过,该信道变量允许这种情况被修改。
suppress_cng
用法:
作用:当发起呼出时在SDP中设置a=silenceSupp:off将取消静音抑制
IVR(交互式语音应答系统)相关的变量
ivr_menu_terminator
用法:
detect_speech_result
用法:
作用:play_and_detect_speech的结果,该变量只读
SIP相关的变量
rtp_disable_hold
用法:
sip_acl_authed_by
sip_acl_token
sip_copy_multipart
用法(使用bridge时默认开启该功能):
action application=”set” data=”sip_copy_multipart=true”/> |
---|
作用:FreeSWITCH仅支持INVITE的multipart bodies。而不支持应答消息例如183或者200带有multipart bodies。也就是说一般情况下SIP的bodies仅支持一个使用MINE类型的应用或者SDP的MINE,设置该参数后就不再有这个限制,但是该变量可能会改变FreeSwitch的行为,bridge默认使用该功能。
注意:FreeSwitch会自动做它认为正确的事情并且附加一个应用或者SDP到B-LEG上。其他的non-SDP MINE部分将会被自动过滤。
sip_invite_params
sip_invite_domain
用法:
sip_from_display
用法:
sip_invite_from_params
用法:
{sip_invite_from_params=otg=mytrunk}sofia/gateway/sonus/$1 |
---|
结果:
From: sip:5552345678@sonus:5060;otg=mytrunk;tag=blah |
---|
sip_invite_to_params
sip_invite_contact_params
sip_invite_tel_params
用法:
结果:
INVITE sip:555000002;npdi=yes;rn=5555550001@1.2.3.4;user=phone SIP/2.0 |
---|
作用:在呼出呼叫中的SIP URI设置URI参数(npdi,rn)
sip_network_destination
用法:
作用:Itis intended for use with devices registering behind a NAT where the Request-URIshould contain the contact that was bound to the AOR during the registrationrequest while the request itself should be sent to the public IP and portnumber of the NAT “pinhole”. It does not add a Route header field tothe request like the ;fs_path= or the sip_route_uri options do.
sip_auth_username
用法:
originate {sip_auth_username= |
---|
作用:不用定义一个完整的网关,由mod_sofia完成授权。通常与sip_auth_password一起使用。指明了一个SIP用户名设备成功注册到FreeSWITCH上
sip_auth_password
sip_auth_simplify
用法:
作用:设置后,在安全的情况下FreeSWITCH将从SIP信号通路移除自身。
sip_force_audio_fmtp
sip_invite_req_uri
用法:
结果:
INVITE sip:11112222@test1.com SIP/2.0 From: “” sip:0000000000@192.168.2.7;tag=N6K579y4g6j0D To: sip:33334444@192.168.4.6 |
---|
作用:当呼叫桥接或者发起的时候设置头部请求行INVITE中的URI
sip_invite_record_toute
sip_invite_route_uri
用法:
originate {sip_invite_route_uri=sip:+48399999999@10.0.0.51:5080;lr;orig,origination_caller_id_number=399999000}sofia/internal/+48399999999@domain.com &echo |
---|
结果:
INVITE sip:+48399999999@domain.com SIP/2.0 Via: SIP/2.0/UDP 10.0.0.51;rport;branch=z9hG4bKpmFv4aXv4tKcK Route: sip:+48399999999@10.0.0.51:5080;lr;orig |
---|
作用:当呼叫桥接或者发起呼叫的时候设置头部route的URI
sip_invite_full_from
sip_invite_full_to
sip_handle_full_from
sip_handle_full_to
sip_force_full_from
sip_force_full_to
sip_recover_contact
sip_recover_via
sip_invite_from_uri
sip_invite_to_uri
用法:
originate {sip_invite_to_uri=sip:11112222@test1.com}sofia/internal/33334444@192.168.4.6 &park |
---|
结果:
INVITE sip:33334444@192.168.4.6 SIP/2.0 From: “” sip:0000000000@192.168.2.7;tag=N6K579y4g6j0D To: sip:11112222@test1.com |
---|
用法2(只需设置用户名):
originate sofia/internal/33334444@192.168.4.6^11112222 &park |
---|
结果:
INVITE sip:33334444@192.168.4.6 SIP/2.0 From: “” sip:0000000000@192.168.2.7;tag=Qr6pB00BBrZ5m To: sip:11112222@@192.168.4.6 |
---|
sip_ignore_reinvites
用法:
注:一旦桥接后禁止re-INVITEs
作用:告诉FreeSWITCH接受或者拒绝远端的re-INVITEs操作
sip_has_crypto
rtp_sdes_suites
rtp_secure_media
rtp_secure_media_inbound
rtp_secure_media_outbound
用法:
rtp_secure_media=
rtp_secure_media_inbound=
rtp_secure_media_outbound=
|
---|
参数值:
· mandatory –只接受或者提供 SAVP协商
· optional –接受/提供SAVP优先的SAVP/AVP
· forbidden –拒绝SAVP协商的呼入
· false –等效于forbidden,已废弃
· true –等效于mandatory,已废弃
· default –如果提供则接受SAVP呼入
encryption suites可选项:
· AEAD_AES_256_GCM_8
· AEAD_AES_128_GCM_8
· AES_CM_256_HMAC_SHA1_80
· AES_CM_192_HMAC_SHA1_80
· AES_CM_128_HMAC_SHA1_80
· AES_CM_256_HMAC_SHA1_32
· AES_CM_192_HMAC_SHA1_32
· AES_CM_128_HMAC_SHA1_32
· AES_CM_128_NULL_AUTH
示例:
rtp_secure_media=mandatory:AES_CM_256_HMAC_SHA1_80,AES_CM_256_HMAC_SHA1_32 rtp_secure_media=true:AES_CM_256_HMAC_SHA1_80,AES_CM_256_HMAC_SHA1_32 rtp_secure_media=optional:AES_CM_256_HMAC_SHA1_80 rtp_secure_media=true:AES_CM_256_HMAC_SHA1_80 |
---|
示例(指明是呼入还是呼出):
rtp_secure_media_inbound=true:AEAD_AES_256_GCM_8,AES_CM_256_HMAC_SHA1_80,AES_CM_256_HMAC_SHA1_32 rtp_secure_media_inbound=mandatory:AEAD_AES_256_GCM_8 rtp_secure_media_outbound=true:AEAD_AES_128_GCM_8 rtp_secure_media_outbound=optional:AEAD_AES_128_GCM_8 |
---|
sip_wait_for_aleg_ack
用法:
作用:在呼出的b-leg中设置该变量后,只有a-leg收到一个ACK后,b-leg才会发送ACK
timer_name
用法:
作用:Ifset will make playback and speak use a timer to clock the audio instead of theread.
deny_refer_requests
用法:
作用:如果该变量在任意一条桥接后的SIP呼叫的LEG上设置为true,其他终端发送REFER请求,都会被FreeSWITCH拒绝。
SDP操作相关的变量
sdp_m_per_ptime
用法:
作用:为每个在codec列表中不同的ptime添加“m=”行
When this variable is not set:
· When mixing codecs with various ptime in a codec list,they will now be allowed to co-exist in the sdp but it will send no ptime attr.This means the ptime preferences on the offer will be ignored when mixingcodecs with various ptimes. When receiving a codec list with no ptime attr, theptime will be chosen from local preference instead of assuming 20ms. This meansif offer contains PCMU with no ptime and FS has PCMU@40i
· Dynamic payloads will now start at 98 and increment peradditional dynamic codec per call. So now you can add CELT@32000h,CELT@48000hand each one will be auto-assigned a dynamic payload type.
Is now implied to be true, if you don’tlike this set it to false but its going to be undefined behaviour. Thisbasically means if you call in with ptime 30 then you have a bunch of ptime 20codecs in your outbound list that there will be one m= line with 30 and theoriginal inbound codec and more m= lines for each discinct ptime in your list.This is, of course, will depend on disable_trancoding or absolute_codec_stringas well
switch_r_sdp
用法:
注:不要在”set”>后添加一个回车符,否则将写入一个不同名称的变量名
作用:只读,该变量的值为当前LEG/信道的远程SDP
switch_m_sdp
用法:用来存储用于呼叫中的其他
作用:Used to store the remote SDP used by the other leg/channel of acall. (In the A-leg that will be the remote SDP of the B-leg.)
sip_append_audio_sdp
用法:
sip_ignore_183nosdp
用法:
作用:忽略183 w/o SDP。改选项不适用于正常的基础呼叫流
verbose_sdp
用法:
作用:RFCs需要一个rtpmap作为IANA动态负载类型。一个带codec名称和负载类型的rtpmap不需要常见的静态负载类型(PCMU,PCMA,G729等)
sip_local_sdp_str
sip_recovery_break_rfc
用法:
作用:为了防止在USA Re-INVITEs反转from和to,这将会中断RFC
注:该变量可设置为全局变量
sip_mirror_remote_audio_codec_payload
用法:
作用:To tell sip to break the rfc and expect the codec payload the otherside replies with rather than the one it offered which is the correct behavior.
sip_enable_soa
用法:
sdp_secure_savp_only
用法:
作用:设置为true时FreeSWITCH将在SDP提供AVP和SAVP。同时将rtp_secure_media和sdp_secure_savp_only设置为true,FreeSWITCH仅在SDP中提供SAVP
FIFO相关的变量:
fifo_bridged
fifo_caller_consumer_import
用法:
fifo_consumer_caller_import
用法:
fifo_manual_bridged
fifo_position
fifo_role
用法:
作用:作为报告目的,例如CDRs,根据呼叫LEG包含consumer或者caller变量
transfer_after_bridge
用法:
或
作用:通话挂断后进行transfer,就像是设置了一个代理。该变量作用在hangup_after_bridge前,park_after_bridge后。
播放(playback)相关的变量:
playback_terminators
用法:
作用:在播放(playback)一个文件或者在play_and_detect_speech期间,按下某个键即终止播放。默认的终结符为“*”。值为”none”则取消终结操作。
sound_prefix
playback_terminator_used
用法:
作用:呼叫方用来终止播放(playback)的DTMF键。默认为undef即未定义
playback_ms
用法:
作用:包含刚刚播放的音频文件的毫秒数。而play_seconds保存的秒数。
playback_samples
playback_last_offset_pos
用法:
作用:包含刚刚播放的文件的偏移量。可用于暂停后的恢复。
playback_sleep_val
用法:
playback_delimiter
用法:
sleep_eat_digits
用法:
作用:防止意外退出IVR。默认情况下不会吃掉任何DTMF按键。
注意:请确保在sleep_eat_digits设置为true保存好了之前的操作。
playback_timeout_sec
用法:
呼叫(Originate)相关的变量
execute_on_originate
用法:
originate {ignore_early_media=true,execute_on_originate=’cng_plc’}sofia/gateway/foo/123456789 9664 originate {ignore_early_media=true,execute_on_originate=’my_app::my_arg’}sofia/gateway/foo/123456789 9664 |
---|
作用:在成功发起呼叫时执行的代码。在originate线程中执行格式为
leg_delay_start
用法:
作用:在LEG被呼叫前的等待秒数。可以用[],但不能用全局{}
originate_disposition
用法:
作用:由B-LEG返回的挂断原因。如果桥接未成功,该变量将在每次桥接请求后更新其值。
originate_retries
originate_retry_sleep_ms
用法:
originate_timeout
用法:
作用:当向网关发送invite请求后等待的秒数。该变量在多方呼叫中十分有效。例如
originating_leg_uuid
用法:
In A-leg CDR: |
---|
origination_channel_name
用法:
originate {origination_channel_name=’this_is_my_channel_name’}loopback/9664 9195 |
---|
origination_caller_id_name
用法:
作用:设置呼叫方名称(A-LEG),命令行下可在拨号串前加入{}设置
originarion_call_id_number
用法:
作用:设置呼叫方号码(A-LEG),命令行下可在拨号串前加入{}设置
注意:当一个经由FXO网关的PSTN呼叫呼入时,该变量将无效
origination_cancel_key
用法:
origination_privacy
用法:
作用:呼叫方的策略配置信息。选项有 “screen”, “hide_name”,”hide_number”.
origination_uuid
用法:
originate [origination_uuid=….]sofia/ |
---|
originator
用法:
作用:保存呼叫发起方信道的UUID。通常由FreeSWITCH设置,用户通常不会去设置它。
originator_codec
用法:
RTP/媒体相关的变量
bypass_media
用法:
作用:设置后,媒体(RTP)将直接从呼叫方发送至被叫方。信令(SIP)有经过FreeSWITCH,但是媒体视频是点对点的
bypass_media_after_bridge
用法:
作用:跟bypass_media一样,但是会处理呼叫被应答前的媒体。Atthis point FreeSWITCH will use a ReInvite to take itself out of the media path.This helps reduce audio latency and take some load off FreeSWITCH. Especiallyuseful for UACs behind Coned NAT as it gives RTP Auto-Adjust enough time todetermine the correct ports to avoid one-way audio.
bypass_keep_codec
用法:
作用:用export bypass_keep_codec来强制使用先前的codec来re-invite
proxy_media
用法:
action application=”set” data=”proxy_media=true”/> |
---|
作用:proxy media模式可让FreeSWITCH中的RTP流处于透明代理模式。RTP流仍然经过freeswitch(不像bypass媒体模式),但是它在CPU处理上属于轻量级的,因为FreeSWITCH不处理它的包和程序,仅仅是转发而已。
注意:晚期协商(
rtp_autoflush
用法:
作用:当设置为true后(默认未设置),当套接字有数据在读取时将忽略计时器等待。设置为false时,它总是会休眠一个时间间隔。When set tofalse, it will always sleep one timer interval. When a packet is too late withthis setting, it would be saved for next time in the udp stack and we wouldplace a filler packet into the core to keep it moving that is flagged as CNG soyou know there is no audio in it. If you have it set to false, you end up withdelay if the other side is sending the audio at a different speed (can be tinydifference but it would build up).
It is worth itto set to true if you have crappy network conditions where you are hearinghiccups it’s related to jitter. Sometimes you have the other side sending audiotoo fast, then this option set to false will smooth it out but if you have itset to false in jitter conditions it tricks it into moving too fast.
rtp_autoflush_during_bridge
用法:
作用:跟rtp_autoflush类似,但是是在桥接期间设置的
disable_rtp_auto_adjust
用法:
Add {disable_rtp_auto_adjust=true} in your dial string. |
---|
作用:关闭RTP的自动调整。它将停止从源到目的RTP的重写转换。
当RTP自动调整打开时,FreeSWITCH将改变RTP的目的地址来匹配源接收包,如果另一端想发送或者接收一个不同的地址该操作将不起作用。
progress_timeout
用法:
作用:得到媒体前的最大等待时间。一般的,稳定条件下(PDD)低于3秒,移动环境下低于8秒
bridge_answer_timeout
用法:
作用:桥接状态中,处于早起媒体状态且无应答最大可容忍的等待秒数。
ingnore_early_media
用法:
用法2:
作用:忽略早期媒体,默认为false。将值设置为ring_ready与设置成true有一样的效果,但是会在接受到SIP 183时向呼入LEG发送SIP 180
ringback
用法:
用法2:
用法3:
def handler(uuid): session = PySession(uuid) session.answer() session.speak(“Hello, connecting your call to the first available agent”) session.execute(“set”,”call_timeout=30”) session.execute(“set”,”continue_on_fail=true”) session.execute(“set”,”hangup_after_bridge=true”) session.execute(“set”,”ringback=%(2000,4000,440.0,480.0)”) session.execute(“bridge”,”sofia/foo/bar@test.com,sofia/foo/baz@test2.com:5070”) session.speak(“doh!”) |
---|
instant_ringback
用法:
<action application="set" da``ta="instant_ringback=true"/> |
---|
作用:在发送回铃声给主叫方时ringback将不会根据指示停止下来
transfer_ringback
用法:
<action application="set" data="transfer_ringback=[data]"/> |
---|
作用:当一个呼叫已经被应答时该声音文件将被播放,然后transfer到另一个终端
rtp_disable_hold
用法:
rtp_negotiate_near_match
用法:
作用:Settingthis to true will cause FreeSWITCH to consider codec PTIME on inbound codecnegotiation as well. If you receive a call with PCMU@30i and only have PCMU@20ion the list, it will prefer anything else that matches codec and ptime bydefault. This changes behavior and matches PCMU@30i despite the PTIME mismatch.This is only valid if you have other matching codecs on the endpoints lists, ofcourse.
RTCP相关的变量
rtcp_packet_count
rtcp_octet_count
呼叫保留(Camp-on)相关的变量
该功能应用于桥接一个呼叫的过程中。在尝试桥接呼叫的过程中将对信道置于park(aka camp)状态,并播放保持音乐。
campon
用法:
作用:控制是否保留(camping)一个呼叫,默认为false
campon_retries
用法:
campon_timeout
用法:
camp_sleep
用法:
campon_fallback_exten
campon_fallback_dialplan
campon_fallback_context
campon_hold_music
用法:
作用:如果未设置hold_music变量,在camping期间将使用该变量的等待音乐
campon_stop_key
用法:
作用:终止campon循环及直接跳过fallback extension的DTMF按键
campon_announce_sound
用法:
应答确认相关的变量
group_confirm_file
用法:
作用:该变量与group_confirm_key配合使用。在group_confirm_file中,需指明当被叫方接起电话后播放的wav文件。在group_confirm_key变量中,可以设置一个DTMF按键,当呼叫方按下该键后将桥接呼叫。如果一个错误的DTMF按键或者没有DTMF按键输入,被叫方不会被桥接,wav文件将重复播放。
注:该功能更灵活的应该可参考Freeswitch_IVR_Originate#Answer_confirmation.
group_confirm_key
group_confirm_cancel_timeout
用法:
作用:设置后将在呼叫被应答时取消leg_timeout,但是originate_timeout仍然有效。
当使用群确认时,一个呼叫包含3个阶段:
1. 呼叫在响铃
2. 呼叫被应答,等待被确认
3. 呼叫被确认,桥接成功
正常情况下,LEG上的超时将应用于第一阶段和第二结点
如果使用了以下命令
那么coast将仅在第一阶段有效。因此,一旦阶段一结束,leg_timeout将停止计数。
语音信箱相关变量
voicemail_alternate_greet_id
voicemail_greeting_number
vm_message_ext
vm_cc
skip_greeting
skip_instructions
voicemail_authorized
事件相关的变量
fire_asr_events
用法:
作用:设置后,当检测到语音后将产生(fire)一个事件
系统相关的变量
base_dir
用法:
OpenZap相关的变量
openzap_span_number
openzap_chan_number
用法:
作用:openzap频道数