Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Asterisk - Append area code for only selected SIP users using shared trunk

Posted on 2011-09-05
8
Medium Priority
?
501 Views
Last Modified: 2012-05-12
I have remote office in another state with 4 users connecting to our Asterisk (Trixbox 2.8) server via a IPsec VPN. They connect to it and use the same outgoing trunk as the 70 users at our main office using Cisco 7941 handsets and SIP.

As they are using our main office trunk they are effectively dialling from a different state to the one they are in physically. Due to this they have to enter the area code for the state they are in whenever making local calls. This is unacceptable and I need to come up with a workaround for these 4 users without impacting on the 70 head office users.

I don't believe you can manipulate numbers using dialplan.xml and I haven't delved too deep into the nitty gritty of the extensions.conf file yet.

Could someone suggest a way of automatically adding the area code 03 to all 10 digit numbers dialed for only the 4 users using a shared trunk without affecting the other users?
0
Comment
Question by:thenos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 36

Expert Comment

by:grblades
ID: 36487525
Generally all you would do is alter the context for these 4 users in the sip.conf file so when they make a call it jumps to a different context in extensions.conf.
You would then have a piece of dialplan code to check the entered number and if its 10 digits jump to the main context all other extensions go to when making calls but add the area code to the start.

I only work with straight Asterisk where you modify the dialplan directly. Sorry I dont know how to would go about doing the same thing via the Trixbox web interface.
0
 
LVL 25

Expert Comment

by:Ron Malmstead
ID: 36497386
You would need to edit the extensions_custom.conf file.

If you could post your extensions.conf file, as well as your extensions_custom.conf file...I can try to help you with this.

I use o-source asterisk like grblades, so I would need those files to refresh my memory of Trixbox dialplan flow.

Essentially we will add a custom context, that will be hardcoded to prepend the number and modify the dialed number variable if the ${CDR(src)}...meets the criteria.

Please also tell me what the 4 users extensions are.
0
 

Author Comment

by:thenos
ID: 36499776
Hi,

I have attached all three extensions.conf files.

Extensions 201 through to 209 (inclusive) need all 8 digit numbers to be prepended with an 03.

Thanks for your help,
extensions.conf.txt
extensions-custom.conf.txt
extensions-additional.conf.txt
0
Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

 
LVL 25

Expert Comment

by:Ron Malmstead
ID: 36510836
Sorry i'm just now getting a chance to look at this....

I'll have something for you to test soon.
0
 
LVL 25

Expert Comment

by:Ron Malmstead
ID: 36510915
Can you place a call from one of the extensions, and capture the CLI output for me?

I need to see which contexts the call is traversing.
0
 

Author Comment

by:thenos
ID: 36536082
Apologies for my delay in getting this to you, I have been a little distracted of late...

Each extension is currently set to from-internal

I outputed a putty session using Astersk CLI (~>Asterisk -rvvvvvvvvvv) and made an outgoing call from extension 109 using PortGo (softphone). See attached txt file

Note for attached file:
Hostname has been replaced by <Asterisk>
The external number called from extension 109 has been replaced by <External Phone #>
asterisk-cli.txt
0
 

Accepted Solution

by:
thenos earned 0 total points
ID: 36997179
I ended up working this one out with
I resolved this by doing the following:

1. Added the following to extension_custom.conf

[from-remote]
exten => _XXXXXXXX,1,noop(${EXTEN})
exten => _XXXXXXXX,n,set(EXTEN=03${EXTEN})
exten => _XXXXXXXX,n,goto(from-internal,${exten},1)
include => from-internal

2. I then changed the context for each of the extensions 201-209 manually using the FreeBPX GUI to "from-remote".

Tested and working.
0
 

Author Closing Comment

by:thenos
ID: 37016667
Tested and working
0

Featured Post

Enhanced Intelligibility Without Cable Clutter

Challenge: The ESA office in Brussels wanted a reliable audio conference system for video conferences. Their requirement - No participant must be left out from the conference and the audio quality must not be compromised.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Implementing Avaya's One-X portal is pretty painless, until you want to deploy this to the Android and iPhone clients when these clients are outside of your network. The clients will also work within your local network. Here is our experience and so…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question