/* Handle an event on a given channel for the monitor thread. */
switch (event) {
case ANALOG_EVENT_WINKFLASH:
+ case ANALOG_EVENT_RINGBEGIN:
+ switch (i->sig) {
+ case ANALOG_SIG_FXSLS:
+ case ANALOG_SIG_FXSGS:
+ case ANALOG_SIG_FXSKS:
+ if (i->immediate) {
+ if (i->use_callerid || i->usedistinctiveringdetection) {
+ ast_log(LOG_WARNING, "Can't start PBX immediately, must wait for Caller ID / distinctive ring\n");
+ } else {
+ /* If we don't care about Caller ID or Distinctive Ring, then there's
+ * no need to wait for anything before accepting the call, as
+ * waiting will buy us nothing.
+ * So if the channel is configured for immediate, actually start immediately
+ * and get the show on the road as soon as possible. */
+ ast_debug(1, "Disabling ring timeout (previously %d) to begin handling immediately\n", i->ringt_base);
+ analog_set_ringtimeout(i, 0);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ /* Fall through */
+ if (!(ISTRUNK(i) && i->immediate && !i->use_callerid && !i->usedistinctiveringdetection)) {
+ break;
+ }
case ANALOG_EVENT_RINGOFFHOOK:
if (i->inalarm) {
break;
; target of the transfer.
;
-; Specify whether the channel should be answered immediately or if the simple
-; switch should provide dialtone, read digits, etc.
+; On FXS channels (FXO signaled), specifies whether the channel should enter the dialplan
+; immediately or if the simple switch should provide dialtone, read digits, etc.
+; On FXO channels (FXS signaled), specifies whether the call should enter the dialplan
+; immediately or if we should wait for at least one ring. This is required if
+; Caller ID or distinctive ringing is enabled. If you do not need either, you can
+; skip waiting for the first ring to begin call processing sooner.
+;
; Note: If immediate=yes the dialplan execution will always start at extension
; 's' priority 1 regardless of the dialed number!
;
--- /dev/null
+Subject: chan_dahdi
+
+FXO channels (FXS signaled) that don't use callerid or
+distinctive ring detection can now be configured
+to enter the dialplan immediately using immediate=yes,
+instead of waiting for at least one ring.