Keep-alive to the SIP server is not working

Hi,

I am using Asterisk 13 with PJSIP. I have defined my general section in pjsip as follow:

[global]
type=global
keep_alive_interval=20
endpoint_identifier_order=username,ip,anonymous

I used tcpdump and wireshark to see the keep-alive packets and do not see the keep-alive working properly.

No matter what I defined “keep_alive_interval=” to, it is always sending the signal every 30 secs instead of defined time in the “keep_alive_interval=”.

How can I send the keep-alive packets to the sip server so the communication tunnel will be always open?
I want to make the keep-alive interval 5 secs but doing “keep_alive_interval=5” is not working.

Any help would be appreciated.

Thanks.

Are you tracing keep alive packages packages for UDP or TCP connection and also have you read this post http://forums.asterisk.org/viewtopic.php?f=1&t=95303 ?

@ambiorixg12, Thanks for your reply.

Following is my pjsip file:

[global]
type=global
keep_alive_interval=20
endpoint_identifier_order=username,ip,anonymous

[simple]
type=transport
protocol=udp
bind=0.0.0.0
tos=cs7
cos=7

[simpletrans]
type=transport
protocol=tcp
bind=0.0.0.0:5060
tos=cs7
cos=7
local_net=192.168.145.0/24
external_media_address=71.225.187.142
external_signaling_address=71.225.187.142

[user1]
type=registration
outbound_auth=user1
outbound_proxy=sip:abcd.sip.com\;transport=tcp
transport=simpletrans
line=yes
retry_interval=60
endpoint=user1
expiration=600
max_retries=240
server_uri=sip:abcd.sip.com\;transport=tcp
client_uri=sip:user1@abcd.sip.com\;transport=tcp

[user1]
type=auth
auth_type=userpass
password=1234567890
username=user1

[user1]
type=aor
remove_existing=yes
contact=sip:abcd.sip.com\;transport=tcp

[user1]
type=endpoint
tos_audio=cs7
cos_audio=7
direct_media=no
force_rport=yes
context=user1Line
rewrite_contact=yes
transport=simpletrans
mailboxes=999@vm_setup
disallow=all
allow=ulaw,h263,h264
from_user=user1
from_domain=abcd.sip.com\;transport=tcp
aors=user1
outbound_auth=user1

[user2]
type=registration
outbound_auth=user2
outbound_proxy=sip:abcd.sip.com\;transport=tcp
transport=simpletrans
line=yes
retry_interval=60
endpoint=user2
expiration=600
max_retries=240
server_uri=sip:abcd.sip.com\;transport=tcp
client_uri=sip:user2@abcd.sip.com\;transport=tcp

[user2]
type=auth
auth_type=userpass
password=0987654321
username=user2

[user2]
type=aor
remove_existing=yes
contact=sip:abcd.sip.com\;transport=tcp

[user2]
type=endpoint
tos_audio=cs7
cos_audio=7
direct_media=no
force_rport=yes
context=user2Line
rewrite_contact=yes
transport=simpletrans
mailboxes=999@vm_setup
disallow=all
allow=ulaw,h263,h264
from_user=user2
from_domain=abcd.sip.com\;transport=tcp
aors=user2
outbound_auth=user2

[8883]
type=endpoint
transport=simple
context=sla_stations
send_pai=yes
send_rpid=yes
disallow=all
tos_audio=cs7
cos_audio=7
rewrite_contact=yes
dtmf_mode=rfc4733
allow=ulaw,h263,h264
mailboxes=999@vm_setup
auth=8883
aors=8883

[8883]
type=auth
auth_type=userpass
password=abcdabcdabcd1
username=8883

[8883]
type=aor
max_contacts=2

[8884]
type=endpoint
transport=simple
context=sla_stations
send_pai=yes
send_rpid=yes
disallow=all
tos_audio=cs7
cos_audio=7
rewrite_contact=yes
dtmf_mode=rfc4733
allow=ulaw,h263,h264
mailboxes=999@vm_setup
auth=8884
aors=8884

[8884]
type=auth
auth_type=userpass
password=abcdabcdabcd2
username=8884

[8884]
type=aor
max_contacts=2


[8885]
type=endpoint
transport=simple
context=sla_stations
send_pai=yes
send_rpid=yes
disallow=all
tos_audio=cs7
cos_audio=7
rewrite_contact=yes
dtmf_mode=rfc4733
allow=ulaw,h263,h264
mailboxes=999@vm_setup
auth=8885
aors=8885

[8885]
type=auth
auth_type=userpass
password=abcdabcdabcd3
username=8885

[8885]
type=aor
max_contacts=2

I have gone through the link you mentioned but did not get the information which can help with the mentioned pjsip file.

Any help regarding this issue?

For those coming from an Internet search (like me, initially), please, continue with this thread …

1 Like