Merge "chan_sip: Check sip_pvt pointer in ast_channel_get_t38_state(c)"
authorMatt Jordan <mjordan@digium.com>
Wed, 9 Dec 2015 18:40:58 +0000 (12:40 -0600)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Wed, 9 Dec 2015 18:40:58 +0000 (12:40 -0600)
channels/chan_sip.c
codecs/codec_resample.c
main/translate.c
res/res_pjsip/config_transport.c

index cd03e15..cc73a15 100644 (file)
@@ -10634,7 +10634,11 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
        /* Setup audio address and port */
        if (p->rtp) {
                if (sa && portno > 0) {
-                       start_ice(p->rtp, (req->method != SIP_RESPONSE) ? 0 : 1);
+                       /* Start ICE negotiation here, only when it is response, and setting that we are conrolling agent,
+                          as we are offerer */
+                       if (req->method == SIP_RESPONSE) {
+                               start_ice(p->rtp, 1);
+                       }
                        ast_sockaddr_set_port(sa, portno);
                        ast_rtp_instance_set_remote_address(p->rtp, sa);
                        if (debug) {
@@ -13408,6 +13412,11 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int
                if (!doing_directmedia) {
                        if (ast_test_flag(&p->flags[2], SIP_PAGE3_ICE_SUPPORT)) {
                                add_ice_to_sdp(p->rtp, &a_audio);
+                               /* Start ICE negotiation, and setting that we are controlled agent,
+                                  as this is response to offer */
+                               if (resp->method == SIP_RESPONSE) {
+                                       start_ice(p->rtp, 0);
+                               }
                        }
 
                        add_dtls_to_sdp(p->rtp, &a_audio);
index 3c8a149..1c73bf3 100644 (file)
@@ -38,7 +38,7 @@ ASTERISK_REGISTER_FILE()
 #include "asterisk/translate.h"
 #include "asterisk/slin.h"
 
-#define OUTBUF_SAMPLES   5760
+#define OUTBUF_SAMPLES   11520
 
 static struct ast_translator *translators;
 static int trans_size;
index 61a827b..8d37e37 100644 (file)
@@ -397,9 +397,6 @@ static struct ast_trans_pvt *newpvt(struct ast_translator *t, struct ast_format
 /*! \brief framein wrapper, deals with bound checks.  */
 static int framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
 {
-       int ret;
-       int samples = pvt->samples;     /* initial value */
-
        /* Copy the last in jb timing info to the pvt */
        ast_copy_flags(&pvt->f, f, AST_FRFLAG_HAS_TIMING_INFO);
        pvt->f.ts = f->ts;
@@ -423,12 +420,7 @@ static int framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
        /* we require a framein routine, wouldn't know how to do
         * it otherwise.
         */
-       ret = pvt->t->framein(pvt, f);
-       /* diagnostic ... */
-       if (pvt->samples == samples)
-               ast_log(LOG_WARNING, "%s did not update samples %d\n",
-                       pvt->t->name, pvt->samples);
-       return ret;
+       return pvt->t->framein(pvt, f);
 }
 
 /*! \brief generic frameout routine.
index e998661..e2f0c7f 100644 (file)
@@ -216,6 +216,14 @@ static int transport_apply(const struct ast_sorcery *sorcery, void *obj)
 
                res = pjsip_tcp_transport_start3(ast_sip_get_pjsip_endpoint(), &cfg, &transport->state->factory);
        } else if (transport->type == AST_TRANSPORT_TLS) {
+               /* The following check is a work-around for ASTERISK-25615.
+                * When that issue is resolved in upstream pjproject, this check can be removed.
+                */
+               if (transport->async_operations > 1) {
+                       ast_log(LOG_ERROR, "Transport: %s: When protocol=tls, async_operations can't be > 1 (ASTERISK-25615)\n",
+                                       ast_sorcery_object_get_id(obj));
+                       return -1;
+               }
                transport->tls.ca_list_file = pj_str((char*)transport->ca_list_file);
 #ifdef HAVE_PJ_SSL_CERT_LOAD_FROM_FILES2
                transport->tls.ca_list_path = pj_str((char*)transport->ca_list_path);