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
3b37712d24
commit
e6834e1b78
@@ -321,7 +321,10 @@ func (sma *AsteriskAgent) handleChannelDestroyed(ev *SMAsteriskEvent) {
|
||||
if sma.cgrCfg.AsteriskAgentCfg().CreateCDR {
|
||||
if err := sma.connMgr.Call(sma.cgrCfg.AsteriskAgentCfg().SessionSConns, sma,
|
||||
utils.SessionSv1ProcessCDR,
|
||||
cgrEvDisp, &reply); err != nil {
|
||||
&utils.CGREventWithArgDispatcher{
|
||||
CGREvent: cgrEvDisp.CGREvent,
|
||||
ArgDispatcher: cgrEvDisp.ArgDispatcher,
|
||||
}, &reply); err != nil {
|
||||
utils.Logger.Err(fmt.Sprintf("<%s> Error: %s when attempting to process CDR for channelID: %s",
|
||||
utils.AsteriskAgent, err.Error(), ev.ChannelID()))
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -128,8 +128,8 @@
|
||||
],
|
||||
},
|
||||
{
|
||||
"type": "*suppliers", // data source type
|
||||
"file_name": "Suppliers.csv", // file name in the tp_in_dir
|
||||
"type": "*routes", // data source type
|
||||
"file_name": "Routes.csv", // file name in the tp_in_dir
|
||||
"fields": [
|
||||
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true},
|
||||
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true},
|
||||
|
||||
@@ -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_flags=*accounts,*attributes,*resources,*stats,*suppliers,*thresholds")
|
||||
same => n,Stasis(cgrates_auth,cgr_reqtype=*prepaid,cgr_supplier=supplier1,"cgr_flags=*accounts,*attributes,*resources,*stats,*routes,*thresholds")
|
||||
same => n,Dial(PJSIP/${EXTEN},30,L(${CGRMaxSessionTime}))
|
||||
same => n,Hangup()
|
||||
|
||||
|
||||
@@ -103,6 +103,7 @@
|
||||
"enabled": true,
|
||||
"resources_conns": ["*internal"],
|
||||
"stats_conns": ["*internal"],
|
||||
"rals_conns": ["*internal"],
|
||||
"string_indexed_fields": ["Account"],
|
||||
},
|
||||
|
||||
|
||||
@@ -101,6 +101,7 @@
|
||||
"enabled": true,
|
||||
"resources_conns": ["*internal"],
|
||||
"stats_conns": ["*internal"],
|
||||
"rals_conns": ["*internal"],
|
||||
"string_indexed_fields": ["Account"],
|
||||
},
|
||||
|
||||
|
||||
Binary file not shown.
@@ -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_flags\":\"*attributes,*accounts,*suppliers,*resources,*thresholds\",
|
||||
\"cgr_flags\":\"*attributes,*accounts,*routes,*resources,*thresholds\",
|
||||
\"reply_route\":\"CGR_SESSIONAUTH_REPLY\",
|
||||
\"Account\":\"$fU\",
|
||||
\"Destination\":\"$rU\",
|
||||
|
||||
@@ -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_flags=*accounts,*attributes,*resources,*stats,*suppliers,*thresholds")
|
||||
same => n,Stasis(cgrates_auth,cgr_reqtype=*prepaid,cgr_supplier=supplier1,"cgr_flags=*accounts,*attributes,*resources,*stats,*routes,*thresholds")
|
||||
same => n,Dial(PJSIP/${EXTEN},30,L(${CGRMaxSessionTime}))
|
||||
same => n,Hangup()
|
||||
|
||||
|
||||
@@ -102,6 +102,7 @@
|
||||
"enabled": true,
|
||||
"resources_conns": ["*internal"],
|
||||
"stats_conns": ["*internal"],
|
||||
"rals_conns": ["*internal"],
|
||||
"string_indexed_fields": ["Account"],
|
||||
},
|
||||
|
||||
|
||||
@@ -101,6 +101,7 @@
|
||||
"enabled": true,
|
||||
"resources_conns": ["*internal"],
|
||||
"stats_conns": ["*internal"],
|
||||
"rals_conns": ["*internal"],
|
||||
"string_indexed_fields": ["Account"],
|
||||
},
|
||||
|
||||
|
||||
Binary file not shown.
@@ -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_flags\":\"*attributes,*accounts,*suppliers,*resources,*thresholds\",
|
||||
\"cgr_flags\":\"*attributes,*accounts,*routes,*resources,*thresholds\",
|
||||
\"reply_route\":\"CGR_SESSIONAUTH_REPLY\",
|
||||
\"Account\":\"$fU\",
|
||||
\"Destination\":\"$rU\",
|
||||
|
||||
@@ -364,7 +364,7 @@ flags
|
||||
**\*auth**
|
||||
Sends the request for authorization on CGRateS.
|
||||
|
||||
Auxiliary flags available: **\*attributes**, **\*thresholds**, **\*stats**, **\*resources**, **\*accounts**, **\*suppliers**, **\*suppliers_ignore_errors**, **\*suppliers_event_cost** which are used to influence the auth behavior on CGRateS side. More info on that can be found on the **SessionS** component's API behavior.
|
||||
Auxiliary flags available: **\*attributes**, **\*thresholds**, **\*stats**, **\*resources**, **\*accounts**, **\*routes**, **\*routes_ignore_errors**, **\*routes_event_cost** which are used to influence the auth behavior on CGRateS side. More info on that can be found on the **SessionS** component's API behavior.
|
||||
|
||||
**\*initiate**
|
||||
Initiates a session out of request on CGRateS side.
|
||||
@@ -384,7 +384,7 @@ flags
|
||||
**\*message**
|
||||
Process the request as individual message charging on CGRateS side.
|
||||
|
||||
Auxiliary flags available: **\*attributes**, **\*thresholds**, **\*stats**, **\*resources**, **\*accounts**, **\*suppliers**, **\*suppliers_ignore_errors**, **\*suppliers_event_cost** which are used to influence the behavior on CGRateS side.
|
||||
Auxiliary flags available: **\*attributes**, **\*thresholds**, **\*stats**, **\*resources**, **\*accounts**, **\*routes**, **\*routes_ignore_errors**, **\*routes_event_cost** which are used to influence the behavior on CGRateS side.
|
||||
|
||||
|
||||
**\*event**
|
||||
|
||||
@@ -214,7 +214,7 @@ flags
|
||||
**\*auth**
|
||||
Sends the Event for authorization on CGRateS.
|
||||
|
||||
Auxiliary flags available: **\*attributes**, **\*thresholds**, **\*stats**, **\*resources**, **\*accounts**, **\*suppliers**, **\*suppliers_ignore_errors**, **\*suppliers_event_cost** which are used to influence the auth behavior on CGRateS side. More info on that can be found on the **SessionS** component's API behavior.
|
||||
Auxiliary flags available: **\*attributes**, **\*thresholds**, **\*stats**, **\*resources**, **\*accounts**, **\*routes**, **\*routes_ignore_errors**, **\*routes_event_cost** which are used to influence the auth behavior on CGRateS side. More info on that can be found on the **SessionS** component's API behavior.
|
||||
|
||||
**\*initiate**
|
||||
Initiates a session out of Event on CGRateS side.
|
||||
@@ -234,7 +234,7 @@ flags
|
||||
**\*message**
|
||||
Process the Event as individual message charging on CGRateS side.
|
||||
|
||||
Auxiliary flags available: **\*attributes**, **\*thresholds**, **\*stats**, **\*resources**, **\*accounts**, **\*suppliers**, **\*suppliers_ignore_errors**, **\*suppliers_event_cost** which are used to influence the behavior on CGRateS side.
|
||||
Auxiliary flags available: **\*attributes**, **\*thresholds**, **\*stats**, **\*resources**, **\*accounts**, **\*routes**, **\*routes_ignore_errors**, **\*routes_event_cost** which are used to influence the behavior on CGRateS side.
|
||||
|
||||
**\*event**
|
||||
Process the Event as generic event on CGRateS side.
|
||||
|
||||
@@ -341,14 +341,14 @@ Instead of arguments, the options for enabling various functionaity will come in
|
||||
**\*terminate**
|
||||
Terminate a session (or initialize + terminate) out of event.
|
||||
|
||||
\*suppliers
|
||||
\*routes
|
||||
Process the event with :ref:`Suppliers`. Auxiliary flags available:
|
||||
|
||||
**\*ignore_errors**
|
||||
Ignore the suppliers with errors instead of failing the request completely.
|
||||
Ignore the routes with errors instead of failing the request completely.
|
||||
|
||||
**\*event_cost**
|
||||
Ignore suppliers with cost higher than the event cost.
|
||||
Ignore routes with cost higher than the event cost.
|
||||
|
||||
\*thresholds
|
||||
Process the event with :ref:`ThresholdS` for monitoring.
|
||||
|
||||
@@ -52,7 +52,7 @@ SupplierS
|
||||
|
||||
**SupplierS** is the **CGRateS** component responsible for handling the *SupplierProfiles*.
|
||||
|
||||
It is configured within **suppliers** section from :ref:`JSON configuration <configuration>` via the following parameters:
|
||||
It is configured within **routes** section from :ref:`JSON configuration <configuration>` via the following parameters:
|
||||
|
||||
enabled
|
||||
Will enable starting of the service. Possible values: <true|false>.
|
||||
|
||||
@@ -610,7 +610,7 @@ func testCallStatMetrics(t *testing.T) {
|
||||
|
||||
if err := tutorialCallsRpc.Call(utils.StatSv1GetQueueStringMetrics,
|
||||
&utils.TenantID{Tenant: "cgrates.org", ID: "Stats2"}, &metrics); err != nil {
|
||||
t.Error(err)
|
||||
t.Fatal(err)
|
||||
}
|
||||
if optConf == utils.Asterisk {
|
||||
metrics[utils.MetaTCD] = strings.Split(metrics[utils.MetaTCD], ".")[0] + "s"
|
||||
|
||||
@@ -361,16 +361,16 @@ func TestCGREventconsumeRoutePaginator(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
//check if *suppliers_limit and *suppliers_offset was deleted
|
||||
//check if *routes_limit and *routes_offset was deleted
|
||||
if _, has := opts[RoutesLimit]; has {
|
||||
t.Errorf("*suppliers_limit wasn't deleted")
|
||||
t.Errorf("*routes_limit wasn't deleted")
|
||||
} else if _, has := opts[RoutesOffset]; has {
|
||||
t.Errorf("*suppliers_offset wasn't deleted")
|
||||
t.Errorf("*routes_offset wasn't deleted")
|
||||
}
|
||||
if !reflect.DeepEqual(eOut, rcv) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", eOut, rcv)
|
||||
}
|
||||
//check without *suppliers_limit, but with *suppliers_offset
|
||||
//check without *routes_limit, but with *routes_offset
|
||||
opts = map[string]interface{}{
|
||||
RoutesOffset: 20,
|
||||
}
|
||||
@@ -382,16 +382,16 @@ func TestCGREventconsumeRoutePaginator(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
//check if *suppliers_limit and *suppliers_offset was deleted
|
||||
//check if *routes_limit and *routes_offset was deleted
|
||||
if _, has := opts[RoutesLimit]; has {
|
||||
t.Errorf("*suppliers_limit wasn't deleted")
|
||||
t.Errorf("*routes_limit wasn't deleted")
|
||||
} else if _, has := opts[RoutesOffset]; has {
|
||||
t.Errorf("*suppliers_offset wasn't deleted")
|
||||
t.Errorf("*routes_offset wasn't deleted")
|
||||
}
|
||||
if !reflect.DeepEqual(eOut, rcv) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", eOut, rcv)
|
||||
}
|
||||
//check with notAnInt at *suppliers_limit
|
||||
//check with notAnInt at *routes_limit
|
||||
opts = map[string]interface{}{
|
||||
RoutesLimit: "Not an int",
|
||||
}
|
||||
@@ -403,7 +403,7 @@ func TestCGREventconsumeRoutePaginator(t *testing.T) {
|
||||
if !reflect.DeepEqual(eOut, rcv) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", eOut, rcv)
|
||||
}
|
||||
//check with notAnInt at and *suppliers_offset
|
||||
//check with notAnInt at and *routes_offset
|
||||
opts = map[string]interface{}{
|
||||
RoutesOffset: "Not an int",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user