|
|
@@ -76,12 +76,12 @@ public class SIPRequestHeaderProvider {
|
|
|
return request;
|
|
|
}
|
|
|
int count=1;
|
|
|
- public Request createInviteRequest(MediaDevice device, String channelId, String content, String viaTag, String fromTag, String toTag, String ssrc, CallIdHeader callIdHeader) throws ParseException, InvalidArgumentException, PeerUnavailableException {
|
|
|
+ public Request createInviteRequest(MediaDevice device,String destAddress, String channelId, String content, String viaTag, String fromTag, String toTag, String ssrc, CallIdHeader callIdHeader) throws ParseException, InvalidArgumentException, PeerUnavailableException {
|
|
|
SipServerConfig sipConfig=SipContext.getConfig();
|
|
|
SipFactory sipFactory=SipContext.getSipFactory();
|
|
|
Request request = null;
|
|
|
//请求行
|
|
|
- SipURI requestLine = sipFactory.createAddressFactory().createSipURI(channelId, device.getHostAddress());
|
|
|
+ SipURI requestLine = sipFactory.createAddressFactory().createSipURI(channelId, destAddress);
|
|
|
// SipURI requestLine = sipFactory.createAddressFactory().createSipURI(channelId, device.getHostAddress());
|
|
|
//via
|
|
|
ArrayList<ViaHeader> viaHeaders = new ArrayList<ViaHeader>();
|
|
|
@@ -97,7 +97,7 @@ public class SIPRequestHeaderProvider {
|
|
|
FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag);
|
|
|
//必须要有标记,否则无法创建会话,无法回应ack
|
|
|
//to
|
|
|
- SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(channelId,sipConfig.getDomain());
|
|
|
+ SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(channelId,destAddress);
|
|
|
Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI);
|
|
|
ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress,null);
|
|
|
|