Files
cgrates/data/conf/samples/httpagent/httpagent.json
2018-11-28 17:15:26 +01:00

128 lines
5.2 KiB
JSON

{
"http_agent": [
{
"id": "conecto1",
"url": "/conecto",
"sessions_conns": [
{"address": "127.0.0.1:2012", "transport": "*json"}
],
"request_payload": "*url",
"reply_payload": "*xml",
"request_processors": [
{
"id": "OutboundAUTHDryRun",
"filters": ["*string:*req.request_type:OutboundAUTH","*string:*req.Msisdn:497700056231"],
"tenant": "cgrates.org",
"flags": ["*dryrun"],
"request_fields":[
],
"reply_fields":[
{"tag": "Allow", "field_id": "response.Allow", "type": "*constant",
"value": "1", "mandatory": true},
{"tag": "Concatenated1", "field_id": "response.Concatenated", "type": "*composed",
"value": "~*req.MCC;/", "mandatory": true},
{"tag": "Concatenated2", "field_id": "response.Concatenated", "type": "*composed",
"value": "Val1"},
{"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*constant",
"value": "1200", "blocker": true},
{"tag": "Unused", "field_id": "response.Unused", "type": "*constant",
"value": "0"},
],
},
{
"id": "OutboundAUTH",
"filters": ["*string:*req.request_type:OutboundAUTH"],
"tenant": "cgrates.org",
"flags": [ "*auth", "*accounts", "*attributes"],
"request_fields":[
{"tag": "RequestType", "field_id": "RequestType", "type": "*constant",
"value": "*pseudoprepaid", "mandatory": true},
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed",
"value": "~*req.CallID", "mandatory": true},
{"tag": "Account", "field_id": "Account", "type": "*composed",
"value": "~*req.Msisdn", "mandatory": true},
{"tag": "Destination", "field_id": "Destination", "type": "*composed",
"value": "~*req.Destination", "mandatory": true},
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*constant",
"value": "*now", "mandatory": true},
],
"reply_fields":[
{"tag": "Allow", "field_id": "response.Allow", "type": "*constant",
"value": "1", "mandatory": true},
{"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*composed",
"value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true},
],
},
{
"id": "mtcall_cdr",
"filters": ["*string:*req.request_type:MTCALL_CDR"],
"tenant": "cgrates.org",
"flags": ["*cdrs"],
"request_fields":[
{"tag": "RequestType", "field_id": "RequestType", "type": "*constant",
"value": "*pseudoprepaid", "mandatory": true},
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed",
"value": "~*req.CDR_ID", "mandatory": true},
{"tag": "Account", "field_id": "Account", "type": "*composed",
"value": "~*req.msisdn", "mandatory": true},
{"tag": "Destination", "field_id": "Destination", "type": "*composed",
"value": "~*req.destination", "mandatory": true},
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable",
"value": "~*req.timestamp", "mandatory": true},
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable",
"value": "~*req.timestamp", "mandatory": true},
{"tag": "Usage", "field_id": "Usage", "type": "*composed",
"value": "~*req.leg_duration;s", "mandatory": true},
],
"reply_fields":[
{"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"],
"field_id": "CDR_RESPONSE.RESULT_CODE", "type": "*composed", "value": "~*cgrep.Error", "blocker": true},
{"tag": "CDR_ID", "field_id": "CDR_RESPONSE.CDR_ID", "type": "*composed",
"value": "~*req.CDR_ID", "mandatory": true},
{"tag": "CDR_STATUS", "field_id": "CDR_RESPONSE.CDR_STATUS", "type": "*constant",
"value": "1", "mandatory": true},
],
}
],
},
{
"id": "conecto_xml",
"url": "/conecto_xml",
"sessions_conns": [
{"address": "127.0.0.1:2012", "transport": "*json"}
],
"request_payload": "*xml",
"reply_payload": "*xml",
"request_processors": [
{
"id": "cdr_from_xml",
"tenant": "cgrates.org",
"flags": ["*cdrs"],
"request_fields":[
{"tag": "TOR", "field_id": "ToR", "type": "*constant",
"value": "*data", "mandatory": true},
{"tag": "RequestType", "field_id": "RequestType", "type": "*constant",
"value": "*pseudoprepaid", "mandatory": true},
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed",
"value": "~*req.complete-datasession-notification.customerid", "mandatory": true},
{"tag": "Account", "field_id": "Account", "type": "*composed",
"value": "~*req.complete-datasession-notification.username", "mandatory": true},
{"tag": "Destination", "field_id": "Destination", "type": "*composed",
"value": "~*req.complete-datasession-notification.userid", "mandatory": true},
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed",
"value": "~*req.complete-datasession-notification.createtime", "mandatory": true},
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed",
"value": "~*req.complete-datasession-notification.createtime", "mandatory": true},
{"tag": "Usage", "field_id": "Usage", "type": "*composed",
"value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true},
],
"reply_fields":[],
}
],
},
],
}