The file 
[th-test.c.txt](https://github.com/kamailio/kamailio/files/10608862/th-test.c.txt)
 contains the exact copy of the th_mask_encode() and th_mask_decode() functions 
from src/modules/topoh/th_mask.c . (except LM_ERR is removed and 
pkg_malloc/pkg_free are replaced with malloc/free).

When I run Kamilio under topoh and the websocket client calls, at some moment 
`sip:test-gnome-ca...@bapha.be;gr=urn:uuid:f2f5a3cf-a0fb-0047-be50-740fb9bdc562;alias=87.118.146.153~60472~2>;+sip.instance="<urn:uuid:f2f5a3cf-a0fb-0047-be50-740fb9bdc562>";+org.linphone.specs="conference/1.0,ephemeral/1.1,groupchat/1.1,groupchat/1.2,lime"`
  is passed to th_mask_encode().  The output it 
`sip:127.3.4.84;line=sr-if7s1mg7i36PNf0AbdwPpfzlbqWEpLzsSGItpLwyN39ZMY4t1mCTSd6DNo4LWdIOpfpPp5FLpUQscX63Kd47W5EPWO6sNL90pLgoW5p-1fzlSdzO25n3KoIk1vHkWXptc5wOeopsWXi-eo9*`.
  This is put in a Contact: header.  When that last string is passed to 
th_mask_decode(), e.g. because BYE or ACK have it as R-URI, the output is 
`sip:test-gnome-ca...@bapha.be;gr=urn:uuid:f2f5a3cf-a0fb-0047-be50-740fb9bdc562;alias=87.118.1`.
  From the initial input the final output misses at least `46.153`.

The attached file contains under `b2` another input, which is passed ot 
th_mask_decode.  This is the actual input Kamailio gets at runtime and passes 
to th_mask_decode.  The result is not a string — 
callu.b.p...b.;.r...n:s..d..2lQ — where the dots represent unprintable bytes.

The error report is that th_mask_encode() produces output, which 
th_mask_decode() does not convert to its origin.

N.B.: The above problem happens, when a websocket client calls TCP-client with 
topoh-module.  When a TLS-client calls TCP-client (no websockets involved), 
topoh does not make problems — BYE is delivered properly.

See also:
* 
https://lists.kamailio.org/mailman3/hyperkitty/list/sr-us...@lists.kamailio.org/thread/EQUUHFFEXM7WB2CIUZPAVP3E4JIOWYDI/
* 
https://lists.kamailio.org/mailman3/hyperkitty/list/sr-us...@lists.kamailio.org/thread/IQR26GBVVUCECBRHHXAHNUFJGR6QNDXK/

This might also be related:
* 
https://lists.kamailio.org/mailman3/hyperkitty/list/sr-us...@lists.kamailio.org/thread/J5PHX5O6HVOZH5DMQZIQRJYHXMI3GXUQ/

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3358
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/issues/3...@github.com>
_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to