|
|
@@ -19,13 +19,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
-import javax.sip.ListeningPoint;
|
|
|
-import javax.sip.ObjectInUseException;
|
|
|
-import javax.sip.RequestEvent;
|
|
|
-import javax.sip.SipProvider;
|
|
|
+import javax.sip.*;
|
|
|
import javax.sip.address.SipURI;
|
|
|
import javax.sip.header.HeaderAddress;
|
|
|
import javax.sip.header.ToHeader;
|
|
|
+import java.text.ParseException;
|
|
|
import java.util.Iterator;
|
|
|
|
|
|
import static com.genersoft.iot.vmp.gb28181.utils.XmlUtil.getText;
|
|
|
@@ -105,7 +103,29 @@ public class DeviceControlQueryMessageHandler extends SIPRequestProcessorParent
|
|
|
if (!StringUtils.isEmpty(getText(rootElement,"PTZCmd")) && !parentPlatform.getServerGBId().equals(targetGBId)) {
|
|
|
String cmdString = getText(rootElement,"PTZCmd");
|
|
|
Device deviceForPlatform = storager.queryVideoDeviceByPlatformIdAndChannelId(parentPlatform.getServerGBId(), channelId);
|
|
|
- cmder.fronEndCmd(deviceForPlatform, channelId, cmdString);
|
|
|
+ cmder.fronEndCmd(deviceForPlatform, channelId, cmdString, eventResult -> {
|
|
|
+ // 失败的回复
|
|
|
+ try {
|
|
|
+ responseAck(evt, eventResult.statusCode, eventResult.msg);
|
|
|
+ } catch (SipException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } catch (InvalidArgumentException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } catch (ParseException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }, eventResult -> {
|
|
|
+ // 成功的回复
|
|
|
+ try {
|
|
|
+ responseAck(evt, eventResult.statusCode);
|
|
|
+ } catch (SipException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } catch (InvalidArgumentException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } catch (ParseException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
}
|