标签:received ssr targe result super ons timeout style span
在TransactionClient Fail/Success的回调中, 调用RegisterAgentListener的Register Fail/Sucess接口
public class RegisterAgent implements TransactionClientListener, SubscriberDialogListener {
RegisterAgentListener listener;
public RegisterAgent(...RegisterAgentListener listener, ...) {} public void onTransSuccessResponse(TransactionClient ransaction, Message resp) { listener.onUaRegistrationSuccess(this, target, contact, result); } public void onTransFailureResponse(TransactionClient, Message resp) { listener.onUaRegistrationFailure(this, target, contact, result); } public void onTransTimeout(TransactionClient transaction) { listener.onUaRegistrationFailure(this, target, contac, "Timeout"); listener.onUaRegistrationSuccess(this, target, contac, "Timeout"); } }
public abstract class Transaction implements SipProviderListener, TimerListener { public void onReceivedMessage(SipProvider provider, Message msg){} }
在Transaction Fail/Success(实际的SipProvider回调)的回调中, 调用TransactionClient的 Fail/Sucess接口
public class TransactionClient extends Transaction { TransactionClientListener transaction_listener; public TransactionClient(SipProvider sip_provider, Message req, TransactionClientListener listener) { super(sip_provider); request = new Message(req); init(listener, request.getTransactionId()); //this.transaction_listener = listener; } //实际上的SipProvider回调
public void onReceivedMessage(SipProvider provider, Message msg) { transaction_listener.onTransSuccessResponse(this, msg); transaction_listener.onTransFailureResponse(this, msg); } pulic void onTimeout(Timer to) { //和超时相关的transaction_listener回调 } }
所以, SipProviderListener又是哪个对象触发的呢?
学习笔记_基于Sipdroid的SIP音视频电话SIP消息接收处理流程
标签:received ssr targe result super ons timeout style span
原文地址:http://www.cnblogs.com/elsarong/p/6177892.html