Commit 29/07/2025

This commit is contained in:
2025-07-29 18:34:55 +07:00
parent c076f31fcc
commit 86d81f030f
13 changed files with 136 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
package zello
import com.fasterxml.jackson.annotation.JsonPropertyOrder
@Suppress("unused")
@JsonPropertyOrder(value = ["command", "channel", "status", "users_online", "images_supported", "texting_supported", "locations_supported", "error", "error_type"])
class Event_OnChannelStatus {
var command: String="" // must be "on_channel_status"
var channel: String=""
var status: String="" // must be "online" or "offline"
var users_online: Int = 0
var images_supported: Boolean = false
var texting_supported: Boolean = false
var locations_supported: Boolean = false
var error: String? = null
var error_type: String? = null // either "unknown" or "configuration"
}

View File

@@ -0,0 +1,17 @@
package zello
import com.fasterxml.jackson.annotation.JsonPropertyOrder
@Suppress("unused")
@JsonPropertyOrder(value = ["command", "type", "codec", "codec_header", "packet_duration", "stream_id", "channel", "from", "for"])
class Event_OnStreamStart {
var command: String = "" // must be "on_stream_start"
var type: String = "" // must be "audio"
var codec: String = "" // must be "opus"
var codec_header: String = ""
var packet_duration: Int = 0 // in milliseconds
var stream_id: Int = 0
var channel: String=""
var from: String = "" // the user who started the stream
var For: String = "" // the user who is receiving the stream, should be "for" not "For"
}

View File

@@ -0,0 +1,10 @@
package zello
import com.fasterxml.jackson.annotation.JsonPropertyOrder
@Suppress("unused")
@JsonPropertyOrder(value = ["command", "stream_id"])
class Event_OnStreamStop {
var command: String = "" // must be "on_stream_stop
var stream_id: Int = 0
}

View File

@@ -0,0 +1,10 @@
package zello
import com.fasterxml.jackson.annotation.JsonPropertyOrder
@Suppress("unused")
@JsonPropertyOrder(value = ["command", "seq", "channel", "type", "thumbnail_content_length", "content_length", "width", "height", "source", "For"])
class SendImageCommand(val seq: Int, val channel: String, val thumbnail_content_length: Int, val content_length: Int, val width: Int, val height: Int, val source: String = "camera", val For: String?) {
val command: String = "send_image"
val type: String = "jpeg"
}

View File

@@ -0,0 +1,11 @@
package zello
import com.fasterxml.jackson.annotation.JsonPropertyOrder
@Suppress("unused")
@JsonPropertyOrder(value = ["seq", "success", "image_id"])
class SendImageReply {
var seq: Int = 0
var success: Boolean = false
var image_id: Int = 0
}

View File

@@ -0,0 +1,9 @@
package zello
import com.fasterxml.jackson.annotation.JsonPropertyOrder
@Suppress("unused")
@JsonPropertyOrder(value = ["command", "seq", "channel", "latitude", "longitude", "accuracy", "formatted_address", "For"])
class SendLocationCommand(val seq: Int, val channel: String, val latitude: Double, val longitude: Double, val accuracy: Double, val formatted_address: String, val For: String? = null) {
val command: String = "send_location"
}

View File

@@ -0,0 +1,10 @@
package zello
import com.fasterxml.jackson.annotation.JsonPropertyOrder
@Suppress("unused")
@JsonPropertyOrder(value = ["seq", "success"])
class SendLocationReply {
var seq: Int = 0
var success: Boolean = false
}

View File

@@ -0,0 +1,9 @@
package zello
import com.fasterxml.jackson.annotation.JsonPropertyOrder
@Suppress("unused")
@JsonPropertyOrder(value = ["command","seq", "channel", "text", "For"])
class SendTextMessageCommand(val seq: Int, val channel: String, val text: String, val For: String? = null) {
val command: String = "send_text_message"
}

View File

@@ -0,0 +1,10 @@
package zello
import com.fasterxml.jackson.annotation.JsonPropertyOrder
@Suppress("unused")
@JsonPropertyOrder(value = ["seq", "success"])
class SendTextMessageReply {
var seq: Int = 0
var success: Boolean = false
}

View File

@@ -0,0 +1,12 @@
package zello
import com.fasterxml.jackson.annotation.JsonPropertyOrder
@Suppress("unused")
@JsonPropertyOrder(value=["command","seq","channels","type","codec","codec_header","packet_duration","For"])
class StartStreamCommand(val seq: Int, val channels: String, val packet_duration: Int=20, val For:String ) {
val command: String = "start_stream"
val type: String = "audio"
val codec: String = "opus"
val codec_header: String ="gD4BPA==" // base64 encoded header for [opus codec header](https://github.com/zelloptt/zello-channel-api/blob/master/API.md#codec_header-attribute)
}

View File

@@ -0,0 +1,11 @@
package zello
import com.fasterxml.jackson.annotation.JsonPropertyOrder
@JsonPropertyOrder(value=["seq","success","stream_id"])
@Suppress("unused")
class StartStreamReply {
var seq : Int=0
var success: Boolean = false
var stream_id : Int = 0
}

View File

@@ -0,0 +1,9 @@
package zello
import com.fasterxml.jackson.annotation.JsonPropertyOrder
@Suppress("unused")
@JsonPropertyOrder(value = ["command", "seq", "stream_id", "channel"])
class StopStreamCommand(val seq: Int, val stream_id: Int, val channel: String) {
val command: String = "stop_stream"
}