mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Update *alter_sessions action
Will now support two extra parameters: address and codec. For *internal connections, the birpc.Service object will be retrieved from rpcParamsMap from utils. Supported codecs: <*gob|*json|*http_jsonrpc> (ingored for *internal address). Action does not bother with setting defaults anymore, lets the API handle them. Improve action comments. Add unit tests for the action. UnregisterRpcParams' implementation was required. Updated *alter_sessions action tariffplan for radius coa integration test to include address and codec. Some birpc clients that are set up in integration tests were still registering a SessionSv1 object. Updated them to register an AgentV1 object instead.
This commit is contained in:
committed by
Dan Christian Bogos
parent
675d9e25ce
commit
1f7e0b33a2
@@ -21,6 +21,7 @@ package utils
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/cgrates/birpc"
|
||||
@@ -86,3 +87,14 @@ func GetRpcParams(method string) (params *RpcParams, err error) {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func UnregisterRpcParams(name string) {
|
||||
rpcParamsLock.Lock()
|
||||
defer rpcParamsLock.Unlock()
|
||||
for method := range rpcParamsMap {
|
||||
if strings.HasPrefix(method, name) {
|
||||
delete(rpcParamsMap, method)
|
||||
}
|
||||
}
|
||||
delete(rpcParamsMap, name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user