Get help with installing, upgrading and running a PBX such as Asterisk.

Advertisement

By Sponsor
User avatar
By Mike999
#5376
I have 2 Voipfone accounts with a number on each account. My PBX is Asterisk/FreePBX 13

Both Trunks are configured and working fine for calls in and out.

However I would like to route calls from one of the numbers (which is on a separate account) to a different destination than the other number. Currently they go through the same inbound route with a blank DID set.

I have tried creating an inbound route with DID set as the voipfone account number (8 digit beginning with 3) but it does not match. It's almost like the DID is not being passed through. I have tried using SIP (with a registration string) and also PJSIP. I have tried various context headers, fromvoipfone, from-pstn and from-pstn-toheader.

Anyone any idea why this may not be working. If I look in the CDR reports of inbound calls, it simply shows the DID as 's'

Thanks,
Mike

Advertisement

By Sponsor
User avatar
By WelshPaul
#5377
Voipfone don't pass the DID through (unless something has changed recently) so set it all up as follows...

TRUNK:
Trunk Name: 3xxxxxxx
Outbound CallerID: by-3xxxxxxx

Trunk Name: 3xxxxxxx

host=sip.voipfone.net
fromdomain=sip.voipfone.net
username=3xxxxxxx
fromuser=3xxxxxxx
authuser=3xxxxxxx
secret=enter your voipfone password here
type=peer
qualify=yes
nat=yes
insecure=very
context=from-pstn
canreinvite=no
disallow=all
allow=alaw
dtmfmode=rfc2833

Register String: 3xxxxxxx:enter your voipfone password [email protected]/3xxxxxxx

INBOUND ROUTE:
Description: 3xxxxxxx
DID Number: 3xxxxxxx

Now under the Set Destination section at the bottom enter the route destination (e.g. Extension 200), save the changes and then apply them. Do this for both Voipfone accounts. :)

3xxxxxxx would be your Voipfone account number obviously... Replace "enter your voipfone password here" with your real Voipfone account password.
User avatar
By VoipIT
#5378
Whilst that's a very good general setup, it sounded from your first post like you are already happy with the in/out config apart from the routing.

sip.conf (or indeed pjsip.conf) is not usually your friend for routing by extension as you will end up identifying voipfone either as anonymous or by ip. However in the dialplan you can use:
Code: Select all
[voipfone-in]
exten => _30000000*200,1,Goto(FredsPhone,s,1)
exten => _30000000*201,1,Goto(BillsPhone,s,1)
or the freepbx equivalent (I am hazy on FreePBX as I got fed up with it - if you can't do any of these things directly in freePBX then use its _custom context files to make your voipfone in context and feed it back into the context it wants you to use). Post if you are stuck on this and I will dig out how we used to do it a long, long time ago ;-)

Another cool trick with voipfone is to set your inbound numbers to 'Name & calling number' in 'Inbound Number Setup' then apply a label to each line in the Name box (e.g. BillsLine) - this allows you to test incoming calls using ${CALLERID(name)}=BillsLine and route accordingly (again I fear this will need some real code rather freePBX clicks) or an even simpler:
Code: Select all
[voipfone-in]
exten => _30000000*20X,1,Goto(trunk-in-context,from-${CALLERID(name)},1) 
[trunk-in-context]
exten => from-BillsLine,1,Playback(en_GB/tt-monty-knights)
exten => from-FredsLine,1,Hangup()
You could almost certainly manage the trunk-in-context using the standard freePBX tools...(but don't, vim is your friend)

Hello, It could be the SPA122 that's faulty, the …

VOIP JOB needed

This is an independent VoIP forum, we are not a Vo…

Newbie help!

I recommend Voipfone! They offer a pay go service …

Gigaset N300A IP

@VoipIT I doubt it. From my understanding ther…

Sign up for full membership