I am trying to configure Asterick, having the following system setup on the Asterick server: * eth0 faces the external Internet interface, *but* it does not have IP address (it has a private one given to it by my ISP's DHCP server); * eth1 faces my internal network (say 10.1.1.0/24); * tun0 serves all mobile smartphones and connects to the internal network (it has a different ip range, say 10.1.2.0/24) - they are all connected via the Internet using OpenVPN; I would like to configure Asterick for internal calls between ourselves (eth1<->tun0) and I think I have no problem with configuring this part. I would also like to use one external VOIP provider to which Asterick registers on startup. I think I know how to do that and use the "register" option in sip.conf, though I am not sure for the rest of the NAT-related entries (see below). The purpose of registering this external account is so that both the smart phones (tun0) and the internal net (eth1) users could use this account to make external calls (starting with "0", i.e "_0[0-9]." pattern in extensioins.conf). Obviously, I need these calls to be routed properly via the external VOIP account. In addition to that, I would also need to receive calls from that external account to a nominated internal one (say on extension 20). Is this achievable? If so, I am not completely clear on whether I need to explicitly specify my public IP address (via externip/externhost) or whether Asterick is able to find it without this option? If not, then my plan is to use external program to find it and then use a script in Asterick to set it up as an environment variable. Would that work? That external IP address is going to change, but only in rare circumstances and in such cases I have to restart a lot of stuff (including Asterick) on that server (this is usually triggered by a monitoring program), so it won't be a problem once it is setup initially. I am also not sure whether to specify "nat=yes" or just have "nat=route" only - any ideas? Is there a comprehensive list of all the options available in sip.conf and what they do, because I was unable to find such a list? If the above is doable, I would also like to add the following 2 features: 1. Secondary external VOIP account, though I have no idea how to specify its port in "register" (it uses port 5065 instead of the standard 5060). That account would need to be used on a separate interface (eth2) with a different public IP address. Would it be possible to use externip/externhost inside that external account section to specify it? If this is not possible, then I am thinking of running a separate instance of Asterick with the second VOIP account/public IP address set up - would that work? 2. I would like to be able to configure the following work flow: for a specific set of (external) calling numbers (including where no Caller ID is available): a) these callers to be prompted to specify the "reason" for their call; b) their response to be temporarily "recorded"/stored (a short message of, say no more than 10 seconds long or when they press '#' for that recording to stop); c) Asterick then rings the nominated number for external VOIP calls (extension 20) and play that recorded message back; d) then asks for one of four possible outcomes: - accept this call (pressing, say 1) in which case the call is connected as normal; - reject it with a message that that number/person is "unavailable" (say, by pressing 0); - ask the caller to leave a message by transferring them to a voicemail (say by pressing 2); or - end the initial call completely with a message that the caller/number has been "blacklisted" (say, by pressing the 9 key); Could this be achieved? One final question about binding: in order to be able to use both tun0 and eth1 interfaces so that Asterick serves the calls from both eth1 and tun0, do I have to use "bind 0.0.0.0"? Is there an alternative, like specifying "bind 10.1.1.1" for eth1 and then "bind 10.1.2.1" for the tun0 interface - is this possible? Many thanks in advance!
Whats asterick? On Wed, Feb 1, 2012 at 7:48 PM, Josh <mojo1736 at privatedemail.net> wrote:> I am trying to configure Asterick, having the following system setup on > the Asterick server: > > * eth0 faces the external Internet interface, *but* it does not have IP > address (it has a private one given to it by my ISP's DHCP server); > * eth1 faces my internal network (say 10.1.1.0/24); > * tun0 serves all mobile smartphones and connects to the internal > network (it has a different ip range, say 10.1.2.0/24) - they are all > connected via the Internet using OpenVPN; > > I would like to configure Asterick for internal calls between ourselves > (eth1<->tun0) and I think I have no problem with configuring this part. > I would also like to use one external VOIP provider to which Asterick > registers on startup. I think I know how to do that and use the > "register" option in sip.conf, though I am not sure for the rest of the > NAT-related entries (see below). > > The purpose of registering this external account is so that both the > smart phones (tun0) and the internal net (eth1) users could use this > account to make external calls (starting with "0", i.e "_0[0-9]." > pattern in extensioins.conf). Obviously, I need these calls to be routed > properly via the external VOIP account. In addition to that, I would > also need to receive calls from that external account to a nominated > internal one (say on extension 20). > > Is this achievable? > > If so, I am not completely clear on whether I need to explicitly specify > my public IP address (via externip/externhost) or whether Asterick is > able to find it without this option? If not, then my plan is to use > external program to find it and then use a script in Asterick to set it > up as an environment variable. Would that work? That external IP address > is going to change, but only in rare circumstances and in such cases I > have to restart a lot of stuff (including Asterick) on that server (this > is usually triggered by a monitoring program), so it won't be a problem > once it is setup initially. I am also not sure whether to specify > "nat=yes" or just have "nat=route" only - any ideas? > > Is there a comprehensive list of all the options available in sip.conf > and what they do, because I was unable to find such a list? > > If the above is doable, I would also like to add the following 2 features: > > 1. Secondary external VOIP account, though I have no idea how to specify > its port in "register" (it uses port 5065 instead of the standard 5060). > That account would need to be used on a separate interface (eth2) with a > different public IP address. Would it be possible to use > externip/externhost inside that external account section to specify it? > If this is not possible, then I am thinking of running a separate > instance of Asterick with the second VOIP account/public IP address set > up - would that work? > > 2. I would like to be able to configure the following work flow: for a > specific set of (external) calling numbers (including where no Caller ID > is available): > a) these callers to be prompted to specify the "reason" for their call; > b) their response to be temporarily "recorded"/stored (a short message > of, say no more than 10 seconds long or when they press '#' for that > recording to stop); > c) Asterick then rings the nominated number for external VOIP calls > (extension 20) and play that recorded message back; > d) then asks for one of four possible outcomes: > - accept this call (pressing, say 1) in which case the call is connected > as normal; > - reject it with a message that that number/person is "unavailable" > (say, by pressing 0); > - ask the caller to leave a message by transferring them to a voicemail > (say by pressing 2); or > - end the initial call completely with a message that the caller/number > has been "blacklisted" (say, by pressing the 9 key); > > Could this be achieved? > > One final question about binding: in order to be able to use both tun0 > and eth1 interfaces so that Asterick serves the calls from both eth1 and > tun0, do I have to use "bind 0.0.0.0"? Is there an alternative, like > specifying "bind 10.1.1.1" for eth1 and then "bind 10.1.2.1" for the > tun0 interface - is this possible? > > Many thanks in advance! > > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > ? ? ? ? ? ? ?http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > ?http://lists.digium.com/mailman/listinfo/asterisk-users
> Whats asterick? >I blame my spell checker! :-P Do you have anything to offer in terms of help or advice on the issues/questions I posted?
I think you might want to split your questions first. this might work from local ISP network, but in my experience it might depend on provider. 1. You can't have multiple externip, but it's not necessary to run two Asterisk instances, because you can set routes to different destinations via particular interfaces. On Thu, Feb 2, 2012 at 2:48 AM, Josh <mojo1736 at privatedemail.net> wrote:> I am trying to configure Asterick, having the following system setup on > the Asterick server: > > * eth0 faces the external Internet interface, *but* it does not have IP > address (it has a private one given to it by my ISP's DHCP server); > * eth1 faces my internal network (say 10.1.1.0/24); > * tun0 serves all mobile smartphones and connects to the internal > network (it has a different ip range, say 10.1.2.0/24) - they are all > connected via the Internet using OpenVPN; > > I would like to configure Asterick for internal calls between ourselves > (eth1<->tun0) and I think I have no problem with configuring this part. > I would also like to use one external VOIP provider to which Asterick > registers on startup. I think I know how to do that and use the > "register" option in sip.conf, though I am not sure for the rest of the > NAT-related entries (see below). > > The purpose of registering this external account is so that both the > smart phones (tun0) and the internal net (eth1) users could use this > account to make external calls (starting with "0", i.e "_0[0-9]." > pattern in extensioins.conf). Obviously, I need these calls to be routed > properly via the external VOIP account. In addition to that, I would > also need to receive calls from that external account to a nominated > internal one (say on extension 20). > > Is this achievable? > > If so, I am not completely clear on whether I need to explicitly specify > my public IP address (via externip/externhost) or whether Asterick is > able to find it without this option? If not, then my plan is to use > external program to find it and then use a script in Asterick to set it > up as an environment variable. Would that work? That external IP address > is going to change, but only in rare circumstances and in such cases I > have to restart a lot of stuff (including Asterick) on that server (this > is usually triggered by a monitoring program), so it won't be a problem > once it is setup initially. I am also not sure whether to specify > "nat=yes" or just have "nat=route" only - any ideas? > > Is there a comprehensive list of all the options available in sip.conf > and what they do, because I was unable to find such a list? > > If the above is doable, I would also like to add the following 2 features: > > 1. Secondary external VOIP account, though I have no idea how to specify > its port in "register" (it uses port 5065 instead of the standard 5060). > That account would need to be used on a separate interface (eth2) with a > different public IP address. Would it be possible to use > externip/externhost inside that external account section to specify it? > If this is not possible, then I am thinking of running a separate > instance of Asterick with the second VOIP account/public IP address set > up - would that work? > > 2. I would like to be able to configure the following work flow: for a > specific set of (external) calling numbers (including where no Caller ID > is available): > a) these callers to be prompted to specify the "reason" for their call; > b) their response to be temporarily "recorded"/stored (a short message > of, say no more than 10 seconds long or when they press '#' for that > recording to stop); > c) Asterick then rings the nominated number for external VOIP calls > (extension 20) and play that recorded message back; > d) then asks for one of four possible outcomes: > - accept this call (pressing, say 1) in which case the call is connected > as normal; > - reject it with a message that that number/person is "unavailable" > (say, by pressing 0); > - ask the caller to leave a message by transferring them to a voicemail > (say by pressing 2); or > - end the initial call completely with a message that the caller/number > has been "blacklisted" (say, by pressing the 9 key); > > Could this be achieved? > > One final question about binding: in order to be able to use both tun0 > and eth1 interfaces so that Asterick serves the calls from both eth1 and > tun0, do I have to use "bind 0.0.0.0"? Is there an alternative, like > specifying "bind 10.1.1.1" for eth1 and then "bind 10.1.2.1" for the > tun0 interface - is this possible? > > Many thanks in advance! > > > -- > ______________________________**______________________________**_________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/**mailman/listinfo/asterisk-**users<http://lists.digium.com/mailman/listinfo/asterisk-users> >-- Mvh, Aurimas Skirgaila -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120202/1d184879/attachment.htm>
On 02/01/2012 04:48 PM, Josh wrote:> The purpose of registering this external account is so that both the > smart phones (tun0) and the internal net (eth1) users could use this > account to make external calls (starting with "0", i.e "_0[0-9]." > pattern in extensioins.conf). Obviously, I need these calls to be routed > properly via the external VOIP account. In addition to that, I would > also need to receive calls from that external account to a nominated > internal one (say on extension 20). > > Is this achievable?I can't see any reason it shouldn't be.> If so, I am not completely clear on whether I need to explicitly specify > my public IP address (via externip/externhost) or whether Asterick is > able to find it without this option?As I understand it, that depends on your router. If you have a Linux router with the ip_nat_sip module, it'll "fix" your SIP packets so that you don't need to use the externip setting. However, you'll need to test to verify that. Asterisk won't be able to figure out your external address on its own, so if your firewall isn't fixing packets, then you'd need to specify externip.> If not, then my plan is to use > external program to find it and then use a script in Asterick to set it > up as an environment variable. Would that work?http://www.voip-info.org/wiki/view/Asterisk+variables According to the information here, you should be able to use ${ENV(externip)} to reference the value of an environment variable named "externip".> I am also not sure whether to specify > "nat=yes" or just have "nat=route" only - any ideas?http://www.asteriskguru.com/tutorials/sip_nat_oneway_or_no_audio_asterisk.html For a SIP trunk... no, I don't. The above link may be useful as it describes NAT issues with SIP. If you have to specify NAT options at all, start with "yes" and try "route" if that doesn't work.> Is there a comprehensive list of all the options available in sip.conf > and what they do, because I was unable to find such a list?http://www.voip-info.org/wiki/view/Asterisk+config+sip.conf I wish I knew. The link above seems fairly complete, but also terse.> One final question about binding: in order to be able to use both tun0 > and eth1 interfaces so that Asterick serves the calls from both eth1 and > tun0, do I have to use "bind 0.0.0.0"? Is there an alternative, like > specifying "bind 10.1.1.1" for eth1 and then "bind 10.1.2.1" for the > tun0 interface - is this possible?Start with binding to 0.0.0.0.
On Thu, 2 Feb 2012, Josh wrote: Great subject, BTW. It'll make everyone's contribution so much easier for 'the next guy' to search for. Just feeling snarky on a Friday afternoon :) -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
On 07-02-12 18:41, Josh wrote: [snip]> Thanks, another mystery solved then - Asterisk does rely on the > Linux/Unix routing, in which case I would definitely need to take care > of the SNAT/DNAT and proper routing/forwarding of packets between > interfaces using core Linux/Unix tools. Am I correct in thinking that?Yes. Regards, Patrick