简体   繁体   English

java jain sip如何最小化事务超时

[英]java jain sip how to minimize transaction timeout

I'm building a Jain Sip application that sends request and receives response. 我正在构建一个Jain Sip应用程序,该应用程序发送请求并接收响应。 In case the response is not received I need to handle it in my code, but the default delay before firing the processTimeout function is too long (~32 sec), how can I minimize it? 如果未收到响应,则需要在代码中进行处理,但是触发processTimeout函数之前的默认延迟过长(〜32秒),如何将其最小化?

below is a snippet of my code: 以下是我的代码段:

//Sending the request statfully:
sendRegisterStateful{
ClientTransaction transaction = this.sipProvider.getNewClientTransaction(request);
// Send the request statefully, through the client transaction.
transaction.sendRequest();

//Process timeout function:
public void processTimeou{
//Need to fire the timeout here after 7sec instead of ~32s
}

Thank you, Salim 谢谢萨利姆

I resolved my issue by editing the timer factor in SIPTransaction class (Jain Sip Lib): The original value was 64 , new value became 14: Formula: Timeout ms = timeout_factor*T1 //T1 is the retranmission time default: 500ms; 我通过编辑SIPTransaction类(Jain Sip Lib)中的计时器因子解决了我的问题:原始值为64,新值为14:公式:超时ms = timeout_factor * T1 // T1是重传时间默认值:500ms; timeout factor default: 64. Defalut timeout value in millisecond = 500*64 = 32000ms So I minimized the value of 64 in order to minimize the default time out 32000ms -> 7000ms 超时因子默认值:64。Defalut超时值(以毫秒为单位)= 500 * 64 = 32000ms因此,我将64的值最小化以最小化默认超时32000ms-> 7000ms

class SIPTransaction{ 
......
protected static final int TIMER_B = 14;

protected static final int TIMER_J = 14;

protected static final int TIMER_F = 14;

protected static final int TIMER_H = 14;
.......
}

Not the preferred way to do things. 不是首选的处理方式。 You should not need to edit code. 您不需要编辑代码。 Set the base timer interval for your transaction. 设置事务的基本计时器间隔。 Look through the Transaction API to see how to do that. 查看Transaction API,以了解如何进行操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM