[Freeswitch-users] collectInput does not call callback function

Kamen sireeps at gmail.com
Sun May 29 19:38:35 MSD 2011


Good point grmt!

But that is where I am getting confused.  What is that second argument? 
According to collectInput description in wiki (
http://wiki.freeswitch.org/wiki/Session_collectInput
http://wiki.freeswitch.org/wiki/Session_collectInput ) it is a
"callbackArguments" which in the example given is the last argument (is it?
because no more explanation is given):

function mycb( session, type, data, arg )

So I take that "dtmf" of the collectInput is arg of the callback function.

session.collectInput( mycb, "dtmf", 3000, 0)

But why is it a string type in the example?  Isn't dtmf defined as an object
and then used in callback function as an object?
arg.digits += data.digit;

At the same time in callback function example type parameter is apparently
expected to be a string "dtmf". Is it a coincidence or I am missing
something here? If collectInput second parameter is string "dtmf" then it
also looks that in callback function it is apparently a second parameter
(type). So what is it?  Is it an object dtmf which turns as arg parameter in
callback function, or it is a string which in callback function turns into
type parameter?  I took it should be a string turning into "type" of
callback function, so it does not matter what string is as long as it is the
same.  So I made it "digit".  

If I am missing something here, I'd really appreciate if someone let me
know.  I also tried it to be just an object (without quotes, in spite of the
example), or followed the example exactly.  In any case the callback is not
happening - the first line of my callback function is a console prompt,
which is not printed. Thus is my question.

Regards,

Sergei Kamen




--
View this message in context: http://freeswitch-users.2379917.n2.nabble.com/collectInput-does-not-call-callback-function-tp6414679p6416704.html
Sent from the freeswitch-users mailing list archive at Nabble.com.



More information about the FreeSWITCH-users mailing list