Question

Asterisk PBX - When making an outside call, internal extension rings

Asked by: lfereday

I am running Asterisk@Home, Asterisk v1.0.9

I have a TDM11B (1FXO 1FXS).

My ZAP extension belongs to group 1, the number is 200
My ZAP trunk belongs to group 0

I also have an IAX2 extension, number 201.  When I try to call out through my PSTN (using 9 before the number), extension 200 rings.

I've discovered that if I delete extension 200 and reboot, calls through my PSTN work.  If I then add extension 200 back as a ZAP extension and do a "reload", I can still call through my PSTN.

BUT, when I reboot and try PSTN calls, extension 200 rings again.

It seems to me that this is a configuration issue, but I am a newbie and don't know where to look!

Thanks in advance.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2005-10-16 at 17:52:21ID21596971
Tags

asterisk

Topic

Voice Over IP

Participating Experts
1
Points
150
Comments
13

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Asterisk PBX Installations
    Hello everyone, Our organization is currently looking at upgrading our phone systems. We currently have 7 office sites around our state, which all have old key based phone systems. One avenue I would like to explore would be the deployment of the Open-Source Asterisk PBX s...
  2. Asterisk - split pstn line asterisk vs regular phone
    Hey, I have one pstn line thats split into 2, one goes to a regular phone and the other one goes to asterisk. When someone calls I want a SIP phone to ring along with the regular phone. I have the context for the Zap interface set correctly and everything I even see the incom...
  3. Create IVR In Asterisk?
    Hi, I have worked on asterisk a bit and created a PBX with SIP/IAX based softphones and managed to connect PSTN trunk to this PBX. Now I have a different scenrio. I have a to create a pure VoIP network with just SIP users and make an IVR. Like if suppose a SIP user dials a n...
  4. How do I connect my PBX to the PSTN (Asterisk Newbie,…
    I need to figure out rather urgantly how to configure my Asterisk server to make it send and recieve calls on the PSTN (I'm in the UK by the way), I have a zaptel card and it's plugged into the line. The FreePBX ISO I used to set up Asterisk was "PBX in a Flash" and...
  5. How to get Asterisk to pass DID info to a ZAP modem
    Hello, I currently have a working Asterisk setup using DID routing for inbound routes, which then are directed to ZAP devices via a Rhino Channel Bank.. The problem that I am having is that one endpoint needs to have the DID info in order to perform it's own rule set. Provi...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: ripariusPosted on 2005-10-17 at 06:54:28ID: 15099365

There is a quirk in the zaptel driver loading as I recall.... The order in which the wcfxs and wcfxo are loaded can reverse the zap/1 and zap/2 assignments in your dialplan.   Here is the reference from VOIP-Info.org

"If you had just the Wildcard X100P installed in your computer, you would be first loading the zaptel module, then the wcfxo module (and then running the ztcfg program). Your Wildcard X100P would show up as Zap/1. If you bought and installed a Wildcard TDM400P with modules FXO,FXO,FXS,FXS plugged into it, you would also need to load the wcfxs kernel module driver for this card (somewhat confusingly, it handles both the FXO and the FXS modules installed on the Wildcard TDM400P). If you load your kernel modules in the order zaptel, wcfxo, wcfxs, then your Wiildcard X100P interface will be Zap/1, and your Wildcard TDM400P interfaces will be Zap/2 through to Zap/5. If, on the other hand, you load your kernel modules in the order zaptel, wcfxs, wcfxo, then your Wildcard TDM400P interfaces will be Zap/1 through to Zap/4, and your Wildcard X100P interface will be Zap/5, and you would need to change your dialplan (extensions.conf) accordingly. "


Could you post the output of "ztcfg -vvvv" ?  that will show the asignments.

Also, do you get dialtone on the zap extension? what happens if you try to dial  out from it? (if not..it is could be the fxs/fxo reversal above)

Is your dial plan different for the two extensions?   If you could post  /etc/asterisk/extensions.conf it would help.

 

by: lferedayPosted on 2005-10-17 at 07:30:22ID: 15099758

Here is the output pf ztcfg -vvvv:

Zaptel Configuration
======================


Channel map:

Channel 01: FXO Kewlstart (Default) (Slaves: 01)
Channel 04: FXS Kewlstart (Default) (Slaves: 04)

2 channels configured.

I do get a dialtone on the zap extension, and if I try to dial out, it works.  It can call internally and externally.

Here is my extensions.conf:

; Asterisk Management Portal (AMP)
; Copyright (C) 2004 Coalescent Systems Inc

; dialparties.agi (http://www.sprackett.com/asterisk/)
; Asterisk::AGI (http://asterisk.gnuinter.net/)
; gsm (http://www.ibiblio.org/pub/Linux/utils/compress/!INDEX.short.html)
; loligo sounds (http://www.loligo.com/asterisk/sounds/)
; mpg123 (http://voip-info.org/wiki-Asterisk+config+musiconhold.conf)


; include extension contexts generated from AMP
#include extensions_additional.conf

; Customizations to this dialplan should be made in extensions_custom.conf
; See extensions_custom.conf.sample for an example
#include extensions_custom.conf

[from-trunk]                                          ; just an alias since VoIP shouldn't be called PSTN
include => from-pstn

[from-pstn]
include => from-pstn-custom                     ; create this context in extensions_custom.conf to include customizations
include => ext-did
include => from-pstn-timecheck          ; this has to be included otherwise it overrides ext-did

[from-pstn-timecheck]
exten => .,1,Goto(s,1)            ; catch-all matching for calls that have DID info (if a DID route hasn't matched them)
exten => s,1,GotoIf($[${IN_OVERRIDE} = forcereghours]?from-pstn-reghours,s,1:)
exten => s,2,GotoIf($[${IN_OVERRIDE} = forceafthours]?from-pstn-afthours,s,1:)
exten => s,3,GotoIfTime(${REGTIME}|${REGDAYS}|*|*?from-pstn-reghours,s,1:)
exten => s,4,Goto(from-pstn-afthours,s,1)

[from-pstn-reghours]
exten => s,1,GotoIf($[${FAX_RX} = disabled]?from-pstn-reghours-nofax,s,1:2)      ; if fax detection is disabled, then jump to from-pstn-nofax - else continue
exten => s,2,Answer      
exten => s,3,Wait(1)
exten => s,4,SetVar(intype=${INCOMING})
exten => s,5,Cut(intype=intype,-,1)
exten => s,6,GotoIf($[${intype} = EXT]?7:9)            ; If INCOMING starts with EXT, then assume its an extension
exten => s,7,Wait(3)                                           ;wait 3 more second to make sure this isn't a fax before dialing someone
exten => s,8,Goto(ext-local,${INCOMING:4},1)
exten => s,9,GotoIf($[${intype} = GRP]?10:12)       ; If INCOMING starts with GRP, then assume its a ring group
exten => s,10,Wait(3)
exten => s,11,Goto(ext-group,${INCOMING:4},1)
exten => s,12,GotoIf($[${intype} = QUE]?13:15)
exten => s,13,Wait(3)
exten => s,14,Goto(ext-queues,${INCOMING:4},1)
exten => s,15,Goto(${INCOMING},s,1)                   ; not EXT or GR1 - it's an auto attendant
exten => fax,1,Goto(ext-fax,in_fax,1)
exten => h,1,Hangup

[from-pstn-reghours-nofax]
exten => s,1,SetVar(intype=${INCOMING})
exten => s,2,Cut(intype=intype,-,1)
exten => s,3,GotoIf($[${intype} = EXT]?4:5)            ; If INCOMING starts with EXT, then assume its an extension
exten => s,4,Goto(ext-local,${INCOMING:4},1)
exten => s,5,GotoIf($[${intype} = GRP]?6:7)       ; If INCOMING starts with GRP, then assume its a ring group
exten => s,6,Goto(ext-group,${INCOMING:4},1)
exten => s,7,GotoIf($[${intype} = QUE]?8:11) ;queue
exten => s,8,Answer                                            ; answer call before queue
exten => s,9,Wait(1)
exten => s,10,Goto(ext-queues,${INCOMING:4},1)
exten => s,11,Answer                                            ; answer call before auto attendant
exten => s,12,Wait(1)                                          
exten => s,13,Goto(${INCOMING},s,1)                         ; not EXT or GR1 - it's an auto attendant
exten => fax,1,Goto(ext-fax,in_fax,1)
exten => h,1,Hangup

[from-pstn-afthours]
exten => s,1,GotoIf($[${FAX_RX} = disabled]?from-pstn-afthours-nofax,s,1:2)      ; if fax detection is disabled, then jump to from-pstn-nofax - else continue
exten => s,2,Answer      
exten => s,3,Wait(1)
exten => s,4,SetVar(intype=${AFTER_INCOMING})
exten => s,5,Cut(intype=intype,-,1)
exten => s,6,GotoIf($[${intype} = EXT]?7:9)            ; If INCOMING starts with EXT, then assume its an extension
exten => s,7,Wait(3)                                           ;wait 3 more second to make sure this isn't a fax before dialing someone
exten => s,8,Goto(ext-local,${AFTER_INCOMING:4},1)
exten => s,9,GotoIf($[${intype} = GRP]?10:12)       ; If INCOMING starts with GRP, then assume its a ring group
exten => s,10,Wait(3)
exten => s,11,Goto(ext-group,${AFTER_INCOMING:4},1)
exten => s,12,GotoIf($[${intype} = QUE]?13:15)
exten => s,13,Wait(3)
exten => s,14,Goto(ext-queues,${AFTER_INCOMING:4},1)
exten => s,15,Goto(${AFTER_INCOMING},s,1)                   ; not EXT or GR1 - it's an auto attendant
exten => fax,1,Goto(ext-fax,in_fax,1)
exten => h,1,Hangup

[from-pstn-afthours-nofax]
exten => s,1,SetVar(intype=${AFTER_INCOMING})
exten => s,2,Cut(intype=intype,-,1)
exten => s,3,GotoIf($[${intype} = EXT]?4:5)            ; If INCOMING starts with EXT, then assume its an extension
exten => s,4,Goto(ext-local,${AFTER_INCOMING:4},1)
exten => s,5,GotoIf($[${intype} = GRP]?6:7)       ; If INCOMING starts with GRP, then assume its a ring group
exten => s,6,Goto(ext-group,${AFTER_INCOMING:4},1)
exten => s,7,GotoIf($[${intype} = QUE]?8:11) ;queue
exten => s,8,Answer                                            ; answer call before queue
exten => s,9,Wait(1)
exten => s,10,Goto(ext-queues,${AFTER_INCOMING:4},1)
exten => s,11,Answer                                            ; answer call before auto attendant
exten => s,12,Wait(1)                                          
exten => s,13,Goto(${AFTER_INCOMING},s,1)                         ; not EXT or GR1 - it's an auto attendant
exten => fax,1,Goto(ext-fax,in_fax,1)
exten => h,1,Hangup

; ############################################################################
; Macros [macro]
; ############################################################################

; Rings one or more extensions.  Handles things like call forwarding and DND
; We don't call dial directly for anything internal anymore.
; ARGS: $TIMER, $OPTIONS, $EXT1, $EXT2, $EXT3, ...
; Use a Macro call such as the following:
;  Macro(dial,$DIAL_TIMER,$DIAL_OPTIONS,$EXT1,$EXT2,$EXT3,...)
[macro-dial]
exten => s,1,GotoIf($[ "${MACRO_CONTEXT}" = "macro-rg-group" ]?4:2)  ; if this is from rg-group, don't strip prefix
exten => s,2,GotoIf($[${CALLERIDNAME:0:${LEN(${RGPREFIX})}} != ${RGPREFIX}]?4:3)  ; check for ring-group prefix
exten => s,3,SetCIDName(${CALLERIDNAME:${LEN(${RGPREFIX})}}) ; strip off prefix
exten => s,4,AGI,dialparties.agi
exten => s,5,NoOp(Returned from dialparties with no extensions to call)
exten => s,6,SetVar(DIALSTATUS=BUSY)
exten => s,10,Dial(${ds})                               ; dialparties will set the priority to 10 if $ds is not null
exten => s,11,Playback(the-number-u-dialed)
exten => s,12,Playback(is-curntly-unavail)
exten => s,13,Playback(goodbye)
exten => s,14,Hangup

; Ring an extension, if the extension is busy or there is no answer send it
; to voicemail
; ARGS: $VMBOX, $EXT
[macro-exten-vm]
exten => s,1,Setvar(FROMCONTEXT=exten-vm)
exten => s,2,Macro(record-enable,${ARG2},IN)
exten => s,3,Macro(dial,${RINGTIMER},${DIAL_OPTIONS},${ARG2})
exten => s,4,GotoIf($[${CHANNEL:0:5} = Local]?s-${DIALSTATUS},1) ; if the channel is Local, then do not go to voicemail.  This is primarily to avoid vm for call-forwarded extensions in ring groups
exten => s,5,GotoIf($[${ARG1} = novm]?s-${DIALSTATUS},1) ; no voicemail in use for this extension
exten => s,6,NoOp(Sending to Voicemail box ${ARG1})
exten => s,7,Macro(vm,${ARG1},${DIALSTATUS})
exten => s-BUSY,1,NoOp(Extension is reporting BUSY and has no Voicemail)
exten => s-BUSY,2,Busy()
exten => s-BUSY,3,Wait(60)
exten => s-BUSY,4,NoOp()
exten => _s-.,1,Congestion()

[macro-vm]
exten => s,1,Goto(s-${ARG2},1)
exten => s-BUSY,1,Voicemail(b${ARG1})   ; Voicemail Busy message
exten => s-BUSY,2,Hangup()
exten => _s-.,1,Voicemail(u${ARG1})     ; Voicemail Unavailable message
exten => _s-.,2,Hangup()
exten => o,1,Background(one-moment-please)      ; 0 during vm message will hangup
exten => o,2,GotoIf($["foo${FROM_DID}" = "foo"]?from-pstn,s,1:from-pstn,${FROM_DID},1)
exten => a,1,VoiceMailMain(${ARG1})
exten => a,2,Hangup

; For some reason, if I don't run setCIDname, CALLERIDNAME will be blank in my AGI
; ARGS: none
[macro-fixcid]
exten => s,1,SetCIDName(${CALLERIDNAME})

; Ring groups of phones
; ARGS: comma separated extension list
; 1 - ringtimer
; 2 - preifx
; 3 - extension list
[macro-rg-group]
exten => _s-.,1,Hangup()
exten => s,1,GotoIf($[${CALLERIDNAME:0:${LEN(${RGPREFIX})}} != ${RGPREFIX}]?3:2)  ; check for old prefix
exten => s,2,SetCIDName(${CALLERIDNAME:${LEN(${RGPREFIX})}}) ; strip off old prefix
exten => s,3,Setvar(RGPREFIX=${ARG2})  ; set new prefix
exten => s,4,SetCIDName(${RGPREFIX}${CALLERIDNAME})  ; add prefix to callerid name
exten => s,5,Setvar(RecordMethod=Group)  ; set new prefix
exten => s,6,Macro(record-enable,${MACRO_EXTEN},${RecordMethod})
exten => s,7,Macro(dial,${ARG1},${DIAL_OPTIONS},${ARG3})

;exten => s,1,GotoIf($[${CALLERIDNAME:0:${LEN(${RGPREFIX})}} != ${RGPREFIX}]?3:2)  ; check for old prefix
;exten => s,2,SetCIDName(${CALLERIDNAME:${LEN(${RGPREFIX})}}) ; strip off old prefix
;exten => s,3,Setvar(RGPREFIX=${ARG2})  ; set new prefix
;;exten => s,4,Noop(${RGPREFIX}  ${CALLERIDNAME})
;exten => s,4,SetCIDName(${RGPREFIX}${CALLERIDNAME})  ; add prefix to callerid name
;;exten => s,6,Noop(Dial group ${ARG3})
;exten => s,5,Macro(dial,${ARG1},${DIAL_OPTIONS},${ARG3})

;exten => s,1,Setvar(GRP=${GRP})   ;my original choice of variable GROUP is now overwritten by SetGroup.  Copy contents to GRP
;exten => s,2,SetGroup(${CALLERIDNUM})
;exten => s,3,Setvar(FROMCONTEXT=rg-group)
;exten => s,4,SetCIDName(${PRE}${CALLERIDNAME})
;exten => s,5,Macro(dial,${RINGTIMER},${DIAL_OPTIONS},${GRP})

;
; Outgoing channel(s) are busy ... inform the client
;
[macro-outisbusy]
exten => s,1,Playback(allison7/all-circuits-busy-now)
exten => s,2,Playback(allison7/pls-try-call-later)
exten => s,3,Macro(hangupcall)

; What to do on hangup.
[macro-hangupcall]
exten => s,1,ResetCDR(w)
exten => s,2,NoCDR()
exten => s,3,Wait(5)
exten => s,4,Hangup

[macro-faxreceive]
exten => s,1,SetVar(FAXFILE=/var/spool/asterisk/fax/${UNIQUEID}.tif)
exten => s,2,SetVar(EMAILADDR=${FAX_RX_EMAIL})
exten => s,3,rxfax(${FAXFILE})
exten => s,103,SetVar(EMAILADDR=${FAX_RX_EMAIL})
exten => s,104,Goto(3)

; dialout and strip the prefix
[macro-dialout]
exten => s,1,GotoIf($[foo${ECID${CALLERIDNUM}} = foo]?4)       ;check for CID override for exten
exten => s,2,SetCallerID(${ECID${CALLERIDNUM}})
exten => s,3,Goto(6)
exten => s,4,GotoIf($[foo${OUTCID_${ARG1}} = foo]?6)             ;check for CID override for trunk
exten => s,5,SetCallerID(${OUTCID_${ARG1}})
exten => s,6,SetVar(length=${LEN(${DIAL_OUT_${ARG1}})})
exten => s,7,Dial(${OUT_${ARG1}}/${ARG2:${length}})
exten => s,8,Congestion
exten => s,108,Macro(outisbusy)


; dialout using default OUT trunk - no prefix
[macro-dialout-default]
exten => s,1,Macro(record-enable,${CALLERIDNUM},OUT)
exten => s,2,GotoIf($[foo${ECID${CALLERIDNUM}} = foo]?5)       ;check for CID override for exten
exten => s,3,SetCallerID(${ECID${CALLERIDNUM}})
exten => s,4,Goto(7)
exten => s,5,GotoIf($[foo${OUTCID} = foo]?7)       ;check for CID override for trunk
exten => s,6,SetCallerID(${OUTCID})
exten => s,7,Dial(${OUT}/${ARG1})
exten => s,8,Congestion
exten => s,108,Macro(outisbusy)

; dialout using a trunk, using pattern matching (don't strip any prefix)
; arg1 = trunk number, arg2 = number, arg3 = route password
[macro-dialout-trunk]
exten => s,1,GotoIf($[foo${ARG3} = foo]?3:2))      ; arg3 is pattern password
exten => s,2,Authenticate(${ARG3})
exten => s,3,Macro(record-enable,${CALLERIDNUM},OUT)
exten => s,4,GotoIf($[foo${ECID${CALLERIDNUM}} = foo]?7)  ;check for CID override for exten
exten => s,5,SetCallerID(${ECID${CALLERIDNUM}})
exten => s,6,Goto(9)
exten => s,7,GotoIf($[foo${OUTCID_${ARG1}} = foo]?9)  ;check for CID override for trunk
exten => s,8,SetCallerID(${OUTCID_${ARG1}})
exten => s,9,SetGroup(OUT_${ARG1})
exten => s,10,CheckGroup(${OUTMAXCHANS_${ARG1}})
; if we've used up the max channels, continue at 109 (n+101)
exten => s,11,SetVar(DIAL_NUMBER=${ARG2})
exten => s,12,SetVar(DIAL_TRUNK=${ARG1})
exten => s,13,AGI(fixlocalprefix) ; this sets DIAL_NUMBER to the proper dial string for this trunk
exten => s,14,SetVar(OUTNUM=${OUTPREFIX_${ARG1}}${DIAL_NUMBER})  ; OUTNUM is the final dial number
exten => s,15,Cut(custom=OUT_${ARG1},:,1)  ; Custom trunks are prefixed with "AMP:"
exten => s,16,GotoIf($[${custom} = AMP]?19)
exten => s,17,Dial(${OUT_${ARG1}}/${OUTNUM})  ; Regular Trunk Dial
exten => s,18,Goto(s-${DIALSTATUS},1)

; This is a custom trunk.  Substitute $OUTNUM$ with the actual number and rebuild the dialstring
; example trunks: "AMP:CAPI/XXXXXXXX:b$OUTNUM$,30,r", "AMP:OH323/$OUTNUM$@XX.XX.XX.XX:XXXX"
exten => s,19,Cut(pre_num=OUT_${ARG1},$,1)
exten => s,20,Cut(the_num=OUT_${ARG1},$,2)  ; this is where we expect to find string OUTNUM
exten => s,21,Cut(post_num=OUT_${ARG1},$,3)
exten => s,22,GotoIf($[${the_num} = OUTNUM]?23:24) ; if we didn't find "OUTNUM", then skip to Dial
exten => s,23,SetVar(the_num=${OUTNUM}) ; replace "OUTNUM" with the actual number to dial
exten => s,24,Dial(${pre_num:4}${the_num}${post_num})
exten => s,25,Goto(s-${DIALSTATUS},1)

exten => s,111,Noop(max channels used up)
exten => s-BUSY,1,NoOp(Trunk is reporting BUSY)
exten => s-BUSY,2,Busy()
exten => s-BUSY,3,Wait(60)
exten => s-BUSY,4,NoOp()

exten => _s-.,1,NoOp(Dial failed due to ${DIALSTATUS})

; Adds a dynamic agent/member to a Queue
; Prompts for call-back number - in not entered, uses CIDNum
[macro-agent-add]
exten => s,1,Wait(1)
exten => s,2,NoOp
exten => s,3,Read(CALLBACKNUM,agent-user)        ; get callback number from user
exten => s,4,GotoIf($[foo${CALLBACKNUM} = foo]?5:7))      ; if user just pressed # or timed out, use cidnum
exten => s,5,SetVar(CALLBACKNUM=${CALLERIDNUM})
exten => s,6,GotoIf($[foo${CALLBACKNUM} = foo]?2))      ; if still no number, start over
exten => s,7,GotoIf($[foo${ARG2} = foo]?9:8))      ; arg2 is queue password
exten => s,8,Authenticate(${ARG2})
exten => s,9,AddQueueMember(${ARG1}|Local/${CALLBACKNUM}@from-internal)      ; using chan_local allows us to have agents over trunks
exten => s,10,Wait(1)
exten => s,11,Playback(agent-loginok)
exten => s,12,Hangup()

; Removes a dynamic agent/member from a Queue
; Prompts for call-back number - in not entered, uses CIDNum
[macro-agent-del]
exten => s,1,Wait(1)
exten => s,2,NoOp
exten => s,3,Read(CALLBACKNUM,agent-user)        ; get callback number from user
exten => s,4,GotoIf($[foo${CALLBACKNUM} = foo]?5:7))      ; if user just pressed # or timed out, use cidnum
exten => s,5,SetVar(CALLBACKNUM=${CALLERIDNUM})
exten => s,6,GotoIf($[foo${CALLBACKNUM} = foo]?2))      ; if still no number, start over
exten => s,7,RemoveQueueMember(${ARG1}|Local/${CALLBACKNUM}@from-internal)
exten => s,8,Wait(1)
exten => s,9,Playback(agent-loggedoff)
exten => s,10,Hangup()

; arg1 = trunk number, arg2 = number
[macro-dialout-enum]
exten => s,1,Macro(record-enable,${CALLERIDNUM},OUT)
exten => s,2,GotoIf($[foo${ECID${CALLERIDNUM}} = foo]?3)        ;check for CID override for exten
exten => s,3,SetCallerID(${ECID${CALLERIDNUM}})
exten => s,4,Goto(7)
exten => s,5,GotoIf($[foo${OUTCID_${ARG1}} = foo]?7)            ;check for CID override for trunk
exten => s,6,SetCallerID(${OUTCID_${ARG1}})
exten => s,7,SetGroup(OUT_${ARG1})
exten => s,8,CheckGroup(${OUTMAXCHANS_${ARG1}})            ; if we've used up the max channels, continue at 108 (n+101)
exten => s,9,SetVar(DIAL_NUMBER=${ARG2})
exten => s,10,SetVar(DIAL_TRUNK=${ARG1})
exten => s,11,AGI(fixlocalprefix)                                     ; this sets DIAL_NUMBER to the proper dial string for this trunk
exten => s,12,EnumLookup(${DIAL_NUMBER})
exten => s,13,GotoIf($[$[${ENUM:0:3} = SIP] | $[${ENUM:0:3} = IAX]]?14:63)
exten => s,14,Dial(${ENUM})
exten => s,15,Goto(s-${DIALSTATUS},1)
; if dial fails (ie, all channels are busy), continue at 116 (n+101)

; exit points for macro
exten => s,63,NoOp(EnumLookup failed)
exten => s,109,NoOp(max channels used up)

exten => s-BUSY,1,NoOp(Trunk is reporting BUSY)
exten => s-BUSY,2,Busy()
exten => s-BUSY,3,Wait(60)
exten => s-BUSY,4,NoOp()

exten => _s-.,1,NoOp(Dial failed due to ${DIALSTATUS})

[macro-record-enable]
exten => s,1,GotoIf(${LEN(${BLINDTRANSFER})} > 0?2:4)
exten => s,2,ResetCDR(w)
exten => s,3,StopMonitor()
exten => s,4,GotoIf($["${ARG2}" = "OUT"]?5:8)
exten => s,5,DBGet(RecEnable=RECORD-OUT/${ARG1})
exten => s,6,SetVar(CALLFILENAME=OUT${ARG1}-${TIMESTAMP}-${UNIQUEID})
exten => s,7,Goto(s,14)
exten => s,8,GotoIf($["${ARG2}" = "Group"]?9:12)
exten => s,9,AGI(recordingcheck)
exten => s,10,SetVar(CALLFILENAME=g${ARG1}-${TIMESTAMP}-${UNIQUEID})
exten => s,11,Goto(s,14)
exten => s,12,DBGet(RecEnable=RECORD-IN/${ARG1})
exten => s,13,SetVar(CALLFILENAME=${TIMESTAMP}-${UNIQUEID})
exten => s,14,GotoIf($["${RecEnable}" = "ENABLED"]?15:99)
exten => s,15,Monitor(wav49,${CALLFILENAME}, mb)
exten => s,99,Noop(NO RECORDING NEEDED)
;exten => s,3,BackGround(for-quality-purposes)
;exten => s,4,BackGround(this-call-may-be)
;exten => s,5,BackGround(recorded)

; This macro is for dev purposes and just dumps channel/app variables.  Useful when designing new contexts.
[macro-dumpvars]
exten => s,1,Noop(ACCOUNTCODE=${ACCOUNTCODE})
exten => s,2,Noop(ANSWEREDTIME=${ANSWEREDTIME})
exten => s,3,Noop(BLINDTRANSFER=${BLINDTRANSFER})
exten => s,4,Noop(CALLERID=${CALLERID})
exten => s,5,Noop(CALLERIDNAME=${CALLERIDNAME})
exten => s,6,Noop(CALLERIDNUM=${CALLERIDNUM})
exten => s,7,Noop(CALLINGPRES=${CALLINGPRES})
exten => s,8,Noop(CHANNEL=${CHANNEL})
exten => s,9,Noop(CONTEXT=${CONTEXT})
exten => s,10,Noop(DATETIME=${DATETIME})
exten => s,11,Noop(DIALEDPEERNAME=${DIALEDPEERNAME})
exten => s,12,Noop(DIALEDPEERNUMBER=${DIALEDPEERNUMBER})
exten => s,13,Noop(DIALEDTIME=${DIALEDTIME})
exten => s,14,Noop(DIALSTATUS=${DIALSTATUS})
exten => s,15,Noop(DNID=${DNID})
exten => s,16,Noop(EPOCH=${EPOCH})
exten => s,17,Noop(EXTEN=${EXTEN})
exten => s,18,Noop(HANGUPCAUSE=${HANGUPCAUSE})
exten => s,19,Noop(INVALID_EXTEN=${INVALID_EXTEN})
exten => s,20,Noop(LANGUAGE=${LANGUAGE})
exten => s,21,Noop(MEETMESECS=${MEETMESECS})
exten => s,22,Noop(PRIORITY=${PRIORITY})
exten => s,23,Noop(RDNIS=${RDNIS})
exten => s,24,Noop(SIPDOMAIN=${SIPDOMAIN})
exten => s,25,Noop(SIP_CODEC=${SIP_CODEC})
exten => s,26,Noop(SIPCALLID=${SIPCALLID})
exten => s,27,Noop(SIPUSERAGENT=${SIPUSERAGENT})
exten => s,28,Noop(TIMESTAMP=${TIMESTAMP})
exten => s,29,Noop(TXTCIDNAME=${TXTCIDNAME})
exten => s,30,Noop(UNIQUEID=${UNIQUEID})
exten => s,31,Noop(TOUCH_MONITOR=${TOUCH_MONITOR})
exten => s,32,Noop(MACRO_CONTEXT=${MACRO_CONTEXT})
exten => s,33,Noop(MACRO_EXTEN=${MACRO_EXTEN})
exten => s,34,Noop(MACRO_PRIORITY=${MACRO_PRIORITY})


; ############################################################################
; Applications [app]
; ############################################################################
;
[app-directory]
;DIR-CONTEXT set in Digital Receptionist
exten => #,1,Wait(1)
exten => #,2,AGI(directory,${DIR-CONTEXT},ext-local,${DIRECTORY:0:1}${DIRECTORY_OPTS}o)
exten => #,3,Playback(vm-goodbye)
exten => #,4,Hangup
; *411 will access the entire directory (not just a single context)
exten => *411,1,Answer
exten => *411,2,Wait(1)
exten => *411,3,AGI(directory,general,ext-local,${DIRECTORY:0:1}${DIRECTORY_OPTS})
exten => *411,4,Playback(vm-goodbye)
exten => *411,5,Hangup
exten => h,1,Hangup
exten => o,1,GotoIf($["foo${FROM_DID}" = "foo"]?from-pstn,s,1:from-pstn,${FROM_DID},1)

[app-dnd]
exten => *78,1,Answer
exten => *78,2,Wait(1)
exten => *78,3,DBput(DND/${CALLERIDNUM}=YES)
exten => *78,4,Playback(allison7/do-not-disturb)
exten => *78,5,Playback(activated)
exten => *78,6,Macro(hangupcall)
exten => *79,1,Answer
exten => *79,2,Wait(1)
exten => *79,3,DBdel(DND/${CALLERIDNUM})
exten => *79,4,Playback(allison7/do-not-disturb)
exten => *79,5,Playback(de-activated)
exten => *79,6,Macro(hangupcall)

[app-messagecenter]
exten => *98,1,Answer
exten => *98,2,Wait(1)
exten => *98,3,VoiceMailMain(default)
exten => *98,4,Macro(hangupcall)
exten => _*98X.,1,Answer                  ; can dial *98<exten> to skip 'mailbox' prompt.  Useful for speedial.
exten => _*98X.,2,Wait(1)
exten => _*98X.,3,VoiceMailMain(${EXTEN:3}@default)
exten => _*98X.,4,Macro(hangupcall)
exten => *97,1,Answer
exten => *97,2,Wait(1)
exten => *97,3,VoicemailMain(${CALLERIDNUM}@default)
exten => *97,4,Macro(hangupcall)

[app-callwaiting]
exten => *70,1,Answer
exten => *70,2,Wait(1)
exten => *70,3,DBput(CW/${CALLERIDNUM}=ENABLED)
exten => *70,4,Playback(callwaiting)
exten => *70,5,Playback(activated)
exten => *70,6,Macro(hangupcall)
exten => *71,1,Answer
exten => *71,2,Wait(1)
exten => *71,3,DBdel(CW/${CALLERIDNUM})
exten => *71,4,Playback(callwaiting)
exten => *71,5,Playback(de-activated)
exten => *71,6,Macro(hangupcall)

[app-callforward]
; dialed call forward app - forwards calling extension
exten => _*72.,1,DBput(CF/${CALLERIDNUM}=${EXTEN:3})
exten => _*72.,2,Answer
exten => _*72.,3,Wait(1)
exten => _*72.,4,Playback(loligo/call-fwd-unconditional)
exten => _*72.,5,Playback(loligo/for)
exten => _*72.,6,Playback(loligo/extension)
exten => _*72.,7,SayDigits(${CALLERIDNUM})
exten => _*72.,8,Playback(loligo/is-set-to)
exten => _*72.,9,SayDigits(${EXTEN:3})
exten => _*72.,10,Macro(hangupcall)
; prompting call forward app - forwards entered extension
exten => *72,1,Answer
exten => *72,2,Wait(1)
exten => *72,3,BackGround(allison7/please-enter-your)
exten => *72,4,Playback(extension)
exten => *72,5,Read(fromext,then-press-pound)
exten => *72,6,Wait(1)
exten => *72,7,BackGround(ent-target-attendant)
exten => *72,8,Read(toext,then-press-pound)
exten => *72,9,Wait(1)
exten => *72,10,DBput(CF/${fromext}=${toext})
exten => *72,11,Playback(call-fwd-unconditional)
exten => *72,12,Playback(for)
exten => *72,13,Playback(extension)
exten => *72,14,SayDigits(${fromext})
exten => *72,15,Playback(is-set-to)
exten => *72,16,SayDigits(${toext})
exten => *72,17,Macro(hangupcall)
; cancels dialed extension call forward
exten => _*73.,1,DBdel(CF/${EXTEN:3})
exten => _*73.,2,Answer
exten => _*73.,3,Wait(1)
exten => _*73.,4,SayDigits(${EXTEN:3})
exten => _*73.,5,Playback(call-fwd-cancelled)
exten => _*73.,6,Macro(hangupcall)
; cancels call forward for calling extension
exten => *73,1,DBdel(CF/${CALLERIDNUM})
exten => *73,2,Answer
exten => *73,3,Wait(1)
exten => *73,4,Playback(loligo/call-fwd-cancelled)
exten => *73,5,Macro(hangupcall)
; dialed call forward on busy app - forwards calling extension when busy
exten => _*90.,1,DBput(CFB/${CALLERIDNUM}=${EXTEN:3})
exten => _*90.,2,Answer
exten => _*90.,3,Wait(1)
exten => _*90.,4,Playback(loligo/call-fwd-on-busy)
exten => _*90.,5,Playback(loligo/for)
exten => _*90.,6,Playback(loligo/extension)
exten => _*90.,7,SayDigits(${CALLERIDNUM})
exten => _*90.,8,Playback(loligo/is-set-to)
exten => _*90.,9,SayDigits(${EXTEN:3})
exten => _*90.,10,Macro(hangupcall)
; cancels call forward on busy for calling extension
exten => *91,1,DBdel(CFB/${CALLERIDNUM})
exten => *91,2,Answer
exten => *91,3,Wait(1)
exten => *91,4,Playback(call-fwd-on-busy)
exten => *91,5,Playback(de-activated)
exten => *91,6,Macro(hangupcall)
exten => h,1,Hangup

[app-calltrace]
; We can't have our timeouts or dial digits collide with other applications
; or extensions, so we build the app in pieces
exten => *69,1,Goto(app-calltrace-perform,s,1)

[app-calltrace-perform]
exten => s,1,Answer
exten => s,2,Wait(1)
exten => s,3,Background(allison7/info-about-last-call)
exten => s,4,Background(allison7/telephone-number)
exten => s,5,Dbget(lastcaller=CALLTRACE/${CALLERIDNUM})
exten => s,6,GotoIf($[${lastcaller}]?7:13)
exten => s,7,SayDigits(${lastcaller})
exten => s,8,DigitTimeout(3)
exten => s,9,ResponseTimeout(7)
exten => s,10,Background(loligo/to-call-this-number)
exten => s,11,Background(allison7/press-1)
exten => s,12,Goto(15)
exten => s,13,Playback(loligo/from-unknown-caller)
exten => s,14,Macro(hangupcall)
exten => s,15,NoOp
exten => 1,1,Goto(from-internal,${lastcaller},1);
exten => i,1,Playback(vm-goodbye)
exten => i,2,Macro(hangupcall)
exten => t,1,Playback(vm-goodbye)
exten => t,2,Macro(hangupcall)


; ############################################################################
; Inbound Contexts [from]
; ############################################################################

[from-sip-external]

;give external sip users congestion and hangup
exten => _.,1,AbsoluteTimeout(15)
exten => _.,2,Congestion
exten => _.,3,Hangup

[from-internal]
;allow phones to use applications
include => app-directory
include => app-dnd
include => app-callforward
include => app-callwaiting
include => app-messagecenter
include => app-calltrace
include => parkedcalls
include => from-internal-custom
;allow phones to dial other extensions
include => ext-fax
include => ext-local
include => ext-group
include => ext-queues
include => ext-zapbarge
include => ext-meetme
include => ext-record
include => ext-test
;allow phones to access trunks
include => outbound-allroutes
exten => s,1,Macro(hangupcall)
exten => h,1,Macro(hangupcall)

; ############################################################################
; Extension Contexts [ext]
; ############################################################################

[ext-zapbarge]
exten => 888,1,SetGroup(${CALLERIDNUM})
exten => 888,2,Answer
exten => 888,3,Wait(1)
exten => 888,4,ZapBarge
exten => 888,5,Hangup

[ext-meetme]
exten => _8X,1,Answer
exten => _8X,2,Wait(1)
exten => _8X,3,GotoIf($[${CALLERIDNUM} = ${EXTEN:1}]?5:4)
exten => _8X,4,MeetMe(${EXTEN}|sM)
exten => _8X,5,MeetMe(${EXTEN}|asM)

exten => _8XX,1,Answer
exten => _8XX,2,Wait(1)
exten => _8XX,3,GotoIf($[${CALLERIDNUM} = ${EXTEN:1}]?5:4)
exten => _8XX,4,MeetMe(${EXTEN}|sM)
exten => _8XX,5,MeetMe(${EXTEN}|asM)

exten => _8XXX,1,Answer
exten => _8XXX,2,Wait(1)
exten => _8XXX,3,GotoIf($[${CALLERIDNUM} = ${EXTEN:1}]?5:4)
exten => _8XXX,4,MeetMe(${EXTEN}|sM)
exten => _8XXX,5,MeetMe(${EXTEN}|asM)

exten => _8XXXX,1,Answer
exten => _8XXXX,2,Wait(1)
exten => _8XXXX,3,GotoIf($[${CALLERIDNUM} = ${EXTEN:1}]?5:4)
exten => _8XXXX,4,MeetMe(${EXTEN}|sM)
exten => _8XXXX,5,MeetMe(${EXTEN}|asM)


[ext-fax]
exten => s,1,Answer
exten => s,2,Goto(in_fax,1)
exten => in_fax,1,GotoIf($[${FAX_RX} = system]?2:analog_fax,1)
exten => in_fax,2,Macro(faxreceive)
exten => in_fax,3,system(tiff2ps -2eaz -w 8.5 -h 11 ${FAXFILE} | ps2pdf - ${FAXFILE}.pdf)
exten => in_fax,4,system(mime-construct --to ${EMAILADDR} --subject "Fax from ${CALLERIDNUM} ${CALLERIDNAME}" --attachment ${FAXFILE}.pdf --type application/pdf --file ${FAXFILE}.pdf)
exten => in_fax,5,system(rm ${FAXFILE} ${FAXFILE}.pdf)
exten => in_fax,6,Hangup
exten => analog_fax,1,GotoIf($[${FAX_RX} = disabled]?3:2)  ;if fax is disabled, just hang up
exten => analog_fax,2,Dial(${FAX_RX},20,d)
exten => analog_fax,3,Hangup
;exten => out_fax,1,wait(7)
exten => out_fax,1,txfax(${TXFAX_NAME}|caller)
exten => out_fax,2,Hangup
exten => h,1,Hangup()

[ext-record]
exten => *77,1,Wait(2)
exten => *77,2,Record(${CALLERIDNUM}ivrrecording:wav)
exten => *77,3,Wait(2)
exten => *77,4,Hangup
exten => *99,1,Playback(${CALLERIDNUM}ivrrecording)
exten => *99,2,Wait(2)
exten => *99,3,Hangup

;this is where parked calls go if they time-out.  Should probably re-ring
[default]
include => ext-local
exten => s,1,Playback(vm-goodbye)
exten => s,2,Macro(hangupcall)

[ext-test]
exten => 7777,1,Goto(from-pstn,s,1)
exten => 666,1,Goto(ext-fax,in_fax,1)
exten => h,1,Macro(hangupcall)

;echo test
exten => *43,1,Answer
exten => *43,2,Wait(2)
exten => *43,3,Playback(demo-echotest)
exten => *43,4,Echo
exten => *43,5,Playback(demo-echodone)
exten => *43,6,Hangup

 

by: lferedayPosted on 2005-10-17 at 08:54:39ID: 15100580

Could this have anything to with the fact that my "external" numbers that I am calling begin with '8'?
I have Asterisk setup in my office, which is connected to a Mitel SX2000 LITE, the PSTN line is connected to an analog extension provided by the Mitel.
All extensions provided by the Mitel begin with '8'.

Sorry if this has muddied the waters!

 

by: ripariusPosted on 2005-10-17 at 09:07:31ID: 15100687

Sorry, didn't know you were running AMP/ asterisk@home.   The configuration files that are specific to your settings  will be in extensions-additional.conf   and zapata-additional.conf and sip-additional.conf  and iax-additional .conf  We'll probably fing the issue there...

You will also note that you can customize them using the -custom version of the files, edits of the other files get wiped out on reboots, or AMP changes. (Your not doing hand edits and losing them on the reboot are you?)

It now sounds like your IAX2 extension is perhaps not acting as a local extension.  

You should only have one trunk set up... on group 0 zap/4

You should not have iax2 or zap/0 as a trunk or in an outbound route or sharing a ring group ( only 200/201 could share a ring group).

Please post the -additional config files!



 

by: ripariusPosted on 2005-10-17 at 09:13:56ID: 15100738

Hmmm...there is one complication, Asterisk @home creates and matches short 8XXX, 8XX, 8X type extensions in the dial plan as a conference room if it happens to match an extension number like this: 8+200 = 8200 = a conference room.

But...if you are dialing 9 first, it shouldn't be an issue.

 

by: lferedayPosted on 2005-10-17 at 09:25:39ID: 15100835

RE: My Comment about extensions beginning with '8', I've tried outside number that don't begin with '8' and the same thing happens, so I presume that is not the issue.

As far as I can tell, I have only one trunk, which is group 0 and using zap channel 4
Again, as far as I can tell, my iax2 extension is not a trunk or used for outbound routing, and I don't have any ring groups.

I've done one hand edit, which was to the "macro-dial" in "extensions.conf" - before hanging-up on an unsanwered call, I get Asterisk to play a message.
I did not make any changes to "macro-dialout".

Here are the files:

extensions_additional.conf
[globals]
ZAPCHAN_200 = 1
VM_PREFIX = *
RINGTIMER = 15
REGTIME = 7:55-17:05
REGDAYS = mon-fri
RECORDEXTEN = ""
PARKNOTIFY = SIP/200
OUT_2 = ZAP/g0
OUTPREFIX_2 =
OUTMAXCHANS_2 = 1
OUTCID_2 = 784-488-8813
OPERATOR =
NULL = ""
IN_OVERRIDE = none
INCOMING = EXT-201
FAX_RX_EMAIL = fax@mydomain.com
FAX_RX = system
FAX =
E206 = SIP
E205 = IAX2
E204 = IAX2
E203 = IAX2
E202 = IAX2
E201 = IAX2
E200 = ZAP
DIRECTORY_OPTS =
DIRECTORY = last
DIAL_OUT = 9
DIAL_OPTIONS = tr
DIALOUTIDS = 2/
CALLFILENAME = ""
AFTER_INCOMING = EXT-201

[ext-local]
include => ext-local-custom
exten => 200,1,Macro(exten-vm,novm,200)
exten => 201,1,Macro(exten-vm,novm,201)
exten => 202,1,Macro(exten-vm,novm,202)
exten => 203,1,Macro(exten-vm,novm,203)
exten => 204,1,Macro(exten-vm,novm,204)
exten => 205,1,Macro(exten-vm,novm,205)
exten => 206,1,Macro(exten-vm,novm,206)

[outbound-allroutes]
include => outbound-allroutes-custom
include => outrt-001-MyNumbers
include => outrt-002-AllOtherNumbers

[outbound-trunks]
include => outbound-trunks-custom
exten => _${DIAL_OUT_1}.,1,Macro(dialout,1,${EXTEN})

[outrt-001-MyNumbers]
include => outrt-001-MyNumbers-custom
exten => 98218,1,Macro(dialout-trunk,2,${EXTEN:1},)
exten => 98218,2,Macro(outisbusy)      ; No available circuits
exten => 98295,1,Macro(dialout-trunk,2,${EXTEN:1},)
exten => 98295,2,Macro(outisbusy)      ; No available circuits

[outrt-002-AllOtherNumbers]
include => outrt-002-AllOtherNumbers-custom
exten => _9.,1,Macro(dialout-trunk,2,${EXTEN:1},8780)
exten => _9.,2,Macro(outisbusy)      ; No available circuits

zapata-additional.conf
;;;;;;[200]
signalling=fxo_ks
record_out=Never
record_in=Never
mailbox=
echotraining=800
echocancelwhenbridge=no
echocancel=yes
context=from-internal
callprogress=no
callerid="Leigh Fereday - ZAP" <200>
busydetect=no
busycount=7
channel=>1

sip-additional.conf
[206]
username=206
type=friend
secret=***
record_out=Never
record_in=Never
qualify=no
port=5060
nat=never
host=dynamic
dtmfmode=rfc2833
context=from-internal
canreinvite=no
callerid="Leigh Fereday - SIP" <206>

iax-additional .conf
[201]
username=201
type=friend
secret=***
record_out=Never
record_in=Never
qualify=no
port=4569
notransfer=yes
host=dynamic
context=from-internal
callerid="Leigh Fereday - IAX2" <201>

[202]
username=202
type=friend
secret=***
record_out=Never
record_in=Never
qualify=no
port=4569
notransfer=yes
host=dynamic
context=from-internal
callerid="Giles Thorlby - IAX2" <202>

[203]
username=203
type=friend
secret=***
record_out=Never
record_in=Never
qualify=no
port=4569
notransfer=yes
host=dynamic
context=from-internal
callerid="Christopher Fereday - IAX2" <203>

[204]
username=204
type=friend
secret=***
record_out=Never
record_in=Never
qualify=no
port=4569
notransfer=yes
host=dynamic
context=from-internal
callerid="Donnie Bachan - IAX2" <204>

[205]
username=205
type=friend
secret=***
record_out=Never
record_in=Never
qualify=no
port=4569
notransfer=yes
host=dynamic
context=from-internal
callerid="Richard Judd - IAX2" <205>

 

by: ripariusPosted on 2005-10-17 at 10:25:08ID: 15101263

In zapata-additional.conf:

Where is the outbound trunk?  If the only defined zap is the fxo extension the routing has nowhere to go???

Shouldn't it look like this?

signalling=fx0_ks
context=from-internal
group=1
channel =>1


signalling=fxs_ks
context=from-pstn
group=0
channel => 4



 

by: lferedayPosted on 2005-10-17 at 11:10:14ID: 15101659

That information is in my zapata-auto.conf:

; Autogenerated by /usr/local/sbin/genzaptelconf -- do not hand edit
; Zaptel Channels Configurations (zapata.conf)
;
; This is not intended to be a complete zapata.conf. Rather, it is intended
; to be #include-d by /etc/zapata.conf that will include the global settings
;
callerid=asreceived

; Span 1: WCTDM/0 "Wildcard TDM400P REV I Board 1"
signalling=fxo_ks
; Note: this is an extension. Create a ZAP extension in AMP for Channel 1
context=from-internal
group=1
channel => 1

; channel 2, WCTDM, inactive.
; channel 3, WCTDM, inactive.
signalling=fxs_ks
; Note: this is a trunk. Create a ZAP trunk in AMP for Channel 4
context=from-pstn
group=0
channel => 4

 

by: ripariusPosted on 2005-10-17 at 11:53:48ID: 15101999

That looks right.  Have you tried simply (temporarily) renaming the zaptel-custom and doing a full restart ("asterisk -r" in a terminal screen , then "stop gracefully", then asterisk -vvvvvvvvvvv to restart in verbose mode)  It is actually pretty safe to do your zaptel file edits in zaptel.conf or just move everything to -custom to control the interpretation order.   It only overwrites if you run genzaptelconf or upgrade asterisk@home.

This is just a hunch, but the -additional file should be enough to make it work, and the -custom just happens to follow  your zap/4 definition with the ext 200 data.  It wouldn't be the first parsing bug on a file inclusion .....

I didn't see anything else in you extensions or dialplans that looked amiss, so * could simply be getting confused.  

I have to catch a flight, so I will be offline for a bit,  but I would suggest watching the asterisk screen in verbose mode (you can just type asterisk -vvvvvvvvv on a running system if you have a monitor on it) while you dial the outbound line from iax2.  You should get a nice running progress display of what it thinks it is doing and that could head us down a more certain path.











 

by: lferedayPosted on 2005-10-18 at 09:51:43ID: 15109161

Couldn't find zaptel-custom.conf, so presumed you meant extensions-custom.conf

1)Renamed extensions-custom.conf
2)Restarted
3)Tried an external call, got the same result

Looked at the verbose messages, and picked up on these entries:
Executing Dial("IAX2/201@201/4", "ZAP/g0/8218") in new stack
Called g0/8218
Zap/1-1 is ringing

It shows that it called g0/8218 - but it didn't really.

 

by: ripariusPosted on 2005-10-18 at 10:29:51ID: 15109503

Thats what I get for typing while I am on the run and I can't check my filenames...ooops


...I meant zapata-additional  
zapata.conf does an include on zapata-auto.conf  and zapata_additional.conf  and it looks like it is confusing the groups in these files .  What I said so ineptly was that  you should try renaming (and therefore not executing) the "zapata_additional.conf" file  so that there is no inbound zap1 configuration being read other than the channel definitions in zapata-auto.

===============this is ok and normal...outbound on zap4
Executing Dial("IAX2/201@201/4", "ZAP/g0/8218") in new stack


===============this is ok and normal
Called g0/8218

===============this is the strange inbound calll
Zap/1-1 is ringing


Your entire zap configuration would read to the system like the combination of these files (as follows), I am suspicious that somethng may be going wrong at the inclusion of the second file which, by the way, would inherit the g0 group designation from the outgoing group above it (since you don't specifically override it anywhere).  This inheritance could be the issue.  So renaming  it (zapata_additonal) or editing in the group 1 statement might fix it.  

Remember, everything above a channel statement defines it, so you appear to have the inbound line in outbound group 0.

signalling=fxo_ks
context=from-internal
group=1
channel => 1


signalling=fxs_ks
context=from-pstn
group=0
channel => 4
                                         
;;;;;;[200]
signalling=fxo_ks
record_out=Never
record_in=Never
mailbox=
echotraining=800
echocancelwhenbridge=no
echocancel=yes
context=from-internal
callprogress=no
callerid="Leigh Fereday - ZAP" <200>
busydetect=no
busycount=7
channel=>1

Hope this works!

 

by: lferedayPosted on 2005-10-18 at 10:56:05ID: 15109777

By the way, when I try restarting Asterisk following a "stop gracefully" I get "Ouch...broken pipe", so I end up rebooting!

So I did the following:
1)Renamed zapata-additional.conf
2)Rebooted

And it worked!

I can call outside number beginning with '9', AND I can call extension 200.

I'm happy with this, although I'm a tad confused, how is it working without "zapata-additional.conf".

Can you tell me what "zapata-additional.conf" is supposed to do, and do I need it?

I have rebooted again, and it still works!

Would it be worth editing "zapata-additional.conf" and adding "group=1" between "busycount=7" and "channel=>1"?

 

by: ripariusPosted on 2005-10-18 at 11:40:04ID: 15110217

Great!

Your zapata config defines where your "zap" lines (zap/1, zap/4) are and what they do.  It consists of everything in:

zapata.conf

plus

zapata-auto.conf

plus

zapata_additional.conf

(in the above order)

You shouldn't need most of the settings from _additional since many are probably already in zapata.conf and therefore are inherited by the other two files unless you specifically change them.  My _additional file is empty even with 24 pots and 48 extensions.  Because of the order of inclusion (very important as you now know :)  )...I would just edit  (and keep a backup of ) zapata.conf or -auto with any desired settings.   AMP/ @Home does not overwrite this file unless you tell it to by running the genzaptelconf program manually (or reinstalling).    In general the _additonal and -custom files allow you to mess with @Home without being overwritten, but you have to be carefull about which order they execute.  In this case, it executes last, which  makes it problematic to modify earlier settings.

Hey, at least we all know what happens if you mix an fxo and fxs group now!

Broken-pipe is often a result of zaptel config issues.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...