| 1 |
import inc_sip as sip |
| 2 |
import inc_sdp as sdp |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
pjsua = "--null-audio --id=sip:127.0.0.1:$PORT --registrar sip:127.0.0.1:$PORT " + \ |
| 8 |
"--realm=python --user=username --password=password " + \ |
| 9 |
"--auto-update-nat=0 --publish" |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
req1 = sip.RecvfromTransaction("Initial REGISTER", 200, |
| 14 |
include=["REGISTER sip"], |
| 15 |
exclude=[], |
| 16 |
resp_hdr=["Expires: 1800"] |
| 17 |
) |
| 18 |
|
| 19 |
|
| 20 |
req2 = sip.RecvfromTransaction("Initial PUBLISH, will be replied with 412", 412, |
| 21 |
include=["PUBLISH sip"], |
| 22 |
exclude=["Expires:"] |
| 23 |
) |
| 24 |
|
| 25 |
|
| 26 |
req3 = sip.RecvfromTransaction("Second PUBLISH, will be replied with 200", 200, |
| 27 |
include=["PUBLISH sip"], |
| 28 |
exclude=["Expires:"], |
| 29 |
resp_hdr=["Expires: 60", "SIP-ETag: dx200xyz"] |
| 30 |
) |
| 31 |
|
| 32 |
|
| 33 |
req4 = sip.RecvfromTransaction("PUBLISH refresh, will be replied with 408", 408, |
| 34 |
include=["PUBLISH sip", "SIP-If-Match: dx200xyz"], |
| 35 |
exclude=["Expires:"], |
| 36 |
resp_hdr=["Expires: 60", "SIP-ETag: dx200xyz"] |
| 37 |
) |
| 38 |
|
| 39 |
|
| 40 |
req5 = sip.RecvfromTransaction("PUBLISH retry", 200, |
| 41 |
include=["PUBLISH sip"], |
| 42 |
exclude=["Expires:", "SIP-If-Match:"], |
| 43 |
resp_hdr=["Expires: 60", "SIP-ETag: abc"] |
| 44 |
) |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
recvfrom_cfg = sip.RecvfromCfg("PUBLISH scenarios", |
| 49 |
pjsua, [req1, req2, req3]) |
| 50 |
|