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

nats: add KEMI publish function and event_callback param #3154

Merged
merged 1 commit into from Jun 24, 2022

Conversation

seven1240
Copy link
Contributor

@seven1240 seven1240 commented Jun 19, 2022

Pre-Submission Checklist

  • Commit message has the format required by CONTRIBUTING guide
  • Commits are split per component (core, individual modules, libs, utils, ...)
  • Each component has a single commit (if not, squash them into one commit)
  • No commits to README files for modules (changes must be done to docbook files
    in doc/ subfolder, the README file is autogenerated)

Type Of Change

  • Small bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would change existing functionality)

Checklist:

  • PR should be backported to stable branches
  • Tested changes locally
  • Related to issue #XXXX (replace XXXX with an open issue number)

Description

  • add event_callback KEMI param like in other modules
  • expose KSR.nats.publish

I can fix module doc if it looks good. How to generate docs locally btw?

@henningw
Copy link
Contributor

henningw commented Jun 19, 2022

Thanks for the pull request. @seven1240 to generate locally - see here http://www.kamailio.org/wiki/devel/module-docbook-readme

@seven1240
Copy link
Contributor Author

I updated the doc and squashed into one commit.

@miconda
Copy link
Member

miconda commented Jun 21, 2022

@eschmidbauer: any comments on this PR?

@@ -73,39 +79,36 @@ static void onMsg(
natsConnection *nc, natsSubscription *sub, natsMsg *msg, void *closure)
{
nats_on_message_ptr on_message = (nats_on_message_ptr)closure;
char *s = (char *)natsMsg_GetSubject(msg);
// char *s = (char *)natsMsg_GetSubject(msg);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove this comment?

}
} else {
run_top_route(event_rt.rlist[rt], fmsg, 0);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (rt < 0 && keng) {
    if (sr_kemi_route(keng, fmsg, EVENT_ROUTE, &nats_event_callback, evname) < 0) {
        LM_ERR("error running event route kemi callback\n");
    }
    return 0;
}

run_top_route(event_rt.rlist[rt], fmsg, 0);
return 0;

@@ -30,6 +30,7 @@
#include "../json/api.h"
#include "../../core/cfg/cfg_struct.h"
#include "../../core/fmsg.h"
// #include "../../core/str.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove this commented code ?

Copy link
Contributor

@eschmidbauer eschmidbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few minor comments - otherwise looks good.
thank you!

@seven1240
Copy link
Contributor Author

Thanks. updated as suggested and squashed and rebased to the latest master.

@miconda
Copy link
Member

miconda commented Jun 24, 2022

I see @eschmidbauer approved the changes, therefore I merge it.

@miconda miconda merged commit 25d42b7 into kamailio:master Jun 24, 2022
miconda pushed a commit that referenced this pull request Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants