SOLVED Outbound calls to Vitelity going to inbound server

Jonathan W

New Member
Joined
Jul 6, 2015
Messages
10
Reaction score
0
Running Incredible PBX on a Raspberry pi 2
Linux incrediblepi 3.18.11-v7+
Asterisk/11.17.1
Asterisk GUI-version : SVN-branch-2.0-r5220
I'm using Vitelity, and everything seemed to be working just fine. I had periodically (1 per month or so) been getting a recording from Asterix that said "That number has not yet been assigned". After restarting I was again able to get calls out. Just this week though, it started happening frequently and a restart did not help matters. About 1 in 5 calls makes it, but the rest do not.
The Asterix log shows the following entry whenever the error appears:
[Oct 20 11:48:56] NOTICE[3628][C-0000001e] chan_sip.c: Failed to authenticate on INVITE to '"Jonathan Waggoner" ;tag=as59280d3c'
According to Vitelity, my outbound calls are going to their inbound server, which sends back an error 603 since it's not meant to get outbound calls. I tried explicitly defining the outbound settings in sip.conf, based on the Asterix recommendations by Vitelity:
[outbound] type=friend
dtmfmode=auto
host=outbound.vitelity.net
username=XXXXXXXXX
fromuser=XXXXXXXXX
secret=XXXXXXXXX
trustrpid=yes
sendrpid=yes
allow=all
canreinvite=no

So how should I go about checking to see where my outbound calls are getting routed to the inbound server? Start at extensions.conf and work from there, or is there something else?
 
Joined
Nov 14, 2008
Messages
1,398
Reaction score
320
You should be doing all this from the gui and not individual configuration files. Trunks need to be set up for outgoing and incoming calls but only outgoing trunks have outgoing routes to them based on whats being dialed.
 

Jonathan W

New Member
Joined
Jul 6, 2015
Messages
10
Reaction score
0
I did set it all up in the GUI initially. The only time I got into the config files was when the error 603 started happening often. However, pointing this out doesn't help the discussion or get at an answer to my question. Why are my calls often going to the incoming server and not the outgoing? Is there somewhere (GUI or otherwise) that I should be looking at to get to the root of this?
 

Dave Gray

Guru
Joined
May 22, 2013
Messages
150
Reaction score
60
You'll need to get a look at the Asterisk log and see how a call gets routed.
 

Jonathan W

New Member
Joined
Jul 6, 2015
Messages
10
Reaction score
0
OK, I'm on that. Funny how just when you set debug logging it works, and then doesn't when you turn it off. So I've got a successful call's debug log, now to catch it breaking and compare the two. Are there certain keywords I should be looking for in the selection of which server to connect for outbound call routes? At about 64K per call it's a massive wall of text to sort through.
 

Jonathan W

New Member
Joined
Jul 6, 2015
Messages
10
Reaction score
0
I got a debug log file for a call that doesn't go through (i.e. "That number has not yet been assigned" plays). It doesn't tell me any more than I already know, which is that the outbound calls are getting routed to the inbound Vitelity server, which responds with an error 603 (their "wrong server" response). The PBX (version in first post) is 10.1.10.192, the Polycom VVX 310 I'm using is extension 24 at 10.1.10.196. The outbound caller ID is obfuscated to 5557654321. The number I called is local within the US, but we dial 10-digit numbers. In the log I've obfuscated it to 5551234567. Here's my observations, and then the log in the hopes that someone can see something I'm missing.

1. Phone picks up fine, and sets the extension to unavailable.
2. CID, etc. sets correctly for phone.
3. Server hits DialPlanMain for the outbound number, and sends it to outbound-allroutes, which I assume is the one in extensions_custom.conf
4. On Launching 'Dial' channel.c complains about having to channel type registered for 'Motif', but I see that when the call goes through as well. This looks like an attempt to use Google Voice, which isn't set up on this server.
5. The call then sets up to go to Vitelity.
6. acl.c finally shows up with an IP address to send the call too, but it happens to be inbound33.vitelity.net (66.241.99.22), where I believe it should have been 64.2.142.187, which is outbound.vitelity.net.
7. There's some negotiation of protocol
8. After the protocols chan_sip.c sends the request and gets "SIP response 603 "Declined" back from 66.241.99.22:5060", which I've been told by Vitelity is because I'm sending an outbound call to the wrong server.
9. When chan_sip tries to acknowledge the 603, Vitelity has already hung up.
10. Asterix then tries to use lesnet, didLogic, CallCentric, etc. from the outbound-allroutes list, with the expected failure to connect and eventual hangup on my extension, but I don't see where it plays the "not yet assigned" sound file.

My big question is why does outbound-allroutes use inbound33.vitelity.net and where do I set the correct outbound server for Vitelity? The trunk setup is the only place I see for setting the server address, but if I change it to outbound.vitelity.net I get a failure to register.

edit: apparently the log file (800+ lines) is too big to post, but hopefully my synopsis above is good enough
 
Last edited:

MGD4me

Guru
Joined
Feb 3, 2009
Messages
505
Reaction score
109
Let's have a look at your Outbound Route for your 10-digit dial pattern.
 

Jonathan W

New Member
Joined
Jul 6, 2015
Messages
10
Reaction score
0
Here's my [outbound-allroutes] from extensions_custom.conf:

[outbound-allroutes]
exten => _.,1,Noop(SIPDOMAIN=${SIPDOMAIN})
exten => _.,n,Set(FROM_IP=${CUT(CUT(CUT(SIP_HEADER(From),>,1),@,2),:,1)})
exten => _.,n,GotoIf($["${SIPDOMAIN}"!="${FROM_IP}"]?hangup,1)
exten => _NXXNXXXXXX,n,Set(CALLERID(num)=${CID_allroutes})
exten => _NXXNXXXXXX,n,Dial(Motif/GoogleVoice/1${EXTEN}@voice.google.com)
exten => _NXXNXXXXXX,n,Dial(${Vitelity}/${EXTEN})
exten => _NXXNXXXXXX,n,Dial(${lesnet_peer}/1${EXTEN})
exten => _NXXNXXXXXX,n,Dial(${didlogic}/1${EXTEN})
exten => _NXXNXXXXXX,n,Dial(${CallCentric}/1${EXTEN})
exten => _NXXNXXXXXX,n,Dial(${FutureNine}/1${EXTEN})
exten => _NXXNXXXXXX,n,Dial(SIP/${AnveoPIN}1${EXTEN}@sbc.anveo.com)
exten => _NXXNXXXXXX,n,Dial(${voipms}/${EXTEN})
exten => _NXXNXXXXXX,n,Dial(${ipcomms}/${EXTEN})
exten => _NXXNXXXXXX,n,Hangup


I don't understand where the ${Vitelity} is being fully defined in this context. In extensions.conf "Vitelity = SIP/Vitelity", but then there's no further mention of SIP/Vitelity in any of those files. I feel like that's the direction to look, seeing as how ${Vitelity} appears to be where the outbound call is going.
 

Jonathan W

New Member
Joined
Jul 6, 2015
Messages
10
Reaction score
0
OK, I think I've found a way to make calls go to the correct outbound server. It looks like SIP/Vitelity was never actually defined in sip.conf. Not sure where the inbound server was getting pulled, but maybe Asterisk just pulls it from the registration? Here's what I ended up doing:
In extensions.conf I redefined the Vitelity variable to SIP/VitelityOut
In sip.conf I added a VitelityOut peer using the settings that Vitelity has on the Asterisk support page like this:

[VitelityOut]
type=friend
dtmfmode=auto
host=outbound.vitelity.net
username=XXXXXXX
fromuser=XXXXXXX
secret=XXXXXXX
trustrpid=yes
sendrpid=yes
allow=all
canreinvite=no

After reloading sip and dialplan the logs show calls going to the correct server! YAY!

Now for the part where I try to figure out why I had to edit a config file directly instead of using the GUI. I'm concerned that the GUI may overwrite these changes and I suddenly fall back to outgoing calls to the wrong server. Where are the controls on sip.conf in the GUI? I can't seem to find the location where I can define the above sip context.
 

geopeterwc

Guru
Joined
Aug 17, 2010
Messages
385
Reaction score
131
Why are you editing the sip.conf file???

You're making the configuration of your Vitelity DIDs far more complicated than is necessary. For one, I have found no reasonable requirement that you have to create separate profiles for incoming and outgoing services on your DID from Vitelity. Simply, configure both the incoming and outgoing aspect of the DID on the same trunk profile, according to the following. I do this with all of my Vitelity services, and this works reliably on several servers.

Getting it all together can be confusing ... but things get simpler if you give the DID and the outgoing and incoming aspects of the DID names names you'll remember, as this helps you to identify the DID when you are configuring routing: the name shows up in the Connectivity | Incoming Routes and Outgoing Routes sections of the Incredible GUI

For example:
Trunk Name: Vitel-4999 (the last four digits of the DID)

Outgoing Settings:
Trunk Name: V4999-out (again, using the last four digits of the DID)
Peer Details:
username=your subaccount name
type=friend
trustrpid=yes
sendrpid=yes
secret=your password
host=outbound.vitelity.net
fromuser=your subaccount name
disallow=all
dtmfmode=auto
context=from-trunk
canreinvite=no
allow=ulaw

Incoming Settings:
User Context: V4999-in
User Details:
username=your subaccount name
type=friend
t38pt_udptl=no
t38pt_tcp=no
t38pt_rtp=no
secret=your password
insecure=port,invite
host=inboundnn.vitelity.net <Vitelity will tell you the value for nn
disallow=all
dtmfmode=auto
context=from-trunk
canreinvite=no
allow=ulaw

Registration String:
subaccount:password@inboundnn.vitelity.net:5060/NXXNXX4999

/Pete./
 
Last edited:

Jonathan W

New Member
Joined
Jul 6, 2015
Messages
10
Reaction score
0
I'm editing sip.conf because I can't intuitively tell where exactly in the GUI to set up my outbound trunk correctly. Being familiar enough with Linux to edit things directly, that's where I went to find out what makes it all tick. Of course, I'm worried the GUI will overwrite my changes in the future, so I'm trying to figure out how to make my changes from within the GUI.

So in IPBX is it the "Trunks" -> "VOIP Trunks" section that controls entries in sip.conf? This section was originally auto-populated when I added my Vitelity registration, and I've got in my notes here that I did change that section to point at outbound.vitelity.net without success. Seems like it keeps wanting to rename the trunk to "Vitelity ; GUI metadata" regardless of what I call it.

Of course, in my hair-pulling-it's-not-working episode I may have had a typo or something silly...
 

geopeterwc

Guru
Joined
Aug 17, 2010
Messages
385
Reaction score
131
Use the GUI, my friend! You'll note that on opening the sip.conf file that you're warned:
;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
; this file must be done via the web gui. There are alternative files to make ;
; custom modifications, details at: http://freepbx.org/configuration_files ;
;--------------------------------------------------------------------------------;

If you make edits to the sip.conf file, and then attempt to make other changes to the configuration with the GUI, your edits will be gone. You can't have it both ways. Could cause you to go bald if you don't heed the warning.

Yup ... Connectivity | Trunks is where you create and edit the SIP trunks. Vitelity trunks are CHAN_SIP ... so launch that, and input-away. Follow my suggestions in the settings for the Vitelity DID - you did make sure that on the Vitelity web site that you've assigned the DID to a sub-account? and that the DID is routing to a SIP SERVER? (there are other ways, too ... but this works.) Armed with the detail, fill in the appropriate fields of the trunk definition panel of the GUI ... "submit changes" at the bottom of the panel ... the red "Apply Changes" at the top of the resulting panel, and you should be done with your configuration of the trunk.

Then set up your incoming and outgoing routes and you should be "done" with your trunks. Note that you'll have to specify the extension (or ring group) that you want to receive incoming calls.

Specify the "dial patterns that will utilize this route" in your outgoing route, and then select the trunks (in the order that you want, if you have multiple DIDs) in the "Trunk Sequence for Matched Routes" and you should be in business.

/Pete./
 

john p

Member
Joined
Jul 9, 2013
Messages
82
Reaction score
6
I've used Vitelity for a few years & after more than a year without issues I had a similar problem. My recollection is that Vitelity TS told me they needed separate in/out trunks configured at the PBX & outbound trunks should not register as it confuses their system. So I removed the registration string from the outbound trunk & my GUI shows 1 more trunk total than registered. With these settings it works for me. Also, I did not see it in your post but AFAIK you need an outbound route using the vitelity outbound trunk. Hope this helps.
 

Attachments

  • gui-stats.jpg
    gui-stats.jpg
    10.5 KB · Views: 6

geopeterwc

Guru
Joined
Aug 17, 2010
Messages
385
Reaction score
131
I hear what you're saying @john p ... but for as long as I've been playing with PIAF - and it's been a few years now - I've configured both the incoming and outgoing aspects of my DIDs on the same configuration panel in the FreePBX GUI. Agreed, the configuration information that's on Vitelity's web site that outlines how to configure DIDs shows separate incoming and outgoing detail - and there is no reason for you to configure your DID any differently or my way. I just know that my way does work on iPBXs with multiple DIDs and extensions without problems.

You'll notice that the information in the Outgoing Settings (Peer Settings) and the Incoming Settings (User Details) in my example are similar both identify the same UserID (SubAccount) and Password. But only the Incoming aspect of the configuration panel identifies the Vitelity server that sources calls to my Incredible PBX. The RaspPi2 configuration that @Jonathan W is using - I have set up and tested the same image on my own Pi2, with multiple Vitelity DIDs and SIP extensions - and it works flawlessly with Vitelity as I've described above.

/Pete./
 

Jonathan W

New Member
Joined
Jul 6, 2015
Messages
10
Reaction score
0
Great, totally appreciate the help @geopeterwc, and when the system isn't under load (i.e. when everyone else is off for Veteran's Day tomorrow) I'll get those settings tightened up in the GUI. Following proper backups, of course. I'd really like to start removing the extra extensions and trunk definitions.

I do think it's been helped me greatly to have read through the config files in order to further my knowledge of how Asterisk is working and configured to talk to Vitelity. Now of course, I've got to understand how the GUI impacts the configurations in order to keep things simple.
 
Last edited:

Members online

No members online now.

Forum statistics

Threads
25,845
Messages
167,970
Members
19,265
Latest member
muneer
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