I am doing some bespoke development work with Asterisk and I’m stuck on this issue.
When you make an outgoing call there is no audio until it is placed on-hold and off-hold.
For incoming calls, the audio seems to work fine (from another SIP Provider to a UK number with Zadarma).
I have tested using Groundwire on iPhone and X-Lite on PC with the same result. The call flow is a phone in LAN, to VULTR server in WAN, to Zadarma SIP Provider, to a UK number with another SIP Provider (Yay).
I set up an extension on the Asterisk server which just plays music and that audio always seems to work fine. It’s only when calling out over Zadarma that I see this issue so I don’t know where the issue is but I think it is further upstream.
I tried adding some settings for NAT (even though the server has its own IPv4 and isn’t using NAT). I also tried adding some settings to the endpoint such as directmedia=no in attempt to fix the issue.
I am using the default rtp.conf sample file.
Here is my pjsip.conf file with passwords removed and SIP user ID changed:
; --- --- --- Start of File "pjsip.conf" ; --- --- --- Start of Transports ; --- Start of Transport "transport-udp" [transport-udp] type=transport protocol=udp bind=220.127.116.11 ; Configuring res_pjsip to work through nat: https://wiki.asterisk.org/wiki/display/AST/Configuring+res_pjsip+to+work+through+NAT local_net=127.0.0.1/32 external_media_address=18.104.22.168 external_signaling_address=22.214.171.124 ; --- End of Transport "transport-udp" ; --- --- --- End of Transports ; --- --- --- Start of Trunks ; --- Start of Trunk "zadarma"  type=registration transport=transport-udp outbound_auth=54321 server_uri=sip:sip.zadarma.com client_uri=sip:firstname.lastname@example.org retry_interval=60 expiration=120 contact_user=54321  type=auth auth_type=userpass password= username=54321  type=aor contact=sip:sip.zadarma.com:5060  type=endpoint transport=transport-udp context=LocalSets allow=!all,ulaw outbound_auth=54321 aors=54321 from_user=54321 direct_media=no rtp_symmetric=yes force_rport=yes rewrite_contact=yes  type=identify endpoint=54321 match=sip.zadarma.com match=126.96.36.199/24 match=188.8.131.52/24 match=184.108.40.206/24 match=220.127.116.11/27 ; --- End of Trunk "zadarma" ; --- --- --- End of Trunks ; --- --- --- Start of Templates ; --- Start of Template "endpoint" [endpoint](!) type=endpoint transport=transport-udp context=internal allow=!all,ulaw direct_media=no rtp_symmetric=yes force_rport=yes rewrite_contact=yes [auth-userpass](!) type=auth auth_type=userpass [aor-single-reg](!) type=aor max_contacts=10 ; --- End of Template "endpoint" ; --- --- --- End of Templates ; --- --- --- Start of Endpoints ; --- Start of Endpoint "1001" (endpoint) auth=1001 aors=1001 (auth-userpass) password= username=1001 (aor-single-reg) ; --- End of Endpoint "1001" ; --- Start of Endpoint "1002" (endpoint) auth=1002 aors=1002 (auth-userpass) password= username=1002 (aor-single-reg) ; --- End of Endpoint "1002" ; --- --- --- End of Endpoints ; --- --- --- End of File "pjsip.conf"