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

pharo: Use something that is now in OsmoCore

Do not relay on the HLR to be loaded
This commit is contained in:
Holger Hans Peter Freyther 2015-07-24 18:07:36 +02:00
parent aa7002b2e1
commit e6f5e3afde
1 changed files with 5 additions and 5 deletions

View File

@ -2,17 +2,17 @@
SIPURandom class extend [
nextByte [
<category: 'random'>
^(RAND rand: 1) first.
^(OsmoSecureRandom rand: 1) first.
]
nextInt [
<category: 'random'>
^(RAND rand: 4) asInteger
^(OsmoSecureRandom rand: 4) asInteger
]
nextFourBytes [
<category: 'random'>
^RAND rand: 4
^OsmoSecureRandom rand: 4
]
]
@ -20,14 +20,14 @@ SIPUserAgentBase class extend [
generateCSeq [
<category: 'helper'>
"For pharo just use the random we have"
^(RAND rand: 4) asInteger abs
^(OsmoSecureRandom rand: 4) asInteger abs
]
generateBranch [
| data |
data := '<1p>,<2p>' expandMacrosWithArguments:
{DateTime now asUTC asSeconds.
(RAND rand: 2) asInteger}.
(OsmoSecureRandom rand: 2) asInteger}.
^ self branchStart, (SIPBase64 encode: data).
]
]