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 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) {
|
public MessageParser(XmppConnectionService service) {
|
||||||
super(service);
|
super(service);
|
||||||
|
|
|
@ -266,6 +266,7 @@ public class JingleConnectionManager extends AbstractConnectionManager {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final boolean fromSelf = from.asBareJid().equals(account.getJid().asBareJid());
|
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 boolean addressedDirectly = to != null && to.equals(account.getJid());
|
||||||
final AbstractJingleConnection.Id id;
|
final AbstractJingleConnection.Id id;
|
||||||
if (fromSelf) {
|
if (fromSelf) {
|
||||||
|
@ -474,12 +475,19 @@ public class JingleConnectionManager extends AbstractConnectionManager {
|
||||||
+ " to deliver reject");
|
+ " 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 {
|
} else {
|
||||||
Log.d(
|
Log.d(
|
||||||
Config.LOGTAG,
|
Config.LOGTAG,
|
||||||
account.getJid().asBareJid()
|
account.getJid().asBareJid()
|
||||||
+ ": retrieved out of order jingle message"
|
+ ": retrieved out of order jingle message from "
|
||||||
+ message);
|
+ from
|
||||||
|
+ message
|
||||||
|
+ ", addressedDirectly="
|
||||||
|
+ addressedDirectly);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1504,6 +1504,7 @@ public class JingleRtpConnection extends AbstractJingleConnection
|
||||||
}
|
}
|
||||||
this.message.setTime(timestamp);
|
this.message.setTime(timestamp);
|
||||||
startRinging();
|
startRinging();
|
||||||
|
sendJingleMessage("ringing");
|
||||||
} else {
|
} else {
|
||||||
Log.d(
|
Log.d(
|
||||||
Config.LOGTAG,
|
Config.LOGTAG,
|
||||||
|
|
Loading…
Reference in a new issue