2010-12-11 08:45:25 +00:00
|
|
|
PackageLoader fileInPackage: 'Iliad-Core'.
|
2010-12-11 11:21:07 +00:00
|
|
|
PackageLoader fileInPackage: 'Iliad-More-Formula'.
|
2010-12-11 08:45:25 +00:00
|
|
|
PackageLoader fileInPackage: 'Iliad-Swazoo'.
|
|
|
|
|
|
|
|
FileStream fileIn: 'A3A8.st'.
|
|
|
|
FileStream fileIn: 'Messages.st'.
|
|
|
|
FileStream fileIn: 'BSSAP.st'.
|
|
|
|
FileStream fileIn: 'BSSMAP.st'.
|
|
|
|
FileStream fileIn: 'GSM48.st'.
|
|
|
|
FileStream fileIn: 'SCCPHandler.st'.
|
|
|
|
FileStream fileIn: 'GSMDriver.st'.
|
2010-12-11 11:21:07 +00:00
|
|
|
FileStream fileIn: 'TestPhone.st'.
|
2010-12-11 08:45:25 +00:00
|
|
|
|
|
|
|
Iliad.ILWidget subclass: ServerConfigWidget [
|
|
|
|
contents [
|
|
|
|
^ [:e |
|
2010-12-11 11:21:07 +00:00
|
|
|
self application gsmServer isConnected
|
|
|
|
ifTrue: [
|
|
|
|
e text: 'The A link is connected to the MSC'.
|
|
|
|
]
|
|
|
|
ifFalse: [
|
|
|
|
e text: 'The A link is not connected: '.
|
|
|
|
e a
|
|
|
|
text: 'Connect';
|
|
|
|
action: [self connectServer]
|
|
|
|
].
|
2010-12-11 08:45:25 +00:00
|
|
|
]
|
|
|
|
]
|
2010-12-11 11:21:07 +00:00
|
|
|
|
|
|
|
connectServer [
|
|
|
|
(self application gsmServer)
|
|
|
|
connect;
|
|
|
|
serve.
|
|
|
|
|
|
|
|
[
|
|
|
|
(Delay forSeconds: 5) wait.
|
|
|
|
self send: #markDirty.
|
|
|
|
] fork.
|
|
|
|
]
|
2010-12-11 08:45:25 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
Iliad.ILWidget subclass: PhoneConfigWidget [
|
2010-12-11 11:21:07 +00:00
|
|
|
configFormOn: anItem [
|
|
|
|
| form |
|
2010-12-11 08:45:25 +00:00
|
|
|
|
2010-12-11 11:21:07 +00:00
|
|
|
form := ILFormula on: anItem.
|
|
|
|
(form inputOn: #imsi)
|
|
|
|
labelContents: [:e | e span text: 'IMSI' ].
|
|
|
|
(form inputOn: #auKey)
|
|
|
|
labelContents: [:e | e span text: 'AuKey' ].
|
|
|
|
^ form
|
2010-12-11 08:45:25 +00:00
|
|
|
]
|
|
|
|
|
2010-12-11 11:21:07 +00:00
|
|
|
configurePhone [
|
|
|
|
self lightbox: ((self configFormOn: self session gsmConfig)
|
|
|
|
addMessage: [:e | e h2: 'Configure Test Phone'];
|
|
|
|
yourself)
|
2010-12-11 08:45:25 +00:00
|
|
|
]
|
|
|
|
|
2010-12-11 11:21:07 +00:00
|
|
|
contents [
|
|
|
|
^ [:e | e a text: 'Configure phone'; action: [self configurePhone]].
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
Iliad.ILWidget subclass: LUWidget [
|
2010-12-11 08:45:25 +00:00
|
|
|
contents [
|
|
|
|
^ [:e |
|
2010-12-11 11:21:07 +00:00
|
|
|
e a
|
|
|
|
text: 'Start LU';
|
|
|
|
action: [self doLU]
|
2010-12-11 08:45:25 +00:00
|
|
|
]
|
|
|
|
]
|
|
|
|
|
2010-12-11 11:21:07 +00:00
|
|
|
doLU [
|
|
|
|
| lu |
|
|
|
|
lu := self application gsmServer doLU: self session gsmConfig.
|
|
|
|
lu run.
|
|
|
|
self session procedures add: lu.
|
2010-12-11 08:45:25 +00:00
|
|
|
]
|
|
|
|
]
|
|
|
|
|
2010-12-11 11:21:07 +00:00
|
|
|
Object subclass: PhoneNumber [
|
|
|
|
| number |
|
|
|
|
number [ ^ number ]
|
|
|
|
number: aNumber [ number := aNumber ]
|
|
|
|
]
|
2010-12-11 08:45:25 +00:00
|
|
|
|
2010-12-11 11:21:07 +00:00
|
|
|
Iliad.ILWidget subclass: CallWidget [
|
|
|
|
createNumberWidget [
|
|
|
|
| form |
|
|
|
|
form := Iliad.ILFormula on: PhoneNumber new.
|
|
|
|
(form inputOn: #number)
|
|
|
|
labelContents: [:e | e span text: 'Number' ].
|
|
|
|
^ form
|
2010-12-11 08:45:25 +00:00
|
|
|
]
|
|
|
|
|
2010-12-11 11:21:07 +00:00
|
|
|
dial [
|
|
|
|
self lightbox: ((self createNumberWidget)
|
|
|
|
addMessage: [:e | e h2: 'Set the number'];
|
|
|
|
yourself)
|
|
|
|
onAnswer: [:item | item ifNotNil: [
|
|
|
|
self placeCall: item number]]
|
2010-12-11 08:45:25 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
contents [
|
|
|
|
^ [:e |
|
2010-12-11 11:21:07 +00:00
|
|
|
e a text: 'Place a call';
|
|
|
|
action: [ self dial ].
|
2010-12-11 08:45:25 +00:00
|
|
|
]
|
|
|
|
]
|
|
|
|
|
2010-12-11 11:21:07 +00:00
|
|
|
placeCall: aNumber [
|
|
|
|
| call |
|
|
|
|
call := self application gsmServer doCallNumber: self session gsmConfig.
|
|
|
|
call run.
|
|
|
|
self session procedures add: call.
|
2010-12-11 08:45:25 +00:00
|
|
|
]
|
2010-12-11 11:21:07 +00:00
|
|
|
]
|
2010-12-11 08:45:25 +00:00
|
|
|
|
2010-12-11 11:21:07 +00:00
|
|
|
Iliad.ILSession subclass: GSMTestphoneSession [
|
|
|
|
| user gsmConfig procedures |
|
2010-12-11 08:45:25 +00:00
|
|
|
|
2010-12-11 11:30:46 +00:00
|
|
|
isAuthenticated [
|
|
|
|
^ user = 'toto-user'
|
|
|
|
]
|
|
|
|
|
|
|
|
username: aUser [
|
|
|
|
user := aUser.
|
|
|
|
]
|
2010-12-11 11:21:07 +00:00
|
|
|
|
|
|
|
gsmConfig [ ^ gsmConfig ifNil: [gsmConfig := PhoneConfig new. ]]
|
|
|
|
procedures [ ^ procedures ifNil: [procedures := OrderedCollection new]]
|
2010-12-11 08:45:25 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
Iliad.ILApplication subclass: GSMTestphoneApp [
|
2010-12-11 11:21:07 +00:00
|
|
|
| config call lu serverConfig gsmServer |
|
2010-12-11 08:45:25 +00:00
|
|
|
GSMTestphoneApp class >> path [ ^ 'testphone' ]
|
|
|
|
|
2010-12-11 11:21:07 +00:00
|
|
|
GSMTestphoneApp class >> initialize [
|
|
|
|
Iliad.ILSessionManager current sessionClass: GSMTestphoneSession.
|
2010-12-11 08:45:25 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
gsmServer [
|
|
|
|
^ gsmServer ifNil: [gsmServer := IPAConfig new]
|
|
|
|
]
|
|
|
|
|
|
|
|
phoneConfig [
|
2010-12-11 11:21:07 +00:00
|
|
|
^ config ifNil: [config := PhoneConfigWidget new]
|
2010-12-11 08:45:25 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
serverConfig [
|
2010-12-11 11:21:07 +00:00
|
|
|
^ serverConfig ifNil: [serverConfig := ServerConfigWidget new]
|
2010-12-11 08:45:25 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
call [
|
2010-12-11 11:21:07 +00:00
|
|
|
^ call ifNil: [call := CallWidget new]
|
2010-12-11 08:45:25 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
lu [
|
2010-12-11 11:21:07 +00:00
|
|
|
^ lu ifNil: [lu := LUWidget new]
|
2010-12-11 08:45:25 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
index [
|
|
|
|
<category: 'controllers'>
|
|
|
|
^ [:e |
|
|
|
|
e build: self serverConfig.
|
|
|
|
e build: self phoneConfig.
|
|
|
|
e build: self call.
|
|
|
|
e build: self lu.
|
|
|
|
].
|
|
|
|
]
|
2010-12-11 11:30:46 +00:00
|
|
|
|
|
|
|
loginContents [
|
|
|
|
<category: 'building'>
|
|
|
|
^[:e |
|
|
|
|
e form build: [:form |
|
|
|
|
form input action: [:val | self login: val].
|
|
|
|
form button text: 'Login']]
|
|
|
|
]
|
|
|
|
|
|
|
|
login: aString [
|
|
|
|
<category: 'actions'>
|
|
|
|
self session username: aString.
|
|
|
|
self redirectToCurrentController
|
|
|
|
]
|
|
|
|
|
|
|
|
dispatchOverride [
|
|
|
|
<category: 'dispatching'>
|
|
|
|
^self session isAuthenticated
|
|
|
|
ifFalse: [self loginContents]
|
|
|
|
ifTrue: [super dispatchOverride]
|
|
|
|
]
|
2010-12-11 08:45:25 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
Eval [
|
2010-12-11 11:21:07 +00:00
|
|
|
GSMTestphoneApp initialize.
|
2010-12-11 08:45:25 +00:00
|
|
|
Iliad.SwazooIliad startOn: 8080.
|
|
|
|
|
|
|
|
stdin next.
|
|
|
|
]
|