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

172 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 15d8883c95 rand: 1^N == 1 all the time.. 2015-07-24 15:36:01 +02:00
Holger Hans Peter Freyther 57e67cac55 test: Remember the right collection
When executing multiple tests we might not have the collection we
want anymore. Some tests don't stop all the timers so we have a
retransmit and this would cause an exception and log spam.
2015-07-24 14:03:15 +02:00
Holger Hans Peter Freyther d1e8b2dcd5 cseq: Make the testcases work with different cseq as well 2015-07-24 14:01:19 +02:00
Holger Hans Peter Freyther 21d395593e pharo: Allow converting the authorization message as well
We need >>#do: as nextPutAllOn: is not called/doesn't exist in
this dialect.
2015-07-24 12:13:38 +02:00
Holger Hans Peter Freyther d00bcc74a4 tests: Modernize and use >>#assert:equals
Modernize the tests to use the >>#assert:equals: protocol as
this allows creating/finding failing tests earlier.
2015-07-24 12:09:32 +02:00
Holger Hans Peter Freyther 2abc6e82e5 base64: Remove method we don't use
Avoid porting issue with the MIMERWStream and just kill the method
2015-07-24 11:53:03 +02:00
Holger Hans Peter Freyther 1e249c5e0e cseq: Fix the log message and print old and new cseq 2015-07-24 11:51:04 +02:00
Holger Hans Peter Freyther 61a7928236 cseq: Use asString for portability with pharo 2015-07-24 11:50:45 +02:00
Holger Hans Peter Freyther 54d9f2059b pharo: Update the conversion code
PetitParser has a PPContext in newer versions but the GST code
is older and doesn't have it. Provide an alternative impl.

Provide >>#do: for the SIPVia for Pharo to print the data

Avoid importing MIMERWStream as it is dead in Pharo
2015-07-23 21:37:26 +02:00
Holger Hans Peter Freyther 439f34e675 use an IPv4 address instead of localhost
Depending on the host OS localhost might resolve to something
we can't handle properly. In a FreeBSD jail this started to
behave oddly. There is no point to force AF_INET6 for this
test.

open("/etc/hosts",O_CLOEXEC,0666)		 = 3 (0x3)
fstat(3,{ mode=-rw-r--r-- ,inode=12621,size=1138,blksize=4096 }) = 0 (0x0)
read(3,"# $FreeBSD: src/etc/hosts,v 1.16"...,4096) = 1138 (0x472)
read(3,0x80282e000,4096)			 = 0 (0x0)
close(3)					 = 0 (0x0)
__sysctl(0x7fffffffaff0,0x4,0x0,0x7fffffffb070,0x0,0x0) = 0 (0x0)
__sysctl(0x7fffffffaff0,0x4,0x82b0aa300,0x7fffffffb070,0x0,0x0) = 0 (0x0)
socket(PF_INET6,0x10000002,17)			 = 3 (0x3)
connect(3,{ AF_INET6 [::1]:1 },28)		 = 0 (0x0)
getsockname(3,{ AF_INET6 [2a01:4f8:150:70c4::5:2]:55378 },0x7fffffffafec) = 0 (0x0)
ioctl(3,SIOCGIFAFLAG_IN6,0xffffaec8)		 ERR#6 'Device not configured'
close(3)					 = 0 (0x0)
socket(PF_INET6,0x10000002,17)			 = 3 (0x3)
connect(3,{ AF_INET6 [::1]:1 },28)		 = 0 (0x0)
getsockname(3,{ AF_INET6 [2a01:4f8:150:70c4::5:2]:14967 },0x7fffffffafec) = 0 (0x0)
ioctl(3,SIOCGIFAFLAG_IN6,0xffffaec8)		 ERR#6 'Device not configured'
close(3)					 = 0 (0x0)
socket(PF_INET6,0x10000002,17)			 = 3 (0x3)
connect(3,{ AF_INET6 [::1]:1 },28)		 = 0 (0x0)
getsockname(3,{ AF_INET6 [2a01:4f8:150:70c4::5:2]:39503 },0x7fffffffafec) = 0 (0x0)
ioctl(3,SIOCGIFAFLAG_IN6,0xffffaec8)		 ERR#6 'Device not configured'
close(3)					 = 0 (0x0)
2015-03-20 08:33:45 +01:00
Holger Hans Peter Freyther 6c57c968dd grammar: Speed-up quoted string parsing
On the sysmoBTS (ARM7TDMI) the parsing of a simple response
with quoted string takes up to 200ms. Parsing the single
digest line takes 40ms itself. Create a custom parser to
speed things up to avoid the backtracking between three
optional parsers that are combined in a choice.
2014-09-05 18:56:00 +02:00
Holger Hans Peter Freyther f13639d443 misc: Use separatedBy: for the beauty of reading it, no big win 2014-09-05 14:23:05 +02:00
Holger Hans Peter Freyther 89e653a41a call: Handle CANCEL and verify that the right messages are returned
The code does not verify that sessionFailed is called but it
does verify that the dialogue is scheduled for removal and
that 487/200 is returned.
2014-08-29 20:44:10 +02:00
Holger Hans Peter Freyther 9161371a32 perf: Various changes to speed up various operations
* Do not use >>#instVarNamed:put: but add selectors
* Pre-allocate some arrays with a default string to avoid
  re-allocations at the start
* Share same parser trees to avoid construction costs
* Remove some lazy allocation and always allocate it
2014-08-29 20:39:46 +02:00
Holger Hans Peter Freyther a536a7a788 callagent: Do not mix From/To in the response we generate
In the SIPDialog we need to switch from/to to send messages
from the right "From" but for a response we musn't do that.
YATE doesn't like if we respond with From/To mixed to their
BYE request.
2014-08-10 20:36:14 +02:00
Holger Hans Peter Freyther 1a20f003aa misc: Re-use the parser for a great speed-up during the tests
Creating a PetitParser is expensive due the usage of >>#become:
so let us re-use the one from the SIPCallAgent.
2014-08-10 20:28:59 +02:00
Holger Hans Peter Freyther 1e43d02ed3 transaction: ACK the 401 Unauthorized message before we change
So this code acks the 401 Unauthorized message. It is possible
that this message is lost on the way we will not be able to
respond to the 401 again. The right thing would be to "fork" off
the transaction to deal with re-transmissions.
2014-08-10 19:49:05 +02:00
Holger Hans Peter Freyther df79f4c469 call: Deal with both ends hanging up at the same time 2014-08-10 19:39:28 +02:00
Holger Hans Peter Freyther 88c8005597 misc: Make code more portable by using "self basicNew initialize" 2014-07-24 15:49:29 +02:00
Holger Hans Peter Freyther 4e38ef3ece call: For a re-invite we need to handle the ACK
In case the remote will do a re-invite to verify that we are
still aware of the call we need to handle >>#sessionAcked:dialog:

This probably got introduced when I introduced the incoming
call support that will send a 200 and receive the ACK.

The incoming call will print a warning that session->session is
not a valid state transition but nothing bad will happen.
2014-07-04 19:34:34 +02:00
Holger Hans Peter Freyther 804459c35a proxy: And once more. 2014-06-20 15:14:44 +02:00
Holger Hans Peter Freyther cc1d2d3e2f auth: qop is not included by sipgate as well.. 2014-06-20 15:11:39 +02:00
Holger Hans Peter Freyther b0fae4c117 proxy: Add the same default handling for md5 2014-06-20 15:00:43 +02:00
Holger Hans Peter Freyther 4bf83bb523 call: Fix typo in the selector name 2014-06-20 14:35:35 +02:00
Holger Hans Peter Freyther e2d1145639 auth: Sipgate doesn't send the algorithm. assume it is md5 2014-06-20 14:19:10 +02:00
Holger Hans Peter Freyther eb578aa93e call: Document the "sessionAcked" thinko and deal with it later 2014-06-16 15:45:40 +02:00
Holger Hans Peter Freyther 29242f86a1 call: End the session at any hangup result
E.g. the hangup could have failed due the other side already
having hung up but at some point we need to stop caring about
it.
2014-06-05 17:24:39 +02:00
Holger Hans Peter Freyther a28c2ab64c response: Provide a Content-Type/Content-Length as well 2014-06-05 16:30:16 +02:00
Holger Hans Peter Freyther 160b36056a invite: Extend the testcase to actually ask for hanging up 2014-06-05 15:49:52 +02:00
Holger Hans Peter Freyther 8b626c8a52 parser/grammar: Be able to parse domain used by Yate.
It looks like "domain" is not proper in yate. Just parse it as
numbers and words.
2014-06-02 22:06:31 +02:00
Holger Hans Peter Freyther 24dbbc986c callagent: Avoid running into the EndOfStream exception 2014-06-02 21:34:22 +02:00
Holger Hans Peter Freyther 58cd187895 call: Provide access to the remote SDP file 2014-06-02 20:51:50 +02:00
Holger Hans Peter Freyther 8a820162d2 invite: Verify we have a remoteSDP file and it is matching
This way we can fully handle a session once the sessionNew selector
is called by the code.
2014-05-28 12:05:12 +02:00
Holger Hans Peter Freyther 1a3d577894 invite: Debug/test the re-transmit handling and fix it 2014-05-28 12:04:32 +02:00
Holger Hans Peter Freyther 3864d6ae2f invite: Add code to get all the way to an ACKed session
What is probably missing is to start a timer in case something
is not acked to have a call timedout and to send a failure message
to the other side.
2014-05-28 12:04:07 +02:00
Holger Hans Peter Freyther 01260bb20e invite: Deal with re-transmit of a rejected call
In case our reject does not arrive and is re-transmitted we
should reject it too.

* Modify SIPDialog>>#checkCompatible. We have to accept that
  the remote does not know the tag we assigned. Be more forgiving
* Send the INVITE again and count our rejects.
2014-05-28 12:03:45 +02:00
Holger Hans Peter Freyther b2099a8474 invite: First shot at handling the SIP Invite
Create a SIPIncomingCall and register the dialog. The "Via" and
remote handling is broken. The "respond with" is broken too. The
whole dialog/request passing to the UserAgent is broken and needs
to be fixed.
2014-05-28 11:53:17 +02:00
Holger Hans Peter Freyther 69810d6afa invite: Create a base class for the "call"
I nee to differentiate between incoming and outgoing calls. At
the same time a lot of logic can be shared. Specially at the
time the call is established the hangup will work the same on
both sides.
2014-05-27 18:21:18 +02:00
Holger Hans Peter Freyther 77ef4b6ece session: Fix a typo/grammar in the comment 2014-05-27 15:15:16 +02:00
Holger Hans Peter Freyther a819a8b877 invite: Begin to handle the incoming INVITE from the network
Add a new test, inject a SIP Invite. Verify that the SIPUserAgent
rejects the invite.
2014-05-27 15:01:50 +02:00
Holger Hans Peter Freyther 15f1f07631 parser: Be aple to parse From/To with display_name in it
A rule like "ANY star / quoted_string" will only parse the ANY
rules for '0' times. Change the order to avoid this and add a
small test that we properly parse the From address now.
2014-05-27 14:55:18 +02:00
Holger Hans Peter Freyther 33f1e40cbe parser: Fix the grammar and update the example message
token requires the presence of at least one match. The usage of
star has been wrong and is corrected now. This was seen due not
being able to parse a From address that included a diplay name.
Remove the trailing ";" to fix the parsing bug.
2014-05-27 14:55:18 +02:00
Holger Hans Peter Freyther 1a634a1492 identity: Remove use the "contact" and userString from SIPIdentity
The code allows (and that looks like a good thing) to have a different
from and username in the authorization. The userString was not really
right as it was missing the URL part (sip/sips) and the splitting was
broken as well.
2014-04-22 14:39:42 +02:00
Holger Hans Peter Freyther e89ddfa07a identity: Fix the identity string for the from 2014-04-22 14:39:11 +02:00
Holger Hans Peter Freyther 0c609b9975 identity: Move the identity into the SIPDialog
This way the one that creates a dialog needs to decide which
identity will be used.
2014-04-22 14:18:26 +02:00
Holger Hans Peter Freyther 3779496a4a identity: Make the SIPSession work based on identity 2014-04-03 11:05:08 +02:00
Holger Hans Peter Freyther 858d25e2be identity: Remove direct usage of of useragent username
In preparation of introducing multiple identities we need to
remove usage of SIPUserAgent>>#username. The next step is to
actually be able to pass a different identity.
2014-04-02 18:28:09 +02:00
Holger Hans Peter Freyther 89efe79f71 identity: Make it possible to have a separate proxy username/password
Make it possible that the proxy username and password is different
to the identity of the user.
2014-04-02 18:16:04 +02:00
Holger Hans Peter Freyther 72afcc72e4 identity: Introduce the concept of an identity to the useragent
The Transport to UserAgent relationship is a one to one. E.g. we
need this to generate unique branch and call-ids to make sure the
dialogues are different. To be able to use multiple identities I
introduce a SIPIdentity class. Currently the user agent has one
main identity but this could change over time.
2014-04-02 17:44:39 +02:00
Holger Hans Peter Freyther 2020d4cdf4 test: Add test for remote-hangup handling
The whole response handling code was broken. Make sure to increase
the test coverage of the system.
2014-03-25 12:59:26 +01:00