Unable to make outbound SIP URI calls from FreePBX using PJSIP

I’m trying to set up outbound SIP URI calls from FreePBX (version 15.0.37.5) using PJSIP, but I’m running into issues. I am trying to use a 4 digit extension to place the call to sip:[email protected] as a test, but I keep getting a “all circuits busy” message. Here’s what I’ve done so far:

  1. Created a custom trunk in FreePBX with the following dial string:
    PJSIP/sips:[email protected]

  2. Added the following to my pjsip_custom.conf:

    [iptel.org]
    type=endpoint
    context=from-internal
    disallow=all
    allow=ulaw,alaw
    direct_media=no
    dtmf_mode=rfc4733
    send_pai=yes
    rtp_symmetric=yes
    force_rport=yes
    rewrite_contact=yes
    from_domain=iptel.org
    aors=iptel.org
    outbound_auth=
    transport=tcp-transport

    [iptel.org]
    type=aor
    contact=sips:iptel.org

    [iptel.org]
    type=identify
    endpoint=iptel.org
    match=iptel.org

    [tcp-transport]
    type=transport
    protocol=tcp
    bind=0.0.0.0:5160
    tos=96
    cos=3

  3. Modified my dialplan in extensions_custom.conf:

    [sipuri-custom]
    exten => _61696.,1,NoOp(Dialing SIP URI: ${EXTEN})
    same => n,Dial(PJSIP/sip:[email protected],300,T)

  4. Reloaded PJSIP and the dialplan.

When I make a test call by dialing my 6 digit extension, I get a “all circuits busy” message. The Asterisk logs show:

VERBOSE[32725][C-0000067e] app_dial.c: Called PJSIP/sip:[email protected]
VERBOSE[32725][C-0000067e] app_dial.c: Everyone is busy/congested at this time (1:0/1/0)

I’ve verified that my firewall allows outbound connections on the appropriate ports, and I can successfully make this call using a softphone like Zoiper.

Has anyone successfully set up outbound SIP URI calls from FreePBX using PJSIP? What am I missing or doing wrong?

Any help or guidance would be greatly appreciated!

(I’ve also tried allowing anonymous sip calls, setting up a custom extension with a dial string, I can call the sipuri from a softphone not connected to my server without any issues)

You should ask iptel.org why TCP calls to [email protected]:5160 are being rejected from your external IP, we can’t guess.

This is not the correct dial string for URI dialing in PJSIP. The format is:

PJSIP/<endpoint>/<URI>

You have other problems with this though. “sips” is for TLS based dialing, not for TCP dialing so the URI scheme should be “sip” in all the places. Since you have an explicit TCP transport configured on the endpoint it should choose TCP. You could also leave out the explicit transport and specify it in the URI instead using:

sip:iptel.org\;transport=tcp

Or just don’t configure a transport or specify it in the URI and SRV/NAPTR will occur.

So to recap if you want to do URI based dialing it is:

PJSIP/iptel.org/sip:[email protected]

You do have an AOR configured however so it could even be:

PJSIP/[email protected]

And it would use the contact from the AOR.

If the call fails you’d need to provide logging and an updated configuration.

When attempting to make a call from a standard softphone (zoiper) from the same IP by just putting in the SIP URI, it completes successfully.

I don’t think the request is making it out of my freepbx system when trying. But I am hair too out of my depth here to know.

I’ve also tried UDP and TCP but I don’t know if my configurations are correct (in fact I’m sure they aren’t)

Basically I’m back at square one of, regardless of the config I’ve pasted above, how does one properly configure the ability to, by dialing an extension or code, place a URI call from inside freepbx (other registered extension, inbound route etc) to an external sip uri

From what I’ve read on other posts, it should be as easy as putting in the SIP URI in the dial string of a custom extension.

When that didn’t work, then I thought maybe it was trying to dial out through my bandwidth trunks and bandwidth was blocking, so then I tried to create a custom trunk and outbound route that dialed the dial string.

When that didn’t work I tried custom dial plans in a bunch of different configurations, custom PJSIP_custom.conf

I think I might be making this way harder than it needs to be.

I defer to @jcolp 's message above for the dial string. The choice of transport and port can only be confirmed by iptel.org

Everything you want to do can be done from the FreePBX interface and does not require you to work in custom config files.

Make a PJSIP trunk:

Make a new extension, type Custom:

Call 61696 from a phone and hear music.

2 Likes

This is exactly what I was looking for. I was indeed making it WAYY more complex than I needed to be.
The part I was missing was adding the trunk in the Dial String when I tried it this way first.

Thank you thank you thank you!!!

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