How to have dynamic extensions in Asterisk

asterisksipvoip

I have recently swapped VoIP providers. So far so good, but I have ran into one little snag (and I'm honestly not really sure how to ask / Google this).

With my old provider I could have inside my extensions.conf inbound context each of the landing point numbers as such:

exten => _6123456779,1,Goto(1300s,${EXTEN},1) 
exten => _6123456773,1,Goto(1300s,${EXTEN},1)

That worked great, but with my new provider, all the calls go to the /extension in the register function or to extension s.


Old providers sip.conf:

;This comes through as the phone number dialed
register => username:password@10.10.10.10
[CL]
type=peer
host=10.10.10.10
context=from-cl
qualify=yes
disallow=all
allow=ulaw
nat=yes
canreinvite=no
dtmfmode=rfc2833
insecure=port,invite
username=username
authuser=username
secret=password

;This comes through as extension s
New providers sip.conf:

register => phonenumber:password@trunk.engin.com.au

[CL]
auth=phonenumber
username=phonenumber
host=trunk.engin.com.au
secret=password
type=peer
insecure=invite,port 
nat=yes
qualify=yes
dtmfmode=rfc2833
canreinvite=no
disallow=all
allow=ulaw
allow=alaw
allow=g729
defaultexpirey=1800
maxexpirey=3600
context=from-cl

So how do I re-enable this functionality?

Or do I have to do:

register => 6123456770,1:password@trunk.engin.com.au/6123456770
register => 6123456770,1:password@trunk.engin.com.au/6123456771
register => 6123456770,1:password@trunk.engin.com.au/6123456772

etc,etc?

This is the sip INVITE:

<--- SIP read from UDP:10.10.10.10:5060 --->
INVITE sip:s@10.10.10.10:5060 SIP/2.0
Via: SIP/2.0/UDP 10.10.10.10:5060;branch=z9hG4bKl7qoae00agdqjdh18ks0.1
From: <sip:0466666666@voice.mibroadband.com.au;user=phone>;tag=SDl4lp901-1922148923-1430721154048-
To: "Full Name"<sip:6123456771@voice.mibroadband.com.au>
Call-ID: SDl4lp901-8c3fdacbe5fbc40c18c775a59025a687-jm6gpa0020
CSeq: 248522241 INVITE
Contact: <sip:SDgt55b-vp9pm6n1vn1nrhs6gngof0drovpsfkkt000e420@10.10.10.10:5060;transport=udp>
P-Called-Party-ID: <sip:6123456771@voice.mibroadband.com.au>
Supported: 100rel,timer
Allow: ACK,BYE,CANCEL,INFO,INVITE,OPTIONS,PRACK,REFER,NOTIFY,UPDATE
Accept: application/media_control+xml,application/sdp,multipart/mixed
Min-SE: 60
Session-Expires: 1800;refresher=uas
Max-Forwards: 29
Content-Type: application/sdp
Content-Length: 327

v=0
o=BroadWorks 525881593 1 IN IP4 10.10.10.10
s=-
c=IN IP4 10.10.10.10
t=0 0
m=audio 17968 RTP/AVP 8 18 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=maxptime:30
a=sqn: 0
a=cdsc:1 image udptl t38
<------------->

Best Answer

I figured a work around, I'm not terribly happy with it but using this dialplan I can translate the s into a proper extension:

[from-cl]
exten => s,1,NoOp(${SIP_HEADER(To)})
exten => s,n,Set(DID=${SIP_HEADER(To)})
exten => s,n,Set(DID=${CUT(DID,:,2)})
exten => s,n,Set(DID=${CUT(DID,@,1)})
exten => s,n,Goto(from-pstn,${DID},1)

I'm not going to mark this as best answer as this is messy and a workaround