CyCoreSystems / ari

Golang Asterisk REST Interface (ARI) library
Apache License 2.0
180 stars 74 forks source link

Added ProtocolId and fixed Language in the ChannelData. Added AppName and AppData to the DialplanCEP. #165

Closed daninmadison closed 7 months ago

daninmadison commented 10 months ago

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 channel.go so applications could not retrieve the Language value passed from Asterisk.

Added AppName and AppData to the DialplanCEP. This allows applications to know the current Asterisk 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. Without retrieving a list of channels, we could have calls stuck in Asterisk Stasis application. PJSIP and chan_sip calls will be disconnected when the other end disconnects. However, local channels or ExternalMedia channels could become permanently stuck. 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 parameters that were passed to the stasis application. This AppData is very useful when Asterisk dialplans are configured to pass data to the Stasis application. The ARI Stasis application retrieves these parameters via the AppData (when AppName is Stasis).


This change is Reviewable

svarunan commented 7 months ago

@Ulexus Can we merge this? I was looking to create a PR for same ProtocolId

daninmadison commented 7 months ago

My apologies. Is there anything I need to do?

Ulexus commented 7 months ago

Thanks!