[asterisk-bugs] [JIRA] (ASTERISK-26257) AGI scripts called from dialplan disturb confbrige audio quality

Andrew Nagy (JIRA) noreply at issues.asterisk.org
Tue Jul 24 15:49:54 CDT 2018


    [ https://issues.asterisk.org/jira/browse/ASTERISK-26257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=231682#comment-231682 ] 

Andrew Nagy edited comment on ASTERISK-26257 at 7/24/18 3:49 PM:
-----------------------------------------------------------------

the workaround would be to dedicated one cpu core to the non timesensitive tasks and to exclude that from the Asterisk threads. You could modify the safe_asterisk script to use taskset when starting asterisk like change (sorry the long lines wrap in this setup):
{code}
nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} >/dev/${TTY} 2>&1 </dev/${TTY}
{code}
to
{code}
nice -n $PRIORITY /bin/taskset -c 0-6 ${ASTSBINDIR}/asterisk -f ${CLIARGS} ${ASTARGS} >/dev/${TTY} 2>&1 </dev/${TTY}
{code}
you have now excluded core 7 from your asterisk threads.
now in you extensions.conf change
{code}
_+X.,1,Agi(MyAgi.agi.)
{code}
to
{code}
_+X.,1,Agi(/bin/taskset,-c,7,/var/lib/asterisk/agi-bin/MyAgi.agi)
{code}
your are now only using core 7 when executing you agi script, it would make sense to also move your PostgreSQL to core 7.
If this isn't enough to give your asterisk the timing needed then use the isolcpu switch in the kernel boot line so you take e.g core 1-6 away from the OS scheduler and only use these cores in your safe_asterisk start.
  


was (Author: freddi_fonet):
the workaround would be to dedicated one cpu core to the non timesensitive tasks and to exclude that from the Asterisk threads. You could modify the safe_asterisk script to use taskset when starting asterisk like change (sorry the long lines wrap in this setup):
{code}
nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} >/dev/${TTY} 2>&1 </dev/${TTY}
{code}
to
{code}
nice -n $PRIORITY /bin/taskset -c 0-6 ${ASTSBINDIR}/asterisk -f ${CLIARGS} ${ASTARGS} >/dev/${TTY} 2>&1 </dev/${TTY}
you have now excluded core 7 from your asterisk threads.
now in you extensions.conf change
_+X.,1,Agi(MyAgi.agi.)
{code}
to
{code}
_+X.,1,Agi(/bin/taskset,-c,7,/var/lib/asterisk/agi-bin/MyAgi.agi)
{code}
your are now only using core 7 when executing you agi script, it would make sense to also move your PostgreSQL to core 7.
If this isn't enough to give your asterisk the timing needed then use the isolcpu switch in the kernel boot line so you take e.g core 1-6 away from the OS scheduler and only use these cores in your safe_asterisk start.
  

> AGI scripts called from dialplan disturb confbrige audio quality
> ----------------------------------------------------------------
>
>                 Key: ASTERISK-26257
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-26257
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_confbridge, Resources/res_agi
>    Affects Versions: 11.13.0
>         Environment: CentOS 6.5 x64 8 core RAM 16 GB
>            Reporter: Marco Nicoloso
>
> The issue has been reported in the Asterisk community and investigated.
> Here the link to the forum.
> The version we are using is quite old (11.13), but the problem can affect also other versione as, reading through the changelogs, I do not have any evidence that the problem is solved.
> We have some clients that receive continuously audio from confbridge and try to setup once every 5 seconds new channels if the configured ones are  down. In parallel Asterisk records the audio of these conferences into some wav files.
> The effect that wwe observed was that we were detecting some strange audio "holes" on client-side generated by asterisk  (20-40 ms) at least once every 2 seconds.
> Looking at the recorded files, we noticed that there was about 2% of samples missing (during an hour of recording we had a loss of 1 minute and a half in record duration)
> The dialplan was starting with an AGI script in order to retrieve from a PostgreSQL 8.4 DB some data and setup some channel variables.
> After that step, dialplan was executing simple checks which wouold terminate eventually in confbridge or busy.
> After switching from AGI script to func_odbc the loss is approximately 0,01 % of samples



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list