| | |
| | | import javax.sip.message.Request;
|
| | | import javax.sip.message.Response;
|
| | |
|
| | | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform;
|
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
| | | import com.alibaba.fastjson.JSON;
|
| | | import com.genersoft.iot.vmp.gb28181.transmit.response.impl.*;
|
| | | import com.genersoft.iot.vmp.gb28181.transmit.response.impl.*;
|
| | | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
|
| | | import org.slf4j.Logger;
|
| | | import org.slf4j.LoggerFactory;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.beans.factory.annotation.Qualifier;
|
| | | import org.springframework.context.annotation.Lazy;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.genersoft.iot.vmp.conf.SipConfig;
|
| | |
| | |
|
| | | @Autowired
|
| | | private IVideoManagerStorager storager;
|
| | | |
| | |
|
| | | @Autowired
|
| | | private IRedisCatchStorage redisCatchStorage;
|
| | |
|
| | | @Autowired
|
| | | private EventPublisher publisher;
|
| | |
|
| | | @Autowired
|
| | | private SIPCommander cmder;
|
| | |
|
| | | @Autowired
|
| | | private SIPCommanderFroPlatform cmderFroPlatform;
|
| | |
|
| | | @Autowired
|
| | | private RedisUtil redis;
|
| | |
| | |
|
| | | @Autowired
|
| | | private CancelResponseProcessor cancelResponseProcessor;
|
| | | |
| | |
|
| | | @Autowired
|
| | | @Lazy
|
| | | private RegisterResponseProcessor registerResponseProcessor;
|
| | |
|
| | |
|
| | | @Autowired
|
| | | private OtherResponseProcessor otherResponseProcessor;
|
| | |
|
| | |
| | | Request request = evt.getRequest();
|
| | | String method = request.getMethod();
|
| | | // logger.info("接收到消息:"+request.getMethod());
|
| | | // sipSubscribe.getSubscribe(evt.getServerTransaction().getBranchId()).response(evt);
|
| | | if (Request.INVITE.equals(method)) {
|
| | | InviteRequestProcessor processor = new InviteRequestProcessor();
|
| | | processor.setRequestEvent(evt);
|
| | |
| | | processor.setDeferredResultHolder(deferredResultHolder);
|
| | | processor.setOffLineDetector(offLineDetector);
|
| | | processor.setCmder(cmder);
|
| | | processor.setCmderFroPlatform(cmderFroPlatform);
|
| | | processor.setStorager(storager);
|
| | | processor.setRedisCatchStorage(redisCatchStorage);
|
| | | return processor;
|
| | | } else {
|
| | | return new OtherRequestProcessor();
|
| | |
| | | return byeResponseProcessor;
|
| | | } else if (Request.CANCEL.equals(method)) {
|
| | | return cancelResponseProcessor;
|
| | | }else if (Request.REGISTER.equals(method)) {
|
| | | return registerResponseProcessor;
|
| | | } else {
|
| | | return otherResponseProcessor;
|
| | | }
|