[Freeswitch-users] mod_managed - how listen for *999

Chris freeswitch at gilligan.id.au
Wed Mar 10 13:42:40 PST 2010


Thanks Phillip! That worked perfectly for some reason.  I mean it was hardly
different from mine and i still can't spot the fault in my own code.  very
strange.


On Thu, Mar 11, 2010 at 12:42 AM, Phillip Jones <pjintheusa at gmail.com>wrote:

> There should be no problem on digit capture on an outgoing call. For
> example - when I originate a call, I ask the called party, for example, to
> press 1 to accept the call. This works correctly:
>
> BLegSession.DtmfReceivedFunction = (d, t) =>
>                 {
>                     Log.WriteLine(LogLevel.Info, "Received {0} for {1}.",
> d, t);
>                     if (d == confirmationDigit)
>                     {
>                         confirmed = true;
>                         return "break";
>                     }
>
>                     return "";
>                 };
>
>                 while (!confirmed && BLegSession != null &&
> BLegSession.Ready() && BLegSession.mediaReady() && loop <= loops)
>                 {
>                     loop++;
>
>                     if (!confirmed && BLegSession != null &&
> BLegSession.Ready() && BLegSession.mediaReady())
>
> BLegSession.StreamFile("prompts/press-1-to-accept-call-from.wav", 0);
>
>                     if (!confirmed && BLegSession != null &&
> BLegSession.Ready() && BLegSession.mediaReady())
>                         BLegSession.CollectDigits(5000);
>
>                 }
>
> If you are not receiving the digits - I would try and bridge the oubound
> call to an existing call and check that you are getting two way audio - and
> if you are using inband DTMF -  that you can actually hear the digits.
>
> HTH
>
>
>
> On Wed, Mar 10, 2010 at 7:02 AM, Chris <freeswitch at gilligan.id.au> wrote:
>
>> Thanks for the idea i will try that next. I thought i would try to capture
>> the digits like normal first to make sure everything is working right and to
>> test a few event capture methods.  What i found was that mod_managed never
>> seemed to capture or read any digits for an out going call.  If i pass the
>> call to a different application/dial plan it captures the digits perfectly.
>>  I assume audio was working as it played audio to the user to enter digits
>> so i figure i have not configured something correctly but i have not idea
>> what it is.  Until i work it out i don't think any event code will work.
>>
>> I have no idea what is wrong in this case or even how to debug it.
>>
>> Chris
>>
>>
>> On Wed, Mar 10, 2010 at 1:31 PM, Phillip Jones <pjintheusa at gmail.com>wrote:
>>
>>> One way might be to create an event loop and listen for DTMF
>>>
>>> public bool Load()
>>>         {
>>>             ThreadPool.QueueUserWorkItem((o) =>
>>>             {
>>>                 Log.WriteLine(LogLevel.Notice, "Thread Starting. ");
>>>                 EventConsumer con = new EventConsumer("DTMF", "");
>>>                 while (true)
>>>                 {
>>>                     Event ev = con.pop(1);
>>>                     if (ev != null)
>>>                     {
>>>                                   ... do what ever needs to be done
>>>                     }
>>>
>>>                 }
>>>             });
>>>
>>> See http://wiki.freeswitch.org/wiki/Event_List#DTMF
>>>
>>> I am guessing the DTMF is "DTMF" so play around with that if it does not
>>> work.
>>>
>>> There are probably better ways.
>>>
>>>
>>>
>>> On Tue, Mar 9, 2010 at 5:27 AM, Chris <freeswitch at gilligan.id.au> wrote:
>>>
>>>> What i need to do is listen on a session before, during and after the
>>>> session is bridged with another call. I know built into FS is the option to
>>>> listen for *x where x is 0-9 but i really need more than one digit.
>>>>
>>>> I traced the method that listens for the single digit to the
>>>> command switch_core_event_hook_add_send_dtmf(session, meta_on_dtmf); in
>>>> switch_ivr_async.c
>>>>
>>>> mod_managed also has the following in the native class freeswitch.
>>>> public static switch_status_t
>>>> switch_core_event_hook_add_recv_dtmf(SWIGTYPE_p_switch_core_session session,
>>>> SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_switch_dtmf_direction_t__switch_status_t
>>>> recv_dtmf)
>>>>
>>>> The problem is i can't work out how to use it.  I am fine the the first
>>>> param for the session but have no idea what i need for
>>>> the SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_switch_dtmf_direction_t__switch_status_t
>>>> recv_dtmf param.
>>>>
>>>> if anyone can point me in the right direction or knows a better way i
>>>> would be grateful.
>>>>
>>>> Chris
>>>>
>>>> _______________________________________________
>>>> 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
>>>
>>>
>>
>> _______________________________________________
>> 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/20100311/ddbdaa6b/attachment-0002.html 


More information about the FreeSWITCH-users mailing list