Problem with voicenetwork.ca SIP trunk

freaky al

New Member
Joined
Dec 7, 2011
Messages
13
Reaction score
0
Hello,

I have been trying for a while to get my SIP trunks working without any luck and am hoping that someone can help me out. If there is a solution for this here already, sorry in advance for not finding it.

I am using the latest PIAF2 image with FreePBX 2.9 and Asterisk 10 on an Asus EEE PC.

My problem is that inbound and outbound calls on my Voice Network trunk don't connect. I get ringing, but when the call is answered the originating end keeps ringing. On inbound calls the Asterisk console shows the messages and I watch it sent to voicemail when the call is declined, where an empty voicemail is created.

I have the following ports forwarded in my Dlink DIR-615 router:
TCP: 5060-5061
UDP: 4659, 5000-5082, 10000-20000


I tried using the Dynamic IP/NAT settings in "Asterisk SIP Settings" (using no-ip.com and dlinkddns.com) without any luck, so I used the following in sip_custom.conf as per Ward's post on knol.google.com with his ip.sh script in /var/lib/asterisk/agi-bin:
externip=<my.external.ip.address>
localnet=192.168.0.0/255.255.255.0
nat=yes


Voice Network has a customer portal with recommended incoming and outgoing settings for Asterisk and Trixbox 2.6. I have tried the Trixbox config (since it uses FreePBX) and variations by adding from the Asterisk config without any luck. Currently I am using the following in my trunk config:
[Outgoing Settings]
host=sip.voicenetwork.ca
fromdomain=voicenetwork.ca
context=from-trunk
type=friend
username=<my.username>
fromuser=<my.username>
secret=<my.password>
dtmfmode=rfc2833
disallow=all
allow=ulaw
sendrpid=yes
qualify=yes
canreinvite=no
insecure=port,invite
[Incoming Settings]
type=peer
host=sip.voicenetwork.ca
fromuser=<my.username>
dtmfmode=rfc2833
disallow=all
allow=ulaw
qualify=yes
canreinvite=no
context=from-trunk


I have looked through the various configs and can't find reference to the "from-trunk" context.

Also, In the recommended Asterisk settings on the Voice Network portal there is this:
; To use VoiceNetwork.ca to termination your calls
; add the following line to your extensions.conf file
;
exten => _X.,1,Dial(SIP/voicenetwork-out/${EXTEN})

Where "voicenetwork-out" is the header of the outgoing settings in sip.conf:
[voicenetwork-out]
host= sip.voicenetwork.ca
type=friend
username=<my.username>
fromuser=<my.username>
fromdomain=voicenetwork.ca
sendrpid=yes
qualify=no
secret=<my.password>
dtmfmode=rfc2833
disallow=all
allow=ulaw
context=voicenetwork-incoming ; incoming DID calls will arrive in the voicenetwork-incoming context
insecure=port,invite


Thanks for your time,
Al
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
[Outgoing Settings]
host=sip.voicenetwork.ca
fromdomain=voicenetwork.ca
context=from-trunk
type=friend
username=<my.username>
fromuser=<my.username>
secret=<my.password>
dtmfmode=rfc2833
disallow=all
allow=ulaw
sendrpid=yes
qualify=yes
canreinvite=no
insecure=port,invite
Those look fine...
[Incoming Settings]
type=peer
host=sip.voicenetwork.ca
fromuser=<my.username>
dtmfmode=rfc2833
disallow=all
allow=ulaw
qualify=yes
canreinvite=no
context=from-trunk

Are you sure you need those? Most of my SIP trunks don't have any incoming settings.

I have looked through the various configs and can't find reference to the "from-trunk" context.
It just works. Don't worry.

Also, In the recommended Asterisk settings on the Voice Network portal there is this:
; To use VoiceNetwork.ca to termination your calls
; add the following line to your extensions.conf file
;
exten => _X.,1,Dial(SIP/voicenetwork-out/${EXTEN})

Where "voicenetwork-out" is the header of the outgoing settings in sip.conf:
[voicenetwork-out]
host= sip.voicenetwork.ca
type=friend
username=<my.username>
fromuser=<my.username>
fromdomain=voicenetwork.ca
sendrpid=yes
qualify=no
secret=<my.password>
dtmfmode=rfc2833
disallow=all
allow=ulaw
context=voicenetwork-incoming ; incoming DID calls will arrive in the voicenetwork-incoming context
insecure=port,invite

You don't need that. That is if you didn't have FreePBX. The line they gave you is the equivalent to an outbound route. You also don't need the voicenetwork-out thing either. Redundant. Additionally, you should NEVER edit either the SIP.conf or extensions.conf because any edits will be removed upon Applying Config Changes in FreePBX. Any edits go into sip_custom.conf (IIRC) and extensions_custom.conf

Thanks for your time,
Al
See above replies in red.
 

freaky al

New Member
Joined
Dec 7, 2011
Messages
13
Reaction score
0
Pretty sure the Dlinks have a SIP ALG (Application layer Gateway), try disabling it.

http://www.voip-info.org/wiki/view/Routers+SIP+ALG
tbrummell:
When I disabled it my trunk wouldn't register and the Bria client on my iPhone (via WiFi) kept timing out. So, I re-enabled it. I did notice that the setting for UDP Endpoint Filtering was set to "Address Restricted". The other options are "Endpoint Independent" and "Address and Port Restricted". From what I can gather "Address Restricted" allows remote connections establish locally to respond on different ports, but only if they come from the same address.
 

freaky al

New Member
Joined
Dec 7, 2011
Messages
13
Reaction score
0
rossiv:

[Incoming Settings]
type=peer
host=sip.voicenetwork.ca
fromuser=<my.username>
dtmfmode=rfc2833
disallow=all
allow=ulaw
qualify=yes
canreinvite=no
context=from-trunk

Are you sure you need those? Most of my SIP trunks don't have any incoming settings.
You are recommending removing the all the settings for "User Context" and "User Details" in the Trunk configuration within FreePBX?

EDIT: I modified the Trunk settings and only used values for "Outgoing Settings". Calls still don't connect when answered.

I have looked through the various configs and can't find reference to the "from-trunk" context.
It just works. Don't worry.
I thought as much, but just wanted to double check.

You don't need that. That is if you didn't have FreePBX. The line they gave you is the equivalent to an outbound route. You also don't need the voicenetwork-out thing either. Redundant. Additionally, you should NEVER edit either the SIP.conf or extensions.conf because any edits will be removed upon Applying Config Changes in FreePBX. Any edits go into sip_custom.conf (IIRC) and extensions_custom.conf
I brought that up because I was trying to be thorough. Thanks for the reminder to always use the *_custom.conf file.
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
Yes, remove the User Context and User Details just to see. It *shouldn't* do anything, but you never know. Of course, keep it saved somewhere so you can put it back.

What do you hear on the receiving end of an outbound call?
 

freaky al

New Member
Joined
Dec 7, 2011
Messages
13
Reaction score
0
No luck. I restored the settings easily enough by copying them from this thread. :wink5:

The originator just gets ringing and the receiving end gets dead air, no sound whatsoever.

EDIT:
My next thought is to connect the server directly to the internet. I have configured pppoe on it for eth0 (which is currently down/offline) and am using wlan0 for LAN connectivity, for just this reason. I will have to play around with it though because during the pppoe testing I couldn't remote in since it really locked down the firewall. Will have to configure it as a router also since my ISP only gives me one IP. But that can come later. I have a feeling the router is playing nice.
 

MGD4me

Guru
Joined
Feb 3, 2009
Messages
505
Reaction score
109
Sorry, but...

Re: the receiving end gets dead air, no sound whatsoever.

Sorry to be so anal, but... the phone at the 'receiving end' must ring first, no?? And then a person answers, and there is 'no sound'. One way, or both? If the far end phone does ring, that would *suggest* that the signaling is working, and there is a problem *only* with the audio ports. Unless you have phones at a remote site acting as extensions to your PBX you don't even need to bother with opening up ports on the router. Once your trunk is registered with 'voicenetwork' that is all you really need.

Also, as rossiv points out, since you have declared "type=friend" in your Outgoing Settings, then the Incoming Settings aren't really needed, but if used will show up as a separate incoming trunk on the 'FOP panel'.

It looks like you are trying to hand edit a bunch of files as well as configure your trunk via FreePBX. Just use FreePBX and let it do it's magic.
 

freaky al

New Member
Joined
Dec 7, 2011
Messages
13
Reaction score
0
MGD4me:

Sorry to be so anal, but... the phone at the 'receiving end' must ring first, no?? And then a person answers, and there is 'no sound'. One way, or both? If the far end phone does ring, that would *suggest* that the signaling is working, and there is a problem *only* with the audio ports.
The phone on the callee side rings first and then when answered it is silent with no audio. Sorry, I wasn't clear enough. My concern that the signalling isn't complete is that the caller side continues to ring after the callee answers. I have done a tshark (wireshark) capture at the cli and it shows the SIP signals back and for, but the RTP packets are outgoing from the PIAF2 server only with nothing returning.

Also, as rossiv points out, since you have declared "type=friend" in your Outgoing Settings, then the Incoming Settings aren't really needed, but if used will show up as a separate incoming trunk on the 'FOP panel'.
I do get two trunk show in the FOP panel. I'll remove the settings as rossiv suggested.

It looks like you are trying to hand edit a bunch of files as well as configure your trunk via FreePBX. Just use FreePBX and let it do it's magic.
I have lost count of how many times that I have reinstalled PIAF on this box, and am starting to grasp at straws a bit. :banghead: Currently the only conf file modified is sip_custom.conf as mentioned previously. I will delete those settings, remove ip.sh from crontab, and go back to the Dynamic IP/NAT settings in "Asterisk SIP Settings".

From what I have learned from this thread it makes me think that the router is my problem, and it's SIP ALG funtionality. I find it wierd that I can't register the trunk when it is disabled even though the ports are forwarded.
 

atsak

Guru
Joined
Sep 7, 2009
Messages
2,381
Reaction score
436
I have done a tshark (wireshark) capture at the cli and it shows the SIP signals back and for, but the RTP packets are outgoing from the PIAF2 server only with nothing returning.

From what I have learned from this thread it makes me think that the router is my problem, and it's SIP ALG funtionality. I find it wierd that I can't register the trunk when it is disabled even though the ports are forwarded.

Almost certainly your router, or your ISP is blocking the packets. If tshark isn't showing you the RTP coming back, that's the problem.

Turn off ALG, and straight forward the ports . . .
 

freaky al

New Member
Joined
Dec 7, 2011
Messages
13
Reaction score
0
Turn off ALG, and straight forward the ports . . .

atsak:
When I disable SIP ALG with forwarded ports the trunk won't register. I am going to put the DD-WRT firmware on to my Dlink DIR-615.

Time to pull out the big stick. :D
 

freaky al

New Member
Joined
Dec 7, 2011
Messages
13
Reaction score
0
It was the SIP ALG thing for sure. :tazb:

Once I put the DD-WRT firmware on the router and configured the ports, the trunk came up right away and test calls are behaving as expected.

Huge thanks to all of you for your help!!!!
:party:
 

MGD4me

Guru
Joined
Feb 3, 2009
Messages
505
Reaction score
109
Way to go...

If at first it doesn't work, get a bigger hammer! Glad you finally found the problem.

Good luck with the rest...
 

Members online

No members online now.

Forum statistics

Threads
25,782
Messages
167,509
Members
19,202
Latest member
pbxnewguy
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top