Hi everbody,
I encountered an issue with my Kamailio in combination with Rtpengine. I wondered if
anybody got a solution or a hint as this issue is only in combination with special
parallel forked calls.
I sent a call from my SIP gateway via a Kamailio to another SIP provider. The other SIP
provider or the B-user seems to use a parallel forking as I receive 183 Session Progress
and 180 Ringing with different to-tags.
My kamailio is using a Rtpengine to relay the media from my SIP gateway to the other SIP
provider. As Kamailio receives two different to-tags that include a SDP body
rtpengine_manage makes Rtpengine to change RTP port.
Some short example (cut down to the important messages):
a-gateway kamailio b-provider
| INVITE Port 16890 | INVITE Port 20400 |
| ------------------------> | --------------------------> |
| | |
| 180 to-tag 1 / no SDP | 180 to-tag 1 / no SDP |
| <------------------------ | <------------------------- |
| | |
| 183 to-tag 2 / Port 20408 | 183 to-tag 2 / Port 46298 |
| <------------------------ | <------------------------- |
| | |
| | |
| RTP | RTP |
| Port 16890 <---- Port 20408 | Port 20400 <---- Port 46298 |
| | |
| | |
| RTP | RTP |
| Port 16890 ----> Port 20408 | Port 20400 ----> Port 46298 |
| | |
| | |
| 180 to-tag 2 / Port 20408 | 180 to-tag 0 / Port 46298 |
| <------------------------ | <------------------------- |
| | |
| | |
| 200 OK to-tag 1 / Port 20408 | 200 OK to-tag 1 / Port 46298 |
| <------------------------ | <------------------------- |
| | |
| | |
| RTP | RTP |
| Port 16890 <---- Port 20408 | Port 20400 <---- Port 46298 |
| | |
| | |
| RTP | RTP |
| Port 16890 ----> Port 20408 | Port 20418 ----> Port 46298 |
Kamailio receives INVITE from a-gateway with rtp port 16890 and rtpengine rewrites it with
port 20400 to b-provider.
b-provider sends 180 ringing from to-tag 1 and no SDP which is just passed through
kamailio to a-gateway.
b-provider sends 183 progress from to-tag 2 and SDP with port 46298 to kamailio.
rtpengines rewrites the sdp port to 20408 which is passed to a-gateway.
b-provider start sending RTP via the negotiated ports which is passed correctly to
a-gateway.
b-provider sends 180 ringing from to-tag 2 with the same SDP. Rewritten and passed to
a-gateway.
b-provider sends 200 OK on Invite. This 200 Ok is from to-tag 1 but including the same SDP
endpoint as to-tag 2 used before.
Media from b-provider via rtpengine to a-gateway is passed the same way as before.
Media from a-gateway to rtpengine is passed the same way as before. Media from rtpengine
is passed with a different source port to b-provider. As this port was not announced in
the callflow b-provider blocks the traffic.
Any ideas how to fix this issue or force rtpengine to stay on the same port?
Thanks
Michael