support 'ringing' jingle message

This commit is contained in:
Daniel Gultsch 2023-09-14 11:21:43 +02:00
parent 381a058db0
commit fdd7f2926f
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2
3 changed files with 13 additions and 3 deletions

View file

@ -52,7 +52,8 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
private static final SimpleDateFormat TIME_FORMAT = new SimpleDateFormat("HH:mm:ss", Locale.ENGLISH);
private static final List<String> JINGLE_MESSAGE_ELEMENT_NAMES = Arrays.asList("accept", "propose", "proceed", "reject", "retract");
private static final List<String> JINGLE_MESSAGE_ELEMENT_NAMES =
Arrays.asList("accept", "propose", "proceed", "reject", "retract", "ringing");
public MessageParser(XmppConnectionService service) {
super(service);

View file

@ -266,6 +266,7 @@ public class JingleConnectionManager extends AbstractConnectionManager {
return;
}
final boolean fromSelf = from.asBareJid().equals(account.getJid().asBareJid());
// XEP version 0.6.0 sends proceed, reject, ringing to bare jid
final boolean addressedDirectly = to != null && to.equals(account.getJid());
final AbstractJingleConnection.Id id;
if (fromSelf) {
@ -474,12 +475,19 @@ public class JingleConnectionManager extends AbstractConnectionManager {
+ " to deliver reject");
}
}
} else if (addressedDirectly && "ringing".equals(message.getName())) {
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": " + from + " started ringing");
updateProposedSessionDiscovered(
account, from, sessionId, DeviceDiscoveryState.DISCOVERED);
} else {
Log.d(
Config.LOGTAG,
account.getJid().asBareJid()
+ ": retrieved out of order jingle message"
+ message);
+ ": retrieved out of order jingle message from "
+ from
+ message
+ ", addressedDirectly="
+ addressedDirectly);
}
}

View file

@ -1504,6 +1504,7 @@ public class JingleRtpConnection extends AbstractJingleConnection
}
this.message.setTime(timestamp);
startRinging();
sendJingleMessage("ringing");
} else {
Log.d(
Config.LOGTAG,