<p>This patch on 4.4.6 tag worked ok for me by simply forcing a port number on the Via and Request URI prefixes:</p>
<pre><code>diff --git modules/topoh/topoh_mod.c modules/topoh/topoh_mod.c
index 266cc46..7322cd6 100644
--- modules/topoh/topoh_mod.c
+++ modules/topoh/topoh_mod.c
@@ -160,7 +160,7 @@ static int mod_init(void)
    }

    /* 'SIP/2.0/UDP ' + ip + ';' + param + '=' + prefix (+ '\0') */
-   th_via_prefix.len = 12 + th_ip.len + 1 + th_vparam_name.len + 1
+   th_via_prefix.len = 12 + th_ip.len + 6 + th_vparam_name.len + 1
        + th_vparam_prefix.len;
    th_via_prefix.s = (char*)pkg_malloc(th_via_prefix.len+1);
    if(th_via_prefix.s==NULL)
@@ -169,7 +169,7 @@ static int mod_init(void)
        goto error;
    }
    /* 'sip:' + ip + ';' + param + '=' + prefix (+ '\0') */
-   th_uri_prefix.len = 4 + th_ip.len + 1 + th_uparam_name.len + 1
+   th_uri_prefix.len = 4 + th_ip.len + 6 + th_uparam_name.len + 1
        + th_uparam_prefix.len;
    th_uri_prefix.s = (char*)pkg_malloc(th_uri_prefix.len+1);
    if(th_uri_prefix.s==NULL)
@@ -180,21 +180,21 @@ static int mod_init(void)
    /* build via prefix */
    memcpy(th_via_prefix.s, "SIP/2.0/UDP ", 12);
    memcpy(th_via_prefix.s+12, th_ip.s, th_ip.len);
-   th_via_prefix.s[12+th_ip.len] = ';';
-   memcpy(th_via_prefix.s+12+th_ip.len+1, th_vparam_name.s,
+    memcpy(th_via_prefix.s+12+th_ip.len, ":5060;", 6);
+   memcpy(th_via_prefix.s+12+th_ip.len+6, th_vparam_name.s,
            th_vparam_name.len);
-   th_via_prefix.s[12+th_ip.len+1+th_vparam_name.len] = '=';
-   memcpy(th_via_prefix.s+12+th_ip.len+1+th_vparam_name.len+1,
+   th_via_prefix.s[12+th_ip.len+6+th_vparam_name.len] = '=';
+   memcpy(th_via_prefix.s+12+th_ip.len+6+th_vparam_name.len+1,
            th_vparam_prefix.s, th_vparam_prefix.len);
    th_via_prefix.s[th_via_prefix.len] = '\0';
    LM_DBG("VIA prefix: [%s]\n", th_via_prefix.s);
    /* build uri prefix */
    memcpy(th_uri_prefix.s, "sip:", 4);
    memcpy(th_uri_prefix.s+4, th_ip.s, th_ip.len);
-   th_uri_prefix.s[4+th_ip.len] = ';';
-   memcpy(th_uri_prefix.s+4+th_ip.len+1, th_uparam_name.s, th_uparam_name.len);
-   th_uri_prefix.s[4+th_ip.len+1+th_uparam_name.len] = '=';
-   memcpy(th_uri_prefix.s+4+th_ip.len+1+th_uparam_name.len+1,
+   memcpy(th_uri_prefix.s+4+th_ip.len, ":5060;", 6);
+   memcpy(th_uri_prefix.s+4+th_ip.len+6, th_uparam_name.s, th_uparam_name.len);
+   th_uri_prefix.s[4+th_ip.len+6+th_uparam_name.len] = '=';
+   memcpy(th_uri_prefix.s+4+th_ip.len+6+th_uparam_name.len+1,
            th_uparam_prefix.s, th_uparam_prefix.len);
    th_uri_prefix.s[th_uri_prefix.len] = '\0';
    LM_DBG("URI prefix: [%s]\n", th_uri_prefix.s);
</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/issues/1222#issuecomment-326030933">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZUapZ9F6th2JimVusUo66lOG4aF0ks5sdYIogaJpZM4PGoWl">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZeEu06WxzsP_KTYq-yq2y00ppLDjks5sdYIogaJpZM4PGoWl.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/1222#issuecomment-326030933"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<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://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@rampageai in #1222: This patch on 4.4.6 tag worked ok for me by simply forcing a port number on the Via and Request URI prefixes:\r\n\r\n```\r\ndiff --git modules/topoh/topoh_mod.c modules/topoh/topoh_mod.c\r\nindex 266cc46..7322cd6 100644\r\n--- modules/topoh/topoh_mod.c\r\n+++ modules/topoh/topoh_mod.c\r\n@@ -160,7 +160,7 @@ static int mod_init(void)\r\n    }\r\n\r\n    /* 'SIP/2.0/UDP ' + ip + ';' + param + '=' + prefix (+ '\\0') */\r\n-   th_via_prefix.len = 12 + th_ip.len + 1 + th_vparam_name.len + 1\r\n+   th_via_prefix.len = 12 + th_ip.len + 6 + th_vparam_name.len + 1\r\n        + th_vparam_prefix.len;\r\n    th_via_prefix.s = (char*)pkg_malloc(th_via_prefix.len+1);\r\n    if(th_via_prefix.s==NULL)\r\n@@ -169,7 +169,7 @@ static int mod_init(void)\r\n        goto error;\r\n    }\r\n    /* 'sip:' + ip + ';' + param + '=' + prefix (+ '\\0') */\r\n-   th_uri_prefix.len = 4 + th_ip.len + 1 + th_uparam_name.len + 1\r\n+   th_uri_prefix.len = 4 + th_ip.len + 6 + th_uparam_name.len + 1\r\n        + th_uparam_prefix.len;\r\n    th_uri_prefix.s = (char*)pkg_malloc(th_uri_prefix.len+1);\r\n    if(th_uri_prefix.s==NULL)\r\n@@ -180,21 +180,21 @@ static int mod_init(void)\r\n    /* build via prefix */\r\n    memcpy(th_via_prefix.s, \"SIP/2.0/UDP \", 12);\r\n    memcpy(th_via_prefix.s+12, th_ip.s, th_ip.len);\r\n-   th_via_prefix.s[12+th_ip.len] = ';';\r\n-   memcpy(th_via_prefix.s+12+th_ip.len+1, th_vparam_name.s,\r\n+    memcpy(th_via_prefix.s+12+th_ip.len, \":5060;\", 6);\r\n+   memcpy(th_via_prefix.s+12+th_ip.len+6, th_vparam_name.s,\r\n            th_vparam_name.len);\r\n-   th_via_prefix.s[12+th_ip.len+1+th_vparam_name.len] = '=';\r\n-   memcpy(th_via_prefix.s+12+th_ip.len+1+th_vparam_name.len+1,\r\n+   th_via_prefix.s[12+th_ip.len+6+th_vparam_name.len] = '=';\r\n+   memcpy(th_via_prefix.s+12+th_ip.len+6+th_vparam_name.len+1,\r\n            th_vparam_prefix.s, th_vparam_prefix.len);\r\n    th_via_prefix.s[th_via_prefix.len] = '\\0';\r\n    LM_DBG(\"VIA prefix: [%s]\\n\", th_via_prefix.s);\r\n    /* build uri prefix */\r\n    memcpy(th_uri_prefix.s, \"sip:\", 4);\r\n    memcpy(th_uri_prefix.s+4, th_ip.s, th_ip.len);\r\n-   th_uri_prefix.s[4+th_ip.len] = ';';\r\n-   memcpy(th_uri_prefix.s+4+th_ip.len+1, th_uparam_name.s, th_uparam_name.len);\r\n-   th_uri_prefix.s[4+th_ip.len+1+th_uparam_name.len] = '=';\r\n-   memcpy(th_uri_prefix.s+4+th_ip.len+1+th_uparam_name.len+1,\r\n+   memcpy(th_uri_prefix.s+4+th_ip.len, \":5060;\", 6);\r\n+   memcpy(th_uri_prefix.s+4+th_ip.len+6, th_uparam_name.s, th_uparam_name.len);\r\n+   th_uri_prefix.s[4+th_ip.len+6+th_uparam_name.len] = '=';\r\n+   memcpy(th_uri_prefix.s+4+th_ip.len+6+th_uparam_name.len+1,\r\n            th_uparam_prefix.s, th_uparam_prefix.len);\r\n    th_uri_prefix.s[th_uri_prefix.len] = '\\0';\r\n    LM_DBG(\"URI prefix: [%s]\\n\", th_uri_prefix.s);\r\n```"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1222#issuecomment-326030933"}}}</script>