support 'ringing' jingle message
This commit is contained in:
parent
381a058db0
commit
fdd7f2926f
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1504,6 +1504,7 @@ public class JingleRtpConnection extends AbstractJingleConnection
|
|||
}
|
||||
this.message.setTime(timestamp);
|
||||
startRinging();
|
||||
sendJingleMessage("ringing");
|
||||
} else {
|
||||
Log.d(
|
||||
Config.LOGTAG,
|
||||
|
|
Loading…
Reference in a new issue