<h3>Description</h3>
<p>Kamailio seems to fail to properly route in-dialog SUBSCRIBE with the topos module enabled. In this configuration, SUBSCRIBEs are expected to be delivered to a downstream UAS, an asterisk instance in the internal network.</p>
<p>record_route() is executed for all initial requests, including SUBSCRIBEs. Routing is performed correctly with the topos module disabled, no other modifications were needed.</p>

<h3>Troubleshooting</h3>
<p>I haven't been able to work around this issue in any other way other than disabling the topos module.</p>
<h4>Reproduction</h4>
<p>The configuration used is a heavily modified version of the example configuration file, but the handling of SUBSCRIBEs is generally simple. The initial SUBSCRIBE is subject to some tests, the R-URI is edited and dispatched to a farm of asterisk servers based on some criteria. Record Routing is enforced, so subsequent in-dialog re-SUBSCRIBEs are expected to be routed with loose_route(), which doesn't seem to handle things properly.</p>

<h4>Debugging Data</h4>
<p>I'm attaching kamailio logs with debug=4, cfg_trace</p>

<h4>Log Messages</h4>
<p>See attachments</p>

<h4>SIP Traffic</h4>
<p>Please see: <a href="https://www.cloudshark.org/captures/d2643aae7f2a" rel="nofollow">https://www.cloudshark.org/captures/d2643aae7f2a</a></p>

<h3>Possible Solutions</h3>
<p>Using topoh instead for topos, but unfortunately this will break communication for other reasons (messages too large/UDP fragmentation for some peers).</p>
<h3>Additional Information</h3>
<ul>
<li>
<p><strong>Kamailio Version</strong><br>
Tried with kamailio 5.1.6 and kamailio 5.3.0-dev0<br>
deb.kamailio.org repositories were used to acquire binaries for both versions</p>
</li>
<li>
<p><strong>Operating System</strong>:<br>
Debian Stretch</p>
</li>
</ul>

<p><a href="https://github.com/kamailio/kamailio/files/2586440/resubscribe.log">resubscribe.log</a></p>

<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/issues/1724">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36Za_c54hvP77unxrf4zpNDplQQzb9ks5uvai0gaJpZM4YhDdq">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36Zej2gMDH8-ZSszSvIBJb30VJwTonks5uvai0gaJpZM4YhDdq.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":"DESCRIPTION","message":"topos module seems to break re-SUBSCRIBE routing to downstream destinations (#1724)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1724"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1724",
"url": "https://github.com/kamailio/kamailio/issues/1724",
"name": "View Issue"
},
"description": "View this Issue 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": "topos module seems to break re-SUBSCRIBE routing to downstream destinations (#1724)",
"sections": [
{
"text": "",
"activityTitle": "**George Diamantopoulos**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@gedia",
"facts": [
{
"name": "Repository: ",
"value": "kamailio/kamailio"
},
{
"name": "Issue #: ",
"value": 1724
}
]
}
],
"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\": 1724,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1724\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/kamailio/kamailio/issues/1724"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 411318122\n}"
}
],
"themeColor": "26292E"
}
]</script>