<p>some context for this PR...<br>
we are testing using the <code>tsilo</code> module for mobile push notifications while maintaining multiple registrars with <code>dmq_usrloc</code><br>
if an <code>INVITE</code> 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.</p>
<pre><code>    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;
   }
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/pull/1626#issuecomment-417652457">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZUBdF85GAfecBQAp8Hv9--0JAAMRks5uWS_FgaJpZM4WUFlx">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36Zeg7-zL8aVzZPsGCHRZttTdrnElRks5uWS_FgaJpZM4WUFlx.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@eschmidbauer in #1626: some context for this PR...\r\nwe are testing using the `tsilo` module for mobile push notifications while maintaining multiple registrars with `dmq_usrloc`\r\nif 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. \r\n\r\n```\r\n    if (is_method(\"KDMQ\")) {\r\n        dmq_handle_message(\"1\");\r\n        if ($tU == \"usrloc\") {\r\n            $var(a) = \"\";\r\n            json_get_field(\"$rb\", \"aor\", \"$var(a)\");\r\n            $var(a) = $(var(a){s.strip,1});     #strip quotes\r\n            $var(a) = $(var(a){s.striptail,1}); #strip quotes\r\n            $var(p) = \"sip:\" + $var(a);\r\n            route(PUSHJOIN);\r\n        }\r\n        exit;\r\n   }\r\n```"}],"action":{"name":"View Pull Request","url":"https://github.com/kamailio/kamailio/pull/1626#issuecomment-417652457"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/pull/1626#issuecomment-417652457",
"url": "https://github.com/kamailio/kamailio/pull/1626#issuecomment-417652457",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [kamailio/kamailio] dmq: add optional parameter to dmq_handle_message() (#1626)",
"sections": [
{
"text": "",
"activityTitle": "**Emmanuel Schmidbauer**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@eschmidbauer",
"facts": [

]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1626,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close pull request",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"PullRequestClose\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"pullRequestId\": 1626\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/kamailio/kamailio/pull/1626#issuecomment-417652457"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 374364529\n}"
}
],
"themeColor": "26292E"
}
]</script>