diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java index c0c15d0b..0050d446 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java @@ -7,6 +7,7 @@ import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; import com.genersoft.iot.vmp.gb28181.SipLayer; import com.genersoft.iot.vmp.gb28181.bean.*; +import com.genersoft.iot.vmp.gb28181.dao.CommonGBChannelMapper; import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; import com.genersoft.iot.vmp.gb28181.session.SipInviteSessionManager; import com.genersoft.iot.vmp.gb28181.transmit.SIPSender; @@ -84,6 +85,9 @@ public class SIPCommanderForPlatform implements ISIPCommanderForPlatform { @Autowired private GitUtil gitUtil; + @Autowired + private CommonGBChannelMapper commonGBChannelMapper; + @Override public void register(Platform parentPlatform, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException { register(parentPlatform, null, null, errorEvent, okEvent, true); @@ -604,6 +608,11 @@ public class SIPCommanderForPlatform implements ISIPCommanderForPlatform { return; } + CommonGBChannel channel = commonGBChannelMapper.queryById(sendRtpItem.getChannelId()); + + if (channel == null) { + return; + } String characterSet = parentPlatform.getCharacterSet(); StringBuffer mediaStatusXml = new StringBuffer(200); @@ -611,7 +620,7 @@ public class SIPCommanderForPlatform implements ISIPCommanderForPlatform { .append("\r\n") .append("MediaStatus\r\n") .append("" + (int)((Math.random()*9+1)*100000) + "\r\n") - .append("" + sendRtpItem.getChannelId() + "\r\n") + .append("" + channel.getGbDeviceId() + "\r\n") .append("121\r\n") .append("\r\n");