码迷,mamicode.com
首页 > 其他好文 > 详细

学习笔记_基于Sipdroid的SIP音视频电话SIP消息接收处理流程

时间:2016-12-14 09:50:36      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:received   ssr   targe   result   super   ons   timeout   style   span   

RegisterAgent类

在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"); } }

 

TransactionClient类/--->SipProviderListener

1. extends Transaction

public abstract class Transaction implements SipProviderListener, TimerListener {
    public void onReceivedMessage(SipProvider provider, Message msg){}
}

2. TransactionClient类

在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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!