+ Reply to Thread
Results 1 to 5 of 5

Thread: Asterisk Dial Plan - force insert of prefix

  Share/Bookmark
  1. #1

    Reputation
    Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation
    localzuk's Avatar
    Join Date
    Dec 2006
    Location
    Minehead, Somerset
    Posts
    8,384
    Blog Entries
    22
    Thank Post
    264
    Thanked 755 Times in 604 Posts
    Rep Power
    197

    Default Asterisk Dial Plan - force insert of prefix

    Does anyone know how to force all calls from an extension to add a prefix to the beginning?

    We have a pay phone which is on our asterisk server - using the normal school lines to dial out. The problem is, kids are trying to call home at break etc... and not leaving a message. This leads to parents doing 1471 and calling the school demanding to know who called them and why.

    What we want to do is insert 141 in front of all calls dialled from that phone. So, if they call 842134, the asterisk server will actually dial 141842134.

    Any ideas how to do this?

    Doing a google search for asterisk and prefix turns up about 1,000,000 irrelevant items...

  2. #2

    Reputation

    Join Date
    Jan 2006
    Location
    Hertfordshire
    Posts
    121
    Thank Post
    1
    Thanked 5 Times in 5 Posts
    Rep Power
    10

    Default try in trunks

    1471+x

  3. #3

    Reputation
    Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation
    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,445
    Thank Post
    342
    Thanked 687 Times in 576 Posts
    Rep Power
    144

    Default

    Something like:

    Code:
    exten => _0Z.,n,Dial(${TRUNK}/44${EXTEN:1})
    

    in your dialplan will put a 44 before any number starting 0, and chop the 0 off the front of it (in this example, I use it to stick the country code in front of an external but not international call).

    Result: 01234567899 becomes 441234567899

  4. #4

    Reputation
    Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation
    localzuk's Avatar
    Join Date
    Dec 2006
    Location
    Minehead, Somerset
    Posts
    8,384
    Blog Entries
    22
    Thank Post
    264
    Thanked 755 Times in 604 Posts
    Rep Power
    197

    Default

    Ok, next question then - how can I restrict this to just being from that one extension. I want all the other extensions to continue to function as normal?

  5. #5

    Reputation

    Join Date
    Aug 2010
    Location
    OC California
    Posts
    3
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    You can separate the extensions/sip account by context and put it in the same context as your dialplan..so that is only accessible by that extension

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. New Prefix for OS Deployment Fourm
    By Gatt in forum Comments and Suggestions
    Replies: 3
    Last Post: 05-11-2009, 12:23 AM
  2. Solved - Prefix for posts
    By CHR1S in forum Comments and Suggestions
    Replies: 0
    Last Post: 05-05-2009, 11:28 AM
  3. new prefix for classified section
    By RabbieBurns in forum Comments and Suggestions
    Replies: 2
    Last Post: 20-02-2009, 09:31 AM
  4. BT Dial up Speed At Home.
    By tickmike in forum General Chat
    Replies: 10
    Last Post: 15-08-2007, 10:56 PM
  5. disable dial up
    By adnan in forum Windows
    Replies: 15
    Last Post: 28-03-2007, 11:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts