| 1 |
import inc_sip as sip |
| 2 |
import inc_sdp as sdp |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \ |
| 8 |
"--realm=python --user=username --password=password" |
| 9 |
|
| 10 |
req1 = sip.RecvfromTransaction("Initial request", 401, |
| 11 |
include=["REGISTER sip"], |
| 12 |
exclude=["Authorization"], |
| 13 |
resp_hdr=["WWW-Authenticate: Digest realm=\"python\", nonce=\"1\""] |
| 14 |
) |
| 15 |
|
| 16 |
req2 = sip.RecvfromTransaction("REGISTER retry", 401, |
| 17 |
include=["REGISTER sip", "Authorization", "nonce=\"1\""], |
| 18 |
exclude=["Authorization:[\\s\\S]+Authorization:"], |
| 19 |
resp_hdr=["WWW-Authenticate: Digest realm=\"python\", nonce=\"1\""], |
| 20 |
expect="PJSIP_EFAILEDCREDENTIAL" |
| 21 |
) |
| 22 |
|
| 23 |
|
| 24 |
recvfrom_cfg = sip.RecvfromCfg("Authentication failure with same nonce", |
| 25 |
pjsua, [req1, req2]) |