<h3>Description</h3>
<p>Hi. Seems lime that after WSS in the VIA kamailio adds double SPACE<br>
It makes kamailio incompatable with jssip.net (tried 5.1.2 and 5.0.6 versions)</p>
<p>Looks like this happens with advertise address added on the interface</p>
<h4>Reproduction</h4>
<p>Just connect to kamailio via WSS with advertized address and try to make incoming call into WSS client</p>
<h4>Debugging Data</h4>
<p>I just put this link to JsSIP.net here<br>
<a href="https://groups.google.com/forum/#!topic/jssip/2lDyqgvZgrY" rel="nofollow">https://groups.google.com/forum/#!topic/jssip/2lDyqgvZgrY</a></p>
<p>Also here is a string of my VIA header that gives issue</p>
<p>SIP/2.0/WSS ​1.2.3.4:5061;branch=z9hG4bKd302.4c862421515641e7b59b9f3ba7f8eab4.1<br>
Thant can be checked here<br>
<a href="https://www.textmagic.com/free-tools/unicode-detector" rel="nofollow">https://www.textmagic.com/free-tools/unicode-detector</a></p>
<p>Log INVITE from the browser (only added \r\n at the end of the each string because of notepad++ not shows it after copying):</p>
<p>INVITE sip:<a href="mailto:2hsq8ob4@daotd6p7hil4.invalid">2hsq8ob4@daotd6p7hil4.invalid</a>;transport=ws SIP/2.0\r\n<br>
Record-Route: sip:1.2.3.4:5061;transport=ws;r2=on;lr;ftag=as7c4d457d;nat=yes\r\n<br>
Record-Route: sip:1.2.3.4;r2=on;lr;ftag=as7c4d457d;nat=yes\r\n<br>
Via: SIP/2.0/WSS ​1.2.3.4:5061;branch=z9hG4bK110e.476a7e8aa7db8de3a4d7b01aed1e7ef5.1\r\n<br>
Via: SIP/2.0/UDP 10.1.1.138:5060;rport=5060;branch=z9hG4bK7122bcfb\r\n<br>
Max-Forwards: 69\r\n<br>
From: "test" sip:test@10.1.1.138;tag=as7c4d457d\r\n<br>
To: sip:test2@10.1.1.38:5060\r\n<br>
Contact: sip:test@10.1.1.138:5060\r\n<br>
Call-ID: 2ec6d77f5a56ca0f59ab0d2118d2f7d5@10.1.1.138:5060\r\n<br>
CSeq: 102 INVITE\r\n<br>
User-Agent: Asterisk PBX 15.3.0\r\n<br>
Date: Mon, 02 Apr 2018 10:30:57 GMT\r\n<br>
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE\r\n<br>
Supported: replaces, timer\r\n<br>
Content-Type: application/sdp\r\n<br>
Content-Length: 642\r\n<br>
\r\n<br>
v=0\r\n<br>
o=root 1538180518 1538180518 IN IP4 1.2.3.4\r\n<br>
s=Asterisk PBX 15.3.0\r\n<br>
c=IN IP4 1.2.3.4\r\n<br>
t=0 0\r\n<br>
a=group:BUNDLE audio\r\n<br>
m=audio 31858 RTP/SAVPF 8 0 101\r\n<br>
a=maxptime:150\r\n<br>
a=rtpmap:8 PCMA/8000\r\n<br>
a=rtpmap:0 PCMU/8000\r\n<br>
a=rtpmap:101 telephone-event/8000\r\n<br>
a=fmtp:101 0-16\r\n<br>
a=sendrecv\r\n<br>
a=rtcp:31859\r\n<br>
a=rtcp-mux\r\n<br>
a=setup:actpass\r\n<br>
a=mid:audio\r\n<br>
a=fingerprint:sha-1 95:6F:40:F2:76:B3:E3:1E:DA:29:04:60:F1:F7:0A:DA:5E:D4:67:9F\r\n<br>
a=ice-ufrag:eSuU9ztd\r\n<br>
a=ice-pwd:j693abw9QWiaX81TlbvyHBD8FU\r\n<br>
a=candidate:5Qp8pvPCHLmm6iUU 1 UDP 2130706431 1.2.3.4 31858 typ host\r\n<br>
a=candidate:5Qp8pvPCHLmm6iUU 2 UDP 2130706430 1.2.3.4 31859 typ host\r\n</p>
<p>Actually i did not found any information about is it MUST be only one sace at the Grammar of SIP message based on RFC 2234 but I may be wrong.</p>
<pre><code>
#### SIP Traffic

<!--
If the issue is exposed by processing specific SIP messages, grab them with ngrep or save in a pcap file, then add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->

</code></pre>
<p>(paste your sip traffic here)</p>
<pre><code>
### Possible Solutions

<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->

### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

</code></pre>
<p>(paste your output here)</p>
<pre><code>
* **Operating System**:

<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `uname -a`)
-->

</code></pre>
<p>(paste your output here)</p>
<pre><code></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/1491">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZYhEuQRcr8K7bDmE33BAr8C-EV8Nks5tkiCegaJpZM4TDgju">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZUgKB86MeEak2Hxx4Q8wGxauADfHks5tkiCegaJpZM4TDgju.gif" height="1" width="1" alt="" /></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/1491"></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":"DESCRIPTION","message":"Double SPACE after in the VIA WSS (#1491)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1491"}}}</script>