/** Receives incoming calls (auto accept) */ public void listen() { for (UserAgent ua : uas) { if (ua != null) { ua.printLog("UAS: WAITING FOR INCOMING CALL"); if (!ua.user_profile.audio && !ua.user_profile.video) { ua.printLog("ONLY SIGNALING, NO MEDIA"); } ua.listen(); } } }
/** Makes a new call */ public boolean call(String target_url, boolean force) { int p = pref; boolean found = false; if (isRegistered(p) && Receiver.isFast(p)) found = true; else { for (p = 0; p < LINES; p++) if (isRegistered(p) && Receiver.isFast(p)) { found = true; break; } if (!found && force) { p = pref; if (Receiver.isFast(p)) found = true; else for (p = 0; p < LINES; p++) if (Receiver.isFast(p)) { found = true; break; } } } if (!found || (ua = uas[p]) == null) { if (PreferenceManager.getDefaultSharedPreferences(getUIContext()) .getBoolean(Settings.PREF_CALLBACK, Settings.DEFAULT_CALLBACK) && PreferenceManager.getDefaultSharedPreferences(getUIContext()) .getString(Settings.PREF_POSURL, Settings.DEFAULT_POSURL) .length() > 0) { Receiver.url("n=" + Uri.decode(target_url)); return true; } return false; } ua.printLog("UAC: CALLING " + target_url); if (!ua.user_profile.audio && !ua.user_profile.video) { ua.printLog("ONLY SIGNALING, NO MEDIA"); } return ua.call(target_url, false); }
public void rejectcall() { ua.printLog("UA: HANGUP"); ua.hangup(); }