Problem with sound in external sip calls

Hi,

I am having a problem with sound. I have tried almost everything but it looks like the problem is in asterisk.

Configuration:
First off, I use
asterisk-1.4.20
freepbx-2.3.1
CentOS 5.1
I have connected asterisk with an external voip provider, so I can receive and place calls through the voip server. When I call from an extension to my cell phone or when I call from my cell phone to an extension I don’t have any sound problem.

Description of the problem:
I have configured freepbx to forward all incoming calls to a ring group that calls my cell phone. In this way, when somebody calls my voip number (let’s say A) my cell phone rings (let’s say cell phone number B). When I pick up the cell phone there is no sound.

I have used wireshark and I can see that there are no RTP packets transfered between the voip provider and the linux machine. I have made several tests and the problem happens only when number A and number B are going through the same voip provider. For example, in my case my voip provider connects to my linux machine when somebody calls me (call A) and the linux machine connects back to my voip provider to place call B.

I have attached the log from asterisk in the end. I think asterisk is getting confused when a sip call is initiated from and forwarded to the same sip provider. In this log I think the problem is close to the end in line:
"To: sip:0858780396@127.0.0.1;user=phone;tag=as04e1b9f4"
The IP=127.0.0.1 doesn’t look ok to me but I am not sure if this is the problem.

Please let me know how I can solve this problem or if you need more info.

Thanks in advance,
Iakovos

Asterisk Log:
GotoIf(“Local/900302810226134@from-internal-917e,2”, “0?bypass|1”) in new stack
– Executing [s@macro-dialout-trunk:24] GotoIf(“Local/900302810226134@from-internal-917e,2”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:25] Dial(“Local/900302810226134@from-internal-917e,2”, “SIP/xs4all/00302810226134|300|TW”) in new stackAudio is at 192.168.2.5 port 10560
Adding codec 0x8 (alaw) to SDP
Adding codec 0x2 (gsm) to SDP
Adding codec 0x4 (ulaw) to SDP
Reliably Transmitting (NAT) to 82.101.62.99:5060:
INVITE sip:00302810226134@sip.xs4all.nl SIP/2.0
Via: SIP/2.0/UDP 192.168.2.5:5060;branch=z9hG4bK125389e4;rport
From: “00302810241648” sip:0858780396@sip.xs4all.nl;tag=as0a6974dd
To: sip:00302810226134@sip.xs4all.nl
Contact: sip:0858780396@192.168.2.5
Call-ID: 1c023b89513fbdd56b45a8cb7ececa1c@sip.xs4all.nl
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Date: Thu, 13 Aug 2009 09:37:35 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Type: application/sdp
Content-Length: 229

v=0
o=root 10876 10876 IN IP4 192.168.2.5
s=session
c=IN IP4 192.168.2.5
t=0 0
m=audio 10560 RTP/AVP 8 3 0
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

— – Called xs4all/00302810226134olo*CLI>
<— SIP read from 82.101.62.99:5060 —>
SIP/2.0 100 Giving a try
Via: SIP/2.0/UDP 192.168.2.5:5060;branch=z9hG4bK125389e4;rport=5061;received=94.71.126.12
From: “00302810241648” sip:0858780396@sip.xs4all.nl;tag=as0a6974dd
To: sip:00302810226134@sip.xs4all.nl
Call-ID: 1c023b89513fbdd56b45a8cb7ececa1c@sip.xs4all.nl
CSeq: 102 INVITE
Server: OpenSIPS (1.4.4-notls (i386/linux))
Content-Length: 0

<------------->— (8 headers 0 lines) —olo*CLI>
<— SIP read from 82.101.62.99:5060 —>
SIP/2.0 407 authentication required
Allow: INVITE,ACK,BYE,CANCEL,PRACK,SUBSCRIBE,NOTIFY,UPDATE
Call-ID: 1c023b89513fbdd56b45a8cb7ececa1c@sip.xs4all.nl
Contact: sip:00302810226134@82.101.62.99:5060;user=phone
CSeq: 102 INVITE
From: “00302810241648” sip:0858780396@sip.xs4all.nl;tag=as0a6974dd
Proxy-Authenticate: Digest realm=“sip.xs4all.nl”,nonce=“12fe379265da7acd1f50de12768a0bac”,opaque=“12fc27bb1525c74”,stale=false,algorithm=MD5
Record-Route: sip:82.101.62.115;lr;r2=on;ftag=as0a6974dd,sip:82.101.63.5;lr;r2=on;ftag=as0a6974dd
Server: Cirpack/v4.41b (gw_sip)
To: sip:00302810226134@sip.xs4all.nl;tag=00-07714-12fe3878-6b4127447
Via: SIP/2.0/UDP 192.168.2.5:5060;received=94.71.126.12;rport=5061;branch=z9hG4bK125389e4
Content-Length: 0

<------------->— (12 headers 0 lines) —Transmitting (NAT) to 82.101.62.99:5060:
ACK sip:00302810226134@sip.xs4all.nl SIP/2.0
Via: SIP/2.0/UDP 192.168.2.5:5060;branch=z9hG4bK125389e4;rport
From: “00302810241648” sip:0858780396@sip.xs4all.nl;tag=as0a6974dd
To: sip:00302810226134@sip.xs4all.nl;tag=00-07714-12fe3878-6b4127447
Contact: sip:0858780396@192.168.2.5
Call-ID: 1c023b89513fbdd56b45a8cb7ececa1c@sip.xs4all.nl
CSeq: 102 ACK
User-Agent: Asterisk PBX
Max-Forwards: 70
Content-Length: 0

—Audio is at 192.168.2.5 port 10560Adding codec 0x8 (alaw) to SDPAdding codec 0x2 (gsm) to SDPAdding codec 0x4 (ulaw) to SDPReliably Transmitting (NAT) to 82.101.62.99:5060:
INVITE sip:00302810226134@sip.xs4all.nl SIP/2.0
Via: SIP/2.0/UDP 192.168.2.5:5060;branch=z9hG4bK1ef22546;rport
From: “00302810241648” sip:0858780396@sip.xs4all.nl;tag=as0a6974dd
To: sip:00302810226134@sip.xs4all.nl
Contact: sip:0858780396@192.168.2.5
Call-ID: 1c023b89513fbdd56b45a8cb7ececa1c@sip.xs4all.nl
CSeq: 103 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Proxy-Authorization: Digest username=“0858780396”, realm=“sip.xs4all.nl”, algorithm=MD5, uri="sip:00302810226134@sip.xs4all.nl", nonce=“12fe379265da7acd1f50de12768a0bac”, response=“b6bfac1571a9cc788791515931f46303”, opaque="12fc27bb1525c74"
Date: Thu, 13 Aug 2009 09:37:35 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Type: application/sdp
Content-Length: 229

v=0
o=root 10876 10877 IN IP4 192.168.2.5
s=session
c=IN IP4 192.168.2.5
t=0 0
m=audio 10560 RTP/AVP 8 3 0
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

—olo*CLI>
<— SIP read from 82.101.62.99:5060 —>
SIP/2.0 100 Giving a try
Via: SIP/2.0/UDP 192.168.2.5:5060;branch=z9hG4bK1ef22546;rport=5061;received=94.71.126.12
From: “00302810241648” sip:0858780396@sip.xs4all.nl;tag=as0a6974dd
To: sip:00302810226134@sip.xs4all.nl
Call-ID: 1c023b89513fbdd56b45a8cb7ececa1c@sip.xs4all.nl
CSeq: 103 INVITE
Server: OpenSIPS (1.4.4-notls (i386/linux))
Content-Length: 0

<------------->— (8 headers 0 lines) —Really destroying SIP dialog ‘28af5fd304d2a31a4acaccdf3e091758@194.30.193.119’ Method: OPTIONSReally destroying SIP dialog '054140295bf7120278c7b8bf408665cb@vtrip … ateway.com’ Method: REGISTERolo*CLI>
<— SIP read from 82.101.62.99:5060 —>
SIP/2.0 200 OK
Allow: INVITE,ACK,BYE,CANCEL,PRACK,SUBSCRIBE,NOTIFY,UPDATE
Call-ID: 1c023b89513fbdd56b45a8cb7ececa1c@sip.xs4all.nl
Contact: sip:82.101.62.99:5060
Content-Type: application/sdp
CSeq: 103 INVITE
From: “00302810241648” sip:0858780396@sip.xs4all.nl;tag=as0a6974dd
Record-Route: sip:82.101.62.115;lr;r2=on;ftag=as0a6974dd,sip:82.101.63.5;lr;r2=on;ftag=as0a6974dd
Server: Cirpack/v4.41b (gw_sip)
To: sip:00302810226134@sip.xs4all.nl;tag=00-07696-12fe3887-05349abb7
Via: SIP/2.0/UDP 192.168.2.5:5060;received=94.71.126.12;rport=5061;branch=z9hG4bK1ef22546
Content-Length: 209

v=0
o=cp10 125015626065 125015626065 IN IP4 82.101.42.134
s=SIP Call
c=IN IP4 194.109.8.3
t=0 0
m=audio 30426 RTP/AVP 8 0
b=AS:64
a=rtpmap:8 PCMA/8000/1
a=rtpmap:0 PCMU/8000/1
a=ptime:20
a=sendrecv

<------------->— (12 headers 11 lines)
—Found RTP audio format 8Found RTP audio format 0
Peer audio RTP is at port 194.109.8.3:30426
Found audio description format PCMA for ID 8
Found audio description format PCMU for ID 0
Capabilities: us - 0xe (gsm|ulaw|alaw), peer - audio=0xc (ulaw|alaw)/video=0x0 (nothing), combined - 0xc (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x0 (nothing), peer - 0x0 (nothing), combined - 0x0 (nothing)
Peer audio RTP is at port 194.109.8.3:30426
list_route: hop: sip:82.101.63.5;lr;r2=on;ftag=as0a6974ddlist_route: hop: sip:82.101.62.115;lr;r2=on;ftag=as0a6974ddset_destination: Parsing sip:82.101.63.5;lr;r2=on;ftag=as0a6974dd for address/port to send toset_destination: set destination to 82.101.63.5, port 5060Transmitting (NAT) to 82.101.62.99:5060:
ACK sip:82.101.62.99:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.2.5:5060;branch=z9hG4bK7a1618fc;rport
Route: sip:82.101.63.5;lr;r2=on;ftag=as0a6974dd,sip:82.101.62.115;lr;r2=on;ftag=as0a6974dd
From: “00302810241648” sip:0858780396@sip.xs4all.nl;tag=as0a6974dd
To: sip:00302810226134@sip.xs4all.nl;tag=00-07696-12fe3887-05349abb7
Contact: sip:0858780396@192.168.2.5
Call-ID: 1c023b89513fbdd56b45a8cb7ececa1c@sip.xs4all.nl
CSeq: 103 ACK
User-Agent: Asterisk PBX
Max-Forwards: 70
Content-Length: 0


-- SIP/xs4all-086b9e88 answered Local/900302810226134@from-internal-917e,2
-- Local/900302810226134@from-internal-917e,1 answered SIP/0858780396-08757af8
-- Executing [s@macro-auto-blkvm:1] Set("Local/900302810226134@from-internal-917e,1", "__MACRO_RESULT=") in new stack
-- Executing [s@macro-auto-blkvm:2] DBdel("Local/900302810226134@from-internal-917e,1", "BLKVM/77100/SIP/0858780396-08757af8") in new stack
-- DBdel: family=BLKVM, key=77100/SIP/0858780396-08757af8

Audio is at 192.168.2.5 port 15246
Adding codec 0x8 (alaw) to SDP
Adding codec 0x4 (ulaw) to SDP
<— Reliably Transmitting (NAT) to 82.101.62.99:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 82.101.63.5;branch=z9hG4bKf10e.bb07e2b6.0;received=82.101.62.99
Via: SIP/2.0/UDP 82.101.62.99:5060;rport=5060;received=82.101.62.99;branch=z9hG4bK-1D86-2BF240E
Record-Route: sip:82.101.63.5;r2=on;lr=on;ftag=28106-LT-12fe3852-388dc4173
Record-Route: sip:82.101.62.115;r2=on;lr=on;ftag=28106-LT-12fe3852-388dc4173
From: “00302810241648” sip:00302810241648@sip.xs4all.nl;user=phone;tag=28106-LT-12fe3852-388dc4173
To: sip:0858780396@127.0.0.1;user=phone;tag=as04e1b9f4
Call-ID: 28106-UX-12fe3851-13606d4b4@sip.xs4all.nl
CSeq: 316099941 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: sip:s@192.168.2.5
Content-Type: application/sdp
Content-Length: 206

v=0
o=root 10876 10876 IN IP4 192.168.2.5
s=session
c=IN IP4 192.168.2.5
t=0 0
m=audio 15246 RTP/AVP 8 0
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

<------------>olo*CLI>
<— SIP read from 82.101.62.99:5060 —>
ACK sip:s@94.71.126.12:5061 SIP/2.0
Record-Route: sip:82.101.63.5;r2=on;lr=on;ftag=28106-LT-12fe3852-388dc4173
Record-Route: sip:82.101.62.115;r2=on;lr=on;ftag=28106-LT-12fe3852-388dc4173
Call-ID: 28106-UX-12fe3851-13606d4b4@sip.xs4all.nl
Contact: sip:82.101.62.99:5060
CSeq: 316099941 ACK
From: “00302810241648” sip:00302810241648@sip.xs4all.nl;user=phone;tag=28106-LT-12fe3852-388dc4173
Max-Forwards: 30
To: sip:0858780396@127.0.0.1;user=phone;tag=as04e1b9f4
User-Agent: Cirpack/v4.41b (gw_sip)
Via: SIP/2.0/UDP 82.101.63.5;branch=z9hG4bKf10e.bb07e2b6.2
Via: SIP/2.0/UDP 82.101.62.99:5060;rport=5060;received=82.101.62.99;branch=z9hG4bK-621B-2BF247A
Content-Length: 0
P-hint: rr-enforced

<------------->— (14 headers 0 lines) —

Hi

Set canreinvite=no in the sip.conf

looks like the rtp may be reinviting

Ian

Hi,

Thanks for the reply. It is already set. This is the configuration in sip.conf:

[xs4all]
username=XXXX
type=peer
secret=XXXX
qualify=yes
nat=yes
insecure=very
host=sip.xs4all.nl
fromuser=XXXX
fromdomain=sip.xs4all.nl
dtmfmode=inband
disallow=all
canreinvite=no
allow=gsm
allow=alaw
allow=ulaw
call-limit=50

thanks,
Iakovos

I installed asterisk 1.4.26.1 but the problem remains the same. I don’t know what to try next.
Please advise!

thanks,
Iakovos

Hello,

I am having the same problem after moving from asterisk 1.4 to asterisk 1.6.0. So I was wondering if you finally solved your problem, yes if yes how did you managed that?
Thanks