1
0
Fork 0

ussd: Switch invokeid... respond to a unstructuredRequest

Respond with a fixed response.... this is only useful for testing
right now.
This commit is contained in:
Holger Hans Peter Freyther 2011-04-20 23:19:59 +02:00
parent 67c1801031
commit 60c5441e9b
1 changed files with 26 additions and 2 deletions

View File

@ -376,17 +376,33 @@ ProcedureBase subclass: USSDProcedure [
| req str |
req := {BERTag fromTuple: #(2 true 1). OrderedCollection
with: {BERTag integer. #(4).}
with: {BERTag integer. #(0).}
with: {BERTag integer. #(59).}
with: {BERTag fromTuple: #(0 true 16). OrderedCollection
with: {BERTag octetString. #(15).}
with: {BERTag octetString. aNr asUSSD7Bit.}.}.}.
with: {BERTag octetString. aNr asUSSD7Bit}}}.
str := WriteStream on: (ByteArray new: 40).
(DERTLVStream on: str) nextPut: req.
^ str contents
]
USSDProcedure class >> buildReturnLast: invokeId text: aText [
| ret str |
ret := {BERTag fromTuple: #(2 true 2). OrderedCollection
with: {BERTag integer. invokeId}
with: {BERTag sequence. OrderedCollection
with: {BERTag integer. #(60)}
with: {BERTag sequence. OrderedCollection
with: {BERTag octetString. #(15).}
with: {BERTag octetString. aText asUSSD7Bit}}}}.
str := WriteStream on: (ByteArray new: 40).
(DERTLVStream on: str) nextPut: ret.
^ str contents
]
nr: aNr [
nr := aNr.
]
@ -419,6 +435,14 @@ ProcedureBase subclass: USSDProcedure [
aMsg class messageType = GSM48SSMessage msgReleaseCompl ifTrue:[
aMsg inspect.
self success: aMsg ti = 9.
].
aMsg class messageType = GSM48SSMessage msgFacility ifTrue: [
| fac |
fac := GSM48SSFacility new.
fac ti: 1.
fac facility data: (self class buildReturnLast: #(1) text: '45050888658950').
conn nextPutData: (BSSAPDTAP initWith: fac linkIdentifier: 0).
]
]
]