如何配置JAIN-SIP客户端将流量发送到非标准端口?

时间:2015-02-22 05:40:57

标签: sip jain-sip

我已经检查了Stack Overflow上的其他问题并用Google搜索,但我似乎无法找到问题的答案:在客户端实现中使用JAIN-SIP时,如何配置它将SIP请求发送到配置为使用非标准端口的服务器?

这是我在日志文件中看到的消息:

<message
from="10.145.120.15:32095" 
to="54.241.2.206:5060" 
time="1424580783467"
isSender="true" 
transactionId="asdfgh3-6fc92a570580c48612146bb551a8b023-10.145.120.15-1-register-10.10.10.155-32095323632" 
callId="6fc92a570580c48612146bb551a8b023@10.145.120.15" 
firstLine="REGISTER sip:phone.plivo.com SIP/2.0" 
>

&#39; To&#39; line表示它正在发送到端口5060.我需要它将sip流量发送到配置为使用端口 5063 的sip服务器。有没有办法做到这一点?

如果有帮助,这是我用来发送sip注册请求的代码:

    // Create the "Request"
    Request request = this.messageFactory.createRequest("REGISTER sip:" + remoteServer + " SIP/2.0\r\n\r\n");
    request.addHeader(callIdHeader);
    request.addHeader(cSeqHeader);
    request.addHeader(fromHeader);
    request.addHeader(toHeader);
    request.addHeader(maxForwardsHeader);
    request.addHeader(viaHeader);
    request.addHeader(contactHeader);


    // Send the request
    this.sipProvider.sendRequest(request);  // Response received through SipListener method implementation on this class

1 个答案:

答案 0 :(得分:1)

您只需在请求URI或路由标头中设置端口即可。例如

REGISTER sip:phone.plivo.com:5063 SIP/2.0