diff --git a/agents/diam_it_test.go b/agents/diam_it_test.go index 02af5f0ef..05a4411a7 100644 --- a/agents/diam_it_test.go +++ b/agents/diam_it_test.go @@ -22,6 +22,7 @@ import ( "net/rpc" "net/rpc/jsonrpc" "path" + "strings" "testing" "time" @@ -645,6 +646,10 @@ func testDiamItCCRTerminate(t *testing.T) { if cdrs[0].Usage != 550*time.Second { t.Errorf("Unexpected Usage CDR: %+v", cdrs[0]) } + + if !strings.Contains(cdrs[0].OriginHost, "127.0.0.1") { + t.Errorf("Unexpected OriginHost CDR: %+v", cdrs[0]) + } } } diff --git a/data/conf/samples/diamagent/voice.json b/data/conf/samples/diamagent/voice.json index bf085e906..c3838e206 100644 --- a/data/conf/samples/diamagent/voice.json +++ b/data/conf/samples/diamagent/voice.json @@ -12,6 +12,8 @@ {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, + {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, @@ -40,6 +42,8 @@ {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, + {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, @@ -70,6 +74,8 @@ {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, + {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, {"tag": "Destination", "field_id": "Destination", "type": "*composed", diff --git a/data/conf/samples/diamsctpagent/voice.json b/data/conf/samples/diamsctpagent/voice.json index bf085e906..c3838e206 100755 --- a/data/conf/samples/diamsctpagent/voice.json +++ b/data/conf/samples/diamsctpagent/voice.json @@ -12,6 +12,8 @@ {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, + {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, @@ -40,6 +42,8 @@ {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, + {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, @@ -70,6 +74,8 @@ {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, + {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, {"tag": "Destination", "field_id": "Destination", "type": "*composed",