callagent: Move the creation of messages into the base
This commit is contained in:
parent
026e0bd87b
commit
c47d0568eb
|
@ -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
|
||||
]
|
||||
]
|
||||
|
|
Reference in New Issue