Potential incorrect handling of SIP 404?

Chilling_Silence's picture

Hi all,

So Im getting this with both Elastix, Trixbox & AsteriskNOW using a variety of FreePBX versions.

When I dial a number that does not exist (Invalid / No-such-number) from my asterisk box, I get the message "All circuits are busy now, please try your call again later". I *think* I should be getting the message "Your call cannot be completed as dialed, please check the number and try again".

Ive tried this via a SIP trunk & an IAX2 trunk to my ITSP.

Turning on SIP Debug I get:
<--- SIP read from 202.180.76.161:5060 --->
SIP/2.0 404 Not Found

So, reading here:
http://www.voip-info.org/wiki-Asterisk+variable+DIALSTATUS
And here:
http://www.voip-info.org/wiki/view/Asterisk+variable+hangupcause
It appears as though 404 Not Found is correct, however I believe the box should be handling it as CONGESTION but instead its coming back with CHANUNAVAIL.

When dialing a number I know is invalid, it looks like this from the asterisk console:
-- Executing [s@macro-dialout-trunk:20] Dial("SIP/195-09ac4fc0", "IAX2/099294922/4061756|300|") in new stack
-- Called 099294922/4061756
-- Call accepted by 202.180.76.166 (format alaw)
-- Format for call is alaw
-- IAX2/099294922-16386 is making progress passing it to SIP/195-09ac4fc0
-- Hungup 'IAX2/099294922-16386'
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [s@macro-dialout-trunk:21] Goto("SIP/195-09ac4fc0", "s-CHANUNAVAIL|1") in new stack
-- Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
-- Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] GotoIf("SIP/195-09ac4fc0", "1?noreport") in new stack
-- Goto (macro-dialout-trunk,s-CHANUNAVAIL,3)
-- Executing [s-CHANUNAVAIL@macro-dialout-trunk:3] NoOp("SIP/195-09ac4fc0", "TRUNK Dial failed due to CHANUNAVAIL - failing through to other trunks") in new stack
-- Executing [4061756@from-internal:5] Macro("SIP/195-09ac4fc0", "outisbusy|") in new stack
-- Executing [s@macro-outisbusy:1] Playback("SIP/195-09ac4fc0", "all-circuits-busy-now|noanswer") in new stack
-- Playing 'all-circuits-busy-now' (language 'en')

So Ive been trying to read through my extensions.conf file, thinking I might be able to see something in there that I can adjust to correct it, but to be honest I wouldnt have a clue where to start, nor am I entirely sure what I can manually change without having FreePBX change it back...

Any pointers / suggestions would be greatly appreciated.

Cheers

Chill.


__________________


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

SIP Trunk not producing correct connection error messages

neil_mccarthy2@itmsltd.net's picture

Hi there, did you ever get anywhere with this?

I have a similar problem at a small call centre where outgoing calls are failing for a number of reasons (busy, unobtainable, internet line issues etc etc), but all being presented as an "all-circuits busy" to the user.

This is confusing them no-end and we are being called un-necessarily when they are dialling invalid numbers.

I have looked at the macro's and they seem not to use the HANGUPCAUSE method at all, which is probably why it is falling to the generic message that they are receiving.

Has anyone got a workaround for this using the HANGUPCAUSE ?

Thanks

Neil


Sadly no

Chilling_Silence's picture

Hi Neil,

Unfortunately not, I havent got anywhere further with it... I've got so many things on at once this has unfortunately been pushed to one side now. I also have a small call-center so I understand the frustration :(

If you find anything, let me know. Im hoping to do some more research during the week.

Cheers

Chill.


our patch to solve this problem

nicson's picture

Hi!

We've encountered a problem like yours, but with Zap trunks (Sangoma E1).
I've patched FreePBX to handle this correctly, by checking $HANGUPCAUSE.
[Please note that a few ISDN hangup causes are not treated yet]

I'll try to submit the patch to the devs, hopefully it'll get included in the next versions of FreePBX.

Hope this helps!

--- ./modules/core/functions.inc.php.orig 2008-09-22 04:19:18.000000000 +0200
+++ ./modules/core/functions.inc.php 2009-02-09 11:35:18.000000000 +0100
@@ -1150,6 +1151,11 @@
*
* Modified both Dial() commands to include the new TRUNK_OPTIONS from the general
* screen of AMP
+ *
+ * MODIFIED (Nicson)
+ *
+ * Modified to check HANGUPCAUSE
+ *
*/
$ext->add($context, $exten, '', new ext_set('DIAL_TRUNK', '${ARG1}'));
$ext->add($context, $exten, '', new ext_execif('$[$["${ARG3}" != ""] & $["${DB(AMPUSER/${AMPUSER}/pinless)}" != "NOPASSWD"]]', 'Authenticate', '${ARG3}'));
@@ -1206,6 +1212,53 @@
$ext->add($context, $exten, '', new ext_playtones('congestion'));
$ext->add($context, $exten, '', new ext_congestion(20));

+ // added by Nicson
+ $exten = "s-UNALLOC";
+ $ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting Unallocated/Unassigned number - giving up'));
+ $ext->add($context, $exten, '', new ext_progress());
+ $ext->add($context, $exten, '', new ext_playback('ss-noservice|noanswer'));
+ $ext->add($context, $exten, '', new ext_busy(20));
+
+ $exten = "s-NONET";
+ $ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting No route to specified transit network - giving up'));
+ $ext->add($context, $exten, '', new ext_progress());
+                        $ext->add($context, $exten, '', new ext_playback('ss-noservice|noanswer'));
+ $ext->add($context, $exten, '', new ext_busy(20));
+
+ $exten = "s-NOROUTE";
+ $ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting No route to destination - giving up'));
+ $ext->add($context, $exten, '', new ext_progress());
+                        $ext->add($context, $exten, '', new ext_playback('ss-noservice|noanswer'));
+ $ext->add($context, $exten, '', new ext_busy(20));
+
+ $exten = "s-CHANUNACCEPT";
+ $ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting Channel unacceptable - giving up'));
+ $ext->add($context, $exten, '', new ext_playtones('busy'));
+ $ext->add($context, $exten, '', new ext_busy(20));
+
+ $exten = "s-REJECT";
+ $ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting Call Rejected - giving up'));
+ $ext->add($context, $exten, '', new ext_playtones('busy'));
+ $ext->add($context, $exten, '', new ext_busy(20));
+
+ $exten = "s-CHANGED";
+ $ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting Number Changed - giving up'));
+ $ext->add($context, $exten, '', new ext_playtones('busy'));
+ $ext->add($context, $exten, '', new ext_busy(20));
+
+ $exten = 's-CONGESTION';
+ // added by Nicson
+ $ext->add($context, $exten, '', new ext_gotoif('$["${HANGUPCAUSE}" = "1"]', 's-UNALLOC,1'));
+ $ext->add($context, $exten, '', new ext_gotoif('$["${HANGUPCAUSE}" = "2"]', 's-NONET,1'));
+ $ext->add($context, $exten, '', new ext_gotoif('$["${HANGUPCAUSE}" = "3"]', 's-NOROUTE,1'));
+ $ext->add($context, $exten, '', new ext_gotoif('$["${HANGUPCAUSE}" = "6"]', 's-CHANUNACCEPT,1'));
+ $ext->add($context, $exten, '', new ext_gotoif('$["${HANGUPCAUSE}" = "11"]', 's-BUSY,1'));
+ $ext->add($context, $exten, '', new ext_gotoif('$["${HANGUPCAUSE}" = "12"]', 's-NOANSWER,1'));
+ $ext->add($context, $exten, '', new ext_gotoif('$["${HANGUPCAUSE}" = "13"]', 's-NOANSWER,1'));
+ $ext->add($context, $exten, '', new ext_gotoif('$["${HANGUPCAUSE}" = "15"]', 's-REJECT,1'));
+ $ext->add($context, $exten, '', new ext_gotoif('$["${HANGUPCAUSE}" = "16"]', 's-CHANGED,1'));
+ // end added by Nicson
+
$exten = '_s-.';
$ext->add($context, $exten, '', new ext_gotoif('$["x${OUTFAIL_${ARG1}}" = "x"]', 'noreport'));
$ext->add($context, $exten, '', new ext_agi('${OUTFAIL_${ARG1}}'));
@@ -1272,7 +1325,53 @@
$ext->add($context, $exten, '', new ext_playtones('congestion'));
$ext->add($context, $exten, '', new ext_congestion(20));

+                        // added by Nicson
+                        $exten = "s-UNALLOC";
+                        $ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting Unallocated/Unassigned number - giving up'));
+ $ext->add($context, $exten, '', new ext_answer());
+                        $ext->add($context, $exten, '', new ext_playback('ss-noservice'));
+                        $ext->add($context, $exten, '', new ext_busy(20));
+
+                        $exten = "s-NONET";
+                        $ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting No route to specified transit network - giving up'));
+ $ext->add($context, $exten, '', new ext_answer());
+                        $ext->add($context, $exten, '', new ext_playback('ss-noservice'));
+                        $ext->add($context, $exten, '', new ext_busy(20));
+
+                        $exten = "s-NOROUTE";
+                        $ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting No route to destination - giving up'));
+ $ext->add($context, $exten, '', new ext_answer());
+                        $ext->add($context, $exten, '', new ext_playback('ss-noservice'));
+                        $ext->add($context, $exten, '', new ext_busy(20));
+
+                        $exten = "s-CHANUNACCEPT";
+                        $ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting Channel unacceptable - giving up'));
+                        $ext->add($context, $exten, '', new ext_playtones('busy'));
+                        $ext->add($context, $exten, '', new ext_busy(20));
+
+                        $exten = "s-REJECT";
+                        $ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting Call Rejected - giving up'));
+                        $ext->add($context, $exten, '', new ext_playtones('busy'));
+                        $ext->add($context, $exten, '', new ext_busy(20));
+
+                        $exten = "s-CHANGED";
+                        $ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting Number Changed - giving up'));
+                        $ext->add($context, $exten, '', new ext_playtones('busy'));
+                        $ext->add($context, $exten, '', new ext_busy(20));
+                        // end added by Nicson
+
$exten = '_s-.';
+                        // added by Nicson
+                        $ext->add($context, $exten, '', new ext_gotoif('$["${HANGUPCAUSE}" = "1"]', 's-UNALLOC,1'));
+                        $ext->add($context, $exten, '', new ext_gotoif('$["${HANGUPCAUSE}" = "2"]', 's-NONET,1'));
+                        $ext->add($context, $exten, '', new ext_gotoif('$["${HANGUPCAUSE}" = "3"]', 's-NOROUTE,1'));
+                        $ext->add($context, $exten, '', new ext_gotoif('$["${HANGUPCAUSE}" = "6"]', 's-CHANUNACCEPT,1'));
+                        $ext->add($context, $exten, '', new ext_gotoif('$["${HANGUPCAUSE}" = "11"]', 's-BUSY,1'));
+                        $ext->add($context, $exten, '', new ext_gotoif('$["${HANGUPCAUSE}" = "12"]', 's-NOANSWER,1'));
+                        $ext->add($context, $exten, '', new ext_gotoif('$["${HANGUPCAUSE}" = "13"]', 's-NOANSWER,1'));
+                        $ext->add($context, $exten, '', new ext_gotoif('$["${HANGUPCAUSE}" = "15"]', 's-REJECT,1'));
+                        $ext->add($context, $exten, '', new ext_gotoif('$["${HANGUPCAUSE}" = "16"]', 's-CHANGED,1'));
+                        // end added by Nicson
$ext->add($context, $exten, '', new ext_gotoif('$["x${OUTFAIL_${ARG1}}" = "x"]', 'noreport'));
$ext->add($context, $exten, '', new ext_agi('${OUTFAIL_${ARG1}}'));
$ext->add($context, $exten, 'noreport', new ext_noop('TRUNK Dial failed due to ${DIALSTATUS} - failing through to other trunks'));
--- ./extensions.class.php.orig 2009-02-09 11:38:18.000000000 +0100
+++ ./extensions.class.php 2009-02-09 11:34:07.000000000 +0100
@@ -569,6 +569,12 @@
}
}

+class ext_progress extends extension {
+ function output() {
+ return"Progress";
+ }
+}
+
class ext_privacymanager extends extension {
function output() {
return "PrivacyManager(".$this->data.")";

__________________

--
SwissVON s.a.r.l
http://www.swissvon.ch


If you submit it via the bug

fskrotzki's picture

If you submit it via the bug report with the patch as an attachment I'm sure they will look at it. You'll find it at the bottom of every we page in the center 3 item down under Development


could you please help on how to do the patch

flashmemory's picture

Hi
I have the same problem, sip congestion, sometimes the calls will go thru and most of the time it said congestion.
Thanks for your time.


Patch

neil_mccarthy2@itmsltd.net's picture

Fantastic ! Thank you.

We will try this over the coming couple of weeks and feed back.

Kind regards

Neil


Tested

ziggie's picture

I attest that the patch works perfectly. Wonder why it hasn't been added...

Well. Thanks a lot nicson !!

I had been battling with this thing for several months now!


Any ideas why this hasn't

andyb2k9's picture

Any ideas why this hasn't been adopted?

Also I can't see the bug/entry in the trac, anyone have a reference as trying to apply the patch myself is failing, i think thats due to forum encoding/screwing the formatting though


what's the ticket number,

p_lindheimer's picture

what's the ticket number, it's possible it's just an oversight...


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


I'm suffering from this

timboothby's picture

I'm suffering from this problem too, it seems calls through our SIP provider to non-existant or otherwise problem numbers are giving an "all circuits are busy" message and confusing my call centre staff.

I've searched through the bug tracking system and can't find this listed - but it's not a system I'm familiar with so I may have missed it. Anyway, I've submitted the bug myself as ticket 3805

Hopefully this will get resolved in a future release. Meanwhile can anybody explain to a non developer like myself how to apply the patch?

Thanks,

Tim


Could someone please guide

mrobinson's picture

Could someone please guide me on how to add the patch? Is it as easy as copy and pasting the aboce code into functions.inc.php? Or do I have to create a module to upload via Freepbx?

Thanks,

Mark


May someone can explain me

Mysterious's picture

May someone can explain me how to apply this patch to an working 2.6 Instalaltion too?


This feature is added to

mickecarlsson's picture

This feature is added to FreePBX 2.7 that is in svn right now. 2.7 will be released in a near future as soon as the fax functions are tested.

Please read more here: http://www.freepbx.org/trac/roadmap and the ticket here

I will not try to explain how to patch the above because it explained almost everywhere on the net how to use the patch command.


__________________

Mikael Carlsson
(I am off-line, tinkering with my Chevy and my radios, don't know when I will be back)


Thanks for your comment, the

Mysterious's picture

Thanks for your comment, the patch command isn´t the problem. My question is maybe a basic question but changing the 2 php files doesn´t efect the dialplan, correct? What does i have to do to get these changes take effekt in the dialplan. Would be nice of you to get get some hint.


If you enter the above in

mickecarlsson's picture

If you enter the above in the files (you need to change two files), and save them, all you have to do then is to save some setting in FreePBX and the dialplan will be updated.


__________________

Mikael Carlsson
(I am off-line, tinkering with my Chevy and my radios, don't know when I will be back)


I´m sorry asking again but

Mysterious's picture

I´m sorry asking again but the second file patch.txt cannot be applied correctly. I tried "patch

Part of security?

blanchae's picture

From what I've read is that the "All circuits are busy" message is part of the dialplan security. The idea is that if someone attempts to hack your PBX by brute force guessing of extensions then they receive this message. It's ambiguous enough that it discourages hackers.

Normally, the extension is known or there is a dialplan rule that says what to do with calls to the PBX. If no rules match, then the "All circuits are busy" message appears.

Unfortunately, if you are trying to troubleshoot a problem and receive this message then it can be very frustrating. Usually the source of the problem is mismatched extension numbers and secrets (passwords).


__________________

Eugene Blanchard
Author of PBX in a Flash for Newbies and Introduction to Data Communications


blanchae, the change in

mickecarlsson's picture

blanchae, the change in dialplan was to enhance the report back to the caller calling out of the pbx, I fail to see how this affects hackers trying to brute force guessing extensions.

This update in the dial plan is to enhance the failure message to caller if trunk report this:
* HANGUPCAUSE 1 = Unallocated number, or SIP 404 not Found
This means that the number dialed is not found, usually a number dialed wrong.

* HANGUPCAUSE 28 = Address Incomplete, or SIP 484 Address Incomplete
This means that the number dialed is incomplete, like dialing a number to short

* HANGUPCAUSE 18 = No User Responding, or SIP 408 Request Timeout
* HANGUPCAUSE 19 = No Answer From The User, or SIP 480 Temporarily unavailable, SIP 483 To many hops
This means that there was no answer from the dialed number.


__________________

Mikael Carlsson
(I am off-line, tinkering with my Chevy and my radios, don't know when I will be back)


Oh, saddly my last comment

Mysterious's picture

Oh, saddly my last comment was not fully postet.
I´ve got problems applying this patch with the patch command. Here´s my output:

root@pbx:/var/www/html/admin/modules/core $ patch <./patch.txt
patching file functions.inc.php
patch: **** malformed patch at line 4: *

May i forot some parameters to the patch command?


Mysterious, the patch posted

mickecarlsson's picture

Mysterious, the patch posted above only work with the specific version of FreePBX where the diff was generated.
As I don't know which version of FreePBX the diff was generated from or your version of FreePBX I actually can't help with your request.

I advice you to wait until FreePBX 2.7 is out.


__________________

Mikael Carlsson
(I am off-line, tinkering with my Chevy and my radios, don't know when I will be back)


Mikael: It was security by

blanchae's picture

Mikael:

It was security by obscurity as far as I can tell. The hacker attempts to break in by brute forcing the extensions, wrong extensions give a weird message. Don't shoot me, I'm just the messenger in this.

If you read the code that originates the message "All circuits are busy", the comment of the author is

[[from-sip-external]
;give external sip users congestion and hangup
; Yes. This is _really_ meant to be _. - I know asterisk whinges about it, but
; I do know what I'm doing. This is correct.

I figure that he knows more about it than I do..

I'm not complaining about the changes, I'm glad that there is better error handling that will aid in troubleshooting


__________________

Eugene Blanchard
Author of PBX in a Flash for Newbies and Introduction to Data Communications


Hi blanchae, I am not

mickecarlsson's picture

Hi blanchae,

I am not complaining to you, no way, I do like your posts and your excellent texts about PBX in a Flash and the PiaF system summary presentation.

I think that you have detected a line that should be removed a long time ago.
The text ";give external sip users congestion and hangup" was for when an anonymous peer tried to call into the system it would get the "ss-noservice". But it is selectable in the GUI to actually make it possible to receive anonymous calls.

The rest of the text:
; Yes. This is _really_ meant to be _. - I know asterisk whinges about it, but
; I do know what I'm doing.
This is correct. It is for the "_. that is a catch-all and is not related to the ";give external sip users congestion and hangup".

And the feature is for outgoing calls only, not incoming.

I will remove that line to avoid confusion, but I need to look through the code to see when it was added so I get a grip of what it was referring to in the first place.

Take care,


__________________

Mikael Carlsson
(I am off-line, tinkering with my Chevy and my radios, don't know when I will be back)


We are running 2.7.0.1 and we are still experiencing this ?

curto's picture

We have a TE205 Dual Channel PRI - the telco error classes are not being handled properly - we always get the All Circuits are busy message - even for incorrect numbers etc.

Does anyone know the status of this in 2.7 ?

regards

Craig


Me too - Also running 2.7.0.1 with PRI

jmehl's picture

... and it looks like macro-outisbusy hasn't changed in my extensions.conf file to reflect the HANGUPCAUSE values.

Would *love* to have a solution on this - we get lots of user calls saying "it's busy" when in fact they've dialed a bad number, etc.


found a fix

jmehl's picture

still don't know why my 2.7.0.1 isn't working. But I found this solution:

http://www.trixbox.org/forums/trixbox-forums/open-discussion/all-circuit...


I tried that fix from the Trixbox forums and it had no effect

curto's picture

Implemented it as described. Did an amportal stop and asterisk stop, then started all backup again - still no good

Craig


what hangupcause are you

p_lindheimer's picture

what hangupcause are you receiving?

Version 2.7 has added the handling of some hangupcauses though due to the inconsistencies with all carriers, there are likely some not there.

This line should be there:

exten => 28,1,Goto(s-INVALIDNMBR,1)

which would play an ss-noservice message. I suspect we may need to add more but we need to know what you are receiving and then we can assess if it is safe to add that.


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


We are getting this for a number of different conditions

curto's picture

Phillipe, Thanks firstly for taking the time to look at this

Our system is as follows (for background)

PIAF 1.4
Centos 5.2
FreePBX 2.7.0.1

We have a TE210P 3.3v Rev 2 card - we are connected to an Australian PRI (30 channels plus two signalling channels) of which we have 20 provisioned

We use LCR across this PRI trunk to direct calls to various providers based on their call rates. We have implemented this using Outbound Route pattern matching and Custom Trunks (these simple append the correct LCR code for the vendors as required)

We finding that the following conditions all seem to generate the same message to be played

1)incorrect/invalid number
2)Engaged/busy number
3)number blocked by the LCR provider

Below is the capture from the log of the call in question when the number is engaged (we had called it from a mobile phone and ensured they did not have call waiting available)

[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [0296051135@from-internal:1] Macro("SIP/519-b67e5018", "user-callerid|SKIPTTL|") in new stack
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-user-callerid:1] Set("SIP/519-b67e5018", "AMPUSER=519") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-user-callerid:2] GotoIf("SIP/519-b67e5018", "0?report") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: GotoIf
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-user-callerid:3] ExecIf("SIP/519-b67e5018", "1|Set|REALCALLERIDNUM=519") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: ExecIf
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-user-callerid:4] Set("SIP/519-b67e5018", "AMPUSER=519") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-user-callerid:5] Set("SIP/519-b67e5018", "AMPUSERCIDNAME=Michele Martinez") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-user-callerid:6] GotoIf("SIP/519-b67e5018", "0?report") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: GotoIf
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-user-callerid:7] Set("SIP/519-b67e5018", "AMPUSERCID=519") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-user-callerid:8] Set("SIP/519-b67e5018", "CALLERID(all)="Michele Martinez" <519>") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-user-callerid:9] ExecIf("SIP/519-b67e5018", "0|Set|CHANNEL(language)=") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: ExecIf
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-user-callerid:10] GotoIf("SIP/519-b67e5018", "1?continue") in new stack
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Goto (macro-user-callerid,s,19)
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: GotoIf
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-user-callerid:19] NoOp("SIP/519-b67e5018", "Using CallerID "Michele Martinez" <519>") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: Noop
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [0296051135@from-internal:2] Set("SIP/519-b67e5018", "_NODEST=") in new stack
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [0296051135@from-internal:3] Macro("SIP/519-b67e5018", "record-enable|519|OUT|") in new stack
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-record-enable:1] GotoIf("SIP/519-b67e5018", "1?check") in new stack
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Goto (macro-record-enable,s,4)
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: GotoIf
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-record-enable:4] ExecIf("SIP/519-b67e5018", "0|MacroExit|") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: ExecIf
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-record-enable:5] GotoIf("SIP/519-b67e5018", "0?Group:OUT") in new stack
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Goto (macro-record-enable,s,15)
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: GotoIf
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-record-enable:15] GotoIf("SIP/519-b67e5018", "0?IN") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: GotoIf
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-record-enable:16] ExecIf("SIP/519-b67e5018", "1|MacroExit|") in new stack
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [0296051135@from-internal:4] Macro("SIP/519-b67e5018", "dialout-trunk|2|0296051135||") in new stack
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:1] Set("SIP/519-b67e5018", "DIAL_TRUNK=2") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:57] DEBUG[15134] func_db.c: DB: AMPUSER/519/pinless not found in database.
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:2] GosubIf("SIP/519-b67e5018", "0?sub-pincheck|s|1") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: GosubIf
[2010-04-20 13:58:57] DEBUG[15134] func_db.c: DB: AMPUSER/519/pinless not found in database.
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:3] GotoIf("SIP/519-b67e5018", "0?disabletrunk|1") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: GotoIf
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:4] Set("SIP/519-b67e5018", "DIAL_NUMBER=0296051135") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:5] Set("SIP/519-b67e5018", "DIAL_TRUNK_OPTIONS=tr") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:6] Set("SIP/519-b67e5018", "OUTBOUND_GROUP=OUT_2") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:7] GotoIf("SIP/519-b67e5018", "0?nomax") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: GotoIf
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:8] GotoIf("SIP/519-b67e5018", "0?chanfull") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: GotoIf
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:9] GotoIf("SIP/519-b67e5018", "0?skipoutcid") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: GotoIf
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:10] Set("SIP/519-b67e5018", "DIAL_TRUNK_OPTIONS=") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:11] Macro("SIP/519-b67e5018", "outbound-callerid|2") in new stack
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-outbound-callerid:1] ExecIf("SIP/519-b67e5018", "0|SetCallerPres|") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: ExecIf
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-outbound-callerid:2] ExecIf("SIP/519-b67e5018", "0|Set|REALCALLERIDNUM=519") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: ExecIf
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-outbound-callerid:3] GotoIf("SIP/519-b67e5018", "1?normcid") in new stack
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Goto (macro-outbound-callerid,s,6)
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: GotoIf
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-outbound-callerid:6] Set("SIP/519-b67e5018", "USEROUTCID=292557519") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:57] DEBUG[15134] func_db.c: DB: DEVICE/519/emergency_cid not found in database.
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-outbound-callerid:7] Set("SIP/519-b67e5018", "EMERGENCYCID=") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-outbound-callerid:8] Set("SIP/519-b67e5018", "TRUNKOUTCID=") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-outbound-callerid:9] GotoIf("SIP/519-b67e5018", "1?trunkcid") in new stack
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Goto (macro-outbound-callerid,s,12)
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: GotoIf
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-outbound-callerid:12] ExecIf("SIP/519-b67e5018", "0|Set|CALLERID(all)=") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: ExecIf
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-outbound-callerid:13] ExecIf("SIP/519-b67e5018", "1|Set|CALLERID(all)=292557519") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: ExecIf
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Last app: Set|CALLERID(all)=292557519
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-outbound-callerid:14] ExecIf("SIP/519-b67e5018", "0|Set|CALLERID(all)=") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: ExecIf
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-outbound-callerid:15] ExecIf("SIP/519-b67e5018", "0|SetCallerPres|prohib_passed_screen") in new stack
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: ExecIf
[2010-04-20 13:58:57] DEBUG[15134] app_macro.c: Executed application: Macro
[2010-04-20 13:58:57] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:12] ExecIf("SIP/519-b67e5018", "1|AGI|fixlocalprefix") in new stack
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: == fixlocalprefix: Dialpattern 1434+. matched. 0296051135 -> 14340296051135
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- AGI Script fixlocalprefix completed, returning 0
[2010-04-20 13:58:58] DEBUG[15134] app_macro.c: Executed application: ExecIf
[2010-04-20 13:58:58] DEBUG[15134] app_macro.c: Last app: AGI|fixlocalprefix
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:13] Set("SIP/519-b67e5018", "OUTNUM=14340296051135") in new stack
[2010-04-20 13:58:58] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:14] Set("SIP/519-b67e5018", "custom=AMP") in new stack
[2010-04-20 13:58:58] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:15] ExecIf("SIP/519-b67e5018", "0|Set|DIAL_TRUNK_OPTIONS=M(setmusic^)") in new stack
[2010-04-20 13:58:58] DEBUG[15134] app_macro.c: Executed application: ExecIf
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:16] Macro("SIP/519-b67e5018", "dialout-trunk-predial-hook|") in new stack
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("SIP/519-b67e5018", "") in new stack
[2010-04-20 13:58:58] DEBUG[15134] app_macro.c: Executed application: Macro
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:17] GotoIf("SIP/519-b67e5018", "0?bypass|1") in new stack
[2010-04-20 13:58:58] DEBUG[15134] app_macro.c: Executed application: GotoIf
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:18] GotoIf("SIP/519-b67e5018", "1?customtrunk") in new stack
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Goto (macro-dialout-trunk,s,22)
[2010-04-20 13:58:58] DEBUG[15134] app_macro.c: Executed application: GotoIf
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:22] Set("SIP/519-b67e5018", "pre_num=AMP:Local/") in new stack
[2010-04-20 13:58:58] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:23] Set("SIP/519-b67e5018", "the_num=OUTNUM") in new stack
[2010-04-20 13:58:58] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:24] Set("SIP/519-b67e5018", "post_num=@LCR-Gotalk") in new stack
[2010-04-20 13:58:58] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:25] GotoIf("SIP/519-b67e5018", "1?outnum:skipoutnum") in new stack
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Goto (macro-dialout-trunk,s,26)
[2010-04-20 13:58:58] DEBUG[15134] app_macro.c: Executed application: GotoIf
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:26] Set("SIP/519-b67e5018", "the_num=14340296051135") in new stack
[2010-04-20 13:58:58] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:27] Dial("SIP/519-b67e5018", "Local/14340296051135@LCR-Gotalk|300|") in new stack
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Called 14340296051135@LCR-Gotalk
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Local/14340296051135@LCR-Gotalk-3a09,1 is ringing
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Local/14340296051135@LCR-Gotalk-3a09,1 stopped sounds
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: == Everyone is busy/congested at this time (1:0/0/1)
[2010-04-20 13:58:59] DEBUG[15134] app_macro.c: Executed application: Dial
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:28] NoOp("SIP/519-b67e5018", "Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 0") in new stack
[2010-04-20 13:58:59] DEBUG[15134] app_macro.c: Executed application: Noop
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Executing [s@macro-dialout-trunk:29] Goto("SIP/519-b67e5018", "s-CHANUNAVAIL|1") in new stack
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
[2010-04-20 13:58:59] DEBUG[15134] app_macro.c: Executed application: Goto
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] Set("SIP/519-b67e5018", "RC=0") in new stack
[2010-04-20 13:58:59] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto("SIP/519-b67e5018", "0|1") in new stack
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Goto (macro-dialout-trunk,0,1)
[2010-04-20 13:58:59] DEBUG[15134] app_macro.c: Executed application: Goto
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Executing [0@macro-dialout-trunk:1] Goto("SIP/519-b67e5018", "continue|1") in new stack
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Goto (macro-dialout-trunk,continue,1)
[2010-04-20 13:58:59] DEBUG[15134] app_macro.c: Executed application: Goto
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Executing [continue@macro-dialout-trunk:1] GotoIf("SIP/519-b67e5018", "1?noreport") in new stack
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Goto (macro-dialout-trunk,continue,3)
[2010-04-20 13:58:59] DEBUG[15134] app_macro.c: Executed application: GotoIf
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Executing [continue@macro-dialout-trunk:3] NoOp("SIP/519-b67e5018", "TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 0 - failing through to other trunks") in new stack
[2010-04-20 13:58:59] DEBUG[15134] app_macro.c: Executed application: Noop
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Executing [continue@macro-dialout-trunk:4] Set("SIP/519-b67e5018", "CALLERID(number)=519") in new stack
[2010-04-20 13:58:59] DEBUG[15134] app_macro.c: Executed application: Set
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Executing [0296051135@from-internal:5] Macro("SIP/519-b67e5018", "outisbusy|") in new stack
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Executing [s@macro-outisbusy:1] Progress("SIP/519-b67e5018", "") in new stack
[2010-04-20 13:58:59] DEBUG[15134] app_macro.c: Executed application: Progress
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Executing [s@macro-outisbusy:2] GotoIf("SIP/519-b67e5018", "0?emergency|1") in new stack
[2010-04-20 13:58:59] DEBUG[15134] app_macro.c: Executed application: GotoIf
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Executing [s@macro-outisbusy:3] GotoIf("SIP/519-b67e5018", "0?intracompany|1") in new stack
[2010-04-20 13:58:59] DEBUG[15134] app_macro.c: Executed application: GotoIf
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Executing [s@macro-outisbusy:4] Playback("SIP/519-b67e5018", "all-circuits-busy-now&pls-try-call-later| noanswer") in new stack
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Playing 'all-circuits-busy-now' (language 'au')
[2010-04-20 13:59:01] VERBOSE[15134] logger.c: -- Playing 'pls-try-call-later' (language 'au')
[2010-04-20 13:59:03] DEBUG[15134] app_macro.c: Executed application: Playback
[2010-04-20 13:59:03] VERBOSE[15134] logger.c: -- Executing [s@macro-outisbusy:5] Congestion("SIP/519-b67e5018", "20") in new stack
[2010-04-20 13:59:03] VERBOSE[15134] logger.c: == Spawn extension (macro-outisbusy, s, 5) exited non-zero on 'SIP/519-b67e5018' in macro 'outisbusy'
[2010-04-20 13:59:03] VERBOSE[15134] logger.c: == Spawn extension (macro-outisbusy, s, 5) exited non-zero on 'SIP/519-b67e5018'

regards

Craig


This is in your log

mickecarlsson's picture

This is in your log file:
"Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 0"
It seems that your provider does not report back anything useful or that your PRI card is not detecting it.


__________________

Mikael Carlsson
(I am off-line, tinkering with my Chevy and my radios, don't know when I will be back)


I could accept that except

curto's picture

This system has been implemented as a replacement for an Asterisk 1.4 system (commandline driven), it is running on the same hardware (PRI card etc) to the same providers and we did not have this issue then.

I will bypass our LCR routing and see what the call logs tell us from there.

regards

Craig


you are running this through

p_lindheimer's picture

you are running this through a custom trunk and thus some custom dialplan.

That equates to spawning a new Local channel which is similar to calling a function in programming terms.

I suspect that the HANGUPCAUSE, if being set, may very likely not be 'passed back' to the initiating channel just like a local variable would not be since it occurs within the new spawned channel and a failure would end up back here where it was called.

However ... from the looks of the trace, it appears that the failure is that there is no such Local channel which is resulting in the CHANUNAVAIL. So check your dialplan. If it were hitting your custom trunk code, you would see it executed in the log above.


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


It is definitely getting to the custom trunk

curto's picture

Phillipe, You can see where the 1434 is appended to the outgoing number - this is the function of the custom trunk

All of our normal calls are working and going out the way we expect it is only when we hit an incorrect number or engaged etc that we are getting this issue

[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Called 14340296051135@LCR-Gotalk
[2010-04-20 13:58:58] VERBOSE[15134] logger.c: -- Local/14340296051135@LCR-Gotalk-3a09,1 is ringing
[2010-04-20 13:58:59] VERBOSE[15134] logger.c: -- Local/14340296051135@LCR-Gotalk-3a09,1 stopped

So we dial the number 0296051135, our outbound route matches this and sends it to our custom trunk, which appends the 1434 at the front and then pumps it out through the ZAP group on the Pri (single group only)

Our Custom trunk code is pretty straight forward

;Use this section for Least Cost Routing
[LCR-Gotalk]
exten => _X.,1,Dial(ZAP/g0/${EXTEN},120,tr)
exten => _X.,2,Hangup

[LCR-International]
exten => _X.,1,Dial(ZAP/g0/${EXTEN},120,tr)
exten => _X.,2,Hangup

[LCR-Primus]
exten => _X.,1,Dial(ZAP/g0/${EXTEN},120,tr)
exten => _X.,2,Hangup

[LCR-Bypass]
exten => _X.,1,Dial(ZAP/g0/${EXTEN},120,tr)
exten => _X.,2,Hangup

This is included in the extensions_custom.conf file

and in the outbound trunk all we have in the string is

Local/$OUTNUM$@LCR-Gotalk

regards

Craig


OK some more info on this

curto's picture

I have changed around the custom trunks and outbound routes for testing today and have received the correct error codes as per the log below

l-4477,2", "0?customtrunk") in new stack
[2010-04-21 17:20:51] VERBOSE[26785] logger.c: -- Executing [s@macro-dialout-trunk:19] Dial("Local/98826559@from-internal-
4477,2", "ZAP/g0/143498826559|300|") in new stack
[2010-04-21 17:20:51] VERBOSE[26785] logger.c: -- Called g0/143498826559
[2010-04-21 17:20:51] VERBOSE[26785] logger.c: -- Zap/1-1 is proceeding passing it to Local/98826559@from-internal-4477,2
[2010-04-21 17:20:51] VERBOSE[26784] logger.c: -- Local/98826559@from-internal-4477,1 is proceeding passing it to Zap/10-1
[2010-04-21 17:20:54] VERBOSE[26785] logger.c: -- Executing [s@macro-dialout-trunk:20] NoOp("Local/98826559@from-internal-
4477,2", "Dial failed for some reason with DIALSTATUS = BUSY and HANGUPCAUSE = 17") in new stack
[2010-04-21 17:20:54] VERBOSE[26785] logger.c: -- Executing [s@macro-dialout-trunk:21] Goto("Local/98826559@from-internal-
4477,2", "s-BUSY|1") in new stack
[2010-04-21 17:20:54] VERBOSE[26785] logger.c: -- Executing [s-BUSY@macro-dialout-trunk:1] NoOp("Local/98826559@from-inter
nal-4477,2", "Dial failed due to trunk reporting BUSY - giving up") in new stack
[2010-04-21 17:20:54] VERBOSE[26785] logger.c: -- Executing [s-BUSY@macro-dialout-trunk:2] PlayTones("Local/98826559@from-
internal-4477,2", "busy") in new stack
[2010-04-21 17:20:54] VERBOSE[26785] logger.c: -- Executing [s-BUSY@macro-dialout-trunk:3] Busy("Local/98826559@from-inter
nal-4477,2", "20") in new stack
[2010-04-21 17:20:54] VERBOSE[26784] logger.c: -- Local/98826559@from-internal-4477,1 is busy
[2010-04-21 17:20:54] VERBOSE[26784] logger.c: -- Executing [98826559@disa-dial:3] Gosub("Zap/10-1", "s-BUSY|1") in new st
ack
[2010-04-21 17:20:54] VERBOSE[26785] logger.c: == Spawn extension (macro-dialout-trunk, s-BUSY, 3) exited non-zero on 'Local
/98826559@from-internal-4477,2' in macro 'dialout-trunk'
[2010-04-21 17:20:54] VERBOSE[26785] logger.c: == Spawn extension (macro-dialout-trunk, s-BUSY, 3) exited non-zero on 'Local
/98826559@from-internal-4477,2'
[2010-04-21 17:20:54] VERBOSE[26785] logger.c: -- Executing [h@macro-dialout-trunk:1] Macro("Local/98826559@from-internal-
4477,2", "hangupcall|") in new stack
[2010-04-21 17:20:54] VERBOSE[26785] logger.c: -- Executing [s@macro-hangupcall:1] GotoIf("Local/98826559@from-internal-44
77,2", "1?skiprg") in new stack
[2010-04-21 17:20:54] VERBOSE[26785] logger.c: -- Executing [s@macro-hangupcall:4] GotoIf("Local/98826559@from-internal-44
77,2", "1?skipblkvm") in new stack
[2010-04-21 17:20:54] VERBOSE[26785] logger.c: -- Executing [s@macro-hangupcall:7] GotoIf("Local/98826559@from-internal-44
77,2", "1?theend") in new stack
[2010-04-21 17:20:54] VERBOSE[26785] logger.c: -- Executing [s@macro-hangupcall:9] Hangup("Local/98826559@from-internal-44
77,2", "") in new stack
[2010-04-21 17:20:54] VERBOSE[26785] logger.c: == Spawn extension (macro-hangupcall, s, 9) exited non-zero on 'Local/9882655
9@from-internal-4477,2' in macro 'hangupcall'
[2010-04-21 17:20:54] VERBOSE[26785] logger.c: == Spawn extension (macro-hangupcall, s, 9) exited non-zero on 'Local/9882655
9@from-internal-4477,2'
root@asterisk2:/var/log/asterisk $

So it seems that FreePBX is doing what it is meant to do as is our PRI and Service provider.

The issue we have now is that we need to be able to have the following

1) Multiple Outbound Routes going out the same physical trunk (Zap/g0) but with different codes appended to the front to perform Least Cost Routing

We were using the code in the previous posts to do this but obviously this appears to be interfering with the ISDN return codes to FreepBX in some fashion through the use of Custom Trunks.

Can anyone see a way for us to do this and still keep the ISDN status codes flowing through correctly ?

regards

Craig


Version 2.8 will let you

p_lindheimer's picture

Version 2.8 will let you prepend digits at the route level. You could have multiple routes prepending as needed but all sending to the same trunk.

Version 2.8 is in beta right now so that may not be an option. Otherwise you can write some dialplan that hooks the predial macro in dialout-trunk to change the number being dialed.


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


2.8 will not be an option for a while

curto's picture

We would have to go through a heap of testing as we use UNISTIM extensively.

We have contracted support with you guys, i will raise a ticket to get the custom diaplan stuff written as i would not know where to start on that.

regards
Craig


I can understand needing to

p_lindheimer's picture

I can understand needing to test.

As far as UNISTIM is concerned though, it should not make a difference given that any UNISTIM stuff is all custom anyhow and FreePBX should not be messing with it or doing anything that was change what you may have done.


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


only 1 call on pri

jaisingh's picture

I have a similar issue, it seems that if channel 1 is being used on the pri freepbx does not know that there are channels 2-23 available and gives me back a channel unavailable message.


jaisingh, sounds like a

p_lindheimer's picture

jaisingh,

sounds like a mis-configuration.

Make sure you have a proper zap/dahdi group configured that includes all the channels you want as part of that group (usually 1-23) and then use that as your trunk. And leave the max calls blank since it is automatic in the case of zap/dahdi.


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


configuration details

jaisingh's picture

the pri is setup as -

chan_dahdi_custom.conf :

signalling=pri_cpe
callerid=asreceived
context=from-pstn
channel => 1-23
group=1

in FreePBX trunk config :

from extensions_additonal.conf

OUT_1 = DAHDI/g1

the UI shows zap/g1

I can receive multiple in bound calls, but can only make 1 outbound calls on the PRI (this issues does not exist on sip trunks for me)

thanks

Jai


I would suggest that you may

p_lindheimer's picture

I would suggest that you may want to open a new ticket to seek help as this had diverted from the original thread and you may end up getting many people not reading it as a result.


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


fixed

jaisingh's picture

i got it:

i changed chan_dahdi_custom.conf to:

group=1
signalling=pri_cpe
callerid=asreceived
context=from-pstn
channel => 1-23

basically moved group=1 to the top, that seemed to do the trick.

thanks

jai


could someone please help me how to do the patch

flashmemory's picture

Hi all
I have the same the problem, I don't know how to perform the patch, could someone help me please?
Thanks


This has been talked about

Firstsip's picture

This has been talked about at length in this thread and http://www.freepbx.org/trac/ticket/3805 and http://www.freepbx.org/v2/ticket/1542 maybe. I have 2.9.0.7 on 1.8.3 and receive this all-circuits-busy-now&pls-try-call-later message for wrong numbers.

I have no custom trunks and have installed Route Congestion Messages. Even with a single matching Route selecting a single SIP Trunk I hear this message. Any thoughts on what I am missing? Has this broken again recently?

I am variously seeing:
TRUNK Dial failed due to CONGESTION HANGUPCAUSE: 1 - failing through to other trunks
TRUNK Dial failed due to CONGESTION HANGUPCAUSE: 21 - failing through to other trunks
TRUNK Dial failed due to CONGESTION HANGUPCAUSE: 19 - failing through to other trunks
TRUNK Dial failed due to CONGESTION HANGUPCAUSE: 38 - failing through to other trunks
TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 111 - failing through to other trunks


There is a bug in Asterisk

mickecarlsson's picture

There is a bug in Asterisk 1.8 (and 1.6.2) that set HANGUPCAUSE 111 instead of HANGUPCAUSE 28 when trunk reports SIP 484.

In FreePBX we detect HANGUPCAUSE=28 for INVALID NUMBER, but as Asterisk now send HANGUPCAUSE=111 it will fail.

There is a ticket open (by me) over at Asterisk Issue Tracker: https://issues.asterisk.org/jira/browse/ASTERISK-17288


__________________

Mikael Carlsson
(I am off-line, tinkering with my Chevy and my radios, don't know when I will be back)


Languishing issue

Firstsip's picture

I see, thanks. That's languishing somewhat...

It's causing my call centre staff to distrust the PBX. If Route Congestion Messages was extended to include selectable HANGUPCAUSE, or specifically 111, we would have a work around perhaps?

Any recommended workarounds peeps? Would I be better hacking Macro outisbusy perhaps, or use something like http://www.freepbx.org/forum/freepbx/users/handling-of-hangupcause-1-whe...


There will be no workaround

mickecarlsson's picture

There will be no workaround in FreePBX for a bug in Asterisk.
You could register at the asterisk issue site and add a remark to the ticket asking when it will be fixed.


__________________

Mikael Carlsson
(I am off-line, tinkering with my Chevy and my radios, don't know when I will be back)


"all-circuits-busy-now&pls-try-call-later| noanswer"

mummuluri's picture

Hello Team,

I am facing the the problem with while adding second trunk to the asterisk box.
I need to configure three server's which are in diffrent location. Unfortunatly while adding third server trunk, i am getting "all-circuits-busy-now&pls-try-call-later| noanswer" from main Box. From the second box I can able to make calls to main box.

From Main Box Cli.....

-- Executing [37012@from-internal:1] Macro("SIP/33666-b775d9e0", "user-callerid|LIMIT|") in new stack
-- Executing [s@macro-user-callerid:1] Set("SIP/33666-b775d9e0", "AMPUSER=33666") in new stack
-- Executing [s@macro-user-callerid:2] GotoIf("SIP/33666-b775d9e0", "0?report") in new stack
-- Executing [s@macro-user-callerid:3] ExecIf("SIP/33666-b775d9e0", "1|Set|REALCALLERIDNUM=33666") in new stack
-- Executing [s@macro-user-callerid:4] Set("SIP/33666-b775d9e0", "AMPUSER=33666") in new stack
-- Executing [s@macro-user-callerid:5] Set("SIP/33666-b775d9e0", "AMPUSERCIDNAME=Kiran Mummuluri") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("SIP/33666-b775d9e0", "0?report") in new stack
-- Executing [s@macro-user-callerid:7] Set("SIP/33666-b775d9e0", "AMPUSERCID=33666") in new stack
-- Executing [s@macro-user-callerid:8] Set("SIP/33666-b775d9e0", "CALLERID(all)="Kiran Mummuluri" <33666>") in new stack
-- Executing [s@macro-user-callerid:9] GotoIf("SIP/33666-b775d9e0", "0?limit") in new stack
-- Executing [s@macro-user-callerid:10] ExecIf("SIP/33666-b775d9e0", "1|Set|GROUP(concurrency_limit)=33666") in new stack
-- Executing [s@macro-user-callerid:11] ExecIf("SIP/33666-b775d9e0", "0|Set|CHANNEL(language)=") in new stack
-- Executing [s@macro-user-callerid:12] GotoIf("SIP/33666-b775d9e0", "1?continue") in new stack
-- Goto (macro-user-callerid,s,25)
-- Executing [s@macro-user-callerid:25] Set("SIP/33666-b775d9e0", "CALLERID(number)=33666") in new stack
-- Executing [s@macro-user-callerid:26] Set("SIP/33666-b775d9e0", "CALLERID(name)=Kiran Mummuluri") in new stack
-- Executing [37012@from-internal:2] Set("SIP/33666-b775d9e0", "INTRACOMPANYROUTE=YES") in new stack
-- Executing [37012@from-internal:3] Set("SIP/33666-b775d9e0", "MOHCLASS=default") in new stack
-- Executing [37012@from-internal:4] Set("SIP/33666-b775d9e0", "_NODEST=") in new stack
-- Executing [37012@from-internal:5] Macro("SIP/33666-b775d9e0", "record-enable|33666|OUT|") in new stack
-- Executing [s@macro-record-enable:1] GotoIf("SIP/33666-b775d9e0", "1?check") in new stack
-- Goto (macro-record-enable,s,4)
-- Executing [s@macro-record-enable:4] ExecIf("SIP/33666-b775d9e0", "0|MacroExit|") in new stack
-- Executing [s@macro-record-enable:5] GotoIf("SIP/33666-b775d9e0", "0?Group:OUT") in new stack
-- Goto (macro-record-enable,s,14)
-- Executing [s@macro-record-enable:14] GotoIf("SIP/33666-b775d9e0", "0?IN") in new stack
-- Executing [s@macro-record-enable:15] ExecIf("SIP/33666-b775d9e0", "0|MacroExit|") in new stack
-- Executing [s@macro-record-enable:16] Set("SIP/33666-b775d9e0", "CALLFILENAME=OUT33666-20110701-124844-1309538924.33309") in new stack
-- Executing [s@macro-record-enable:17] Goto("SIP/33666-b775d9e0", "record") in new stack
-- Goto (macro-record-enable,s,20)
-- Executing [s@macro-record-enable:20] MixMonitor("SIP/33666-b775d9e0", "OUT33666-20110701-124844-1309538924.33309.wav||") in new stack
-- Executing [s@macro-record-enable:21] MacroExit("SIP/33666-b775d9e0", "") in new stack
== Begin MixMonitor Recording SIP/33666-b775d9e0
-- Executing [37012@from-internal:6] Macro("SIP/33666-b775d9e0", "dialout-trunk|4|37012|") in new stack
-- Executing [s@macro-dialout-trunk:1] Set("SIP/33666-b775d9e0", "DIAL_TRUNK=4") in new stack
-- Executing [s@macro-dialout-trunk:2] GosubIf("SIP/33666-b775d9e0", "0?sub-pincheck|s|1") in new stack
-- Executing [s@macro-dialout-trunk:3] GotoIf("SIP/33666-b775d9e0", "0?disabletrunk|1") in new stack
-- Executing [s@macro-dialout-trunk:4] Set("SIP/33666-b775d9e0", "DIAL_NUMBER=37012") in new stack
-- Executing [s@macro-dialout-trunk:5] Set("SIP/33666-b775d9e0", "DIAL_TRUNK_OPTIONS=tr") in new stack
-- Executing [s@macro-dialout-trunk:6] Set("SIP/33666-b775d9e0", "OUTBOUND_GROUP=OUT_4") in new stack
-- Executing [s@macro-dialout-trunk:7] GotoIf("SIP/33666-b775d9e0", "1?nomax") in new stack
-- Goto (macro-dialout-trunk,s,9)
-- Executing [s@macro-dialout-trunk:9] GotoIf("SIP/33666-b775d9e0", "1?skipoutcid") in new stack
-- Goto (macro-dialout-trunk,s,12)
-- Executing [s@macro-dialout-trunk:12] GosubIf("SIP/33666-b775d9e0", "1?sub-flp-4|s|1") in new stack
-- Executing [s@sub-flp-4:1] ExecIf("SIP/33666-b775d9e0", "1|Return|") in new stack
-- Executing [s@macro-dialout-trunk:13] Set("SIP/33666-b775d9e0", "OUTNUM=37012") in new stack
-- Executing [s@macro-dialout-trunk:14] Set("SIP/33666-b775d9e0", "custom=IAX2/Server2") in new stack
-- Executing [s@macro-dialout-trunk:15] ExecIf("SIP/33666-b775d9e0", "0|Set|DIAL_TRUNK_OPTIONS=M(setmusic^default)tr") in new stack
-- Executing [s@macro-dialout-trunk:16] ExecIf("SIP/33666-b775d9e0", "0|Set|DIAL_TRUNK_OPTIONS=trM(confirm)") in new stack
-- Executing [s@macro-dialout-trunk:17] Macro("SIP/33666-b775d9e0", "dialout-trunk-predial-hook|") in new stack
-- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("SIP/33666-b775d9e0", "") in new stack
-- Executing [s@macro-dialout-trunk:18] GotoIf("SIP/33666-b775d9e0", "0?bypass|1") in new stack
-- Executing [s@macro-dialout-trunk:19] GotoIf("SIP/33666-b775d9e0", "0?customtrunk") in new stack
-- Executing [s@macro-dialout-trunk:20] Dial("SIP/33666-b775d9e0", "IAX2/Server2/37012|300|tr") in new stack
-- Called Server2/37012
-- Hungup 'IAX2/Server2-7683'
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [s@macro-dialout-trunk:21] NoOp("SIP/33666-b775d9e0", "Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 0") in new stack
-- Executing [s@macro-dialout-trunk:22] Goto("SIP/33666-b775d9e0", "s-CHANUNAVAIL|1") in new stack
-- Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
-- Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] Set("SIP/33666-b775d9e0", "RC=0") in new stack
-- Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto("SIP/33666-b775d9e0", "0|1") in new stack
-- Goto (macro-dialout-trunk,0,1)
-- Executing [0@macro-dialout-trunk:1] Goto("SIP/33666-b775d9e0", "continue|1") in new stack
-- Goto (macro-dialout-trunk,continue,1)
-- Executing [continue@macro-dialout-trunk:1] GotoIf("SIP/33666-b775d9e0", "1?noreport") in new stack
-- Goto (macro-dialout-trunk,continue,3)
-- Executing [continue@macro-dialout-trunk:3] NoOp("SIP/33666-b775d9e0", "TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 0 - failing through to other trunks") in new stack
-- Executing [continue@macro-dialout-trunk:4] Set("SIP/33666-b775d9e0", "CALLERID(number)=33666") in new stack
-- Executing [37012@from-internal:7] Macro("SIP/33666-b775d9e0", "outisbusy|") in new stack
-- Executing [s@macro-outisbusy:1] Progress("SIP/33666-b775d9e0", "") in new stack
-- Executing [s@macro-outisbusy:2] GotoIf("SIP/33666-b775d9e0", "0?emergency|1") in new stack
-- Executing [s@macro-outisbusy:3] GotoIf("SIP/33666-b775d9e0", "1?intracompany|1") in new stack
-- Goto (macro-outisbusy,intracompany,1)
-- Executing [intracompany@macro-outisbusy:1] Playback("SIP/33666-b775d9e0", "all-circuits-busy-now&pls-try-call-later| noanswer") in new stack
-- Playing 'all-circuits-busy-now' (language 'en')


__________________

Kiran Mummuluri,
US - +1-2482333666
India - 9000462221


mummuluri - Do not hijack

SkykingOH's picture

mummuluri - Do not hijack threads and change the subject of the thread

This is a well established thread. Barging in is a sure way to piss everyone off.

Make your own thread.


As this is still a problem

freddy's picture

As this is still a problem in current asterisk versions I came up the following simple workaround:

To add custom HANGUPCAUSE to error handling routines add the following lines to extensions_custom.conf:
; additional HANGUPCAUSE code mappings
[macro-dialout-trunk](+)
exten => _1,1,Goto(s-INVALIDNMBR,1)
exten => _111,1,Goto(s-INVALIDNMBR,1)
exten => _19,1,Goto(s-NOANSWER,1)

If you have different HANGUPCAUSE codes, just add them.
Works for us with FreePBX 2.9.0.7/asterisk 1.8.7


Early Audio

louisMos's picture

Hi

I have much the same problem. When calling out and dialling an invalid number, we get a sip response 503 from our providor. This results in the 'All circuits are busy message’ being played and as per the other posts this causes confusion. The provider does provide an audio message detailing the problem ‘The number you have dialled does not exist’ and has advised us to enable ‘early audio’ on our PBX.

Any ideas on how to do this?

Thanks
Louis


__________________

Louis