Adding custom parameters to gateway config

Status
Not open for further replies.

Gregor Maier

New Member
Oct 31, 2021
5
0
1
Hello!

I'm new to FusionPBX and Freeswitch and therefore searching solutions for some challenges :). My SIP provider needs mediasec to be able to encrypt rtp stream. Therefore I extended Freeswitch to speak mediasec (which primarily is part of the registration process). That's working fine. Now I would like to add a switch / a new parameter to the gateway configuration (which enables mediasec only if needed). But unfortunately, I don't know how to provide custom variables via FusionPBX to Freeswitch gateway configuration w/o changing the FusionPBX source though I searched heavily - but hopefully I've overseen the solution?

Do you have any idea?

Thanks
Gregor
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
I assume you are referring to RFC3329 maybe? I'm pretty sure Sofia parses, passes and supports the Security-Client: Security-Verify: headers. I always thought it was up to the UAC to generate them, not something you would configure in a gateway, unless, of course, you mean adding them to the registration process with your provider. I would then imagine it would be governed by a parameter in the SIP Profile. I have not seen it.
 

Gregor Maier

New Member
Oct 31, 2021
5
0
1
unless, of course, you mean adding them to the registration process with your provider.
Yes.

Sofia / freeswitch doesn't know anything regarding mediasec besides the headers itself. There is no handling implemented at all regarding mediasec (you may take a look at the source code and you will see it). I implemented it for myself. It's working now. Because of this, it would be desirable to have a variable to switch mediasec on or off in the gateway (most SIP provider don't need it).
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
OK, You don't explain what you have done. But my guess is you will need to look at the definitions for sofia_config_t and the sofia gateway struct. If you allow the xml loader (switch_xml_load) to know about your extra configuration, then you will be able to set (Add) your defined config item in the SIP Profile, in order to control it from within Fusion. Menu->Advanced->SIP Profiles
 
  • Like
Reactions: Gregor Maier

Gregor Maier

New Member
Oct 31, 2021
5
0
1
You're right, that would be an option - binding the new config switch to the profile - which would mean, that it would be necessary to add an own profile especially for the "mediasec" gateway. Not nice, but possible. But this would mean to open another port / listener, which isn't necessary at all with regard to many SIP provider using RFC 5626 (flows). Therefore: is there a possibility to switch off the listener (= just don't add any at all) which is usually part of the profile?
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
I don't think you would need another profile, I imagined just adding your new sofia parameter to the existing external profile, example screen shot below:

Screenshot from 2021-11-04 08-22-47.png
 

Gregor Maier

New Member
Oct 31, 2021
5
0
1
Thanks for your kind reply! I think you're right as long as you do not have more than one SIP provider using this profile. If you have more than one but just one of those needs mediasec, you would need two? Or am I misunderstanding something?

Btw: I attached the patch - if anyone should be interested. This patch doesn't contain any switch yet. Maybe it's easier to talk about my idea. The patch can be applied to 1.10.6 or 7. Didn't test previous versions.
 

Attachments

  • freeswitch-1.10.7-mediasec.diff.gz
    1.7 KB · Views: 27

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
Thank you for sharing the patch, I now understand what you have done. Yes I think you probably would need separate SIP profiles if you have a mix of mediasec and non media sec providers.
 
Status
Not open for further replies.