PJSIP Trunk settings in Freepbx 12

PJSIP In FreePBX is Experimental

The trunk settings in Freepbx are limited yet.
To overcome it you could use the custom configurations of PJSIP and add
a custom trunk with a custom dial like "PJSIP/$OUTNUM$@mycustomtrunk
Works nicely inbound and outbound.

Whats limited. Please go into more details for all of us.

For a particular trunk I needed to add in pjsip_endpoint the
from_domain=provider.nl

I do not see how that is possible in the current freepbx pjsip trunk settings.

It would be nice to have a possibility to add “other pjsip settings” in the trunk like you can do in the general sip settings.

We can’t allow that unfortunately. Any wrong setting prevents PJSIP from loading. The support tickets we’d have to deal with as a result of people trying to add settings from SIP would be tremendous.

I am having difficulty in that no caller id information is being sent as Remote Party ID on a pjsip trunk. I have the situation where a sip trunk to my voip provider carries several different numbers. I use the extension trunk CID field to designate the particular CID number to be used by that extension which should be sent out in the invite message. If the VOIP provider does not receive a CID number he inserts the master CID number for the trunk.

There is no difficulty with a chan_sip trunk as setting senderpid=yes causes this to happen.

From my research I beleive that adding trust_id_inbound=yes to the endpoint conf file may resolve this problem. Is there a simple way I can do this?

@stonet
Like I have already mentioned:

Create a trunk in the pjsip_custom.conf settings with a context someting like mycustomtrunk

and after in the freepbx gui:

connectivity -> trunks -> add custom trunk with in the custom dial string:

something like PJSIP/$OUTNUM$@mycustomtrunk

Regards,

Geert

NooNoo

I tried that but it did not work. I also tried putting this macro in extensions_custom.conf:

[macro-dialout-trunk-predial-hook]
exten => s,1,SIPAddHeader(Remote-Party-ID: ${CALLERID(name)} <sip:${CALLERID(number)}@voiphost.net>)
exten => s,n,MacroExit()

The macro is read and shows up in the trace:

-- Executing [s@macro-dialout-trunk:17] Macro("PJSIP/6505-00000072", "dialout-trunk-predial-hook,") in new stack
 -- Executing [s@macro-dialout-trunk-predial-hook:1] SIPAddHeader("PJSIP/6505-00000072", "Remote-Party-ID: CidName <sip:[email protected]>") in new stack
 -- Executing [s@macro-dialout-trunk-predial-hook:2] MacroExit("PJSIP/6505-00000072", "") in new stack

but the Remote-Party-ID does not appear in the Sip Invite header. Does anyone have any ideas why this does not work?

It doesn’t work because SIPAddHeader doesn’t work on PJSIP trunks. Look up how to use PJSIP_HEADER()