本文整理汇总了Java中javax.sip.TimeoutEvent类的典型用法代码示例。如果您正苦于以下问题:Java TimeoutEvent类的具体用法?Java TimeoutEvent怎么用?Java TimeoutEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TimeoutEvent类属于javax.sip包,在下文中一共展示了TimeoutEvent类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: processTimeout
import javax.sip.TimeoutEvent; //导入依赖的package包/类
public void processTimeout(TimeoutEvent timeoutEvent) {
this.timeoutSeen = true;
ClientTransaction ctx = timeoutEvent.getClientTransaction();
TestCase.assertSame("Should see a timeout for INVITE", ctx,
this.inviteTid);
TestCase.assertEquals("Should be in proceeding state",
TransactionState.PROCEEDING, ctx.getState());
try {
Request cancelRequest = timeoutEvent.getClientTransaction()
.createCancel();
ClientTransaction cancelTx = this.provider
.getNewClientTransaction(cancelRequest);
cancelTx.sendRequest();
} catch (Exception ex) {
logger.error("Unexpected exception", ex);
TestCase.fail("Unexpected exception");
}
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:20,代码来源:CtxExpiredTest.java
示例2: processTimeout
import javax.sip.TimeoutEvent; //导入依赖的package包/类
public void processTimeout(TimeoutEvent transactionTimeOutEvent) {
Transaction transaction;
if (transactionTimeOutEvent.isServerTransaction()) {
transaction = transactionTimeOutEvent.getServerTransaction();
} else {
transaction = transactionTimeOutEvent.getClientTransaction();
}
Request request = transaction.getRequest();
if (request.getMethod().equals(Request.REGISTER)) {
registerProcessing.processTimeout(transaction, request);
} else if (request.getMethod().equals(Request.INVITE)) {
callProcessing.processTimeout(transaction, request);
} else {
// Just show an error for now
}
}
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:17,代码来源:SipManager.java
示例3: fireRetransmissionTimer
import javax.sip.TimeoutEvent; //导入依赖的package包/类
/**
* @see SIPTransactionImpl#fireRetransmissionTimer()
*/
@Override
public void fireRetransmissionTimer() {
try {
if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) {
logger.logDebug("fireRetransmissionTimer() -- " + this + " state " + getState());
}
// Resend the last response sent by this transaction
if (isInviteTransaction() && (lastResponse != null || lastResponseAsBytes != null)) {
// null can happen if this is terminating when the timer fires.
if (!this.retransmissionAlertEnabled || sipStack.isTransactionPendingAck(this) ) {
// Retransmit last response until ack.
if (lastResponseStatusCode / 100 >= 2 && !this.isAckSeen) {
resendLastResponseAsBytes();
}
} else {
// alert the application to retransmit the last response
SipProviderImpl sipProvider = (SipProviderImpl) this.getSipProvider();
TimeoutEvent txTimeout = new TimeoutEvent(sipProvider, this,
Timeout.RETRANSMIT);
sipProvider.handleEvent(txTimeout, this);
}
}
} catch (IOException e) {
if (logger.isLoggingEnabled())
logger.logException(e);
raiseErrorEvent(SIPTransactionErrorEvent.TRANSPORT_ERROR);
}
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:36,代码来源:SIPServerTransactionImpl.java
示例4: runTask
import javax.sip.TimeoutEvent; //导入依赖的package包/类
@Override
public void runTask() {
SIPClientTransaction ct = SIPClientTransactionImpl.this;
SipProviderImpl provider = ct.getSipProvider();
if (ct.getState() != TransactionState.TERMINATED) {
TimeoutEvent tte = new TimeoutEvent(provider, ct, Timeout.TRANSACTION);
provider.handleEvent(tte, ct);
} else {
if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) {
logger.logDebug("state = " + ct.getState());
}
}
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:15,代码来源:SIPClientTransactionImpl.java
示例5: processTimeout
import javax.sip.TimeoutEvent; //导入依赖的package包/类
public void processTimeout(TimeoutEvent timeoutEvent) {
Transaction transaction;
if (timeoutEvent.isServerTransaction()) {
transaction = timeoutEvent.getServerTransaction();
} else {
transaction = timeoutEvent.getClientTransaction();
}
logger.info("state = " + transaction.getState());
logger.info("dialog = " + transaction.getDialog());
logger.info("dialogState = "
+ transaction.getDialog().getState());
logger.info("Transaction Time out");
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:14,代码来源:RFC5626KeepAliveTest.java
示例6: fireRetransmissionTimer
import javax.sip.TimeoutEvent; //导入依赖的package包/类
/**
* Called by the transaction stack when a retransmission timer fires.
*/
public void fireRetransmissionTimer() {
try {
// Resend the last request sent
if (this.getInternalState() < 0 || !this.isMapped)
return;
boolean inv = isInviteTransaction();
int s = this.getInternalState();
// JvB: INVITE CTs only retransmit in CALLING, non-INVITE in both TRYING and
// PROCEEDING
// Bug-fix for non-INVITE transactions not retransmitted when 1xx response received
if ((inv && TransactionState._CALLING == s)
|| (!inv && (TransactionState._TRYING == s || TransactionState._PROCEEDING == s)))
{
// If the retransmission filter is disabled then
// retransmission of the INVITE is the application
// responsibility.
if (lastRequest != null) {
if (sipStack.generateTimeStampHeader
&& lastRequest.getHeader(TimeStampHeader.NAME) != null)
{
long milisec = System.currentTimeMillis();
TimeStamp timeStamp = new TimeStamp();
try {
timeStamp.setTimeStamp(milisec);
} catch (InvalidArgumentException ex) {
InternalErrorHandler.handleException(ex);
}
lastRequest.setHeader(timeStamp);
}
super.sendMessage(lastRequest);
if (this.notifyOnRetransmit) {
TimeoutEvent txTimeout = new TimeoutEvent(this.getSipProvider(),
this,
Timeout.RETRANSMIT);
this.getSipProvider().handleEvent(txTimeout, this);
}
if (this.timeoutIfStillInCallingState
&& this.getInternalState() == TransactionState._CALLING)
{
this.callingStateTimeoutCount--;
if (callingStateTimeoutCount == 0) {
TimeoutEvent timeoutEvent = new TimeoutEvent(this.getSipProvider(),
this,
Timeout.RETRANSMIT);
this.getSipProvider().handleEvent(timeoutEvent, this);
this.timeoutIfStillInCallingState = false;
}
}
}
}
} catch (IOException e) {
this.raiseIOExceptionEvent();
raiseErrorEvent(SIPTransactionErrorEvent.TRANSPORT_ERROR);
}
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:67,代码来源:SIPClientTransactionImpl.java
示例7: processTimeout
import javax.sip.TimeoutEvent; //导入依赖的package包/类
public void processTimeout(TimeoutEvent timeoutEvent) {
getSipListener(timeoutEvent).processTimeout(timeoutEvent);
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:4,代码来源:AbstractCancelTest.java
示例8: processTimeout
import javax.sip.TimeoutEvent; //导入依赖的package包/类
public void processTimeout(TimeoutEvent timeoutEvent) {
logger.info("Timeout occured");
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:4,代码来源:Proxy.java
示例9: processTimeout
import javax.sip.TimeoutEvent; //导入依赖的package包/类
public void processTimeout(TimeoutEvent timeoutEvent) {
logger.info("Transaction Time out");
logger.info("TimeoutEvent " + timeoutEvent.getTimeout());
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:6,代码来源:SelfroutingTest.java
示例10: processTimeout
import javax.sip.TimeoutEvent; //导入依赖的package包/类
public void processTimeout(TimeoutEvent timeoutEvent) {
logger.error("Timeout occured");
TestCase.fail("unexpected event");
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:5,代码来源:Proxy.java
示例11: processTimeout
import javax.sip.TimeoutEvent; //导入依赖的package包/类
public void processTimeout(TimeoutEvent timeoutEvent) {
logger.error("Timeout occured");
fail("unexpected event");
}
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:5,代码来源:Proxy.java
示例12: processTimeout
import javax.sip.TimeoutEvent; //导入依赖的package包/类
@Override
public void processTimeout(TimeoutEvent arg0) {
// TODO Auto-generated method stub
System.out.println("Transaction Time out");
}
开发者ID:SyMPHOnY-,项目名称:Smart-Home-Gateway,代码行数:6,代码来源:SipManager.java
示例13: processTimeout
import javax.sip.TimeoutEvent; //导入依赖的package包/类
@Override
public void processTimeout(TimeoutEvent evt) {
logger.info("processTimeout");
}
开发者ID:lmangani,项目名称:Reaper,代码行数:5,代码来源:ReaperListener.java
注:本文中的javax.sip.TimeoutEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论