Media session is destroyed after 12 hrs

Hi all

We are Using The Asterisk® Open Source PBX asterisk 1.6.2.6 version we are also using konference(app_konference) 1.4 .
we are registering one linux based hardfone using pjsua 1.8 as the useragent…
actually we are streaming anaudio continuously without end unless user intervention
but we found that after 12 hours or so the media session is destroyed. so no audio is transmitted
details are as below

on server side in asterisk sip.conf file
all the session parameters are set to default
i.e
session-timers=accept
session-expires=1800
session-minse=90
session-refresher=uas

and on client side

pjsua is started with parameters as below

./pjsua-arm-none-gnuabi --ec-tail=0 --snd-auto-close=-1 --no-tones --use-timer=1 --timer-se=86400 --timer-min-se=86300

we register one sip client which transmits audio continuously as
SIP/0060 which will join konference on asterisk server
after 12 hrs we get dump on pjsua as media session is destroyed as below

v=0
o=root 468455516 468455516 IN IP4 192.168.0.3
s=Asterisk PBX 1.6.2.6
c=IN IP4 192.168.0.3
t=0 0
m=audio 14850 RTP/AVP 9 101
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

–end msg–
07:29:48.325 pjsua_call.c Call 1: received updated media offer
07:29:48.328 pjsua_media.c Media session for call 1 is destroyed
07:29:48.330 strm0x1a43b4 Encoder stream started
07:29:48.330 strm0x1a43b4 Decoder stream started
07:29:48.331 pjsua_media.c Media updates, stream #0: G722 (sendrecv)
07:29:48.331 pjsua_app.c Media for call 1 is active
07:29:48.334 pjsua_core.c TX 801 bytes Response msg 200/INVITE/cseq=102 (tdta0x1a2320) to UDP 192.168.0.3:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.0.3:5060;rport=5060;received=192.168.0.3;branch=z9hG4bK5c572d7b
Call-ID: EATdkyE-H-lM5zxsRyoc4kdhKQ3NWY3I
From: sip:0410@192.168.0.3;tag=as221784dd
To: sip:0060@192.168.0.3;tag=Wz5wNxRpYtt7Lc-yqRc8zz92bSJSaNmU
CSeq: 102 INVITE
Session-Expires: 86400;refresher=uas
Contact: sip:0060@192.168.1.15:5060
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Content-Type: application/sdp
Content-Length: 251

v=0
o=- 3559577385 3559577386 IN IP4 192.168.1.15
s=pjmedia
c=IN IP4 192.168.1.15
t=0 0
a=X-nat:0
m=audio 4002 RTP/AVP 9 101
a=rtcp:4003 IN IP4 192.168.1.15
a=rtpmap:9 G722/8000
a=sendrecv
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

my problem is I want to know why media session is destroyed and what configuration changes should I do for prohibiting this please guide .
any help is appreciated.

Thanks in advance
Pranv Thipse.

The trace is incomplete and doesn’t show any sort of failure. As you hint, session timers are about the only thing that could cause a change after such a period.

It iw always best, when asking about Asterisk, to provide the debugging traces fromk the Asterisk side.

hi david

on asterisk debug following dump is found when session is destroyed

node2*CLI>
<— SIP read from UDP:192.168.0.12:5060 —>

<------------->
set_destination: Parsing sip:0060@192.168.1.15:5060 for address/port to send to
set_destination: set destination to 192.168.1.15, port 5060
Audio is at 192.168.0.3 port 13512
Adding codec 0x1000 (g722) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 192.168.1.15:5060:
INVITE sip:0060@192.168.1.15:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.3:5060;branch=z9hG4bK59aba3a1;rport
Max-Forwards: 70
From: sip:0410@192.168.0.3;tag=as32914f10
To: sip:0060@192.168.0.3;tag=zqulK1vvEqAvFF-0uUFguw.5AvWYxdIT
Contact: sip:0410@192.168.0.3
Call-ID: 1cNFI9Zuo.9usQCs-yacfG5Do0or-DBf
CSeq: 105 INVITE
User-Agent: Asterisk PBX 1.6.2.6
Require: timer
Session-Expires: 120;refresher=uas
Min-SE: 100
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
X-asterisk-Info: SIP re-invite (Session-Timers)
Content-Type: application/sdp
Content-Length: 259

v=0
o=root 498561931 498561931 IN IP4 192.168.0.3
s=Asterisk PBX 1.6.2.6
c=IN IP4 192.168.0.3
t=0 0
m=audio 13512 RTP/AVP 9 101
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv


node2*CLI>
<— SIP read from UDP:192.168.1.15:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.0.3:5060;rport=5060;received=192.168.0.3;branch=z9hG4bK59aba3a1
Call-ID: 1cNFI9Zuo.9usQCs-yacfG5Do0or-DBf
From: sip:0410@192.168.0.3;tag=as32914f10
To: sip:0060@192.168.0.3;tag=zqulK1vvEqAvFF-0uUFguw.5AvWYxdIT
CSeq: 105 INVITE
Contact: sip:0060@192.168.1.15:5060
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Content-Type: application/sdp
Content-Length: 251

v=0
o=- 3559647737 3559647741 IN IP4 192.168.1.15
s=pjmedia
c=IN IP4 192.168.1.15
t=0 0
a=X-nat:0
m=audio 4000 RTP/AVP 9 101
a=rtcp:4001 IN IP4 192.168.1.15
a=rtpmap:9 G722/8000
a=sendrecv
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

<------------->
— (11 headers 12 lines) —
Found RTP audio format 9
Found RTP audio format 101
Found audio description format G722 for ID 9
Found audio description format telephone-event for ID 101
Capabilities: us - 0x1000 (g722), peer - audio=0x1000 (g722)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x1000 (g722)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 192.168.1.15:4000
set_destination: Parsing sip:0060@192.168.1.15:5060 for address/port to send to
set_destination: set destination to 192.168.1.15, port 5060
Transmitting (no NAT) to 192.168.1.15:5060:
ACK sip:0060@192.168.1.15:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.3:5060;branch=z9hG4bK23fef122;rport
Max-Forwards: 70
From: sip:0410@192.168.0.3;tag=as32914f10
To: sip:0060@192.168.0.3;tag=zqulK1vvEqAvFF-0uUFguw.5AvWYxdIT
Contact: sip:0410@192.168.0.3
Call-ID: 1cNFI9Zuo.9usQCs-yacfG5Do0or-DBf
CSeq: 105 ACK
User-Agent: Asterisk PBX 1.6.2.6
Content-Length: 0


node2*CLI>

in above dump 0410 is one konference created at
server and 0060 is sip registered with asterisk

and this is periodic activity actually. set any value for session-expires on any side whether on asterisk or on pjsua the session is destroyed at time interval half of that value
please guide
thanks in advance.

Pranav Thipse

Looks like a successful session timer refresh. There is no indication that Asterisk intends to suspend the media, or has done so. If a session actually timed out, I would expect it to send BYE.

The half time is probably to ensure that the session is always refreshed before it can timeout.