本文整理汇总了Java中javax.sip.RequestEvent.getDialog方法的典型用法代码示例。如果您正苦于以下问题:Java RequestEvent.getDialog方法的具体用法?Java RequestEvent.getDialog怎么用?Java RequestEvent.getDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.sip.RequestEvent
的用法示例。
在下文中一共展示了RequestEvent.getDialog方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processBye
import javax.sip.RequestEvent; //导入方法依赖的package包/类
/**
* Process the bye request.
*/
public void processBye(RequestEvent requestEvent,
ServerTransaction serverTransactionId) {
final Request request = requestEvent.getRequest();
final Dialog dialog = requestEvent.getDialog();
try {
final Response response = messageFactory.createResponse(200, request);
if(serverTransactionId == null) {
serverTransactionId = ((SipProvider)requestEvent.getSource()).getNewServerTransaction(request);
}
serverTransactionId.sendResponse(response);
} catch (Exception ex) {
ex.printStackTrace();
//System.exit(0);
}
}
示例2: processBye
import javax.sip.RequestEvent; //导入方法依赖的package包/类
/**
* Process the bye request.
*/
public void processBye(RequestEvent requestEvent,
ServerTransaction serverTransactionId) {
SipProvider sipProvider = (SipProvider) requestEvent.getSource();
Request request = requestEvent.getRequest();
Dialog dialog = requestEvent.getDialog();
System.out.println("local party = " + dialog.getLocalParty());
try {
System.out.println("shootme: got a bye sending OK.");
Response response = messageFactory.createResponse(200, request);
serverTransactionId.sendResponse(response);
System.out.println("Dialog State is "
+ serverTransactionId.getDialog().getState());
} catch (Exception ex) {
ex.printStackTrace();
System.exit(0);
}
}
示例3: processBye
import javax.sip.RequestEvent; //导入方法依赖的package包/类
/**
* Process the bye request.
*/
public void processBye(RequestEvent requestEvent,
ServerTransaction serverTransactionId) {
SipProvider sipProvider = (SipProvider) requestEvent.getSource();
Request request = requestEvent.getRequest();
Dialog dialog = requestEvent.getDialog();
logger.info("shootme: local party = " + dialog.getLocalParty());
try {
logger.info("shootme: got a bye sending OK.");
Response response = messageFactory.createResponse(200, request);
serverTransactionId.sendResponse(response);
logger.info("shootme: Dialog State is "
+ serverTransactionId.getDialog().getState());
} catch (Exception ex) {
logger.error("UNexpected exception",ex);
fail("UNexpected exception");
}
}
示例4: processBye
import javax.sip.RequestEvent; //导入方法依赖的package包/类
/**
* Process the bye request.
*/
public void processBye(RequestEvent requestEvent,
ServerTransaction serverTransactionId) {
SipProvider sipProvider = (SipProvider) requestEvent.getSource();
Request request = requestEvent.getRequest();
Dialog dialog = requestEvent.getDialog();
System.out.println("local party = " + dialog.getLocalParty());
try {
System.out.println("shootme: got a bye sending OK.");
Response response = messageFactory.createResponse(200, request);
serverTransactionId.sendResponse(response);
System.out.println("Shootme : Dialog State is "
+ serverTransactionId.getDialog().getState());
} catch (Exception ex) {
ex.printStackTrace();
System.exit(0);
}
}
示例5: processAck
import javax.sip.RequestEvent; //导入方法依赖的package包/类
/**
* Process the ACK request.
*/
public void processAck(RequestEvent requestEvent,
ServerTransaction serverTransaction) {
final Dialog dialog = requestEvent.getDialog();
final RequestExt request = (RequestExt) requestEvent.getRequest();
if(((SipURI)request.getFromHeader().getAddress().getURI()).getUser().equalsIgnoreCase(TIMER_USER)) {
timer.schedule(new ByeTask(dialog), BYE_DELAY) ;
}
}