mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Updated call tests
This commit is contained in:
committed by
Dan Christian Bogos
parent
0222d17f96
commit
b4f79616e8
@@ -331,8 +331,8 @@ func (smaEv *SMAsteriskEvent) V1InitSessionArgs(cgrEvDisp utils.CGREventWithArgD
|
||||
}
|
||||
subsystems, err := cgrEvDisp.CGREvent.FieldAsString(utils.CGRFlags)
|
||||
if err != nil {
|
||||
utils.Logger.Err(fmt.Sprintf("<%s> event: %s don't have cgr_subsystems variable",
|
||||
utils.AsteriskAgent, utils.ToJSON(cgrEvDisp.CGREvent)))
|
||||
utils.Logger.Err(fmt.Sprintf("<%s> event: %s don't have %s variable",
|
||||
utils.AsteriskAgent, utils.ToJSON(cgrEvDisp.CGREvent), utils.CGRFlags))
|
||||
return
|
||||
}
|
||||
for _, subsystem := range strings.Split(subsystems, utils.FIELDS_SEP) {
|
||||
@@ -374,8 +374,8 @@ func (smaEv *SMAsteriskEvent) V1TerminateSessionArgs(cgrEvDisp utils.CGREventWit
|
||||
}
|
||||
subsystems, err := cgrEvDisp.CGREvent.FieldAsString(utils.CGRFlags)
|
||||
if err != nil {
|
||||
utils.Logger.Err(fmt.Sprintf("<%s> event: %s don't have cgr_subsystems variable",
|
||||
utils.AsteriskAgent, utils.ToJSON(cgrEvDisp.CGREvent)))
|
||||
utils.Logger.Err(fmt.Sprintf("<%s> event: %s don't have %s variable",
|
||||
utils.AsteriskAgent, utils.ToJSON(cgrEvDisp.CGREvent), utils.CGRFlags))
|
||||
return
|
||||
}
|
||||
for _, subsystem := range strings.Split(subsystems, utils.FIELDS_SEP) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -275,7 +275,7 @@ func (ka *KamailioAgent) onCgrProcessEvent(evData []byte, connIdx int) {
|
||||
return
|
||||
}
|
||||
|
||||
//in case that we don't reveice cgr_subsystems from kamailio
|
||||
//in case that we don't reveice cgr_flags from kamailio
|
||||
//we consider this as ping-pong event
|
||||
if _, has := kev[utils.CGRFlags]; !has {
|
||||
if err = ka.conns[connIdx].Send(kev.AsKamProcessEventEmptyReply().String()); err != nil {
|
||||
|
||||
@@ -111,7 +111,7 @@ func (kev KamEvent) MissingParameter() bool {
|
||||
// TRIndex and TRLabel must exist in order to know where to send back the response
|
||||
mndPrm := []string{kev[KamTRIndex], kev[KamTRLabel]}
|
||||
_, has := kev[utils.CGRFlags]
|
||||
// in case that the user populate cgr_subsystems we treat it like a ProcessEvent
|
||||
// in case that the user populate cgr_flags we treat it like a ProcessEvent
|
||||
// and expect to have the required fields
|
||||
if has {
|
||||
mndPrm = append(mndPrm, kev[utils.OriginID],
|
||||
|
||||
@@ -1593,7 +1593,7 @@ func main() {
|
||||
}
|
||||
utils.Logger.SetLogLevel(lgLevel)
|
||||
|
||||
cfg.LazzySanityCheck()
|
||||
cfg.LazySanityCheck()
|
||||
|
||||
var loadDb engine.LoadStorage
|
||||
var cdrDb engine.CdrStorage
|
||||
|
||||
@@ -709,7 +709,7 @@ func (self *CGRConfig) checkConfigSanity() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (self *CGRConfig) LazzySanityCheck() {
|
||||
func (self *CGRConfig) LazySanityCheck() {
|
||||
for _, cdrePrfl := range self.cdrsCfg.CDRSOnlineCDRExports {
|
||||
if cdreProfile, hasIt := self.CdreProfiles[cdrePrfl]; hasIt && (cdreProfile.ExportFormat == utils.MetaS3jsonMap || cdreProfile.ExportFormat == utils.MetaSQSjsonMap) {
|
||||
poster := utils.SQSPoster
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
exten => _1XXX,1,NoOp()
|
||||
same => n,Set(CGRMaxSessionTime=0); use it to disconnect automatically the call if CGRateS is not active
|
||||
same => n,DumpChan()
|
||||
same => n,Stasis(cgrates_auth,cgr_reqtype=*prepaid,cgr_supplier=supplier1,cgr_subsystems=*accounts*attributes*resources*stats*suppliers*thresholds)
|
||||
same => n,Stasis(cgrates_auth,cgr_reqtype=*prepaid,cgr_supplier=supplier1,"cgr_flags=*accounts,*attributes,*resources,*stats,*suppliers,*thresholds")
|
||||
same => n,Dial(PJSIP/${EXTEN},30,L(${CGRMaxSessionTime}))
|
||||
same => n,Hangup()
|
||||
|
||||
|
||||
Binary file not shown.
@@ -74,7 +74,7 @@ route[CGRATES_SIMPLEAUTH_REQUEST] {
|
||||
evapi_async_relay("{\"event\":\"CGR_AUTH_REQUEST\",
|
||||
\"tr_index\":\"$T(id_index)\",
|
||||
\"tr_label\":\"$T(id_label)\",
|
||||
\"cgr_subsystems\":\"*attributes\",
|
||||
\"cgr_flags\":\"*attributes\",
|
||||
\"cgr_context\":\"simpleauth\",
|
||||
\"reply_route\":\"CGR_SIMPLEAUTH_REPLY\",
|
||||
\"Account\":\"$fU\"}");
|
||||
@@ -113,7 +113,7 @@ route[CGRATES_SESSIONAUTH_REQUEST] {
|
||||
evapi_async_relay("{\"event\":\"CGR_AUTH_REQUEST\",
|
||||
\"tr_index\":\"$T(id_index)\",
|
||||
\"tr_label\":\"$T(id_label)\",
|
||||
\"cgr_subsystems\":\"*attributes;*accounts;*suppliers;*resources;*thresholds\",
|
||||
\"cgr_flags\":\"*attributes,*accounts,*suppliers,*resources,*thresholds\",
|
||||
\"reply_route\":\"CGR_SESSIONAUTH_REPLY\",
|
||||
\"Account\":\"$fU\",
|
||||
\"Destination\":\"$rU\",
|
||||
@@ -159,7 +159,7 @@ route[CGR_CALL_START] {
|
||||
evapi_relay("{\"event\":\"CGR_CALL_START\",
|
||||
\"h_entry\":\"$dlg(h_entry)\",
|
||||
\"h_id\":\"$dlg(h_id)\",
|
||||
\"cgr_subsystems\":\"*attributes;*accounts;*resources;*thresholds\",
|
||||
\"cgr_flags\":\"*attributes,*accounts,*resources,*thresholds\",
|
||||
\"OriginID\":\"$dlg_var(cgrOriginID)\",
|
||||
\"RequestType\":\"$dlg_var(cgrReqType)\",
|
||||
\"Tenant\":\"$dlg_var(cgrTenant)\",
|
||||
@@ -178,7 +178,7 @@ route[CGR_CALL_END] {
|
||||
}
|
||||
$var(callDur) = $TS - $dlg(start_ts);
|
||||
evapi_relay("{\"event\":\"CGR_CALL_END\",
|
||||
\"cgr_subsystems\":\"*accounts;*resources\",
|
||||
\"cgr_flags\":\"*accounts,*resources\",
|
||||
\"OriginID\":\"$dlg_var(cgrOriginID)\",
|
||||
\"RequestType\":\"$dlg_var(cgrReqType)\",
|
||||
\"Tenant\":\"$dlg_var(cgrTenant)\",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
exten => _1XXX,1,NoOp()
|
||||
same => n,Set(CGRMaxSessionTime=0); use it to disconnect automatically the call if CGRateS is not active
|
||||
same => n,DumpChan()
|
||||
same => n,Stasis(cgrates_auth,cgr_reqtype=*prepaid,cgr_supplier=supplier1,cgr_subsystems=*accounts*attributes*resources*stats*suppliers*thresholds)
|
||||
same => n,Stasis(cgrates_auth,cgr_reqtype=*prepaid,cgr_supplier=supplier1,"cgr_flags=*accounts,*attributes,*resources,*stats,*suppliers,*thresholds")
|
||||
same => n,Dial(PJSIP/${EXTEN},30,L(${CGRMaxSessionTime}))
|
||||
same => n,Hangup()
|
||||
|
||||
|
||||
Binary file not shown.
@@ -74,7 +74,7 @@ route[CGRATES_SIMPLEAUTH_REQUEST] {
|
||||
evapi_async_relay("{\"event\":\"CGR_AUTH_REQUEST\",
|
||||
\"tr_index\":\"$T(id_index)\",
|
||||
\"tr_label\":\"$T(id_label)\",
|
||||
\"cgr_subsystems\":\"*attributes\",
|
||||
\"cgr_flags\":\"*attributes\",
|
||||
\"cgr_context\":\"simpleauth\",
|
||||
\"reply_route\":\"CGR_SIMPLEAUTH_REPLY\",
|
||||
\"Account\":\"$fU\"}");
|
||||
@@ -113,7 +113,7 @@ route[CGRATES_SESSIONAUTH_REQUEST] {
|
||||
evapi_async_relay("{\"event\":\"CGR_AUTH_REQUEST\",
|
||||
\"tr_index\":\"$T(id_index)\",
|
||||
\"tr_label\":\"$T(id_label)\",
|
||||
\"cgr_subsystems\":\"*attributes;*accounts;*suppliers;*resources;*thresholds\",
|
||||
\"cgr_flags\":\"*attributes,*accounts,*suppliers,*resources,*thresholds\",
|
||||
\"reply_route\":\"CGR_SESSIONAUTH_REPLY\",
|
||||
\"Account\":\"$fU\",
|
||||
\"Destination\":\"$rU\",
|
||||
@@ -159,7 +159,7 @@ route[CGR_CALL_START] {
|
||||
evapi_relay("{\"event\":\"CGR_CALL_START\",
|
||||
\"h_entry\":\"$dlg(h_entry)\",
|
||||
\"h_id\":\"$dlg(h_id)\",
|
||||
\"cgr_subsystems\":\"*attributes;*accounts;*resources;*thresholds\",
|
||||
\"cgr_flags\":\"*attributes,*accounts,*resources,*thresholds\",
|
||||
\"OriginID\":\"$dlg_var(cgrOriginID)\",
|
||||
\"RequestType\":\"$dlg_var(cgrReqType)\",
|
||||
\"Tenant\":\"$dlg_var(cgrTenant)\",
|
||||
@@ -178,7 +178,7 @@ route[CGR_CALL_END] {
|
||||
}
|
||||
$var(callDur) = $TS - $dlg(start_ts);
|
||||
evapi_relay("{\"event\":\"CGR_CALL_END\",
|
||||
\"cgr_subsystems\":\"*accounts;*resources\",
|
||||
\"cgr_flags\":\"*accounts,*resources\",
|
||||
\"OriginID\":\"$dlg_var(cgrOriginID)\",
|
||||
\"RequestType\":\"$dlg_var(cgrReqType)\",
|
||||
\"Tenant\":\"$dlg_var(cgrTenant)\",
|
||||
|
||||
Reference in New Issue
Block a user