songww
2020-05-07 70091f29f2c3c3f974ffc2cc8f140db9f992ca0e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.genersoft.iot.vmp.gb28181.transmit.response.impl;
 
import javax.sip.Dialog;
import javax.sip.InvalidArgumentException;
import javax.sip.ResponseEvent;
import javax.sip.SipException;
import javax.sip.message.Request;
 
import org.springframework.stereotype.Component;
 
import com.genersoft.iot.vmp.conf.SipConfig;
import com.genersoft.iot.vmp.gb28181.SipLayer;
import com.genersoft.iot.vmp.gb28181.transmit.response.ISIPResponseProcessor;
 
/**    
 * @Description:处理INVITE响应
 * @author: songww
 * @date:   2020年5月3日 下午4:43:52     
 */
@Component
public class InviteResponseProcessor implements ISIPResponseProcessor {
 
    /**
     * 处理invite响应
     * 
     * @param request
     *            响应消息
     */ 
    @Override
    public void process(ResponseEvent evt, SipLayer layer, SipConfig config) {
        try {
            Dialog dialog = evt.getDialog();
            Request reqAck =dialog.createAck(1L);
            dialog.sendAck(reqAck);
        } catch (InvalidArgumentException | SipException e) {
            e.printStackTrace();
        }
    }
 
}