Steve Murphy
2003-Nov-06 16:45 UTC
[Asterisk-Users] Dialing an outside number -- QUESTION --
Hello-- I'd like to do a little processing on external phone numbers from within the asterisk pbx. Fairly simple stuff, but... devilishly hard to make it work so far! 1. I'd like to dial 9 to get an outside line. 2. If the number dialed after the 9 is 754XXXX, I'd like it to go thru unmodified. It's the only local number available here. 3. I'd like all 1 XXX XXX XXXX numbers to go thru after the 9, unmolested. 4. After the 9, I'd like all other 7 digit numbers to be dialed 1307NXXXXXX. Simple enough, right? I wrote up the following: [outwork] ignorepat => 9 exten => _91XXXXXXXXXX,1,StripMSD,1 exten => _1XXXXXXXXXX,2,Dial,Zap/2/BYEXTENSION exten => _9754XXXX,1,StripMSD,1 exten => _754XXXX,2,Dial,Zap/2/BYEXTENSION exten =>_9NXXXXXX,1,StripMSD,1 exten =>_NXXXXXX,2,Prefix,1307 exten => _1307NXXXXXX,3,Dial,Zap/2/BYEXTENSION [workext] ;; the active context for an internal extension include => outwork ... (other extensions, but not 9) exten => t,1,Congestion exten => i,1,Congestion exten => o,1,Congestion And it doesn't work, and neither do maybe a dozen variants. I split the 3 groups up into different contexts, I remove the second two StripMSD commands. I sequence the priorities from 1 to 7. I tried setting all the post-StripMSD commands to priority 2, I... and on and on, including combinations of the above, and the best I can do, is get the first one to work. I can dial 91<10 digits>, and the <10 digits> are sent out to the phone company, and the phone rings out there. All the rest might have me wait some seconds, and then I get the congestion tone. And, on top of everything else, the moment I touch 9 on the extension, the dial tone goes away. So IgnorePat doesn't work in this situation, either. Checked the documentation for dial and stripmsd, and none of the examples cover anything more complicated than a single pattern. What am I missing? murf
Steven Critchfield
2003-Nov-06 18:06 UTC
[Asterisk-Users] Dialing an outside number -- QUESTION --
On Thu, 2003-11-06 at 17:45, Steve Murphy wrote:> I wrote up the following: > > [outwork] > ignorepat => 9 > exten => _91XXXXXXXXXX,1,StripMSD,1 > exten => _1XXXXXXXXXX,2,Dial,Zap/2/BYEXTENSION > exten => _9754XXXX,1,StripMSD,1 > exten => _754XXXX,2,Dial,Zap/2/BYEXTENSION > exten =>_9NXXXXXX,1,StripMSD,1 > exten =>_NXXXXXX,2,Prefix,1307 > exten => _1307NXXXXXX,3,Dial,Zap/2/BYEXTENSION> Checked the documentation for dial and stripmsd, and none of the > examples cover anything more complicated than a single pattern.This isn't too complicated, I think you are inadvertently making it so.> What am I missing?Lets see if I can make this simpler for you. [outwork] ignorepat => 9 exten => _9754XXXX,1,Dial(Zap/2/${EXTEN}) exten => _9NXXXXXX,1,Dial(Zap/2/1307${EXTEN:1}) exten => _91NXXNXXXXXX,1,Dial(Zap/2/${EXTEN}) This assumes you place stripmsd=1 in the /etc/asterisk/zapata.conf file near your channel 2 definition. Quick explanations as to why this is preferred. First by not having any extension entries that are ambiguous to your normal extensions in the office is desirable. This is what I suspect caused your timeout problems before. Second, the fewer rules you have in place the fewer places to run into problems. Hope this helps. -- Steven Critchfield <critch@basesys.com>
Chris Albertson
2003-Nov-06 18:10 UTC
[Asterisk-Users] Dialing an outside number -- QUESTION --
--- Steve Murphy <murf@e-tools.com> wrote:><snip> > > I wrote up the following: > > [outwork] > ignorepat => 9 > exten => _91XXXXXXXXXX,1,StripMSD,1 > exten => _1XXXXXXXXXX,2,Dial,Zap/2/BYEXTENSION > exten => _9754XXXX,1,StripMSD,1 > exten => _754XXXX,2,Dial,Zap/2/BYEXTENSION > exten =>_9NXXXXXX,1,StripMSD,1 > exten =>_NXXXXXX,2,Prefix,1307 > exten => _1307NXXXXXX,3,Dial,Zap/2/BYEXTENSION >Try this newer syntax: [outwork] exten => _91XXXXXXXXXX,1,Dial,Zap/2/${EXTEN:1} exten => _9754XXXX,1,Dial,Zap/2/${EXTEN:1} exten => _9NXXXXXX,1,Dial,Zap/2/1307${EXTEN:1} ====Chris Albertson Home: 310-376-1029 chrisalbertson90278@yahoo.com Cell: 310-990-7550 Office: 310-336-5189 Christopher.J.Albertson@aero.org KG6OMK __________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree