]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Check that there really is a tag
authorMark Spencer <markster@digium.com>
Fri, 24 Oct 2003 18:22:45 +0000 (18:22 +0000)
committerMark Spencer <markster@digium.com>
Fri, 24 Oct 2003 18:22:45 +0000 (18:22 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1663 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c
channels/chan_zap.c
configs/zapata.conf.sample

index e6cd20e6a214a8754ec1cce1f9abab7c8d8c9bf0..34847fc89db5c5d7e987160d43f46ea30adb6453 100755 (executable)
@@ -1629,7 +1629,7 @@ static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr_in *si
        p = iflist;
        while(p) {
                if (!strcmp(p->callid, callid) && 
-                       (!pedanticsipchecking || !strlen(p->theirtag) || !strcmp(p->theirtag, tag))) {
+                       (!pedanticsipchecking || !tag || !strlen(p->theirtag) || !strcmp(p->theirtag, tag))) {
                        /* Found the call */
                        ast_mutex_lock(&p->lock);
                        ast_mutex_unlock(&iflock);
index 1fb8509633d680d4af0982c42b189c841505f071..2391734eb4c7c135be9f420274de0808bb44388c 100755 (executable)
@@ -188,6 +188,8 @@ static int amaflags = 0;
 
 static int adsi = 0;
 
+static int numbufs = 4;
+
 #ifdef ZAPATA_PRI
 static int minunused = 2;
 static int minidle = 0;
@@ -659,7 +661,7 @@ static int alloc_sub(struct zt_pvt *p, int x)
                        if (!res) {
                                bi.txbufpolicy = ZT_POLICY_IMMEDIATE;
                                bi.rxbufpolicy = ZT_POLICY_IMMEDIATE;
-                               bi.numbufs = 4;
+                               bi.numbufs = numbufs;
                                res = ioctl(p->subs[x].zfd, ZT_SET_BUFINFO, &bi);
                                if (res < 0) {
                                        ast_log(LOG_WARNING, "Unable to set buffer policy on channel %d\n", x);
@@ -5116,7 +5118,7 @@ static struct zt_pvt *mkintf(int channel, int signalling, int radio)
                        if (!res) {
                                bi.txbufpolicy = ZT_POLICY_IMMEDIATE;
                                bi.rxbufpolicy = ZT_POLICY_IMMEDIATE;
-                               bi.numbufs = 4;
+                               bi.numbufs = numbufs;
                                res = ioctl(tmp->subs[SUB_REAL].zfd, ZT_SET_BUFINFO, &bi);
                                if (res < 0) {
                                        ast_log(LOG_WARNING, "Unable to set buffer policy on channel %d\n", channel);
@@ -5301,7 +5303,7 @@ static struct zt_pvt *chandup(struct zt_pvt *src)
                if (!res) {
                        bi.txbufpolicy = ZT_POLICY_IMMEDIATE;
                        bi.rxbufpolicy = ZT_POLICY_IMMEDIATE;
-                       bi.numbufs = 4;
+                       bi.numbufs = numbufs;
                        res = ioctl(p->subs[SUB_REAL].zfd, ZT_SET_BUFINFO, &bi);
                        if (res < 0) {
                                ast_log(LOG_WARNING, "Unable to set buffer policy on dup channel\n");
@@ -6267,7 +6269,7 @@ static int start_pri(struct zt_pri *pri)
        }
        bi.txbufpolicy = ZT_POLICY_IMMEDIATE;
        bi.rxbufpolicy = ZT_POLICY_IMMEDIATE;
-       bi.numbufs = 8;
+       bi.numbufs = 16;
        bi.bufsize = 1024;
        if (ioctl(pri->fd, ZT_SET_BUFINFO, &bi)) {
                ast_log(LOG_ERROR, "Unable to set appropriate buffering on channel %d\n", x);
@@ -6781,6 +6783,8 @@ int load_module()
                        strncpy(musicclass, v->value, sizeof(musicclass)-1);
                } else if (!strcasecmp(v->name, "stripmsd")) {
                        stripmsd = atoi(v->value);
+               } else if (!strcasecmp(v->name, "jitterbuffers")) {
+                       numbufs = atoi(v->value);
                } else if (!strcasecmp(v->name, "group")) {
                        cur_group = ast_get_group(v->value);
                } else if (!strcasecmp(v->name, "callgroup")) {
@@ -7319,6 +7323,8 @@ static int reload_zt(void)
                                ast_mutex_unlock(&iflock);
                                return -1;
                        }
+               } else if (!strcasecmp(v->name, "jitterbuffers")) {
+                       numbufs = atoi(v->value);
                } else if (!strcasecmp(v->name, "minunused")) {
                        minunused = atoi(v->value);
                } else if (!strcasecmp(v->name, "idleext")) {
index 70d41d37c34440e3f188e68f3eef8acfabf5f417..8d22e3cbc01920d40d9fd7a7bd7559d8280cf6a4 100755 (executable)
@@ -234,6 +234,10 @@ immediate=no
 ;minunused=2
 ;minidle=1
 ;
+; Configure jitter buffers in zapata (each one is 20ms, default is 4)
+;
+;jitterbuffers=4
+;
 ; Each channel consists of the channel number or range.  It
 ; inherits the parameters that were specified above its declaration
 ;