Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3128
  • Last Modified:

Set up two X100P cards in Asterisk@Home

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?



Thanks
0
fferdinan
Asked:
fferdinan
  • 4
  • 3
  • 2
1 Solution
 
grbladesCommented:
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?
0
 
fuzzysbCommented:
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?
0
 
fferdinanAuthor Commented:
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.

Thanks



0
Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

 
fuzzysbCommented:
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
exten=1005,1,Macro(stdcallerid)
exten=1005,2,Macro(stdvoip,SIP/${MYMOBILENUM}@pipecall,40,tT)
exten=1005,3,Goto(204)
exten=1005,103,Dial(${DIALOUTANALOG}/${MYMOBILEPHONE},40,tT)
exten=1005,104,Voicemail(u1000)
exten=1005,204,Congestion
exten=1005,205,Hangup

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

cheers

Stuart Buchanan
0
 
grbladesCommented:
Here is a good document :-
http://www.digium.com/en/docs/misc/basic_configurations_and_examples.txt

So in your case you will want something like the following in zapata.conf :-
fxsks=1-2
signalling=fxs_ks
context=line1
channel => 1
context=line2
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 :-

[line1]
exten => s,1,Dial(IAX2/[username]:[password]@[ip.address.of.box.2]/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}
0
 
fferdinanAuthor Commented:
Ok I trying the configuration, but I can't  understand how I'll create 2 trunks, one per line.





0
 
grbladesCommented:
You dont actually have to create two groups. As you only have two lines to can just specify the line to use.
0
 
fferdinanAuthor Commented:
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
0
 
grbladesCommented:
> 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]@[ip.address.of.box.2]/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.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now