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

pharo: Add a Makefile and begin with the porting.

* Change the category for the tests and extensions
* Rewrite usages of >>nl and >>cr
* There are still issues with the Socket code, Datagram handling
  and and expands.
This commit is contained in:
Holger Hans Peter Freyther 2013-03-31 17:08:18 +02:00
parent f0d7c722d0
commit 6559cc6c1c
13 changed files with 76 additions and 24 deletions

60
Makefile Normal file
View File

@ -0,0 +1,60 @@
GST_PACKAGE = gst-package
GST_CONVERT = gst-convert
CONVERT_RULES = -r'Osmo.LogManager->LogManager' \
-r'Osmo.LogArea->LogArea' \
-r'Osmo.LogLevel->LogLevel' \
-r'Osmo.TimerScheduler->TimerScheduler' \
-r'Osmo.OsmoUDPSocket->OsmoUDPSocket' \
-r'Sockets.StreamSocket->SocketStream' \
-r'DateTime->DateAndTime' \
-r'Character nl->Character lf' \
-r'(Duration milliseconds: ``@args1) -> (Duration milliSeconds: ``@args1)' \
-r'PP.PPCompositeParser->PPCompositeParser' \
-r'PP.PPCompositeParserTest->PPCompositeParserTest' \
-r'PP.PPPredicateObjectParser->PPPredicateObjectParser' \
-r'Osmo.MessageBuffer->MessageBuffer' \
-r'SystemExceptions.NotFound->NotFound' \
-r'(``@object substrings: ``@args1)->(``@object subStrings: ``@args1)' \
-r'(Dictionary from: ``@args1)->(Dictionary newFrom: ``@args1)' \
-r'(``@object copyFrom: ``@args1)->(``@object copyFrom: ``@args1 to: ``@object size)' \
-r'Sockets.SocketAddress->GSTSocketAddress' \
-r'((Osmo at: \#SIPParser) combineUri: ``@args1)->(SIPParser combineUri: ``@args1)' \
-r'``@object nl->``@object lf' \
# Can not be parsed right now..
# -r'(``@object => ``@args1)->(``@object ==> ``@args1)'
GRAMMAR = \
grammar/SIPGrammar.st grammar/SIPGrammarTest.st
CALLAGENT = \
callagent/Base64MimeConverter.st \
callagent/SIPLogArea.st \
callagent/SIPDialog.st \
callagent/SIPParams.st \
callagent/SIPParser.st \
callagent/SIPRandom.st \
callagent/SIPRequests.st \
callagent/SIPResponse.st \
callagent/SIPTransactions.st \
callagent/SIPCallAgent.st \
callagent/SIPCall.st \
callagent/SIPParserTest.st \
callagent/Tests.st
PHARO_COMPAT = pharo-porting/compat_for_pharo.st
PHARO_CHANGES =
all:
$(GST_PACKAGE) --test package.xml
convert:
$(GST_CONVERT) $(CONVERT_RULES) -F squeak -f gst \
-o fileout.st $(PHARO_COMPAT) \
$(GRAMMAR) $(CALLAGENT) \
$(PHARO_CHANGES)
sed -i s,"=>","==>",g fileout.st

View File

@ -16,11 +16,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"
PackageLoader fileInPackage: 'OsmoCore'.
SIPRequest extend [
sipCallDispatch: aCall [
<category: '*-OsmoSIP-call'>
<category: '*OsmoSIP-call'>
self logError: 'SIPCall(%1) got unhandled request %2.'
% {aCall callId. self class verb} area: #sip.
]
@ -28,7 +26,7 @@ SIPRequest extend [
SIPByeRequest extend [
sipCallDispatch: aCall [
<category: '*-OsmoSIP-call'>
<category: '*OsmoSIP-call'>
self logDebug: 'SIPCall(%1) got BYE.'
% {aCall callId} area: #sip.
aCall remoteHangup: self.

View File

@ -16,8 +16,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"
PackageLoader fileInPackage: 'Sockets'.
SIPRequest extend [
sipDispatchNewDialog: aDialog on: aUserAgent [
<category: 'OsmoSIP-Callagent'>

View File

@ -16,8 +16,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"
PackageLoader fileInPackage: #OsmoLogging.
Osmo.LogArea subclass: SIPLogArea [
<category: 'OsmoSIP-LogArea'>

View File

@ -151,7 +151,7 @@ Object subclass: SIPGenericParam [
]
isGenericSIPParam [
<category: '*osmo-sip-extension'>
<category: 'osmo-sip-extension'>
^ true
]
]

View File

@ -16,10 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"
PackageLoader fileInPackage: 'PetitParserTests'.
PP.PPCompositeParserTest subclass: SIPParserTest [
<category: 'OsmoSIP-Parser'>
<category: 'OsmoSIP-Parser-Tests'>
<comment: 'I excercise the SIPParser a bit'>
parserClass [

View File

@ -16,8 +16,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"
PackageLoader fileInPackage: 'Sockets'.
Object subclass: SIPBase64 [
<category: 'OsmoSIP-Misc'>

View File

@ -16,9 +16,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"
PackageLoader
fileInPackage: 'OsmoCore'.
Object subclass: SIPTransaction [
| sem useragent initial_dialog state timeout success failure notification
cseq branch retransmit_time fail_time removal |

View File

@ -17,7 +17,7 @@
"
TestCase subclass: SIPRequestTest [
<category: 'OsmoSIP-Callagent'>
<category: 'OsmoSIP-Callagent-Tests'>
testINVITE [
| dialog req out |
@ -72,7 +72,7 @@ TestCase subclass: SIPRequestTest [
]
TestCase subclass: SIPUdpTransportTest [
<category: 'OsmoSIP-Callagent'>
<category: 'OsmoSIP-Callagent-Tests'>
testSending [
| target transp datagram read |

View File

@ -16,8 +16,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"
PackageLoader fileInPackage: 'PetitParser'.
PP.PPCompositeParser subclass: SIPGrammar [
| Response StatusLine message_header
CRLF SP HTAB HCOLON SWS LWS WSP COMMA SEMI SLASH COLON EQUAL

View File

@ -16,10 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"
PackageLoader fileInPackage: 'PetitParserTests'.
PP.PPCompositeParserTest subclass: SIPGrammarTest [
<category: 'OsmoSIP-Grammar'>
<category: 'OsmoSIP-Grammar-Tests'>
<comment: 'I try to parse some SIP messages.'>
SIPGrammarTest class >> packageNamesUnderTest [

View File

@ -1,7 +1,11 @@
<package>
<name>OsmoSIP</name>
<namespace>Osmo</namespace>
<prereq>OsmoLogging</prereq>
<prereq>OsmoCore</prereq>
<prereq>OsmoNetwork</prereq>
<prereq>Sockets</prereq>
<prereq>PetitParser</prereq>
<filein>grammar/SIPGrammar.st</filein>
@ -18,6 +22,7 @@
<filein>callagent/SIPCall.st</filein>
<test>
<prereq>PetitParserTests</prereq>
<sunit>Osmo.SIPGrammarTest</sunit>
<sunit>Osmo.SIPParserTest</sunit>
<sunit>Osmo.SIPRequestTest</sunit>

View File

@ -0,0 +1,4 @@
Object subclass: GSTSocketAddress [
<category: 'OsmoSIP-Pharo'>
<comment: 'TODO: Move it into the OsmoNetwork package'>
]