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

callagent: Parse a status response

This commit is contained in:
Holger Hans Peter Freyther 2012-08-03 11:02:41 +02:00
parent 1c58c2fe26
commit 5b057eb5c3
1 changed files with 22 additions and 0 deletions

View File

@ -124,4 +124,26 @@ PP.PPCompositeParserTest subclass: SIPParserTest [
assert: (res parameter: 'Via' ifAbsent: []) branch = 'z9hG4bKvt9FDU96c89cQ';
assert: (res parameter: 'CSeq' ifAbsent: []) number = 14600327.
]
statusResponseData [
^ (WriteStream on: String new)
nextPutAll: 'SIP/2.0 416 Unsupported URI Scheme'; cr; nl;
nextPutAll: 'Via: SIP/2.0/UDP 192.168.0.101:5061;branch=z9hG4bKMzQ4ODYxODcyOCwyMDg0MA__'; cr; nl;
nextPutAll: 'From: <sip:1000@osmocom.org>;tag=MzQ4ODYyNTkyODQxMDY0OTAxMzI_'; cr; nl;
nextPutAll: 'To: <1000@192.168.0.106>;tag=5UtDUa1DeFa4S'; cr; nl;
nextPutAll: 'Call-ID: MTg3NzU0Mjk2MQ__@xiaoyu'; cr; nl;
nextPutAll: 'CSeq: 1 INVITE'; cr; nl;
nextPutAll: 'User-Agent: FreeSWITCH-mod_sofia/1.0.head-git-7cb0951 2011-06-24 18-28-56 -0500'; cr; nl;
nextPutAll: 'Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE'; cr; nl;
nextPutAll: 'Supported: timer, precondition, path, replaces'; cr; nl;
nextPutAll: 'Content-Length: 0'; cr; nl;
cr; nl;
contents
]
testStatusResponse [
| res dlg |
res := SIPParser parse: self statusResponseData.
"dlg := SIPDialog fromMessage: res."
]
]