Sounds problem with asterisk

Hi guys,

I am having an odd problem.

I have made sip users and extensions.
Calling between them works like a charm.

The quality of sound seems to be really of… it sounds horrible.
It’s like I can almost not hear the person on the other side.

What would be the problem to a case like this?
I think (correct me if I am wrong) I did something wrong with my settings.

My settings are as followed;

sip.conf

; SIP Configuration for Asterisk
context => phones ; Default context for incoming calls. Defaults to 'default'
allowguest => yes ; Allow or reject guest calls (default is yes)
allowoverlap => yes ; Disable overlap dialing support. (Default is yes)
tcpenable => yes ; Enable server for incoming TCP connections (default is no)
tcpbindaddr => 0.0.0.0:15060 ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
udpbindaddr => 0.0.0.0:15060 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
transport => udp ; Set the default transports.  The order determines the primary default transport.
nat => force_rport,comedia
localnet => 172.31.27.202/255.255.0.0 ; NAT SUPPORT
externaddr =>54.178.185.181  ; NAT SUPPORT
media_address => 54.178.185.181 ; NAT SUPPORT
directmedia => no
srvlookup => yes ; Enable DNS SRV lookups on outbound calls
language => ja ; Default language setting for all users/peers
rtcachefriends => yes ; realtime database settings
rtautoclear => yes ; realtime database settings

;------------------------------ quality settings --------------------------
tos_sip => cs3                  ; Sets TOS for SIP packets.
tos_audio => ef                 ; Sets TOS for RTP audio packets.

cos_sip => 3                    ; Sets 802.1p priority for SIP packets.
cos_audio => 5                  ; Sets 802.1p priority for RTP audio packets.

;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
jbenable => no                  ; Enables the use of a jitterbuffer on the receiving side of a
                                ; SIP channel. Defaults to "no". An enabled jitterbuffer will
                                ; be used only if the sending side can create and the receiving
                                ; side can not accept jitter. The SIP channel can accept jitter,
                                ; thus a jitterbuffer on the receive SIP side will be used only
                                ; if it is forced and enabled.
                                ; (和訳)SIPチャネルの受信側でジッタバッファを使用できるようにします。
                                ; デフォルトは「いいえ」です。有効なジッタバッファは、送信側が作成でき、
                                ; 受信側がジッタを受け入れることができない場合にのみ使用されます。
                                ; SIPチャネルはジッタを受け入れることができます。
                                ; したがって、受信SIP側のジッタバッファは、
                                ; 強制的に有効化されている場合にのみ使用されます。

jbforce => no                   ; Forces the use of a jitterbuffer on the receive side of a SIP
                                ; channel. Defaults to "no".
                                ; (和訳)SIPチャネルの受信側でジッタバッファを強制的に使用します。
                                ; デフォルトは「いいえ」です。

jbmaxsize => 200                ; Max length of the jitterbuffer in milliseconds.
                                ; (和訳)ジッタバッファの最大長(ミリ秒単位)。

jbresyncthreshold => 1000       ; Jump in the frame timestamps over which the jitterbuffer is
                                ; resynchronized. Useful to improve the quality of the voice, with
                                ; big jumps in/broken timestamps, usually sent from exotic devices
                                ; and programs. Defaults to 1000.
                                ; (和訳)ジッタバッファが再同期されるフレームタイムスタンプ内をジャンプします。
                                ; 通常はエキゾチックなデバイスやプログラムから送信される、
                                ; 壊れたタイムスタンプの大きなジャンプで、音声の品質を向上させるのに便利です。
                                ; デフォルトは1000です。

jbimpl => fixed                 ; Jitterbuffer implementation, used on the receiving side of a SIP
                                ; channel. Two implementations are currently available - "fixed"
                                ; (with size always equals to jbmaxsize) and "adaptive" (with
                                ; variable size, actually the new jb of IAX2). Defaults to fixed.
                                ; (和訳)SIPチャネルの受信側で使用されるJitterbuffer実装。
                                ; 現在のところ、 "fixed"(サイズは常にjbmaxsizeに等しい)と
                                ; "adaptive"(可変サイズで、実際はIAX2の新しいjb)という
                                ; 2つの実装が利用可能です。デフォルトは固定です。

jbtargetextra => 40             ; This option only affects the jb when 'jbimpl = adaptive' is set.
                                ; The option represents the number of milliseconds by which the new jitter buffer
                                ; will pad its size. the default is 40, so without modification, the new
                                ; jitter buffer will set its size to the jitter value plus 40 milliseconds.
                                ; increasing this value may help if your network normally has low jitter,
                                ; but occasionally has spikes.
                                ; (和訳)このオプションは、 'jbimpl = adaptive'が設定されている場合に
                                ; のみjbに影響します。このオプションは、新しいジッタバッファがその
                                ; サイズを埋めるまでのミリ秒数を表します。デフォルトは40ですので、
                                ; 変更なしでは、新しいジッタバッファはジッタ値に40ミリ秒を加えたサイズに設定されます。
                                ; この値を大きくすると、ネットワークのジッタが通常は低くなりますが、
                                ; 時にはスパイクが発生することがあります。

jblog => yes                    ; Enables jitterbuffer frame logging. Defaults to "no".
                                ; (和訳)ジッタバッファフレームロギングをイネーブルにします。
                                ; デフォルトは「いいえ」です。

;--------------------------- RTP timers ----------------------------------------------------
; These timers are currently used for both audio and video streams. The RTP timeouts
; are only applied to the audio channel.
; The settings are settable in the global section as well as per device.
; (和訳)これらのタイマーは、現在、オーディオストリームとビデオストリームの両方に使用されています。
; RTPタイムアウトはオーディオチャネルにのみ適用されます。
; 設定は、デバイスごとにグローバルセクションでも設定できます。
;
rtptimeout => 5                 ; Terminate call if 60 seconds of no RTP or RTCP activity
                                ; on the audio channel
                                ; when we're not on hold. This is to be able to hangup
                                ; a call in the case of a phone disappearing from the net,
                                ; like a powerloss or grandma tripping over a cable.
                                ; (和訳)保留されていないときに、オーディオチャネルでRTPまたはRTCPの
                                ; アクティビティがない場合は、60秒間コールを終了します。
                                ; これは、電力損失やおばあちゃんがケーブルを乗り越えるように、
                                ; ネットから消えていく電話の場合に電話を切ることができるようにするためです。

;rtpholdtimeout => 300          ; Terminate call if 300 seconds of no RTP or RTCP activity
                                ; on the audio channel
                                ; when we're on hold (must be > rtptimeout)
                                ; (和訳)保留中の場合、オーディオチャネルでRTPまたはRTCPのアクティビティがない状態で
                                ; 300秒が経過すると、コールを終了します。 (rtptimeoutより大きくなければいけません)

;rtpkeepalive => <secs>         ; Send keepalives in the RTP stream to keep NAT open
                                ; (default is off - zero)
                                ; (和訳)キープアライブをRTPストリームに送信して、NATを開いたままにします
                                ; (デフォルトはオフ)

;--------------------------------codec---------------------------------------------------
;音声コーデックのGSM固定 作業者:渋谷 2018/06/26
disallow => all
allow => ulaw,alaw,gsm

;-----------------------------------------------------------------------------------
;セッション設定  作業者:あすか柴田 2018/07/23
session-expires => 1800
session-refresher => uac

[ACCOUNT-COMMON](!)
type=friend
nat=force_rport,comedia
secret=123456
canreinvite=no
dtmfmode=auto
callgroup=1
pickupgroup=1
context=phones

[1000](ACCOUNT-COMMON)
[1001](ACCOUNT-COMMON)
[1002](ACCOUNT-COMMON)
[1003](ACCOUNT-COMMON)
[1004](ACCOUNT-COMMON)
[1005](ACCOUNT-COMMON)
[1006](ACCOUNT-COMMON)
[1007](ACCOUNT-COMMON)
[1008](ACCOUNT-COMMON)
[1009](ACCOUNT-COMMON)
[1010](ACCOUNT-COMMON)
[1011](ACCOUNT-COMMON)
[1012](ACCOUNT-COMMON)
[1013](ACCOUNT-COMMON)
[1014](ACCOUNT-COMMON)
[1015](ACCOUNT-COMMON)
[1016](ACCOUNT-COMMON)
[1017](ACCOUNT-COMMON)
[1018](ACCOUNT-COMMON)
[1019](ACCOUNT-COMMON)
[1020](ACCOUNT-COMMON)

My extensions.conf

[phones]
exten =>  _X0XX,1,NoOp(First Line)
    same  => n,dumpchan()
    same  => n,NoOp(Second Line)
    same  => n,Dial(SIP/${CALLERID(dnid)}/${CALLERID(dnid)})
    same  => n,NoOp(dialstatus=${DIALSTATUS},causecode=${HANGUPCAUSE})
    same  => n,Hangup

The debug log from the client when I call

SIP Debugging enabled

<--- SIP read from UDP:111.108.30.208:62566 --->

<------------->
Really destroying SIP dialog 'e02d510346cd4db58cc2869ea3e85542' Method: REGISTER

<--- SIP read from UDP:111.108.30.208:62383 --->

<------------->
Really destroying SIP dialog '31f2d3b15ce749c38149a4443ceecc7b' Method: REGISTER

<--- SIP read from UDP:111.108.30.208:62566 --->
INVITE sip:1000@54.178.185.181:15060 SIP/2.0
Via: SIP/2.0/UDP 111.108.30.208:62566;rport;branch=z9hG4bKPj12729c1e32264a09a7651de39104bfa2
Max-Forwards: 70
From: sip:1000@192.168.80.123;tag=967faa9ed6f74b0189abfce3da60ba01
To: sip:1000@54.178.185.181
Contact: <sip:1000@111.108.30.208:62566;ob>
Call-ID: 188d3fbfedf0444e9e528ab83ea38416
CSeq: 30964 INVITE
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 1800
Min-SE: 90
User-Agent: PJSUA v2.4 win32-6.2/i386/msvc-15.0
Content-Type: application/sdp
Content-Length: 482

v=0
o=- 3741526335 3741526335 IN IP4 192.168.100.231
s=pjmedia
b=AS:84
t=0 0
a=X-nat:0
m=audio 4000 RTP/AVP 98 97 99 104 3 0 8 9 96
c=IN IP4 192.168.100.231
b=TIAS:64000
a=rtcp:4001 IN IP4 192.168.100.231
a=sendrecv
a=rtpmap:98 speex/16000
a=rtpmap:97 speex/8000
a=rtpmap:99 speex/32000
a=rtpmap:104 iLBC/8000
a=fmtp:104 mode=30
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-16
<------------->
--- (15 headers 22 lines) ---
Sending to 111.108.30.208:62566 (NAT)
Sending to 111.108.30.208:62566 (NAT)
Using INVITE request as basis request - 188d3fbfedf0444e9e528ab83ea38416
Found peer '1000' for '1000' from 111.108.30.208:62566

<--- Reliably Transmitting (NAT) to 111.108.30.208:62566 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 111.108.30.208:62566;branch=z9hG4bKPj12729c1e32264a09a7651de39104bfa2;received=111.108.30.208;rport=62566
From: sip:1000@192.168.80.123;tag=967faa9ed6f74b0189abfce3da60ba01
To: sip:1000@54.178.185.181;tag=as77fea572
Call-ID: 188d3fbfedf0444e9e528ab83ea38416
CSeq: 30964 INVITE
Server: Asterisk PBX 13.22.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="35993b20"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '188d3fbfedf0444e9e528ab83ea38416' in 6400 ms (Method: INVITE)

<--- SIP read from UDP:111.108.30.208:62566 --->
ACK sip:1000@54.178.185.181:15060 SIP/2.0
Via: SIP/2.0/UDP 111.108.30.208:62566;rport;branch=z9hG4bKPj12729c1e32264a09a7651de39104bfa2
Max-Forwards: 70
From: sip:1000@192.168.80.123;tag=967faa9ed6f74b0189abfce3da60ba01
To: sip:1000@54.178.185.181;tag=as77fea572
Call-ID: 188d3fbfedf0444e9e528ab83ea38416
CSeq: 30964 ACK
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---

<--- SIP read from TCP:111.108.30.208:63852 --->
INVITE sip:1000@54.178.185.181:15060 SIP/2.0
Via: SIP/2.0/TCP 192.168.100.231:62150;rport;branch=z9hG4bKPjcf39eb0d9b62487f9d334f67373ce98d;alias
Max-Forwards: 70
From: sip:1000@192.168.80.123;tag=967faa9ed6f74b0189abfce3da60ba01
To: sip:1000@54.178.185.181
Contact: <sip:1000@111.108.30.208:62566;ob>
Call-ID: 188d3fbfedf0444e9e528ab83ea38416
CSeq: 30965 INVITE
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 1800
Min-SE: 90
User-Agent: PJSUA v2.4 win32-6.2/i386/msvc-15.0
Authorization: Digest username="1000", realm="asterisk", nonce="35993b20", uri="sip:1000@54.178.185.181:15060", response="e5095bf9a92eeee6668d831f904e7cb1", algorithm=MD5
Content-Type: application/sdp
Content-Length: 482

v=0
o=- 3741526335 3741526335 IN IP4 192.168.100.231
s=pjmedia
b=AS:84
t=0 0
a=X-nat:0
m=audio 4000 RTP/AVP 98 97 99 104 3 0 8 9 96
c=IN IP4 192.168.100.231
b=TIAS:64000
a=rtcp:4001 IN IP4 192.168.100.231
a=sendrecv
a=rtpmap:98 speex/16000
a=rtpmap:97 speex/8000
a=rtpmap:99 speex/32000
a=rtpmap:104 iLBC/8000
a=fmtp:104 mode=30
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-16
<------------->
--- (16 headers 22 lines) ---
Sending to 111.108.30.208:63852 (NAT)
Using INVITE request as basis request - 188d3fbfedf0444e9e528ab83ea38416
Found peer '1000' for '1000' from 111.108.30.208:63852
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
Found RTP audio format 98
Found RTP audio format 97
Found RTP audio format 99
Found RTP audio format 104
Found RTP audio format 3
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 9
Found RTP audio format 96
Found audio description format speex for ID 98
Found audio description format speex for ID 97
Found audio description format speex for ID 99
Found audio description format iLBC for ID 104
Found audio description format GSM for ID 3
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format G722 for ID 9
Found audio description format telephone-event for ID 96
Capabilities: us - (ulaw|alaw|gsm), peer - audio=(ulaw|gsm|alaw|g722|speex|speex16|speex32|ilbc)/video=(nothing)/text=(nothing), combined - (ulaw|alaw|gsm)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
       > 0x7fd8300072c0 -- Strict RTP learning after remote address set to: 192.168.100.231:4000
Peer audio RTP is at port 192.168.100.231:4000
Looking for 1000 in phones (domain 54.178.185.181)
sip_route_dump: route/path hop: <sip:1000@111.108.30.208:62566;ob>

<--- Transmitting (NAT) to 111.108.30.208:63852 --->
SIP/2.0 100 Trying
Via: SIP/2.0/TCP 192.168.100.231:62150;branch=z9hG4bKPjcf39eb0d9b62487f9d334f67373ce98d;alias;received=111.108.30.208;rport=63852
From: sip:1000@192.168.80.123;tag=967faa9ed6f74b0189abfce3da60ba01
To: sip:1000@54.178.185.181
Call-ID: 188d3fbfedf0444e9e528ab83ea38416
CSeq: 30965 INVITE
Server: Asterisk PBX 13.22.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uac
Contact: <sip:1000@54.178.185.181:15060;transport=tcp>
Content-Length: 0


<------------>
    -- Executing [1000@phones:1] NoOp("SIP/1000-00000004", "First Line") in new stack
    -- Executing [1000@phones:2] DumpChan("SIP/1000-00000004", "") in new stack

Dumping Info For Channel: SIP/1000-00000004:
================================================================================
Info:
Name=               SIP/1000-00000004
Type=               SIP
UniqueID=           1532505135.6
LinkedID=           1532505135.6
CallerIDNum=        1000
CallerIDName=       (N/A)
ConnectedLineIDNum= (N/A)
ConnectedLineIDName=(N/A)
DNIDDigits=         1000
RDNIS=              (N/A)
Parkinglot=         default
Language=           ja
State=              Ring (4)
Rings=              0
NativeFormat=       (ulaw)
WriteFormat=        ulaw
ReadFormat=         ulaw
RawWriteFormat=     ulaw
RawReadFormat=      ulaw
WriteTranscode=     No 
ReadTranscode=      No 
1stFileDescriptor=  29
Framesin=           0 
Framesout=          0 
TimetoHangup=       0
ElapsedTime=        0h0m0s
BridgeID=           (Not bridged)
Context=            phones
Extension=          1000
Priority=           2
CallGroup=          1
PickupGroup=        1
Application=        DumpChan
Data=               (Empty)
Blocking_in=        (Not Blocking)

Variables:
SIPCALLID=188d3fbfedf0444e9e528ab83ea38416
SIPDOMAIN=54.178.185.181
SIPURI=sip:1000@111.108.30.208:62566
================================================================================
    -- Executing [1000@phones:3] NoOp("SIP/1000-00000004", "Second Line") in new stack
    -- Executing [1000@phones:4] Dial("SIP/1000-00000004", "SIP/1000/1000") in new stack
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
Audio is at 25572
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 111.108.30.208:62566:
INVITE sip:1000@111.108.30.208 SIP/2.0
Via: SIP/2.0/UDP 54.178.185.181:15060;branch=z9hG4bK770f26db;rport
Max-Forwards: 70
From: <sip:1000@54.178.185.181:15060>;tag=as14588959
To: <sip:1000@111.108.30.208>
Contact: <sip:1000@54.178.185.181:15060>
Call-ID: 3538e60b5e8c2c1b66ef00297fd218e0@54.178.185.181:15060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 13.22.0
Date: Wed, 25 Jul 2018 07:52:15 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 303

v=0
o=root 1946525208 1946525208 IN IP4 54.178.185.181
s=Asterisk PBX 13.22.0
c=IN IP4 54.178.185.181
t=0 0
m=audio 25572 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

---
    -- Called SIP/1000/1000

<--- SIP read from UDP:111.108.30.208:62566 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 54.178.185.181:15060;rport=15060;received=54.178.185.181;branch=z9hG4bK770f26db
Call-ID: 3538e60b5e8c2c1b66ef00297fd218e0@54.178.185.181:15060
From: <sip:1000@54.178.185.181>;tag=as14588959
To: <sip:1000@111.108.30.208>
CSeq: 102 INVITE
Content-Length: 0

<------------->
--- (7 headers 0 lines) ---
[Jul 25 16:52:15] NOTICE[1088]: chan_sip.c:15753 sip_reregister:    -- Re-registration for  53065174@okj.sip.0038.net
REGISTER 12 headers, 0 lines
Reliably Transmitting (NAT) to 61.213.230.145:5060:
REGISTER sip:okj.sip.0038.net SIP/2.0
Via: SIP/2.0/UDP 54.178.185.181:15060;branch=z9hG4bK0b40ee91;rport
Max-Forwards: 70
From: <sip:53065174@okj.sip.0038.net>;tag=as7641fec7
To: <sip:53065174@okj.sip.0038.net>
Call-ID: 1fa69de43da6b2d9011b348e26cb4c7b@127.0.0.1
CSeq: 134 REGISTER
Supported: replaces, timer
User-Agent: Asterisk PBX 13.22.0
Authorization: Digest username="53065174", realm="okj.sip.0038.net", algorithm=MD5, uri="sip:okj.sip.0038.net", nonce="0ad266c5", response="d17a1a4a0db40775e77eeb0fcbc6581a"
Expires: 120
Contact: <sip:s@54.178.185.181:15060>
Content-Length: 0


---

<--- SIP read from UDP:61.213.230.145:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 54.178.185.181:15060;branch=z9hG4bK0b40ee91;rport
From: <sip:53065174@okj.sip.0038.net>;tag=as7641fec7
To: <sip:53065174@okj.sip.0038.net>;tag=as32fa296b
Call-ID: 1fa69de43da6b2d9011b348e26cb4c7b@127.0.0.1
CSeq: 134 REGISTER
WWW-Authenticate: Digest algorithm=MD5, realm="okj.sip.0038.net", nonce="2820b83b"
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---
Responding to challenge, registration to domain/host name okj.sip.0038.net
REGISTER 12 headers, 0 lines
Reliably Transmitting (NAT) to 61.213.230.145:5060:
REGISTER sip:okj.sip.0038.net SIP/2.0
Via: SIP/2.0/UDP 54.178.185.181:15060;branch=z9hG4bK34214824;rport
Max-Forwards: 70
From: <sip:53065174@okj.sip.0038.net>;tag=as7641fec7
To: <sip:53065174@okj.sip.0038.net>
Call-ID: 1fa69de43da6b2d9011b348e26cb4c7b@127.0.0.1
CSeq: 135 REGISTER
Supported: replaces, timer
User-Agent: Asterisk PBX 13.22.0
Authorization: Digest username="53065174", realm="okj.sip.0038.net", algorithm=MD5, uri="sip:okj.sip.0038.net", nonce="2820b83b", response="4af3e85f4d165cb5ac9a9fa697a98438"
Expires: 120
Contact: <sip:s@54.178.185.181:15060>
Content-Length: 0


---

<--- SIP read from UDP:61.213.230.145:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 54.178.185.181:15060;branch=z9hG4bK34214824;rport
From: <sip:53065174@okj.sip.0038.net>;tag=as7641fec7
To: <sip:53065174@okj.sip.0038.net>;tag=as32fa296b
Call-ID: 1fa69de43da6b2d9011b348e26cb4c7b@127.0.0.1
CSeq: 135 REGISTER
Expires: 120
Contact: <sip:s@54.178.185.181:15060>;expires=120
Date: Wed, 25 Jul 2018 07:52:15 GMT
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---
[Jul 25 16:52:15] NOTICE[1088]: chan_sip.c:24591 handle_response_register: Outbound Registration: Expiry for okj.sip.0038.net is 120 sec (Scheduling reregistration in 105 s)
Really destroying SIP dialog '1fa69de43da6b2d9011b348e26cb4c7b@127.0.0.1' Method: REGISTER

<--- SIP read from UDP:111.108.30.208:62566 --->

<------------->

<--- SIP read from UDP:111.108.30.208:62383 --->

<------------->

<--- SIP read from TCP:111.108.30.208:63852 --->
CANCEL sip:1000@54.178.185.181:15060 SIP/2.0
Via: SIP/2.0/TCP 192.168.100.231:62150;rport;branch=z9hG4bKPjcf39eb0d9b62487f9d334f67373ce98d;alias
Max-Forwards: 70
From: sip:1000@192.168.80.123;tag=967faa9ed6f74b0189abfce3da60ba01
To: sip:1000@54.178.185.181
Call-ID: 188d3fbfedf0444e9e528ab83ea38416
CSeq: 30965 CANCEL
User-Agent: PJSUA v2.4 win32-6.2/i386/msvc-15.0
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
Sending to 111.108.30.208:63852 (NAT)

<--- Reliably Transmitting (NAT) to 111.108.30.208:63852 --->
SIP/2.0 487 Request Terminated
Via: SIP/2.0/TCP 192.168.100.231:62150;branch=z9hG4bKPjcf39eb0d9b62487f9d334f67373ce98d;alias;received=111.108.30.208;rport=63852
From: sip:1000@192.168.80.123;tag=967faa9ed6f74b0189abfce3da60ba01
To: sip:1000@54.178.185.181;tag=as54684525
Call-ID: 188d3fbfedf0444e9e528ab83ea38416
CSeq: 30965 INVITE
Server: Asterisk PBX 13.22.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


<------------>

<--- Transmitting (NAT) to 111.108.30.208:63852 --->
SIP/2.0 200 OK
Via: SIP/2.0/TCP 192.168.100.231:62150;branch=z9hG4bKPjcf39eb0d9b62487f9d334f67373ce98d;alias;received=111.108.30.208;rport=63852
From: sip:1000@192.168.80.123;tag=967faa9ed6f74b0189abfce3da60ba01
To: sip:1000@54.178.185.181;tag=as54684525
Call-ID: 188d3fbfedf0444e9e528ab83ea38416
CSeq: 30965 CANCEL
Server: Asterisk PBX 13.22.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '3538e60b5e8c2c1b66ef00297fd218e0@54.178.185.181:15060' in 6400 ms (Method: INVITE)
Reliably Transmitting (NAT) to 111.108.30.208:62566:
CANCEL sip:1000@111.108.30.208 SIP/2.0
Via: SIP/2.0/UDP 54.178.185.181:15060;branch=z9hG4bK770f26db;rport
Max-Forwards: 70
From: <sip:1000@54.178.185.181:15060>;tag=as14588959
To: <sip:1000@111.108.30.208>
Call-ID: 3538e60b5e8c2c1b66ef00297fd218e0@54.178.185.181:15060
CSeq: 102 CANCEL
User-Agent: Asterisk PBX 13.22.0
Content-Length: 0


---
Scheduling destruction of SIP dialog '3538e60b5e8c2c1b66ef00297fd218e0@54.178.185.181:15060' in 6400 ms (Method: INVITE)
  == Spawn extension (phones, 1000, 4) exited non-zero on 'SIP/1000-00000004'

<--- SIP read from UDP:111.108.30.208:62566 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 54.178.185.181:15060;rport=15060;received=54.178.185.181;branch=z9hG4bK770f26db
Call-ID: 3538e60b5e8c2c1b66ef00297fd218e0@54.178.185.181:15060
From: <sip:1000@54.178.185.181>;tag=as14588959
To: <sip:1000@111.108.30.208>;tag=e39090e960694922bbf31e2dc1385e44
CSeq: 102 CANCEL
Content-Length: 0

<------------->
--- (7 headers 0 lines) ---

<--- SIP read from UDP:111.108.30.208:62566 --->
SIP/2.0 487 Request Terminated
Via: SIP/2.0/UDP 54.178.185.181:15060;rport=15060;received=54.178.185.181;branch=z9hG4bK770f26db
Call-ID: 3538e60b5e8c2c1b66ef00297fd218e0@54.178.185.181:15060
From: <sip:1000@54.178.185.181>;tag=as14588959
To: <sip:1000@111.108.30.208>;tag=e39090e960694922bbf31e2dc1385e44
CSeq: 102 INVITE
Content-Length: 0

<------------->
--- (7 headers 0 lines) ---
Transmitting (NAT) to 111.108.30.208:62566:
ACK sip:1000@111.108.30.208 SIP/2.0
Via: SIP/2.0/UDP 54.178.185.181:15060;branch=z9hG4bK770f26db;rport
Max-Forwards: 70
From: <sip:1000@54.178.185.181:15060>;tag=as14588959
To: <sip:1000@111.108.30.208>;tag=e39090e960694922bbf31e2dc1385e44
Contact: <sip:1000@54.178.185.181:15060>
Call-ID: 3538e60b5e8c2c1b66ef00297fd218e0@54.178.185.181:15060
CSeq: 102 ACK
User-Agent: Asterisk PBX 13.22.0
Content-Length: 0


---
Scheduling destruction of SIP dialog '3538e60b5e8c2c1b66ef00297fd218e0@54.178.185.181:15060' in 6400 ms (Method: INVITE)

<--- SIP read from TCP:111.108.30.208:63852 --->
ACK sip:1000@54.178.185.181:15060 SIP/2.0
Via: SIP/2.0/TCP 192.168.100.231:62150;rport;branch=z9hG4bKPjcf39eb0d9b62487f9d334f67373ce98d;alias
Max-Forwards: 70
From: sip:1000@192.168.80.123;tag=967faa9ed6f74b0189abfce3da60ba01
To: sip:1000@54.178.185.181;tag=as54684525
Call-ID: 188d3fbfedf0444e9e528ab83ea38416
CSeq: 30965 ACK
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---
Really destroying SIP dialog '188d3fbfedf0444e9e528ab83ea38416' Method: ACK
Reliably Transmitting (NAT) to 111.108.30.208:62566:
OPTIONS sip:1000@111.108.30.208:62566;ob SIP/2.0
Via: SIP/2.0/UDP 54.178.185.181:15060;branch=z9hG4bK543117bb;rport
Max-Forwards: 70
From: "asterisk" <sip:asterisk@54.178.185.181:15060>;tag=as61a65d4c
To: <sip:1000@111.108.30.208:62566;ob>
Contact: <sip:asterisk@54.178.185.181:15060>
Call-ID: 0e3d4445061039c51cb77b485d916e7e@54.178.185.181:15060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 13.22.0
Date: Wed, 25 Jul 2018 07:52:33 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


---

<--- SIP read from UDP:111.108.30.208:62566 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 54.178.185.181:15060;rport=15060;received=54.178.185.181;branch=z9hG4bK543117bb
Call-ID: 0e3d4445061039c51cb77b485d916e7e@54.178.185.181:15060
From: "asterisk" <sip:asterisk@54.178.185.181>;tag=as61a65d4c
To: <sip:1000@111.108.30.208;ob>;tag=z9hG4bK543117bb
CSeq: 102 OPTIONS
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Accept: application/sdp, application/pidf+xml, application/xpidf+xml, application/simple-message-summary, message/sipfrag;version=2.0, application/im-iscomposing+xml, text/plain
Supported: replaces, 100rel, timer, norefersub
Allow-Events: presence, message-summary, refer
User-Agent: PJSUA v2.4 win32-6.2/i386/msvc-15.0
Content-Length: 0

<------------->
--- (12 headers 0 lines) ---
Really destroying SIP dialog '0e3d4445061039c51cb77b485d916e7e@54.178.185.181:15060' Method: OPTIONS

<--- SIP read from UDP:111.108.30.208:62566 --->

<------------->

There doesn’t seem to be any errors in the log files
What am I missing here?

How is it possible that this problem comes up.

I personally thought it has something to do with the codex,
but after hours of searching, I don’t really know it anymore.

Thank you for your input
It’s highly appreciated.

Wesley

Overloaded network.

Running on a virtual machine configure for general, rather than real time, use.

Hi @david551

I have changed the realtime database information.
Doesn’t seems to be this problem

rtcachefriends => no; realtime database settings
rtautoclear => no; realtime database settings

Real time had nothing to do with Asterisk Real Time Architecture. I used it in the much older sense of the word…

Running a telephony switching application on a computer requires that input is processed through to output in a very short time, ideally less than 2 ms, although the problems will start to really show at maybe 50ms.

A real PC, running only Asterisk, can easily achieve this, but a virtual machine host will need special configuration to ensure that the guest running Asterisk has this sort of low latency.

I see what you mean.
What would be this special configuration to ensure that the asterisk server has low latency.

We are using at the moment a Amazon AWS server, we always use this,
this is to be honest the first time ever we have this problem.

The sound always works fine.
This is where we don’t really understand what is wrong.
As in previous cases the sound worked like it was suppose to.

Thank you.
Your reactions are highly appreciated.
Gives me a change to learn more about asterisk.

You would need to ask Amazon. I, personally, would not consider running on anything but a real machine, but lots of people seem to be trying to use cloud virtual machines.

It’s likely that this might be cause by two reasons:

a) network traffic - VoIP media packets need to arrive in order and with little delay. If the network between your phone and the server is congested then it may be the case that the media packets are being delayed or dropped. There’s no concept of QoS on the internet, so you can’t prioritize your media packets over other traffic.

b) the server is not processing media in real-time - if you’ve purchased a virtual machine on a shared service, then resources - in this case network IO and CPU (codec processing) - will be being time shared between you and other virtual machines on the same server. This may be introducing delay in the time critical processing of your media packets.

Hope this helps,

Matt.

Technically, the internet does have a concept of QoS, but the commercial backbone servers don’t implement it, because it would be abused. That part of the internet within a single organisation that uses VoIP can, and probably should, be using the various QoS marking on packets, but then they would also be running their VoIP servers physically within the part of the internet that they control.

Thank you guys.
The strange part is the following.

We have multiple asterisk systems running on different amazon servers.
Everything works perfect, but this server seems to have sounds issues.

This is why we think it has something to do with the current settings.
Thank you for the answers and I am going to try some things to improve the sounds.

Will give a update later today.

I found the problem.
It had nothing to do with the network.

It was the headset that I was using.
With another headset, the sound works.

Thank you guys.
Your input was highly appreciated.