diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-06-27 21:22:12 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-06-27 21:22:12 +0000 |
commit | b3d805986a672e0794333a6a1aabb0a6d3da6c37 (patch) | |
tree | 10de0db6d8ff19791e14f8257adb773ebc727edc /pjsip-apps/src/test-pjsua | |
parent | d7ee0066d767c259fba9c51d3a6e1c00d1261533 (diff) |
Added the ability to send a complete/arbitrary SIP INVITE message in mod_sendto.py Python test script
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2080 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src/test-pjsua')
-rw-r--r-- | pjsip-apps/src/test-pjsua/inc_sip.py | 7 | ||||
-rw-r--r-- | pjsip-apps/src/test-pjsua/mod_sendto.py | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/pjsip-apps/src/test-pjsua/inc_sip.py b/pjsip-apps/src/test-pjsua/inc_sip.py index a4eb15ad..122eeae0 100644 --- a/pjsip-apps/src/test-pjsua/inc_sip.py +++ b/pjsip-apps/src/test-pjsua/inc_sip.py @@ -205,6 +205,10 @@ class SendtoCfg: name = "" # pjsua InstanceParam inst_param = None + # Complete INVITE message. If this is not empty, then this + # message will be sent instead and the "sdp" and "extra_headers" + # settings will be ignored. + complete_msg = "" # Initial SDP sdp = "" # Extra headers to add to request @@ -220,7 +224,8 @@ class SendtoCfg: # Constructor def __init__(self, name, pjsua_args, sdp, resp_code, resp_inc=[], resp_exc=[], use_tcp=False, - extra_headers=""): + extra_headers="", complete_msg=""): + self.complete_msg = complete_msg self.sdp = sdp self.resp_code = resp_code self.resp_include = resp_inc diff --git a/pjsip-apps/src/test-pjsua/mod_sendto.py b/pjsip-apps/src/test-pjsua/mod_sendto.py index 826c509f..4cc12a41 100644 --- a/pjsip-apps/src/test-pjsua/mod_sendto.py +++ b/pjsip-apps/src/test-pjsua/mod_sendto.py @@ -18,7 +18,10 @@ def test_func(t): #dlg = sip.Dialog("127.0.0.1", 5060, tcp=cfg_file.sendto_cfg.use_tcp) cfg = cfg_file.sendto_cfg - req = dlg.create_invite(cfg.sdp, cfg.extra_headers) + if len(cfg.complete_msg) != 0: + req = cfg.complete_msg + else: + req = dlg.create_invite(cfg.sdp, cfg.extra_headers) resp = dlg.send_request_wait(req, 10) if resp=="": raise TestError("Timed-out waiting for response") |