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

84 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 2e1967c49b misc: Use String>>#expandMacrosWith.. for the random helpers
These generate random strings so it is difficult to unit test. But
the invocation worked:

st> Osmo.SIPRandomHelper generateTag
'MzU0MjIxMTQ1OTIzODI1ODc3NjU_'
st> Osmo.SIPRandomHelper generateCallId
'MTk3MTU3OTAxOA__@xiaoyu'
st> Osmo.SIPUserAgent generateBranch
'z9hG4bKMzU0MjIwNDM2Myw0MjIxNg__'
2013-03-31 20:52:12 +02:00
Holger Hans Peter Freyther 06285b7135 misc: Use WriteStream>>#nextPutAll: instead of String>>% to generate messages 2013-03-31 20:51:57 +02:00
Holger Hans Peter Freyther 66622eb271 misc: Use WriteStream>>#nextPutAll: instead of String>>%
* String>>% is not available in Pharo and <<1p>> does not work the
  way it should/could work. Move to a WriteStream.
2013-03-31 20:51:36 +02:00
Holger Hans Peter Freyther 90655feda0 misc: Use String>>#expandMacrosWith to increase portability 2013-03-31 20:51:04 +02:00
Holger Hans Peter Freyther 33ecc34cb5 misc: Stop using String>>% for the to/from generation
To be able to port to Pharo more easily use a WriteStream and put
all the formatting in there.
2013-03-31 20:50:32 +02:00
Holger Hans Peter Freyther e6895f28d5 misc: Use String>>#expandWithMacros for all log messages 2013-03-31 20:47:58 +02:00
Holger Hans Peter Freyther 6559cc6c1c 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.
2013-03-31 19:40:05 +02:00
Holger Hans Peter Freyther f0d7c722d0 misc: Fix the category strings to ease porting to Pharo 2013-03-31 12:25:05 +02:00
Holger Hans Peter Freyther c9bed5b235 transport: Use the OsmoUDPSocket correctly 2012-09-07 14:59:28 +02:00
Holger Hans Peter Freyther fad5328063 transport: Create a testcase for sending data through the transport 2012-09-07 14:58:08 +02:00
Holger Hans Peter Freyther 554903c345 callagent: Move to the common udp socket handling code 2012-08-09 02:23:21 +02:00
Holger Hans Peter Freyther 90083758e1 sip: Make sure both TX/RX stop on socket close and image restart
Use DatagramSocket>>ensureReadable as this is using async poll,
make sure the socket is still open after ensureReadable returns.
Move the RX/TX into selectors as this allows us to return from
them.
2012-08-09 01:01:31 +02:00
Holger Hans Peter Freyther 895ca4fd4a process: Name all processes started by osmo-sip 2012-08-08 18:08:33 +02:00
Holger Hans Peter Freyther 62e17b57ab callagent: Use /dev/urandom as source and rename the class
The class was called SIPSecureRandom as it used /dev/random for
random numbers. The downside of /dev/random is that a read can
block until enough data has been generated. This does occur, e.g.
on an isolated system. Start using /dev/urandom for the tags. It
is better than the Mersene twister of GST but it is no source
for key material.
2012-08-07 20:57:14 +02:00
Holger Hans Peter Freyther 1f4723a902 callagent: Respond with a failure to OPTIONS requests
There is no proper implementation yet, also no way for an application
to tweak that behavior but there is also no need for that right now.
2012-08-06 01:26:03 +02:00
Holger Hans Peter Freyther 55765c9f0d callagent: Start to deal with requests in new dialogs
* This isn't doing proper routing (e.g. the via is not modified
  properly but we return it to the right address)
* An unknown BYE will be acked with a 481. The 'respondWith:...'
  includes the wrong 'Allow:' but it is good enough from the
  structure for now.
* Re-Order the loading of files as the SIPUserAgent is extended
  the SIPRequests.
* Add the port/ip to the SIPDialog so that responding to the
  request is possible.
2012-08-06 01:20:54 +02:00
Holger Hans Peter Freyther 5b1b3f891d callagent: Move the respond with to the callagent class 2012-08-06 00:34:14 +02:00
Holger Hans Peter Freyther 5b870389f0 callagent: Create a class to handle OPTIONS
Linphone insists on sending it and the RFC says that handling
is mandatory. Start with being able to parse the message.
2012-08-05 16:48:45 +02:00
Holger Hans Peter Freyther 536891d433 typo: Fix spelling of mandatory 2012-08-03 11:03:42 +02:00
Holger Hans Peter Freyther 5b057eb5c3 callagent: Parse a status response 2012-08-03 11:02:41 +02:00
Holger Hans Peter Freyther 1c58c2fe26 misc: Add proper categories to the various SIP classes 2011-09-27 17:43:43 +02:00
Holger Hans Peter Freyther e134b1e825 call: Forward the notification and allow a subclass to handle it
For the GSM integration we want to look at the 183 code and then
provide the ringtone.
2011-07-21 00:04:05 +02:00
Holger Hans Peter Freyther bfd9a0c621 cancel: Improve log messages, fix the cancelation of a call
The code changed the state and then compared it to the given
state, remember the old state before changing it.
2011-07-20 21:07:55 +02:00
Holger Hans Peter Freyther 0e699fdee2 callagent: Improve the logging and remove the printNl. 2011-07-06 20:34:57 +02:00
Holger Hans Peter Freyther 907409c0c9 callagent: Handle the BYE Request to close down a connection.
Handle the incoming request, in case of the BYE close down the
session...
2011-07-06 20:34:20 +02:00
Holger Hans Peter Freyther 93f816ea4f callagent: Introduce the SIPSessionBase, prepare handling Requests
The name session base is a bit misleading as it is not the session
that holds the initial dialog, the confirmed dialog, the UAS and then
also the session when it is setup. When the dialog gets confirmed we
will register it with the useragent and then will be called for new
requests. On hangup/cancel the dialog will be scheduled for removal.
2011-07-06 19:45:34 +02:00
Holger Hans Peter Freyther 44efac4f5b callagent: Big performance improvement, cache the parser
Constructing a PetitParser is an expensive operation (Object>>becomeForward:)
we can keep the parser in the class. For the SIPTransactions we keep it as
a global, it is assumed that all SIPTransactions operate through the same
process and will not run into concurrency issues.
2011-07-06 19:25:04 +02:00
Holger Hans Peter Freyther 29fdd40b85 callagent: Add some more tests to the Via parsing. 2011-07-06 18:47:07 +02:00
Holger Hans Peter Freyther faf842cf21 callagent: Handle the the ip address properly... fold/flatten it 2011-07-06 18:39:09 +02:00
Holger Hans Peter Freyther 117fba25ef callagent: Remove the transaction 60s after we think it should go
Do not allow to keep the transaction alive after we decided it
should go.
2011-07-06 15:04:48 +02:00
Holger Hans Peter Freyther f997ab4fbc callagent: Work on canceling a transaction..
This is still more complicated (and wrong) then it should be,
when we CANCEL an INVITE we can either send a CANCEL or we need
to wait for a 100. Now the CANCEL could be too late (the server
already sent a 200), in that case we would get a 200 for the
INVITE and pass this to the higher levels (which we probably
should).
2011-07-05 20:27:22 +02:00
Holger Hans Peter Freyther 9aa3efa1f4 callagent: Fix the SIPVia parsing with optional parameters 2011-07-05 17:14:12 +02:00
Holger Hans Peter Freyther 857486d616 callagent: Fix Contact, SIPCall state, leave the transaction
When sending a result, it might get lost and we will get
another request to reply to, allow to change to the same
state, fix the contact header.
2011-07-05 15:44:43 +02:00
Holger Hans Peter Freyther 3a503338e0 callagent: Provide an easy method to either cancel or hangup 2011-07-05 14:25:43 +02:00
Holger Hans Peter Freyther 12b320f012 callagent: Work on call Call Control, setup the call properly...
- Stop the retransmit timer after we checked the From/To
- Add proper state transitions to SIPCall...
- Support not sending an ACK...
2011-07-05 14:20:57 +02:00
Holger Hans Peter Freyther e3960bea3f callagent: Check if two SIPDialog's are compatible 2011-07-05 12:06:36 +02:00
Holger Hans Peter Freyther 6bc4e9826d callagent: Remove unused variable in the test code. 2011-07-05 11:21:00 +02:00
Holger Hans Peter Freyther ef1cab4bf3 callagent: The SDP file is not part of the dialog but of the session
Do not keep the SDP file inside the dialog, it would be part of
the session.
2011-07-05 11:18:34 +02:00
Holger Hans Peter Freyther 8304e862f0 callagent: Add code to create a SIPDialog from the request/response
The code only tests this with the response but it should work for
the request as well. Depending on this one needs to switch from/to
but this needs to happen on a higher level.
2011-07-05 11:14:55 +02:00
Holger Hans Peter Freyther 9caf52cdcc callagent: Fix the string for logging the state transition 2011-07-05 11:14:10 +02:00
Holger Hans Peter Freyther accd04e522 callagent: Change the CSeq code
The CSeq only needs to be unique within a dialog, so we can have
a global function to generate a valid CSeq start (< 2^31) and then
handle cseq's within the dialog.
2011-07-05 11:08:48 +02:00
Holger Hans Peter Freyther bba8bd1bc2 callagent: Provide a proper Contact header for this service 2011-07-05 09:32:20 +02:00
Holger Hans Peter Freyther d188d2afed callagent: Introduce high level SIP Call
Introduce a high level class that can create multiple transactions,
handles the sequence numbers, the dialogs, the opened session and
provides a nice call, hangup, cancel, terminate interface.
2011-07-04 22:30:14 +02:00
Holger Hans Peter Freyther 44bea36041 callagent: Timeout fixes, pass the dialog along...
This is fixing a previous commit, fixes the timed out handling, attempts
to change the initial dialog -> confirmed dialog handling (but still
gets it wrong, it should compare the dialog, or just get a new dialog
from the response and check if it is compatible with the initial dialog).
2011-07-04 22:23:29 +02:00
Holger Hans Peter Freyther ef0823526f transaction: Remember if an INVITE has been canceled.
Only the INVITE transaction can be canceled, when it gets
canceled we might or might not get a confirmation or we might
be too late to cancel things. With this flag we will be able
to do something sensible when we get a late final response.
2011-06-30 12:11:53 +02:00
Holger Hans Peter Freyther f720f9ea0a transaction: Make the callbacks pass the dialog
The transaction now work on something called an initial dialog, e.g.
during a INVITE we go from an initial dialog to a confirmed dialog and
maybe create a session. Prepare the code to support this.

It is still not clear how callbacks, dialog confirmation and session
creation will be handled but it will somehow fit together.
2011-06-30 12:08:50 +02:00
Holger Hans Peter Freyther 276fdb54b3 parser: Add the parsing to the From tag as well 2011-06-30 12:05:27 +02:00
Holger Hans Peter Freyther 12a83f9fad parser: Create the test data using a WriteStream 2011-06-30 11:41:50 +02:00
Holger Hans Peter Freyther b41d170320 parser: Extract the generic_param/to_param provide access to the tag
Parse every generic_param (or specialized) into a SIPGenericParam,
provide a asFoldedString implementation, tell the folding code about
it, create a SIPToFromParam that holds the list of params.
2011-06-30 11:36:57 +02:00
Holger Hans Peter Freyther c386b9f147 callagent: Dispatch received data with OsmoDispatcher
Dispatch the data from thre socket in a new context. This assures
that we will not run into locking issues. One day where we will have
VMs that can use multiple cores we might have a dispatcher set in
each transaction/session. The we could establish a rule that each
transaction is dispatched in the right/same queue.
2011-06-30 11:36:57 +02:00