diff options
author | Benny Prijono <bennylp@teluu.com> | 2009-03-23 13:28:30 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2009-03-23 13:28:30 +0000 |
commit | b2b892124d30771fdf51a3e3768cd2268ec04b0a (patch) | |
tree | e050625516db57827941f3c3d06ef028739fa62e | |
parent | f10dfa76dd0aebe48fc6f680c598d60b64cbad41 (diff) |
Ticket #708: backported changes from ticket #707
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.0@2548 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjmedia/src/test/mips_test.c | 4 | ||||
-rw-r--r-- | pjmedia/src/test/sdp_neg_test.c | 10 | ||||
-rw-r--r-- | tests/pjsua/inc_sip.py | 23 | ||||
-rw-r--r-- | tests/pjsua/mod_sendto.py | 2 |
4 files changed, 24 insertions, 15 deletions
diff --git a/pjmedia/src/test/mips_test.c b/pjmedia/src/test/mips_test.c index 79144725..0b041f77 100644 --- a/pjmedia/src/test/mips_test.c +++ b/pjmedia/src/test/mips_test.c @@ -881,6 +881,7 @@ static pjmedia_port* g722_encode_decode(pj_pool_t *pool, samples_per_frame, flags, te); } +#if defined(PJMEDIA_HAS_L16_CODEC) && PJMEDIA_HAS_L16_CODEC!=0 static pj_status_t init_l16_default(pjmedia_endpt *endpt) { return pjmedia_codec_l16_init(endpt, 0); @@ -913,6 +914,7 @@ static pjmedia_port* l16_16_encode_decode(pj_pool_t *pool, clock_rate, channel_count, samples_per_frame, flags, te); } +#endif /***************************************************************************/ /* WSOLA PLC mode */ @@ -2279,8 +2281,10 @@ int mips_test(void) { "codec encode/decode - iLBC", OP_PUT, K8, &ilbc_encode_decode}, { "codec encode/decode - Speex 8Khz", OP_PUT, K8, &speex8_encode_decode}, { "codec encode/decode - Speex 16Khz", OP_PUT, K16, &speex16_encode_decode}, +#if defined(PJMEDIA_HAS_L16_CODEC) && PJMEDIA_HAS_L16_CODEC!=0 { "codec encode/decode - L16/8000/1", OP_PUT, K8, &l16_8_encode_decode}, { "codec encode/decode - L16/16000/1", OP_PUT, K16, &l16_16_encode_decode}, +#endif { "stream TX/RX - G.711", OP_PUT_GET, K8, &create_stream_pcmu}, { "stream TX/RX - G.711 SRTP 32bit", OP_PUT_GET, K8, &create_stream_pcmu_srtp32_no_auth}, { "stream TX/RX - G.711 SRTP 32bit +auth", OP_PUT_GET, K8, &create_stream_pcmu_srtp32_with_auth}, diff --git a/pjmedia/src/test/sdp_neg_test.c b/pjmedia/src/test/sdp_neg_test.c index f973f0a2..521fbf2d 100644 --- a/pjmedia/src/test/sdp_neg_test.c +++ b/pjmedia/src/test/sdp_neg_test.c @@ -1328,7 +1328,7 @@ static int offer_answer_test(pj_pool_t *pool, pjmedia_sdp_neg **p_neg, pjmedia_sdp_neg *neg; pj_status_t status; - status = pjmedia_sdp_parse(pool, oa->sdp1, pj_native_strlen(oa->sdp1), + status = pjmedia_sdp_parse(pool, oa->sdp1, pj_ansi_strlen(oa->sdp1), &sdp1); if (status != PJ_SUCCESS) { app_perror(status, " error: unexpected parse status for sdp1"); @@ -1370,7 +1370,7 @@ static int offer_answer_test(pj_pool_t *pool, pjmedia_sdp_neg **p_neg, } /* Parse and validate remote answer */ - status = pjmedia_sdp_parse(pool, oa->sdp2, pj_native_strlen(oa->sdp2), + status = pjmedia_sdp_parse(pool, oa->sdp2, pj_ansi_strlen(oa->sdp2), &sdp2); if (status != PJ_SUCCESS) { app_perror(status, " error: parsing sdp2"); @@ -1405,7 +1405,7 @@ static int offer_answer_test(pj_pool_t *pool, pjmedia_sdp_neg **p_neg, } /* Parse and validate the correct active media. */ - status = pjmedia_sdp_parse(pool, oa->sdp3, pj_native_strlen(oa->sdp3), + status = pjmedia_sdp_parse(pool, oa->sdp3, pj_ansi_strlen(oa->sdp3), &sdp3); if (status != PJ_SUCCESS) { app_perror(status, " error: parsing sdp3"); @@ -1447,7 +1447,7 @@ static int offer_answer_test(pj_pool_t *pool, pjmedia_sdp_neg **p_neg, if (oa->sdp2) { /* Parse and validate initial local capability */ - status = pjmedia_sdp_parse(pool, oa->sdp2, pj_native_strlen(oa->sdp2), + status = pjmedia_sdp_parse(pool, oa->sdp2, pj_ansi_strlen(oa->sdp2), &sdp2); if (status != PJ_SUCCESS) { app_perror(status, " error: parsing sdp2"); @@ -1507,7 +1507,7 @@ static int offer_answer_test(pj_pool_t *pool, pjmedia_sdp_neg **p_neg, } /* Parse the correct answer. */ - status = pjmedia_sdp_parse(pool, oa->sdp3, pj_native_strlen(oa->sdp3), + status = pjmedia_sdp_parse(pool, oa->sdp3, pj_ansi_strlen(oa->sdp3), &sdp3); if (status != PJ_SUCCESS) { app_perror(status, " error: parsing sdp3"); diff --git a/tests/pjsua/inc_sip.py b/tests/pjsua/inc_sip.py index 6d5ef052..0c05756f 100644 --- a/tests/pjsua/inc_sip.py +++ b/tests/pjsua/inc_sip.py @@ -91,11 +91,7 @@ class Dialog: if self.trace_enabled: print str(time.strftime("%H:%M:%S ")) + txt - def create_req(self, method, sdp, branch="", extra_headers=""): - if branch=="": - self.cseq = self.cseq + 1 - msg = req_templ - msg = msg.replace("$METHOD", method) + def update_fields(self, msg): if self.tcp: transport_param = ";transport=tcp" else: @@ -103,14 +99,23 @@ class Dialog: msg = msg.replace("$TARGET_URI", "sip:"+self.dst_addr+":"+str(self.dst_port) + transport_param) msg = msg.replace("$LOCAL_IP", self.local_ip) msg = msg.replace("$LOCAL_PORT", str(self.local_port)) - if branch=="": - branch=str(random.random()) - msg = msg.replace("$BRANCH", branch) msg = msg.replace("$FROM_TAG", self.local_tag) msg = msg.replace("$TO_TAG", self.rem_tag) msg = msg.replace("$CALL_ID", self.call_id) msg = msg.replace("$CSEQ", str(self.cseq)) + branch=str(random.random()) + msg = msg.replace("$BRANCH", branch) + return msg + + def create_req(self, method, sdp, branch="", extra_headers=""): + if branch=="": + self.cseq = self.cseq + 1 + msg = req_templ + msg = msg.replace("$METHOD", method) msg = msg.replace("$SIP_HEADERS", extra_headers) + if branch=="": + branch=str(random.random()) + msg = msg.replace("$BRANCH", branch) if sdp!="": msg = msg.replace("$CONTENT_LENGTH", str(len(sdp))) msg = msg + "Content-Type: application/sdp\r\n" @@ -118,7 +123,7 @@ class Dialog: msg = msg.replace("$CONTENT_LENGTH", "0") msg = msg + "\r\n" msg = msg + sdp - return msg + return self.update_fields(msg) def create_response(self, request, code, reason, to_tag=""): response = "SIP/2.0 " + str(code) + " " + reason + "\r\n" diff --git a/tests/pjsua/mod_sendto.py b/tests/pjsua/mod_sendto.py index 4cc12a41..a2f45212 100644 --- a/tests/pjsua/mod_sendto.py +++ b/tests/pjsua/mod_sendto.py @@ -19,7 +19,7 @@ def test_func(t): cfg = cfg_file.sendto_cfg if len(cfg.complete_msg) != 0: - req = cfg.complete_msg + req = dlg.update_fields(cfg.complete_msg) else: req = dlg.create_invite(cfg.sdp, cfg.extra_headers) resp = dlg.send_request_wait(req, 10) |