DeviceProxyService 调整
This commit is contained in:
parent
28dfe97a5a
commit
39af43f7aa
@ -198,9 +198,12 @@ public class DeviceProxyService {
|
||||
|
||||
public TaskProcessor playbackTask(){
|
||||
return (Runnable sendOkResponse, SIPRequest request,String callId,String fromUrl, String toAddr,int toPort, MockingDevice device, String key, long time,String ssrc) -> {
|
||||
scheduledExecutorService.schedule(() -> {
|
||||
trying(request);
|
||||
sendOkResponse.run();
|
||||
try {
|
||||
TimeUnit.SECONDS.sleep(1);
|
||||
} catch (InterruptedException e) {
|
||||
log.error("{}", e.getMessage());
|
||||
}
|
||||
|
||||
String ackKey = GenericSubscribe.Helper.getKey(Request.ACK, callId);
|
||||
subscribe.getAckSubscribe().addPublisher(ackKey, 1, TimeUnit.MINUTES);
|
||||
subscribe.getAckSubscribe().addSubscribe(ackKey, new Flow.Subscriber<>() {
|
||||
@ -235,7 +238,8 @@ public class DeviceProxyService {
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 1, TimeUnit.SECONDS);
|
||||
trying(request);
|
||||
sendOkResponse.run();
|
||||
};
|
||||
}
|
||||
|
||||
@ -247,8 +251,6 @@ public class DeviceProxyService {
|
||||
log.error("{}", e.getMessage());
|
||||
}
|
||||
|
||||
trying(request);
|
||||
sendOkResponse.run();
|
||||
String ackKey = GenericSubscribe.Helper.getKey(Request.ACK, callId);
|
||||
subscribe.getAckSubscribe().addPublisher(ackKey, 1, TimeUnit.MINUTES);
|
||||
subscribe.getAckSubscribe().addSubscribe(ackKey, new Flow.Subscriber<>() {
|
||||
@ -297,7 +299,8 @@ public class DeviceProxyService {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
trying(request);
|
||||
sendOkResponse.run();
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user