[asterisk-dev] ast_read() wrong for calls initiated by Asterisk

Edwin Groothuis edwin at mavetju.org
Thu Feb 21 16:20:46 CST 2008


Is there nobody who wants to exchange ideas with me about this?

Edwin

On Sat, Feb 16, 2008 at 06:25:54PM +1100, Edwin Groothuis wrote:
> On Sat, Feb 16, 2008 at 03:45:12PM +1100, Edwin Groothuis wrote:
> > See http://bugs.digium.com/view.php?id=11917 (it only talks about
> > AGI scripts, but it's more generic, it also happens with the Read()
> > application in the dialplan)
> > 
> > The story so far:
> > 
> > - I have a call initiated by the Asterisk server with a call file.
> >   That works.
> > 
> > - During the call I will ask for a couple of digits.
> > 
> > The dialplan is as follow (just FYI, this all works)
> > 
> >     [context-tools]
> >     exten => 123,1,NoOp(Callback1)
> >     exten => 123,n,Answer()
> >     exten => 123,n,Read(foo,one-moment-please,3,,,10);
> >     exten => 123,n,SayDigits(${foo})
> >     exten => 123,n,AGI(callback1.agi)
> > 
> >     [context-callback]
> >     exten => _.X,1,NoOp(callback time)
> >     exten => _.X,n,Answer()
> >     exten => _.X,n,Read(foo,one-moment-please,3,n,,10);
> >     exten => _.X,n,SayDigits(${foo});
> >     exten => _.X,n,Hangup
> > 
> > Now the strange thing is the Read() on 123 does recognize the
> > DTMF keys, while the Read() in the callback does not recognized the
> > DTMF keys.
> > 
> > Going through some code I ended up at main/channel.c at the
> > ast_waitfordigit_full() function which did do a ast_read(). For the
>                          ast_waitfor_nandfds() ---^^^^^^^^
> 
> > Read() on 123, the ast_read now and then showed a AST_FRAME_DTMF_END.
>                      ^^^^^^^^-- ast_waitfor_nandfds()
> > But for the Read() in the callback it didn't show up.
> > 
> > At that moment I thought that this might be a left-right-channel issue:
> > 
> > Under normal circumstances, the user telephone (the originating
> > channel) calls the PABX. So the user data comes from originating
> > channel to the channel and the Read() function gets the data from
> > the originating channel.
> > 
> > But with call files, the user telephone is on the outgoing channel
> > and thus should the Read() function get the data from the outgoing
> > channel.
> > 
> > 
> > The question of course is.... Does this explanation make sense?
> > 
> > (Oh, and where is the link between the DialPlan and the call to the
> > Read() function? (Don't worry, I'll find it :-))
> 
> (Just to prevent confusion :-)
> 
> Edwin
> -- 
> Edwin Groothuis      |            Personal website: http://www.mavetju.org
> edwin at mavetju.org    |              Weblog: http://www.mavetju.org/weblog/
> 
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
> 
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
> 

-- 
Edwin Groothuis      |            Personal website: http://www.mavetju.org
edwin at mavetju.org    |              Weblog: http://www.mavetju.org/weblog/



More information about the asterisk-dev mailing list