Changeset 2440 for pjproject/trunk/tests/pjsua/inc_sip.py
- Timestamp:
- Feb 6, 2009 7:56:09 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/tests/pjsua/inc_sip.py
r2110 r2440 92 92 print str(time.strftime("%H:%M:%S ")) + txt 93 93 94 def create_req(self, method, sdp, branch="", extra_headers=""): 95 if branch=="": 96 self.cseq = self.cseq + 1 97 msg = req_templ 98 msg = msg.replace("$METHOD", method) 94 def update_fields(self, msg): 99 95 if self.tcp: 100 96 transport_param = ";transport=tcp" … … 104 100 msg = msg.replace("$LOCAL_IP", self.local_ip) 105 101 msg = msg.replace("$LOCAL_PORT", str(self.local_port)) 106 if branch=="":107 branch=str(random.random())108 msg = msg.replace("$BRANCH", branch)109 102 msg = msg.replace("$FROM_TAG", self.local_tag) 110 103 msg = msg.replace("$TO_TAG", self.rem_tag) 111 104 msg = msg.replace("$CALL_ID", self.call_id) 112 105 msg = msg.replace("$CSEQ", str(self.cseq)) 106 branch=str(random.random()) 107 msg = msg.replace("$BRANCH", branch) 108 return msg 109 110 def create_req(self, method, sdp, branch="", extra_headers=""): 111 if branch=="": 112 self.cseq = self.cseq + 1 113 msg = req_templ 114 msg = msg.replace("$METHOD", method) 113 115 msg = msg.replace("$SIP_HEADERS", extra_headers) 116 if branch=="": 117 branch=str(random.random()) 118 msg = msg.replace("$BRANCH", branch) 114 119 if sdp!="": 115 120 msg = msg.replace("$CONTENT_LENGTH", str(len(sdp))) … … 119 124 msg = msg + "\r\n" 120 125 msg = msg + sdp 121 return msg126 return self.update_fields(msg) 122 127 123 128 def create_response(self, request, code, reason, to_tag=""):
Note: See TracChangeset
for help on using the changeset viewer.