You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1626
-- Commit Summary --
* dmq: add optional parameter to dmq_handle_message()
-- File Changes --
M src/modules/dmq/dmq.c (4) M src/modules/dmq/doc/dmq_admin.xml (12) M src/modules/dmq/message.c (19) M src/modules/dmq/message.h (3)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1626.patch https://github.com/kamailio/kamailio/pull/1626.diff
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; } ```
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 :)
@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)
Merged #1626 into master.