Allow/disallow in pjsip.endpoint.conf

Distro Stable-6.12.65 64bit installed with Asterisk 13.

An example of pjsip.endpoint.conf produced…

[101]
type=endpoint
aors=101
auth=101-auth
allow=g722
disallow=all
context=from-internal
callerid=device <101>
dtmf_mode=rfc4733
use_avpf=no
ice_support=no
media_use_received_transport=no
trust_id_inbound=yes
send_pai=yes
rtp_symmetric=yes
rewrite_contact=yes

Is the order of allow/disallow correct?

yes, the ordering is irrelevant. Internally disallow is always first, followed by allow. If you think there is an error with this then let me know!

Must be an Asterisk error then.

As you see it there, a call from the phone at 101 to *65 returns a 488 - Not acceptable here error.

Removing all from disallow allows the call to go ahead using the g722 codec.

Yeah, ‘disallow=all’ means ‘I explicitly don’t want to use this codec, no matter what’. What you mean to have is ‘disallow’ = blank, and ‘allow’ = g722,ulaw,alaw

Which means it’ll only allow those three codecs, in that order of preference.

So there is a difference in how this works between sip and pjsip?

Yes. The summary is ‘don’t use deny=all, because that’s what it’ll do’ :sunglasses:

Probably a typo but deny is for IP addresses.

And what is being said doesn’t go with this document >> https://wiki.asterisk.org/wiki/display/AST/Migrating+from+chan_sip+to+res_pjsip

My take on this is that FreePBX is placing the Allow/Disallow entries in the wrong order.

Sorry, yes, disallow, not deny.

Um… that’s not how I remember the documentation being written, but that IS what it says. If you swap them around in /etc/asterisk/pjsip* does it work the way you expect?

1 Like

Yes. Just ran through this.

allow=g722
disallow=all

^^^ Call fails.

disallow=all
allow=g722

^^^ Call goes through.

Then file a bug and we will fix it