[SR-Users] Problem with IPv4-IPv6 media bridging using RTPengine

Ismir Saljic isaljic at gmail.com
Thu Jul 20 13:36:23 CEST 2017


On 19/07/17 08:31 AM, Ismir Saljic wrote:
>* Hello,
*>>* I've issue with bridging media between IPv4 and IPv6 clients.
*>* IPv4-IPv4 and IPv6-IPv6 calls are working without issues.
*>* I'm using kamailio 4.4.2 and configuration according to:
*>* http://kb.asipto.com/kamailio:kamailio-mixed-ipv4-ipv6
<http://kb.asipto.com/kamailio:kamailio-mixed-ipv4-ipv6>
*>* <http://kb.asipto.com/kamailio:kamailio-mixed-ipv4-ipv6
<http://kb.asipto.com/kamailio:kamailio-mixed-ipv4-ipv6>>
*>>* SIP signalling is working without issues,but media addresses in SDP
*>* are not rewritten correctly.
*>>* The server is on amazon AWS and both kamailio and RTPengine are on the
*>* same server.
*>* RTPengine is running using these options:
*>>* /usr/sbin/rtpengine   --interface=privateIPv4!publicIPv4
*>*                                  --interface=GlobalIPv6
*>*    --listen-udp=127.0.0.1:22222 <http://127.0.0.1:22222>
<http://127.0.0.1:22222 <http://127.0.0.1:22222>>
*>*    --tos=184
*>* --pidfile=/var/run/rtpengine.pid
*>*    --log-level=6
*>*    --log-facility=daemon
*
I would suggest to use Kamailio's rtpengine module instead of rtpproxy,
together with --listen-ng instead of --listen-udp.

The UDP protocol of the rtpproxy module should work with rtpengine, but
not many people are using it, so it's always possible that some bugs
creep in. I'll look into it anyway, but in the long run, it's much
preferable to switch to the rtpengine module.

Cheers
##########################

Hello Richard,

thank you very much for your answer. I will try to use rtpengine module.

As I can see from logs, kamailio is sending correctly data to
rtpengine but rtp engine

failed to parse IPv6 address from SDP body.

I'm sending flags to rtpengine according to the howto from link I've
posted in the original post.

This is the part of the config:

if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)
			|| isbflagset(FLB_V4V6)))
		return;

	if(isbflagset(FLB_V4V6)) {
		if(af==INET6) {
			rtpproxy_manage("FAEI");
		} else {
			rtpproxy_manage("FAIE");
		}
	} else {
		if(af==INET6) {
			rtpproxy_manage("FAEE");
		} else {
			rtpproxy_manage("FAII");

I'm not sure if I need to inform rtpengine that in SDP body will be
IPv6 address.

Thanks

Ismir


On Wed, Jul 19, 2017 at 2:31 PM, Ismir Saljic <isaljic at gmail.com> wrote:

> Hello,
>
> I've issue with bridging media between IPv4 and IPv6 clients. IPv4-IPv4
> and IPv6-IPv6 calls are working without issues.
> I'm using kamailio 4.4.2 and configuration according to:
> http://kb.asipto.com/kamailio:kamailio-mixed-ipv4-ipv6
>
> SIP signalling is working without issues,but media addresses in SDP are
> not rewritten correctly.
>
> The server is on amazon AWS and both kamailio and RTPengine are on the
> same server.
> RTPengine is running using these options:
>
> /usr/sbin/rtpengine   --interface=privateIPv4!publicIPv4
>                                  --interface=GlobalIPv6
>                                  --listen-udp=127.0.0.1:22222
>                                  --tos=184
>                                  --pidfile=/var/run/rtpengine.pid
>                                  --log-level=6
>                                  --log-facility=daemon
>
>
> In case of IPv4-IPv6 call, INVITE message contains correct IPv4 address
> but 200 OK response to the caller still contains IPv6 address of the callee
> in SDP body instead of IPv4 address of the server/RTPengine.
> This is the log during generation of the 200 OK response. Seems that
> RTPengine failed to parse IPv4 address from SDP body.
>
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/msg_parser.c:618]: parse_msg(): SIP Reply  (status):
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/msg_parser.c:620]: parse_msg():  version: <SIP/2.0>
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/msg_parser.c:622]: parse_msg():  status:  <200>
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/msg_parser.c:624]: parse_msg():  reason:  <OK>
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/parse_via.c:1254]: parse_via_param(): Found param type 232,
> <branch> = <z9hG4bK5afe.c59aef39af345458e17940722ba0c70b.0>; state=6
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/parse_via.c:1254]: parse_via_param(): Found param type 234,
> <received> = <Server's GlobalIPv6>; state=6
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/parse_via.c:1254]: parse_via_param(): Found param type 236, <i> =
> <8>; state=16
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/parse_via.c:2642]: parse_via(): end of header reached, state=5
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/msg_parser.c:496]: parse_headers(): parse_headers: Via found,
> flags=2
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/msg_parser.c:498]: parse_headers(): parse_headers: this is the
> first via
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [receive.c:178]: receive_msg(): After parse_msg...
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: tm
> [t_lookup.c:1011]: t_check_msg(): DEBUG: t_check_msg: msg id=143 global
> id=142 T start=0xffffffffffffffff
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/parse_via.c:1254]: parse_via_param(): Found param type 234,
> <received> = <178.165.130.177>; state=6
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/parse_via.c:1254]: parse_via_param(): Found param type 232,
> <branch> = <z9hG4bK.BUIgttWpK>; state=6
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/parse_via.c:1254]: parse_via_param(): Found param type 235, <rport>
> = <2066>; state=16
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/parse_via.c:2642]: parse_via(): end of header reached, state=5
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/msg_parser.c:496]: parse_headers(): parse_headers: Via found,
> flags=62
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/msg_parser.c:509]: parse_headers(): parse_headers: this is the
> second via
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/parse_addr_spec.c:172]: parse_to_param(): DEBUG: add_param:
> tag=2996330c
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/parse_addr_spec.c:894]: parse_addr_spec(): end of header reached,
> state=29
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/msg_parser.c:173]: get_hdr_field(): DEBUG: get_hdr_field: <To>
> [59]; uri=[sip:user at domain.com]
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/msg_parser.c:175]: get_hdr_field(): DEBUG: to body ["user"<
> sip:user at domain.com>]
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/msg_parser.c:153]: get_hdr_field(): get_hdr_field: cseq <CSeq>:
> <21> <INVITE>
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: tm
> [t_lookup.c:888]: t_reply_matching(): DEBUG: t_reply_matching: hash 61349
> label 0 branch 0
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: tm
> [t_lookup.c:943]: t_reply_matching(): DEBUG: t_reply_matching: reply
> matched (T=0x7f7f95c19a10)!
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: tm
> [t_hooks.c:266]: run_trans_callbacks_internal(): DBG:
> trans=0x7f7f95c19a10, callback type 2, id 0 entered
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: acc
> [acc_logic.c:644]: tmcb_func(): acc callback called for t(0x7f7f95c19a10)
> event type 2, reply code 200
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: tm
> [t_lookup.c:1080]: t_check_msg(): DEBUG: t_check_msg: msg id=143 global
> id=143 T end=0x7f7f95c19a10
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: tm
> [t_reply.c:2160]: reply_received(): DEBUG: reply_received: org. status
> uas=180, uac[0]=180 local=0 is_invite=1)
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <script>:
> incoming reply
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <script>: BMX:
> FAIE
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/msg_parser.c:187]: get_hdr_field(): DEBUG: get_hdr_body :
> content_length=559
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/msg_parser.c:89]: get_hdr_field(): found end of header
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/sdp/sdp_helpr_funcs.c:504]: extract_mediaip(): located IP address
> [IPv6 of the callee] in `o=' field
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/sdp/sdp_helpr_funcs.c:504]: extract_mediaip(): located IP address
> [IPv6 of the callee] in `c=' field
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/sdp/sdp.c:574]: parse_sdp_session(): ignoring unknown type in a=
> line: `a=rtcp-fb:* nack#015#012a=rtcp-fb:* nack pli#015#012'
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/sdp/sdp.c:574]: parse_sdp_session(): ignoring unknown type in a=
> line: `a=rtcp-fb:* nack pli#015#012'
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: rtpproxy
> [rtpproxy_funcs.c:148]: check_content_type(): type <application/sdp> found
> valid
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/parse_addr_spec.c:172]: parse_to_param(): DEBUG: add_param:
> tag=aNfQNJz3e
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/parse_addr_spec.c:894]: parse_addr_spec(): end of header reached,
> state=29
> Jul 19 08:02:42  rtpengine[24330]: Got valid command from udp:
> 127.0.0.1:28152: 1691_12 LAEI6 dcMDMrNRhw IPv6 of the callee 58100
> aNfQNJz3e;1 2996330c;1
> Jul 19 08:02:42  rtpengine[24330]: [dcMDMrNRhw] Failed to parse a media
> stream: /IPv6 of the callee:58100
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: rtpproxy
> [rtpproxy.c:2712]: force_rtp_proxy(): proxy reply: E8
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: ERROR: rtpproxy
> [rtpproxy.c:2735]: force_rtp_proxy(): incorrect port 0 in reply from rtp
> proxy
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: tm
> [t_reply.c:1233]: t_should_relay_response(): ->>>>>>>>> T_code=180,
> new_code=200
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: tm
> [t_reply.c:1751]: relay_reply(): DEBUG: relay_reply: branch=0, save=0,
> relay=0 icode=0
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [msg_translator.c:2260]: generate_res_buf_from_sip_res(): old size: 1467,
> new size: 1319
> Jul 19 08:02:42  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [msg_translator.c:2278]: generate_res_buf_from_sip_res(): copied size:
> orig:164, new: 16, rest: 1303
> msg=#012SIP/2.0 200 OK#015#012
> Via: SIP/2.0/TCP 10.152.108.46:56401;received=X.X.X.X;
> branch=z9hG4bK.BUIgttWpK;rport=2066
> Record-Route: <sip:[Server's IPv6];transport=tcp;r2=on;lr;nat=v46>
> Record-Route: <sip:X.X.X.X;transport=tcp;r2=on;lr;nat=v46>
> Contact: <sip:user@[IPv6 of the callee]:59335;rinstance=836aa3
> 6a01097072;transport=tcp>
> To: "user"<sip:user at domain.com>;tag=2996330c
> From: "caller" <sip:caller at domain.com>;tag=aNfQNJz3e
> Call-ID: dcMDMrNRhw
> CSeq: 21 INVITE
> Allow: SUBSCRIBE, NOTIFY, INVITE, ACK, CANCEL, BYE, REFER, INFO, OPTIONS,
> MESSAGE
> Content-Type: application/sdp
> Supported: replaces
> User-Agent: Bria 5 release 5.0.0 stamp 85993
> Content-Length: 559
>
> v=0
> o=- 241380314 3 IN IP6 IPv6 of the callee(should be IPv4 address of the
> server)
> s=Bria 5 release 5.0.0 stamp 85993
> c=IN IP6 IPv6 of the callee (should be IPv4 address of the server)
>
>
>
> The same situation is in case of IPv6-IPv4 call.
> This is the part of the log in case of IPV6-IPv4 call when kamailio is
> creating INVITE to the IPv4 callee:
>
> Jul 19 08:04:52  /usr/local/sbin/kamailio[1691]: DEBUG: <script>: BMX:
> FAIE
> Jul 19 08:04:52  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/sdp/sdp_helpr_funcs.c:504]: extract_mediaip(): located IP address
> [IPv6 Address] in `o=' field
> Jul 19 08:04:52  /usr/local/sbin/kamailio[1691]: DEBUG: <core>
> [parser/sdp/sdp_helpr_funcs.c:504]: extract_mediaip(): located IP address
> [IPv6 Address] in `c=' field
> Jul 19 08:04:52  /usr/local/sbin/kamailio[1691]: DEBUG: rtpproxy
> [rtpproxy_funcs.c:148]: check_content_type(): type <application/sdp> found
> valid
> Jul 19 08:04:52  rtpengine[24330]: Got valid command from udp:
> 127.0.0.1:28152: 1691_13 UAEI6 85993YWVkNmQ4YTFmN2JkZWQ4NjIzMGYwMDBlM2RlOGY0ZDQ
> 2a03:f81:abcd:172:16:20:119:2 50168 1430094e;1
> Jul 19 08:04:52  rtpengine[24330]: [85993YWVkNmQ4YTFmN2JkZWQ4NjIzMGYwMDBlM2RlOGY0ZDQ]
> Creating new call
> Jul 19 08:04:52  rtpengine[24330]: [85993YWVkNmQ4YTFmN2JkZWQ4NjIzMGYwMDBlM2RlOGY0ZDQ]
> Failed to parse a media stream: /IPv6:50168
> Jul 19 08:04:52  /usr/local/sbin/kamailio[1691]: DEBUG: rtpproxy
> [rtpproxy.c:2712]: force_rtp_proxy(): proxy reply: E8
> Jul 19 08:04:52  /usr/local/sbin/kamailio[1691]: ERROR: rtpproxy
> [rtpproxy.c:2735]: force_rtp_proxy(): incorrect port 0 in reply from rtp
> proxy
> Jul 19 08:04:52  /usr/local/sbin/kamailio[1691]: DEBUG: siputils
> [checks.c:97]: has_totag(): no totag
>
>
> Any help would be very appreciated!
>
> Thank you
> Kind regards
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20170720/fb37a77f/attachment.html>


More information about the sr-users mailing list