Asterisk Behind NAT Early Media Video

Home » Asterisk Users » Asterisk Behind NAT Early Media Video
Asterisk Users 17 Comments

Hello,

I have an Asterisk 15 with PJSIP behind NAT (Amazon EC2).

Now I would like to get Early Media Video working between clients in different NATed networks. The 183 signalling goes trough perfectly, but asterisk doesn’t forward the Early Media RTP stream from the caller to the recipent.

I have the following configuration:

[6001]
type = endpoint context = internal rewrite_contact = yes direct_media = no rtp_symmetric = yes force_rport = yes disallow = all allow = alaw, ulaw, h264
aors = 6001
auth = auth6001

[6001]
type = aor max_contacts = 2

[auth6001]
type=auth auth_type=userpass password34
username`01

Is there a Solution for an such scenario?

Thanks

Benjamin

17 thoughts on - Asterisk Behind NAT Early Media Video

  • You would need to examine things specifically and see where media is flowing. Is the recipient behind NAT? If so then until we receive media from them (wich may or may not occur with early media) we may not have the correct target of media.

    Cheers,

  • Yes, media is flowing through Asterisk because both client’s are behind different NAT’s.

    Do I need to do something special in the Call Flow? Or anything additional to the pjsip.conf?

    2018-04-09 16:50 GMT+02:00 Joshua Colp :

  • This doesn’t answer the question of what is ACTUALLY happening in the scenario you describe which is very important.

    The “rtp_symmetric” option as you’ve used causes Asterisk to send media to the source of media, but it requires us to receive media. If we don’t receive it then we send media to where they’ve told us to send it, which as I’ve mentioned can be wrong.

  • My understanding based on Wireshark analysis is that the signaling works
    (also the recipent phone is displaying the video frame before accepting the call), also the calling phone send video (i see that also via Wireshark)
    but the recipent phone doesn’t get any video from the Asterisk before the call.

    2018-04-09 17:02 GMT+02:00 Joshua Colp :

  • wohoo, so if I unterstand it correctly with that patch early media video works over the Asterisk server? In other words the Asterisk server get’s able to (process/)forward the early media video stream with that patch?

    2018-04-09 17:57 GMT+02:00 Joshua Colp :

  • The patch forwards video while in an early media state before the call is answered and bridged, yes.

  • Hi Benjamin!

    You’re obviously using a similar scenario that I have in place for testing. I initially had issues with early media (not only video also audio) as well in that scenario. What I had to do was to additionally set

    external_media_address=

    in pjsip.conf

    Also, as I wrote the patch for early-media video I’d be interested in any feedback from it.

  • I applied the patch to my Asterisk 13.20. But it seems that it still doesn’t forward the early media video stream. Do I need to put something special into the extensions.conf? I basically just make a Dial. The calling Client sends the 183 protocol.

    [public]
    exten => 6001,1,Dial(SIP/${EXTEN})

    2018-04-09 18:14 GMT+02:00 Joshua Colp :

  • Hi Florian

    I already have the external_media_address set in the PJSIP setup. Also the external_signaling_address is set to the Public IP. If I make a call from an Early Media (video&audio) capable device to an Early Media capable device (also video&audio) the Early Media audio works perfectly. But no video. If I sniff with wireshark on the recipent device I just see G711
    (audio) RTP traffic. The h264 RTP traffic is missing before I accept the call. After accepting the call the h264 RTP traffic comes through.

    The 183 SIP protocoll comes through. Even Asterisk is noticing it:
    — PJSIP/6002-00000013 is making progress passing it to PJSIP/6001-00000012

    I tried both Asterisk 15 with pjsip.conf configuration and Asterisk 13 with sip.conf (chan_sip). In both cases I just put the both case AST_FRAME_VIDEO: statements before the two voice cases, like in your diff and recompiled/reinstalled.

    Regards

    Benjamin

    2018-04-10 9:37 GMT+02:00 Floimair Florian :

  • I just noticed, the calling device isn’t even sending the early media video stream. It just sends an early media audio stream. Is there propably a change in the signaling needed?

    (On another P2P SIP Server the early media video works.)

    2018-04-10 12:29 GMT+02:00 Benjamin Marty :

  • I think I found the root cause. The H264 Early Media video is received successfully on the Asterisk Server. It also seems to get processed. But it’s send to the private IP of the receipent SIP phone.

    For clarification:
    178.82.XX.XX is my Public IP of my Internet access. Both phones use this as Public IP via standard Source NAT.
    159.89.XX.XX is the IP of the Asterisk Server. For this test I used a Server without Destination NAT. So the eth0 interface has this IP.

    Packet capture:
    No. Time Source Destination Protocol Length Info
    141 2018-04-11 06:40:03.306561 178.82.XX.XX 159.89.XX.XX
    H264 64 PT=H264, SSRC=0x3CB1E12D, Seq=19561, Time=319121408
    SPS

    Frame 141: 64 bytes on wire (512 bits), 64 bytes captured (512 bits)
    Ethernet II, Src: JuniperN_34:67:f0 (40:a6:77:34:67:f0), Dst:
    da:81:42:3d:d0:e7 (da:81:42:3d:d0:e7)
    Internet Protocol Version 4, Src: 178.82.169.0, Dst: 159.89.104.193
    User Datagram Protocol, Src Port: 5006, Dst Port: 13182
    Real-Time Transport Protocol H.264

    No. Time Source Destination Protocol Length Info
    142 2018-04-11 06:40:03.306682 159.89.XX.XX
    192.168.XX.XX H264 64 PT=H264, SSRC=0x5EE97C55, Seq=30572, Time=319121408 SPS

    Frame 142: 64 bytes on wire (512 bits), 64 bytes captured (512 bits)
    Ethernet II, Src: da:81:42:3d:d0:e7 (da:81:42:3d:d0:e7), Dst:
    IETF-VRRP-VRID_6e (00:00:5e:00:01:6e)
    Internet Protocol Version 4, Src: 159.89.104.193, Dst: 192.168.1.185
    User Datagram Protocol, Src Port: 10298, Dst Port: 5022
    Real-Time Transport Protocol H.264

    PJSIP.conf:
    [7004]
    type = endpoint context = internal rewrite_contact = yes direct_media = no rtp_symmetric = yes
    ;force_rport = yes disallow = all allow = g722, alaw, ulaw, gsm, ilbc, h264
    aors = 7004
    auth = auth7004

    [7004]
    type = aor max_contacts = 2

    [auth7004]
    type=auth auth_type=userpass password=1234
    username=7004

    extensions.conf:
    [internal]
    exten => _700X,1,Dial(PJSIP/${EXTEN})

    2018-04-10 16:43 GMT+02:00 Benjamin Marty :

  • SSBkaWQgYSBxdWljayBjaGVjayBiZXR3ZWVuIHdoYXQgSSBoYXZlIHNldCBhbmQgeW91ciBzZXR0
    aW5ncyBiZWxvdy4NCg0KWW91IGNhbiB0cnkgdGhlIGZvbGxvd2luZyBhbmQgc2VlIGlmIGl0IGhl bHBzDQoNCkluIHlvdXIgZW5kcG9pbnQ6DQpiaW5kX3J0cF90b19tZWRpYV9hZGRyZXNzPXllcw0K
    DQoNCg0KDQpXaXRoIGJlc3QgcmVnYXJkcw0KDQpGbG9yaWFuIEZsb2ltYWlyDQpJbm5vdmF0aW9u IC0gU29mdHdhcmUtRGV2ZWxvcG1lbnQgLSAgVm9JUCAmIERldk9wcw0KDQpDT01NRU5EIElOVEVS
    TkFUSU9OQUwg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DQoNCg0K

  • I added the bind_rtp_to_media_address=yes on all endpoints but still the same behaviour. The funny thing is that the G711 audio early media works and doesn’t have that Private IP issue. I was also able to cross check with chan_sip on Asterisk 15, exactly the same wrong behaviour. See following capture (PJSIP):

    No. Time Source Destination Protocol Length Info
    187 2018-04-11 07:19:56.735967 159.89.XX.XX
    192.168.1.185 H264 943 PT=H264, SSRC=0x3A7AF929, Seq=27144, Time=1248011648 FU-A

    Frame 187: 943 bytes on wire (7544 bits), 943 bytes captured (7544 bits)
    Ethernet II, Src: da:81:42:3d:d0:e7 (da:81:42:3d:d0:e7), Dst:
    IETF-VRRP-VRID_6e (00:00:5e:00:01:6e)
    Internet Protocol Version 4, Src: 159.89.XX.XX, Dst: 192.168.1.185
    User Datagram Protocol, Src Port: 11502, Dst Port: 5022
    Real-Time Transport Protocol H.264

    No. Time Source Destination Protocol Length Info
    188 2018-04-11 07:19:56.735993 159.89.XX.XX
    192.168.1.185 H264 943 PT=H264, SSRC=0x3A7AF929, Seq=27145, Time=1248011648, Mark FU-A End

    Frame 188: 943 bytes on wire (7544 bits), 943 bytes captured (7544 bits)
    Ethernet II, Src: da:81:42:3d:d0:e7 (da:81:42:3d:d0:e7), Dst:
    IETF-VRRP-VRID_6e (00:00:5e:00:01:6e)
    Internet Protocol Version 4, Src: 159.89.XX.XX, Dst: 192.168.1.185
    User Datagram Protocol, Src Port: 11502, Dst Port: 5022
    Real-Time Transport Protocol H.264

    No. Time Source Destination Protocol Length Info
    189 2018-04-11 07:19:56.738966 178.82.XX.XX
    159.89.XX.XX RTP 214 PT=ITU-T G.711 PCMU, SSRC=0x2A1A1C31, Seq=1820, Time=1104983225

    Frame 189: 214 bytes on wire (1712 bits), 214 bytes captured (1712 bits)
    Ethernet II, Src: JuniperN_34:67:f0 (40:a6:77:34:67:f0), Dst:
    da:81:42:3d:d0:e7 (da:81:42:3d:d0:e7)
    Internet Protocol Version 4, Src: 178.82.XX.XX, Dst: 159.89.XX.XX
    User Datagram Protocol, Src Port: 5020, Dst Port: 16130
    Real-Time Transport Protocol

    No. Time Source Destination Protocol Length Info
    190 2018-04-11 07:19:56.738975 178.82.XX.XX
    159.89.XX.XX RTP 214 PT=ITU-T G.722, SSRC=0x49CD55FD, Seq=26679, Time=470333826

    Frame 190: 214 bytes on wire (1712 bits), 214 bytes captured (1712 bits)
    Ethernet II, Src: JuniperN_4f:3f:f0 (40:a6:77:4f:3f:f0), Dst:
    da:81:42:3d:d0:e7 (da:81:42:3d:d0:e7)
    Internet Protocol Version 4, Src: 178.82.XX.XX, Dst: 159.89.XX.XX
    User Datagram Protocol, Src Port: 5004, Dst Port: 18280
    Real-Time Transport Protocol

    2018-04-11 9:11 GMT+02:00 Floimair Florian :

  • As I stated previously in order for media to go to the source IP address and port, media has to be received from the endpoint. If this doesn’t happen then you’ll see exactly this behavior – we’ll send to the IP address and port they told us. There’s nothing that Asterisk itself can do in that instance, the endpoint has to send media or place the correct IP address and port in the messages.

    Was any media received from it?

  • The current behaviour is that Earlymedia video isn’t working when NAT’s in between are involved. The source/destination IP’s are correct. So the client is sending Early media video + Early media audio to the Asterisk Server “in the cloud” and the Asterisk Server “in the cloud” is sending both to the IP where the Client is located. But strangely just the Early media audio is passing the NAT to the recipent.

    My guess is that the NAT traversal for Early media audio is fine, but the one for Early media video not yet. Can you propably comprehend something in that direction? Or can you guide me to the code part where Asterisk is doing the Port change when a NAT is detected and the Client itself is sending “fake” RTP Early media traffic to get a NAT Binding for incoming RTP Early media traffic?

    Benjamin

    2018-04-11 11:50 GMT+02:00 Joshua Colp :