Registeragent class
In Transactionclient Fail/success callback, the Registeragentlistener register Fail/sucess interface is called
Public classRegisteragentImplementsTransactionclientlistener, Subscriberdialoglistener {
Registeragentlistener Listener;
Publicregisteragent (... Registeragentlistener Listener, ...) {} Public voidOntranssuccessresponse (transactionclient ransaction, Message resp) {listener.onuaregistrationsuccess ( This, target, contact, result); } Public voidontransfailureresponse (transactionclient, Message resp) { listener.onuaregistrationfailure ( This , Target, contact, result); } Public voidontranstimeout (transactionclient transaction) {Listener.onuaregistrationfailure ( This, Target, Contac, "Timeout"); Listener.onuaregistrationsuccess ( This, Target, Contac, "Timeout"); }}
Transactionclient class/--->sipproviderlistener1. Extends Transaction
Public Abstract class Implements Sipproviderlistener, TimerListener { publicvoid onreceivedmessage (sipprovider Provider, Message msg) {}}
2. Transactionclient class
In the callback of the transaction fail/success (actual Sipprovider callback), the Fail/sucess interface of the transactionclient is called
Public classTransactionclientextendsTransaction {Transactionclientlistener transaction_listener; Publictransactionclient (Sipprovider sip_provider, Message req, Transactionclientlistener listener) {Super(Sip_provider); Request=NewMessage (req); Init (Listener, Request.gettransactionid ()); //This.transaction_listener = listener;} //The actual Sipprovider callback
Public voidOnreceivedmessage (Sipprovider provider, Message msg) {Transaction_listener.ontranssuccessresponse ( This, MSG); Transaction_listener.ontransfailureresponse ( This, MSG); } pulicvoidOnTimeOut (Timer to) {//Transaction_listener callback associated with the timeout }}
So, what object is Sipproviderlistener triggered?
Learning notes-SIP message receiving and processing flow based on sipdroid SIP audio and video telephony