Index: channels/chan_sip.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v retrieving revision 1.557 diff -u -r1.557 chan_sip.c --- channels/chan_sip.c 11 Nov 2004 15:08:57 -0000 1.557 +++ channels/chan_sip.c 11 Nov 2004 21:06:02 -0000 @@ -129,11 +129,11 @@ static char notifymime[AST_MAX_EXTENSION] = "application/simple-message-summary"; -static int srvlookup = 0; +static int srvlookup = 1; /* SRV Lookup on or off. Default now on */ -static int pedanticsipchecking = 0; +static int pedanticsipchecking = 0; /* Extra checking ? Default off */ -static int autocreatepeer = 0; +static int autocreatepeer = 0; /* Auto creation of peers at registration? Default off. */ static int relaxdtmf = 0; @@ -141,7 +141,7 @@ static int global_rtpholdtimeout = 0; -static int global_trustrpid = 0; +static int global_trustrpid = 0; /* Trust RPID headers? Default off. */ static int global_progressinband = 0; @@ -149,6 +149,9 @@ static int global_ospauth = 0; #endif +#define DEFAULT_MWITIME 10 +static int global_mwitime = DEFAULT_MWITIME; /* Time between MWI checks for peers */ + static int usecnt =0; AST_MUTEX_DEFINE_STATIC(usecnt_lock); @@ -7808,6 +7811,7 @@ ast_mutex_lock(&monlock); if (res >= 0) ast_sched_runq(sched); + /* needs work to send mwi to realtime peers */ ast_mutex_lock(&peerl.lock); peer = peerl.peers; @@ -7815,7 +7819,7 @@ fastrestart = 0; curpeernum = 0; while(peer) { - if ((curpeernum > lastpeernum) && !ast_strlen_zero(peer->mailbox) && ((t - peer->lastmsgcheck) > 10)) { + if ((curpeernum > lastpeernum) && !ast_strlen_zero(peer->mailbox) && ((t - peer->lastmsgcheck) > global_mwitime)) { sip_send_mwi_to_peer(peer); fastrestart = 1; lastpeernum = curpeernum; @@ -8560,6 +8564,11 @@ else { ast_log(LOG_WARNING, "Unknown dtmf mode '%s', using rfc2833\n", v->value); global_dtmfmode = SIP_DTMF_RFC2833; + } + } else if (!strcasecmp(v->name, "checkmwi")) { + if ((sscanf(v->value, "%d", &global_mwitime) != 1) || (global_mwitime < 0)) { + ast_log(LOG_WARNING, "'%s' is not a valid MWI time setting at line %d. Using default (10).\n", v->value, v->lineno); + global_mwitime = DEFAULT_MWITIME; } } else if (!strcasecmp(v->name, "rtptimeout")) { if ((sscanf(v->value, "%d", &global_rtptimeout) != 1) || (global_rtptimeout < 0)) { Index: configs/sip.conf.sample =================================================================== RCS file: /usr/cvsroot/asterisk/configs/sip.conf.sample,v retrieving revision 1.41 diff -u -r1.41 sip.conf.sample --- configs/sip.conf.sample 8 Nov 2004 00:35:23 -0000 1.41 +++ configs/sip.conf.sample 11 Nov 2004 21:06:02 -0000 @@ -45,6 +45,7 @@ ;maxexpirey=3600 ; Max length of incoming registration we allow ;defaultexpirey=120 ; Default length of incoming/outoing registration ;notifymimetype=text/plain ; Allow overriding of mime type in MWI NOTIFY +;checkmwi=10 ; Default time between mailbox checks for peers ;videosupport=yes ; Turn on support for SIP video ;disallow=all ; First disallow all codecs @@ -66,11 +67,16 @@ ; yes = Always ignore info and assume NAT ; no = Use NAT mode only according to RFC3581 ; never = Never attempt NAT mode or RFC3581 support - ; route = Assume NAT, don't send rport (work around more UNIDEN bugs) -;promiscredir = no ; If yes, allows 302 or REDIR to non-local SIP address -; ; Note that promiscredir when redirects are made to the -; ; local system will cause loops since SIP is incapable -; ; of performing a "hairpin" call. + ; route = Assume NAT, don't send rport + ; (work around more UNIDEN bugs) +;promiscredir = no ; If yes, allows 302 or REDIR to non-local SIP address + ; Note that promiscredir when redirects are made to the + ; local system will cause loops since SIP is incapable + ; of performing a "hairpin" call. +;dtmfmode = rfc2833 ; Set default dtmfmode for sending DTMF. Default: rfc2833 + ; Other options: + ; info : SIP INFO messages + ; inband : Inband audio ; ; If regcontext is specified, Asterisk will dynamically ; create and destroy a NoOp priority 1 extension for a given @@ -79,7 +85,7 @@ ; name if 'regexten' is not provided. More than one regexten may be supplied ; if they are separated by '&'. Patterns may be used in regexten. ; -;regcontext=iaxregistrations +;regcontext=sipregistrations ; ; Asterisk can register as a SIP user agent to a SIP proxy (provider) ; Format for the register statement is: