From 10a297337bfedc78377cec121284e4c72e8857fd Mon Sep 17 00:00:00 2001 From: Razvan Kusztos Date: Mon, 23 Oct 2023 15:46:21 +0100 Subject: [PATCH 1/4] replace cycoresystems with polyai so that it works with please --- README.md | 16 ++++++++-------- _examples/bridge/main.go | 8 ++++---- _examples/helloworld/main.go | 2 +- _examples/play/main.go | 6 +++--- _examples/record/main.go | 6 +++--- _examples/stasisStart/main.go | 4 ++-- _examples/twoapps/main.go | 2 +- client/arimocks/Application.go | 2 +- client/arimocks/Asterisk.go | 2 +- client/arimocks/AsteriskVariables.go | 2 +- client/arimocks/Bridge.go | 2 +- client/arimocks/Bus.go | 2 +- client/arimocks/Channel.go | 2 +- client/arimocks/Client.go | 2 +- client/arimocks/Config.go | 2 +- client/arimocks/DTMFSender.go | 2 +- client/arimocks/DeviceState.go | 2 +- client/arimocks/Endpoint.go | 2 +- client/arimocks/Event.go | 2 +- client/arimocks/LiveRecording.go | 2 +- client/arimocks/Logging.go | 2 +- client/arimocks/Mailbox.go | 2 +- client/arimocks/Matcher.go | 2 +- client/arimocks/Modules.go | 2 +- client/arimocks/Playback.go | 2 +- client/arimocks/Player.go | 2 +- client/arimocks/Recorder.go | 2 +- client/arimocks/Sender.go | 2 +- client/arimocks/Sound.go | 2 +- client/arimocks/StoredRecording.go | 2 +- client/arimocks/Subscriber.go | 2 +- client/arimocks/Subscription.go | 2 +- client/native/application.go | 2 +- client/native/asterisk.go | 2 +- client/native/bridge.go | 4 ++-- client/native/channel.go | 4 ++-- client/native/client.go | 6 +++--- client/native/config.go | 2 +- client/native/device.go | 2 +- client/native/endpoint.go | 2 +- client/native/liveRecording.go | 2 +- client/native/logging.go | 2 +- client/native/mailbox.go | 2 +- client/native/modules.go | 2 +- client/native/playback.go | 2 +- client/native/sound.go | 2 +- client/native/storedRecording.go | 2 +- ext/bridgemon/README.md | 2 +- ext/bridgemon/bridgemon.go | 2 +- ext/keyfilter/keyfilter.go | 2 +- ext/play/example_test.go | 4 ++-- ext/play/play.go | 2 +- ext/play/play_test.go | 4 ++-- ext/play/sequence.go | 4 ++-- ext/play/sequence_test.go | 4 ++-- ext/play/session.go | 2 -- ext/record/record.go | 4 ++-- flake.nix | 4 ++-- go.mod | 2 +- internal/testutils/player.go | 2 +- internal/testutils/recorder.go | 2 +- stdbus/bus.go | 2 +- stdbus/bus_test.go | 2 +- 63 files changed, 87 insertions(+), 89 deletions(-) diff --git a/README.md b/README.md index 3de02036..9fecd6ad 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # ari - Golang Asterisk Rest Interface (ARI) library -[![Build Status](https://travis-ci.org/CyCoreSystems/ari.png)](https://travis-ci.org/CyCoreSystems/ari) [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/CyCoreSystems/ari/v6) +[![Build Status](https://travis-ci.org/PolyAI-LDN/ari.png)](https://travis-ci.org/PolyAI-LDN/ari) [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/PolyAI-LDN/ari/v6) This library allows you to easily access ARI in go applications. The Asterisk Rest Interface (https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=29395573) is an asynchronous API which allows you to access basic Asterisk objects for custom communications applications. @@ -17,11 +17,11 @@ Version `5.x.x` is the current version. There is also a NATS-based `ari-proxy` which is designed to work with this client library. It can be found at -[CyCoreSystems/ari-proxy](https://github.com/CyCoreSystems/ari-proxy). +[PolyAI-LDN/ari-proxy](https://github.com/PolyAI-LDN/ari-proxy). Install with: ```sh -go get github.com/CyCoreSystems/ari/v6 +go get github.com/PolyAI-LDN/ari/v6 ``` # Features @@ -194,7 +194,7 @@ There are a number of extensions which wrap the lower-level operations in higher-level ones, making it easier to perform many common tasks. -### AudioURI [![](https://godoc.org/github.com/CyCoreSystems/ari?status.svg)](http://godoc.org/github.com/CyCoreSystems/ari/ext/audiouri) +### AudioURI [![](https://godoc.org/github.com/PolyAI-LDN/ari?status.svg)](http://godoc.org/github.com/PolyAI-LDN/ari/ext/audiouri) Constructing Asterisk audio playback URIs can be a bit tedious, particularly for handling certain edge cases in digits and for constructing dates. @@ -202,7 +202,7 @@ certain edge cases in digits and for constructing dates. The `audiouri` package provides a number of routines to make the construction of these URIs simpler. -### Bridgemon [![](https://godoc.org/github.com/CyCoreSystems/ari?status.svg)](http://godoc.org/github.com/CyCoreSystems/ari/ext/bridgemon) +### Bridgemon [![](https://godoc.org/github.com/PolyAI-LDN/ari?status.svg)](http://godoc.org/github.com/PolyAI-LDN/ari/ext/bridgemon) Monitoring a bridge for events and data updates is not difficult, but it involves a lot of code and often makes several wasteful calls to obtain bridge @@ -215,7 +215,7 @@ retrieve the updated data without multiple requests. It also shuts itself down automatically when the bridge it is monitoring is destroyed. -### Play [![](https://godoc.org/github.com/CyCoreSystems/ari?status.svg)](http://godoc.org/github.com/CyCoreSystems/ari/ext/play) +### Play [![](https://godoc.org/github.com/PolyAI-LDN/ari?status.svg)](http://godoc.org/github.com/PolyAI-LDN/ari/ext/play) Playback of media and waiting for (DTMF) responses therefrom is an incredibly common task in telephony. ARI provides many tools to perform these types of @@ -233,7 +233,7 @@ The execution of a `Play` is configured by any number of option functions, which supply structured modifiers for the behaviour of the playback. You can even supply your own Match function for highly-customized matching. -### Record [![](https://godoc.org/github.com/CyCoreSystems/ari?status.svg)](http://godoc.org/github.com/CyCoreSystems/ari/ext/record) +### Record [![](https://godoc.org/github.com/PolyAI-LDN/ari?status.svg)](http://godoc.org/github.com/PolyAI-LDN/ari/ext/record) Making recordings is another complicated but common task for ARI applications. The `ext/record`, we provide a simple wrapper which facilitates many common @@ -248,7 +248,7 @@ Features include: # Documentation and Examples -Go documentation is available at https://godoc.org/github.com/CyCoreSystems/ari +Go documentation is available at https://godoc.org/github.com/PolyAI-LDN/ari Examples for helloworld, play, script, bridge, and record are available. Set your environment variables as described above (at minimum, `ARI_USERNAME` and `ARI_PASSWORD`) and run: diff --git a/_examples/bridge/main.go b/_examples/bridge/main.go index 44d211ce..d61c1c31 100644 --- a/_examples/bridge/main.go +++ b/_examples/bridge/main.go @@ -8,10 +8,10 @@ import ( "github.com/rotisserie/eris" "golang.org/x/exp/slog" - "github.com/CyCoreSystems/ari/v6" - "github.com/CyCoreSystems/ari/v6/client/native" - "github.com/CyCoreSystems/ari/v6/ext/play" - "github.com/CyCoreSystems/ari/v6/rid" + "github.com/PolyAI-LDN/ari/v6" + "github.com/PolyAI-LDN/ari/v6/client/native" + "github.com/PolyAI-LDN/ari/v6/ext/play" + "github.com/PolyAI-LDN/ari/v6/rid" ) var ariApp = "test" diff --git a/_examples/helloworld/main.go b/_examples/helloworld/main.go index 05d7f9b7..30b5d5b6 100644 --- a/_examples/helloworld/main.go +++ b/_examples/helloworld/main.go @@ -5,7 +5,7 @@ import ( "golang.org/x/exp/slog" - "github.com/CyCoreSystems/ari/v6/client/native" + "github.com/PolyAI-LDN/ari/v6/client/native" ) func main() { diff --git a/_examples/play/main.go b/_examples/play/main.go index 98ed0730..66707c82 100644 --- a/_examples/play/main.go +++ b/_examples/play/main.go @@ -6,9 +6,9 @@ import ( "golang.org/x/exp/slog" - "github.com/CyCoreSystems/ari/v6" - "github.com/CyCoreSystems/ari/v6/client/native" - "github.com/CyCoreSystems/ari/v6/ext/play" + "github.com/PolyAI-LDN/ari/v6" + "github.com/PolyAI-LDN/ari/v6/client/native" + "github.com/PolyAI-LDN/ari/v6/ext/play" ) var log = slog.New(slog.NewTextHandler(os.Stderr, nil)) diff --git a/_examples/record/main.go b/_examples/record/main.go index 62da83e1..04d66b3f 100644 --- a/_examples/record/main.go +++ b/_examples/record/main.go @@ -6,9 +6,9 @@ import ( "golang.org/x/exp/slog" - "github.com/CyCoreSystems/ari/v6" - "github.com/CyCoreSystems/ari/v6/client/native" - "github.com/CyCoreSystems/ari/v6/ext/record" + "github.com/PolyAI-LDN/ari/v6" + "github.com/PolyAI-LDN/ari/v6/client/native" + "github.com/PolyAI-LDN/ari/v6/ext/record" ) var log = slog.New(slog.NewTextHandler(os.Stderr, nil)) diff --git a/_examples/stasisStart/main.go b/_examples/stasisStart/main.go index 01749698..bbaa0b5c 100644 --- a/_examples/stasisStart/main.go +++ b/_examples/stasisStart/main.go @@ -8,8 +8,8 @@ import ( "golang.org/x/exp/slog" - "github.com/CyCoreSystems/ari/v6" - "github.com/CyCoreSystems/ari/v6/client/native" + "github.com/PolyAI-LDN/ari/v6" + "github.com/PolyAI-LDN/ari/v6/client/native" ) var log = slog.New(slog.NewTextHandler(os.Stderr, nil)) diff --git a/_examples/twoapps/main.go b/_examples/twoapps/main.go index 60acd9c9..89c3ee34 100644 --- a/_examples/twoapps/main.go +++ b/_examples/twoapps/main.go @@ -5,7 +5,7 @@ import ( "golang.org/x/exp/slog" - "github.com/CyCoreSystems/ari/v6/client/native" + "github.com/PolyAI-LDN/ari/v6/client/native" ) func main() { diff --git a/client/arimocks/Application.go b/client/arimocks/Application.go index 7043720a..b900583f 100644 --- a/client/arimocks/Application.go +++ b/client/arimocks/Application.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/Asterisk.go b/client/arimocks/Asterisk.go index 46fc9ddd..af9fd486 100644 --- a/client/arimocks/Asterisk.go +++ b/client/arimocks/Asterisk.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/AsteriskVariables.go b/client/arimocks/AsteriskVariables.go index 1e40ff00..2a5e389b 100644 --- a/client/arimocks/AsteriskVariables.go +++ b/client/arimocks/AsteriskVariables.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/Bridge.go b/client/arimocks/Bridge.go index bbdd8263..48422d08 100644 --- a/client/arimocks/Bridge.go +++ b/client/arimocks/Bridge.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/Bus.go b/client/arimocks/Bus.go index d602a2f4..9e81be8d 100644 --- a/client/arimocks/Bus.go +++ b/client/arimocks/Bus.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/Channel.go b/client/arimocks/Channel.go index 75624228..8ed3ef33 100644 --- a/client/arimocks/Channel.go +++ b/client/arimocks/Channel.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" time "time" diff --git a/client/arimocks/Client.go b/client/arimocks/Client.go index 02d716c1..8d41846a 100644 --- a/client/arimocks/Client.go +++ b/client/arimocks/Client.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" slog "golang.org/x/exp/slog" diff --git a/client/arimocks/Config.go b/client/arimocks/Config.go index 8eabd55f..904a6efc 100644 --- a/client/arimocks/Config.go +++ b/client/arimocks/Config.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/DTMFSender.go b/client/arimocks/DTMFSender.go index 252097d7..e607ccc5 100644 --- a/client/arimocks/DTMFSender.go +++ b/client/arimocks/DTMFSender.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/DeviceState.go b/client/arimocks/DeviceState.go index 75172efa..ac2fa110 100644 --- a/client/arimocks/DeviceState.go +++ b/client/arimocks/DeviceState.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/Endpoint.go b/client/arimocks/Endpoint.go index f5c08105..ce0fed6c 100644 --- a/client/arimocks/Endpoint.go +++ b/client/arimocks/Endpoint.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/Event.go b/client/arimocks/Event.go index 879a0ec0..721f579f 100644 --- a/client/arimocks/Event.go +++ b/client/arimocks/Event.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/LiveRecording.go b/client/arimocks/LiveRecording.go index e0f9636d..70f4dbcf 100644 --- a/client/arimocks/LiveRecording.go +++ b/client/arimocks/LiveRecording.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/Logging.go b/client/arimocks/Logging.go index 9b51c107..c40e8b50 100644 --- a/client/arimocks/Logging.go +++ b/client/arimocks/Logging.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/Mailbox.go b/client/arimocks/Mailbox.go index 9c37e89d..003b4bf7 100644 --- a/client/arimocks/Mailbox.go +++ b/client/arimocks/Mailbox.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/Matcher.go b/client/arimocks/Matcher.go index 52f7a19a..8596f7a3 100644 --- a/client/arimocks/Matcher.go +++ b/client/arimocks/Matcher.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/Modules.go b/client/arimocks/Modules.go index 24c154be..cb790769 100644 --- a/client/arimocks/Modules.go +++ b/client/arimocks/Modules.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/Playback.go b/client/arimocks/Playback.go index 6b812f2c..34607d35 100644 --- a/client/arimocks/Playback.go +++ b/client/arimocks/Playback.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/Player.go b/client/arimocks/Player.go index ab861f46..ebfa2cde 100644 --- a/client/arimocks/Player.go +++ b/client/arimocks/Player.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/Recorder.go b/client/arimocks/Recorder.go index c36b4c94..409101e5 100644 --- a/client/arimocks/Recorder.go +++ b/client/arimocks/Recorder.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/Sender.go b/client/arimocks/Sender.go index b07d98fc..5464f509 100644 --- a/client/arimocks/Sender.go +++ b/client/arimocks/Sender.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/Sound.go b/client/arimocks/Sound.go index 036bbef5..a2a77bff 100644 --- a/client/arimocks/Sound.go +++ b/client/arimocks/Sound.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/StoredRecording.go b/client/arimocks/StoredRecording.go index 078de546..0293d62d 100644 --- a/client/arimocks/StoredRecording.go +++ b/client/arimocks/StoredRecording.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/Subscriber.go b/client/arimocks/Subscriber.go index 645301ce..555da96d 100644 --- a/client/arimocks/Subscriber.go +++ b/client/arimocks/Subscriber.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/arimocks/Subscription.go b/client/arimocks/Subscription.go index f0800ffd..e88f43b4 100644 --- a/client/arimocks/Subscription.go +++ b/client/arimocks/Subscription.go @@ -3,7 +3,7 @@ package arimocks import ( - ari "github.com/CyCoreSystems/ari/v6" + ari "github.com/PolyAI-LDN/ari/v6" mock "github.com/stretchr/testify/mock" ) diff --git a/client/native/application.go b/client/native/application.go index 213b75da..c27d05ca 100644 --- a/client/native/application.go +++ b/client/native/application.go @@ -5,7 +5,7 @@ import ( "github.com/rotisserie/eris" - "github.com/CyCoreSystems/ari/v6" + "github.com/PolyAI-LDN/ari/v6" ) // Application is a native implementation of ARI's Application functions diff --git a/client/native/asterisk.go b/client/native/asterisk.go index 86a4a334..66745f9c 100644 --- a/client/native/asterisk.go +++ b/client/native/asterisk.go @@ -5,7 +5,7 @@ import ( "github.com/rotisserie/eris" - "github.com/CyCoreSystems/ari/v6" + "github.com/PolyAI-LDN/ari/v6" ) // Asterisk provides the ARI Asterisk accessors for a native client diff --git a/client/native/bridge.go b/client/native/bridge.go index 31fc30d6..488e3a7f 100644 --- a/client/native/bridge.go +++ b/client/native/bridge.go @@ -4,8 +4,8 @@ import ( "errors" "time" - "github.com/CyCoreSystems/ari/v6" - "github.com/CyCoreSystems/ari/v6/rid" + "github.com/PolyAI-LDN/ari/v6" + "github.com/PolyAI-LDN/ari/v6/rid" ) // Bridge provides the ARI Bridge accessors for the native client diff --git a/client/native/channel.go b/client/native/channel.go index a1111e79..06a9eb98 100644 --- a/client/native/channel.go +++ b/client/native/channel.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/CyCoreSystems/ari/v6" - "github.com/CyCoreSystems/ari/v6/rid" + "github.com/PolyAI-LDN/ari/v6" + "github.com/PolyAI-LDN/ari/v6/rid" ) // Channel provides the ARI Channel accessors for the native client diff --git a/client/native/client.go b/client/native/client.go index 166f3a36..1f8bbe4c 100644 --- a/client/native/client.go +++ b/client/native/client.go @@ -14,9 +14,9 @@ import ( "golang.org/x/exp/slog" "golang.org/x/net/websocket" - "github.com/CyCoreSystems/ari/v6" - "github.com/CyCoreSystems/ari/v6/rid" - "github.com/CyCoreSystems/ari/v6/stdbus" + "github.com/PolyAI-LDN/ari/v6" + "github.com/PolyAI-LDN/ari/v6/rid" + "github.com/PolyAI-LDN/ari/v6/stdbus" ) // Options describes the options for connecting to diff --git a/client/native/config.go b/client/native/config.go index a67af4ad..025ba723 100644 --- a/client/native/config.go +++ b/client/native/config.go @@ -3,7 +3,7 @@ package native import ( "github.com/rotisserie/eris" - "github.com/CyCoreSystems/ari/v6" + "github.com/PolyAI-LDN/ari/v6" ) // Config provides the ARI Configuration accessors for a native client diff --git a/client/native/device.go b/client/native/device.go index 542c0276..fc76fbfe 100644 --- a/client/native/device.go +++ b/client/native/device.go @@ -3,7 +3,7 @@ package native import ( "errors" - "github.com/CyCoreSystems/ari/v6" + "github.com/PolyAI-LDN/ari/v6" ) // DeviceState provides the ARI DeviceState accessors for the native client diff --git a/client/native/endpoint.go b/client/native/endpoint.go index d76e0fc8..08143924 100644 --- a/client/native/endpoint.go +++ b/client/native/endpoint.go @@ -3,7 +3,7 @@ package native import ( "errors" - "github.com/CyCoreSystems/ari/v6" + "github.com/PolyAI-LDN/ari/v6" ) // Endpoint provides the ARI Endpoint accessors for the native client diff --git a/client/native/liveRecording.go b/client/native/liveRecording.go index c0936660..40cd232a 100644 --- a/client/native/liveRecording.go +++ b/client/native/liveRecording.go @@ -3,7 +3,7 @@ package native import ( "errors" - "github.com/CyCoreSystems/ari/v6" + "github.com/PolyAI-LDN/ari/v6" ) // LiveRecording provides the ARI LiveRecording accessors for the native client diff --git a/client/native/logging.go b/client/native/logging.go index 53e97d25..c2dedc8d 100644 --- a/client/native/logging.go +++ b/client/native/logging.go @@ -3,7 +3,7 @@ package native import ( "github.com/rotisserie/eris" - "github.com/CyCoreSystems/ari/v6" + "github.com/PolyAI-LDN/ari/v6" ) // Logging provides the ARI Logging accessors for a native client diff --git a/client/native/mailbox.go b/client/native/mailbox.go index c3f56227..16f1583e 100644 --- a/client/native/mailbox.go +++ b/client/native/mailbox.go @@ -4,7 +4,7 @@ import ( "errors" "strconv" - "github.com/CyCoreSystems/ari/v6" + "github.com/PolyAI-LDN/ari/v6" ) // Mailbox provides the ARI Mailbox accessors for the native client diff --git a/client/native/modules.go b/client/native/modules.go index 2f0a030a..2f95328c 100644 --- a/client/native/modules.go +++ b/client/native/modules.go @@ -3,7 +3,7 @@ package native import ( "errors" - "github.com/CyCoreSystems/ari/v6" + "github.com/PolyAI-LDN/ari/v6" ) // Modules provides the ARI modules accessors for a native client diff --git a/client/native/playback.go b/client/native/playback.go index 8a00756a..8356e3d9 100644 --- a/client/native/playback.go +++ b/client/native/playback.go @@ -3,7 +3,7 @@ package native import ( "errors" - "github.com/CyCoreSystems/ari/v6" + "github.com/PolyAI-LDN/ari/v6" ) // Playback provides the ARI Playback accessors for the native client diff --git a/client/native/sound.go b/client/native/sound.go index e36f8f89..8464933b 100644 --- a/client/native/sound.go +++ b/client/native/sound.go @@ -4,7 +4,7 @@ import ( "errors" "net/url" - "github.com/CyCoreSystems/ari/v6" + "github.com/PolyAI-LDN/ari/v6" ) // Sound provides the ARI Sound accessors for the native client diff --git a/client/native/storedRecording.go b/client/native/storedRecording.go index 38458e30..f28ec7c9 100644 --- a/client/native/storedRecording.go +++ b/client/native/storedRecording.go @@ -4,7 +4,7 @@ import ( "errors" "io" - "github.com/CyCoreSystems/ari/v6" + "github.com/PolyAI-LDN/ari/v6" ) // StoredRecording provides the ARI StoredRecording accessors for the native client diff --git a/ext/bridgemon/README.md b/ext/bridgemon/README.md index c1e6e0a1..9a75e3dd 100644 --- a/ext/bridgemon/README.md +++ b/ext/bridgemon/README.md @@ -1,6 +1,6 @@ # bridgemon -[![](https://godoc.org/github.com/CyCoreSystems/ari?status.svg)](http://godoc.org/github.com/CyCoreSystems/ari) +[![](https://godoc.org/github.com/PolyAI-LDN/ari?status.svg)](http://godoc.org/github.com/PolyAI-LDN/ari) Bridge Monitor provides a simple tool to monitor and cache a bridge's data for easy, efficient access by other routines. It is safe for multi-threaded use and diff --git a/ext/bridgemon/bridgemon.go b/ext/bridgemon/bridgemon.go index 7e84f7a9..801ff353 100644 --- a/ext/bridgemon/bridgemon.go +++ b/ext/bridgemon/bridgemon.go @@ -3,7 +3,7 @@ package bridgemon import ( "sync" - "github.com/CyCoreSystems/ari/v6" + "github.com/PolyAI-LDN/ari/v6" ) // Monitor is a bridge monitor, which maintains bridge data. It monitors an ARI bridge for events and keeps an internal cache of the bridge's data. diff --git a/ext/keyfilter/keyfilter.go b/ext/keyfilter/keyfilter.go index 021ba251..ce1c2164 100644 --- a/ext/keyfilter/keyfilter.go +++ b/ext/keyfilter/keyfilter.go @@ -1,6 +1,6 @@ package keyfilter -import "github.com/CyCoreSystems/ari/v6" +import "github.com/PolyAI-LDN/ari/v6" // Kind filters a list of keys by a particular Kind func Kind(kind string, in []*ari.Key) (out []*ari.Key) { diff --git a/ext/play/example_test.go b/ext/play/example_test.go index 8e1a08c7..6f8c4f7c 100644 --- a/ext/play/example_test.go +++ b/ext/play/example_test.go @@ -5,8 +5,8 @@ import ( "fmt" "strings" - "github.com/CyCoreSystems/ari/v6" - "github.com/CyCoreSystems/ari/v6/client/arimocks" + "github.com/PolyAI-LDN/ari/v6" + "github.com/PolyAI-LDN/ari/v6/client/arimocks" ) func ExamplePlay() { diff --git a/ext/play/play.go b/ext/play/play.go index c9723901..24e2a39d 100644 --- a/ext/play/play.go +++ b/ext/play/play.go @@ -3,7 +3,7 @@ package play import ( "context" - "github.com/CyCoreSystems/ari/v6" + "github.com/PolyAI-LDN/ari/v6" ) // AllDTMF is a string which contains all possible diff --git a/ext/play/play_test.go b/ext/play/play_test.go index aaafd013..d73c9f61 100644 --- a/ext/play/play_test.go +++ b/ext/play/play_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/mock" - "github.com/CyCoreSystems/ari/v6" - "github.com/CyCoreSystems/ari/v6/client/arimocks" + "github.com/PolyAI-LDN/ari/v6" + "github.com/PolyAI-LDN/ari/v6/client/arimocks" ) type playStagedTest struct { diff --git a/ext/play/sequence.go b/ext/play/sequence.go index 2091197a..0f4b87fd 100644 --- a/ext/play/sequence.go +++ b/ext/play/sequence.go @@ -6,8 +6,8 @@ import ( "github.com/rotisserie/eris" - "github.com/CyCoreSystems/ari/v6" - "github.com/CyCoreSystems/ari/v6/rid" + "github.com/PolyAI-LDN/ari/v6" + "github.com/PolyAI-LDN/ari/v6/rid" ) // sequence represents an audio sequence playback session diff --git a/ext/play/sequence_test.go b/ext/play/sequence_test.go index 6b517a4b..1c9d302e 100644 --- a/ext/play/sequence_test.go +++ b/ext/play/sequence_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/mock" - "github.com/CyCoreSystems/ari/v6" - "github.com/CyCoreSystems/ari/v6/client/arimocks" + "github.com/PolyAI-LDN/ari/v6" + "github.com/PolyAI-LDN/ari/v6/client/arimocks" ) type sequenceTest struct { diff --git a/ext/play/session.go b/ext/play/session.go index 45d9d921..57466baf 100644 --- a/ext/play/session.go +++ b/ext/play/session.go @@ -5,8 +5,6 @@ import ( "errors" "sync" "time" - - "github.com/CyCoreSystems/ari/v6" ) // Session describes a structured Play session. diff --git a/ext/record/record.go b/ext/record/record.go index 067e7a5c..c52f685a 100644 --- a/ext/record/record.go +++ b/ext/record/record.go @@ -11,8 +11,8 @@ import ( "github.com/rotisserie/eris" "golang.org/x/exp/slog" - "github.com/CyCoreSystems/ari/v6" - "github.com/CyCoreSystems/ari/v6/rid" + "github.com/PolyAI-LDN/ari/v6" + "github.com/PolyAI-LDN/ari/v6/rid" ) var ( diff --git a/flake.nix b/flake.nix index 33b41a73..d8d4de2b 100644 --- a/flake.nix +++ b/flake.nix @@ -14,7 +14,7 @@ write-mailmap = pkgs.buildGoModule rec { name = "write_mailmap"; src = pkgs.fetchFromGitHub { - owner = "CyCoreSystems"; + owner = "PolyAI-LDN"; repo = "write_mailmap"; rev = "v0.3.0"; sha256 = "sha256-LzLLEtsWLeIOnlY1pygAOhTsGiWfISnuVF/jeoHHzaw="; @@ -42,7 +42,7 @@ cd $(git rev-parse --show-toplevel) write_mailmap > CONTRIBUTORS gofumpt -w . - gci write --skip-generated -s standard -s default -s "Prefix(github.com/CyCoreSystems)" . + gci write --skip-generated -s standard -s default -s "Prefix(github.com/PolyAI-LDN)" . golangci-lint run golangci-lint run ./_examples/bridge golangci-lint run ./_examples/helloworld diff --git a/go.mod b/go.mod index 5487e213..5073af0c 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/CyCoreSystems/ari/v6 +module github.com/PolyAI-LDN/ari/v6 go 1.20 diff --git a/internal/testutils/player.go b/internal/testutils/player.go index a0883cfd..b096fdbd 100644 --- a/internal/testutils/player.go +++ b/internal/testutils/player.go @@ -1,6 +1,6 @@ package testutils -import "github.com/CyCoreSystems/ari/v6" +import "github.com/PolyAI-LDN/ari/v6" // A PlayerPair is the pair of results returned from a mock Play request type PlayerPair struct { diff --git a/internal/testutils/recorder.go b/internal/testutils/recorder.go index 479665b0..f4ce6b07 100644 --- a/internal/testutils/recorder.go +++ b/internal/testutils/recorder.go @@ -1,6 +1,6 @@ package testutils -import "github.com/CyCoreSystems/ari/v6" +import "github.com/PolyAI-LDN/ari/v6" // A RecorderPair is the pair of results returned from a mock Record request type RecorderPair struct { diff --git a/stdbus/bus.go b/stdbus/bus.go index ffa335a0..ce78a1cf 100644 --- a/stdbus/bus.go +++ b/stdbus/bus.go @@ -3,7 +3,7 @@ package stdbus import ( "sync" - "github.com/CyCoreSystems/ari/v6" + "github.com/PolyAI-LDN/ari/v6" ) // subscriptionEventBufferSize defines the number of events that each diff --git a/stdbus/bus_test.go b/stdbus/bus_test.go index c000f64d..e0ac7732 100644 --- a/stdbus/bus_test.go +++ b/stdbus/bus_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/CyCoreSystems/ari/v6" + "github.com/PolyAI-LDN/ari/v6" ) var dtmfTestEventData = ` From 5d96f29bc53e88b9a18f190adec45f7e19fe3563 Mon Sep 17 00:00:00 2001 From: Razvan Kusztos Date: Mon, 23 Oct 2023 16:07:17 +0100 Subject: [PATCH 2/4] remove gogo protobuf dependency --- Makefile | 2 +- ari.pb.go | 2090 +++++++++-------------------------------------------- ari.proto | 4 +- 3 files changed, 355 insertions(+), 1741 deletions(-) diff --git a/Makefile b/Makefile index d7fd4eda..5cb28842 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ contributors: write_mailmap > CONTRIBUTORS protobuf: ari.proto - protoc -I. -I./vendor -I$(GOPATH)/src --gogofast_out=Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,plugins=grpc:. ari.proto + protoc --go_out=. ari.proto dep: go mod tidy diff --git a/ari.pb.go b/ari.pb.go index 39faf5ab..5b8db918 100644 --- a/ari.pb.go +++ b/ari.pb.go @@ -1,178 +1,181 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v4.22.2 // source: ari.proto package ari import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - types "github.com/gogo/protobuf/types" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) // Key identifies a unique resource in the system type Key struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Kind indicates the type of resource the Key points to. e.g., "channel", // "bridge", etc. Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` // ID indicates the unique identifier of the resource - ID string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // Node indicates the unique identifier of the Asterisk node on which the // resource exists or will be created Node string `protobuf:"bytes,3,opt,name=node,proto3" json:"node,omitempty"` // Dialog indicates a named scope of the resource, for receiving events Dialog string `protobuf:"bytes,4,opt,name=dialog,proto3" json:"dialog,omitempty"` // App indiciates the ARI application that this key is bound to. - App string `protobuf:"bytes,5,opt,name=app,proto3" json:"app,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + App string `protobuf:"bytes,5,opt,name=app,proto3" json:"app,omitempty"` } -func (m *Key) Reset() { *m = Key{} } -func (*Key) ProtoMessage() {} -func (*Key) Descriptor() ([]byte, []int) { - return fileDescriptor_01b1a3f980fd6d07, []int{0} +func (x *Key) Reset() { + *x = Key{} + if protoimpl.UnsafeEnabled { + mi := &file_ari_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Key) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *Key) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Key) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Key.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*Key) ProtoMessage() {} + +func (x *Key) ProtoReflect() protoreflect.Message { + mi := &file_ari_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *Key) XXX_Merge(src proto.Message) { - xxx_messageInfo_Key.Merge(m, src) -} -func (m *Key) XXX_Size() int { - return m.Size() -} -func (m *Key) XXX_DiscardUnknown() { - xxx_messageInfo_Key.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_Key proto.InternalMessageInfo +// Deprecated: Use Key.ProtoReflect.Descriptor instead. +func (*Key) Descriptor() ([]byte, []int) { + return file_ari_proto_rawDescGZIP(), []int{0} +} -func (m *Key) GetKind() string { - if m != nil { - return m.Kind +func (x *Key) GetKind() string { + if x != nil { + return x.Kind } return "" } -func (m *Key) GetID() string { - if m != nil { - return m.ID +func (x *Key) GetId() string { + if x != nil { + return x.Id } return "" } -func (m *Key) GetNode() string { - if m != nil { - return m.Node +func (x *Key) GetNode() string { + if x != nil { + return x.Node } return "" } -func (m *Key) GetDialog() string { - if m != nil { - return m.Dialog +func (x *Key) GetDialog() string { + if x != nil { + return x.Dialog } return "" } -func (m *Key) GetApp() string { - if m != nil { - return m.App +func (x *Key) GetApp() string { + if x != nil { + return x.App } return "" } // CallerID describes the name and number which identifies the caller to other endpoints type CallerID struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Name is the name of the party Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Number is the number of the party - Number string `protobuf:"bytes,2,opt,name=number,proto3" json:"number,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Number string `protobuf:"bytes,2,opt,name=number,proto3" json:"number,omitempty"` } -func (m *CallerID) Reset() { *m = CallerID{} } -func (*CallerID) ProtoMessage() {} -func (*CallerID) Descriptor() ([]byte, []int) { - return fileDescriptor_01b1a3f980fd6d07, []int{1} +func (x *CallerID) Reset() { + *x = CallerID{} + if protoimpl.UnsafeEnabled { + mi := &file_ari_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *CallerID) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *CallerID) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CallerID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CallerID.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*CallerID) ProtoMessage() {} + +func (x *CallerID) ProtoReflect() protoreflect.Message { + mi := &file_ari_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *CallerID) XXX_Merge(src proto.Message) { - xxx_messageInfo_CallerID.Merge(m, src) -} -func (m *CallerID) XXX_Size() int { - return m.Size() -} -func (m *CallerID) XXX_DiscardUnknown() { - xxx_messageInfo_CallerID.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_CallerID proto.InternalMessageInfo +// Deprecated: Use CallerID.ProtoReflect.Descriptor instead. +func (*CallerID) Descriptor() ([]byte, []int) { + return file_ari_proto_rawDescGZIP(), []int{1} +} -func (m *CallerID) GetName() string { - if m != nil { - return m.Name +func (x *CallerID) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *CallerID) GetNumber() string { - if m != nil { - return m.Number +func (x *CallerID) GetNumber() string { + if x != nil { + return x.Number } return "" } // ChannelData describes the data for a specific channel type ChannelData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Key is the key of the channel Key *Key `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // Id is the unique ID for this channel (AMI-style) - ID string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // Name is the name of this channel (tect/name-id) Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // State is the current state of the channel @@ -184,1743 +187,354 @@ type ChannelData struct { // Connected is the callerID of the connected line, if applicable Connected *CallerID `protobuf:"bytes,7,opt,name=connected,proto3" json:"connected,omitempty"` // Creationtime is the time at which the channel was created - Creationtime *types.Timestamp `protobuf:"bytes,8,opt,name=creationtime,proto3" json:"creationtime,omitempty"` + Creationtime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=creationtime,proto3" json:"creationtime,omitempty"` // Dialplan is the current location of the channel in the dialplan Dialplan *DialplanCEP `protobuf:"bytes,9,opt,name=dialplan,proto3" json:"dialplan,omitempty"` // Language is the default spoken language for this channel Language string `protobuf:"bytes,10,opt,name=language,proto3" json:"language,omitempty"` // ChannelVars is the list of channel variables set on this channel - ChannelVars map[string]string `protobuf:"bytes,11,rep,name=channelvars,proto3" json:"channelvars,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + ChannelVars map[string]string `protobuf:"bytes,11,rep,name=channel_vars,json=channelVars,proto3" json:"channel_vars,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (m *ChannelData) Reset() { *m = ChannelData{} } -func (m *ChannelData) String() string { return proto.CompactTextString(m) } -func (*ChannelData) ProtoMessage() {} -func (*ChannelData) Descriptor() ([]byte, []int) { - return fileDescriptor_01b1a3f980fd6d07, []int{2} +func (x *ChannelData) Reset() { + *x = ChannelData{} + if protoimpl.UnsafeEnabled { + mi := &file_ari_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ChannelData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ChannelData) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ChannelData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChannelData.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ChannelData) ProtoMessage() {} + +func (x *ChannelData) ProtoReflect() protoreflect.Message { + mi := &file_ari_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *ChannelData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChannelData.Merge(m, src) -} -func (m *ChannelData) XXX_Size() int { - return m.Size() -} -func (m *ChannelData) XXX_DiscardUnknown() { - xxx_messageInfo_ChannelData.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_ChannelData proto.InternalMessageInfo +// Deprecated: Use ChannelData.ProtoReflect.Descriptor instead. +func (*ChannelData) Descriptor() ([]byte, []int) { + return file_ari_proto_rawDescGZIP(), []int{2} +} -func (m *ChannelData) GetKey() *Key { - if m != nil { - return m.Key +func (x *ChannelData) GetKey() *Key { + if x != nil { + return x.Key } return nil } -func (m *ChannelData) GetID() string { - if m != nil { - return m.ID +func (x *ChannelData) GetId() string { + if x != nil { + return x.Id } return "" } -func (m *ChannelData) GetName() string { - if m != nil { - return m.Name +func (x *ChannelData) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *ChannelData) GetState() string { - if m != nil { - return m.State +func (x *ChannelData) GetState() string { + if x != nil { + return x.State } return "" } -func (m *ChannelData) GetAccountcode() string { - if m != nil { - return m.Accountcode +func (x *ChannelData) GetAccountcode() string { + if x != nil { + return x.Accountcode } return "" } -func (m *ChannelData) GetCaller() *CallerID { - if m != nil { - return m.Caller +func (x *ChannelData) GetCaller() *CallerID { + if x != nil { + return x.Caller } return nil } -func (m *ChannelData) GetConnected() *CallerID { - if m != nil { - return m.Connected +func (x *ChannelData) GetConnected() *CallerID { + if x != nil { + return x.Connected } return nil } -func (m *ChannelData) GetCreationtime() *types.Timestamp { - if m != nil { - return m.Creationtime +func (x *ChannelData) GetCreationtime() *timestamppb.Timestamp { + if x != nil { + return x.Creationtime } return nil } -func (m *ChannelData) GetDialplan() *DialplanCEP { - if m != nil { - return m.Dialplan +func (x *ChannelData) GetDialplan() *DialplanCEP { + if x != nil { + return x.Dialplan } return nil } -func (m *ChannelData) GetLanguage() string { - if m != nil { - return m.Language +func (x *ChannelData) GetLanguage() string { + if x != nil { + return x.Language } return "" } -func (m *ChannelData) GetChannelVars() map[string]string { - if m != nil { - return m.ChannelVars +func (x *ChannelData) GetChannelVars() map[string]string { + if x != nil { + return x.ChannelVars } return nil } // Dialplan describes a location in the Asterisk dialplan type DialplanCEP struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Context describes the section in the dialplan Context string `protobuf:"bytes,1,opt,name=context,proto3" json:"context,omitempty"` // Exten describes the label in the section of the dialplan Exten string `protobuf:"bytes,2,opt,name=exten,proto3" json:"exten,omitempty"` // Priority indicates the index at the label in the section of the dialplan - Priority int64 `protobuf:"varint,3,opt,name=priority,proto3" json:"priority,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DialplanCEP) Reset() { *m = DialplanCEP{} } -func (m *DialplanCEP) String() string { return proto.CompactTextString(m) } -func (*DialplanCEP) ProtoMessage() {} -func (*DialplanCEP) Descriptor() ([]byte, []int) { - return fileDescriptor_01b1a3f980fd6d07, []int{3} -} -func (m *DialplanCEP) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DialplanCEP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DialplanCEP.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DialplanCEP) XXX_Merge(src proto.Message) { - xxx_messageInfo_DialplanCEP.Merge(m, src) -} -func (m *DialplanCEP) XXX_Size() int { - return m.Size() -} -func (m *DialplanCEP) XXX_DiscardUnknown() { - xxx_messageInfo_DialplanCEP.DiscardUnknown(m) -} - -var xxx_messageInfo_DialplanCEP proto.InternalMessageInfo - -func (m *DialplanCEP) GetContext() string { - if m != nil { - return m.Context - } - return "" -} - -func (m *DialplanCEP) GetExten() string { - if m != nil { - return m.Exten - } - return "" -} - -func (m *DialplanCEP) GetPriority() int64 { - if m != nil { - return m.Priority - } - return 0 -} - -func init() { - proto.RegisterType((*Key)(nil), "asterisk.ari.Key") - proto.RegisterType((*CallerID)(nil), "asterisk.ari.CallerID") - proto.RegisterType((*ChannelData)(nil), "asterisk.ari.ChannelData") - proto.RegisterMapType((map[string]string)(nil), "asterisk.ari.ChannelData.ChannelvarsEntry") - proto.RegisterType((*DialplanCEP)(nil), "asterisk.ari.DialplanCEP") -} - -func init() { proto.RegisterFile("ari.proto", fileDescriptor_01b1a3f980fd6d07) } - -var fileDescriptor_01b1a3f980fd6d07 = []byte{ - // 526 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0xcd, 0x6a, 0xdb, 0x40, - 0x10, 0xae, 0x2c, 0xdb, 0xb1, 0x47, 0x81, 0x26, 0x4b, 0x30, 0x5b, 0x1f, 0x6c, 0xe3, 0x5e, 0x42, - 0xa1, 0x0a, 0xa4, 0x2d, 0x94, 0x50, 0x72, 0xb0, 0x9d, 0x43, 0xc8, 0xa5, 0x88, 0x52, 0x68, 0xa1, - 0x87, 0xb1, 0xb4, 0x55, 0x16, 0xcb, 0xbb, 0x62, 0xb5, 0x0a, 0xf1, 0x9b, 0xf4, 0xd8, 0x27, 0xe8, - 0x73, 0xf4, 0xd8, 0x27, 0x08, 0xc5, 0x4f, 0x12, 0x76, 0x57, 0xf2, 0x4f, 0x0e, 0xb9, 0xcd, 0x37, - 0xfa, 0xbe, 0x99, 0xfd, 0xf4, 0x0d, 0x74, 0x51, 0xf1, 0x30, 0x57, 0x52, 0x4b, 0x72, 0x88, 0x85, - 0x66, 0x8a, 0x17, 0x8b, 0x10, 0x15, 0xef, 0xbf, 0x4d, 0xb9, 0xbe, 0x2d, 0xe7, 0x61, 0x2c, 0x97, - 0x67, 0xa9, 0x4c, 0xe5, 0x99, 0x25, 0xcd, 0xcb, 0x9f, 0x16, 0x59, 0x60, 0x2b, 0x27, 0xee, 0x0f, - 0x53, 0x29, 0xd3, 0x8c, 0x6d, 0x59, 0x9a, 0x2f, 0x59, 0xa1, 0x71, 0x99, 0x3b, 0xc2, 0xb8, 0x04, - 0xff, 0x86, 0xad, 0x08, 0x81, 0xe6, 0x82, 0x8b, 0x84, 0x7a, 0x23, 0xef, 0xb4, 0x1b, 0xd9, 0x9a, - 0xf4, 0xa0, 0xc1, 0x13, 0xda, 0x30, 0x9d, 0x49, 0x7b, 0xfd, 0x30, 0x6c, 0x5c, 0xcf, 0xa2, 0x06, - 0x4f, 0x0c, 0x57, 0xc8, 0x84, 0x51, 0xdf, 0x71, 0x4d, 0x4d, 0x7a, 0xd0, 0x4e, 0x38, 0x66, 0x32, - 0xa5, 0x4d, 0xdb, 0xad, 0x10, 0x39, 0x02, 0x1f, 0xf3, 0x9c, 0xb6, 0x6c, 0xd3, 0x94, 0x17, 0xcd, - 0x5f, 0xbf, 0x87, 0x2f, 0xc6, 0x9f, 0xa0, 0x33, 0xc5, 0x2c, 0x63, 0xea, 0x7a, 0x66, 0xe7, 0xe1, - 0x92, 0xd5, 0xbb, 0x4d, 0x6d, 0xe6, 0x89, 0x72, 0x39, 0x67, 0xca, 0xed, 0x8f, 0x2a, 0x54, 0xa9, - 0xff, 0x34, 0x21, 0x98, 0xde, 0xa2, 0x10, 0x2c, 0x9b, 0xa1, 0x46, 0xf2, 0x1a, 0xfc, 0x05, 0x5b, - 0xd9, 0x01, 0xc1, 0xf9, 0x71, 0xb8, 0xfb, 0xc3, 0xc2, 0x1b, 0xb6, 0x8a, 0xcc, 0xd7, 0x67, 0xed, - 0x98, 0xf5, 0xfe, 0xce, 0xfa, 0x13, 0x68, 0x15, 0x1a, 0x35, 0xab, 0xdc, 0x38, 0x40, 0x46, 0x10, - 0x60, 0x1c, 0xcb, 0x52, 0xe8, 0xd8, 0xf8, 0x77, 0xa6, 0x76, 0x5b, 0x24, 0x84, 0x76, 0x6c, 0x6d, - 0xd1, 0xb6, 0x7d, 0x4b, 0x6f, 0xff, 0x2d, 0xb5, 0xe5, 0xa8, 0x62, 0x91, 0xf7, 0xd0, 0x8d, 0xa5, - 0x10, 0x2c, 0xd6, 0x2c, 0xa1, 0x07, 0xcf, 0x4a, 0xb6, 0x44, 0x72, 0x09, 0x87, 0xb1, 0x62, 0xa8, - 0xb9, 0x14, 0x26, 0x4e, 0xda, 0xb1, 0xc2, 0x7e, 0xe8, 0xb2, 0x0e, 0xeb, 0xac, 0xc3, 0x2f, 0x75, - 0xd6, 0xd1, 0x1e, 0x9f, 0x7c, 0x80, 0x8e, 0x89, 0x27, 0xcf, 0x50, 0xd0, 0xae, 0xd5, 0xbe, 0xda, - 0x5f, 0x3a, 0xab, 0xbe, 0x4e, 0xaf, 0x3e, 0x47, 0x1b, 0x2a, 0xe9, 0x43, 0x27, 0x43, 0x91, 0x96, - 0x98, 0x32, 0x0a, 0xd6, 0xfb, 0x06, 0x93, 0x1f, 0x10, 0xc4, 0x2e, 0x90, 0x3b, 0x54, 0x05, 0x0d, - 0x46, 0xfe, 0x69, 0x70, 0xfe, 0xe6, 0x89, 0x95, 0x6d, 0x62, 0x75, 0x6d, 0xc8, 0x57, 0x42, 0xab, - 0xd5, 0xe4, 0xe5, 0xfa, 0x61, 0x58, 0x67, 0xfa, 0x15, 0x55, 0x11, 0xed, 0xce, 0xeb, 0x5f, 0xc2, - 0xd1, 0x53, 0x85, 0x39, 0xad, 0x3a, 0xf4, 0xae, 0x4b, 0xf8, 0x04, 0x5a, 0x77, 0x98, 0x95, 0xac, - 0xba, 0x19, 0x07, 0x2e, 0x1a, 0x1f, 0xbd, 0xf1, 0x37, 0x08, 0x76, 0x3c, 0x11, 0x0a, 0x07, 0xb1, - 0x14, 0x9a, 0xdd, 0xeb, 0x4a, 0x5e, 0x43, 0x33, 0x82, 0xdd, 0x6b, 0x26, 0xea, 0x11, 0x16, 0x18, - 0xe7, 0xb9, 0xe2, 0x52, 0x71, 0xbd, 0xb2, 0x67, 0xe2, 0x47, 0x1b, 0x3c, 0x39, 0xfe, 0xbb, 0x1e, - 0x78, 0xff, 0xd6, 0x03, 0xef, 0xff, 0x7a, 0xe0, 0x7d, 0xf7, 0x51, 0xf1, 0x79, 0xdb, 0x26, 0xf0, - 0xee, 0x31, 0x00, 0x00, 0xff, 0xff, 0x98, 0xd4, 0xd1, 0x20, 0xc5, 0x03, 0x00, 0x00, -} - -func (m *Key) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Key) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Key) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.App) > 0 { - i -= len(m.App) - copy(dAtA[i:], m.App) - i = encodeVarintAri(dAtA, i, uint64(len(m.App))) - i-- - dAtA[i] = 0x2a - } - if len(m.Dialog) > 0 { - i -= len(m.Dialog) - copy(dAtA[i:], m.Dialog) - i = encodeVarintAri(dAtA, i, uint64(len(m.Dialog))) - i-- - dAtA[i] = 0x22 - } - if len(m.Node) > 0 { - i -= len(m.Node) - copy(dAtA[i:], m.Node) - i = encodeVarintAri(dAtA, i, uint64(len(m.Node))) - i-- - dAtA[i] = 0x1a - } - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintAri(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0x12 - } - if len(m.Kind) > 0 { - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintAri(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CallerID) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil + Priority int64 `protobuf:"varint,3,opt,name=priority,proto3" json:"priority,omitempty"` } -func (m *CallerID) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CallerID) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Number) > 0 { - i -= len(m.Number) - copy(dAtA[i:], m.Number) - i = encodeVarintAri(dAtA, i, uint64(len(m.Number))) - i-- - dAtA[i] = 0x12 +func (x *DialplanCEP) Reset() { + *x = DialplanCEP{} + if protoimpl.UnsafeEnabled { + mi := &file_ari_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintAri(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil } -func (m *ChannelData) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (x *DialplanCEP) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ChannelData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} +func (*DialplanCEP) ProtoMessage() {} -func (m *ChannelData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.ChannelVars) > 0 { - for k := range m.ChannelVars { - v := m.ChannelVars[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintAri(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintAri(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintAri(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x5a - } - } - if len(m.Language) > 0 { - i -= len(m.Language) - copy(dAtA[i:], m.Language) - i = encodeVarintAri(dAtA, i, uint64(len(m.Language))) - i-- - dAtA[i] = 0x52 - } - if m.Dialplan != nil { - { - size, err := m.Dialplan.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAri(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - if m.Creationtime != nil { - { - size, err := m.Creationtime.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAri(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.Connected != nil { - { - size, err := m.Connected.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAri(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if m.Caller != nil { - { - size, err := m.Caller.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAri(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if len(m.Accountcode) > 0 { - i -= len(m.Accountcode) - copy(dAtA[i:], m.Accountcode) - i = encodeVarintAri(dAtA, i, uint64(len(m.Accountcode))) - i-- - dAtA[i] = 0x2a - } - if len(m.State) > 0 { - i -= len(m.State) - copy(dAtA[i:], m.State) - i = encodeVarintAri(dAtA, i, uint64(len(m.State))) - i-- - dAtA[i] = 0x22 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintAri(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x1a - } - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintAri(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0x12 - } - if m.Key != nil { - { - size, err := m.Key.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAri(dAtA, i, uint64(size)) +func (x *DialplanCEP) ProtoReflect() protoreflect.Message { + mi := &file_ari_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - i-- - dAtA[i] = 0xa + return ms } - return len(dAtA) - i, nil -} - -func (m *DialplanCEP) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DialplanCEP) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return mi.MessageOf(x) } -func (m *DialplanCEP) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Priority != 0 { - i = encodeVarintAri(dAtA, i, uint64(m.Priority)) - i-- - dAtA[i] = 0x18 - } - if len(m.Exten) > 0 { - i -= len(m.Exten) - copy(dAtA[i:], m.Exten) - i = encodeVarintAri(dAtA, i, uint64(len(m.Exten))) - i-- - dAtA[i] = 0x12 - } - if len(m.Context) > 0 { - i -= len(m.Context) - copy(dAtA[i:], m.Context) - i = encodeVarintAri(dAtA, i, uint64(len(m.Context))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintAri(dAtA []byte, offset int, v uint64) int { - offset -= sovAri(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Key) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Kind) - if l > 0 { - n += 1 + l + sovAri(uint64(l)) - } - l = len(m.ID) - if l > 0 { - n += 1 + l + sovAri(uint64(l)) - } - l = len(m.Node) - if l > 0 { - n += 1 + l + sovAri(uint64(l)) - } - l = len(m.Dialog) - if l > 0 { - n += 1 + l + sovAri(uint64(l)) - } - l = len(m.App) - if l > 0 { - n += 1 + l + sovAri(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n +// Deprecated: Use DialplanCEP.ProtoReflect.Descriptor instead. +func (*DialplanCEP) Descriptor() ([]byte, []int) { + return file_ari_proto_rawDescGZIP(), []int{3} } -func (m *CallerID) Size() (n int) { - if m == nil { - return 0 +func (x *DialplanCEP) GetContext() string { + if x != nil { + return x.Context } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovAri(uint64(l)) - } - l = len(m.Number) - if l > 0 { - n += 1 + l + sovAri(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n + return "" } -func (m *ChannelData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Key != nil { - l = m.Key.Size() - n += 1 + l + sovAri(uint64(l)) - } - l = len(m.ID) - if l > 0 { - n += 1 + l + sovAri(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovAri(uint64(l)) - } - l = len(m.State) - if l > 0 { - n += 1 + l + sovAri(uint64(l)) - } - l = len(m.Accountcode) - if l > 0 { - n += 1 + l + sovAri(uint64(l)) - } - if m.Caller != nil { - l = m.Caller.Size() - n += 1 + l + sovAri(uint64(l)) - } - if m.Connected != nil { - l = m.Connected.Size() - n += 1 + l + sovAri(uint64(l)) - } - if m.Creationtime != nil { - l = m.Creationtime.Size() - n += 1 + l + sovAri(uint64(l)) - } - if m.Dialplan != nil { - l = m.Dialplan.Size() - n += 1 + l + sovAri(uint64(l)) - } - l = len(m.Language) - if l > 0 { - n += 1 + l + sovAri(uint64(l)) - } - if len(m.ChannelVars) > 0 { - for k, v := range m.ChannelVars { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovAri(uint64(len(k))) + 1 + len(v) + sovAri(uint64(len(v))) - n += mapEntrySize + 1 + sovAri(uint64(mapEntrySize)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) +func (x *DialplanCEP) GetExten() string { + if x != nil { + return x.Exten } - return n + return "" } -func (m *DialplanCEP) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Context) - if l > 0 { - n += 1 + l + sovAri(uint64(l)) - } - l = len(m.Exten) - if l > 0 { - n += 1 + l + sovAri(uint64(l)) - } - if m.Priority != 0 { - n += 1 + sovAri(uint64(m.Priority)) +func (x *DialplanCEP) GetPriority() int64 { + if x != nil { + return x.Priority } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovAri(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozAri(x uint64) (n int) { - return sovAri(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + return 0 } -func (m *Key) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Key: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Key: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAri - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAri - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAri - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Node = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Dialog", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAri - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Dialog = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field App", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAri - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.App = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAri(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAri - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +var File_ari_proto protoreflect.FileDescriptor + +var file_ari_proto_rawDesc = []byte{ + 0x0a, 0x09, 0x61, 0x72, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x61, 0x72, 0x69, + 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x67, 0x0a, 0x03, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x70, 0x70, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x61, 0x70, 0x70, 0x22, 0x36, 0x0a, 0x08, 0x43, 0x61, + 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x22, 0xe9, 0x03, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x08, 0x2e, 0x61, 0x72, 0x69, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x25, 0x0a, 0x06, 0x63, 0x61, + 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x72, 0x69, + 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x06, 0x63, 0x61, 0x6c, 0x6c, 0x65, + 0x72, 0x12, 0x2b, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x72, 0x69, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, + 0x72, 0x49, 0x44, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x3e, + 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x2c, + 0x0a, 0x08, 0x64, 0x69, 0x61, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x61, 0x72, 0x69, 0x2e, 0x44, 0x69, 0x61, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x43, + 0x45, 0x50, 0x52, 0x08, 0x64, 0x69, 0x61, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x12, 0x1a, 0x0a, 0x08, + 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x44, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x5f, 0x76, 0x61, 0x72, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x61, 0x72, 0x69, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, + 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x56, 0x61, 0x72, 0x73, 0x1a, 0x3e, + 0x0a, 0x10, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x59, + 0x0a, 0x0b, 0x44, 0x69, 0x61, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x43, 0x45, 0x50, 0x12, 0x18, 0x0a, + 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x78, 0x74, 0x65, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x12, 0x1a, 0x0a, + 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x42, 0x1b, 0x5a, 0x19, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x6f, 0x6c, 0x79, 0x41, 0x49, 0x2d, 0x4c, + 0x44, 0x4e, 0x2f, 0x61, 0x72, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -func (m *CallerID) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CallerID: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CallerID: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAri - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAri - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Number = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAri(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAri - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChannelData) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ChannelData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChannelData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAri - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Key == nil { - m.Key = &Key{} - } - if err := m.Key.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAri - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAri - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAri - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.State = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Accountcode", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAri - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Accountcode = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Caller", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAri - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Caller == nil { - m.Caller = &CallerID{} - } - if err := m.Caller.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Connected", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAri - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Connected == nil { - m.Connected = &CallerID{} - } - if err := m.Connected.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creationtime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAri - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Creationtime == nil { - m.Creationtime = &types.Timestamp{} - } - if err := m.Creationtime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Dialplan", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAri - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Dialplan == nil { - m.Dialplan = &DialplanCEP{} - } - if err := m.Dialplan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Language", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAri - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Language = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChannelVars", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAri - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ChannelVars == nil { - m.ChannelVars = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthAri - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthAri - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthAri - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthAri - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipAri(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAri - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.ChannelVars[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAri(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAri - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } +var ( + file_ari_proto_rawDescOnce sync.Once + file_ari_proto_rawDescData = file_ari_proto_rawDesc +) - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DialplanCEP) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break +func file_ari_proto_rawDescGZIP() []byte { + file_ari_proto_rawDescOnce.Do(func() { + file_ari_proto_rawDescData = protoimpl.X.CompressGZIP(file_ari_proto_rawDescData) + }) + return file_ari_proto_rawDescData +} + +var file_ari_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_ari_proto_goTypes = []interface{}{ + (*Key)(nil), // 0: ari.Key + (*CallerID)(nil), // 1: ari.CallerID + (*ChannelData)(nil), // 2: ari.ChannelData + (*DialplanCEP)(nil), // 3: ari.DialplanCEP + nil, // 4: ari.ChannelData.ChannelVarsEntry + (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp +} +var file_ari_proto_depIdxs = []int32{ + 0, // 0: ari.ChannelData.key:type_name -> ari.Key + 1, // 1: ari.ChannelData.caller:type_name -> ari.CallerID + 1, // 2: ari.ChannelData.connected:type_name -> ari.CallerID + 5, // 3: ari.ChannelData.creationtime:type_name -> google.protobuf.Timestamp + 3, // 4: ari.ChannelData.dialplan:type_name -> ari.DialplanCEP + 4, // 5: ari.ChannelData.channel_vars:type_name -> ari.ChannelData.ChannelVarsEntry + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_ari_proto_init() } +func file_ari_proto_init() { + if File_ari_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_ari_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Key); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil } } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DialplanCEP: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DialplanCEP: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAri - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Context = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Exten", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAri - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAri + file_ari_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CallerID); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Exten = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) - } - m.Priority = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAri - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Priority |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipAri(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAri - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipAri(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAri - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break + file_ari_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil } } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAri - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAri - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthAri - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupAri + file_ari_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DialplanCEP); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthAri - } - if depth == 0 { - return iNdEx, nil } } - return 0, io.ErrUnexpectedEOF + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ari_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ari_proto_goTypes, + DependencyIndexes: file_ari_proto_depIdxs, + MessageInfos: file_ari_proto_msgTypes, + }.Build() + File_ari_proto = out.File + file_ari_proto_rawDesc = nil + file_ari_proto_goTypes = nil + file_ari_proto_depIdxs = nil } - -var ( - ErrInvalidLengthAri = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowAri = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupAri = fmt.Errorf("proto: unexpected end of group") -) diff --git a/ari.proto b/ari.proto index d431bd89..984dc75c 100644 --- a/ari.proto +++ b/ari.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package asterisk.ari; +package ari; -option go_package = "ari"; +option go_package = "github.com/PolyAI-LDN/ari"; import "google/protobuf/timestamp.proto"; From d62f2653c4fd0317e40bffa3fc13f97e8b1a4882 Mon Sep 17 00:00:00 2001 From: Razvan Kusztos Date: Mon, 23 Oct 2023 16:20:21 +0100 Subject: [PATCH 3/4] remove gogo protobuf dependency and timestamppb --- ari.pb.go | 10 +++++----- channel.go | 21 ++++++++++++--------- go.mod | 2 +- go.sum | 36 ++++++------------------------------ 4 files changed, 24 insertions(+), 45 deletions(-) diff --git a/ari.pb.go b/ari.pb.go index 5b8db918..e6718ea3 100644 --- a/ari.pb.go +++ b/ari.pb.go @@ -31,7 +31,7 @@ type Key struct { // "bridge", etc. Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` // ID indicates the unique identifier of the resource - Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + ID string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // Node indicates the unique identifier of the Asterisk node on which the // resource exists or will be created Node string `protobuf:"bytes,3,opt,name=node,proto3" json:"node,omitempty"` @@ -80,9 +80,9 @@ func (x *Key) GetKind() string { return "" } -func (x *Key) GetId() string { +func (x *Key) GetID() string { if x != nil { - return x.Id + return x.ID } return "" } @@ -174,8 +174,8 @@ type ChannelData struct { // Key is the key of the channel Key *Key `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // Id is the unique ID for this channel (AMI-style) - Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + // ID is the unique ID for this channel (AMI-style) + ID string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // Name is the name of this channel (tect/name-id) Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // State is the current state of the channel diff --git a/channel.go b/channel.go index 6a1e314f..8cced2c5 100644 --- a/channel.go +++ b/channel.go @@ -2,10 +2,10 @@ package ari import ( "encoding/json" + "google.golang.org/protobuf/types/known/timestamppb" "strings" "time" - ptypes "github.com/gogo/protobuf/types" "github.com/rotisserie/eris" ) @@ -156,8 +156,13 @@ type channelDataJSON struct { // MarshalJSON encodes ChannelData to JSON func (d *ChannelData) MarshalJSON() ([]byte, error) { - t, err := ptypes.TimestampFromProto(d.Creationtime) - if err != nil { + var ( + t time.Time + ) + + if d.Creationtime.IsValid() { + t = d.Creationtime.AsTime() + } else { t = time.Now() } @@ -183,11 +188,9 @@ func (d *ChannelData) UnmarshalJSON(data []byte) error { return err } - t, err := ptypes.TimestampProto(time.Time(in.Creationtime)) - if err != nil { - t = &ptypes.Timestamp{ - Seconds: time.Now().Unix(), - } + t := timestamppb.New(time.Time(in.Creationtime)) + if !t.IsValid() { + t = timestamppb.Now() } *d = ChannelData{ @@ -303,7 +306,7 @@ func NewChannelHandle(key *Key, c Channel, exec func(ch *ChannelHandle) error) * // ID returns the identifier for the channel handle func (ch *ChannelHandle) ID() string { - return ch.key.ID + return ch.key.Id } // Key returns the key for the channel handle diff --git a/go.mod b/go.mod index 5073af0c..90fd7aa5 100644 --- a/go.mod +++ b/go.mod @@ -3,13 +3,13 @@ module github.com/PolyAI-LDN/ari/v6 go 1.20 require ( - github.com/gogo/protobuf v1.3.2 github.com/oklog/ulid v1.3.1 github.com/rotisserie/eris v0.5.4 github.com/stretchr/testify v1.7.0 golang.org/x/exp v0.0.0-20230905200255-921286631fa9 golang.org/x/net v0.7.0 golang.org/x/text v0.7.0 + google.golang.org/protobuf v1.31.0 ) require ( diff --git a/go.sum b/go.sum index a0b2b134..e2a1d396 100644 --- a/go.sum +++ b/go.sum @@ -2,10 +2,9 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -24,39 +23,16 @@ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 99ba69a85bcd482b2c7f1a6c8a0f3196b2dbebee Mon Sep 17 00:00:00 2001 From: Razvan Kusztos Date: Mon, 23 Oct 2023 16:28:38 +0100 Subject: [PATCH 4/4] rewrite bits of the protoc generated file --- ari.pb.go | 18 ++++++++---------- channel.go | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/ari.pb.go b/ari.pb.go index e6718ea3..f9211811 100644 --- a/ari.pb.go +++ b/ari.pb.go @@ -1,4 +1,10 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. +// Code generated by protoc-gen-go. + +// I had to edit this to avoid refactoring the rest of the library +// too much. Changes are: +// Id fields are replaced with ID +// the String() methods are implemented in other files, so removing from here. + // versions: // protoc-gen-go v1.28.1 // protoc v4.22.2 @@ -50,10 +56,6 @@ func (x *Key) Reset() { } } -func (x *Key) String() string { - return protoimpl.X.MessageStringOf(x) -} - func (*Key) ProtoMessage() {} func (x *Key) ProtoReflect() protoreflect.Message { @@ -129,10 +131,6 @@ func (x *CallerID) Reset() { } } -func (x *CallerID) String() string { - return protoimpl.X.MessageStringOf(x) -} - func (*CallerID) ProtoMessage() {} func (x *CallerID) ProtoReflect() protoreflect.Message { @@ -237,7 +235,7 @@ func (x *ChannelData) GetKey() *Key { func (x *ChannelData) GetId() string { if x != nil { - return x.Id + return x.ID } return "" } diff --git a/channel.go b/channel.go index 8cced2c5..17a4364d 100644 --- a/channel.go +++ b/channel.go @@ -306,7 +306,7 @@ func NewChannelHandle(key *Key, c Channel, exec func(ch *ChannelHandle) error) * // ID returns the identifier for the channel handle func (ch *ChannelHandle) ID() string { - return ch.key.Id + return ch.key.ID } // Key returns the key for the channel handle