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

dmq: add optional parameter to dmq_handle_message() #1626

Merged
merged 1 commit into from Aug 31, 2018

Conversation

eschmidbauer
Copy link
Contributor

No description provided.

@eschmidbauer
Copy link
Contributor Author

some context for this PR...
we are testing using the tsilo module for mobile push notifications while maintaining multiple registrars with dmq_usrloc
if an INVITE goes to a registrar "A" and then the UA registers to registrar "B", the dmq message is sent to registrar "A" with UA location info,and the INVITE can be resumed successfully.

    if (is_method("KDMQ")) {
        dmq_handle_message("1");
        if ($tU == "usrloc") {
            $var(a) = "";
            json_get_field("$rb", "aor", "$var(a)");
            $var(a) = $(var(a){s.strip,1});     #strip quotes
            $var(a) = $(var(a){s.striptail,1}); #strip quotes
            $var(p) = "sip:" + $var(a);
            route(PUSHJOIN);
        }
        exit;
   }

@eschmidbauer eschmidbauer force-pushed the dmq_handle_message-return branch 3 times, most recently from 94fbf6b to e0a089a Compare August 31, 2018 12:52
@charlesrchance
Copy link
Member

Very cool!

It is definitely useful. However, I have one very small comment.

I'm not sure what value it adds allowing the config to determine the returned value - only that the function returns without exiting. Possibly just semantics right now, but it could potentially restrict future module development - or not, but better to be safe.

Would it still serve its purpose if the parameter was renamed to something like "return" or "continue" and only return 1 if set or 0 if not?

Again, nice use case :)

@eschmidbauer
Copy link
Contributor Author

@charlesrchance thanks for your input, and nice catch. I updated the PR to rename the param continue and only pass 1 (if it's set to 1 or greater)

@charlesrchance charlesrchance merged commit 18c1eb2 into master Aug 31, 2018
@eschmidbauer eschmidbauer deleted the dmq_handle_message-return branch September 4, 2018 13:18
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

2 participants