Please help me work out what would cause an endpoint in pjsip_custom.conf to not be found

Tom, I would point out that technically , both naf and sangoma ‘patch’ ‘official’ asterisk releases to their individual needs, its just horses for courses, and FreePBX (as an open source offering) currently accepts either patched or unpatched ‘versions’ of any ‘asterisk’ if it passes a rudimentary version check. It also runs on any number of linux distributions.

JM2CWAE

OK. So going to Asterisk for support on the patched version equals not a lot of help because it’s a modified version. Going to Sangoma for support on the patched version equals the same thing, It’s not an version they released or tested against.

Splitting hairs doesn’t change the result.

OK. So now you know where your problem is, and when you fix your problem with your configuration, you’ll be able to continue on.

1 Like

If nafs patches work or will eventually , not that i use gv , then the result is in fact changed for those that want to ’ boldy go’.

That they can peacefully coexist with FBX happily is just also a fact.

Hi @Lutiana:

The GV mods that you are using are fairly new to the community (I think it’s probably fair to say that only a handful of users here are overly familiar with it) and I don’t expect any of the regulars will be in a position to assist. It appears that your conf file edits are not being loaded, perhaps one of your edits has a typo. How are you actually editing the conf files?

As to the editorials here that don’t address the issue at hand, we can all see that GV provokes polarizing opinions that some feel free to voice. I think OP has gotten the message. So while the learning process chosen may be more difficult than is strictly necessary, it is definitely one way to expose yourself to the inner workings of the system. OP for your part, if you choose to embark on the road less traveled, it’s reasonable to expect a paucity of travelling companions. Also be aware there are other forums discussing these recent GV mods such as https://www.dslreports.com/forum/voip if you don’t get the expertise here that you need.

2 Likes

Here are the contents of the pjsip custom files. Obviously it’s been sanitized for securities sake, but I have checked and re-checked the removed values to make sure they match what I setup on Google’s end.

/etc/asterisk/pjsip_custom.conf:

; pjsip_custom, Copyright (c) 2018, Ward Mundy & Associates, LLC.
; Licensed for use with NAF’s Asterisk 13 PJSIP patches pursuant to GPL2.

[incoming-registrations-unused-but-required]
type=transport
protocol=udp
bind=0.0.0.0:5065

[global]
type=global
debug=true
keep_alive_interval=90

[transport_tls]
type=transport
protocol=tls
bind=0.0.0.0:5061

/etc/asterisk/pjsip_custom_post.conf:

debug=true
keep_alive_interval=90

[gvsip1]
type=registration
contact_user=GVNumber
outbound_auth=gvsip1
server_uri=sip:obihai.sip.google.com
outbound_proxy=sip:obihai.telephony.goog:5061;transport=tls;lr;hide
client_uri=sip:[email protected]
retry_interval=60
support_path=yes
support_outbound=yes
line=yes
endpoint=gvsip1
contact_additional_params=obn=gvsip1
transport=0.0.0.0-tls
transport_reuse=no

[gvsip1]
type=auth
auth_type=oauth
refresh_token=GoogleToken
oauth_clientid=GoogleOAuthID
oauth_secret=GoogleOAuthSecret
username=gvGVNumber
realm=obihai.sip.google.com

[gvsip1]
type=aor
contact=sip:obihai.sip.google.com

[gvsip1]
type=endpoint
context=from-pstn-e164-us
disallow=all
allow=ulaw
allow=opus
outbound_auth=gvsip1
outbound_proxy=sip:obihai.telephony.goog:5061;transport=tls;lr;hide
aors=gvsip1
direct_media=no
ice_support=yes
rtcp_mux=yes
media_use_received_transport=yes
outbound_registration=gvsip1

Via the terminal, with nano.

Completely understandable. However, I am talking about defining a pjsip end point in a conf file. Something I would hope the more experiences users would be familiar with. The fact that it happens to tie in with the new GV stuff does not appear to relevant to my issue just yet. But then again, maybe it is. I don’t know, hence the ask for help.

I completely understand this, and it does make sense. But to extend you euphemism here, this is more like I chose the road less travelled and when I asked where said road begins people started yelling at me about how I should be taking the other road and not that one without even bothering to to point in the general direction.

But anyways. I get it. GV is the devil and what not. So perhaps people can look on this as me having issues getting a defined PJSIP end point to show up and be useable in Asterisk. Because as near as I can tell this is precisely the issue I am having…

1 Like

there are a couple of roads that have a little rubber (and skid marks) on them, the dslreports one and another one that although is anathema here is apparently fully functional and presents FreePBX with a usable trunk, think of a famous french lounge singer from the 60’s who regrets nothing :wink:

Uhm, why is your gvsip stuff in pjsip_custom_post.conf? Did you not read my entire reply to you the other day when I said that pjsip_custom.conf and pjsip_custom_post.conf are two separate files and do two separate things?

Put your GVSIP stuff in pjsip_custom.conf as all the other instructions say. Having things in the right file does make a difference.

Looking over the content of your files, I can’t tell by looking what the exact issue is, but I am unimpressed by what I see:

  • pjsip_custom.conf shows two transports being created, neither of which is referenced again.
  • the FreePBX generated transport for tls is referenced, do the setup docs indicate the requirement for this to be enabled, settings, Asterisk SIP settings, PJSIP tab.
  • pjsip_custom.conf defines a [global] section which will either supersede or conflict with the global section generated by FreePBX
  • there are two stray lines at the top of pjsip_custom_post.conf which are probably intended to be added to the pre-defined global section, which is a sloppy way of doing things, not to mention that [global] has already been defined earlier.
  • why is pjsip debug enabled by default, that’s an odd choice
  • Not incorrect, but more complex than necessary, the content is split between two files when one will do

Without testing, I can’t see why the above couldn’t be condensed to the following, all placed in pjsip_custom_post.conf

; pjsip_custom, Copyright © 2018, Ward Mundy & Associates, LLC.
; Licensed for use with NAF’s Asterisk 13 PJSIP patches pursuant to GPL2.

[global](+)
; debug=true     ; uncomment for debug
keep_alive_interval=90

[gvsip1]
type=registration
contact_user=GVNumber
outbound_auth=gvsip1
server_uri=sip:obihai.sip.google.com
outbound_proxy=sip:obihai.telephony.goog:5061;transport=tls;lr;hide
client_uri=sip:[email protected]
retry_interval=60
support_path=yes
support_outbound=yes
line=yes
endpoint=gvsip1
contact_additional_params=obn=gvsip1
transport=0.0.0.0-tls
transport_reuse=no

[gvsip1]
type=auth
auth_type=oauth
refresh_token=GoogleToken
oauth_clientid=GoogleOAuthID
oauth_secret=GoogleOAuthSecret
username=gvGVNumber
realm=obihai.sip.google.com

[gvsip1]
type=aor
contact=sip:obihai.sip.google.com

[gvsip1]
type=endpoint
context=from-pstn-e164-us
disallow=all
allow=ulaw
allow=opus
outbound_auth=gvsip1
outbound_proxy=sip:obihai.telephony.goog:5061;transport=tls;lr;hide
aors=gvsip1
direct_media=no
ice_support=yes
rtcp_mux=yes
media_use_received_transport=yes
outbound_registration=gvsip1

After doing a reload, the following grep might give you clues (complete with line numbers) as to why the file won’t load:

grep "/etc/asterisk/pjsip_custom_post.conf" /var/log/asterisk/full

edit - added the copyright/licensing lines initially omitted

3 Likes

I’d would agree with this and suggest the OP go there. I am seeing some just plain wrong information in this thread, but I don’t want to get into a fight with anybody so I’m not going to be any more specific than that. Several of the people in the DSLreports forum already have working systems and can tell you how they did it. I would particularly recommend this thread:

Asterisk Google Voice SIP testing and technical discussion

Start with that thread and read it through. But there are several other threads that also give good information, so you might want to glance through the most recent two or three pages of topics in that forum. I will note that the contents of your /etc/asterisk/pjsip_custom.conf seem to be partially wrong, and that I don’t use that file at all, but all the information you need is in that thread and in other GVSIP related threads in that forum.

Those lines seem like so much BS to me, since they’re essentially copies of what naf published at GitHub - naf419/asterisk at gvsip but with a few very minor changes. But possibly the best reason for keeping them is so some users that don’t care for Mr. Mundy know to avoid.

Are you certain this works? I’ve seen several reports that this syntax, using the (+) to add to a section, simply doesn’t work for PJSIP even though it does in Chan_SIP. But just using the statements at the top of the file, without using the [global](+) section header does work. So when you say,

That’s the reason it’s done that way, the [global](+) syntax just doesn’t work in PJSIP at the present time, but adding the lines at the top of pjsip_custom_post.conf does. This may be a bug of some kind, but in the end you have to go with what works.

It does work for me and it’s easy enough to test yourself. You can check the keep alive value before and after reload with:

asterisk -x "pjsip show settings" | grep keep

You’re right, it does. Good to know. In mine I used:

[global](+)
; debug=true ; uncomment for debug
keep_alive_interval=90
endpoint_identifier_order=auth_username,username,ip

at the start of pjsip_custom_post.conf, did a refresh in FreePBX and then ran pjsip show settings from the Asterisk CLI and saw both of the settings were as they should be. Bit of a mystery why that syntax hasn’t worked for some people. I thought I had tried it about a month ago and it did not work then, but maybe something changed or maybe I just did it wrong.

In case you’re curious, that last setting is something that I found on DSLreports that eliminates problems if you have multiple PJSIP endpoints at the same external IP address.

It’s failed for me in the past, but most times it works as expected:

Now this command is really what I was kind of looking for. It tells me exactly what is going I think and has lead me to believe that my asterisk is actually not the NAF one, so something happened with that step when I started this.

The very first error in the log:

[2018-08-03 15:23:16] ERROR[975] config_options.c: Error parsing auth_type=oauth at line 37 of /etc/asterisk/pjsip_custom.conf

So I am going to try and fix that first by going through that part of the tutorial in the other thread again.

1 Like

Mystery solved. The way that FreePBX generates PJSIP configurations means that the same context is used repeatedly for the different types. So sprinkled over several files will be sections like this:

[fpbx-1-trunk1]
type=endpoint

[fpbx-1-trunk1]
type=registration

[fpbx-1-trunk1]
type=identify

... etc

If a later include has something like this:

[fpbx-1-trunk1](+)

Asterisk doesn’t know which section to add it to, and the included line will probably fail. I don’t know if there is a work around for this or not.

edit - there is now a fix to this issue: Override pjsip.identify.conf - #10 by jcolp

1 Like

OH! that is indeed interesting, I am wondering if it would be better to not use the (+) then, and simply try to include things in the proper order/section? What do you suggest?

I don’t have a suggestion at this point. Avoiding the situation is probably best unless someone smarter than me can make me see where I’m going wrong.

Since the setting is just on the type=auth section and FreePBX controls the context, adding a control in the PJ-SIP screen (“Enable oauh”, maybe) which added the type_auth=oauth to the “type=auth” stanza would be reasonable, I’d think,

What other types are there?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.