diff options
author | sobomax <sobomax@FreeBSD.org> | 2005-05-03 21:58:26 +0800 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2005-05-03 21:58:26 +0800 |
commit | 92830d644a2299543682d0c009f0e6a898f33700 (patch) | |
tree | 02bf63be943e88d759ef5fb9ab9c55598a8f97cf /net/asterisk16 | |
parent | 9b6fb998f96e80cebf98cb05d2d88992beb4f7ef (diff) | |
download | freebsd-ports-gnome-92830d644a2299543682d0c009f0e6a898f33700.tar.gz freebsd-ports-gnome-92830d644a2299543682d0c009f0e6a898f33700.tar.zst freebsd-ports-gnome-92830d644a2299543682d0c009f0e6a898f33700.zip |
o chan_sip.c:
- Improve codec negotiation logic.
- make sure to parse SDP on re-INVITE.
o chan_zap.c:
- If unanswered Zap channnel is hanged up wait until the calling party
in turn hangs up (by detecting ring timeout). Otherwise next ring will
trigger a "new" incoming call. This appears to be design limitation of
the analogue telephone system - there is no way to reject the call without
answering it first.
Sponsored by: Porta Software Ltd, PBXpress Inc
Diffstat (limited to 'net/asterisk16')
-rw-r--r-- | net/asterisk16/Makefile | 2 | ||||
-rw-r--r-- | net/asterisk16/files/patch-channels::chan_sip.c | 38 | ||||
-rw-r--r-- | net/asterisk16/files/patch-channels::chan_zap.c | 91 |
3 files changed, 120 insertions, 11 deletions
diff --git a/net/asterisk16/Makefile b/net/asterisk16/Makefile index 00cb6ce94061..2ef12fe3a651 100644 --- a/net/asterisk16/Makefile +++ b/net/asterisk16/Makefile @@ -7,7 +7,7 @@ PORTNAME= asterisk PORTVERSION= 1.0.7 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= net MASTER_SITES= ftp://ftp.asterisk.org/pub/telephony/asterisk/ \ ftp://ftp.asterisk.org/pub/telephony/asterisk/old-releases/ diff --git a/net/asterisk16/files/patch-channels::chan_sip.c b/net/asterisk16/files/patch-channels::chan_sip.c index 521d6a46d256..e634ce47c97f 100644 --- a/net/asterisk16/files/patch-channels::chan_sip.c +++ b/net/asterisk16/files/patch-channels::chan_sip.c @@ -1,9 +1,9 @@ $FreeBSD$ ---- channels/chan_sip.c.orig -+++ channels/chan_sip.c -@@ -139,7 +139,7 @@ +--- channels/chan_sip.c.orig Sun Feb 17 18:01:43 2002 ++++ channels/chan_sip.c Sun Feb 17 18:10:52 2002 +@@ -141,7 +141,7 @@ static char default_language[MAX_LANGUAGE] = ""; @@ -20,7 +20,16 @@ $FreeBSD$ }; struct sip_history { -@@ -4573,6 +4574,10 @@ +@@ -2218,7 +2219,7 @@ + if (p->owner) { + /* We already hold the channel lock */ + if (f->frametype == AST_FRAME_VOICE) { +- if (f->subclass != p->owner->nativeformats) { ++ if (!(f->subclass & p->owner->nativeformats)) { + ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass); + p->owner->nativeformats = f->subclass; + ast_set_read_format(p->owner, p->owner->readformat); +@@ -4620,6 +4621,10 @@ /* Make a struct route */ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1); if (thishop) { @@ -31,7 +40,7 @@ $FreeBSD$ strncpy(thishop->hop, rr, len); /* safe */ thishop->hop[len] = '\0'; ast_log(LOG_DEBUG, "build_route: Record-Route hop: <%s>\n", thishop->hop); -@@ -4596,31 +4601,41 @@ +@@ -4643,31 +4648,41 @@ rr += len+1; } } @@ -97,7 +106,7 @@ $FreeBSD$ } } /* Store as new route */ -@@ -7197,7 +7212,11 @@ +@@ -7338,7 +7353,11 @@ /* Get destination right away */ gotdest = get_destination(p, NULL); get_rdnis(p, NULL); @@ -110,7 +119,7 @@ $FreeBSD$ build_contact(p); if (gotdest) { -@@ -7225,7 +7244,6 @@ +@@ -7366,7 +7385,6 @@ c = sip_new(p, AST_STATE_DOWN, ast_strlen_zero(p->username) ? NULL : p->username ); *recount = 1; /* Save Record-Route for any later requests we make on this dialogue */ @@ -118,3 +127,18 @@ $FreeBSD$ if (c) { /* Pre-lock the call */ ast_mutex_lock(&c->lock); +@@ -7426,6 +7444,14 @@ + transmit_response(p, "180 Ringing", req); + break; + case AST_STATE_UP: ++ /* Assuming this to be reinvite, process new SDP portion */ ++ if (!ast_strlen_zero(get_header(req, "Content-Type"))) { ++ process_sdp(p, req); ++ } else { ++ p->jointcapability = p->capability; ++ ast_log(LOG_DEBUG, "Hm.... No sdp for the moment\n"); ++ } ++ + transmit_response_with_sdp(p, "200 OK", req, 1); + break; + default: diff --git a/net/asterisk16/files/patch-channels::chan_zap.c b/net/asterisk16/files/patch-channels::chan_zap.c index 965a643bb687..458a6147d215 100644 --- a/net/asterisk16/files/patch-channels::chan_zap.c +++ b/net/asterisk16/files/patch-channels::chan_zap.c @@ -1,9 +1,9 @@ $FreeBSD$ ---- channels/chan_zap.c -+++ channels/chan_zap.c -@@ -42,7 +42,9 @@ +--- channels/chan_zap.c.orig Sun Feb 17 18:01:44 2002 ++++ channels/chan_zap.c Sun Feb 17 18:03:26 2002 +@@ -46,7 +46,9 @@ #include <sys/signal.h> #include <errno.h> #include <stdlib.h> @@ -13,3 +13,88 @@ $FreeBSD$ #include <unistd.h> #include <sys/ioctl.h> #ifdef __linux__ +@@ -320,7 +322,7 @@ + #define CALLWAITING_REPEAT_SAMPLES ( (10000 * 8) / READ_SIZE) /* 300 ms */ + #define CIDCW_EXPIRE_SAMPLES ( (500 * 8) / READ_SIZE) /* 500 ms */ + #define MIN_MS_SINCE_FLASH ( (2000) ) /* 2000 ms */ +-#define RINGT ( (8000 * 8) / READ_SIZE) ++#define RINGT ( (8000 * 8) / READ_SIZE) /* 8000 ms */ + + struct zt_pvt; + +@@ -535,6 +537,7 @@ + int cidpos; + int cidlen; + int ringt; ++ int waitnorings; + int stripmsd; + int callwaiting; + int callwaitcas; +@@ -2134,12 +2137,20 @@ + + if (option_debug) + ast_log(LOG_DEBUG, "zt_hangup(%s)\n", ast->name); ++ + if (!ast->pvt->pvt) { + ast_log(LOG_WARNING, "Asked to hangup channel not connected\n"); + return 0; + } + + ast_mutex_lock(&p->lock); ++ ++ ++ if((p->sig == SIG_FXSGS) || (p->sig == SIG_FXSKS) || (p->sig == SIG_FXSLS)) ++ if((ast->_state == AST_STATE_RING) && (p->ringt > 1)) ++ { ++ p->waitnorings = 1; ++ } + + index = zt_get_index(ast, p, 1); + +@@ -5717,7 +5728,37 @@ + ast_setstate(chan, AST_STATE_RING); + chan->rings = 1; + p->ringt = RINGT; ++ p->waitnorings = 0; + res = ast_pbx_run(chan); ++ ++ if(p->waitnorings) ++ { ++ p->ringt = RINGT; ++ for(;;) ++ { ++ int i,j=0; ++ i = ZT_IOMUX_SIGEVENT | ZT_IOMUX_NOWAIT; ++ if (ioctl(p->subs[index].zfd, ZT_IOMUX, &i) == -1) ++ break; ++ ++ if (ioctl(p->subs[index].zfd, ZT_GETEVENT, &j) == -1) ++ break; ++ ++ if(j == ZT_EVENT_RINGOFFHOOK) ++ p->ringt = RINGT; ++ ++ usleep(20000); ++ ++ if (p->ringt <= 0) ++ break; ++ ++ else if (p->ringt > 0) ++ p->ringt--; ++ } ++ p->ringt = 0; ++ p->waitnorings = 0; ++ } ++ + if (res) { + ast_hangup(chan); + ast_log(LOG_WARNING, "PBX exited non-zero\n"); +@@ -6018,7 +6059,7 @@ + i = iflist; + while(i) { + if ((i->subs[SUB_REAL].zfd > -1) && i->sig && (!i->radio)) { +- if (!i->owner && !i->subs[SUB_REAL].owner) { ++ if (!i->owner && !i->subs[SUB_REAL].owner && !i->waitnorings) { + /* This needs to be watched, as it lacks an owner */ + pfds[count].fd = i->subs[SUB_REAL].zfd; + pfds[count].events = POLLPRI; |