编译相关

编译libpng16,用于播放png

参考链接如下:
如何为freeswitch增加libpng16支持

相关配置

conference配置

文件:conf/autoload_configs/conference.conf.xml

  1. <profile name="video-mcu-stereo-320">
  2. <param name="domain" value="$${domain}"/>
  3. <param name="rate" value="48000"/>
  4. <param name="channels" value="2"/>
  5. <param name="interval" value="20"/>
  6. <param name="energy-level" value="200"/>
  7. <!-- <param name="tts-engine" value="flite"/> -->
  8. <!-- <param name="tts-voice" value="kal16"/> -->
  9. <param name="muted-sound" value="conference/conf-muted.wav"/>
  10. <param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
  11. <param name="alone-sound" value="conference/conf-alone.wav"/>
  12. <param name="moh-sound" value="$${hold_music}"/>
  13. <param name="enter-sound" value="tone_stream://%(200,0,500,600,700)"/>
  14. <param name="exit-sound" value="tone_stream://%(500,0,300,200,100,50,25)"/>
  15. <param name="kicked-sound" value="conference/conf-kicked.wav"/>
  16. <param name="locked-sound" value="conference/conf-locked.wav"/>
  17. <param name="is-locked-sound" value="conference/conf-is-locked.wav"/>
  18. <param name="is-unlocked-sound" value="conference/conf-is-unlocked.wav"/>
  19. <param name="pin-sound" value="conference/conf-pin.wav"/>
  20. <param name="bad-pin-sound" value="conference/conf-bad-pin.wav"/>
  21. <param name="caller-id-name" value="$${outbound_caller_name}"/>
  22. <param name="caller-id-number" value="$${outbound_caller_id}"/>
  23. <param name="comfort-noise" value="false"/>
  24. <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"/>
  25. <param name="video-auto-floor-msec" value="1000"/>
  26. <param name="video-mode" value="mux"/>
  27. <param name="video-layout-name" value="1x1"/>
  28. <param name="video-layout-name" value="group:grid"/>
  29. <param name="video-canvas-size" value="640x480"/>
  30. <param name="video-canvas-bgcolor" value="#333333"/>
  31. <param name="video-layout-bgcolor" value="#000000"/>
  32. <param name="video-codec-bandwidth" value="1mb"/>
  33. <param name="video-fps" value="30"/>
  34. </profile>

入会dialplan

文件:conf/dialplan/public.xml

  1. <extension name="CallIn_To_Bot_">
  2. <condition field="destination_number" expression="^\+(\d+)$">
  3. <action application="set" data="core_video_blank_image=false"/>
  4. <action application="answer"/>
  5. <action application="conference" data="3000@video-mcu-stereo-320" />
  6. </condition>
  7. </extension>

API

呼叫软电话并入会

  1. originate {core_video_blank_image=false}sofia/external/1007@10.1.1.157:10020 +8881000 XML public

播放flv命令

  1. conference 3000 play av:///usr/local/freeswitch/flv/1.flv

停止播放flv

  1. conference 3000 stop all

!!!stop将会清空所有待播放的音视频列表!!!

事件

会议室新建

  1. RECV EVENT
  2. Event-Subclass: conference::maintenance
  3. Event-Name: CUSTOM
  4. Core-UUID: 6043ded1-0eff-457b-9740-9d5ed97eb827
  5. FreeSWITCH-Hostname: idc-146
  6. FreeSWITCH-Switchname: idc-146
  7. FreeSWITCH-IPv4: 10.1.1.146
  8. FreeSWITCH-IPv6: ::1
  9. Event-Date-Local: 2020-12-28 17:38:49
  10. Event-Date-GMT: Mon, 28 Dec 2020 09:38:49 GMT
  11. Event-Date-Timestamp: 1609148329962742
  12. Event-Calling-File: mod_conference.c
  13. Event-Calling-Function: conference_new
  14. Event-Calling-Line-Number: 3792
  15. Event-Sequence: 6979
  16. Conference-Name: 3000
  17. Conference-Domain: 10.1.1.146
  18. Conference-Size: 0
  19. Conference-Ghosts: 0
  20. Conference-Profile-Name: video-mcu-stereo-320
  21. Conference-Unique-ID: 3f9c6f47-0673-4852-97a0-7f3096dbba00
  22. Action: conference-create

会议室入会

  1. RECV EVENT
  2. Event-Subclass: conference::maintenance
  3. Event-Name: CUSTOM
  4. Core-UUID: 6043ded1-0eff-457b-9740-9d5ed97eb827
  5. FreeSWITCH-Hostname: idc-146
  6. FreeSWITCH-Switchname: idc-146
  7. FreeSWITCH-IPv4: 10.1.1.146
  8. FreeSWITCH-IPv6: ::1
  9. Event-Date-Local: 2020-12-28 17:38:49
  10. Event-Date-GMT: Mon, 28 Dec 2020 09:38:49 GMT
  11. Event-Date-Timestamp: 1609148329982767
  12. Event-Calling-File: conference_member.c
  13. Event-Calling-Function: conference_member_add
  14. Event-Calling-Line-Number: 931
  15. Event-Sequence: 6982
  16. Conference-Name: 3000
  17. Conference-Domain: 10.1.1.146
  18. Conference-Size: 1
  19. Conference-Ghosts: 0
  20. Conference-Profile-Name: video-mcu-stereo-320
  21. Conference-Unique-ID: 3f9c6f47-0673-4852-97a0-7f3096dbba00
  22. Floor: false
  23. Channel-State: CS_EXECUTE
  24. Channel-Call-State: ACTIVE
  25. Channel-State-Number: 4
  26. Channel-Name: sofia/external/1007@10.1.1.157:10020
  27. Unique-ID: 0eb06110-ff03-4d17-b452-6950aad3eee5
  28. Call-Direction: outbound
  29. Presence-Call-Direction: outbound
  30. Channel-HIT-Dialplan: true
  31. Channel-Call-UUID: 0eb06110-ff03-4d17-b452-6950aad3eee5
  32. Answer-State: answered
  33. Channel-Read-Codec-Name: L16
  34. Channel-Read-Codec-Rate: 8000
  35. Channel-Read-Codec-Bit-Rate: 128000
  36. Channel-Write-Codec-Name: PCMA
  37. Channel-Write-Codec-Rate: 8000
  38. Channel-Write-Codec-Bit-Rate: 64000
  39. Caller-Direction: outbound
  40. Caller-Logical-Direction: outbound
  41. Caller-Dialplan: XML
  42. Caller-Caller-ID-Name: Outbound Call
  43. Caller-Caller-ID-Number: 1007
  44. Caller-Orig-Caller-ID-Number: 0000000000
  45. Caller-Callee-ID-Number: 0000000000
  46. Caller-Network-Addr: 10.1.1.157
  47. Caller-ANI: 0000000000
  48. Caller-Destination-Number: +8881000
  49. Caller-Unique-ID: 0eb06110-ff03-4d17-b452-6950aad3eee5
  50. Caller-Source: src/switch_ivr_originate.c
  51. Caller-Transfer-Source: 1609148329:1f8deee5-b4f8-4503-9a4f-c7ad5a45fdda:bl_xfer:+8881000/public/XML
  52. Caller-Context: public
  53. Caller-RDNIS: 1007
  54. Caller-Channel-Name: sofia/external/1007@10.1.1.157:10020
  55. Caller-Profile-Index: 2
  56. Caller-Profile-Created-Time: 1609148329962742
  57. Caller-Channel-Created-Time: 1609148328242742
  58. Caller-Channel-Answered-Time: 1609148329962742
  59. Caller-Channel-Progress-Time: 1609148328622812
  60. Caller-Channel-Progress-Media-Time: 0
  61. Caller-Channel-Hangup-Time: 0
  62. Caller-Channel-Transfer-Time: 0
  63. Caller-Channel-Resurrect-Time: 0
  64. Caller-Channel-Bridged-Time: 0
  65. Caller-Channel-Last-Hold: 0
  66. Caller-Channel-Hold-Accum: 0
  67. Caller-Screen-Bit: true
  68. Caller-Privacy-Hide-Name: false
  69. Caller-Privacy-Hide-Number: false
  70. Video: true
  71. Hear: true
  72. See: true
  73. Speak: true
  74. Talking: false
  75. Mute-Detect: false
  76. Hold: false
  77. Member-ID: 28
  78. Member-Type: member
  79. Member-Ghost: false
  80. Energy-Level: 200
  81. Current-Energy: 0
  82. Action: add-member

会议室出会(用户挂断导致出会)

  1. RECV EVENT
  2. Event-Subclass: conference::maintenance
  3. Event-Name: CUSTOM
  4. Core-UUID: 6043ded1-0eff-457b-9740-9d5ed97eb827
  5. FreeSWITCH-Hostname: idc-146
  6. FreeSWITCH-Switchname: idc-146
  7. FreeSWITCH-IPv4: 10.1.1.146
  8. FreeSWITCH-IPv6: ::1
  9. Event-Date-Local: 2020-12-28 17:39:16
  10. Event-Date-GMT: Mon, 28 Dec 2020 09:39:16 GMT
  11. Event-Date-Timestamp: 1609148356802740
  12. Event-Calling-File: conference_member.c
  13. Event-Calling-Function: conference_member_del
  14. Event-Calling-Line-Number: 1319
  15. Event-Sequence: 7009
  16. Conference-Name: 3000
  17. Conference-Domain: 10.1.1.146
  18. Conference-Size: 0
  19. Conference-Ghosts: 0
  20. Conference-Profile-Name: video-mcu-stereo-320
  21. Conference-Unique-ID: 3f9c6f47-0673-4852-97a0-7f3096dbba00
  22. Floor: false
  23. Channel-State: CS_EXECUTE
  24. Channel-Call-State: ACTIVE
  25. Channel-State-Number: 10
  26. Channel-Name: sofia/external/1007@10.1.1.157:10020
  27. Unique-ID: 0eb06110-ff03-4d17-b452-6950aad3eee5
  28. Call-Direction: outbound
  29. Presence-Call-Direction: outbound
  30. Channel-HIT-Dialplan: true
  31. Channel-Call-UUID: 0eb06110-ff03-4d17-b452-6950aad3eee5
  32. Answer-State: hangup
  33. Hangup-Cause: NORMAL_CLEARING
  34. Channel-Read-Codec-Name: L16
  35. Channel-Read-Codec-Rate: 8000
  36. Channel-Read-Codec-Bit-Rate: 128000
  37. Channel-Write-Codec-Name: PCMA
  38. Channel-Write-Codec-Rate: 8000
  39. Channel-Write-Codec-Bit-Rate: 64000
  40. Caller-Direction: outbound
  41. Caller-Logical-Direction: outbound
  42. Caller-Dialplan: XML
  43. Caller-Caller-ID-Name: Outbound Call
  44. Caller-Caller-ID-Number: 1007
  45. Caller-Orig-Caller-ID-Number: 0000000000
  46. Caller-Callee-ID-Number: 0000000000
  47. Caller-Network-Addr: 10.1.1.157
  48. Caller-ANI: 0000000000
  49. Caller-Destination-Number: +8881000
  50. Caller-Unique-ID: 0eb06110-ff03-4d17-b452-6950aad3eee5
  51. Caller-Source: src/switch_ivr_originate.c
  52. Caller-Transfer-Source: 1609148329:1f8deee5-b4f8-4503-9a4f-c7ad5a45fdda:bl_xfer:+8881000/public/XML
  53. Caller-Context: public
  54. Caller-RDNIS: 1007
  55. Caller-Channel-Name: sofia/external/1007@10.1.1.157:10020
  56. Caller-Profile-Index: 2
  57. Caller-Profile-Created-Time: 1609148329962742
  58. Caller-Channel-Created-Time: 1609148328242742
  59. Caller-Channel-Answered-Time: 1609148329962742
  60. Caller-Channel-Progress-Time: 1609148328622812
  61. Caller-Channel-Progress-Media-Time: 0
  62. Caller-Channel-Hangup-Time: 0
  63. Caller-Channel-Transfer-Time: 0
  64. Caller-Channel-Resurrect-Time: 0
  65. Caller-Channel-Bridged-Time: 0
  66. Caller-Channel-Last-Hold: 0
  67. Caller-Channel-Hold-Accum: 0
  68. Caller-Screen-Bit: true
  69. Caller-Privacy-Hide-Name: false
  70. Caller-Privacy-Hide-Number: false
  71. Video: true
  72. Hear: true
  73. See: true
  74. Speak: true
  75. Talking: false
  76. Mute-Detect: false
  77. Hold: false
  78. Member-ID: 28
  79. Member-Type: member
  80. Member-Ghost: false
  81. Energy-Level: 200
  82. Current-Energy: 0
  83. Action: del-member

开始播放flv

  1. RECV EVENT
  2. Event-Subclass: conference::maintenance
  3. Event-Name: CUSTOM
  4. Core-UUID: 6043ded1-0eff-457b-9740-9d5ed97eb827
  5. FreeSWITCH-Hostname: idc-146
  6. FreeSWITCH-Switchname: idc-146
  7. FreeSWITCH-IPv4: 10.1.1.146
  8. FreeSWITCH-IPv6: ::1
  9. Event-Date-Local: 2020-12-28 17:38:59
  10. Event-Date-GMT: Mon, 28 Dec 2020 09:38:59 GMT
  11. Event-Date-Timestamp: 1609148339022748
  12. Event-Calling-File: conference_api.c
  13. Event-Calling-Function: conference_api_sub_play
  14. Event-Calling-Line-Number: 2828
  15. Event-Sequence: 6996
  16. Conference-Name: 3000
  17. Conference-Domain: 10.1.1.146
  18. Conference-Size: 1
  19. Conference-Ghosts: 0
  20. Conference-Profile-Name: video-mcu-stereo-320
  21. Conference-Unique-ID: 3f9c6f47-0673-4852-97a0-7f3096dbba00
  22. Action: play-file
  23. File: av:///usr/local/freeswitch/flv/1.flv
  24. Async: false

结束播放flv

  1. RECV EVENT
  2. Event-Subclass: conference::maintenance
  3. Event-Name: CUSTOM
  4. Core-UUID: 6043ded1-0eff-457b-9740-9d5ed97eb827
  5. FreeSWITCH-Hostname: idc-146
  6. FreeSWITCH-Switchname: idc-146
  7. FreeSWITCH-IPv4: 10.1.1.146
  8. FreeSWITCH-IPv6: ::1
  9. Event-Date-Local: 2020-12-28 17:39:05
  10. Event-Date-GMT: Mon, 28 Dec 2020 09:39:05 GMT
  11. Event-Date-Timestamp: 1609148345482802
  12. Event-Calling-File: conference_file.c
  13. Event-Calling-Function: conference_file_close
  14. Event-Calling-Line-Number: 52
  15. Event-Sequence: 6997
  16. Conference-Name: 3000
  17. Conference-Domain: 10.1.1.146
  18. Conference-Size: 1
  19. Conference-Ghosts: 0
  20. Conference-Profile-Name: video-mcu-stereo-320
  21. Conference-Unique-ID: 3f9c6f47-0673-4852-97a0-7f3096dbba00
  22. seconds: 6
  23. milliseconds: 6454
  24. samples: 309838
  25. Action: play-file-done
  26. File: av:///usr/local/freeswitch/flv/1.flv

注意:在队列中等待播放的视频文件,也会有结束播放事件!
区别是,seconds和milliseconds的值为0

  1. RECV EVENT
  2. Event-Subclass: conference::maintenance
  3. Event-Name: CUSTOM
  4. Core-UUID: 94a077e8-4ca1-4b30-80f1-54c29fbde926
  5. FreeSWITCH-Hostname: localhost.localdomain
  6. FreeSWITCH-Switchname: localhost.localdomain
  7. FreeSWITCH-IPv4: 172.16.101.170
  8. FreeSWITCH-IPv6: ::1
  9. Event-Date-Local: 2021-01-07 08:41:05
  10. Event-Date-GMT: Thu, 07 Jan 2021 08:41:05 GMT
  11. Event-Date-Timestamp: 1610008865659644
  12. Event-Calling-File: conference_file.c
  13. Event-Calling-Function: conference_file_close
  14. Event-Calling-Line-Number: 52
  15. Event-Sequence: 856
  16. Conference-Name: 3800
  17. Conference-Domain: 172.16.101.170
  18. Conference-Size: 1
  19. Conference-Ghosts: 0
  20. Conference-Profile-Name: video-mcu-stereo-320
  21. Conference-Unique-ID: 0f5db4bf-1934-4f3e-be14-683e52a06c42
  22. seconds: 0
  23. milliseconds: 0
  24. samples: 0
  25. Action: play-file-done
  26. File: av:///root/127.flv