mod_conference
本文英文部分是来自https://freeswitch.org/confluence/display/FREESWITCH/mod_conference,中文部分是通过分析mod_conference的代码根据个人的理解整理而成。
关于作者
鼎鼎:cdevelop@qq.com qq:1280791187。 本文会不定期更新,最新版本在http://www.ddrj.com/fs/mod_conference.html。
配置
conference.conf.xml 范例
<configuration name="conference.conf" description="Standard Conference configuration">
<advertise>
[... config here ...]
</advertise>
<caller-controls>
<group name="default">
[... config here ...]
</group>
</caller-controls>
<chat-permissions>
<profile name="default">
[... config here ...]
</profile>
</chat-permissions>
<profiles>
<profile name="default">
[... config here ...]
</profile>
</profiles>
</configuration>
advertise
<advertise>
<room name="3001@$${domain}" status="FreeSWITCH"/>
</advertise>
添加room配置后,模块load时,会发送SWITCH_EVENT_PRESENCE_IN事件。详细参考下面实现代码:
if ((advertise = switch_xml_child(cfg, "advertise"))) {
for (room = switch_xml_child(advertise, "room"); room; room = room->next) {
char *name = (char *) switch_xml_attr_soft(room, "name");
char *status = (char *) switch_xml_attr_soft(room, "status");
switch_event_t *event;
if (name && switch_event_create(&event, id) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", CONF_CHAT_PROTO);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", name);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", name);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "force-status", status ? status : "Available");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
switch_event_fire(&event);
}
}
}
caller-controls
配置会议控制按键,profile通过<param name="caller-controls" value="none"/>
设置管理的caller-controls。none就是不使用控制按键,不设置时会使用default组。
Caller controls are used to modify the state of the conference, such as lowering the volume, mute a participant, and such. Below are the commands that can be assigned to digits and executed during a conference. The “moderator-controls” group provides additional controls for participants who enter the conference with the moderator flag set. See below.
Reserved Control Group Names
Name | Description |
---|---|
none | Use this name to prevent installing caller-controls for callers to a conference. |
default | This group of settings will be assigned if no “caller-controls” is specified. You can also assign it explicitly. This group is defined in vanilla config, thus removing it from the configurations will make no caller controls at all. |
例子:
<caller-controls>
<group name="default">
<control action="mute" digits="0"/>
<control action="deaf mute" digits="*"/>
<control action="energy up" digits="9"/>
<control action="energy equ" digits="8"/>
<control action="energy dn" digits="7"/>
<control action="vol talk up" digits="3"/>
<control action="vol talk zero" digits="2"/>
<control action="vol talk dn" digits="1"/>
<control action="vol listen up" digits="6"/>
<control action="vol listen zero" digits="5"/>
<control action="vol listen dn" digits="4"/>
<control action="hangup" digits="#"/>
</group>
</caller-controls>
详细配置
Action | Description | Min. Version |
---|---|---|
mute | Toggle audio from this member into the conference.麦克静音切换,按一下静音,再按一下取消静音。 | |
mute on | Disable audio from this member into the conference.静音麦克。 | |
mute off | Enable audio from this member into the conference.取消静音麦克。 | |
deaf mute | Block audio from conference to this member as well as mute, in one action. 麦克和喇叭都静音。再按一下取消。 | |
energy up | Increase minimum energy threshold by 1 unit above which sound will be admitted into conference (noise gate).按一下噪音阈值加200,最大1800,声音只有大于这个阈值才会送到会议其他成员。 | |
energy equ | Reset minimum energy threshold to default. 噪音阈值恢复默认值。 | |
energy dn | Decrease minimum energy threshold by 1 unit.按一下噪音阈值减少200,最小0 | |
vol talk up | Increase member talk (mic) volume into conference by 1 unit,按一下把说话声音放大1个等级,最大可以放大4个等级,对应 {1.3, 2.3, 3.3, 4.3} 这些倍数。 | |
vol talk zero | Reset talk volume to default setting. 取消说话声音增溢 | |
vol talk dn | Decrease talk volume by 1 unit.,按一下把说话声音降低1个等级,最大可以降低4个等级,对应 {.80, .60, .40, .20}这些倍数。 | |
vol listen up | Increase member receive (earpiece) volume by 1 unit.同vol talk up一样,只是修改是听到的声音 | |
vol listen zero | Reset member receive volume to default setting | |
vol listen dn | Decrease member receive volume by 1 unit | |
hangup | Leave the conference.离开会议 | |
event | Send the DTMF event via CUSTOM conference::maintenance subclass to the event system (even to event socket).触发esl事件 | |
lock | Toggle the conference lock state (no new members can enter when locked).切换会议锁定状态,锁定时会议不能加入新成员 | |
transfer | Transfer member to a given extension in a dialplan context.例子: <control action="transfer" digits="5" data="100 XML default"/> ,离开会议并转到指定上下文。 |
|
execute_application | Execute a dialplan application.例子:<control action="execute_application" digits="0" data="playback conf_help.wav"/> ,执行一个APP,APP执行完成后会返回到会议 。 |
|
floor | Toggle yourself on and off of talking floor, as long as no one else has floor status. floor标记的意思是会议当前的说话人,一个会议只有一个成员拥有floor标记,会议会自动设置。我看代码的逻辑是,按钮的用处是如果一个成员拥有floor标记,执行按键后,会取消floor标记。如果会议中没有成员有floor标记,就给按键的成员设置floor标记, 不会实际测试时并不想预期的这样,系统会自动修改floor标记的。 | |
vid-floor | Video floor. If video floor is currently locked, it will revert to auto; if there is no current holder, you become video floor holder | 1.6 |
vid-floor-force | Video floor. If video floor is currently locked, it will revert to auto, otherwise you become the **locked video floor holder | 1.6 |
vmute | Video mute. Toggle video from this member into the conference | 1.6 |
vmute on | Disable video from this member into the conference | 1.6 |
vmute off | Enable video from this member into the conference | 1.6 |
vmute snap | Take a video snapshot for this user to be used when in vmute | 1.6 |
vmute snapoff | Discard the vmute video snapshot | 1.6 |
profiles
You can specify a number of different profiles in the profiles section, these will let you easily apply a number of settings to a conference. Please note that the profiles are not conference rooms, but define settings that are later applied to conference rooms. The dialplan section in this document will describe how you create conference rooms and apply these profile settings.
profiles structure
<profiles>
<profile name="default">
<param name="paramName" value="paramValue"/>
</profile>
</profiles>
You can have any number of
Conference Profile Parameters
You may specify the conference profile parameters listed below. Keep in mind that if TTS is enabled all audio-file params beginning with ‘say:’ will be considered text to say with TTS. A TTS module must be loaded by FreeSWITCH for this to work.
Name | Description | Example value | Allowed value | Default value | Played for | Min. Version |
---|---|---|---|---|---|---|
announce-count | Requires TTS. If the number of members equals or exceeds this value, the conference will speak the count to the conference after a new member joins. 需要TTS支持,大于几人时播报会议总人数。 |
5 | \ |
0 | ||
auto-gain-level | Enables Automatic Gain Control (AGC). If the parameter is set to ‘true’, then the default AGC value is used. If set to a number it will override the default value. 启用自动增益控制(AGC)。 如果参数设置为“true”,则使用默认的AGC值。 如果设置为数字,它将覆盖默认值 |
900 | \ |
1100 |