Problem with Misc Application

Pretty new to this, and stuck on a seemingly simple problem. I want an internal call to route to one of two ring groups, dependent on the time of day. So I’ve set up a misc application directed to a time condition which is driven off my Day/Night time group (which is also used elsewhere) to route the call to the appropriate ring group.

When I dial the misc application (code 621), some sort of infinite loop is created, with thousands of active calls and channels shown on the status page of the GUI.

The first part of the log shows repetitive groups of entries of the following form:

[2013-06-17 20:28:19] VERBOSE[4724][C-00000026] app_dial.c: – Called Local/621@from-internal/n
[2013-06-17 20:28:19] VERBOSE[4724][C-00000026] pbx.c: == Spawn extension (from-internal, 621, 1) exited non-zero on ‘Local/621@from-internal-000005f7;2’
[2013-06-17 20:28:19] VERBOSE[4724][C-00000026] pbx.c: – Executing [h@from-internal:1] Hangup(“Local/621@from-internal-000005f7;2”, “”) in new stack
[2013-06-17 20:28:19] VERBOSE[4724][C-00000026] pbx.c: == Spawn extension (from-internal, h, 1) exited non-zero on ‘Local/621@from-internal-000005f7;2’
[2013-06-17 20:28:19] VERBOSE[4725][C-00000026] pbx.c: – Executing [621@from-internal:1] Dial(“Local/621@from-internal-000005f8;2”, “Local/621@from-internal/n”) in new stack
[2013-06-17 20:28:19] VERBOSE[4725][C-00000026] app_dial.c: – Called Local/621@from-internal/n
[2013-06-17 20:28:19] VERBOSE[4726][C-00000026] pbx.c: – Executing [621@from-internal:1] Dial(“Local/621@from-internal-000005f9;2”, “Local/621@from-internal/n”) in new stack
[2013-06-17 20:28:19] VERBOSE[4725][C-00000026] pbx.c: == Spawn extension (from-internal, 621, 1) exited non-zero on ‘Local/621@from-internal-000005f8;2’
[2013-06-17 20:28:19] VERBOSE[4725][C-00000026] pbx.c: – Executing [h@from-internal:1] Hangup(“Local/621@from-internal-000005f8;2”, “”) in new stack
[2013-06-17 20:28:19] VERBOSE[4725][C-00000026] pbx.c: == Spawn extension (from-internal, h, 1) exited non-zero on ‘Local/621@from-internal-000005f8;2’
[2013-06-17 20:28:19] VERBOSE[4726][C-00000026] app_dial.c: – Called Local/621@from-internal/n
[2013-06-17 20:28:19] VERBOSE[4727][C-00000026] pbx.c: – Executing [621@from-internal:1] Dial(“Local/621@from-internal-000005fa;2”, “Local/621@from-internal/n”) in new stack
[2013-06-17 20:28:19] VERBOSE[4726][C-00000026] pbx.c: == Spawn extension (from-internal, 621, 1) exited non-zero on ‘Local/621@from-internal-000005f9;2’
[2013-06-17 20:28:19] VERBOSE[4726][C-00000026] pbx.c: – Executing [h@from-internal:1] Hangup(“Local/621@from-internal-000005f9;2”, “”) in new stack
[2013-06-17 20:28:19] VERBOSE[4726][C-00000026] pbx.c: == Spawn extension (from-internal, h, 1) exited non-zero on ‘Local/621@from-internal-000005f9;2’

After a while this stops, presumably due to running out of memory or other resources, and things start to unwind:

[2013-06-17 20:28:56] VERBOSE[7167][C-00000026] app_dial.c: – Called Local/621@from-internal/n
[2013-06-17 20:28:56] VERBOSE[7167][C-00000026] pbx.c: == Spawn extension (from-internal, 621, 1) exited non-zero on ‘Local/621@from-internal-00000f74;2’
[2013-06-17 20:28:56] VERBOSE[7167][C-00000026] pbx.c: – Executing [h@from-internal:1] Hangup(“Local/621@from-internal-00000f74;2”, “”) in new stack
[2013-06-17 20:28:56] VERBOSE[7167][C-00000026] pbx.c: == Spawn extension (from-internal, h, 1) exited non-zero on ‘Local/621@from-internal-00000f74;2’
[2013-06-17 20:28:56] VERBOSE[7168][C-00000026] pbx.c: – Executing [621@from-internal:1] Dial(“Local/621@from-internal-00000f75;2”, “Local/621@from-internal/n”) in new stack
[2013-06-17 20:28:56] WARNING[7168][C-00000026] pbx.c: Failed to create new channel thread
[2013-06-17 20:28:56] VERBOSE[7168][C-00000026] app_dial.c: – Couldn’t call Local/621@from-internal/n
[2013-06-17 20:28:56] VERBOSE[7168][C-00000026] app_dial.c: == Everyone is busy/congested at this time (0:0/0/0)
[2013-06-17 20:28:56] VERBOSE[7168][C-00000026] pbx.c: – Executing [h@from-internal:1] Hangup(“Local/621@from-internal-00000f75;2”, “”) in new stack
[2013-06-17 20:28:56] VERBOSE[7168][C-00000026] pbx.c: == Spawn extension (from-internal, h, 1) exited non-zero on ‘Local/621@from-internal-00000f75;2’
[2013-06-17 20:29:00] VERBOSE[7169] pbx_spool.c: – Attempting call on Local/s@tc-maint for application NoCDR() (Retry 1)
[2013-06-17 20:29:00] VERBOSE[7170][C-00000028] pbx.c: – Executing [s@tc-maint:1] NoCDR(“Local/s@tc-maint-00000f77;2”, “”) in new stack
[2013-06-17 20:29:00] VERBOSE[7170][C-00000028] pbx.c: – Executing [s@tc-maint:2] Set(“Local/s@tc-maint-00000f77;2”, “TCMAINT=RETURN”) in new stack
[2013-06-17 20:29:00] VERBOSE[7170][C-00000028] pbx.c: – Executing [s@tc-maint:3] Gosub(“Local/s@tc-maint-00000f77;2”, “timeconditions,1,1()”) in new stack
[2013-06-17 20:29:00] VERBOSE[7170][C-00000028] pbx.c: – Executing [1@timeconditions:1] GotoIfTime(“Local/s@tc-maint-00000f77;2”, “08:30-13:00,mon-fri,,?truestate”) in new stack
[2013-06-17 20:29:00] VERBOSE[7170][C-00000028] pbx.c: – Executing [1@timeconditions:2] GotoIfTime(“Local/s@tc-maint-00000f77;2”, “14:00-17:00,mon-fri,,?truestate”) in new stack
[2013-06-17 20:29:00] VERBOSE[7170][C-00000028] pbx.c: – Executing [1@timeconditions:3] GotoIf(“Local/s@tc-maint-00000f77;2”, “0?truegoto”) in new stack
[2013-06-17 20:29:00] VERBOSE[7170][C-00000028] pbx.c: – Executing [1@timeconditions:4] ExecIf(“Local/s@tc-maint-00000f77;2”, “0?Set(DB(TC/1)=)”) in new stack
[2013-06-17 20:29:00] VERBOSE[7170][C-00000028] pbx.c: – Executing [1@timeconditions:5] Set(“Local/s@tc-maint-00000f77;2”, “DEVICE_STATE(Custom:TC1)=INUSE”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [1@timeconditions:6] ExecIf(“Local/s@tc-maint-00000f77;2”, “0?Set(DEVICE_STATE(Custom:TCSTICKY)=INUSE)”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [1@timeconditions:7] GotoIf(“Local/s@tc-maint-00000f77;2”, “0?app-blackhole,hangup,1”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [1@timeconditions:8] Set(“Local/s@tc-maint-00000f77;2”, “TCSTATE=false”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [1@timeconditions:9] Return(“Local/s@tc-maint-00000f77;2”, “”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [s@tc-maint:4] Gosub(“Local/s@tc-maint-00000f77;2”, “timeconditions,3,1()”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [3@timeconditions:1] GotoIfTime(“Local/s@tc-maint-00000f77;2”, “08:30-13:00,mon-fri,,?truestate”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [3@timeconditions:2] GotoIfTime(“Local/s@tc-maint-00000f77;2”, “14:00-17:00,mon-fri,,?truestate”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [3@timeconditions:3] GotoIf(“Local/s@tc-maint-00000f77;2”, “0?truegoto”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [3@timeconditions:4] ExecIf(“Local/s@tc-maint-00000f77;2”, “0?Set(DB(TC/3)=)”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [3@timeconditions:5] Set(“Local/s@tc-maint-00000f77;2”, “DEVICE_STATE(Custom:TC3)=INUSE”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [3@timeconditions:6] ExecIf(“Local/s@tc-maint-00000f77;2”, “0?Set(DEVICE_STATE(Custom:TCSTICKY)=INUSE)”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [3@timeconditions:7] GotoIf(“Local/s@tc-maint-00000f77;2”, “0?ext-group,607,1”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [3@timeconditions:8] Set(“Local/s@tc-maint-00000f77;2”, “TCSTATE=false”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [3@timeconditions:9] Return(“Local/s@tc-maint-00000f77;2”, “”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [s@tc-maint:5] System(“Local/s@tc-maint-00000f77;2”, “/var/lib/asterisk/bin/schedtc.php 60 /var/spool/asterisk/outgoing 1”) in new stack
[2013-06-17 20:29:20] VERBOSE[7170][C-00000028] pbx.c: – Executing [s@tc-maint:6] Answer(“Local/s@tc-maint-00000f77;2”, “”) in new stack
[2013-06-17 20:29:20] NOTICE[7169] pbx_spool.c: Call completed to Local/s@tc-maint
[2013-06-17 20:29:20] VERBOSE[7170][C-00000028] pbx.c: == Spawn extension (tc-maint, s, 6) exited non-zero on ‘Local/s@tc-maint-00000f77;2’
[2013-06-17 20:30:00] VERBOSE[7174] pbx_spool.c: – Attempting call on Local/s@tc-maint for application NoCDR() (Retry 1)
[2013-06-17 20:30:00] VERBOSE[7175][C-00000029] pbx.c: – Executing [s@tc-maint:1] NoCDR(“Local/s@tc-maint-00000f78;2”, “”) in new stack
[2013-06-17 20:30:00] VERBOSE[7175][C-00000029] pbx.c: – Executing [s@tc-maint:2] Set(“Local/s@tc-maint-00000f78;2”, “TCMAINT=RETURN”) in new stack
[2013-06-17 20:30:00] VERBOSE[7175][C-00000029] pbx.c: – Executing [s@tc-maint:3] Gosub(“Local/s@tc-maint-00000f78;2”, “timeconditions,1,1()”) in new stack
[2013-06-17 20:30:00] VERBOSE[7175][C-00000029] pbx.c: – Executing [1@timeconditions:1] GotoIfTime(“Local/s@tc-maint-00000f78;2”, “08:30-13:00,mon-fri,,?truestate”) in new stack
[2013-06-17 20:30:00] VERBOSE[7175][C-00000029] pbx.c: – Executing [1@timeconditions:2] GotoIfTime(“Local/s@tc-maint-00000f78;2”, “14:00-17:00,mon-fri,,?truestate”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [1@timeconditions:3] GotoIf(“Local/s@tc-maint-00000f78;2”, “0?truegoto”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [1@timeconditions:4] ExecIf(“Local/s@tc-maint-00000f78;2”, “0?Set(DB(TC/1)=)”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [1@timeconditions:5] Set(“Local/s@tc-maint-00000f78;2”, “DEVICE_STATE(Custom:TC1)=INUSE”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [1@timeconditions:6] ExecIf(“Local/s@tc-maint-00000f78;2”, “0?Set(DEVICE_STATE(Custom:TCSTICKY)=INUSE)”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [1@timeconditions:7] GotoIf(“Local/s@tc-maint-00000f78;2”, “0?app-blackhole,hangup,1”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [1@timeconditions:8] Set(“Local/s@tc-maint-00000f78;2”, “TCSTATE=false”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [1@timeconditions:9] Return(“Local/s@tc-maint-00000f78;2”, “”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [s@tc-maint:4] Gosub(“Local/s@tc-maint-00000f78;2”, “timeconditions,3,1()”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [3@timeconditions:1] GotoIfTime(“Local/s@tc-maint-00000f78;2”, “08:30-13:00,mon-fri,,?truestate”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [3@timeconditions:2] GotoIfTime(“Local/s@tc-maint-00000f78;2”, “14:00-17:00,mon-fri,,?truestate”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [3@timeconditions:3] GotoIf(“Local/s@tc-maint-00000f78;2”, “0?truegoto”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [3@timeconditions:4] ExecIf(“Local/s@tc-maint-00000f78;2”, “0?Set(DB(TC/3)=)”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [3@timeconditions:5] Set(“Local/s@tc-maint-00000f78;2”, “DEVICE_STATE(Custom:TC3)=INUSE”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [3@timeconditions:6] ExecIf(“Local/s@tc-maint-00000f78;2”, “0?Set(DEVICE_STATE(Custom:TCSTICKY)=INUSE)”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [3@timeconditions:7] GotoIf(“Local/s@tc-maint-00000f78;2”, “0?ext-group,607,1”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [3@timeconditions:8] Set(“Local/s@tc-maint-00000f78;2”, “TCSTATE=false”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [3@timeconditions:9] Return(“Local/s@tc-maint-00000f78;2”, “”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [s@tc-maint:5] System(“Local/s@tc-maint-00000f78;2”, “/var/lib/asterisk/bin/schedtc.php 60 /var/spool/asterisk/outgoing 0”) in new stack
[2013-06-17 20:30:14] VERBOSE[7175][C-00000029] pbx.c: – Executing [s@tc-maint:6] Answer(“Local/s@tc-maint-00000f78;2”, “”) in new stack
[2013-06-17 20:30:14] NOTICE[7174] pbx_spool.c: Call completed to Local/s@tc-maint

Ultimately things usually return to ‘normal’, without ever ringing an extension, although sometimes Asterisk restarts.

Running FreePbx 2.11.02 with Asterisk 11.3.0 on a Raspberry Pi.

In general settings have been left at defaults unless they specifically needed to be changed. The ring groups work correctly if dialled directly.

Any suggestions as to what I might have set up wrong?

Thanks
Steve