Hello Community,
I have been dealing with a hard-to-reproduce audio issue for quite some time involving a Cisco 8851 connected to an Asterisk PJSIP setup behind IPSec/NAT. I would like to ask whether anyone has experienced something similar or can spot an obvious mistake in the configuration.
Setup
Infrastructure
-
Asterisk (PJSIP) on a public server
-
Cisco 8851 as SIP client
-
Remote site connected via LANCOM IPSec site-to-site VPN
-
SIP over UDP
-
RTP handled via Asterisk (
direct_media=no) -
Codec: alaw only
Symptom
Calls would initially work completely normally, but after approximately:
-
30–40 minutes
-
sometimes slightly longer
audio would become heavily choppy.
What was noticeable:
-
At times, I would hear the remote party in a heavily choppy way while they could hear me clearly
-
In other cases, it was the opposite:
-
I could hear the remote party normally
-
they would hear me in a choppy way
-
The SIP dialog itself remained active, and the call was not disconnected.
The issue did not occur on every call, but it appeared quite frequently during longer conversations.
Initial assumptions
Initially, the suspected causes were:
-
IPSec rekey events
-
LANCOM UDP aging
-
RTP timeout handling
-
NAT issues
-
RTP relay behavior
-
Cisco SIP behavior
Especially because on the LANCOM side:
- UDP aging is ~300 seconds
However, IPSec lifetimes had already been increased to:
ikelifetime=8h
salifetime=8h
meaning an IPSec rekey around 30–40 minutes should no longer align with the observed timing of the issue.
Key finding
When comparing SIP session timer settings, it became clear that the timers between:
-
Cisco 8851
-
Asterisk
-
SIP peer/remote side
were not consistent.
Cisco 8851 (previous state)
INVITE Expires: 240
ReINVITE Expires: 30
Asterisk (previous state)
Initially:
timers=no
and later:
timers=yes
timers_sess_expires=3600
This likely caused different session refresh mechanisms to run in parallel.
Current state / harmonization
All timers have now been aligned to:
Cisco 8851
INVITE Expires: 1800
ReINVITE Expires: 1800
Asterisk PJSIP endpoint
[1005]
type=endpoint
transport=udp
context=outgoing
disallow=all
allow=alaw
auth=auth1005
aors=1005
direct_media=no
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
media_use_received_transport=yes
rtcp_mux=yes
timers=yes
timers_sess_expires=1800
timers_min_se=90
rtp_keepalive=20
rtp_timeout=0
rtp_timeout_hold=0
Additional relevant points
IPSec
ikelifetime=8h
salifetime=8h
rekey=yes
rekeymargin=300s
LANCOM
- UDP aging approx. 300 seconds
Current status
Important:
The timer harmonization has only just been applied.
I have not yet been able to perform a sufficiently long test call to confirm whether this actually resolves the issue.
At this stage, this is still a hypothesis based on:
-
the strong time correlation (~30–40 minutes)
-
previously inconsistent session timer configurations
-
the behavior observed during long calls
Current hypothesis
The current assumption is:
-
Inconsistent SIP session timers caused Re-INVITE / RTP re-binding issues
-
potentially combined with NAT/IPSec state handling
-
RTP streams may have remained on an outdated or suboptimal path
-
resulting in heavily choppy audio despite an active SIP dialog
Since IPSec lifetimes are now set to 8 hours, a direct correlation with IPSec rekeying now seems unlikely.
Questions to the community
-
Does this hypothesis sound plausible?
-
Has anyone seen similar issues with Cisco 88xx + Asterisk + NAT/IPSec setups?
-
Are there known issues with:
-
rtcp_mux=yes -
media_use_received_transport=yes -
Cisco Re-INVITE behavior?
-
-
Would you generally enforce strict 1800s session timer alignment across all endpoints?
-
Any known pitfalls with long SIP calls over IPSec/NAT with Cisco 88xx devices?
Thanks in advance.
Kind Regards