mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Stale utils.ACCID -> utils.OriginID
This commit is contained in:
@@ -184,7 +184,7 @@ func (smaEv *SMAsteriskEvent) AsSMGenericEvent() *sessionmanager.SMGenericEvent
|
||||
case ARIChannelDestroyed:
|
||||
evName = SMASessionTerminate
|
||||
}
|
||||
smgEv := SMGenericEvent{utils.EVENT_NAME: evName}
|
||||
smgEv := sessionmanager.SMGenericEvent{utils.EVENT_NAME: evName}
|
||||
smgEv[utils.OriginID] = smaEv.ChannelID()
|
||||
if smaEv.RequestType() != "" {
|
||||
smgEv[utils.RequestType] = smaEv.RequestType()
|
||||
|
||||
@@ -186,7 +186,7 @@ func (fsev FSEvent) MissingParameter(timezone string) string {
|
||||
return utils.Category
|
||||
}
|
||||
if strings.TrimSpace(fsev.GetUUID()) == "" {
|
||||
return utils.ACCID
|
||||
return utils.OriginID
|
||||
}
|
||||
if strings.TrimSpace(fsev.GetTenant(utils.META_DEFAULT)) == "" {
|
||||
return utils.Tenant
|
||||
|
||||
@@ -122,7 +122,7 @@ func TestSSv1ItAuth(t *testing.T) {
|
||||
Tenant: "cgrates.org",
|
||||
ID: "TestSSv1ItAuth",
|
||||
Event: map[string]interface{}{
|
||||
utils.ACCID: "TestSSv1It1",
|
||||
utils.OriginID: "TestSSv1It1",
|
||||
utils.RequestType: utils.META_PREPAID,
|
||||
utils.Account: "1001",
|
||||
utils.Destination: "1002",
|
||||
@@ -196,7 +196,7 @@ func TestSSv1ItInitiateSession(t *testing.T) {
|
||||
Tenant: "cgrates.org",
|
||||
ID: "TestSSv1ItInitiateSession",
|
||||
Event: map[string]interface{}{
|
||||
utils.ACCID: "TestSSv1It1",
|
||||
utils.OriginID: "TestSSv1It1",
|
||||
utils.RequestType: utils.META_PREPAID,
|
||||
utils.Account: "1001",
|
||||
utils.Destination: "1002",
|
||||
@@ -249,7 +249,7 @@ func TestSSv1ItUpdateSession(t *testing.T) {
|
||||
Tenant: "cgrates.org",
|
||||
ID: "TestSSv1ItUpdateSession",
|
||||
Event: map[string]interface{}{
|
||||
utils.ACCID: "TestSSv1It1",
|
||||
utils.OriginID: "TestSSv1It1",
|
||||
utils.RequestType: utils.META_PREPAID,
|
||||
utils.Account: "1001",
|
||||
utils.Destination: "1002",
|
||||
@@ -277,7 +277,7 @@ func TestSSv1ItTerminateSession(t *testing.T) {
|
||||
Tenant: "cgrates.org",
|
||||
ID: "TestSSv1ItUpdateSession",
|
||||
Event: map[string]interface{}{
|
||||
utils.ACCID: "TestSSv1It1",
|
||||
utils.OriginID: "TestSSv1It1",
|
||||
utils.RequestType: utils.META_PREPAID,
|
||||
utils.Account: "1001",
|
||||
utils.Destination: "1002",
|
||||
@@ -302,7 +302,7 @@ func TestSSv1ItProcessCDR(t *testing.T) {
|
||||
Tenant: "cgrates.org",
|
||||
ID: "TestSSv1ItProcessCDR",
|
||||
Event: map[string]interface{}{
|
||||
utils.ACCID: "TestSSv1It1",
|
||||
utils.OriginID: "TestSSv1It1",
|
||||
utils.RequestType: utils.META_PREPAID,
|
||||
utils.Account: "1001",
|
||||
utils.Destination: "1002",
|
||||
@@ -331,7 +331,7 @@ func TestSSv1ItProcessEvent(t *testing.T) {
|
||||
Tenant: "cgrates.org",
|
||||
ID: "TestSSv1ItProcessEvent",
|
||||
Event: map[string]interface{}{
|
||||
utils.ACCID: "TestSSv1It2",
|
||||
utils.OriginID: "TestSSv1It2",
|
||||
utils.RequestType: utils.META_PREPAID,
|
||||
utils.Account: "1001",
|
||||
utils.Destination: "1002",
|
||||
|
||||
@@ -45,7 +45,8 @@ var (
|
||||
ErrActiveSession = errors.New("ACTIVE_SESSION")
|
||||
)
|
||||
|
||||
func NewSessionReplicationConns(conns []*config.HaPoolConfig, reconnects int, connTimeout, replyTimeout time.Duration) (smgConns []*SMGReplicationConn, err error) {
|
||||
func NewSessionReplicationConns(conns []*config.HaPoolConfig, reconnects int,
|
||||
connTimeout, replyTimeout time.Duration) (smgConns []*SMGReplicationConn, err error) {
|
||||
smgConns = make([]*SMGReplicationConn, len(conns))
|
||||
for i, replConnCfg := range conns {
|
||||
if replCon, err := rpcclient.NewRpcClient("tcp", replConnCfg.Address, 0, reconnects,
|
||||
@@ -67,7 +68,7 @@ type SMGReplicationConn struct {
|
||||
func NewSMGeneric(cgrCfg *config.CGRConfig, rals, resS,
|
||||
splS, attrS, cdrsrv rpcclient.RpcClientConnection,
|
||||
smgReplConns []*SMGReplicationConn, timezone string) *SMGeneric {
|
||||
ssIdxCfg := cgrCfg.SmGenericConfig.SessionIndexes
|
||||
ssIdxCfg := cgrCfg.SessionSCfg().SessionIndexes
|
||||
ssIdxCfg[utils.OriginID] = true // Make sure we have indexing for OriginID since it is a requirement on prefix searching
|
||||
if rals != nil && reflect.ValueOf(rals).IsNil() {
|
||||
rals = nil
|
||||
@@ -1349,9 +1350,9 @@ func (smg *SMGeneric) BiRPCv1AuthorizeEvent(clnt *rpc2.Client,
|
||||
if smg.resS == nil {
|
||||
return utils.NewErrNotConnected(utils.ResourceS)
|
||||
}
|
||||
originID, err := args.CGREvent.FieldAsString(utils.ACCID)
|
||||
originID, err := args.CGREvent.FieldAsString(utils.OriginID)
|
||||
if err != nil {
|
||||
return utils.NewErrMandatoryIeMissing(utils.ACCID)
|
||||
return utils.NewErrMandatoryIeMissing(utils.OriginID)
|
||||
}
|
||||
var allocMsg string
|
||||
attrRU := utils.ArgRSv1ResourceUsage{
|
||||
@@ -1415,9 +1416,9 @@ func (smg *SMGeneric) BiRPCv1InitiateSession(clnt *rpc2.Client,
|
||||
if smg.resS == nil {
|
||||
return utils.NewErrNotConnected(utils.ResourceS)
|
||||
}
|
||||
originID, err := args.CGREvent.FieldAsString(utils.ACCID)
|
||||
originID, err := args.CGREvent.FieldAsString(utils.OriginID)
|
||||
if err != nil {
|
||||
return utils.NewErrMandatoryIeMissing(utils.ACCID)
|
||||
return utils.NewErrMandatoryIeMissing(utils.OriginID)
|
||||
}
|
||||
attrRU := utils.ArgRSv1ResourceUsage{
|
||||
CGREvent: args.CGREvent,
|
||||
@@ -1485,7 +1486,7 @@ func (smg *SMGeneric) BiRPCv1UpdateSession(clnt *rpc2.Client,
|
||||
if smg.resS == nil {
|
||||
return utils.NewErrNotConnected(utils.ResourceS)
|
||||
}
|
||||
originID, err := args.CGREvent.FieldAsString(utils.ACCID)
|
||||
originID, err := args.CGREvent.FieldAsString(utils.OriginID)
|
||||
if err != nil {
|
||||
return utils.NewErrServerError(err)
|
||||
}
|
||||
@@ -1526,9 +1527,9 @@ func (smg *SMGeneric) BiRPCv1TerminateSession(clnt *rpc2.Client,
|
||||
if smg.resS == nil {
|
||||
return utils.NewErrNotConnected(utils.ResourceS)
|
||||
}
|
||||
originID, err := args.CGREvent.FieldAsString(utils.ACCID)
|
||||
originID, err := args.CGREvent.FieldAsString(utils.OriginID)
|
||||
if err != nil {
|
||||
return utils.NewErrMandatoryIeMissing(utils.ACCID)
|
||||
return utils.NewErrMandatoryIeMissing(utils.OriginID)
|
||||
}
|
||||
var reply string
|
||||
argsRU := utils.ArgRSv1ResourceUsage{
|
||||
@@ -1575,9 +1576,9 @@ func (smg *SMGeneric) BiRPCv1ProcessEvent(clnt *rpc2.Client,
|
||||
if smg.resS == nil {
|
||||
return utils.NewErrNotConnected(utils.ResourceS)
|
||||
}
|
||||
originID, err := args.CGREvent.FieldAsString(utils.ACCID)
|
||||
originID, err := args.CGREvent.FieldAsString(utils.OriginID)
|
||||
if err != nil {
|
||||
return utils.NewErrMandatoryIeMissing(utils.ACCID)
|
||||
return utils.NewErrMandatoryIeMissing(utils.OriginID)
|
||||
}
|
||||
attrRU := utils.ArgRSv1ResourceUsage{
|
||||
CGREvent: args.CGREvent,
|
||||
|
||||
Reference in New Issue
Block a user