PJSIP and ISP SIP trunk


Being PJSIP the next preferred choice, no particular problems are met in registering SIP phones
When an ISP provides you a SIP trunk, instead, no immediate registration is possible as with standard SIP protocol.

Is there any “SIPtoPJSIP trunk howto” available somewhere ?

Thank you

(Simon Telephonics) #2

What does this mean?

(Jared Busch) #3

That he has no idea what he is saying.

Edit: Because flagged for truth

(Communication Technologies) #4

Are you asking if you have setup X for a working CHAN trunk, how do you take that CHAN configuration and make it work on a PJSIP configuration? If yes, we are having the same trouble translating our Avaya SM Chan trunk to a an PJSIP trunk. We are still trying to figure that out.

(Simon Telephonics) #5

I think this is the wrong approach since the stacks work a little differently and there’s not a one-for-one configuration option translation. Better to understand the specifications of the trunk and set it up in PJSIP afresh.


My bad…

I mean when I try to register a new ISP SIP trunk in a fresh Freepbx (PJSIP on port 5060) I can’t get it work (no matching endpoint found) due to port 5061 instead of 5060 an vice-versa.
I suppose is a very common scenario : ISP asks only for a SIP protocol on port 5060

For now (because of hurry) I switched all back to SIP(5060)

(Simon Telephonics) #7

Just disable chan_sip altogether (in Advanced Settings) and set PJSIP to 5060 (Asterisk SIP Settings).

Then when you are in less of a hurry learn about ports.


Latest distros born already this way (PJSIP on 5060) isn’t it ?
That’s where the problem came from…

(Simon Telephonics) #9

PJSIP on 5060 is not the problem. The problem is that you are confused because there are two SIP stacks and you don’t understand port assignments. So I am recommending you disable one of the stacks–chan_sip, since you are asking here about pjsip–and then set PJSIP to the standard ports and proceed with configuration.


In general:
register => user[:secret[:authuser]]@host[:port][/extension]


Username: user
Auth username: authuser
Secret: secret
SIP Server: host
SIP Server Port: port
Contact User: extension

If you are saying that registration is apparently ok but incoming calls fail with (no matching endpoint found), this most likely has nothing to do with ports. Set Match (Permit) to the list of IP addresses from which the provider can send calls.


Surely :slight_smile: , so what’s the right way to proceed with latest fresh installation when SIP protocol is asked by ISP ?
SIP or PJSIP trunk on Freepbx side ?


I would start with a pjsip trunk and see what errors I get. They are usually easy to resolve. If you have a lot of trouble and this forum doesn’t help, switching to chan_sip makes sense.

BTW, if you have a static IP address and the provider doesn’t require registration, don’t use it. IP auth is simpler and more robust.


Ok, somewhat clearer now…
I got my new test distro with default PJSIP on 5060
I set up a PJSIP trunk against ISP “SIP trunk” , I got it registered and working for incoming calls.
For outgoing calls i get an error:

Called PJSIP/067345364@PJSIPtrunk
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [s@macro-dialout-trunk:35] NoOp(“PJSIP/501-0000000a”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 21”) in new stack

Any idea ?

(Itzik) #14

The PBX cannot reach your SIP Provider.

Please post screenshots of your trunk config.
Also, in the Asterisk CLI run:

pjsip set logger on

Reproduce the issue, upload the output to pastebin.freepbx.org and post it here.


SIP/2.0 403 Blocked user :smile:


Post the working chan_sip settings and we’ll try to translate into pjsip. Make it clear what each parameter is, for example


It wasn’t working with chan_sip neither, solved with ISP.
Despite this “technical accident” all seems ok !

Can someone explain briefly the following PJSIP-ADVANCED fields ?

Client URI
Server URI
AOR Contact

They are automatically generated if left blank.
When they should be declared ?

(Jared Busch) #18

When your provider tells you.


I spoken too soon…

After 30 seconds calls drop, seems to be a well known issue but I haven’t understood if it is solvable or not…


3809009494 is the external caller that calls pbx number 042136234

(Simon Telephonics) #20

Set your external IP address in Asterisk SIP Settings.