mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-16 12:18:10 +00:00
update channels/douyin: add 212 mod 5 files
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2025-05-24 10:14:52
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-06-08 13:15:20
|
||||
* @LastEditTime: 2025-06-08 13:42:52
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -19,7 +19,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -33,7 +32,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
public class FreeSwitchConfig {
|
||||
|
||||
private final FreeSwitchProperties freeSwitchProperties;
|
||||
@Lazy
|
||||
|
||||
private final FreeSwitchEventListener freeSwitchEventListener;
|
||||
|
||||
/**
|
||||
@@ -59,10 +58,20 @@ public class FreeSwitchConfig {
|
||||
|
||||
// 订阅所有事件
|
||||
client.setEventSubscriptions("plain", "all");
|
||||
|
||||
//这里必须检查,防止网络抖动时,连接断开
|
||||
if (client.canSend()) {
|
||||
log.info("连接成功,准备发起呼叫...");
|
||||
//(异步)向1000用户发起呼叫,用户接通后,播放音乐/tmp/demo1.wav
|
||||
String callResult = client.sendAsyncApiCommand("originate", "user/1000 &playback(/tmp/demo.wav)");
|
||||
log.info("api uuid:" + callResult);
|
||||
}
|
||||
|
||||
log.info("FreeSwitch ESL连接成功");
|
||||
} catch (InboundConnectionFailure e) {
|
||||
log.error("FreeSwitch ESL连接失败: {}", e.getMessage(), e);
|
||||
// 处理连接失败的情况
|
||||
e.printStackTrace();
|
||||
log.error("FreeSwitch ESL连接失败: {}, {}", e.getMessage(), e);
|
||||
}
|
||||
|
||||
return client;
|
||||
|
||||
@@ -113,6 +113,7 @@ public class FreeSwitchEslInboundConfig {
|
||||
*/
|
||||
private void handleEvent(EslEvent event) {
|
||||
String eventName = event.getEventName();
|
||||
log.trace("处理事件: {} / {}", eventName, event.getEventHeaders());
|
||||
|
||||
switch(eventName) {
|
||||
case "CHANNEL_CREATE":
|
||||
|
||||
@@ -31,9 +31,8 @@ public class FreeSwitchEventListener implements IEslEventListener {
|
||||
@Override
|
||||
public void eventReceived(EslEvent eslEvent) {
|
||||
String eventName = eslEvent.getEventName();
|
||||
// String eventSubclass = eslEvent.getEventSubclass();
|
||||
|
||||
log.debug("收到FreeSwitch事件: {} / {}", eventName);
|
||||
log.debug("收到FreeSwitch事件: {} / {}", eventName, eslEvent.getEventHeaders());
|
||||
|
||||
// 处理不同类型的事件
|
||||
switch(eventName) {
|
||||
|
||||
Reference in New Issue
Block a user