[Freeswitch-users] Lua playAndGetDigits

Michael De Lorenzo delorenzodesign at gmail.com
Wed Mar 17 07:52:16 PDT 2010


Ok, so I updated my install to include OpenZap.  It looks like the keys are
being detected, but not being returned by playAndGetDigits.

2010-03-17 10:49:21.207160 [DEBUG] sofia.c:4152 Channel
sofia/external/19736327407 entering state [ready][200]
2010-03-17 10:49:21.208170 [NOTICE] sofia.c:4676 Channel
[sofia/external/19736327407] has been answered
2010-03-17 10:49:21.208170 [DEBUG] switch_ivr_originate.c:3140 Originate
Resulted in Success: [sofia/external/19736327407]
2010-03-17 10:49:21.208170 [DEBUG] switch_cpp.cpp:497
(sofia/external/19736327407) State Change CS_CONSUME_MEDIA ->
CS_SOFT_EXECUTE
2010-03-17 10:49:21.208170 [DEBUG] switch_core_session.c:1018 Send signal
sofia/external/19736327407 [BREAK]
2010-03-17 10:49:21.209171 [DEBUG] switch_ivr_play_say.c:1152 Codec
Activated L16 at 8000hz 1 channels 20ms
2010-03-17 10:49:21.209171 [DEBUG] switch_core_state_machine.c:314
(sofia/external/19736327407) Running State Change CS_SOFT_EXECUTE
2010-03-17 10:49:21.209171 [DEBUG] switch_core_state_machine.c:354
(sofia/external/19736327407) State SOFT_EXECUTE
2010-03-17 10:49:21.209171 [DEBUG] mod_sofia.c:510 SOFIA SOFT_EXECUTE
2010-03-17 10:49:21.209171 [DEBUG] switch_core_state_machine.c:200
sofia/external/19736327407 Standard SOFT_EXECUTE
2010-03-17 10:49:21.209171 [DEBUG] switch_core_state_machine.c:354
(sofia/external/19736327407) State SOFT_EXECUTE going to sleep
2010-03-17 10:49:21.241184 [DEBUG] switch_rtp.c:2064 Correct ip/port
confirmed.
*2010-03-17 10:49:25.582703 [DEBUG] switch_rtp.c:2426 RTP RECV DTMF 1:1440*
2010-03-17 10:49:25.582703 [DEBUG] switch_ivr_play_say.c:1444 done playing
file
*2010-03-17 10:49:27.342662 [DEBUG] switch_rtp.c:2426 RTP RECV DTMF 1:480*
*2010-03-17 10:49:28.042790 [DEBUG] switch_rtp.c:2426 RTP RECV DTMF 1:48*0
2010-03-17 10:49:31.829092 [NOTICE] sofia.c:481 Hangup
sofia/external/19736327407 [CS_SOFT_EXECUTE] [NORMAL_CLEARING]
2010-03-17 10:49:31.829092 [DEBUG] switch_channel.c:2071 Send signal
sofia/external/19736327407 [KILL]
2010-03-17 10:49:31.829092 [DEBUG] switch_core_session.c:1018 Send signal
sofia/external/19736327407 [BREAK]
2010-03-17 10:49:31.829092 [DEBUG] switch_core_state_machine.c:314
(sofia/external/19736327407) Running State Change CS_HANGUP
2010-03-17 10:49:31.830229 [DEBUG] switch_core_state_machine.c:499
(sofia/external/19736327407) State HANGUP
2010-03-17 10:49:31.830229 [DEBUG] mod_sofia.c:405
sofia/external/19736327407 Overriding SIP cause 480 with 200 from the other
leg
2010-03-17 10:49:31.830229 [DEBUG] mod_sofia.c:411 Channel
sofia/external/19736327407 hanging up, cause: NORMAL_CLEARING
2010-03-17 10:49:31.831230 [DEBUG] switch_core_state_machine.c:46
sofia/external/19736327407 Standard HANGUP, cause: NORMAL_CLEARING
2010-03-17 10:49:31.831230 [DEBUG] switch_core_state_machine.c:499
(sofia/external/19736327407) State HANGUP going to sleep
2010-03-17 10:49:31.831230 [DEBUG] switch_core_state_machine.c:333
(sofia/external/19736327407) State Change CS_HANGUP -> CS_REPORTING
2010-03-17 10:49:31.831230 [DEBUG] switch_core_session.c:1018 Send signal
sofia/external/19736327407 [BREAK]
2010-03-17 10:49:31.831230 [DEBUG] switch_core_state_machine.c:314
(sofia/external/19736327407) Running State Change CS_REPORTING
2010-03-17 10:49:31.831230 [DEBUG] switch_core_state_machine.c:590
(sofia/external/19736327407) State REPORTING
2010-03-17 10:49:31.832242 [DEBUG] switch_core_state_machine.c:53
sofia/external/19736327407 Standard REPORTING, cause: NORMAL_CLEARING
2010-03-17 10:49:31.832242 [DEBUG] switch_core_state_machine.c:590
(sofia/external/19736327407) State REPORTING going to sleep
2010-03-17 10:49:31.832242 [DEBUG] switch_core_state_machine.c:327
(sofia/external/19736327407) State Change CS_REPORTING -> CS_DESTROY
2010-03-17 10:49:31.832242 [DEBUG] switch_core_session.c:1018 Send signal
sofia/external/19736327407 [BREAK]
2010-03-17 10:49:31.832242 [DEBUG] switch_core_session.c:1161 Session 1
(sofia/external/19736327407) Locked, Waiting on external entities
*2010-03-17 10:49:31.841241 [INFO] switch_cpp.cpp:1142 Digits received
during call from playAndGetDigits:*
2010-03-17 10:49:31.841241 [INFO] switch_cpp.cpp:1142 Did this check out? no
2010-03-17 10:49:31.841241 [INFO] switch_cpp.cpp:1142 We need to try this
callee again.



On Wed, Mar 17, 2010 at 10:00 AM, Michael De Lorenzo <
delorenzodesign at gmail.com> wrote:

> How do I do that in Lua?  session:execute("dtmf","start") doesn't work.
>
>
> On Tue, Mar 16, 2010 at 11:38 PM, Michael S Collins <msc at freeswitch.org>wrote:
>
>> Perhaps the DTMFs are coming inband. Try the start_dtmf dialplan app.
>> -MC
>>
>> Sent from my iPhone
>>
>> On Mar 16, 2010, at 7:05 PM, Michael De Lorenzo <
>> delorenzodesign at gmail.com> wrote:
>>
>> So I'm making calls using VoiceNetwork, are you suggesting there's a
>> problem there?  Or on the line where the call is received (I've tried on a
>> couple of different networks/providers)?
>>
>> On Tue, Mar 16, 2010 at 9:34 PM, Aloysius Lloyd <<lloyd.aloysius at gmail.com>
>> lloyd.aloysius at gmail.com> wrote:
>>
>>> You inbound DID Provider
>>>
>>>
>>>
>>> On Tue, Mar 16, 2010 at 9:16 PM, Michael De Lorenzo <<delorenzodesign at gmail.com>
>>> delorenzodesign at gmail.com> wrote:
>>>
>>>> What do you mean about the provider?  I'm not sure I understand that
>>>> part.  I'm trying to call a number and have the call's recipient type the
>>>> digits in.
>>>>
>>>>
>>>> On Tue, Mar 16, 2010 at 9:07 PM, Aloysius Lloyd <<lloyd.aloysius at gmail.com>
>>>> lloyd.aloysius at gmail.com> wrote:
>>>>
>>>>> here is the test script I used
>>>>>
>>>>> session:answer();
>>>>> digits = session:playAndGetDigits(1, 4, 1, 5000, "#",
>>>>> "enter-digits.wav", "", "\\d+");
>>>>>
>>>>> Here is the console log
>>>>>
>>>>> 2010-03-17 01:04:50.374761 [DEBUG] switch_ivr_play_say.c:1444 done
>>>>> playing file
>>>>> *2010-03-17 01:04:50.874736 [DEBUG] switch_rtp.c:2417 RTP RECV DTMF
>>>>> 1:800*
>>>>> *2010-03-17 01:04:51.104725 [DEBUG] switch_rtp.c:2417 RTP RECV DTMF
>>>>> 2:640*
>>>>> *2010-03-17 01:04:51.414710 [DEBUG] switch_rtp.c:2417 RTP RECV DTMF
>>>>> 3:800*
>>>>> *2010-03-17 01:04:51.774692 [DEBUG] switch_rtp.c:2417 RTP RECV DTMF
>>>>> 4:640*
>>>>> 2010-03-17 01:04:51.774692 [DEBUG] switch_ivr_play_say.c:1737 Test
>>>>> Regex [1234][\d+]
>>>>>
>>>>> You may have some issue with the provider. Check using a local
>>>>> extension.
>>>>>
>>>>>
>>>>> On Tue, Mar 16, 2010 at 8:51 PM, Michael De Lorenzo <<delorenzodesign at gmail.com>
>>>>> delorenzodesign at gmail.com> wrote:
>>>>>
>>>>>> Ok, I updated the console log level, and there are no DTMF values
>>>>>> being detected:
>>>>>>
>>>>>> 4268 -> 74.51.38.156 port 15150 codec: 0 ms: 20
>>>>>> 2010-03-16 20:49:06.534030 [DEBUG] switch_rtp.c:1181 Starting timer
>>>>>> [soft] 160 bytes per 20ms
>>>>>> 2010-03-16 20:49:06.535030 [NOTICE] sofia_glue.c:3128 Pre-Answer
>>>>>> sofia/external/19736327407!
>>>>>> 2010-03-16 20:49:13.762610 [DEBUG] sofia.c:4139 Channel
>>>>>> sofia/external/19736327407 entering state [completing][200]
>>>>>> 2010-03-16 20:49:13.762610 [DEBUG] sofia.c:4150 Remote SDP:
>>>>>> v=0
>>>>>> o=root 21648 21649 IN IP4 74.51.38.156
>>>>>> s=session
>>>>>> c=IN IP4 74.51.38.156
>>>>>> t=0 0
>>>>>> m=audio 15150 RTP/AVP 0 101
>>>>>> a=rtpmap:0 PCMU/8000
>>>>>> a=rtpmap:101 telephone-event/8000
>>>>>> a=fmtp:101 0-16
>>>>>> a=silenceSupp:off - - - -
>>>>>> a=ptime:20
>>>>>>
>>>>>> 2010-03-16 20:49:13.762610 [DEBUG] sofia.c:4139 Channel
>>>>>> sofia/external/19736327407 entering state [ready][200]
>>>>>> 2010-03-16 20:49:13.763613 [NOTICE] sofia.c:4663 Channel
>>>>>> [sofia/external/19736327407] has been answered
>>>>>> 2010-03-16 20:49:13.763613 [DEBUG] switch_ivr_originate.c:3107
>>>>>> Originate Resulted in Success: [sofia/external/19736327407]
>>>>>> 2010-03-16 20:49:13.763613 [DEBUG] switch_cpp.cpp:497
>>>>>> (sofia/external/19736327407) State Change CS_CONSUME_MEDIA ->
>>>>>> CS_SOFT_EXECUTE
>>>>>> 2010-03-16 20:49:13.763613 [DEBUG] switch_core_session.c:1018 Send
>>>>>> signal sofia/external/19736327407 [BREAK]
>>>>>> 2010-03-16 20:49:13.764618 [DEBUG] switch_ivr_play_say.c:1178 Codec
>>>>>> Activated L16 at 8000hz 1 channels 20ms
>>>>>> 2010-03-16 20:49:13.764618 [DEBUG] switch_core_state_machine.c:314
>>>>>> (sofia/external/19736327407) Running State Change CS_SOFT_EXECUTE
>>>>>> 2010-03-16 20:49:13.764618 [DEBUG] switch_core_state_machine.c:354
>>>>>> (sofia/external/19736327407) State SOFT_EXECUTE
>>>>>> 2010-03-16 20:49:13.764618 [DEBUG] mod_sofia.c:510 SOFIA SOFT_EXECUTE
>>>>>> 2010-03-16 20:49:13.764618 [DEBUG] switch_core_state_machine.c:200
>>>>>> sofia/external/19736327407 Standard SOFT_EXECUTE
>>>>>> 2010-03-16 20:49:13.764618 [DEBUG] switch_core_state_machine.c:354
>>>>>> (sofia/external/19736327407) State SOFT_EXECUTE going to sleep
>>>>>> 2010-03-16 20:49:13.794735 [DEBUG] switch_rtp.c:2055 Correct ip/port
>>>>>> confirmed.
>>>>>> 2010-03-16 20:49:25.055402 [DEBUG] switch_ivr_play_say.c:1470 done
>>>>>> playing file
>>>>>> 2010-03-16 20:49:30.074803 [INFO] switch_cpp.cpp:1142 Digits received
>>>>>> during call from playAndGetDigits:
>>>>>> 2010-03-16 20:49:30.074803 [INFO] switch_cpp.cpp:1142 Did this check
>>>>>> out? no
>>>>>>
>>>>>>
>>>>>> On Tue, Mar 16, 2010 at 8:37 PM, Aloysius Lloyd <<lloyd.aloysius at gmail.com>
>>>>>> lloyd.aloysius at gmail.com> wrote:
>>>>>>
>>>>>>> set the console log level to 7. Then you can see the DTMF values in
>>>>>>> console log , while you are pressing the keys.
>>>>>>>
>>>>>>> Lloyd
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Mar 16, 2010 at 8:23 PM, Michael De Lorenzo <<delorenzodesign at gmail.com>
>>>>>>> delorenzodesign at gmail.com> wrote:
>>>>>>>
>>>>>>>> So I tried Michael's suggestion of:
>>>>>>>>
>>>>>>>> digits = session:playAndGetDigits(1, 4, 1, 5000, "#",
>>>>>>>> get_digits_message, "", "\\d+");
>>>>>>>>
>>>>>>>> but it still didn't detect that I had pressed any keys.  What would
>>>>>>>> cause this?  Is there someplace I can check to see if anything at all is
>>>>>>>> being detected?
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Mar 16, 2010 at 5:00 PM, Michael Collins <<msc at freeswitch.org>
>>>>>>>> msc at freeswitch.org> wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Tue, Mar 16, 2010 at 1:21 PM, Michael De Lorenzo <<delorenzodesign at gmail.com>
>>>>>>>>> delorenzodesign at gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> I'm having some trouble getting consistent results with
>>>>>>>>>> playAndGetDigits, sometimes the digits are record and other times they're
>>>>>>>>>> not.  It seemed to have something to do with how quickly the digits were
>>>>>>>>>> pressed, but now that no longer seems to be the case.
>>>>>>>>>>
>>>>>>>>>> I'm trying to have users press a confirmation code, in this case
>>>>>>>>>> "1111" although I'd like to make it accept "1" or "11" or "111" or "1111" if
>>>>>>>>>> possible.
>>>>>>>>>>
>>>>>>>>>> Can anyone point me in the right direction?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>     session =
>>>>>>>>>> freeswitch.Session("{ignore_early_media=true}sofia/gateway/" .. provider ..
>>>>>>>>>> "/1" .. number_to_call);
>>>>>>>>>>
>>>>>>>>>>     while(session:ready()) do
>>>>>>>>>>        session:answer();
>>>>>>>>>>        session:setInputCallback("onInput","true");
>>>>>>>>>>
>>>>>>>>>>        --playbackMessage(check_message);
>>>>>>>>>>        digits = session:playAndGetDigits(4, 4, 1, 5000, "",
>>>>>>>>>> get_digits_message, "", "[1]");
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> You are specifying a minimum of four and a maximum of four digits.
>>>>>>>>> Also, your regex will match any string that has a digit 1 in it, which may
>>>>>>>>> or may not be what you are looking for. Lastly, you haven't specified a
>>>>>>>>> terminator key (like "#") but you are giving the user only one try and
>>>>>>>>> waiting 5000ms for the entry. Try something like this:
>>>>>>>>>
>>>>>>>>> digits = session:playAndGetDigits(1, 4, 1, 5000, "#",
>>>>>>>>> get_digits_message, "", "\\d+");
>>>>>>>>>
>>>>>>>>> Let us know if that works. Oh, one other thing: you might want to
>>>>>>>>> add an invalid message because playAndGetDigits will handle invalid input
>>>>>>>>> for you.
>>>>>>>>> -MC
>>>>>>>>>
>>>>>>>>> P.S. - This topic is covered in greater detail in Chapter 7 of the
>>>>>>>>> upcoming FreeSWITCH book. ;)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>        freeswitch.consoleLog("info", digits .. "\n");
>>>>>>>>>>        freeswitch.consoleLog("info", "Did this check out? " ..
>>>>>>>>>> (check_message == true and "yes" or "no" .. "\n"));
>>>>>>>>>>
>>>>>>>>>>        -- we got what we're looking for, so we can end this
>>>>>>>>>>        if(check_success) then
>>>>>>>>>>           freeswitch.consoleLog("info", "A positive response was
>>>>>>>>>> received from this check.\n");
>>>>>>>>>>           break;
>>>>>>>>>>        else
>>>>>>>>>>           -- not a positive response
>>>>>>>>>>           -- if we reached our max attempts, we're finished move
>>>>>>>>>> on
>>>>>>>>>>           if(attempts == max_attempts) then
>>>>>>>>>>             freeswitch.consoleLog("info", "We've reached our
>>>>>>>>>> maximum attempts for this number.\n");
>>>>>>>>>>             break;
>>>>>>>>>>           end
>>>>>>>>>>        end
>>>>>>>>>>     end
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> FreeSWITCH-users mailing list
>>>>>>>>>  <FreeSWITCH-users at lists.freeswitch.org>
>>>>>>>>> FreeSWITCH-users at lists.freeswitch.org
>>>>>>>>>  <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>
>>>>>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>>>>>> UNSUBSCRIBE:<http://lists.freeswitch.org/mailman/options/freeswitch-users>
>>>>>>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>>>>>>  <http://www.freeswitch.org>http://www.freeswitch.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> FreeSWITCH-users mailing list
>>>>>>>>  <FreeSWITCH-users at lists.freeswitch.org>
>>>>>>>> FreeSWITCH-users at lists.freeswitch.org
>>>>>>>>  <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>
>>>>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>>>>> UNSUBSCRIBE:<http://lists.freeswitch.org/mailman/options/freeswitch-users>
>>>>>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>>>>>  <http://www.freeswitch.org>http://www.freeswitch.org
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> FreeSWITCH-users mailing list
>>>>>>>  <FreeSWITCH-users at lists.freeswitch.org>
>>>>>>> FreeSWITCH-users at lists.freeswitch.org
>>>>>>>  <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>
>>>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>>>> UNSUBSCRIBE:<http://lists.freeswitch.org/mailman/options/freeswitch-users>
>>>>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>>>>  <http://www.freeswitch.org>http://www.freeswitch.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> FreeSWITCH-users mailing list
>>>>>>  <FreeSWITCH-users at lists.freeswitch.org>
>>>>>> FreeSWITCH-users at lists.freeswitch.org
>>>>>>  <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>
>>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>>> UNSUBSCRIBE:<http://lists.freeswitch.org/mailman/options/freeswitch-users>
>>>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>>>  <http://www.freeswitch.org>http://www.freeswitch.org
>>>>>>
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> FreeSWITCH-users mailing list
>>>>>  <FreeSWITCH-users at lists.freeswitch.org>
>>>>> FreeSWITCH-users at lists.freeswitch.org
>>>>>  <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>
>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>> UNSUBSCRIBE:<http://lists.freeswitch.org/mailman/options/freeswitch-users>
>>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>>  <http://www.freeswitch.org>http://www.freeswitch.org
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> FreeSWITCH-users mailing list
>>>>  <FreeSWITCH-users at lists.freeswitch.org>
>>>> FreeSWITCH-users at lists.freeswitch.org
>>>>  <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>
>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>> UNSUBSCRIBE:<http://lists.freeswitch.org/mailman/options/freeswitch-users>
>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>  <http://www.freeswitch.org>http://www.freeswitch.org
>>>>
>>>>
>>>
>>> _______________________________________________
>>> FreeSWITCH-users mailing list
>>>  <FreeSWITCH-users at lists.freeswitch.org>
>>> FreeSWITCH-users at lists.freeswitch.org
>>>  <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:<http://lists.freeswitch.org/mailman/options/freeswitch-users>
>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>  <http://www.freeswitch.org>http://www.freeswitch.org
>>>
>>>
>> _______________________________________________
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>>
>> _______________________________________________
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100317/5d0d9230/attachment-0002.html 


More information about the FreeSWITCH-users mailing list