diff --git a/callagent/MGCPTrunk.st b/callagent/MGCPTrunk.st index b70b7bb..a747ac2 100644 --- a/callagent/MGCPTrunk.st +++ b/callagent/MGCPTrunk.st @@ -104,7 +104,7 @@ MGCPTrunkBase subclass: MGCPVirtualTrunk [ ] endpointName: aNr [ - ^ '%1@mgw' % {(aNr radix: 16) copyFrom: 4} + ^ '%1@mgw' % {((aNr radix: 16) copyFrom: 4) asLowercase} ] ] @@ -127,6 +127,6 @@ MGCPTrunkBase subclass: MGCPDSTrunk [ ] endpointName: aNr [ - ^ 'ds/e1-%1/%2@mgw' % {trunk. (aNr radix: 16) copyFrom: 4} + ^ 'ds/e1-%1/%2@mgw' % {trunk. ((aNr radix: 16) copyFrom: 4) asLowercase} ] ] diff --git a/callagent/Tests.st b/callagent/Tests.st index a021e47..76903be 100644 --- a/callagent/Tests.st +++ b/callagent/Tests.st @@ -58,6 +58,15 @@ TestCase subclass: MGCPCommandTest [ self assert: crcx asDatagram = self exampleCRCX. ] + testEndPointName [ + | trunk | + trunk := MGCPDSTrunk createWithDest: '0.0.0.0' trunkNr: 1. + + "I test the endpoint name on hex part.." + self assert: (MGCPVirtualTrunk new endpointName: 16rA) = 'a@mgw'. + self assert: (trunk endpointName: 16rA) = 'ds/e1-1/a@mgw'. + ] + tearDown [ self callagent stop. ]