CyCoreSystems / ari

Golang Asterisk REST Interface (ARI) library
Apache License 2.0
191 stars 73 forks source link

Connect issue, added ConnectWithContext to allow a context to be passed in, additional ChannelData and Bridge #150

Closed daninmadison closed 1 year ago

daninmadison commented 1 year ago
  1. Connect could become stuck if the listen did not successfully connect to the websocket. listen needed to call wg.Done if the context was cancelled.
  2. Modified the native client to include a ConnectWithContext function. This allows the caller to pass in their context. The Connect then uses this Context for the cancel. If the caller/parent cancels the Context, the child Connect routine detects the Context is closed and cleans up. This allows for a more complex environment with multiple go routines running under a parent/client model.
  3. ChannelData additions - Added ProtocolID to the ChannelData. For chan_sip and PJSIP this is the SIP header Call-ID value. Language was in the ChannelData protobuf, but was missing from the channel.go so applications could not retrieve the Language value.
  4. Added AppName and AppData to the DialplanCEP. This allows the application to know the current dialplan application and the parameters (data) passed to the application. If ARI disconnects or is starting up, an application should retrieve a list of it's current channels. If the channels have stasis application name, we know we are in control of the call via ARI. The AppData field allows us to retrieve a list of any parameters that were passed to the stasis application. This is very important because Asterisk will keep the call in stasis control once it has done this. Without retrieving a list of channels, we will have calls stuck in Stasis control. PJSIP and chan_sip calls will be disconnected. However, local channels or ExternalMedia channels could become permanently stuck.
  5. Updated bridge.go to include the CreationTime, VideoMode, and VideoSourceID fields that Asterisk has included for some time.
  6. Updated the CONTRIBUTORS

This change is Reviewable

Ulexus commented 1 year ago

There are good features in here, but this PR also has a bunch of package renames.

daninmadison commented 1 year ago

My apologies.

It had been awhile, so I thought the project was abandoned.

Is it better if I rollback the changes to what I initially proposed or create a brand new fork for the submission?

Ulexus commented 1 year ago

Probably best to make a clean fork, if you can do so without too much trouble.