译者注:没看懂,就不翻译出来误导人了! This example sets the min_dtmf_duration switch parameter to 100ms. The number is in clock ticks where clockticks / 8 = ms. The min_dtmf_duration specifies the minimum DTMF duration to use on outgoing events. Events shorter than this will be increased in duration to match min_dtmf_duration. You cannot configure a DTMF duration on a profile that is less than this setting. You may increase this value, but cannot set it lower than 400 (the default). This value cannot exceed max_dtmf_duration. This setting can be changed in switch.conf.xml.
It is worth noting that many devices squelch in-band DTMF when sending RFC 2833. Devices that squelch in-band DTMF have a certain reaction time and clamping time which can sometimes reach as high as 40ms, though most can do it in less than 20ms. As the shortness of your DTMF event duration approaches this clamping threshold, the risk of your DTMF being ignored as a squelched event increases. If your call is always IP-IP the entire route, this is likely not a concern. However, when your call is sent to the PSTN, the RFC 2833 must be encoded in the audio stream. This means that other devices down the line (possibly a PBX or IVR you are calling into) might start considering your DTMF event a squelched tone and ignore it entirely. For this reason, it is recommended that you do not send DTMF events shorter than 80ms.
Checking the current value:
fsctl min_dtmf_duration 0
The code recognizes a duration of 0 as a status check. Instead of setting the value to 0, it simply returns the current value.
====max_dtmf_duration====
Example:
fsctl max_dtmf_duration 80000
This example sets the max_dtmf_duration switch parameter to 10,000ms (10 seconds). The number is in clock ticks (CT) where CT / 8 = ms. The max_dtmf_duration caps the playout of a DTMF event at the specified duration. Events exceeding this duration will be truncated to this duration. You cannot configure a duration on a profile that exceeds this setting. This setting can be lowered, but cannot exceed 192000 (the default). This setting cannot be set lower than min_dtmf_duration. This setting can be changed in switch.conf.xml.
Checking the current value:
fsctl max_dtmf_duration 0
The code recognizes a duration of 0 as a status check. Instead of setting the value to 0, it simply returns the current value.
====default_dtmf_duration====
Example:
fsctl default_dtmf_duration 2000
This example sets the default_dtmf_duration switch parameter to 250ms. The number is in clock ticks (CT) where CT / 8 = ms. The default_dtmf_duration specifies the DTMF duration to use on originated DTMF events or on events that are received without a duration specified. This value can be increased or lowered. This value is lower-bounded by min_dtmf_duration and upper-bounded by max_dtmf_duration. This setting can be changed in switch.conf.xml.
Checking the current value:
fsctl default_dtmf_duration 0
The code recognizes a duration of 0 as a status check. Instead of setting the value to 0, it simply returns the current value.
====verbose_events==== Enables verbose events. Verbose events have '''every''' channel variable in '''every''' event for a particular channel. Non-verbose events have only the pre-selected channel variables in the event headers. * This setting can also be set in [[switch.conf.xml]].
global_getvar
获取全局变量的值。如果没有提供参数,则返回所有全局变量的值。
用法: global_getvar
global_setvar
设置全局变量
用法: global_setvar =
例子:
global_setvar foo=bar
group_call
返回组呼bridge字符串,组呼定义请参考[[XML User Directory Guide#Groups|call group]]。
版本14727中的逻辑是,如果源字符串匹配匹配到结果,那么条件为false,但是这里仍有一个匹配结果,结果是1001。(这里的翻译是照字面翻译,小伙伴们,你们看懂了没?) Logic in revision 14727 if the source string matches the result then the condition was false however there was a match and it is 1001.
regex 1001|(^\d{4}$)|$1
See also [[Regular_Expression]]
reload
重新加载模块。
用法: reload [-f]
reloadacl
重新加载ACL规则。
用法: reloadacl [reloadxml]
reloadxml
重新加载conf/freeswitch.xml的配置信息到内存中。
用法: reloadxml
show
输出多种(模块)状态报告。
用法: show
item类型如下:
codec
endpoint
application
api
dialplan
file
timer
calls [count]
channels [count|like ]
calls
detailed_calls
bridged_calls
detailed_bridged_calls
aliases
complete
chat
management
modules
nat_map
say
interfaces
interface_types
tasks
limits
XML格式输出: show foo as xml
修改输出分隔符: show foo as delim |
codec - 列出所有编码
endpoint - 列出所有endpoint类型模块
application - 列出所有应用程序
api - 列出所有api
dialplan - 列出拨号方案涉及的模块
file - 列出所有支持的文件类型
timer - 列出计时器timer模块
calls - 列出当前的通话[count]
channels - 列出当前的通道 [count|like ] 注:关于calls与channels的对比,请参考Channels vs Calls
originate sofia/example/[email protected] &conference(conf_uuid-TEST_CON)
originate sofia/example/[email protected] conference:conf_uuid-TEST_CON inline
( See [[Misc._Dialplan_Tools_InlineDialplan]] for more detail on 'inline' Dialplans )
API command to tell a channel to send a re-invite with optional list of new codecs
Usage: uuid_media_reneg
uuid_park
Park call
Usage: uuid_park
uuid_preanswer
Preanswer a channel.
Usage: uuid_preanswer
See Also: [[Misc._Dialplan_Tools_pre_answer]]
uuid_preprocess
Pre-process Channel
Usage: uuid_preprocess <>
uuid_recv_dtmf
Send DTMF digits to set.
Usage: uuid_recv_dtmf [@]
Use the character w for a .5 second delay and the character W for a 1 second delay.
Default tone duration is 2000ms .
uuid_send_dtmf
Send DTMF digits.
Usage: uuid_send_dtmf [@]
Use the character w for a .5 second delay and the character W for a 1 second delay.
Default tone duration is 2000ms .
uuid_send_info
Send info to the endpoint
Usage: uuid_send_info
uuid_session_heartbeat
Usage: uuid_session_heartbeat [sched] [0|]
uuid_setvar
Set a variable on a channel. If value is omitted, the variable is unset.
Usage: uuid_setvar [value]
uuid_setvar_multi
Set multiple vars on a channel.
Usage: uuid_setvar_multi =[;=[;...]]
uuid_simplify
This command directs FreeSWITCH to remove itself from the SIP signaling path if it can safely do so
Usage:
uuid_simplify
uuid_transfer
Transfers an existing call to a specific extension within a and . Dialplan may be "xml" or "directory".
Usage:
uuid_transfer [-bleg|-both] [] []
The optional first argument will allow you to transfer both parties (-both) or only the party to whom is talking.(-bleg)
NOTE: if the call has been bridged, and you want to transfer either sides of the call, then you will need to use (or the API equivalent). If it's not set, transfer doesn't really work as you'd expect, and leaves calls in limbo.
Record/Playback Commands
uuid_record
Record the audio associated with the given UUID into a file. The start command causes FreeSWITCH to start mixing all call legs together and saves the result as a file in the format that the file's extension dictates. (if available) The stop command will stop the recording and close the file. If media setup hasn't yet happened, the file will contain silent audio until media is available. Audio will be recorded for calls that are parked. The recording will continue through the bridged call. If the call is set to return to park after the bridge, the bug will remain on the call, but no audio is recorded until the call is bridged again. (TODO: What if media doesn't flow through FreeSWITCH? Will it re-INVITE first? Or do we just not get the audio in that case?)
Usage:
uuid_record [start|stop] [ ]
Where limit is the max number of seconds to record.
If the path is not specified on start it will default to the channel variable "sound_prefix" or FreeSWITCH base_dir when the "sound_prefix" is empty.
You may also specify "all" for path when stop is used to remove all for this uuid
"stop" command must be followed by option.
[[Channel_Variables#Call_Recording_Related|See record's related variables]]
Limit Commands
[[Limit#API|limit_reset]]
Reset a limit backend.
[[Limit#API|limit_status]]
Retrieve status from a limit backend.
[[Limit#API|limit_usage]]
Retrieve usage for a given resource.
[[Limit#API|uuid_limit_release]]
Manually decrease a resource usage by one.
[[Limit#API|limit_interval_reset]]
Reset the interval counter to zero prior to the start of the next interval.
Misc. Commands
bg_system
Execute a system command in the background.
Usage: bg_system
echo
Echo input back to the console echo This text will appear This text will appear
'''Note''' this tests whether FreeSWITCH can see the file, but the file may still be unreadable (permissions).
find_user_xml
Checks to see if a user exists; Matches user tags found in the directory, similar to [[user_exists]], but returns an XML representation of the user as defined in the directory (like the one shown in [[Mod_commands#user_exists|user_exists]]).
Usage: find_user_xml
Where key references a key specified in a directory's user tag, user represents the value of the key, and the domain is the domain the user is assigned to.
freeswitch@localhost> list_users group default user 2004
userid|context|domain|group|contact|callgroup|effective_caller_id_name|effective_caller_id_number
2004|default|192.168.20.73|default|error/user_not_registered|techsupport|Test 2004|2004
+OK
sched_api
Schedule an API call in the future. Usage: sched_api [+@]
time is the UNIX timestamp at which the command should be executed. If it is prefixed by +, specifies the number of seconds to wait before executing the command. If prefixed by @, it will execute the command periodically everyseconds; for the first time it will be executed after seconds. group_name will be the value of "Task-Group" in generated events. "none" is the proper value for no group. command_string is the command executed
Scheduled task or group of tasks can be revoked with sched_del or unsched_api.
You could put "&" symbol at the end of the line to make command to be executed in its own thread.
Play a file to a specific call in the future. Usage: sched_broadcast [+] [aleg|bleg|both]
Schedule execution of an application on a chosen leg(s) with optional hangup: Usage: sched_broadcast [+] app[![hangup_cause]]::args [aleg|bleg|both]
time is the UNIX timestamp at which the command should be executed (or if it is prefixed by +, the number of seconds to wait before executing the command)
Removes a prior scheduled group or task ID Usage: sched_del
The one argument can either be a group of prior scheduled tasks or the returned task-id from sched_api.
Example: sched_del my_group sched_del 2
sched_hangup
Schedule a running call to hangup.
Usage: sched_hangup [+] []
Note: sched_hangup +0 is the same as uuid_kill
sched_transfer
Schedule a transfer for a running call.
Usage: sched_transfer [+] [] []
stun
Executes a STUN lookup. Usage: stun [:port]
Example: stun stun.freeswitch.org
system
Execute a system command.
Usage: system
The command is passed to the system shell, where it may be expanded or interpreted in ways you don't expect. This can lead to security bugs if you're not careful. For example, the following command is dangerous:
If a malicious remote caller somehow sets their caller ID name to "; rm -rf /", you would unintentionally be executing this shell command:
log_caller_name; rm -rf /
time_test
Time test.
Usage: time_test [count]
Runs a test to see how bad timer jitter is. It runs the test count times (default 10) and tries to sleep for mss microseconds. It returns the actual timer duration along with an average.
Sample:
time_test 100 5
test 1 sleep 100 99
test 2 sleep 100 97
test 3 sleep 100 96
test 4 sleep 100 97
test 5 sleep 100 102
avg 98
timer_test
Timer test.
Usage: timer_test <10|20|40|60|120> [<1..200>] []
Runs a test to see how bad timer jitter is. Unlike time_test, this uses the actual freeswitch timer infrastructure to do the timer test and exercises the timers used for call processing.
First argument is the timer interval. Second is the count. Third is the timer name ("show timers" will give you a list)
Retrieves user information (parameters or variables) as defined in the directory.
Usage: user_data @ [attr|var|param]
Where user is the user's id, domain is the user's domain, var|param specifies whether the info we're requesting is a variable/parameter, and the name is the name (key) of the variable.
will return the user's actual alphanumeric ID (i.e. "john") when number-alias="1000" was set as an attribute for that user.
user_exists
Checks to see if a user exists; Matches user tags found in the directory and returns either true/false:
Usage: user_exists
Where key references a key specified in a directory's user tag, user represents the value of the key, and the domain is the domain the user is assigned to.
Example:
user_exists id 1000 192.168.1.101
will return true where there exists in the directory a user with a key called id whose value equals 1000: In the above example, we also could have tested for randomvar:
总体结构 FreeSWITCH 由一个稳定的核心及外围模块组成. FreeSWITCH 使用线程模型来处理并发请求,每个连接都在单独的线程中进行处理.这不仅能提供最大强度的并发,更重要的是,即使某路电话发生问题,也只影响到它所在的线 程,而不会影响到其它电话.FreeSWITCH 的核心非常短小精悍,这也是保持稳定的关键.所有其它功能都在外围的模块中.模块是可以动态加载(以及卸载)的,在实际应用中可以只加载用到的模块.外围 模块通过核心提供的 Public API 与核心进行通信,而核心则通过回
Windows中Netsh命令的典型应用
11/18 01:12
netsh命令已经推出很长时间,在Windows 2000/XP/2003中均带有Netsh命令.Windows Server 2008只是对netsh的参数项做了些扩展.日常工作中,很多管理员对netsh了解不多,甚至不知道在Windows Server 2008中netsh增强了哪些功能.通过阅读本文,Windows管理员可以找到上面所列问题的答案. 一.什么是 Netsh? 微软Windows的netsh是一个命令行脚本实用工具.使用netsh工具 ,可以查看或更改本地计算机或远程计算机的
linux 常用命令及技巧 一. 通用命令: 1. date :print or set the system date and time 2. stty -a: 可以查看或者打印控制字符(Ctrl-C, Ctrl-D, Ctrl-Z等) 3. passwd: print or set the system date and time (用passwd -h查看) 4. logout, login: 登录shell的登录和注销命令 5. pwd: print or set the syste
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml&q