Kamevapi sample config for extra fields and enabling *suppliers

This commit is contained in:
DanB
2018-05-16 15:23:12 +02:00
parent 6e8a0235f1
commit c26d21ce40
4 changed files with 5 additions and 3 deletions

View File

@@ -3,6 +3,6 @@ cgrates.org,ATTR_1001_SIMPLEAUTH,simpleauth,*string:Account:1001,,Password,*any,
cgrates.org,ATTR_1002_SIMPLEAUTH,simpleauth,*string:Account:1002,,Password,*any,CGRateS.org,true,20
cgrates.org,ATTR_1001_SESSIONAUTH,*sessions,*string:Account:1001,,Password,*any,CGRateS.org,true,10
cgrates.org,ATTR_1001_SESSIONAUTH,,,,RequestType,*any,*prepaid,true,
cgrates.org,ATTR_1001_SESSIONAUTH,,,,PaypalAccount,*any,sendmemoney@paypal.com,true,
cgrates.org,ATTR_1001_SESSIONAUTH,,,,PaypalAccount,*any,cgrates@paypal.com,true,
cgrates.org,ATTR_1001_SESSIONAUTH,,,,LCRProfile,*any,premium_cli,true,
1 #Tenant ID Contexts FilterIDs ActivationInterval FieldName Initial Substitute Append Weight
3 cgrates.org ATTR_1002_SIMPLEAUTH simpleauth *string:Account:1002 Password *any CGRateS.org true 20
4 cgrates.org ATTR_1001_SESSIONAUTH *sessions *string:Account:1001 Password *any CGRateS.org true 10
5 cgrates.org ATTR_1001_SESSIONAUTH RequestType *any *prepaid true
6 cgrates.org ATTR_1001_SESSIONAUTH PaypalAccount *any sendmemoney@paypal.com cgrates@paypal.com true
7 cgrates.org ATTR_1001_SESSIONAUTH LCRProfile *any premium_cli true
8

View File

@@ -81,7 +81,7 @@
"kamailio_agent": {
"enabled": true,
"evapi_conns":[ // instantiate connections to multiple Kamailio servers
{"address": "127.0.0.1:8448", "reconnects": 5}
{"address": "192.168.56.102:8448", "reconnects": 5}
],
"sessions_conns": [
{"address": "*internal"} // connection towards session service: <*internal>

View File

@@ -104,7 +104,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\",
\"cgr_subsystems\":\"*attributes;*accounts;*suppliers\",
\"reply_route\":\"CGR_SESSIONAUTH_REPLY\",
\"Account\":\"$fU\",
\"Destination\":\"$rU\",
@@ -175,6 +175,7 @@ route[CGR_CALL_END] {
\"Account\":\"$dlg_var(cgrAccount)\",
\"Destination\":\"$dlg_var(cgrDestination)\",
\"AnswerTime\":\"$dlg(start_ts)\",
\"PaypalAccount\":\"$dlg_var(paypalAccount)\",
\"Usage\":\"$var(callDur)\"}");
}

View File

@@ -209,6 +209,7 @@ route[CGRATES_SESSIONAUTH_REPLY] {
$dlg_var(cgrReqType) = $avp(RequestType);
$dlg_var(cgrAccount) = $fU;
$dlg_var(cgrDestination) = $rU;
$dlg_var(paypalAccount) = $avp(PaypalAccount);
if $var(cgrMaxUsage) != -1 {
if $var(cgrMaxUsage) == 0 { // Not enough balance, do not allow the call to go through