Jerry Geis
2009-Oct-04 00:05 UTC
[asterisk-users] After call into console/dsp hangup hear ringing
I am running asterisk 1.4.26.1 and using ALSA not oss
dahdi 2.2.0
and libpri-1.4.10
I am calling into console/dsp I hear the audio just fine then after the
hangup I hear ringing
on the console/dsp.
Why would that be?
I found this bug for OSS https://issues.asterisk.org/view.php?id=13686
Does the same thing exist in ALSA???
some traces below
Jerry
== Parsing '/etc/asterisk/asterisk.conf': Found
== Parsing '/etc/asterisk/extconfig.conf': Found
Connected to Asterisk 1.4.26.1 currently running on ebox3850 (pid = 3902)
Verbosity was 0 and is now 5
-- Executing [mediaport_audio_visual at smvoice-mediaport:1]
Goto("SIP/devcentos5x64_to_ebox3850-0837c170",
"smvoice-mediaport-audio-visual|s|1") in new stack
-- Goto (smvoice-mediaport-audio-visual,s,1)
-- Executing [s at smvoice-mediaport-audio-visual:1]
ChanIsAvail("SIP/devcentos5x64_to_ebox3850-0837c170",
"Console/Dsp") in
new stack
<< Hangup on console >>
-- Executing [s at smvoice-mediaport-audio-visual:2]
GotoIf("SIP/devcentos5x64_to_ebox3850-0837c170",
"0?smvoice-busy|s|1")
in new stack
-- Executing [s at smvoice-mediaport-audio-visual:3]
Playback("SIP/devcentos5x64_to_ebox3850-0837c170", "beep")
in new stack
-- <SIP/devcentos5x64_to_ebox3850-0837c170> Playing 'beep'
(language
'en')
-- Executing [s at smvoice-mediaport-audio-visual:4]
Dial("SIP/devcentos5x64_to_ebox3850-0837c170",
"Console/dsp") in new stack
<< Call placed to 'dsp' on console >>
<< Auto-answered >>
-- Called dsp
-- ALSA/default answered SIP/devcentos5x64_to_ebox3850-0837c170
<< Hangup on console >>
== Spawn extension (smvoice-mediaport-audio-visual, s, 4) exited
non-zero on 'SIP/devcentos5x64_to_ebox3850-0837c170'
[smvoice-mediaport-audio-visual]
exten => s,1,ChanIsAvail(Console/Dsp)
exten => s,n,GotoIf($["${AVAILCHAN}" =
""]?smvoice-busy,s,1)
exten => s,n,Playback(beep)
exten => s,n,Dial(Console/dsp)
exten => s,n,Hangup
Jerry Geis
2009-Oct-04 20:28 UTC
[asterisk-users] After call into console/dsp hangup hear ringing
Looking at the function below in chan_alsa.c shouldnt't the variable
hookstate be set to 1 for auto answer??? I think this is affecting the
ringing I hear after the call.
Jerry
static int alsa_call(struct ast_channel *c, char *dest, int timeout)
{
int res = 3;
struct ast_frame f = { AST_FRAME_CONTROL };
ast_mutex_lock(&alsalock);
ast_verbose(" << Call placed to '%s' on console
>> \n", dest);
if (autoanswer) {
ast_verbose(" << Auto-answered >> \n");
grab_owner();
if (alsa.owner) {
f.subclass = AST_CONTROL_ANSWER;
ast_queue_frame(alsa.owner, &f);
ast_mutex_unlock(&alsa.owner->lock);
}
} else {
ast_verbose(" << Type 'answer' to answer, or
use
'autoanswer' for future calls >> \n");
grab_owner();
if (alsa.owner) {
f.subclass = AST_CONTROL_RINGING;
ast_queue_frame(alsa.owner, &f);
ast_mutex_unlock(&alsa.owner->lock);
}
if (write(sndcmd[1], &res, sizeof(res)) < 0) {
Jerry Geis
2009-Oct-05 02:06 UTC
[asterisk-users] After call into console/dsp hangup hear ringing
I found the problem.
The function send_sound() in chan_alsa.c does this:
if (FD_ISSET(sndcmd[0], &rfds)) {
if (read(sndcmd[0], &cursound, sizeof(cursound))
< 0) {
ast_log(LOG_WARNING, "read() failed:
%s\n", strerror(errno));
}
silencelen = 0;
offset = 0;
sampsent = 0;
This sets cursound to 0 and cursound should be -1.
If I change cursound here to local_cursound and recompile I do not hear
the ring after my call.
Jerry
Matt Riddell
2009-Oct-05 04:39 UTC
[asterisk-users] After call into console/dsp hangup hear ringing
On 5/10/09 3:06 PM, Jerry Geis wrote:> I found the problem. > > The function send_sound() in chan_alsa.c does this:Best bet is to open an issue on the bugtracker and post your patch -- Cheers, Matt Riddell Director _______________________________________________ http://www.venturevoip.com/news.php (Daily Asterisk News) http://www.venturevoip.com/st.php (SmoothTorque Predictive Dialer) http://www.venturevoip.com/c3.php (ConduIT3 PABX Systems)