static class AudioListener extends Listener {
private final BA ba;
private final String eventName;
public AudioListener(BA ba, String eventName) {
this.ba = ba;
this.eventName = eventName;
}
@Override
public void onCallEstablished(SipAudioCall call) {
ba.raiseEventFromDifferentThread(call
, null, 0, eventName + "_callestablished", false, null);
}
@Override
public void onCallEnded(SipAudioCall call) {
ba.raiseEventFromDifferentThread(call
, null, 0, eventName + "_callended", false, null);
}
@Override
public void onCallBusy(SipAudioCall call) {
ba.raiseEventFromDifferentThread(call
, null, 0, eventName + "_callbusy", false, null);
}
@Override
public void onCalling(SipAudioCall call) {
ba.raiseEventFromDifferentThread(call
, null, 0, eventName + "_calling", false, null);
}
@Override
public void onError(SipAudioCall call, int errorCode, String errorMessage) {
ba.raiseEventFromDifferentThread(call
, null, 0, eventName + "_callerror", false, new Object[] {errorCode, errorMessage});
}
}