Add tests for *remote_host in diameter

This commit is contained in:
TeoV
2018-12-19 10:50:03 -05:00
committed by Dan Christian Bogos
parent ea8562ba4b
commit edf16b75da
3 changed files with 17 additions and 0 deletions

View File

@@ -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])
}
}
}

View File

@@ -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",

View File

@@ -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",