Hi All,
This is the first time I'm submitting a patch, and I hope it fixes more than
it breaks. I'm putting it  here, since John Todd mentioned a while ago about
the heavy load Mark and crew have at Digium (doing such good work), so I
thought all of us could test this first, and if ok submit for inclusion in
CVS later if appropriate.
This is an extension to work done earlier (sorry I can't remember your name)
with regard to "incominglimit" and "outgoinglimit" to
prevent that horrible
call waiting in your ear for Grand Stream phones. It worked only if you
received a call and only once.
I've tested this on my system between GS and X-ten, using normal extension
and queue calling, and it seems to work ok for me. No call waiting at all,
whether I originate or receive calls. You only need to set
"incominglimit=1"
for each sip phone that you wish to block call waiting.
Anway, enough blurb, please test and let me know how you go .....
Paul
--- chan_sip.c.save     2003-10-20 21:51:52.000000000 +1000
+++ chan_sip.c  2003-10-21 09:02:33.000000000 +1000
@@ -959,7 +959,9 @@
                return 0;
        }
        switch(event) {
+               /* Incoming and outging affects the inUse counter */
                case DEC_IN_USE:
+               case DEC_OUT_USE:
                        if ( u->inUse > 0 ) {
                                u->inUse--;
                        } else {
@@ -967,6 +969,7 @@
                        }
                        break;
                case INC_IN_USE:
+               case INC_OUT_USE:
                        if (u->incominglimit > 0 ) {
                                if (u->inUse >= u->incominglimit) {
                                        ast_log(LOG_ERROR, "Call from user
'%s'
rejected due to usage limit of %d\n", u->name, u->incominglimit);
@@ -977,6 +980,7 @@
                        u->inUse++;
                        ast_log(LOG_DEBUG, "Call from user '%s' is
%d out of
%d\
n", u->name, u->inUse, u->incominglimit);
                        break;
+               /* Commented out - don't want to limit outgoing */
                case DEC_OUT_USE:
                        if ( u->outUse > 0 ) {
                                u->outUse--;
@@ -994,6 +998,7 @@
                        }
                        u->outUse++;
                        break;
+                       */
                default:
                        ast_log(LOG_ERROR, "find_user(%s,%d) called with no
even
t!\n",u->name,event);
        }
@@ -1086,6 +1091,12 @@
                                   INVITE, but do set an autodestruct just
in ca
se. */
                                needdestroy = 0;
                                sip_scheddestroy(p, 15000);
+                               /* channel still up - reverse dec of inuse
count
er */
+                               if ( p->outgoing ) {
+                                       find_user(p, INC_OUT_USE);
+                               } else {
+                                       find_user(p, INC_IN_USE);
+                               }
                        } else {
                                char *res;
                                if (ast->hangupcause && ((res
hangup_cause2sip
(ast->hangupcause)))) {
@@ -4708,6 +4719,14 @@
                                        if (p->owner)
                                                ast_queue_control(p->owner,
AST_
CONTROL_BUSY, 0);
                                        break;
+                               case 487:
+                                       /* channel now destroyed - dec the
inuse
 counter */
+                                       if ( p->outgoing ) {
+                                               find_user(p, DEC_OUT_USE);
+                                       } else {
+                                               find_user(p, DEC_IN_USE);
+                                       }
+                                       break;
                                case 486: /* Busy here */
                                case 600: /* Busy everywhere */
                                        if (p->owner)
Sorry, to repost - but I left a "/*" comment - here it is again
Paul
--- chan_sip.c.save     2003-10-20 21:51:52.000000000 +1000
+++ chan_sip.c  2003-10-21 09:26:41.000000000 +1000
@@ -959,7 +959,9 @@
                return 0;
        }
        switch(event) {
+               /* Incoming and outging affects the inUse counter */
                case DEC_IN_USE:
+               case DEC_OUT_USE:
                        if ( u->inUse > 0 ) {
                                u->inUse--;
                        } else {
@@ -967,6 +969,7 @@
                        }
                        break;
                case INC_IN_USE:
+               case INC_OUT_USE:
                        if (u->incominglimit > 0 ) {
                                if (u->inUse >= u->incominglimit) {
                                        ast_log(LOG_ERROR, "Call from user
'%s'
rejected due to usage limit of %d\n", u->name, u->incominglimit);
@@ -977,6 +980,8 @@
                        u->inUse++;
                        ast_log(LOG_DEBUG, "Call from user '%s' is
%d out of %d\
n", u->name, u->inUse, u->incominglimit);
                        break;
+               /* Commented out - don't want to limit outgoing */
+               /*
                case DEC_OUT_USE:
                        if ( u->outUse > 0 ) {
                                u->outUse--;
@@ -994,6 +999,7 @@
                        }
                        u->outUse++;
                        break;
+                       */
                default:
                        ast_log(LOG_ERROR, "find_user(%s,%d) called with no
even
t!\n",u->name,event);
        }
@@ -1086,6 +1092,12 @@
                                   INVITE, but do set an autodestruct just in ca
se. */
                                needdestroy = 0;
                                sip_scheddestroy(p, 15000);
+                               /* channel still up - reverse dec of inuse count
er */
+                               if ( p->outgoing ) {
+                                       find_user(p, INC_OUT_USE);
+                               } else {
+                                       find_user(p, INC_IN_USE);
+                               }
                        } else {
                                char *res;
                                if (ast->hangupcause && ((res =
hangup_cause2sip
(ast->hangupcause)))) {
@@ -4708,6 +4720,14 @@
                                        if (p->owner)
                                                ast_queue_control(p->owner,
AST_
CONTROL_BUSY, 0);
                                        break;
+                               case 487:
+                                       /* channel now destroyed - dec the inuse
 counter */
+                                       if ( p->outgoing ) {
+                                               find_user(p, DEC_OUT_USE);
+                                       } else {
+                                               find_user(p, DEC_IN_USE);
+                                       }
+                                       break;
                                case 486: /* Busy here */
                                case 600: /* Busy everywhere */
                                        if (p->owner)
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20031020/86db140e/attachment.htm
On Monday 20 October 2003 18:21, Paul Liew wrote:> Hi All, > > This is the first time I'm submitting a patch, and I hope it fixes > more than it breaks. I'm putting it here, since John Todd mentioned > a while ago about the heavy load Mark and crew have at Digium (doing > such good work), so I thought all of us could test this first, and if > ok submit for inclusion in CVS later if appropriate.<snip> You may want to do what everybody else does and open a bug report with this patch uploaded as a separate file to bugs.digium.com. Prefix the title of the patch with "[patch]" to denote it as more than just a problem report. -Tilghman
Voicemail2 already does the date and time. On Mon, 2003-10-20 at 22:03, Kevin wrote:> Has there been any discussion as to having asterisk voice mail play an > optional message envelope with caller ID, date and time of message? > > > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users-- Sample configs, scripts, more : http://www.fnords.org/~eric/asterisk/ BTEL Consulting 504-899-1387 or 850-484-4545 or 877-677-9643