Kamailio/FusionPBX and Microsoft Direct Routing Integration

Status
Not open for further replies.

KonradSC

Active Member
Mar 10, 2017
166
99
28
I figured out the issue with Teams transfer and hold/resume issue. This discussion provided some guidance.

Ultimately I had to strip out the REPLY method from the Allowed Methods fields in all SIP messages coming from FreeSWITCH. For simplicity I just matched what Teams was sending me.

"Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE"
became
"ALLOW: INVITE,ACK,OPTIONS,CANCEL,BYE,NOTIFY".

I did this to initial requests from FreeSWITCH and also in an onreply_route which was armed by using t_on_reply.
 

Craig Fox

New Member
Mar 21, 2018
26
3
3
54
Update: I talked with Mack at dSIPRouter about adding teams as an endpoint and he's willing to do it but its going to require some dev $$$. If anyone's interested in contributing to this feature DM me an we'll co-ordinate with Mack. I'd rather pay Mack than Anynode or Ribbon.
Did the conversation about integrating FusionPBX into MS Teams ever go anywhere? I'd be interested in pushing that development effort forward.
 

bcmike

Active Member
Jun 7, 2018
337
58
28
54
Mack has turned this into a subscription product. I'd contact him if your interested.
 

bcmike

Active Member
Jun 7, 2018
337
58
28
54
When did you ask? It works, it's a little rough but it works.

He's also added support for multiple certs, etc.
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,070
577
113
I got interested in this myself after a client and Ian Oakes both started talking about it too.

I've been playing with it with a slightly modified dsiprouter and have calls in and out working just fine. My hold/unhold was very flakey, maybe taking up to ten attempts to get the call back off hold but it seems from some heavy debugging and RFC reading that its the carriers problem with the REPLACES method.

I also have blind transfer working. Attended transfer kind of works but I will deal with that after I the REPLACE issue is fixed.
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,070
577
113
PS, I think this is all gonna be very much carrier dependant unless you are using a B2BUA which I think the commercial offerings are. I'm seeing very different results with different carriers.

I tried using it with Freeswitch but I cannot get the hold to work. I cannot find a way of Freeswitch NOT sending back a 200 OK WITHOUT a=sendrcv in the sdp which microsoft then rejects.

Maybe if I can up my kamailio fu I can track the call from MS with the a:inactive and modify to 200 OK on the way back to MS and modify the SDP.
 

andycol

Member
Jun 18, 2020
48
14
8
37
Does anyone know if the free version of teams works for this?
OR if anyone has a teams i would be happy to see if i can get it working with kamailio for you for free
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,070
577
113
@andycol I have teams and no, you have to have at least the E5 licence and then on top the pbx licence is about £6.10 per user I think. Its certainly not cheap
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,070
577
113
Adrian,

Kami as the mangler module too :)

The problem I have right now for example when trying to use freeswitch as a b2bua to the carrier is this....

If teams sends it hold out, ie with a=inactive in the sdp freeswitch will return a 200 OK with a=sendrecv as it wants to play moh.

What I need to do is potentially modify the sdp with the mangler as you described but my problem right now is how to match the 200OK to the exactINVITE that went out, ie this is the 200OK to that INVITE, haven't worked out that bit yet.

I'm also looking at the freeswitch source to see if I can modify it to never use moh.
 

andycol

Member
Jun 18, 2020
48
14
8
37
Adrian,

Kami as the mangler module too :)

The problem I have right now for example when trying to use freeswitch as a b2bua to the carrier is this....

If teams sends it hold out, ie with a=inactive in the sdp freeswitch will return a 200 OK with a=sendrecv as it wants to play moh.

What I need to do is potentially modify the sdp with the mangler as you described but my problem right now is how to match the 200OK to the exactINVITE that went out, ie this is the 200OK to that INVITE, haven't worked out that bit yet.

I'm also looking at the freeswitch source to see if I can modify it to never use moh.
you should post on the mailing list im 99% Daniel with have a solution to this
 

andycol

Member
Jun 18, 2020
48
14
8
37
Adrian,

Kami as the mangler module too :)

The problem I have right now for example when trying to use freeswitch as a b2bua to the carrier is this....

If teams sends it hold out, ie with a=inactive in the sdp freeswitch will return a 200 OK with a=sendrecv as it wants to play moh.

What I need to do is potentially modify the sdp with the mangler as you described but my problem right now is how to match the 200OK to the exactINVITE that went out, ie this is the 200OK to that INVITE, haven't worked out that bit yet.

I'm also looking at the freeswitch source to see if I can modify it to never use moh.
another question, have you tested with just freeswitch not using fusion?
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,070
577
113
Hmmm.... perhaps the answer is something like a custom reply route

ie check the outgoing invite and if it has inactive in the sdp:

t_on_reply("InactiveInInvite");

Then mod the 200 OK sdp
 

andycol

Member
Jun 18, 2020
48
14
8
37
I don't use Kamailio, I started with OpenSIPS and stuck with it, but I know they are very similar. OpenSIPS has a "Mangler" module that allows you to do pretty much what you like with the SDP:
https://opensips.org/docs/modules/3.0.x/mangler.html
i try not use opensips just because they "Stole" their project from kamailio so for me its a moral issue, but not saying its bad, i just saw what they did to daniel
 
Status
Not open for further replies.