diff --git a/Makefile b/Makefile index b678b15fb7327ca6857c812627cce5cc4c99fab6..3cc44afffc0339e029548873394a35c0d0490e24 100755 --- 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 - :> $(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 diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 873bc1dcb8839baf2df29deaa2a871bac77e4ade..6df1f53445b2d9c1009f95496c946c99a2171588 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -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_blank_header(&req); 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(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); diff --git a/configs/mgcp.conf.sample b/configs/mgcp.conf.sample index 544940d303d902028e5b019004e48f69b1e43ca7..73b7c6cee2f4e4bcdc9b6428d5a5c31758d2ce5d 100755 --- a/configs/mgcp.conf.sample +++ b/configs/mgcp.conf.sample @@ -8,6 +8,7 @@ ;[dlinkgw] ;host = 192.168.0.64 ;context = default +;canreinvite = no ;line => aaln/2 ;line => aaln/1 diff --git a/manager.c b/manager.c index fe8d2769becf83382a3c9cfd34b2bb91b5963087..ed285ec6986307c8c6620c03ee5f6f3fedcdb44f 100755 --- 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; + int flags; 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)); + /* 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);