[jitsi-users] Jitsi and Asterisk: no hangup on remote call termination


#1

Hi,

I'm having an issue with all my calls going out my SIP provider. I'm using Jitsi as a softphone registering to a local Asterisk PBX.

I register as extension 4053 to asterisk server at 10.215.147.115 (alias IP - real IP addr. is 10.215.147.111) and dial a phone number that is routed via an Internet SIP provider.
The call is correctly established and conversation is OK. IF the Jitsi user hangs up first, the remote end is also disconnected immediately.
However, if the remote party hangs up first, the jitsi user is not immediately disconnected.
That, of course, is undesirable.

I'd like to understand why the call isn't automatically hung up and fix it.

I'm supposing that Jitsi isn't receiving a BYE as expected in a correct SIP transaction.
I don't know why though.

Here's my network setup:

Jitsi asterisk extension 4053 at 10.215.144.48
Asterisk eth0: 10.215.147.111 but Jitsi registers to the alias/floating IP for failover setup 10.215.147.115
Asterisk eth1: 192.168.103.111
Asterisk default gateway: 192.168.103.1
-> Asterisk accesses Internet via eth1 (192.168.103.1 is a DSL modem/router)

I did a tcpdump on the asterisk server while calling from Jitsi as so:
tcpdump -s0 -X -n -w jitsi_via_asterisk.cap -i eth0 host 10.215.144.48

It's here:
http://213.96.91.201/temp/jitsi_via_asterisk.cap.gz

I also dumped the Jitsi log files here:
http://213.96.91.201/temp/jitsi-logs-BYE_not_received.zip

Any ideas/suggestions?

Thanks,

Vieri


#2

Thanks Damian,

Here's the full session from Asterisk:
http://213.96.91.201/temp/jitsi_via_asterisk_full_session.cap.gz

Asterisk doesn't seem to send BYE to Jitsi...
The last message is "call leg/transaction does not exist".

What can I try now?

I'm almost certain the remote SIP provider sends BYE in time because earlier today I tested by connecting Jitsi directly to the SIP provider and going out the same DSL line. ie. I placed a laptop with Jitsi in the same subnet 192.168.103.0 and used the default gateway 192.168.103.1 (just like Asterisk). All went well.
I also setup my Jitsi laptop within the 10.215.0.0 subnet (just like my Asterisk client setup) but connected directly to the SIP provider (without going through Asterisk). In this case the call ended as expected (OK).
So I guess that something's wrong with Asterisk, not Jitsi.
So I'll be moving my question to the * mailing list... unless someone else here has an idea. :wink:

I think it must have something to do with my eth0/eth1 setup but I don't see what.

Thanks,

Vieri

···

--- On Tue, 6/7/11, Vieri <rentorbuy@yahoo.com> wrote:

From: Vieri <rentorbuy@yahoo.com>
Subject: [jitsi-users] Jitsi and Asterisk: no hangup on remote call termination
To: users@jitsi.java.net
Date: Tuesday, June 7, 2011, 9:43 AM
Hi,

I'm having an issue with all my calls going out my SIP
provider. I'm using Jitsi as a softphone registering to a
local Asterisk PBX.

I register as extension 4053 to asterisk server at
10.215.147.115 (alias IP - real IP addr. is 10.215.147.111)
and dial a phone number that is routed via an Internet SIP
provider.
The call is correctly established and conversation is OK.
IF the Jitsi user hangs up first, the remote end is also
disconnected immediately.
However, if the remote party hangs up first, the jitsi user
is not immediately disconnected.
That, of course, is undesirable.

I'd like to understand why the call isn't automatically
hung up and fix it.

I'm supposing that Jitsi isn't receiving a BYE as expected
in a correct SIP transaction.
I don't know why though.

Here's my network setup:

Jitsi asterisk extension 4053 at 10.215.144.48
Asterisk eth0: 10.215.147.111 but Jitsi registers to the
alias/floating IP for failover setup 10.215.147.115
Asterisk eth1: 192.168.103.111
Asterisk default gateway: 192.168.103.1
-> Asterisk accesses Internet via eth1 (192.168.103.1 is
a DSL modem/router)

I did a tcpdump on the asterisk server while calling from
Jitsi as so:
tcpdump -s0 -X -n -w jitsi_via_asterisk.cap -i eth0 host
10.215.144.48

It's here:
http://213.96.91.201/temp/jitsi_via_asterisk.cap.gz

I also dumped the Jitsi log files here:
http://213.96.91.201/temp/jitsi-logs-BYE_not_received.zip

Any ideas/suggestions?

Thanks,

Vieri


#3

I also did another trace but this time on eth1:

tcpdump -s0 -X -n -w jitsi_via_asterisk_full_session_2.cap -i eth1 host 193.22.119.20

The dump contains:

102/103 INVITE

102/103 ACK

and finally a

104 BYE

So Asterisk IS receiving a BYE from my SIP provider but it's not forwarding it to my internal Jitsi client.
I'm also seeing a "SIP/2.0 481 Unknown Dialog" message and I don't know if I should ignore it or if it may be part of my problem.

Here are the very last "trimmed" SIP messages on eth1 (the outer interface - facing Internet):

Note: 192.168.103.111 is the Asterisk server's eth1 IP address.

Via: SIP/2.0/UDP 192.168.103.111:5060;branch=z9hG4bK061ef9a5;rport

From: "Unknown" <sip:Unknown@192.168.103.111>;tag=as0b5ef7d6

Contact: <sip:Unknown@192.168.103.111>
Call-ID: 1bcd2bb737683a1f1693064661922014@192.168.103.111
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX
Max-Forwards: 70
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Content-Length: 0

SIP/2.0 200 OK - keepalive
Via: SIP/2.0/UDP 192.168.103.111:5060;branch=z9hG4bK061ef9a5;rport=49180

From: "Unknown" <sip:Unknown@192.168.103.111>;tag=as0b5ef7d6

Call-ID: 1bcd2bb737683a1f1693064661922014@192.168.103.111
CSeq: 102 OPTIONS
Server: OpenSER (1.2.1-notls (i386/linux))
Content-Length: 0

BYE sip:656660499@212.106.213.4:5060;user=phone;transport=udp SIP/2.0
Via: SIP/2.0/UDP 192.168.103.111:5060;branch=z9hG4bK4eb536f6;rport
Route: <sip:193.22.119.20;lr=on;ftag=as205d2c6d>,<sip:193.22.119.10;lr=on>

From: "IT staff" <sip:1111222333444@voztele.com>;tag=as205d2c6d

Call-ID: 058d3b8c333b1228205ecbfa55dd1f2d@voztele.com
CSeq: 104 BYE
User-Agent: Asterisk PBX
Max-Forwards: 70
Proxy-Authorization: Digest username="1111222333444", realm="voztele.com", algorithm=MD5, uri="sip:656660499@212.106.213.4:5060", nonce="4dee36e38c76f09b6afe975
70a0d9a34d1877025", response="544df6b8aef2433bfa7cf636f84485ad"
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0

SIP/2.0 481 Unknown Dialog
Via: SIP/2.0/UDP 192.168.103.111:5060;branch=z9hG4bK4eb536f6;rport=49180

From: "IT staff" <sip:1111222333444@voztele.com>;tag=as205d2c6d

Call-ID: 058d3b8c333b1228205ecbfa55dd1f2d@voztele.com
CSeq: 104 BYE

···

To: <sip:voztele.com>
Date: Tue, 07 Jun 2011 14:31:08 GMT
To: <sip:voztele.com>;tag=ba3d51acad53eeb51d56ab2459dbff7b.1e10
To: <sip:656660499@voztele.com>;tag=gj-2k5-4ce476fc-000079ae-00169a68Rd15e51d9.b
To: <sip:656660499@voztele.com>;tag=gj-2k5-4ce476fc-000079ae-00169a68Rd15e51d9.b

--- On Tue, 6/7/11, Vieri <rentorbuy@yahoo.com> wrote:

Hi,

I'm having an issue with all my calls going out my SIP
provider. I'm using Jitsi as a softphone registering to a
local Asterisk PBX.

I register as extension 4053 to asterisk server at
10.215.147.115 (alias IP - real IP addr. is 10.215.147.111)
and dial a phone number that is routed via an Internet SIP
provider.
The call is correctly established and conversation is OK.
IF the Jitsi user hangs up first, the remote end is also
disconnected immediately.
However, if the remote party hangs up first, the jitsi user
is not immediately disconnected.
That, of course, is undesirable.

I'd like to understand why the call isn't automatically
hung up and fix it.

I'm supposing that Jitsi isn't receiving a BYE as expected
in a correct SIP transaction.
I don't know why though.

Here's my network setup:

Jitsi asterisk extension 4053 at 10.215.144.48
Asterisk eth0: 10.215.147.111 but Jitsi registers to the
alias/floating IP for failover setup 10.215.147.115
Asterisk eth1: 192.168.103.111
Asterisk default gateway: 192.168.103.1
-> Asterisk accesses Internet via eth1 (192.168.103.1 is
a DSL modem/router)

I did a tcpdump on the asterisk server while calling from
Jitsi as so:
tcpdump -s0 -X -n -w jitsi_via_asterisk.cap -i eth0 host
10.215.144.48

It's here:
http://213.96.91.201/temp/jitsi_via_asterisk.cap.gz

I also dumped the Jitsi log files here:
http://213.96.91.201/temp/jitsi-logs-BYE_not_received.zip

Any ideas/suggestions?

Thanks,

Vieri


#4

OK, Jitsi hangs up after 2 minutes and I didn't see the last BYE from Asterisk (but you pointed it to me). However, there must be something wrong if BYE is coming after 120 seconds. What's keeping it from arriving?

As I posted before, if I remove Asterisk from my setup and do a direct JITSI - SIP PROVIDER then the BYE arrives instantly.

Definitely not a Jitsi issue so I thank you for all the help and insights you've given me.

I'll keep searching for the fix.

Thanks

Vieri

···

On Tue, Jun 7, 2011 at 5:19 PM, Vieri <rentorbuy@yahoo.com> wrote:

Thanks Damian,

Here's the full session from Asterisk:
http://213.96.91.201/temp/jitsi_via_asterisk_full_session.cap.gz

Asterisk doesn't seem to send BYE to Jitsi...

Well there is actually a bye in your log and Jitsi answers with ok.
But this bye is received after 120 secs after the last rtp packet
comming from remote side.
I think If you try your test and wait 2 minutes it will be ok and
Jitsi will hangup.


#5

Hi,

I saw that in the first pcap file from jitsi there is BYE from jitsi
to asterisk which is ok, and you mention its not your problem, but for
the second call in the same file I don't see BYE.
Also in the asterisk pcap file I see only one call which doesn't end
in the pcap, the media is till the end of the file.
You can try doing tcpdump for the whole call on the asterisk side and
see does asterisk really sends a bye. For example I have seen that if
you have analog line - FXO (PSTN) there maybe a problem detecting
hangup from the remote side, sometimes it can take up to 10 secs to
detect and actually hangup and then send BYE to the client(Jitsi).
So to be sure make a dump on the asterisk side for the whole session
to see is there BYE going out from the asterisk.

Regards
damencho

···

On Tue, Jun 7, 2011 at 4:43 PM, Vieri <rentorbuy@yahoo.com> wrote:

Hi,

I'm having an issue with all my calls going out my SIP provider. I'm using Jitsi as a softphone registering to a local Asterisk PBX.

I register as extension 4053 to asterisk server at 10.215.147.115 (alias IP - real IP addr. is 10.215.147.111) and dial a phone number that is routed via an Internet SIP provider.
The call is correctly established and conversation is OK. IF the Jitsi user hangs up first, the remote end is also disconnected immediately.
However, if the remote party hangs up first, the jitsi user is not immediately disconnected.
That, of course, is undesirable.

I'd like to understand why the call isn't automatically hung up and fix it.

I'm supposing that Jitsi isn't receiving a BYE as expected in a correct SIP transaction.
I don't know why though.

Here's my network setup:

Jitsi asterisk extension 4053 at 10.215.144.48
Asterisk eth0: 10.215.147.111 but Jitsi registers to the alias/floating IP for failover setup 10.215.147.115
Asterisk eth1: 192.168.103.111
Asterisk default gateway: 192.168.103.1
-> Asterisk accesses Internet via eth1 (192.168.103.1 is a DSL modem/router)

I did a tcpdump on the asterisk server while calling from Jitsi as so:
tcpdump -s0 -X -n -w jitsi_via_asterisk.cap -i eth0 host 10.215.144.48

It's here:
http://213.96.91.201/temp/jitsi_via_asterisk.cap.gz

I also dumped the Jitsi log files here:
http://213.96.91.201/temp/jitsi-logs-BYE_not_received.zip

Any ideas/suggestions?

Thanks,

Vieri


#6

Thanks Damian,

Here's the full session from Asterisk:
http://213.96.91.201/temp/jitsi_via_asterisk_full_session.cap.gz

Asterisk doesn't seem to send BYE to Jitsi...

Well there is actually a bye in your log and Jitsi answers with ok.
But this bye is received after 120 secs after the last rtp packet
comming from remote side.
I think If you try your test and wait 2 minutes it will be ok and
Jitsi will hangup.

The Bye has also:
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16

Cheers
damencho

···

On Tue, Jun 7, 2011 at 5:19 PM, Vieri <rentorbuy@yahoo.com> wrote:

The last message is "call leg/transaction does not exist".

What can I try now?

I'm almost certain the remote SIP provider sends BYE in time because earlier today I tested by connecting Jitsi directly to the SIP provider and going out the same DSL line. ie. I placed a laptop with Jitsi in the same subnet 192.168.103.0 and used the default gateway 192.168.103.1 (just like Asterisk). All went well.
I also setup my Jitsi laptop within the 10.215.0.0 subnet (just like my Asterisk client setup) but connected directly to the SIP provider (without going through Asterisk). In this case the call ended as expected (OK).
So I guess that something's wrong with Asterisk, not Jitsi.
So I'll be moving my question to the * mailing list... unless someone else here has an idea. :wink:

I think it must have something to do with my eth0/eth1 setup but I don't see what.

Thanks,

Vieri

--- On Tue, 6/7/11, Vieri <rentorbuy@yahoo.com> wrote:

From: Vieri <rentorbuy@yahoo.com>
Subject: [jitsi-users] Jitsi and Asterisk: no hangup on remote call termination
To: users@jitsi.java.net
Date: Tuesday, June 7, 2011, 9:43 AM
Hi,

I'm having an issue with all my calls going out my SIP
provider. I'm using Jitsi as a softphone registering to a
local Asterisk PBX.

I register as extension 4053 to asterisk server at
10.215.147.115 (alias IP - real IP addr. is 10.215.147.111)
and dial a phone number that is routed via an Internet SIP
provider.
The call is correctly established and conversation is OK.
IF the Jitsi user hangs up first, the remote end is also
disconnected immediately.
However, if the remote party hangs up first, the jitsi user
is not immediately disconnected.
That, of course, is undesirable.

I'd like to understand why the call isn't automatically
hung up and fix it.

I'm supposing that Jitsi isn't receiving a BYE as expected
in a correct SIP transaction.
I don't know why though.

Here's my network setup:

Jitsi asterisk extension 4053 at 10.215.144.48
Asterisk eth0: 10.215.147.111 but Jitsi registers to the
alias/floating IP for failover setup 10.215.147.115
Asterisk eth1: 192.168.103.111
Asterisk default gateway: 192.168.103.1
-> Asterisk accesses Internet via eth1 (192.168.103.1 is
a DSL modem/router)

I did a tcpdump on the asterisk server while calling from
Jitsi as so:
tcpdump -s0 -X -n -w jitsi_via_asterisk.cap -i eth0 host
10.215.144.48

It's here:
http://213.96.91.201/temp/jitsi_via_asterisk.cap.gz

I also dumped the Jitsi log files here:
http://213.96.91.201/temp/jitsi-logs-BYE_not_received.zip

Any ideas/suggestions?

Thanks,

Vieri


#7

I seem to have pinpointed the problem. It looks like it's related to a buggy SIP-ALG in my DSL modem/router. Disabling it seems to solve this specific issue but I'm wondering if other problems will arise due to this change.
Anyway, thanks Damian.

···

--- On Tue, 6/7/11, Vieri <rentorbuy@yahoo.com> wrote:

I also did another trace but this
time on eth1:

tcpdump -s0 -X -n -w jitsi_via_asterisk_full_session_2.cap
-i eth1 host 193.22.119.20

The dump contains:

102/103 INVITE

102/103 ACK

and finally a

104 BYE

So Asterisk IS receiving a BYE from my SIP provider but
it's not forwarding it to my internal Jitsi client.
I'm also seeing a "SIP/2.0 481 Unknown Dialog" message and
I don't know if I should ignore it or if it may be part of
my problem.

Here are the very last "trimmed" SIP messages on eth1 (the
outer interface - facing Internet):

Note: 192.168.103.111 is the Asterisk server's eth1 IP
address.

Via: SIP/2.0/UDP
192.168.103.111:5060;branch=z9hG4bK061ef9a5;rport
From: "Unknown"
<sip:Unknown@192.168.103.111>;tag=as0b5ef7d6
To: <sip:voztele.com>
Contact: <sip:Unknown@192.168.103.111>
Call-ID: 1bcd2bb737683a1f1693064661922014@192.168.103.111
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX
Max-Forwards: 70
Date: Tue, 07 Jun 2011 14:31:08 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE,
NOTIFY, INFO
Supported: replaces
Content-Length: 0

SIP/2.0 200 OK - keepalive
Via: SIP/2.0/UDP
192.168.103.111:5060;branch=z9hG4bK061ef9a5;rport=49180
From: "Unknown"
<sip:Unknown@192.168.103.111>;tag=as0b5ef7d6
To:
<sip:voztele.com>;tag=ba3d51acad53eeb51d56ab2459dbff7b.1e10
Call-ID: 1bcd2bb737683a1f1693064661922014@192.168.103.111
CSeq: 102 OPTIONS
Server: OpenSER (1.2.1-notls (i386/linux))
Content-Length: 0

BYE
sip:656660499@212.106.213.4:5060;user=phone;transport=udp
SIP/2.0
Via: SIP/2.0/UDP
192.168.103.111:5060;branch=z9hG4bK4eb536f6;rport
Route:
<sip:193.22.119.20;lr=on;ftag=as205d2c6d>,<sip:193.22.119.10;lr=on>
From: "IT staff" <sip:1111222333444@voztele.com>;tag=as205d2c6d
To: <sip:656660499@voztele.com>;tag=gj-2k5-4ce476fc-000079ae-00169a68Rd15e51d9.b
Call-ID: 058d3b8c333b1228205ecbfa55dd1f2d@voztele.com
CSeq: 104 BYE
User-Agent: Asterisk PBX
Max-Forwards: 70
Proxy-Authorization: Digest username="1111222333444",
realm="voztele.com", algorithm=MD5,
uri="sip:656660499@212.106.213.4:5060",
nonce="4dee36e38c76f09b6afe975
70a0d9a34d1877025",
response="544df6b8aef2433bfa7cf636f84485ad"
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0

SIP/2.0 481 Unknown Dialog
Via: SIP/2.0/UDP
192.168.103.111:5060;branch=z9hG4bK4eb536f6;rport=49180
From: "IT staff" <sip:1111222333444@voztele.com>;tag=as205d2c6d
To: <sip:656660499@voztele.com>;tag=gj-2k5-4ce476fc-000079ae-00169a68Rd15e51d9.b
Call-ID: 058d3b8c333b1228205ecbfa55dd1f2d@voztele.com
CSeq: 104 BYE

--- On Tue, 6/7/11, Vieri <rentorbuy@yahoo.com> > wrote:

> Hi,
>
> I'm having an issue with all my calls going out my
SIP
> provider. I'm using Jitsi as a softphone registering
to a
> local Asterisk PBX.
>
> I register as extension 4053 to asterisk server at
> 10.215.147.115 (alias IP - real IP addr. is
10.215.147.111)
> and dial a phone number that is routed via an Internet
SIP
> provider.
> The call is correctly established and conversation is
OK.
> IF the Jitsi user hangs up first, the remote end is
also
> disconnected immediately.
> However, if the remote party hangs up first, the jitsi
user
> is not immediately disconnected.
> That, of course, is undesirable.
>
> I'd like to understand why the call isn't
automatically
> hung up and fix it.
>
> I'm supposing that Jitsi isn't receiving a BYE as
expected
> in a correct SIP transaction.
> I don't know why though.
>
> Here's my network setup:
>
> Jitsi asterisk extension 4053 at 10.215.144.48
> Asterisk eth0: 10.215.147.111 but Jitsi registers to
the
> alias/floating IP for failover setup 10.215.147.115
> Asterisk eth1: 192.168.103.111
> Asterisk default gateway: 192.168.103.1
> -> Asterisk accesses Internet via eth1
(192.168.103.1 is
> a DSL modem/router)
>
> I did a tcpdump on the asterisk server while calling
from
> Jitsi as so:
> tcpdump -s0 -X -n -w jitsi_via_asterisk.cap -i eth0
host
> 10.215.144.48
>
> It's here:
> http://213.96.91.201/temp/jitsi_via_asterisk.cap.gz
>
> I also dumped the Jitsi log files here:
> http://213.96.91.201/temp/jitsi-logs-BYE_not_received.zip
>
> Any ideas/suggestions?
>
> Thanks,
>
> Vieri
>
>
>