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

callagent: Move the creation of messages into the base

This commit is contained in:
Holger Hans Peter Freyther 2011-06-14 17:01:08 +02:00
parent 026e0bd87b
commit c47d0568eb
1 changed files with 32 additions and 33 deletions

View File

@ -68,7 +68,6 @@ Object subclass: SIPTransaction [
branch := useragent class generateBranch.
]
queueData: aData [
| res datagram |
"validate the output"
@ -147,25 +146,6 @@ Object subclass: SIPTransaction [
self transmit.
]
]
SIPTransaction subclass: SIPInviteTransaction [
| sdp ack_branch |
<category: 'RFC3161 17.2.1'>
"200ms to get TRYING or OK"
SIPInviteTransaction class >> createWith: aDialog on: aUA with: aSDP [
^ (super createWith: aDialog on: aUA)
instVarNamed: #sdp put: aSDP;
yourself.
]
transmit [
| invite |
invite := self createInvite.
self queueData: invite asDatagram.
]
createInvite [
| invite |
@ -195,6 +175,38 @@ SIPTransaction subclass: SIPInviteTransaction [
^ ack
]
createBye [
| bye |
<category: 'invite'>
bye := (SIPByeRequest from: dialog)
addParameter: 'Via' value: (useragent generateVia: branch);
addParameter: 'CSeq' value: '%1 %2' % {cseq. 'BYE'};
addParameter: 'Call-ID' value: dialog callId;
yourself.
useragent injectDefaults: bye.
^ bye
]
]
SIPTransaction subclass: SIPInviteTransaction [
| sdp ack_branch |
<category: 'RFC3161 17.2.1'>
"200ms to get TRYING or OK"
SIPInviteTransaction class >> createWith: aDialog on: aUA with: aSDP [
^ (super createWith: aDialog on: aUA)
instVarNamed: #sdp put: aSDP;
yourself.
]
transmit [
| invite |
invite := self createInvite.
self queueData: invite asDatagram.
]
respSuccess: aReq [
| branch |
branch := useragent class generateBranch.
@ -219,17 +231,4 @@ SIPTransaction subclass: SIPByeTransaction [
bye := self createBye.
self queueData: bye asDatagram.
]
createBye [
| bye |
<category: 'invite'>
bye := (SIPByeRequest from: dialog)
addParameter: 'Via' value: (useragent generateVia: branch);
addParameter: 'CSeq' value: '%1 %2' % {cseq. 'BYE'};
addParameter: 'Call-ID' value: dialog callId;
yourself.
useragent injectDefaults: bye.
^ bye
]
]