编译相关
编译libpng16,用于播放png
参考链接如下:
如何为freeswitch增加libpng16支持
相关配置
conference配置
文件:conf/autoload_configs/conference.conf.xml
<profile name="video-mcu-stereo-320">
<param name="domain" value="$${domain}"/>
<param name="rate" value="48000"/>
<param name="channels" value="2"/>
<param name="interval" value="20"/>
<param name="energy-level" value="200"/>
<!-- <param name="tts-engine" value="flite"/> -->
<!-- <param name="tts-voice" value="kal16"/> -->
<param name="muted-sound" value="conference/conf-muted.wav"/>
<param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
<param name="alone-sound" value="conference/conf-alone.wav"/>
<param name="moh-sound" value="$${hold_music}"/>
<param name="enter-sound" value="tone_stream://%(200,0,500,600,700)"/>
<param name="exit-sound" value="tone_stream://%(500,0,300,200,100,50,25)"/>
<param name="kicked-sound" value="conference/conf-kicked.wav"/>
<param name="locked-sound" value="conference/conf-locked.wav"/>
<param name="is-locked-sound" value="conference/conf-is-locked.wav"/>
<param name="is-unlocked-sound" value="conference/conf-is-unlocked.wav"/>
<param name="pin-sound" value="conference/conf-pin.wav"/>
<param name="bad-pin-sound" value="conference/conf-bad-pin.wav"/>
<param name="caller-id-name" value="$${outbound_caller_name}"/>
<param name="caller-id-number" value="$${outbound_caller_id}"/>
<param name="comfort-noise" value="false"/>
<param name="conference-flags" value="livearray-json-status|json-events|video-floor-only|rfc-4579|livearray-sync|minimize-video-encoding|manage-inbound-video-bitrate|video-required-for-canvas|video-mute-exit-canvas|mute-detect"/>
<param name="video-auto-floor-msec" value="1000"/>
<param name="video-mode" value="mux"/>
<param name="video-layout-name" value="1x1"/>
<param name="video-layout-name" value="group:grid"/>
<param name="video-canvas-size" value="640x480"/>
<param name="video-canvas-bgcolor" value="#333333"/>
<param name="video-layout-bgcolor" value="#000000"/>
<param name="video-codec-bandwidth" value="1mb"/>
<param name="video-fps" value="30"/>
</profile>
入会dialplan
文件:conf/dialplan/public.xml
<extension name="CallIn_To_Bot_">
<condition field="destination_number" expression="^\+(\d+)$">
<action application="set" data="core_video_blank_image=false"/>
<action application="answer"/>
<action application="conference" data="3000@video-mcu-stereo-320" />
</condition>
</extension>
API
呼叫软电话并入会
originate {core_video_blank_image=false}sofia/external/1007@10.1.1.157:10020 +8881000 XML public
播放flv命令
conference 3000 play av:///usr/local/freeswitch/flv/1.flv
停止播放flv
conference 3000 stop all
!!!stop将会清空所有待播放的音视频列表!!!
事件
会议室新建
RECV EVENT
Event-Subclass: conference::maintenance
Event-Name: CUSTOM
Core-UUID: 6043ded1-0eff-457b-9740-9d5ed97eb827
FreeSWITCH-Hostname: idc-146
FreeSWITCH-Switchname: idc-146
FreeSWITCH-IPv4: 10.1.1.146
FreeSWITCH-IPv6: ::1
Event-Date-Local: 2020-12-28 17:38:49
Event-Date-GMT: Mon, 28 Dec 2020 09:38:49 GMT
Event-Date-Timestamp: 1609148329962742
Event-Calling-File: mod_conference.c
Event-Calling-Function: conference_new
Event-Calling-Line-Number: 3792
Event-Sequence: 6979
Conference-Name: 3000
Conference-Domain: 10.1.1.146
Conference-Size: 0
Conference-Ghosts: 0
Conference-Profile-Name: video-mcu-stereo-320
Conference-Unique-ID: 3f9c6f47-0673-4852-97a0-7f3096dbba00
Action: conference-create
会议室入会
RECV EVENT
Event-Subclass: conference::maintenance
Event-Name: CUSTOM
Core-UUID: 6043ded1-0eff-457b-9740-9d5ed97eb827
FreeSWITCH-Hostname: idc-146
FreeSWITCH-Switchname: idc-146
FreeSWITCH-IPv4: 10.1.1.146
FreeSWITCH-IPv6: ::1
Event-Date-Local: 2020-12-28 17:38:49
Event-Date-GMT: Mon, 28 Dec 2020 09:38:49 GMT
Event-Date-Timestamp: 1609148329982767
Event-Calling-File: conference_member.c
Event-Calling-Function: conference_member_add
Event-Calling-Line-Number: 931
Event-Sequence: 6982
Conference-Name: 3000
Conference-Domain: 10.1.1.146
Conference-Size: 1
Conference-Ghosts: 0
Conference-Profile-Name: video-mcu-stereo-320
Conference-Unique-ID: 3f9c6f47-0673-4852-97a0-7f3096dbba00
Floor: false
Channel-State: CS_EXECUTE
Channel-Call-State: ACTIVE
Channel-State-Number: 4
Channel-Name: sofia/external/1007@10.1.1.157:10020
Unique-ID: 0eb06110-ff03-4d17-b452-6950aad3eee5
Call-Direction: outbound
Presence-Call-Direction: outbound
Channel-HIT-Dialplan: true
Channel-Call-UUID: 0eb06110-ff03-4d17-b452-6950aad3eee5
Answer-State: answered
Channel-Read-Codec-Name: L16
Channel-Read-Codec-Rate: 8000
Channel-Read-Codec-Bit-Rate: 128000
Channel-Write-Codec-Name: PCMA
Channel-Write-Codec-Rate: 8000
Channel-Write-Codec-Bit-Rate: 64000
Caller-Direction: outbound
Caller-Logical-Direction: outbound
Caller-Dialplan: XML
Caller-Caller-ID-Name: Outbound Call
Caller-Caller-ID-Number: 1007
Caller-Orig-Caller-ID-Number: 0000000000
Caller-Callee-ID-Number: 0000000000
Caller-Network-Addr: 10.1.1.157
Caller-ANI: 0000000000
Caller-Destination-Number: +8881000
Caller-Unique-ID: 0eb06110-ff03-4d17-b452-6950aad3eee5
Caller-Source: src/switch_ivr_originate.c
Caller-Transfer-Source: 1609148329:1f8deee5-b4f8-4503-9a4f-c7ad5a45fdda:bl_xfer:+8881000/public/XML
Caller-Context: public
Caller-RDNIS: 1007
Caller-Channel-Name: sofia/external/1007@10.1.1.157:10020
Caller-Profile-Index: 2
Caller-Profile-Created-Time: 1609148329962742
Caller-Channel-Created-Time: 1609148328242742
Caller-Channel-Answered-Time: 1609148329962742
Caller-Channel-Progress-Time: 1609148328622812
Caller-Channel-Progress-Media-Time: 0
Caller-Channel-Hangup-Time: 0
Caller-Channel-Transfer-Time: 0
Caller-Channel-Resurrect-Time: 0
Caller-Channel-Bridged-Time: 0
Caller-Channel-Last-Hold: 0
Caller-Channel-Hold-Accum: 0
Caller-Screen-Bit: true
Caller-Privacy-Hide-Name: false
Caller-Privacy-Hide-Number: false
Video: true
Hear: true
See: true
Speak: true
Talking: false
Mute-Detect: false
Hold: false
Member-ID: 28
Member-Type: member
Member-Ghost: false
Energy-Level: 200
Current-Energy: 0
Action: add-member
会议室出会(用户挂断导致出会)
RECV EVENT
Event-Subclass: conference::maintenance
Event-Name: CUSTOM
Core-UUID: 6043ded1-0eff-457b-9740-9d5ed97eb827
FreeSWITCH-Hostname: idc-146
FreeSWITCH-Switchname: idc-146
FreeSWITCH-IPv4: 10.1.1.146
FreeSWITCH-IPv6: ::1
Event-Date-Local: 2020-12-28 17:39:16
Event-Date-GMT: Mon, 28 Dec 2020 09:39:16 GMT
Event-Date-Timestamp: 1609148356802740
Event-Calling-File: conference_member.c
Event-Calling-Function: conference_member_del
Event-Calling-Line-Number: 1319
Event-Sequence: 7009
Conference-Name: 3000
Conference-Domain: 10.1.1.146
Conference-Size: 0
Conference-Ghosts: 0
Conference-Profile-Name: video-mcu-stereo-320
Conference-Unique-ID: 3f9c6f47-0673-4852-97a0-7f3096dbba00
Floor: false
Channel-State: CS_EXECUTE
Channel-Call-State: ACTIVE
Channel-State-Number: 10
Channel-Name: sofia/external/1007@10.1.1.157:10020
Unique-ID: 0eb06110-ff03-4d17-b452-6950aad3eee5
Call-Direction: outbound
Presence-Call-Direction: outbound
Channel-HIT-Dialplan: true
Channel-Call-UUID: 0eb06110-ff03-4d17-b452-6950aad3eee5
Answer-State: hangup
Hangup-Cause: NORMAL_CLEARING
Channel-Read-Codec-Name: L16
Channel-Read-Codec-Rate: 8000
Channel-Read-Codec-Bit-Rate: 128000
Channel-Write-Codec-Name: PCMA
Channel-Write-Codec-Rate: 8000
Channel-Write-Codec-Bit-Rate: 64000
Caller-Direction: outbound
Caller-Logical-Direction: outbound
Caller-Dialplan: XML
Caller-Caller-ID-Name: Outbound Call
Caller-Caller-ID-Number: 1007
Caller-Orig-Caller-ID-Number: 0000000000
Caller-Callee-ID-Number: 0000000000
Caller-Network-Addr: 10.1.1.157
Caller-ANI: 0000000000
Caller-Destination-Number: +8881000
Caller-Unique-ID: 0eb06110-ff03-4d17-b452-6950aad3eee5
Caller-Source: src/switch_ivr_originate.c
Caller-Transfer-Source: 1609148329:1f8deee5-b4f8-4503-9a4f-c7ad5a45fdda:bl_xfer:+8881000/public/XML
Caller-Context: public
Caller-RDNIS: 1007
Caller-Channel-Name: sofia/external/1007@10.1.1.157:10020
Caller-Profile-Index: 2
Caller-Profile-Created-Time: 1609148329962742
Caller-Channel-Created-Time: 1609148328242742
Caller-Channel-Answered-Time: 1609148329962742
Caller-Channel-Progress-Time: 1609148328622812
Caller-Channel-Progress-Media-Time: 0
Caller-Channel-Hangup-Time: 0
Caller-Channel-Transfer-Time: 0
Caller-Channel-Resurrect-Time: 0
Caller-Channel-Bridged-Time: 0
Caller-Channel-Last-Hold: 0
Caller-Channel-Hold-Accum: 0
Caller-Screen-Bit: true
Caller-Privacy-Hide-Name: false
Caller-Privacy-Hide-Number: false
Video: true
Hear: true
See: true
Speak: true
Talking: false
Mute-Detect: false
Hold: false
Member-ID: 28
Member-Type: member
Member-Ghost: false
Energy-Level: 200
Current-Energy: 0
Action: del-member
开始播放flv
RECV EVENT
Event-Subclass: conference::maintenance
Event-Name: CUSTOM
Core-UUID: 6043ded1-0eff-457b-9740-9d5ed97eb827
FreeSWITCH-Hostname: idc-146
FreeSWITCH-Switchname: idc-146
FreeSWITCH-IPv4: 10.1.1.146
FreeSWITCH-IPv6: ::1
Event-Date-Local: 2020-12-28 17:38:59
Event-Date-GMT: Mon, 28 Dec 2020 09:38:59 GMT
Event-Date-Timestamp: 1609148339022748
Event-Calling-File: conference_api.c
Event-Calling-Function: conference_api_sub_play
Event-Calling-Line-Number: 2828
Event-Sequence: 6996
Conference-Name: 3000
Conference-Domain: 10.1.1.146
Conference-Size: 1
Conference-Ghosts: 0
Conference-Profile-Name: video-mcu-stereo-320
Conference-Unique-ID: 3f9c6f47-0673-4852-97a0-7f3096dbba00
Action: play-file
File: av:///usr/local/freeswitch/flv/1.flv
Async: false
结束播放flv
RECV EVENT
Event-Subclass: conference::maintenance
Event-Name: CUSTOM
Core-UUID: 6043ded1-0eff-457b-9740-9d5ed97eb827
FreeSWITCH-Hostname: idc-146
FreeSWITCH-Switchname: idc-146
FreeSWITCH-IPv4: 10.1.1.146
FreeSWITCH-IPv6: ::1
Event-Date-Local: 2020-12-28 17:39:05
Event-Date-GMT: Mon, 28 Dec 2020 09:39:05 GMT
Event-Date-Timestamp: 1609148345482802
Event-Calling-File: conference_file.c
Event-Calling-Function: conference_file_close
Event-Calling-Line-Number: 52
Event-Sequence: 6997
Conference-Name: 3000
Conference-Domain: 10.1.1.146
Conference-Size: 1
Conference-Ghosts: 0
Conference-Profile-Name: video-mcu-stereo-320
Conference-Unique-ID: 3f9c6f47-0673-4852-97a0-7f3096dbba00
seconds: 6
milliseconds: 6454
samples: 309838
Action: play-file-done
File: av:///usr/local/freeswitch/flv/1.flv
注意:在队列中等待播放的视频文件,也会有结束播放事件!
区别是,seconds和milliseconds的值为0
RECV EVENT
Event-Subclass: conference::maintenance
Event-Name: CUSTOM
Core-UUID: 94a077e8-4ca1-4b30-80f1-54c29fbde926
FreeSWITCH-Hostname: localhost.localdomain
FreeSWITCH-Switchname: localhost.localdomain
FreeSWITCH-IPv4: 172.16.101.170
FreeSWITCH-IPv6: ::1
Event-Date-Local: 2021-01-07 08:41:05
Event-Date-GMT: Thu, 07 Jan 2021 08:41:05 GMT
Event-Date-Timestamp: 1610008865659644
Event-Calling-File: conference_file.c
Event-Calling-Function: conference_file_close
Event-Calling-Line-Number: 52
Event-Sequence: 856
Conference-Name: 3800
Conference-Domain: 172.16.101.170
Conference-Size: 1
Conference-Ghosts: 0
Conference-Profile-Name: video-mcu-stereo-320
Conference-Unique-ID: 0f5db4bf-1934-4f3e-be14-683e52a06c42
seconds: 0
milliseconds: 0
samples: 0
Action: play-file-done
File: av:///root/127.flv