[sip-comm-dev] Problem when using a non-standard SIP port


#1

Hi all!

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
of
Via: SIP/2.0/UDP
192.168.32.84:6061;branch=z9hG4bK51581faef174294ae39081ac053e5c87
while the BYE requests Via header is
Via: SIP/2.0/UDP
0.0.0.0;branch=z9hG4bK24ef63e7cc7ab856295b720dfd835c7f;received=192.168.32.8
4
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
ListeningPointImpl:
...
listeningPoint.setSentBy("0.0.0.0");
...
If I remove this line, I get a BYE request Via header of
Via: SIP/2.0/UDP
0.0.0.0:6061;branch=z9hG4bK24ef63e7cc7ab856295b720dfd835c7f;received=192.168
.32.84
which contains the port, and the BYE request is answered on the correct
port.

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?

Regards
Michael Koch


#2

Hi Michael,

I remember explicitly setting "0.0.0.0" through setSentBy() as otherwise
the ListeningPoint was refusing to let the request go.

However, since you are saying that you have tested this and it seems to
work, then I guess this might have been changed in jain-sip.

I'll give this some testing one of these days and commit it if
everything goes fine.

Thanks for reporting the issue!

Emil

Koch Michael wrote:

ยทยทยท

Hi all!

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
of
Via: SIP/2.0/UDP
192.168.32.84:6061;branch=z9hG4bK51581faef174294ae39081ac053e5c87
while the BYE requests Via header is
Via: SIP/2.0/UDP
0.0.0.0;branch=z9hG4bK24ef63e7cc7ab856295b720dfd835c7f;received=192.168.32.8
4
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
ListeningPointImpl:
...
listeningPoint.setSentBy("0.0.0.0");
...
If I remove this line, I get a BYE request Via header of
Via: SIP/2.0/UDP
0.0.0.0:6061;branch=z9hG4bK24ef63e7cc7ab856295b720dfd835c7f;received=192.168
.32.84
which contains the port, and the BYE request is answered on the correct
port.

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?

Regards
Michael Koch

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net