I've stumbled on a problem when I set SIP-Communicator to listen on an
non-standard SIP port (6061 instead of 5060 in my case). I make an outgoing
call to another SIP-Communicator instance directly without going through a
registrar. The call is initated normally, the callee sends the responses to
the INVITE request to port 6061. Then, when I hang up, the callee sends the
OK to the BYE request to the default sip port 5060 instead of 6061.
When I looked a the log, I noticed that the INVITE request has a Via header
while the BYE requests Via header is
Notably the custom port is missing from the BYE Via header.
Looking through the code I found out that the INVITE Via header is
constructed by SIP-Communicator while the BYE header is generated by the
ListeningPointImpl of the JAIN-SIP library. I also found out that
ProtocolProviderSipImpl.createListeningPoint manually sets the sentBy of the
If I remove this line, I get a BYE request Via header of
which contains the port, and the BYE request is answered on the correct
Unfortunately, I don't know enough about the SIP protocol or the JAIN SIP
library to decide if removing this line is a good idea in the general case.
Perhaps someone else can answer this?