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

more hacks..

This commit is contained in:
Holger Hans Peter Freyther 2014-03-18 19:31:35 +01:00
parent 71aaedb922
commit 15ef9af479
3 changed files with 14 additions and 5 deletions

View File

@ -17,7 +17,7 @@
"
SIPTransaction subclass: SIPInviteTransaction [
| sdp ack_branch canceled |
| sdp ack_branch canceled cancelSent |
<category: 'OsmoSIP-Callagent'>
<comment: 'RFC3161 17.2.1'>
@ -36,7 +36,8 @@ SIPTransaction subclass: SIPInviteTransaction [
initialize [
<category: 'creation'>
super initialize.
canceled := false
canceled := false.
cancelSent := false.
]
transmit [
@ -85,7 +86,13 @@ SIPTransaction subclass: SIPInviteTransaction [
"We will send a CANCEL, maybe it is already the second."
code < 200 ifTrue: [
self queueData: (self createCancel asDatagram) dialog: initial_dialog.
"Some equipment sent us 100 TRYING. We sent CANCEL, we got a 200 for
and then we 'ACK' the cancel. Just for the equipment to send us trying
again. TODO: Link a cancel transaction here? And verify that it succeeded?
"
cancelSent ifFalse: [
self queueData: (self createCancel asDatagram) dialog: initial_dialog].
cancelSent := true.
].
"We are connected but we didn't want to, let us BYE it"
@ -148,6 +155,7 @@ SIPTransaction subclass: SIPInviteTransaction [
old_state = self class stateProceeding ifTrue: [
self queueData: self createCancel asDatagram dialog: initial_dialog.
cancelSent := true.
].
old_state = self class stateCompleted ifTrue: [
self logError: 'SIPTransaction already completed.' area: #sip.

View File

@ -44,8 +44,8 @@ SIPTransaction subclass: SIPRegisterTransaction [
addParameter: 'CSeq' value: ('<1p> <2s>'
expandMacrosWith: cseq with: 'REGISTER');
addParameter: 'Call-ID' value: aDialog callId;
addParameter: 'Contact' value: '*';
addParameter: 'Expires' value: '0';
addParameter: 'Contact' value: '<', aDialog contact, '>';
addParameter: 'Expires' value: '3600';
yourself.
self addAuthorizationTo: reg.
useragent injectDefaults: reg.

View File

@ -64,6 +64,7 @@ Object subclass: SIPUserAgentBase [
nextPutAll: transport port asString;
nextPutAll: ';branch=';
nextPutAll: aBranch;
nextPutAll: ';rport';
contents.
]