[Spce-user] Trunk for Asterisk on dynamic IP

William Fulton wfulton at thirdhatch.com
Sat Feb 14 14:27:22 EST 2015


Here is our scenario:

SPCE - INTERNET - Firewall - Asterisk

As you can see, we are using Asterisk behind a firewall.  We configured Asterisk properly for NAT.  We did not have to create firewall rules or any port forwarding to make this work.

Thanks!
William

-----Original Message-----
From: Spce-user [mailto:spce-user-bounces at lists.sipwise.com] On Behalf Of Tóth Csaba
Sent: Saturday, February 14, 2015 10:45 AM
To: spce-user at lists.sipwise.com
Subject: Re: [Spce-user] Trunk for Asterisk on dynamic IP

Your welcome :)

i forget to tell, that for these linux hosts we use direct ip, because
they are not on dynamic ips, so no router between the sipwise and the
asterisk host.
For behind-router setup you need to enable nat for the VOIP-UP sip user,
in sip.conf tell asterisk the external ip (or use STUN or TURN to auto
detect it) and set localnet too. Than set port forwarding in the router:
port 5060 and the port range for rtp (for example 10000-20000). If the
router supports SIP ALG you need to set it off, because you setted
everything manually up, no need to auto modify SIP connection.

BR,
Csaba



2015.02.14. 18:37 keltezéssel, William Fulton írta:
> Thanks for sharing your config info!  
>
> -----Original Message-----
> From: Spce-user [mailto:spce-user-bounces at lists.sipwise.com] On Behalf Of Tóth Csaba
> Sent: Saturday, February 14, 2015 1:24 AM
> To: spce-user at lists.sipwise.com
> Subject: Re: [Spce-user] Trunk for Asterisk on dynamic IP
>
> Hi,
>
> here it is how we do this:
>
> Set Domain:
> inbound_upn to PAI
> outbound_from_user to UPRN or User provided number outbound_pai_user to network provided number
>
> Set Customer:
> External # to the contract number you have
>
> Set Subscriber:
> create main E.164 number as you wish, alias numbers as you wish we create SIP Username to a random string: XYZ321 Set password to random string: PASS987 Set External # if you wish to identify in CDR records the different subscribers for the contract ip_header to X-RealIP e164_to_ruri to yes display_name to the name of teh customer, like "i3 Systems Ltd"
> you can check the allowed_clis contains the DIDs you want to enable for the asterisk to choose from
>
> At asterisk:
> at sip.conf you set this register string:
> register => udp://XYZ321@domain.ltd:PASS987@12.3.4.5/3615779331~30
>
> this means:
> username at domain:password at ip-address/DID~timeout
>
> this is the sip account:
>
> [VOIP-UP]
> type=friend
> fromdomain=domain.ltd
> fromuser=XYZ321
> username=XYZ321
> context=cust-inc
> host=12.3.4.5
> secret=PASS987
> canreinvite=yes
> nat=no
> directmedia=no
> qualify=no
> disallow=all
> allow=alaw
> accountcode=CONTRACT_NUMBER // this is the same as External #
>
>
> in the cust-inc context you can wait the incomings:
> context cust-inc {
>  3615779331 => {
>   COMMANDS...;
>  };
>  3615779332 => {
>   COMMANDS...;
>  };
>  _X. => { // unknown incoming DID
>   Dial(SIP/PHONE-50,,t);
>   Hangup();
>  };
> }
>
> before the dial out we run these commands to set up the real IP address field and the outgoing number:
>
> Set(CDR(accountcode)=CONTRACT_NUMBER);
> Set(CALLERID(num)=3615779332);
> Set(CALLERID(name-charset)=utf8);
> SipAddHeader(P-Asserted-Identity: <sip:3615779332 at domain.ltd>);
> Set(CALLERID(name)="i3 Systems Ltd");
> Set(CALLERID(all)="i3 Systems Ltd <3615779332>"); Set(CALLERPRES()=allowed);
> SIPAddHeader(X-RealIP: ${CHANNEL(recvip)}); Dial(SIP/VOIP-UP/OUTNUM);
>
> if you want the call to be private set this callepres instead:
>
> Set(CALLERPRES()=prohib_passed_screen);
>
> At asterisk you need to set the external IP address well, or set to use STUN, or TURN.
> This works for us.
>
> Hope i helped!
>
> BR,
> Csaba
>
>
>
> 2015.02.14. 8:22 keltezéssel, William Fulton írta:
>> I've dug through the list to find a few posts on using Sipwise with 
>> asterisk PBXs as clients.  This was the most useful.
>>
>>  
>>
>> https://lists.sipwise.com/pipermail/spce-user/2014-October/007319.html
>>
>>  
>>
>> I was wondering if it was possible to make this work in a case where 
>> the asterisk PBX was not on a static public ip address.  Not all 
>> broadband offers this as an option and I was hoping there was an 
>> alternate configuration that would allow whichever IP Address 
>> registers to be a trusted IP, or at least be able to make calls from 
>> the PBX through the sipwise spce.
>>
>>  
>>
>> Any thoughts?
>>
>>  
>>
>> Thank you,
>>
>> William
>>
>>
>>
>> _______________________________________________
>> Spce-user mailing list
>> Spce-user at lists.sipwise.com
>> https://lists.sipwise.com/listinfo/spce-user
>>
> _______________________________________________
> Spce-user mailing list
> Spce-user at lists.sipwise.com
> https://lists.sipwise.com/listinfo/spce-user
>
>

_______________________________________________
Spce-user mailing list
Spce-user at lists.sipwise.com
https://lists.sipwise.com/listinfo/spce-user



More information about the Spce-user mailing list