Search code examples
asteriskpjsipopensips

Asterisk 13 PJSIP sometime sound coming sometime not coming


I recently set up my asterisk 13 with PJSIP and database. All working fine, but sometimes I get no voice, where most of the time I get a voice. So I need RTP software? following is detail log, I am looking but not found any voice or codec issue, as I set up codec to all, and this is local environment all local services, so there should not be any nat related issue but seem I have configured incorrect nat issue. I migrated and also notice the same issue in old sip servers too and I moved it on new due to this voice issue. So it is sure that it is not a software issue, but must be a configuration issue. Following is my log. note: I am a newbie in PJSIP and it is my first PJSIP installation.

-- Executing [1567241111@default:1] AGI("PJSIP/192.168.56.103-00000004", "myagi.pl,0000FFFF0001,1567241111,,PJSIP/192.168.56.103-00000004,,1547882181.8") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/myagi.pl
<--- Transmitting SIP response (913 bytes) to UDP:192.168.56.103:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.56.103:5060;received=192.168.56.103;branch=z9hG4bK08e608fd
Call-ID: [email protected]:5060
From: "vendorTest" <sip:[email protected]>;tag=as7756e843
To: <sip:[email protected]>;tag=1bf6a0d2-1c8b-431f-91c7-a074337a7b88
CSeq: 102 INVITE
Server: Asterisk PBX certified/13.21-cert3
Contact: <sip:192.168.56.102:5060>
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, REFER, MESSAGE
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length:   288

v=0
o=- 2131651698 2131651700 IN IP4 192.168.56.102
s=Asterisk
c=IN IP4 192.168.56.102
t=0 0
m=audio 24874 RTP/AVP 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<--- Received SIP request (460 bytes) from UDP:192.168.56.103:5060 --->
ACK sip:192.168.56.102:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.56.103:5060;branch=z9hG4bK62ff354e
Max-Forwards: 70
From: "vendorTest" <sip:[email protected]>;tag=as7756e843
To: <sip:[email protected]>;tag=1bf6a0d2-1c8b-431f-91c7-a074337a7b88
Contact: <sip:[email protected]:5060>
Call-ID: [email protected]:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 11.13.1~dfsg-2+deb8u5
Content-Length: 0

My PJSIP configuration calling peer

[192.168.56.103]
type = aor
contact = sip:192.168.56.103
maximum_expiration = 60
minimum_expiration = 60
default_expiration = 180

[192.168.56.103]
type = identify
endpoint = 192.168.56.103
match =  192.168.56.103

[192.168.56.103]
type = endpoint
context = default
dtmf_mode = rfc4733
disallow = all
allow =all
direct_media = yes
language = en
aors = 159.203.27.198
t38_udptl = yes
t38_udptl_ec = none
rtp_symmetric = yes
force_rport = no
rewrite_contact = yes
direct_media = no

My Servers

192.168.56.103 - Asterisk 13 with PJSIP  - call receiver
192.168.56.102 - Asterisk 11 with PJSIP - Caller

To make clear I have put voicemail so another part is actually asterisked replying, normal it asks for a password and it does 10 times but 2 times no voice? any idea where I am doing wrong. Should I install RTP engine or RTPProxy. I heard a lot of people say we must have RTP, Stun or ICE server, so what would be a better environtment should I put opensips on front as a SBC and than forward call to Asterisk, as I am expecting more servers in this current setup so need strong communication infrastructure without any sound issue.


Solution

  • The issue was solved by using RTP debug, where I noticed that sound packets were not receiving from another side due to the firewall. Firewall setup 10000-20000 ports but this asterisk was sending different ports, now I fixed using RTP.conf ports and also voice is perfectly coming.