[Spce-user] Trunk for Asterisk on dynamic IP

Tóth Csaba tsabi at tsabi.hu
Sat Feb 14 04:24:09 EST 2015


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
> 



More information about the Spce-user mailing list