diff --git a/agents/agentreq.go b/agents/agentreq.go index cb435b231..e5981bb97 100644 --- a/agents/agentreq.go +++ b/agents/agentreq.go @@ -70,7 +70,7 @@ func (ar *AgentRequest) FieldAsInterface(fldPath []string) (val interface{}, err switch fldPath[0] { default: return nil, fmt.Errorf("unsupported field prefix: <%s>", fldPath[0]) - case utils.MetaRequest: + case utils.MetaReq: return ar.Request.FieldAsInterface(fldPath[1:]) case utils.MetaVars: return ar.Vars.FieldAsInterface(fldPath[1:]) @@ -78,7 +78,7 @@ func (ar *AgentRequest) FieldAsInterface(fldPath []string) (val interface{}, err return ar.CGRRequest.FieldAsInterface(fldPath[1:]) case utils.MetaCGRReply: return ar.CGRReply.FieldAsInterface(fldPath[1:]) - case utils.MetaReply: + case utils.MetaRep: return ar.Reply.FieldAsInterface(fldPath[1:]) } } @@ -88,7 +88,7 @@ func (ar *AgentRequest) FieldAsString(fldPath []string) (val string, err error) switch fldPath[0] { default: return "", fmt.Errorf("unsupported field prefix: <%s>", fldPath[0]) - case utils.MetaRequest: + case utils.MetaReq: return ar.Request.FieldAsString(fldPath[1:]) case utils.MetaVars: return ar.Vars.FieldAsString(fldPath[1:]) @@ -96,7 +96,7 @@ func (ar *AgentRequest) FieldAsString(fldPath []string) (val string, err error) return ar.CGRRequest.FieldAsString(fldPath[1:]) case utils.MetaCGRReply: return ar.CGRReply.FieldAsString(fldPath[1:]) - case utils.MetaReply: + case utils.MetaRep: return ar.Reply.FieldAsString(fldPath[1:]) } } diff --git a/data/conf/samples/httpagent/httpagent.json b/data/conf/samples/httpagent/httpagent.json index fd9cbaa7e..e0d847a31 100644 --- a/data/conf/samples/httpagent/httpagent.json +++ b/data/conf/samples/httpagent/httpagent.json @@ -15,7 +15,7 @@ "request_processors": [ { "id": "OutboundAUTHDryRun", - "filters": ["*string:*request.request_type:OutboundAUTH","*string:*request.Msisdn:497700056231"], + "filters": ["*string:*req.request_type:OutboundAUTH","*string:*req.Msisdn:497700056231"], "flags": ["*dryrun"], "continue_on_success": false, "request_fields":[ @@ -31,18 +31,18 @@ }, { "id": "OutboundAUTH", - "filters": ["*string:*request.request_type:OutboundAUTH"], + "filters": ["*string:*req.request_type:OutboundAUTH"], "flags": [ "*auth", "*accounts", "*attributes"], "continue_on_success": false, "request_fields":[ {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*pseudoprepaid", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", - "value": "*request.CallID", "mandatory": true}, + "value": "*req.CallID", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", - "value": "*request.Msisdn", "mandatory": true}, + "value": "*req.Msisdn", "mandatory": true}, {"tag": "Destination", "field_id": "Destination", "type": "*composed", - "value": "*request.Destination", "mandatory": true}, + "value": "*req.Destination", "mandatory": true}, {"tag": "SetupTime", "field_id": "SetupTime", "type": "*constant", "value": "*now", "mandatory": true}, ], @@ -55,28 +55,28 @@ }, { "id": "mtcall_cdr", - "filters": ["*string:*request.request_type:MTCALL_CDR"], + "filters": ["*string:*req.request_type:MTCALL_CDR"], "flags": ["*dryrun", "*cdrs"], "continue_on_success": false, "request_fields":[ {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*pseudoprepaid", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", - "value": "*request.CDR_ID", "mandatory": true}, + "value": "*req.CDR_ID", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", - "value": "*request.msisdn", "mandatory": true}, + "value": "*req.msisdn", "mandatory": true}, {"tag": "Destination", "field_id": "Destination", "type": "*composed", - "value": "*request.destination", "mandatory": true}, + "value": "*req.destination", "mandatory": true}, {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", - "value": "*request.timestamp", "mandatory": true}, + "value": "*req.timestamp", "mandatory": true}, {"tag": "AnswerTime", "field_id": "SetupTime", "type": "*composed", - "value": "*request.timestamp", "mandatory": true}, + "value": "*req.timestamp", "mandatory": true}, {"tag": "Usage", "field_id": "Usage", "type": "*composed", - "value": "*request.leg_duration;^s", "mandatory": true}, + "value": "*req.leg_duration;^s", "mandatory": true}, ], "reply_fields":[ {"tag": "CDR_ID", "field_id": "CDR_RESPONSE.CDR_ID", "type": "*composed", - "value": "*request.CDR_ID", "mandatory": true}, + "value": "*req.CDR_ID", "mandatory": true}, {"tag": "CDR_STATUS", "field_id": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", "value": "1", "mandatory": true}, ], diff --git a/data/conf/samples/radagent/cgrates.json b/data/conf/samples/radagent/cgrates.json index f255714f2..40c95e876 100644 --- a/data/conf/samples/radagent/cgrates.json +++ b/data/conf/samples/radagent/cgrates.json @@ -86,15 +86,15 @@ {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", - "value": "*request.Acct-Session-Id;^-;*request.Sip-From-Tag", "mandatory": true}, + "value": "*req.Acct-Session-Id;^-;*req.Sip-From-Tag", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", - "value": "*request.User-Name", "mandatory": true}, + "value": "*req.User-Name", "mandatory": true}, {"tag": "Destination", "field_id": "Destination", "type": "*composed", - "value": "*request.Called-Station-Id", "mandatory": true}, + "value": "*req.Called-Station-Id", "mandatory": true}, {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", - "value": "*request.Event-Timestamp", "mandatory": true}, + "value": "*req.Event-Timestamp", "mandatory": true}, {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", - "value": "*request.Event-Timestamp", "mandatory": true}, + "value": "*req.Event-Timestamp", "mandatory": true}, ], "reply_fields":[ {"tag": "MaxUsage", "field_id": "SIP-AVP", "type": "*composed", @@ -103,49 +103,49 @@ }, { "id": "KamailioAccountingStart", - "filters": ["*string:*request.Acct-Status-Type:Start"], + "filters": ["*string:*req.Acct-Status-Type:Start"], "flags": ["*initiate","*attributes","*resources","*accounts"], "continue_on_success": false, "request_fields":[ {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", - "value": "*request.Acct-Session-Id;^-;*request.Sip-From-Tag;^-;*request.Sip-To-Tag", "mandatory": true}, + "value": "*req.Acct-Session-Id;^-;*req.Sip-From-Tag;^-;*req.Sip-To-Tag", "mandatory": true}, {"tag": "OriginHost", "field_id": "OriginHost", "type": "*composed", - "value": "*request.NAS-IP-Address", "mandatory": true}, + "value": "*req.NAS-IP-Address", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", - "value": "*request.User-Name", "mandatory": true}, + "value": "*req.User-Name", "mandatory": true}, {"tag": "Destination", "field_id": "Destination", "type": "*composed", - "value": "*request.Called-Station-Id", "mandatory": true}, + "value": "*req.Called-Station-Id", "mandatory": true}, {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", - "value": "*request.Ascend-User-Acct-Time", "mandatory": true}, + "value": "*req.Ascend-User-Acct-Time", "mandatory": true}, {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", - "value": "*request.Ascend-User-Acct-Time", "mandatory": true}, + "value": "*req.Ascend-User-Acct-Time", "mandatory": true}, ], "reply_fields":[], }, { "id": "KamailioAccountingStop", - "filters": ["*string:*request.Acct-Status-Type:Stop"], + "filters": ["*string:*req.Acct-Status-Type:Stop"], "flags": ["*terminate","*resources","*accounts","*cdrs"], "continue_on_success": false, "request_fields":[ {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", - "value": "*request.Acct-Session-Id;^-;*request.Sip-From-Tag;^-;*request.Sip-To-Tag", "mandatory": true}, + "value": "*req.Acct-Session-Id;^-;*req.Sip-From-Tag;^-;*req.Sip-To-Tag", "mandatory": true}, {"tag": "OriginHost", "field_id": "OriginHost", "type": "*composed", - "value": "*request.NAS-IP-Address", "mandatory": true}, + "value": "*req.NAS-IP-Address", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", - "value": "*request.User-Name", "mandatory": true}, + "value": "*req.User-Name", "mandatory": true}, {"tag": "Destination", "field_id": "Destination", "type": "*composed", - "value": "*request.Called-Station-Id", "mandatory": true}, + "value": "*req.Called-Station-Id", "mandatory": true}, {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", - "value": "*request.Ascend-User-Acct-Time", "mandatory": true}, + "value": "*req.Ascend-User-Acct-Time", "mandatory": true}, {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", - "value": "*request.Ascend-User-Acct-Time", "mandatory": true}, + "value": "*req.Ascend-User-Acct-Time", "mandatory": true}, {"tag": "Usage", "field_id": "Usage", "type": "*usage_difference", - "value": "*request.Event-Timestamp;*request.Ascend-User-Acct-Time", "mandatory": true}, + "value": "*req.Event-Timestamp;*req.Ascend-User-Acct-Time", "mandatory": true}, ], "reply_fields":[], }, diff --git a/utils/consts.go b/utils/consts.go index db17c14c4..77350fba8 100755 --- a/utils/consts.go +++ b/utils/consts.go @@ -501,9 +501,9 @@ const ( MetaUrl = "*url" MetaXml = "*xml" ApiKey = "apikey" - MetaRequest = "*request" + MetaReq = "*req" MetaVars = "*vars" - MetaReply = "*reply" + MetaRep = "*rep" CGROriginHost = "cgr_originhost" MetaInitiate = "*initiate" MetaUpdate = "*update"