mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
SM-Asterisk - receiving Asterisk events for a call
This commit is contained in:
@@ -112,6 +112,7 @@ load = res_sorcery_realtime.so
|
||||
load = res_timing_timerfd.so
|
||||
|
||||
;ARI
|
||||
load => app_stasis.so
|
||||
load => res_http_websocket.so
|
||||
load => res_stasis.so
|
||||
load => res_stasis_answer.so
|
||||
|
||||
2
glide.lock
generated
2
glide.lock
generated
@@ -8,7 +8,7 @@ imports:
|
||||
- name: github.com/cenk/rpc2
|
||||
version: 7ab76d2e88c77ca1a715756036d8264b2886acd2
|
||||
- name: github.com/cgrates/aringo
|
||||
version: af32eb4cfc6bfa2b73812221c099455dac3b603c
|
||||
version: 01a6eb0c59fdce5158fb8ac5ed62e70b12ca0fd7
|
||||
- name: github.com/cgrates/fsock
|
||||
version: a8ffdbdfc8440016df008ba91e6f05f806d7a69f
|
||||
- name: github.com/cgrates/kamevapi
|
||||
|
||||
@@ -18,7 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
package sessionmanager
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/cgrates/aringo"
|
||||
@@ -39,13 +38,13 @@ type SMAsterisk struct {
|
||||
astConnIdx int
|
||||
smg rpcclient.RpcClientConnection
|
||||
astConn *aringo.ARInGO
|
||||
astEvChan chan *json.RawMessage
|
||||
astEvChan chan map[string]interface{}
|
||||
astErrChan chan error
|
||||
}
|
||||
|
||||
func (sma *SMAsterisk) connectAsterisk() error {
|
||||
connCfg := sma.cgrCfg.SMAsteriskCfg().AsteriskConns[sma.astConnIdx]
|
||||
sma.astEvChan = make(chan *json.RawMessage)
|
||||
sma.astEvChan = make(chan map[string]interface{})
|
||||
sma.astErrChan = make(chan error)
|
||||
_, err := aringo.NewARInGO(fmt.Sprintf("ws://%s/ari/events?api_key=%s:%s&app=%s", connCfg.Address, connCfg.User, connCfg.Password, CGRAuthAPP), "http://cgrates.org",
|
||||
sma.astEvChan, sma.astErrChan, connCfg.ConnectAttempts, connCfg.Reconnects)
|
||||
|
||||
Reference in New Issue
Block a user