|
List Info
Thread: ast_readaudio_callback() called just one time
|
|
| ast_readaudio_callback() called just
one time |

|
2007-09-18 13:22:22 |
|
Hi,
I have the following behavior (Asterisk 1.2.24):
Using my channel driver, If my dialplan starts directly with a playback functions, for example:
exten => 4020,1,VoicemailMain(${CALLERID(num)} default);
the first messages wasn't played (in this case vm-login). The vm-password file is played normally.
However, If I insert a Wait() function before:
exten => 4020,1,Wait(1) exten => 4020,1,VoicemailMain(${CALLERID(num)} default);
both vm-login and vm-password are played normally.
In the first case (without Wait()), checking the Asterisk code, I saw that the ast_write() function is called just one time when the vm-login is played. I found in
file.c the ast_readaudio_callback() that should be called several times until the file finishes. However, it is called just one time.
I checked that in my side, the audio is already enabled, the channel is UP but my write callback is never called more than one (since ast_write() is not called as well).
What is the difference using Wait or not? Why the vm-login fails to play in the first case?
Any idea where to find the cause ?
Thanks!
-- -------------- Paulo Garcia Pika Technologies Inc
|
| Re: ast_readaudio_callback() called
just one time |
  United States |
2007-09-18 14:01:43 |
On Tue, 2007-09-18 at 15:22 -0300, Paulo Garcia wrote:
> What is the difference using Wait or not? Why the
vm-login fails to
> play in the first case?
I think what you're experiencing is the lag in the time it
takes the RTP
audio to be setup and the streams to begin once the call is
established.
The same thing can be accomplished by using:
exten => 4020,1,Answer(500)
exten => 4020,1,VoicemailMain(${CALLERID(num)} default)
Which will answer the call and start the streams flowing,
wait for
500ms, and then continue. By default, at least for
voicemail, Asterisk
does an implicit answer and I think that the channel.c code
in trunk was
changed a while back to insert a 500ms wait when a channel
was answered
to help with this very problem, ast_answer(). I don't think
this change
made it in to 1.4 but I could be wrong.
It's easy enough to insert an Answer(500) in the dialplan
for now
whenever there is an application which will answer the
channel and play
audio to it to avoid chopping off the first half second or
so of audio
if you're experiencing this issue.
There could be something else going on here but this is what
I've seen
and how I've worked around it in 1.2 and 1.4.
Cheers,
-Curt
_______________________________________________
Sign up now for AstriCon 2007! September 25-28th. http://www.astricon.net/
--Bandwidth and Colocation Provided by http://www.api-digital.c
om--
asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev
|
|
| Re: ast_readaudio_callback() called
just one time |

|
2007-09-18 14:35:39 |
|
Hi Curt, First, thank you for your answer. exten => 4020,1,Answer(500)
exten => 4020,1,VoicemailMain(${CALLERID(num)} default)
Which will answer the call and start the streams flowing, wait for 500ms, and then continue. By default, at least for voicemail, Asterisk does an implicit answer and I think that the
channel.c code in trunk was changed a while back to insert a 500ms wait when a channel was answered to help with this very problem, ast_answer(). I don't think this change made it in to 1.4 but I could be wrong.
I tried to use the Answer(500) and I still have the same behavior. Then I tried to increase the 500ms to more and it seems that the dialplan isn't wait this time.
Do I interpret something wrong? Is this the same that use:
Answer() Wait(1) ? (of course considering that wait use seconds).
Thanks again!
-- -------------- Paulo Garcia Pika Technologies Inc
|
| Re: ast_readaudio_callback() called
just one time |

|
2007-09-18 14:39:07 |
|
Curt,
I just saw that in pbx_builtin_answer() function, if the channel is AST_STATE_UP the delay is set to zero. This can explain my last question.
I'll do more tests.
Thanks!
Paulo
On 9/18/07, Paulo Garcia < paulo.astdev gmail.com">paulo.astdev gmail.com> wrote:
Hi Curt, First, thank you for your answer.
exten => 4020,1,Answer(500)
exten => 4020,1,VoicemailMain(${CALLERID(num)} default)
Which will answer the call and start the streams flowing, wait for 500ms, and then continue. By default, at least for voicemail, Asterisk does an implicit answer and I think that the
channel.c code in trunk was changed a while back to insert a 500ms wait when a channel was answered to help with this very problem, ast_answer(). I don't think this change made it in to 1.4 but I could be wrong.
I tried to use the Answer(500) and I still have the same behavior. Then I tried to increase the 500ms to more and it seems that the dialplan isn't wait this time.
Do I interpret something wrong? Is this the same that use:
Answer() Wait(1) ? (of course considering that wait use seconds).
Thanks again!
-- -------------- Paulo Garcia Pika Technologies Inc
-- -------------- Paulo Garcia Pika Technologies Inc
|
[1-4]
|
|