Insert blank after REFER (bug #997)
authorMark Spencer <markster@digium.com>
Sat, 7 Feb 2004 07:13:33 +0000 (07:13 +0000)
committerMark Spencer <markster@digium.com>
Sat, 7 Feb 2004 07:13:33 +0000 (07:13 +0000)
Correct path to VM sample (bug #994)
Make manager interface non-blocking (bug #861)
Don't bork on empty from in SIP (bug #887)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2138 65c4cc65-6c06-0410-ace0-fbb531ad65f3

Makefile
channels/chan_sip.c
configs/mgcp.conf.sample
manager.c

index b678b15..3cc44af 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -397,7 +397,7 @@ samples: all datafiles adsi
        for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isunavail; do \
                cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm ; \
        done
        for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isunavail; do \
                cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm ; \
        done
-       :> $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail/default/1234/busy.gsm
+       :> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/busy.gsm
        for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isonphone; do \
                cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/busy.gsm ; \
        done
        for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isonphone; do \
                cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/busy.gsm ; \
        done
index 873bc1d..6df1f53 100755 (executable)
@@ -3305,6 +3305,7 @@ static int transmit_refer(struct sip_pvt *p, char *dest)
        add_header(&req, "Refer-To", referto);
        if (strlen(p->our_contact))
                add_header(&req, "Referred-By", p->our_contact);
        add_header(&req, "Refer-To", referto);
        if (strlen(p->our_contact))
                add_header(&req, "Referred-By", p->our_contact);
+       add_blank_header(&req);
        return send_request(p, &req, 1, p->ocseq);
 }
 
        return send_request(p, &req, 1, p->ocseq);
 }
 
@@ -3888,8 +3889,10 @@ static int get_destination(struct sip_pvt *p, struct sip_request *oreq)
        if ((a = strchr(c, ';'))) {
                *a = '\0';
        }
        if ((a = strchr(c, ';'))) {
                *a = '\0';
        }
-       if ((a = strchr(fr, '@')) || (a = strchr(fr, ';'))) {
-               *a = '\0';
+       if (fr) {
+               if ((a = strchr(fr, '@')) || (a = strchr(fr, ';'))) {
+                       *a = '\0';
+               }
        }
        if (sipdebug)
                ast_verbose("Looking for %s in %s\n", c, p->context);
        }
        if (sipdebug)
                ast_verbose("Looking for %s in %s\n", c, p->context);
index 544940d..73b7c6c 100755 (executable)
@@ -8,6 +8,7 @@
 ;[dlinkgw]
 ;host = 192.168.0.64
 ;context = default
 ;[dlinkgw]
 ;host = 192.168.0.64
 ;context = default
+;canreinvite = no
 ;line => aaln/2
 ;line => aaln/1
 
 ;line => aaln/2
 ;line => aaln/1
 
index fe8d276..ed285ec 100755 (executable)
--- a/manager.c
+++ b/manager.c
@@ -727,6 +727,7 @@ static void *accept_thread(void *ignore)
        struct mansession *s;
        struct protoent *p;
        int arg = 1;
        struct mansession *s;
        struct protoent *p;
        int arg = 1;
+       int flags;
        pthread_attr_t attr;
 
        pthread_attr_init(&attr);
        pthread_attr_t attr;
 
        pthread_attr_init(&attr);
@@ -752,6 +753,9 @@ static void *accept_thread(void *ignore)
                } 
                memset(s, 0, sizeof(struct mansession));
                memcpy(&s->sin, &sin, sizeof(sin));
                } 
                memset(s, 0, sizeof(struct mansession));
                memcpy(&s->sin, &sin, sizeof(sin));
+               /* For safety, make sure socket is non-blocking */
+               flags = fcntl(as, F_GETFL);
+               fcntl(as, F_SETFL, flags | O_NONBLOCK);
                ast_mutex_init(&s->lock);
                s->fd = as;
                ast_mutex_lock(&sessionlock);
                ast_mutex_init(&s->lock);
                s->fd = as;
                ast_mutex_lock(&sessionlock);