[SR-Users] Split audio and video into different calls

Rüdiger, Christoph christoph.ruediger at tkelevator.com
Wed May 18 14:30:35 CEST 2022


Hello Rick,

interesting approach. We can identify video calls by special SIP headers and/or sdp contents and have Kamailio trigger a webhook or something.

But even though I would like to try it at home, I see huge issues with maintaining such a solution in production. This is so far off from anything standard that you need to have this one guy at hand when all hell breaks loose.

I'd rather favor Henning's suggestion of reverting to a PBX and implement the media handling there. Not that fancy, but maintainable by the average support guy that comes in for half a year and leaves afterwards.

Regards,
Christoph


-----Original Message-----
From: sr-users <sr-users-bounces at lists.kamailio.org> On Behalf Of Rick van Rein
Sent: Tuesday, May 17, 2022 7:57 AM
To: Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org>
Subject: Re: [SR-Users] Split audio and video into different calls

This message was sent from outside the company. Please do not click links or open attachments unless you recognize the source of this email and know the content is safe.

Hello Christoph,

I held back responding, but since it does not seem directly possible with Kamailio here's what I what try.

RTP frames have a Payload Type which is usually negotiated in rtpmap attributes in SDP, but there are static mappings for many codecs.  I would first figure out if you can find a common pattern in your (local) traffic that separates the two kinds of payload.

Since the Payload Type is at a fixed offset (the lower 7 bits of the second RTP byte, the 8th bit is an M-bit) you could instruct a firewall to mangle/redirect traffic to your video wall.  You can easily ignore the M bit in the same byte by specifying two values for the M-bit + Payload Type byte.
For NFT on Linux, see https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmanpages.debian.org%2Fbullseye%2Fnftables%2Fnft.8.en.html%23RAW_PAYLOAD_EXPRESSION&data=05%7C01%7Cchristoph.ruediger%40tkelevator.com%7C39d6f199f58a4292475508da37ca4efe%7C84d9a216e2854aacb1630dfd0c074546%7C0%7C0%7C637883639293090653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=RvjTurFx2cHJs6REl2nNd5wgWMylK%2FznTA332%2B7Xrws%3D&reserved=0

If this seems workable, I would look into the sdpops module in Kamailio, to modify any SDP attachments coming in and going out, to strip and add video codecs.  You may or may not need to dynamically alter the firewall bypassing.  But in general, you can set where the Payload Type on the local end receives video streams -- possibly with different codecs.
https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kamailio.net%2Fdocs%2Fmodules%2F5.6.x%2Fmodules%2Fsdpops.html&data=05%7C01%7Cchristoph.ruediger%40tkelevator.com%7C39d6f199f58a4292475508da37ca4efe%7C84d9a216e2854aacb1630dfd0c074546%7C0%7C0%7C637883639293090653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=yM8OseanphQZ2n68IGBwmbzfKh2diS255BnoYrzhZO8%3D&reserved=0

You may or may not need to use Kamailio to fork a connection to your video software, depending on whether it wants SIP to talk to it.

This probably gives you the control you need, but it is a bit of a hack.  Which is why I held back to see if others knew a more direct method of doing what you want.

It would be interesting to hear if / how this works for you, by the way.  It might even be a nice blog article.


Cheers,
 -Rick

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users at lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.kamailio.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fsr-users&data=05%7C01%7Cchristoph.ruediger%40tkelevator.com%7C39d6f199f58a4292475508da37ca4efe%7C84d9a216e2854aacb1630dfd0c074546%7C0%7C0%7C637883639293090653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=EINimUKm8NQDojQ3mWexCZ%2BF%2F5CjkqNFCiIOC%2FIYsfo%3D&reserved=0


More information about the sr-users mailing list