callagent: Manually parse the 'tag' from a to...
This should be done through the grammar instead.
This commit is contained in:
parent
88e451670c
commit
8330ad52d6
|
@ -63,6 +63,7 @@ Object subclass: SIPDialog [
|
|||
|
||||
toTag: aTag [
|
||||
<category: 'accessing'>
|
||||
to_tag := aTag
|
||||
]
|
||||
|
||||
callId [
|
||||
|
@ -100,4 +101,26 @@ Object subclass: SIPDialog [
|
|||
destPort [
|
||||
^ dest_port
|
||||
]
|
||||
|
||||
updateFromRequest: aReq [
|
||||
to_tag ifNil: [
|
||||
| to pos tag|
|
||||
to := aReq parameter: 'To' ifAbsent: [^false].
|
||||
|
||||
pos := to indexOf: ';tag=' matchCase: true startingAt: 1.
|
||||
pos ifNil: [^self].
|
||||
|
||||
tag := WriteStream on: (String new).
|
||||
|
||||
(pos last + 1) to: to size do: [:pos |
|
||||
(to at: pos) = $; ifTrue: [
|
||||
to_tag := tag contents.
|
||||
^ self
|
||||
].
|
||||
|
||||
tag nextPut: (to at: pos).
|
||||
].
|
||||
to_tag := tag contents.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
|
|
@ -110,6 +110,9 @@ Object subclass: SIPTransaction [
|
|||
<category: 'dispatch'>
|
||||
|
||||
('Found response %1 %2' % {aReq code. aReq phrase}) printNl.
|
||||
|
||||
dialog updateFromRequest: aReq.
|
||||
|
||||
code := aReq code asInteger.
|
||||
code < 200 ifTrue: [
|
||||
^ self respNotification: aReq
|
||||
|
|
Reference in New Issue