Skip to content

Commit 2ea480f

Browse files
committed
add ICE events
1 parent c0877fd commit 2ea480f

File tree

9 files changed

+187
-0
lines changed

9 files changed

+187
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package io.callstats.event.ice
2+
3+
import io.callstats.event.info.IceCandidate
4+
import io.callstats.event.info.IceCandidatePair
5+
6+
/**
7+
* When ICE Aborts, this event should be submitted
8+
*
9+
* @param remoteID remote user identifier
10+
* @param connectionID Unique identifier of connection between two endpoints. This identifier should remain the same throughout the life-time of the connection.
11+
* @param localIceCandidates list of local [IceCandidate]
12+
* @param remoteIceCandidates list of remote [IceCandidate]
13+
* @param iceCandidatePairs list of [IceCandidatePair]
14+
* @param prevIceConnectionState current ice connection state "checking" or "new"
15+
* @param delay delay in milliseconds (example: 3.5 seconds is 3500 in milliseconds)
16+
*/
17+
class IceAbortedEvent(
18+
val remoteID: String,
19+
val connectionID: String,
20+
val localIceCandidates: Array<IceCandidate>,
21+
val remoteIceCandidates: Array<IceCandidate>,
22+
val iceCandidatePairs: Array<IceCandidatePair>,
23+
val prevIceConnectionState: String,
24+
val delay: Int) : IceEvent()
25+
{
26+
val eventType = "iceFailed"
27+
val currIceConnectionState = "closed"
28+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package io.callstats.event.ice
2+
3+
/**
4+
* When ICE connection disruption ends, this event should be submitted
5+
*
6+
* @param remoteID remote user identifier
7+
* @param connectionID Unique identifier of connection between two endpoints. This identifier should remain the same throughout the life-time of the connection.
8+
* @param delay delay in milliseconds (example: 3.5 seconds is 3500 in milliseconds)
9+
*/
10+
class IceConnectionDisruptEndEvent(
11+
val remoteID: String,
12+
val connectionID: String,
13+
val delay: Int) : IceEvent()
14+
{
15+
val eventType = "iceConnectionDisruptionEnd"
16+
val currIceConnectionState = "checking"
17+
val prevIceConnectionState = "disconnected"
18+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package io.callstats.event.ice
2+
3+
/**
4+
* When ICE connection disruption starts, this event should be submitted
5+
*
6+
* @param remoteID remote user identifier
7+
* @param connectionID Unique identifier of connection between two endpoints. This identifier should remain the same throughout the life-time of the connection.
8+
*/
9+
class IceConnectionDisruptStartEvent(
10+
val remoteID: String,
11+
val connectionID: String) : IceEvent()
12+
{
13+
val eventType = "iceConnectionDisruptionStart"
14+
val currIceConnectionState = "disconnected"
15+
val prevIceConnectionState = "checking"
16+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package io.callstats.event.ice
2+
3+
import io.callstats.event.info.IceCandidatePair
4+
5+
/**
6+
* When ICE disruption ends, this event should be submitted
7+
*
8+
* @param remoteID remote user identifier
9+
* @param connectionID Unique identifier of connection between two endpoints. This identifier should remain the same throughout the life-time of the connection.
10+
* @param currIceCandidatePair current [IceCandidatePair]
11+
* @param prevIceCandidatePair previous [IceCandidatePair]
12+
* @param currIceConnectionState current ice connection state "connected" or "completed" or "checking"
13+
* @param delay delay
14+
*/
15+
class IceDisruptEndEvent(
16+
val remoteID: String,
17+
val connectionID: String,
18+
val currIceCandidatePair: IceCandidatePair,
19+
val prevIceCandidatePair: IceCandidatePair,
20+
val currIceConnectionState: String,
21+
val delay: Int) : IceEvent()
22+
{
23+
val prevIceConnectionState = "disconnected"
24+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package io.callstats.event.ice
2+
3+
import io.callstats.event.info.IceCandidatePair
4+
5+
/**
6+
* When ICE disruption starts, this event should be submitted
7+
*
8+
* @param remoteID remote user identifier
9+
* @param connectionID Unique identifier of connection between two endpoints. This identifier should remain the same throughout the life-time of the connection.
10+
* @param currIceCandidatePair current [IceCandidatePair]
11+
* @param prevIceConnectionState previous ice connection state "connected" or "completed"
12+
*/
13+
class IceDisruptStartEvent(
14+
val remoteID: String,
15+
val connectionID: String,
16+
val currIceCandidatePair: IceCandidatePair,
17+
val prevIceConnectionState: String) : IceEvent()
18+
{
19+
val eventType = "iceDisruptionStart"
20+
val currIceConnectionState = "disconnected"
21+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package io.callstats.event.ice
2+
3+
import io.callstats.event.SessionEvent
4+
5+
/**
6+
* Base type for ICE events
7+
*/
8+
abstract class IceEvent : SessionEvent() {
9+
override fun path() = "event/ice/status"
10+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package io.callstats.event.ice
2+
3+
import io.callstats.event.info.IceCandidate
4+
import io.callstats.event.info.IceCandidatePair
5+
6+
/**
7+
* When ICE fails, this event should be submitted
8+
*
9+
* @param remoteID remote user identifier
10+
* @param connectionID Unique identifier of connection between two endpoints. This identifier should remain the same throughout the life-time of the connection.
11+
* @param localIceCandidates list of local [IceCandidate]
12+
* @param remoteIceCandidates list of remote [IceCandidate]
13+
* @param iceCandidatePairs list of [IceCandidatePair]
14+
* @param prevIceConnectionState current ice connection state "checking" or "disconnected"
15+
* @param delay delay in milliseconds (example: 3.5 seconds is 3500 in milliseconds)
16+
*/
17+
class IceFailedEvent(
18+
val remoteID: String,
19+
val connectionID: String,
20+
val localIceCandidates: Array<IceCandidate>,
21+
val remoteIceCandidates: Array<IceCandidate>,
22+
val iceCandidatePairs: Array<IceCandidatePair>,
23+
val prevIceConnectionState: String,
24+
val delay: Int) : IceEvent()
25+
{
26+
val eventType = "iceFailed"
27+
val currIceConnectionState = "failed"
28+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package io.callstats.event.ice
2+
3+
import io.callstats.event.info.IceCandidatePair
4+
5+
/**
6+
* When ICE restarts, this event should be submitted
7+
*
8+
* @param remoteID remote user identifier
9+
* @param connectionID Unique identifier of connection between two endpoints. This identifier should remain the same throughout the life-time of the connection.
10+
* @param prevIceCandidatePair previous [IceCandidatePair]
11+
* @param prevIceConnectionState previous connection state "checking" or "connected" or "completed" or "failed" or "disconnected" or "closed"
12+
*/
13+
class IceRestartEvent(
14+
val remoteID: String,
15+
val connectionID: String,
16+
val prevIceCandidatePair: IceCandidatePair,
17+
val prevIceConnectionState: String) : IceEvent()
18+
{
19+
val eventType = "iceRestarted"
20+
val currIceConnectionState = "new"
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package io.callstats.event.ice
2+
3+
import io.callstats.event.info.IceCandidatePair
4+
5+
/**
6+
* When ICE Terminates, this event should be submitted
7+
*
8+
* @param remoteID remote user identifier
9+
* @param connectionID Unique identifier of connection between two endpoints. This identifier should remain the same throughout the life-time of the connection.
10+
* @param prevIceCandidatePair previous [IceCandidatePair]
11+
* @param prevIceConnectionState previous ice connection state "connected" or "completed" or "failed" or "disconnected"
12+
*/
13+
class IceTerminatedEvent(
14+
val remoteID: String,
15+
val connectionID: String,
16+
val prevIceCandidatePair: IceCandidatePair,
17+
val prevIceConnectionState: String) : IceEvent()
18+
{
19+
val eventType = "iceDisruptionStart"
20+
val currIceConnectionState = "closed"
21+
}

0 commit comments

Comments
 (0)