Provider P-prefred-Identity header


(Deutschland) #1

Hello all !

Sipgate wants the P-prefred-Identity header in order to show the CID on an outgoing call.

We have two freepbx installations. One is online (we call it “pbxonline”) and one is local at our office (we call it “pbxoffice”).

pbxonline has a pjsip trunk to sipgate (“sipgatepjsip”). Calls from and to the outside are shipped through sipgate.

pbxonline has several pjsip extensions for our external employees (working from home).

pbxoffice has several sip extensions for the office workers.

The two installations pbxonline and pbxoffice are linked by an IAX2 trunk.

In order to set the CID by indicating it in the P-prefred-Identity header as requested by Sipgate we followed these instructions:

When an extension on the pbxonline installation places a call to the outside it is routed by an outgoing route (“sipgate_out”) to the sipgate trunk (“sipgatepjsip”) which has “Asterisk Trunk Dial Options” set to "B(custom-sip-header^s^1)" as indicated in the mentioned instructions. This works fine meaning that the extenion’s Outbound CID is shown to the called party by Sipgate!

BUT now comes the problem:

If a call is placed by an extension on the pbxoffice installation, the outgoing call is first routed by an outgoing route (“pbxonline_out”) to the aix2 trunk (“pbxonline”). Arriving at the pbxonline installation the call is routed by an inbound route (DID: Any, CID: Any) to the trunk sipgatepjsip (don’t know if this is proper ?!). For some reason those calls are not provided with the P-prefred-Identity header. And therefore the Outbound CID set by the calling extension on the pbxoffice installation is not shown by Sipgate.

I must admit that I am not that firm in asterisk and in general in voip principles. And I would be very thankful if someone could help me to get this fixed. Thanks !


(Lorne Gaetz) #2

Th method in the linked post is out of date. The best method right now for adding custom headers to SIP trunks is to use this method: Custom SIP header on outgoing calls

What is the callerid of the call leaving the pbxoffice system, is it the PSTN caller ID or the local extension? Are you using the intracompay option in the route to pbxonline?


(Deutschland) #3

Hi Lorne, thanks a lot for your attention !

Are you using the intracompay option in the route to pbxonline?

I did not activate the intracompany option on the pbxonline route - should I ?

What is the callerid of the call leaving the pbxoffice system, is it the PSTN caller ID or the local extension?

At the pbxoffice extensions we set the PSTN Outbound CID (ex. 491234567812). And we do not touch the CID further more during the routing.

The best method right now for adding custom headers to SIP trunks is to use this method

Honestly I do not understand this method. Could you be so kind and help me how to introduce the P-prefred-Identity header with it ? As stated the name of the outgoing trunk on the pbxonline installation is “sipgatepjsip”

Thanks a lot for any further help.


(Deutschland) #4

Hey Lorne, I just gave it a try and activated the intracompany option on the outgoing route on the pbxoffice installation … and voilà, it works (still with your old method).

Thanks for the great help !


(Lorne Gaetz) #5

Glad it’s fixed, but I can’t think of any reason why intracomany would work in this case and you are still using a dated method to add headers. Be prepared to revisit this in the future if it breaks again.


(Deutschland) #6

Lorne, you are right. In fact I was to fast - I wrongly thought to have done the test with an extension of the pbxoffice installation but in fact I was using an extension of the pbxonline installation from where the old methode is working.
So I would be very glad if you could go through my questions in answer to your first post …


(Deutschland) #7

@lgaetz - I would be very thankful if you could have a look at my questions


(Lorne Gaetz) #8

This is something you’re going to need to figure out on your own. Get a call trace of a working call and a non-working call and compare the two. You can share the trace via pastebin:
https://wiki.freepbx.org/display/SUP/Providing+Great+Debug#ProvidingGreatDebug-AsteriskLogs-PartII


(Deutschland) #9

Hi Igaetz,
I did the trace and your guess is right - the call leaves the pbxoffice system with the local extension number (20) instead of outgoing CID (49123456789) as CID. Do you have any idea, where I could change this? Thanks a lot for any further advice !

chan_iax2.c: VERSION : 2
chan_iax2.c: CALLED NUMBER : 0145232145
chan_iax2.c: CODEC_PREFS : (ulaw|alaw|gsm)
chan_iax2.c: CALLING NUMBER : 20
chan_iax2.c: CALLING PRESNTN : 0
chan_iax2.c: CALLING TYPEOFN : 0
chan_iax2.c: CALLING TRANSIT : 1
chan_iax2.c: CALLING NAME : Myname
chan_iax2.c: LANGUAGE : en
chan_iax2.c: USERNAME : pbxonline
chan_iax2.c: FORMAT : 4
chan_iax2.c: CAPABILITY : 14
chan_iax2.c: ADSICPE : 2
chan_iax2.c: DATE TIME : 2020-05-02 01:14:40

Btw the pbxoffice system is an old installation (elastix):

Name Package Name Version Release
FreePBX
freePBX 2.7.0 9
Name Package Name Version Release
Asterisk
asterisk 1.6.2.13 0
asterisk-perl 0.10 2
asterisk-addons 1.6.2.1 0

And here my iax2 trunk settings:

[PEER Details]
username=pbxonline
type=peer
secret=xxxxxxxxxxxx
qualify=yes
host=pbxonline.xxxxxxxx.com
context=from-trunk

[USER Details]
type=user
secret=xxxxxxxxxxxxxxxx
qualify=yes
host=pbxonline.xxxxxxxxxxx.com
context=from-trunk


(Deutschland) #10

If anybody has an idea on this, I would be very thankful !


(Lorne Gaetz) #11

You’re asking questions about config of FreePBX 2.7 system, circa 2009 or so. It’s long past time for migration to a supportable version.


(Deutschland) #12

I see. That will be quite some work as I suppose that I have to do a reinstall from scratch. Or do you think I could go for an update?


(Lorne Gaetz) #13

If it was mine, I wouldn’t even consider upgrading in place, and the version is too old to use any of the migration tools. I fear your only option is setup a new 14/15 system side by side and copy and paste from one to another.

Don’t neglect the next one for a decade.


(Deutschland) #14

Don’t neglect the next one for a decade.

:sweat_smile: ok - see you


(Jared Busch) #15

I’ve recently been using the new backup module in FreepBX 15 with a backup file from 2.8.

Currently, most of the bugs I found and reported from that process are resolved. The biggest issue now is the chan_sip port getting reassigned to 5062 instead of taking over 5060. But the new tool to migrate all the extensions to pjsip will work around that, once I get a chance to test it.


(Deutschland) #16

thanks for sharing !
It’s incredible how a decade passed by in a glimpse …