Ticket #3457 (closed Bugs: fixed)

Opened 2 years ago

Last modified 1 year ago

DISA Crashes System, DISA Ver 2.5.1.6 FreePBX Ver 2.5.1.0, Asterisk Ver Asterisk 1.2.18

Reported by: mkolberg Assigned to:
Priority: crash Milestone: 2.6
Component: DISA Version: 2.5-branch
Keywords: Crash, Loop Cc:
Confirmation: Need Feedback SVN Revision (if applicable):
Backend Engine: Asterisk 1.2.x Backend Engine Version:

Description

I have a DID that goes directly to DISA. When the DID is called DISA asks for password and I enter it. I am then dropped to a dial tone. If I place a normal call to an outside number everything works fine. Calls to an internal extension, feature code, ring group, queue, etc. cause the system to loop. Here is an example: If I try to log in or out of our call queue the system loops and spikes CPU to 100%. If I place an inbound call to our main phone number or any other DID immediately after the system goes into a loop the IVR can be heard but is barely audible. It is broken up and will not respond to any DTMF entries. If I wait a couple minutes and try the main number or any other DID again the calling phones carrier reports "All circuits Busy" or "this number is disconnected". This is the normal error message when the PBX is not available. If I look at the servers console it is blank and non responsive. No SSH connections can be made to the server.

All trunks are SIP, logging on and off of the queue or dialing any other internal extension, feature, ring group, queue, etc. without using DISA works fine (from a handset). Our queue is 555. To log on to the queue we dial 555* and then it asks for extension. To log off we dial 555** and then it asks for the extension. When using DISA it crashes while logging on and off. When I use DISA to log on or off it starts this crash right after I enter the extension number. EXAMPLE: Dial DISA -> Prompts for Password -> Enter Password -> Drops to dial tone -> Dial 555* -> Asks for extension to log into queue -> Enter Extension -> System Loop -> Call is disconnected. Similar problem exists while using DISA for any other internal use. EXAMPLE: Dial DISA -> Prompts for Password -> Enter Password -> Drops to dial tone -> Enter internal extension number -> System Loop -> Call is disconnected.

The machine is basically useless until it is hard rebooted. I logged on to the asterisk console to see output while I called the DISA and tried to log into queue. I set verbose to 100 and this is the output to the console. It repeats this for about 200 lines and then ssh looses the connection.

Here is the screen output that keeps repeating.

== Everyone is busy/congested at this time (1:0/0/1)
-- Executing Gosub("SIP/4.68.250.148-09980728", "s-CHANUNAVAIL|1") in new stack
-- Executing NoOp("SIP/4.68.250.148-09980728", "called s-CHANUNAVAIL in from-internal by "disa") in new stack
-- Executing Dial("SIP/4.68.250.148-09980728", "Local/s-CHANUNAVAIL@from-internal|300|") in new stack
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing Gosub("SIP/4.68.250.148-09980728", "s-CHANUNAVAIL|1") in new stack
-- Executing NoOp("SIP/4.68.250.148-09980728", "called s-CHANUNAVAIL in from-internal by "disa") in new stack
-- Executing Dial("SIP/4.68.250.148-09980728", "Local/s-CHANUNAVAIL@from-internal|300|") in new stack
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing Gosub("SIP/4.68.250.148-09980728", "s-CHANUNAVAIL|1") in new stack

After posting this to the forum, An Asterisk Developer (mbrevda) commented:


If I remember correctly, asterisk 1.2 has issues with dialplan matching. When there is more than one possible match, it will take the broadest, instead of the most restrictive, choice.

Is anyone experiencing these issues on asterisk 1.4?

If not then we will have to restore the original code for 1.2 users, so please open a bug to that affect.


Another user did report problems in Asterisk 1.4 but thought that by selecting "Allow Hangup" within DISA saving changes and then deselecting "Allow Hangup" within DISA fixed the problem. This has not been confirmed by other Asterisk 1.4 users. This fix did not work for me.

DISA calls to internal extensions, queues, ring groups, etc. worked fine with FreePBX version 2.3, is there anyway to restore the old code for this module.

Thanks

Change History

12/27/08 22:17:25 changed by naftali5

confirmed worksforme with the same DISA version, and Asterisk 1.4.19

confirmed bug for Asterisk 1.2.14 - endless loop - but hanging up saves the system for me...

it would seems that mbrevda is right about the improper pattern matching as s-CHANUNAVAIL is going to _. instead of _s-.

In any event, adding each possible dialstatus individually would solve the problem - there are only 6 or 7 possible in 1.2, and leaving the pattern for future statuses which will probably not be added in 1.2.

There is however another problem - and I wish you had posted the first part of the debug - which is why did your feature codes return CHANUNAVAIL in the first place?

the following in the disa/functions.inc.php fixes the loop,

			$exten = 's-ANSWER';
			$ext->add($context, $exten, '', new ext_return());

			$exten = 's-CANCEL';
			$ext->add($context, $exten, '', new ext_return());

			$exten = 's-BUSY';
			$ext->add($context, $exten, '', new ext_playtones('busy'));
			$ext->add($context, $exten, '', new ext_wait('3'));
			$ext->add($context, $exten, '', new ext_return());

			$exten = 's-NOANSWER';
			$ext->add($context, $exten, '', new ext_gosub(1,'failed'));
			$ext->add($context, $exten, '', new ext_return());

			$exten = 's-CONGESTION';
			$ext->add($context, $exten, '', new ext_gosub(1,'failed'));
			$ext->add($context, $exten, '', new ext_return());

			$exten = 's-CHANUNAVAIL';
			$ext->add($context, $exten, '', new ext_gosub(1,'failed'));
			$ext->add($context, $exten, '', new ext_return());

			$exten = 's-DONTCALL';
			$ext->add($context, $exten, '', new ext_gosub(1,'failed'));
			$ext->add($context, $exten, '', new ext_return());

			$exten = '_s-.';
			$ext->add($context, $exten, '', new ext_gosub(1,'failed'));
			$ext->add($context, $exten, '', new ext_return());

			$exten = 'failed';
			$ext->add($context, $exten, '', new ext_noop('DISA Dial failed due to ${DIALSTATUS} - returning to dial tone'));
			$ext->add($context, $exten, '', new ext_playtones('congestion'));
			$ext->add($context, $exten, '', new ext_wait('3'));
			$ext->add($context, $exten, '', new ext_stopplaytones());
			$ext->add($context, $exten, '', new ext_return());

but the following line does not work on asterisk 1.2 either, (it reads the quotes as literal, and stops at the comma

				$ext->add('disa', $item['disa_id'], '', new ext_setvar('_DISA', '"disa,'.$item['disa_id'].',newcall"'));

so instead of looping, it does try to return, but does not know where

-- Executing Goto("SIP/613-b7698700", ""disa") in new stack

instead of 1.4 behavior

-- Executing [123456@disa-dial:4] Goto("IAX2/603-3", "disa|1|newcall") in new stack

and even adjusting it, to leave out the quotes, and escape the commas, I could not get it to work well.

Really, only the disa id should be passed as a variable, and the goto knows to go to disa,${DISA},newcall - this avoids the quotes and commas.

so the following fixes should be made too.

				$ext->add('disa', $item['disa_id'], '', new ext_setvar('_DISA', $item['disa_id']));
				$ext->add('disa', $item['disa_id'], 'newcall', new ext_setvar('_DISACONTEXT', $thisitem['context']));
				$ext->add('disa', $item['disa_id'], '', new ext_setvar('_KEEPCID', 'TRUE')); 

and

			$context = 'disa-dial';
			$exten = '_.';
			$ext->add($context, $exten, '', new ext_noop('called ${EXTEN} in ${DISACONTEXT} by disa ${DISA}'));
			$ext->add($context, $exten, '', new ext_dial('Local/${EXTEN}@${DISACONTEXT}', '300,${HANGUP}'));  // Regular Trunk Dial
			$ext->add($context, $exten, '', new ext_gosub('1', 's-${DIALSTATUS}'));
			$ext->add($context, $exten, '', new ext_goto('newcall','${DISA}','disa'));

01/25/09 20:28:08 changed by mbrevda

Naftali: im not really sure what your suggesting. Do we need to add code to 1.4 based systems as well? If not, shouldn't we check if were running 1.2 or 1.4 and add the code based on that? As a dev, I'm sure you would understand when I ask for a patch in diff format :)

01/25/09 20:39:32 changed by naftali5

All 3 of the code blocks i posted would work on 1.2 and 1.4 (that is code block numbers 1, 5, and 6 above - as the other 3 code blocks are just cli output or existing code) Actually, the changes I made make it more correct for 1.4 also.

I meant to post in human readable form so someone can look it over, as I can not rightly be called a dev as I no longer have svn access :)

My 1.4 machine with freepbx trunk on it is powered down for now, if you need I can fire it up to diff it for you. I did pad enough code around my changes so anyone can find the code to change easily.

01/25/09 21:56:53 changed by p_lindheimer

naftali5, you should have svn access, when we migrated from sourceforge I enabled everyone where I could find and account on freepbx.org for them. So either you didn't have a new one at the time or it was an oversite, in either case, you should have it now.

03/11/09 17:13:20 changed by p_lindheimer

  • confirmation changed from Unreviewed to Need Feedback.

mbrevda or naftali,

what's the status on this? I see the issue wrt to 1.2 and the "_." matching before the "_s-." as Asterisk 1.2 is very liberal with "_.". So for that part, is there a reason why we would ever have a call made that did not have at least one digit, and thus use "_X." or if needed something like "_[0-9a-zA-Z*#]." if need be?

thanks in advance.

And naftali, if you still don't have svn access, ping me, you should.

03/13/09 00:19:03 changed by mbrevda

something like that should work, although having the a-zA-Z is a bit risky as the s-status can match it (unless bacause you dont have a '-' in there your not worried?)

05/02/09 11:40:34 changed by p_lindheimer

  • status changed from new to closed.
  • resolution set to fixed.

(In [7624]) fixes #3457 don't use _. since Asterisk 1.2 will take that over more explicit matches like _s-.

05/06/09 12:15:58 changed by p_lindheimer

(In [7647]) Merged revisions 7525-7553,7555-7612,7614-7646 via svnmerge from http://svn.freepbx.org/modules/branches/2.5

........

r7543 | mickecarlsson | 2009-03-21 05:37:55 -0700 (Sat, 21 Mar 2009) | 1 line

Fixes #3591 logic should be AND instead of OR

........

r7571 | mickecarlsson | 2009-04-06 11:18:35 -0700 (Mon, 06 Apr 2009) | 1 line

Re #3616, adds Portuguese (Brasil) to varous modules

........

r7612 | p_lindheimer | 2009-05-02 09:52:03 -0700 (Sat, 02 May 2009) | 1 line

fixes #3653 Skip Busy Agent ignored in some Follow-Me configurations under a queue

........

r7624 | p_lindheimer | 2009-05-02 11:40:34 -0700 (Sat, 02 May 2009) | 1 line

fixes #3457 don't use _. since Asterisk 1.2 will take that over more explicit matches like _s-.

........

r7626 | p_lindheimer | 2009-05-02 12:21:14 -0700 (Sat, 02 May 2009) | 1 line

fixes #3517 no need to test nodest variable, it will be set and empty if not set in the channel

........

r7627 | p_lindheimer | 2009-05-02 13:15:16 -0700 (Sat, 02 May 2009) | 1 line

fixes #3618 generate announce-position in queues.conf for Asterisk 1.6 (yes or no only for now)

........

r7644 | mickecarlsson | 2009-05-05 13:54:37 -0700 (Tue, 05 May 2009) | 1 line

Re #3657, updated Brazilian Portuguese language files

........