smalltalk
/
osmo-st-mgcp
Archived
1
0
Fork 0

callagent: Make sure the callagent name is in lowercase

This commit is contained in:
Holger Hans Peter Freyther 2011-06-24 19:32:54 +02:00
parent 557986c4f2
commit 41b5e63eae
2 changed files with 11 additions and 2 deletions

View File

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

View File

@ -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.
]