[Freeswitch-users] Question on switch_core_media_bug_add

Stephen Wilde wstephen80 at gmail.com
Tue Jul 16 00:42:46 MSD 2013


Thank you for this info, I'll try with switch_core_session_read_frame and
read directly the media.


On Mon, Jul 15, 2013 at 10:20 PM, Anthony Minessale <
anthony.minessale at gmail.com> wrote:

> Yes but then you have the session and you need to be making it do
> something so you can read from it.
> Really it sounds like you don't really need a media bug as much as a while
> loop waiting for it to be answered calling read_frame similar to how many
> other ivr apps do and you can read the media directly.  A media bug
> requires something to be doing constant reading on the channel to have
> something to tap into.
>
>
>
>
> On Mon, Jul 15, 2013 at 2:43 PM, Stephen Wilde <wstephen80 at gmail.com>wrote:
>
>> The channel is an outgoing channel created with originate in a C module
>> (inside a thread that read db and make the originate) with:
>>
>> status  = switch_ivr_originate(NULL, &session, &cause, dialstring, 60,
>> NULL, NULL, NULL, NULL, NULL, SOF_NO_LIMITS, NULL);
>>
>> where dialstring like "sofia/external/xxx at yyy"
>>
>> and when:
>>
>> channel = switch_core_session_get_channel(session);
>> switch_channel_test_flag(channel, CF_EARLY_MEDIA)
>>
>> I do:
>>
>> media = switch_core_media_bug_add(session, "myfunc", NULL, mycallback,
>> sth, 0, SMBF_READ_REPLACE, &bug);
>>
>> but 'mycallback' is called with type=SWITCH_ABC_TYPE_READ_REPLACE only
>> when the channel is answered and not during early media.
>>
>>
>>
>>
>>
>> On Mon, Jul 15, 2013 at 7:40 PM, Anthony Minessale <
>> anthony.minessale at gmail.com> wrote:
>>
>>> What is the channel doing during the early media that you are capturing.
>>> Did you transfer it somewhere or execute an application on it?
>>>
>>>
>>>
>>> On Mon, Jul 15, 2013 at 11:01 AM, Stephen Wilde <wstephen80 at gmail.com>wrote:
>>>
>>>> Hi all,
>>>> I'm trying to capture early media packets of an originated call without
>>>> success.
>>>>
>>>> I first call the:
>>>>       switch_ivr_originate() with ignore_early_media=false
>>>>
>>>> that returns success then I call the:
>>>>       switch_core_media_bug_add() with SMBF_READ_REPLACE
>>>>
>>>> that returns also success and also I see a call to my callback with:
>>>>       type=SWITCH_ABC_TYPE_INIT
>>>>
>>>> The problem is that during early media phase I don't see any call to my
>>>> media bug callback.
>>>> The callback is called only when the call is answered.
>>>>
>>>> Any idea on that? What is my error?
>>>>
>>>> Stephen
>>>>
>>>>
>>>>
>>>> _________________________________________________________________________
>>>> Professional FreeSWITCH Consulting Services:
>>>> consulting at freeswitch.org
>>>> http://www.freeswitchsolutions.com
>>>>
>>>> 
>>>> 
>>>>
>>>> Official FreeSWITCH Sites
>>>> http://www.freeswitch.org
>>>> http://wiki.freeswitch.org
>>>> http://www.cluecon.com
>>>>
>>>> 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
>>>>
>>>>
>>>
>>>
>>> --
>>> Anthony Minessale II
>>>
>>> FreeSWITCH http://www.freeswitch.org/
>>> ClueCon http://www.cluecon.com/
>>> Twitter: http://twitter.com/FreeSWITCH_wire
>>>
>>> AIM: anthm
>>> MSN:anthony_minessale at hotmail.com
>>> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
>>> IRC: irc.freenode.net #freeswitch
>>>
>>> FreeSWITCH Developer Conference
>>> sip:888 at conference.freeswitch.org
>>> googletalk:conf+888 at conference.freeswitch.org
>>> pstn:+19193869900
>>>
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>> 
>>> 
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://wiki.freeswitch.org
>>> http://www.cluecon.com
>>>
>>> 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
>>>
>>>
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> 
>> 
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://wiki.freeswitch.org
>> http://www.cluecon.com
>>
>> 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
>>
>>
>
>
> --
> Anthony Minessale II
>
> FreeSWITCH http://www.freeswitch.org/
> ClueCon http://www.cluecon.com/
> Twitter: http://twitter.com/FreeSWITCH_wire
>
> AIM: anthm
> MSN:anthony_minessale at hotmail.com
> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
> IRC: irc.freenode.net #freeswitch
>
> FreeSWITCH Developer Conference
> sip:888 at conference.freeswitch.org
> googletalk:conf+888 at conference.freeswitch.org
> pstn:+19193869900
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> 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/20130715/1fa368ea/attachment-0001.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list