Set up two X100P cards in Asterisk@Home

Posted on 2006-04-19
Last Modified: 2008-01-09
Hi all,
I installed two x100P cards in my Asterisl@Home to get  POTS lines. Each card has connected a POT line with differents phone number.
The server is working good, I can make outbound calls and I can get incoming calls.

My questions is: how can I configure each x100p card like a trunk. I need to configure one Outbound Routing per X100P card / POT Line, because each line has a diferent rate with the provider.
and the second questions is: When I receive a call through first line how can I make to ring  o redirect the call to the second line?

Question by:fferdinan
    LVL 36

    Expert Comment

    Is there any functionality to do what you want within the asterisk@home web interface?

    I have helped many people trying to use asterisk@home in the last few weeks and once they want to do anything more complex than is supported in the web interface you end up having to try and hack the customised asterisk configuration it uses which is very difficult, over complicated, and undocumented.

    I would strongly advise that you reinstall a general version of lInux and then install asterisk manually. It will take a bit of time to get everything working and configured but you will have a much cleaner and more efficient asterisk system and will be able to make customised changes far more easily.

    To answer your question have a look at zapata.conf. In here you can define groups. You woulf define g1 for one card and g2 for another. Then when you make an outgoing call you would decide whether to dial using ZAP/g1 or ZAP/g2 depending on the destination number. If its a case that one line is always cheaper than the other you could use a single group consisting of both telephone lines and just add the cheaper line to the group first so it gets used first.

    Why would you want to redirect a call back out the 2nd interface?
    LVL 4

    Expert Comment

    I agree with the point of not using AMP to configure the asterisk config, but i wouldn't recommend using anything other than asterisk@home, as you can still customise it manually editing the conf files in /etc/asterisk using the SSH session. there is no reason to install asterisk manually unless you have an extreme aversion to CentOS and want to use a different Distro.

    I have used asterisk for 3 years and recently i had to replace my config, and instead of building the system manually i used asterisk@home. and to me it is a fantastic way to get asterisk up & running. i have added my custom config which i have written from scratch and just overwritten completely the sip.conf & extensions.conf. I have then disabled apache from starting so i have disabled the web config. There is really no simpler way to get started.

    but to clarify you need to as grblades has suggested use different ZAP groups with each line.

    but moving on, as grblades stated why would you want to redirect a call to the second trunk? all that would do would be to tie up both lines for the one call. why would you want to do this?

    Author Comment

    The asterisk@home is very easy and it doesn't mean limited. From web interface the AAH (asterisk@home) i can change all configs files, or I can go to the server AAH log in it and make the chanches manually.

    OK now, I can undertand that I need to create groups in the zapata.conf,  can you place some example.

    Why would you want to redirect a call back out the 2nd interface?

    OK imagine the following situation

    Place A
          First Server AAH with two X100P and connected two POTS lines
          POTS Line 1 Number 1111
          POTS Line 2 Number 2222

    Place B
          Second Server AAH with two X100P and connected two POTS lines
          POTS Line 3 Number 3333
          POTS Line 4 Number 4444

    From place A make a call using my cellphone calling to number 1111 (line1), Line 1 has assigned a SIP extension to Second AAH Server, the Second Server use the number (3333) Line3 to call another cellphone.

    How I implement this scenario in the AAH Servers.


    LVL 4

    Expert Comment

    first off i would not use the pots lines for communicating with the two asterisk boxes, you have a to VoIP PBX's so i would use  the internet to forward calls between the two boxes either using IAX (NAT Friendly) or SIP. unless of course you do not have the boxes

    The process of this is very simple, you just need to determine how you route the call.

    do you want asterisk to forward your call based on the CLID of your mobile? you haven't stated how you want to call the second cell phone automatically or with your response.

    you could specify that your asterisk box waits 15 seconds after the call has been answered for you to key in the SIP extension of your second asterisk box. and then have that AAH box wait for the digits of the mobile you want to call.

    in your inbound pots section of your extensions.conf put include => local

    and then put your local extensions and other AAHbox extension in the [local] context.

    this would then ensure that noone else could dial other numbers.

    you then put these commands in your inbound pots context

      include => local

      exten => s,1,Answer
      exten => s,2,Ringing
      exten => s,3,DigitTimeout,5
      exten => s,4,ResponseTimeout,10
      exten => s,5,Dial yada yada yada

    step 1 answers the call, step 2 plays a ringing tone to the caller, but step 3 appends any other digits dialed, and step 4 waits for 10 seconds for more DTMF tones, so if when you hear the ringing tone you dial the SIP extension of the other AAH box you will be put through to that box if no digits are dialled the dial command in step 5 is executed, but be aware that it will dial step 5 immediately so if someone picks up that call before you input the extension you will be unable to route the call

    you then need to do a similar thing on that AAH box, but you have to be carefull not to open up full access to inbound callers to dial any number as it would be open to abuse, but if you dial say 5 mobiles you could configure 5 local extensions in the local context of the second AAH box to dial these. i have a short extension for my mobile which is 1005 se my example below

    ; Dial My Mobile

    this effectively tries dialling via VoIP and if that fails tries pots and failing that goes to voicemail or plays the congestion tone

    i hope this gives you an idea, but without knowing if you want it manually routed or automatically i will be unable to help further


    Stuart Buchanan
    LVL 36

    Expert Comment

    Here is a good document :-

    So in your case you will want something like the following in zapata.conf :-
    channel => 1
    channel => 2

    Then in extensions.conf you want incoming calls on the [line1] context to be routed out over the internet to the second asterisk box :-

    exten => s,1,Dial(IAX2/[username]:[password]@[]/9[telephone-number-to-dial])

    Then on the second box you would have an entry in extensions.conf to divert dialed numbers out an analogue interface :-

    ; we use the 9 prefix to indicate an external line
    exten => _9X.,1,Dial,Zap/3/${EXTEN:1}

    Author Comment

    Ok I trying the configuration, but I can't  understand how I'll create 2 trunks, one per line.

    LVL 36

    Expert Comment

    You dont actually have to create two groups. As you only have two lines to can just specify the line to use.

    Author Comment

    Thank you for your answer grblades. Ok so no groups, but HOW do I specify the line that I want to use, in what file, HOW, could you give an example and be more specific.

    Thank you
    LVL 36

    Accepted Solution

    > fxsks=1-2
    > signalling=fxs_ks
    > context=line1
    > channel => 1
    > context=line2
    > channel => 2
    Here the 'channel' defines the line. Channel 1 will be the first card in the machine.
    All incoming calls on line 1 will therefore go to the line1 context.

    > [line1]
    > exten => s,1,Dial(IAX2/[username]:[password]@[]/9[telephone-number-to-dial])
    Here any calls coming into the line1 context (which will be incoming calls on line1) will be passed over to the other asterisk box.

    > exten => _9X.,1,Dial,Zap/3/${EXTEN:1}
    Here when 9 is used to get an external line the first digit is stripped off the dialed number and then the call is placed over the zaptel interface channel 3.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Suggested Solutions

    Every year the snow affects people and businesses. According to the Federation of Small Businesses (FSB), in 2009, UK businesses lost an estimated £1.2bn ( because of bad weather. This article was c…
    If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now