[asterisk-dev] Slow Sip Processing
Matthew Jordan
mjordan at digium.com
Wed Dec 3 07:06:42 CST 2014
On Tue, Dec 2, 2014 at 3:34 PM, Ross Beer <ross.beer at outlook.com> wrote:
> Hi,
>
> I've run into an issue with slow processing of SIP packets on Asterisk 11,
> which isn't present in Asterisk 1.8.
>
> I believe the issue to be related to asterisk realtime and cache. In version
> 1.8 asterisk appears to use cache data or if present static config. However
> in version 11 a call is made to the database every time a call comes in even
> if there is a static peer defined or cache is present.
>
> The issue has become apparent recently when one server calls a group of
> phones that reside on another server. For example 'Asterisk A (Asterisk 11)'
> calls multiple phones on 'Asterisk B (Asterisk 11)' at exactly the same
> time, a delay is present which causes the phones to ring at different times.
>
> If however 'Asterisk A (Asterisk 11) makes the same calls to 'Asterisk C
> (Asterisk 1.8)' all phones ring in time.
>
> When looking at the CLI, the calls coming into 'Asterisk B' show a slight
> delay in processing, however a call from a phone on the same server to the
> same group has no such delay.
>
> This leads me to believe that processing of packets from other servers is
> delayed in some way, however I am unable to find the cause. I've even
> downgraded to Asterisk 1.8 on 'Asterisk B' which removes the issue.
>
> The question I have is why does the realtime architecture query the
> database even if the peer is not dynamic? Does Asterisk 11 not check for
> static peers before checking the database?
>
> Can anyone shed any light on this?
>
I'm not aware of any major differences in realtime processing in
chan_sip between 1.8 and 11. The function update_peer is identical in
both:
/*! \brief Update peer data in database (if used) */
static void update_peer(struct sip_peer *p, int expire)
{
int rtcachefriends = ast_test_flag(&p->flags[1], SIP_PAGE2_RTCACHEFRIENDS);
if (sip_cfg.peer_rtupdate &&
(p->is_realtime || rtcachefriends)) {
realtime_update_peer(p->name, &p->addr, p->username,
p->fullcontact, p->useragent, expire, p->deprecated_username,
p->lastms);
}
}
A cursory look of the usage of peer_rtupdate and other related
settings yields similar results in both as well.
You'll most likely need to do a deeper inspection on what is occurring
to determine why you have a behavioural difference between the two
versions.
--
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org
More information about the asterisk-dev
mailing list