本文整理汇总了Java中javax.sip.ServerTransaction.getState方法的典型用法代码示例。如果您正苦于以下问题:Java ServerTransaction.getState方法的具体用法?Java ServerTransaction.getState怎么用?Java ServerTransaction.getState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.sip.ServerTransaction
的用法示例。
在下文中一共展示了ServerTransaction.getState方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendInviteOK
import javax.sip.ServerTransaction; //导入方法依赖的package包/类
private void sendInviteOK(RequestEvent requestEvent, ServerTransaction inviteTid, String toTag) {
try {
logger.info("sendInviteOK: " + inviteTid);
if (inviteTid.getState() != TransactionState.COMPLETED) {
logger.info("shootme: Dialog state before OK: "
+ inviteTid.getDialog().getState());
SipProvider sipProvider = (SipProvider) requestEvent.getSource();
Request request = requestEvent.getRequest();
Response okResponse = messageFactory.createResponse(Response.OK,
request);
ListeningPoint lp = sipProvider.getListeningPoint(transport);
int myPort = lp.getPort();
((ToHeader)okResponse.getHeader(ToHeader.NAME)).setTag(toTag);
Address address = addressFactory.createAddress("Shootme <sip:"
+ myAddress + ":" + myPort + ">");
ContactHeader contactHeader = headerFactory
.createContactHeader(address);
okResponse.addHeader(contactHeader);
inviteTid.sendResponse(okResponse);
logger.info("shootme: Dialog state after OK: "
+ inviteTid.getDialog().getState());
TestCase.assertEquals( DialogState.CONFIRMED , inviteTid.getDialog().getState() );
} else {
logger.info("semdInviteOK: inviteTid = " + inviteTid + " state = " + inviteTid.getState());
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
示例2: sendInviteOK
import javax.sip.ServerTransaction; //导入方法依赖的package包/类
private void sendInviteOK(RequestEvent requestEvent, ServerTransaction inviteTid, String toTag) {
try {
logger.info("sendInviteOK: " + inviteTid);
if (inviteTid.getState() != TransactionState.COMPLETED) {
logger.info("shootme: Dialog state before OK: "
+ inviteTid.getDialog().getState());
SipProvider sipProvider = (SipProvider) requestEvent.getSource();
Request request = requestEvent.getRequest();
Response okResponse = messageFactory.createResponse(Response.OK,
request);
ListeningPoint lp = sipProvider.getListeningPoint(transport);
int myPort = lp.getPort();
((ToHeader)okResponse.getHeader(ToHeader.NAME)).setTag(toTag);
Address address = addressFactory.createAddress("Shootme <sip:"
+ myAddress + ":" + myPort + ">");
ContactHeader contactHeader = headerFactory
.createContactHeader(address);
okResponse.addHeader(contactHeader);
inviteTid.sendResponse(okResponse);
logger.info("shootme: Dialog state after OK: "
+ inviteTid.getDialog().getState());
TestCase.assertEquals( DialogState.CONFIRMED , inviteTid.getDialog().getState() );
} else {
logger.info("semdInviteOK: inviteTid = " + inviteTid + " state = " + inviteTid.getState());
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
示例3: sendInviteOK
import javax.sip.ServerTransaction; //导入方法依赖的package包/类
private void sendInviteOK(RequestEvent requestEvent, ServerTransaction inviteTid, String toTag) {
try {
logger.info("sendInviteOK: " + inviteTid);
if (inviteTid.getState() == TransactionState.PROCEEDING) {
logger.info("shootme: Dialog state before OK: " + inviteTid.getDialog().getState());
System.err.println("shootme: Dialog state before OK: " + inviteTid.getDialog().getState());
SipProvider sipProvider = (SipProvider) requestEvent.getSource();
Request request = requestEvent.getRequest();
Response okResponse = messageFactory.createResponse(Response.OK, request);
ListeningPoint lp = sipProvider.getListeningPoint(transport);
int myPort = lp.getPort();
((ToHeader) okResponse.getHeader(ToHeader.NAME)).setTag(toTag);
Address address = addressFactory.createAddress("Shootme <sip:" + myAddress + ":" + myPort + ">");
ContactHeader contactHeader = headerFactory.createContactHeader(address);
okResponse.addHeader(contactHeader);
inviteTid.sendResponse(okResponse);
logger.info("shootme: Dialog state after OK: " + inviteTid.getDialog().getState());
TestCase.assertEquals(DialogState.CONFIRMED, inviteTid.getDialog().getState());
} else {
logger.info("semdInviteOK: inviteTid = " + inviteTid + " state = " + inviteTid.getState());
System.err.println("sentInviteOK: inviteTid = " + inviteTid + " state = " + inviteTid.getState());
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
示例4: sendInviteOK
import javax.sip.ServerTransaction; //导入方法依赖的package包/类
private void sendInviteOK(RequestEvent requestEvent, ServerTransaction inviteTid, String toTag) {
try {
logger.info("sendInviteOK: " + inviteTid);
if (inviteTid.getState() != TransactionState.COMPLETED) {
logger.info("shootme: Dialog state before OK: "
+ inviteTid.getDialog().getState());
SipProvider sipProvider = (SipProvider) requestEvent.getSource();
Request request = requestEvent.getRequest();
Response okResponse = messageFactory.createResponse(Response.OK,
request);
ListeningPoint lp = sipProvider.getListeningPoint(transport);
int myPort = lp.getPort();
((ToHeader)okResponse.getHeader(ToHeader.NAME)).setTag(toTag);
Address address = addressFactory.createAddress("Shootme <sip:"
+ myAddress + ":" + myPort + ";transport=" + transport+ ">");
ContactHeader contactHeader = headerFactory
.createContactHeader(address);
okResponse.addHeader(contactHeader);
inviteTid.sendResponse(okResponse);
logger.info("shootme: Dialog state after OK: "
+ inviteTid.getDialog().getState());
TestCase.assertEquals( DialogState.CONFIRMED , inviteTid.getDialog().getState() );
} else {
logger.info("semdInviteOK: inviteTid = " + inviteTid + " state = " + inviteTid.getState());
}
} catch (Exception ex) {
ex.printStackTrace();
}
}