Ignore:
Timestamp:
Aug 1, 2010 9:48:51 AM (14 years ago)
Author:
bennylp
Message:

Implemented core multipart support and support in the invite session (re #1070)

  • incoming multipart message will be handled automatically
  • for testing, enable HAVE_MULTIPART_TEST in pjsua_app.c
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/tests/pjsua/inc_sip.py

    r3194 r3243  
    108108                return msg 
    109109 
    110         def create_req(self, method, sdp, branch="", extra_headers=""): 
     110        def create_req(self, method, sdp, branch="", extra_headers="", body=""): 
    111111                if branch=="": 
    112112                        self.cseq = self.cseq + 1 
     
    120120                        msg = msg.replace("$CONTENT_LENGTH", str(len(sdp))) 
    121121                        msg = msg + "Content-Type: application/sdp\r\n" 
     122                        msg = msg + "\r\n" 
     123                        msg = msg + sdp 
     124                elif body!="": 
     125                        msg = msg.replace("$CONTENT_LENGTH", str(len(body))) 
     126                        msg = msg + "\r\n" 
     127                        msg = msg + body 
    122128                else: 
    123129                        msg = msg.replace("$CONTENT_LENGTH", "0") 
    124                 msg = msg + "\r\n" 
    125                 msg = msg + sdp 
    126130                return self.update_fields(msg) 
    127131 
     
    139143                return response 
    140144 
    141         def create_invite(self, sdp, extra_headers=""): 
     145        def create_invite(self, sdp, extra_headers="", body=""): 
    142146                self.inv_branch = str(random.random()) 
    143                 return self.create_req("INVITE", sdp, branch=self.inv_branch, extra_headers=extra_headers) 
     147                return self.create_req("INVITE", sdp, branch=self.inv_branch, extra_headers=extra_headers, body=body) 
    144148 
    145149        def create_ack(self, sdp="", extra_headers=""): 
     
    253257        # List of RE patterns that must NOT exist in response 
    254258        resp_exclude = [] 
     259        # Full (non-SDP) body 
     260        body = "" 
    255261        # Constructor 
    256262        def __init__(self, name, pjsua_args, sdp, resp_code,  
    257263                     resp_inc=[], resp_exc=[], use_tcp=False, 
    258                      extra_headers="", complete_msg="", 
     264                     extra_headers="", body="", complete_msg="", 
    259265                     enable_buffer = False): 
    260266                self.complete_msg = complete_msg 
     
    265271                self.use_tcp = use_tcp 
    266272                self.extra_headers = extra_headers 
     273                self.body = body 
    267274                self.inst_param = cfg.InstanceParam("pjsua", pjsua_args) 
    268275                self.inst_param.enable_buffer = enable_buffer  
Note: See TracChangeset for help on using the changeset viewer.