SOLVED Diversion header and PAI

Status
Not open for further replies.

Thomas

New Member
Nov 23, 2017
5
2
1
Hannover, Germany
Hi all,

I work for a small university of Music and performing arts in northern Germany and look for a nice pbx for moving over to VOIP. Fusionpbx seems to be a very promising system, thanks to all of you for this nice peace of software.
Using the german research network I have access to a SIP-trunk provided by German telekom. Prior to using I have to pass an about 6 hour lasting test, fulfilling a more than 50 pages long test protocoll. One of these test is about call forwarding. A properly set PAI and diversion header is a must.

phone a (external or internal) calls phone b. b is forwarded to c
Headesr are supposed to look like (fuisonpbx to telekom SBC)
Request URI = C
From = A
To = C
Contact = A
PAI = B
Diversion = B

PAI is used for billing. This is to avoid that A gets the cost for forwading charged.

At the moment I don´t get a diversion header at all !

Used version is 4.2.4 on Debian 8, installed according to the installation guide. The two lines in call_foward.lua and call_forward.php about diversion exist in both files

Do you have any hint for me what is wrong ?
Thanks alot in advance. Any help is highly appreciated
Thomas
 
Last edited:

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,038
556
113
You won't get a diversion header as a forward through fusionpbx is not done using that method, it is a back to back user agent and so there isn't a way the scenario you are describing will happen.

This is the sort of scenario that would potentially happen ig the trunk were connected directly to the endpoint but its not, its connected to the PBX
 

Thomas

New Member
Nov 23, 2017
5
2
1
Hannover, Germany
Hi DigitalDaz,

thx for your reply.
I don´t understand, what you mean by back to back user agents, also I am afraid that I was not clear enough describing my setup.
The phones A and B are in my LAN, registered to the Fusionpbx. Phone C is an external one. Fusionpbx works as a proxy and is the only device, that can connect to the telekom SBC.
A -> Fusion, B-> Fusion, Fusion->trunk(TelekomSBC), Telekom SBC ->C (external phone)
I have a wireshark running on the fusionpbx interface to the trunk.
For testing I have two Snoms as Phones A and B. I understand that the Snoms know two ways of forwarding
1: Forwarding is activated in Snom B
I get three calls : A sends an invite to Fusion for B
Fusion sends invite to B, B replying with "temporarly moved"
Fusion sends invite with new number to external(SBC)
2: Forwarding activated in Fusionpbx
I get only two calls : A sends an invite to Fusion for B
Fusion sends an invite straight to C
Snoms offer the feature to send the forwarding number straight after the *72 without an IVR being needed. So I changed the LUA-Script a little bit to handle that. if fusionpbx receives a *7212345@... its adding the 12345 as forward number without playing the IVR and also without playing the forwarding number back again . So I can use Snoms as well as other phones without this feature.
So forwarding works absolutely fine, only the PAI and the diversion header are missing.
Do you see any chance to generate a header ?
Also in the lua and php scripts I see these lines, adding the header to the dial string. Why don´t they show up ?

Thanks again and hoping to solve this problem :)
Thomas
 
Last edited:

Thomas

New Member
Nov 23, 2017
5
2
1
Hannover, Germany
I spent more time on testing and I see in the dial string (extension-> advanced tab) a diversion header, but it´s not included in the outgoing invite.
Do I have to activate anything so that sofia is using the dial string ?
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,388
364
83
Thomas, in a SIP proxy a forwarded call will have the URI re-written to represent the diverted to destination and have a Diversion header added to show the original destination. The call ID remains the same and the invite is sent on it's way. FusionPBX is not behaving like a SIP proxy, it is, as Daz says, a B2BUA or Back to Back user agent. This means that the first call is answered by Fusion and then bridged to a second call originated by Fusion to the final destination. So although we call this forwarding, the call is not actually forwarded like it would be by a SIP proxy, there ate two separate calls with two call IDs. I hope that makes sense.

When you implement the forward in the phone, the phone generates a 3xx redirection response that FusionPBX uses to re-arrange the call to it's new destination.

Many proxies are programmed to handle 3xx messages in a way to prevent fraud, some proxies ignore them altogether, simply returning busy or temporarily unavailable.

Adrian.
 

Thomas

New Member
Nov 23, 2017
5
2
1
Hannover, Germany
Adrian,
thx alot for your explanation. It makes absolutely sense to me and this exactly what I see when analyzing traffic with wireshark on the pbx interface and having a closer look at the log file. I just didn´t knew that it´s called B2BUA :)

To avoid any problems with 3xx messages by the phone I changed my forward.lua to set the forwarding inside fusionpbx. I also see that internaly a "dialstring" is build when setting the forward. It also get´s stored and displayed by the GUI. But the dialstring that is build doesn´t seems to be used when setting up the outgoing phonecall. Any idea ?

Thomas
 

Thomas

New Member
Nov 23, 2017
5
2
1
Hannover, Germany
The problem is solved.

In dial plan -> call_forward_all the original destination is replaced by the forward number that is stored in the database for destination of leg A (so phone B of my example)
I just copy the original destination in a variable that I export so I can use it later for leg B.
I have three outbound routes (local,domestic,international). Before bridging the call to sofia.... I set the x_header_Diversion and also the x_header_PAI.
Generating a PAI in the default settings is turned off for avoiding duplicate PAIs.

Probably there is a smarter way to solve this problem but it´seems to work fine. Anyway I would really like to know, whatfor exactly this kind of manipulation is done with the dial string in call_forward.lua without using it later :). This thread may be marked as solved, it´seems I haven´t got the permission to do it myself.

fwd1.PNG

fwd2.PNG
 

pjosephs

New Member
May 4, 2018
1
0
1
38
Most PBX's seem to support this.
3CX and Asterisk does.
It would be nice if there was an easier way to implement it in FreeSwitch/FusionPBX.

But good work Thomas.
 
Status
Not open for further replies.