| 1 | # |
| 2 | # Test driver for alt-pjsua-uac-custom-sdp.xml |
| 3 | # |
| 4 | # alt_pjsua acts as UAC. It places a call to SIPp (UAS) using a custom SDP |
| 5 | # with audio (PCMU) and video (H263-1998). The call should reach |
| 6 | # STATE_CONFIRMED. |
| 7 | # |
| 8 | # Run with alt_pjsua: |
| 9 | # cd tests/pjsua && python3 run.py \ |
| 10 | # --exe ../../pjsip-apps/src/3rdparty_media_sample/alt_pjsua \ |
| 11 | # mod_sipp.py scripts-sipp/alt-pjsua-uac-custom-sdp.xml |
| 12 | # |
| 13 | import inc_const as const |
| 14 | |
| 15 | # pjsua instance: UAC. No URI in args so the call is initiated via CLI |
| 16 | # after cli_main() has set up the telnet log redirect. |
| 17 | # --rtp-port 4000 pins the audio RTP port; video uses 4002 (next even port). |
| 18 | # PJMEDIA_HAS_VIDEO=1 in config_site.h makes pjsua_call_setting_default set |
| 19 | # vid_cnt=1, so med_prov_cnt=2 (audio+video), matching the custom SDP. |
| 20 | PJSUA = [ |
| 21 | "--null-audio --max-calls=1 --no-tcp --rtp-port 4000 " |
| 22 | "--custom-sdp \"v=0\\r\\no=- 1234567890 1234567890 IN IP4 127.0.0.1" |
| 23 | "\\r\\ns=-\\r\\nc=IN IP4 127.0.0.1\\r\\nt=0 0" |
| 24 | "\\r\\nm=audio 4000 RTP/AVP 0\\r\\na=rtpmap:0 PCMU/8000" |
| 25 | "\\r\\nm=video 4002 RTP/AVP 96\\r\\na=rtpmap:96 H263-1998/90000\"" |
| 26 | ] |
| 27 | |
| 28 | PJSUA_CLI_EXPECTS = [ |
| 29 | [0, "", "call new $SIPP_URI"], |
| 30 | # Verify the SDP SIPp sends in its 200 OK is received by alt_pjsua. |
| 31 | # Codec check only (no IP/port) for environment independence. |
| 32 | [0, r"v=0", ""], |
| 33 | [0, r"s=-", ""], |
| 34 | [0, r"t=0 0", ""], |
| 35 | [0, r"a=rtpmap:0 PCMU/8000", ""], |
| 36 | [0, r"a=rtpmap:96 H263-1998/90000", ""], |
| 37 | [0, const.STATE_CONFIRMED, "call hangup"], |
| 38 | ] |