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/[email protected]/n
[2013-06-17 20:28:19] VERBOSE[4724][C-00000026] pbx.c: == Spawn extension (from-internal, 621, 1) exited non-zero on ‘Local/[email protected];2’
[2013-06-17 20:28:19] VERBOSE[4724][C-00000026] pbx.c: – Executing [[email protected]:1] Hangup(“Local/[email protected];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/[email protected];2’
[2013-06-17 20:28:19] VERBOSE[4725][C-00000026] pbx.c: – Executing [[email protected]:1] Dial(“Local/[email protected];2”, “Local/[email protected]/n”) in new stack
[2013-06-17 20:28:19] VERBOSE[4725][C-00000026] app_dial.c: – Called Local/[email protected]/n
[2013-06-17 20:28:19] VERBOSE[4726][C-00000026] pbx.c: – Executing [[email protected]:1] Dial(“Local/[email protected];2”, “Local/[email protected]/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/[email protected];2’
[2013-06-17 20:28:19] VERBOSE[4725][C-00000026] pbx.c: – Executing [[email protected]:1] Hangup(“Local/[email protected];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/[email protected];2’
[2013-06-17 20:28:19] VERBOSE[4726][C-00000026] app_dial.c: – Called Local/[email protected]/n
[2013-06-17 20:28:19] VERBOSE[4727][C-00000026] pbx.c: – Executing [[email protected]:1] Dial(“Local/[email protected];2”, “Local/[email protected]/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/[email protected];2’
[2013-06-17 20:28:19] VERBOSE[4726][C-00000026] pbx.c: – Executing [[email protected]:1] Hangup(“Local/[email protected];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/[email protected];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/[email protected]/n
[2013-06-17 20:28:56] VERBOSE[7167][C-00000026] pbx.c: == Spawn extension (from-internal, 621, 1) exited non-zero on ‘Local/[email protected];2’
[2013-06-17 20:28:56] VERBOSE[7167][C-00000026] pbx.c: – Executing [[email protected]:1] Hangup(“Local/[email protected];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/[email protected];2’
[2013-06-17 20:28:56] VERBOSE[7168][C-00000026] pbx.c: – Executing [[email protected]:1] Dial(“Local/[email protected];2”, “Local/[email protected]/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/[email protected]/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 [[email protected]:1] Hangup(“Local/[email protected];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/[email protected];2’
[2013-06-17 20:29:00] VERBOSE[7169] pbx_spool.c: – Attempting call on Local/[email protected] for application NoCDR() (Retry 1)
[2013-06-17 20:29:00] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:1] NoCDR(“Local/[email protected];2”, “”) in new stack
[2013-06-17 20:29:00] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:2] Set(“Local/[email protected];2”, “TCMAINT=RETURN”) in new stack
[2013-06-17 20:29:00] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:3] Gosub(“Local/[email protected];2”, “timeconditions,1,1()”) in new stack
[2013-06-17 20:29:00] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:1] GotoIfTime(“Local/[email protected];2”, “08:30-13:00,mon-fri,,?truestate”) in new stack
[2013-06-17 20:29:00] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:2] GotoIfTime(“Local/[email protected];2”, “14:00-17:00,mon-fri,,?truestate”) in new stack
[2013-06-17 20:29:00] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:3] GotoIf(“Local/[email protected];2”, “0?truegoto”) in new stack
[2013-06-17 20:29:00] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:4] ExecIf(“Local/[email protected];2”, “0?Set(DB(TC/1)=)”) in new stack
[2013-06-17 20:29:00] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:5] Set(“Local/[email protected];2”, “DEVICE_STATE(Custom:TC1)=INUSE”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:6] ExecIf(“Local/[email protected];2”, “0?Set(DEVICE_STATE(Custom:TCSTICKY)=INUSE)”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:7] GotoIf(“Local/[email protected];2”, “0?app-blackhole,hangup,1”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:8] Set(“Local/[email protected];2”, “TCSTATE=false”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:9] Return(“Local/[email protected];2”, “”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:4] Gosub(“Local/[email protected];2”, “timeconditions,3,1()”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:1] GotoIfTime(“Local/[email protected];2”, “08:30-13:00,mon-fri,,?truestate”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:2] GotoIfTime(“Local/[email protected];2”, “14:00-17:00,mon-fri,,?truestate”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:3] GotoIf(“Local/[email protected];2”, “0?truegoto”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:4] ExecIf(“Local/[email protected];2”, “0?Set(DB(TC/3)=)”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:5] Set(“Local/[email protected];2”, “DEVICE_STATE(Custom:TC3)=INUSE”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:6] ExecIf(“Local/[email protected];2”, “0?Set(DEVICE_STATE(Custom:TCSTICKY)=INUSE)”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:7] GotoIf(“Local/[email protected];2”, “0?ext-group,607,1”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:8] Set(“Local/[email protected];2”, “TCSTATE=false”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:9] Return(“Local/[email protected];2”, “”) in new stack
[2013-06-17 20:29:08] VERBOSE[7170][C-00000028] pbx.c: – Executing [[email protected]:5] System(“Local/[email protected];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 [[email protected]:6] Answer(“Local/[email protected];2”, “”) in new stack
[2013-06-17 20:29:20] NOTICE[7169] pbx_spool.c: Call completed to Local/[email protected]
[2013-06-17 20:29:20] VERBOSE[7170][C-00000028] pbx.c: == Spawn extension (tc-maint, s, 6) exited non-zero on ‘Local/[email protected];2’
[2013-06-17 20:30:00] VERBOSE[7174] pbx_spool.c: – Attempting call on Local/[email protected] for application NoCDR() (Retry 1)
[2013-06-17 20:30:00] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:1] NoCDR(“Local/[email protected];2”, “”) in new stack
[2013-06-17 20:30:00] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:2] Set(“Local/[email protected];2”, “TCMAINT=RETURN”) in new stack
[2013-06-17 20:30:00] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:3] Gosub(“Local/[email protected];2”, “timeconditions,1,1()”) in new stack
[2013-06-17 20:30:00] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:1] GotoIfTime(“Local/[email protected];2”, “08:30-13:00,mon-fri,,?truestate”) in new stack
[2013-06-17 20:30:00] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:2] GotoIfTime(“Local/[email protected];2”, “14:00-17:00,mon-fri,,?truestate”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:3] GotoIf(“Local/[email protected];2”, “0?truegoto”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:4] ExecIf(“Local/[email protected];2”, “0?Set(DB(TC/1)=)”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:5] Set(“Local/[email protected];2”, “DEVICE_STATE(Custom:TC1)=INUSE”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:6] ExecIf(“Local/[email protected];2”, “0?Set(DEVICE_STATE(Custom:TCSTICKY)=INUSE)”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:7] GotoIf(“Local/[email protected];2”, “0?app-blackhole,hangup,1”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:8] Set(“Local/[email protected];2”, “TCSTATE=false”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:9] Return(“Local/[email protected];2”, “”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:4] Gosub(“Local/[email protected];2”, “timeconditions,3,1()”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:1] GotoIfTime(“Local/[email protected];2”, “08:30-13:00,mon-fri,,?truestate”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:2] GotoIfTime(“Local/[email protected];2”, “14:00-17:00,mon-fri,,?truestate”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:3] GotoIf(“Local/[email protected];2”, “0?truegoto”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:4] ExecIf(“Local/[email protected];2”, “0?Set(DB(TC/3)=)”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:5] Set(“Local/[email protected];2”, “DEVICE_STATE(Custom:TC3)=INUSE”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:6] ExecIf(“Local/[email protected];2”, “0?Set(DEVICE_STATE(Custom:TCSTICKY)=INUSE)”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:7] GotoIf(“Local/[email protected];2”, “0?ext-group,607,1”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:8] Set(“Local/[email protected];2”, “TCSTATE=false”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:9] Return(“Local/[email protected];2”, “”) in new stack
[2013-06-17 20:30:13] VERBOSE[7175][C-00000029] pbx.c: – Executing [[email protected]:5] System(“Local/[email protected];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 [[email protected]:6] Answer(“Local/[email protected];2”, “”) in new stack
[2013-06-17 20:30:14] NOTICE[7174] pbx_spool.c: Call completed to Local/[email protected]

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