| 1 | import inc_sip as sip |
| 2 | import inc_sdp as sdp |
| 3 | |
| 4 | pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \ |
| 5 | "--username user --realm \"*\" --password passwd --auto-update-nat=0" |
| 6 | |
| 7 | req1 = sip.RecvfromTransaction("Initial registration", 401, |
| 8 | include=["REGISTER sip"], |
| 9 | exclude=["Authorization"], |
| 10 | resp_hdr=["WWW-Authenticate: Digest realm=\"python\", nonce=\"1234\""], |
| 11 | expect="SIP/2.0 401" |
| 12 | ) |
| 13 | |
| 14 | req2 = sip.RecvfromTransaction("Registration retry with auth", 200, |
| 15 | include=["REGISTER sip", "Authorization:", |
| 16 | "realm=\"python\"", "username=\"user\"", |
| 17 | "nonce=\"1234\"", "response="], |
| 18 | expect="registration success" |
| 19 | ) |
| 20 | |
| 21 | recvfrom_cfg = sip.RecvfromCfg("Successful registration with wildcard realm test", |
| 22 | pjsua, [req1, req2]) |