Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sip2json pvar #3311

Merged
merged 3 commits into from
May 8, 2024
Merged

Add sip2json pvar #3311

merged 3 commits into from
May 8, 2024

Conversation

vladpaiu
Copy link
Member

@vladpaiu vladpaiu commented Feb 23, 2024

Summary
Add sip2json pvar

Details
Needed for cases when you want to pass a generic SIP message to a SIP agnostic entity, but still want to provide some layer of SIP parsing before sending the full message further.

Solution
JSON with First line, Headers and Body

Compatibility
Backwards compatible

Special Thanks to Voicenter for sponsoring the work.

@bogdan-iancu
Copy link
Member

Thank you @vladpaiu . Here is some feedback:

"Must" changes:

  • this function should not be part of the core, but rather some module, maybe cfgutils or sipmsgops (even better)
  • documentation is needed, describing the json structure

"Nice to have" change:

  • for the body sections, it would be nicer to have an array of body parts, to also deal with the multi-part body. The array will have all the time at least one part (if there are no multi-parts) and each array element will consist of an element containing an optional Content-Type field and the mandatory body part itself.

If you consider converting this pvar into a function, you may also parametrize it - like an optional parameter with white/black filters to control the headers to be added into JSON.

Now, on second thoughts, I see a better option to have this functionality as function in sipmsgops module.

@vladpaiu
Copy link
Member Author

Thank you @vladpaiu . Here is some feedback:

"Must" changes:

  • this function should not be part of the core, but rather some module, maybe cfgutils or sipmsgops (even better)
  • documentation is needed, describing the json structure

"Nice to have" change:

  • for the body sections, it would be nicer to have an array of body parts, to also deal with the multi-part body. The array will have all the time at least one part (if there are no multi-parts) and each array element will consist of an element containing an optional Content-Type field and the mandatory body part itself.

If you consider converting this pvar into a function, you may also parametrize it - like an optional parameter with white/black filters to control the headers to be added into JSON.

Now, on second thoughts, I see a better option to have this functionality as function in sipmsgops module.

thanks for the feedback, will make the necessary changes and get back to you here.

Copy link

Any updates here? No progress has been made in the last 30 days, marking as stale.

@github-actions github-actions bot added the stale label Mar 30, 2024
@github-actions github-actions bot closed this Apr 13, 2024
@bogdan-iancu bogdan-iancu reopened this Apr 15, 2024
@stale stale bot removed the stale label Apr 15, 2024
@bogdan-iancu
Copy link
Member

@vladpaiu, any chances to get the MUST changes (at least) by tomorrow, so we can include this into the 3.5 release on 9th ?

@vladpaiu
Copy link
Member Author

vladpaiu commented May 8, 2024

@vladpaiu, any chances to get the MUST changes (at least) by tomorrow, so we can include this into the 3.5 release on 9th ?

moved the implementation to sipmsgops and added documentation

@bogdan-iancu
Copy link
Member

Thank you @vladpaiu - could you add couple of words in the doc about the format of the resulting json? is it like one node per line? or ? Thanks !
O will merge as soon as the CI tests are validated.

@bogdan-iancu bogdan-iancu merged commit 043b7e0 into OpenSIPS:master May 8, 2024
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants