blob: 16ec214cc469ff2053ebb8f005cb28153f17d8d5 [file] [log] [blame]
Tristan Matthews0a329cc2013-07-17 13:20:14 -04001# $Id$
2import inc_sip as sip
3import inc_sdp as sdp
4
5pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \
6 "--realm=python --user=username --password=password " + \
7 "--auto-update-nat=0"
8
9# 423 Response without Min-Expires header
10req1 = sip.RecvfromTransaction("Initial request", 423,
11 include=["REGISTER sip"],
12 exclude=[],
13 resp_hdr=[]
14 )
15
16# Client should retry with Expires header containing special value (pjsip specific)
17req2 = sip.RecvfromTransaction("REGISTER retry after 423 response without Min-Expires header", 423,
18 include=["REGISTER sip", "Expires: 3601"],
19 exclude=[],
20 resp_hdr=["Min-Expires: 3612"]
21 )
22
23# Client should retry with proper Expires header now
24req3 = sip.RecvfromTransaction("REGISTER retry after proper 423", 200,
25 include=["Expires: 3612"],
26 exclude=[],
27 expect="registration success"
28 )
29
30recvfrom_cfg = sip.RecvfromCfg("Reregistration after 423 response",
31 pjsua, [req1, req2, req3])