0

I'm building a Jain Sip application that sends request and receives response. 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?

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

4

2 回答 2

0

我通过编辑 SIPTransaction 类(Jain Sip Lib)中的计时器因子解决了我的问题:原始值为 64 ,新值变为 14: 公式:超时 ms = timeout_factor*T1 //T1 是重传时间默认值:500ms; 超时因子默认值:64。默认超时值以毫秒为单位 = 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;
.......
}
于 2014-04-24T08:45:57.340 回答
0

不是做事的首选方式。您不需要编辑代码。为您的事务设置基本计时器间隔。查看 Transaction API 以了解如何执行此操作。

于 2014-05-09T16:30:37.163 回答