[asterisk-dev] Read application
Volkov Alexei
kot at kotzone.ru
Fri Dec 8 17:13:13 MST 2006
Hi!
With latest 1.4-trunk (revision 48358) i have note that Read application
is work tragically different with unspecified filename parameter.
//
Just to remember
Read(variable[|filename[&filename2...]][|maxdigits][|option][|attempts][|timeout])
//
For example, let's take following context
context mainmenu {
s=> {jump start;};
start => {
Set(levelup=mainmenu);
Answer();
Read(NUM||1|n|1|3);
MusicOnHold();
Hangup();
};
When some incoming call routed to this context the log says:
-- Executing [s at mainmenu:1] Goto("H323/ip$192.168.1.1:63443/4149",
"start|1") in new stack
-- Goto (mainmenu,start,1)
-- Executing [start at mainmenu:1]
Set("H323/ip$192.168.1.1:63443/4149", "levelup=mainmenu") in new stack
-- Executing [start at mainmenu:2]
Answer("H323/ip$192.168.1.1:63443/4149", "") in new stack
-- Executing [start at mainmenu:3]
Read("H323/ip$192.168.1.1:63443/4149", "NUM||1|n|1|3") in new stack
-- Accepting a maximum of 1 digits.
-- User disconnected
== Spawn extension (mainmenu, start, 3) exited non-zero on
'H323/ip$192.168.1.1:63443/4149'
And call is terminated before end user can send any DTMF digit.
But if we replace Read(NUM||1|n|1|3) with same call, but filename
parameter specified, incoming call will be processed as assumed (short
beep, user can send DTMF or wait for read timeout, after all music on
hold is starting).
Following context
context mainmenu {
s=> {jump start;};
start => {
Set(levelup=mainmenu);
Answer();
Read(NUM|beep|1|n|1|3);
MusicOnHold();
Hangup();
};
produce logs
-- Executing [s at mainmenu:1] Goto("H323/ip$192.168.1.1:65355/4150",
"start|1") in new stack
-- Goto (mainmenu,start,1)
-- Executing [start at mainmenu:1]
Set("H323/ip$192.168.1.1:65355/4150", "levelup=mainmenu") in new stack
-- Executing [start at mainmenu:2]
Answer("H323/ip$192.168.1.1:65355/4150", "") in new stack
-- Executing [start at mainmenu:3]
Read("H323/ip$192.168.1.1:65355/4150", "NUM|beep|1|n|1|3") in new stack
-- Accepting a maximum of 1 digits.
-- Playing 'beep' (language 'en')
-- User entered '5'
-- Executing [start at mainmenu:4]
MusicOnHold("H323/ip$192.168.1.1:65355/4150", "") in new stack
-- Started music on hold, class 'default', on
H323/ip$192.168.1.1:65355/4150
-- Stopped music on hold on H323/ip$192.168.1.1:65355/4150
== Spawn extension (mainmenu, start, 4) exited non-zero on
'H323/ip$192.168.1.1:65355/4150'
It seems to be, that filename=NULL processed incorrectly somewhere
inside app_read.c.
--
С уважением,
Волков Алексей
More information about the asterisk-dev
mailing list