[SR-Users] [sr-dev] How to uniquely identify SIP WS / WSS endpoint

Muhammad Shahzad shaheryarkh at gmail.com
Wed Sep 3 03:09:16 CEST 2014


Thank you so much for your informative response.

Yes the "peer" may be correct term in this sense as i am trying to identify
"devices" (SIP UAs or Proxy) that are directly connected to Kamailio via
SIP signalling (i.e. there is no other intermediate SIP device [SIP UA or
Proxy] in the middle). That is why top most VIA header looks interesting as
it has peer network address that can be used to identify that peer uniquely
for both incoming and outgoing SIP requests and responses.

However, this works perfectly fine ONLY for TCP, TLS and UDP transports.
For WS and WSS, there is no network address, just some random string, which
is not guaranteed to be unique in peer context.

Anyways for the moment the only workaround i see fit for the situation is
to modify WS client code such that i generates this random string uniquely
(e.g. something like GUID used by Windows OS or UUID generated by libuuid
in Linux).

Any other suggestions are warmly welcome.

Thank you.




On Tue, Sep 2, 2014 at 4:22 PM, Klaus Darilion <klaus.mailinglists at pernau.at
> wrote:

> Not sure what you trying to do, but the Via header is for transactions.
> It may be different for every transaction. Thus, if you need transaction
> matching (requests to responses) then you are fine and should use purely
> the branch id.
>
> If you want to match messages from one transaction to messages from
> another transaction (e.g. dialog matching or matching multiple dialogs
> from the same user) then the Via is probably the wrong choice. Please
> also note, that the user can put any data into the Via header and this
> may confuse your application if you blindly trusts all the data in the
> Via header.
>
> For matching dialogs you should use call-id and tags (or use the dialog
> module).
>
> For matching requests from a certain user agent: I think there is no
> reliable way - GRUU may work if available.
>
> But as you are talking about encryption it is more "peer" related then
> user-agent related. I say "peer" as the peer may be another proxy with
> several user agents behind. To identify peers you should use the data
> from the transport: IP, port, protocol. That should be unique for a
> peer. For received messages it should be simple to extract them, for
> sending, the data should be available too (e.g. in DURI or some
> references to a TCP connection).
>
> regards
> Klaus
>
> On 22.08.2014 02:26, Muhammad Shahzad wrote:
> > Sorry for putting this question on both dev and user mailing lists, as
> > it is a rather theoretical question and i hope some SIP guru on either
> > mail list will answer.
> >
> > For non-WS endpoints which use TCP or UDP for SIP transport, each
> > upstream request has top most VIA header pointing to the previous hop
> > which forwarded the request to current hop while each downstream request
> > has top most VIA header pointing to next hop to which it will be
> > forwarded from current hop.
> >
> > But for WS endpoints, the top most VIA has dummy static value, so there
> > is no way to identify who sent this request or to whom the reply is
> > going to.
> >
> > Please note that i am not specifically interested in network address of
> > remote endpoint (though VIA header is suppose to provide it), i only
> > need to match requests and responses from / to a specific device using
> > SIP v2.0 standard.
> >
> > Any help is highly appreciated.
> >
> > Thank you.
> >
> >
> >
> >
> > _______________________________________________
> > sr-dev mailing list
> > sr-dev at lists.sip-router.org
> > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
> >
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20140903/d5edfb99/attachment.html>


More information about the sr-users mailing list