[Freeswitch-users] ESL Outbound: how to bridge media?

Stephen Wilde wstephen80 at gmail.com
Tue Feb 15 12:48:54 MSK 2011


I have tried to wait originate completition but the "uuid_bridge" doesn't
works also in this case.

It seems that works only when at least one leg is answered so it's not
possible to do the "uuid_bridge" during progressing phase also if the
originate has ended (I don't set the ignore_early_media).

My application is this: http://pastebin.freeswitch.org/15387

The application:

1. receive a call with an "inbound_uuid"

2. create a new "outbound_uuid"

3. do a "bgapi originate" using the new "outbound_uuid"

4. when the called phone is ringing, receive a "CHANNEL_PROGRESS_MEDIA"
event on "outbound_uuid" and do a "pre_answer" on "inbound_uuid"

5. receive a "CHANNEL_PROGRESS_MEDIA" on "inbound_uuid"

6. receive a job completition event related to the "originate" so issue an
"uuid_bridge inbound_uuid outbound_uuid"

7. when a job completition event related to "uuid_bridge" is received, no
audio flow from outbound to inbound channel

8. when outbound answer the call, the application answer also the inbound
call but no audio flow in both directions

If I do the uuid_bridge after legB answer, then all is ok (obviously with no
audio during progressing phase).


The log of my application is:

[ERROR] newacme.cpp:46 mycallback() Connected!
[ERROR] newacme.cpp:65 mycallback() Inbound uuid =
8b2c39db-1ad9-489c-b72f-a92d4087bf99
[ERROR] newacme.cpp:68 mycallback() create_uuid:
394167aa-2811-4fcd-95c9-85576bdd9a7a
[ERROR] newacme.cpp:89 mycallback() bgapi originate
[origination_uuid=394167aa-2811-4fcd-95c9-85576bdd9a7a]sofia/external/xxxx at yyyy&park()
[ERROR] newacme.cpp:91 mycallback() Job-ID:
1c654ac2-c22d-418f-9fad-bb6b6b35aeff
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_UUID]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_OUTGOING]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_ORIGINATE]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_STATE]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_CALLSTATE]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_STATE]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_STATE]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CALL_UPDATE]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] - [CODEC]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] - [CODEC]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_CALLSTATE]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_PROGRESS_MEDIA]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_STATE]
[ERROR] newacme.cpp:112 mycallback() Got an event: [BACKGROUND_JOB] -
[1c654ac2-c22d-418f-9fad-bb6b6b35aeff]
[ERROR] newacme.cpp:119 mycallback() bgapi uuid_bridge
8b2c39db-1ad9-489c-b72f-a92d4087bf99 394167aa-2811-4fcd-95c9-85576bdd9a7a
[ERROR] newacme.cpp:123 mycallback() Job-ID:
0d43cffe-fdc6-4a13-97e6-aeee199c45d5
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_EXECUTE]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_PARK]
[ERROR] newacme.cpp:112 mycallback() Got an event: [BACKGROUND_JOB] -
[0d43cffe-fdc6-4a13-97e6-aeee199c45d5]
[ERROR] newacme.cpp:167 mycallback() Got an event: [INBOUND] -
[CHANNEL_EXECUTE]
[ERROR] newacme.cpp:167 mycallback() Got an event: [INBOUND] -
[CHANNEL_CALLSTATE]
[ERROR] newacme.cpp:167 mycallback() Got an event: [INBOUND] -
[CHANNEL_PROGRESS_MEDIA]
[ERROR] newacme.cpp:167 mycallback() Got an event: [INBOUND] -
[CHANNEL_EXECUTE_COMPLETE]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CALL_UPDATE]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_CALLSTATE]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_ANSWER]
[ERROR] newacme.cpp:167 mycallback() Got an event: [INBOUND] -
[CHANNEL_EXECUTE]
[ERROR] newacme.cpp:167 mycallback() Got an event: [INBOUND] -
[CHANNEL_CALLSTATE]
[ERROR] newacme.cpp:167 mycallback() Got an event: [INBOUND] -
[CHANNEL_ANSWER]
[ERROR] newacme.cpp:167 mycallback() Got an event: [INBOUND] -
[CHANNEL_EXECUTE_COMPLETE]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_CALLSTATE]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_HANGUP]
[ERROR] newacme.cpp:160 mycallback() hangup
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_UNPARK]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_EXECUTE_COMPLETE]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_STATE]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_STATE]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_HANGUP_COMPLETE]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_DESTROY]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_CALLSTATE]
[ERROR] newacme.cpp:138 mycallback() Got an event: [OUTBOUND] -
[CHANNEL_STATE]
[ERROR] newacme.cpp:167 mycallback() Got an event: [INBOUND] -
[CHANNEL_EXECUTE]
[ERROR] newacme.cpp:167 mycallback() Got an event: [INBOUND] -
[CHANNEL_CALLSTATE]
[ERROR] newacme.cpp:167 mycallback() Got an event: [INBOUND] -
[CHANNEL_HANGUP]
[ERROR] newacme.cpp:171 mycallback() hangup
[ERROR] newacme.cpp:167 mycallback() Got an event: [INBOUND] -
[CHANNEL_EXECUTE_COMPLETE]
[ERROR] newacme.cpp:167 mycallback() Got an event: [INBOUND] -
[CHANNEL_UNPARK]
[ERROR] newacme.cpp:167 mycallback() Got an event: [INBOUND] -
[CHANNEL_EXECUTE_COMPLETE]
[ERROR] newacme.cpp:167 mycallback() Got an event: [INBOUND] -
[CHANNEL_STATE]
[ERROR] newacme.cpp:184 mycallback() End.


Stephen


On Tue, Feb 15, 2011 at 1:14 AM, Anthony Minessale <
anthony.minessale at gmail.com> wrote:

> if you do originate without ignore_early_media=true set it will end
> the soonest possible where it's suitable for a bridge.
> so that is the best bet to wait for originate to end.
>
>
> On Mon, Feb 14, 2011 at 6:11 PM, Stephen Wilde <wstephen80 at gmail.com>
> wrote:
> > Ok, now I'm doing bridge when I receive "CHANNEL_ANSWER" or
> > "CHANNEL_PROGRESS_MEDIA" on outbound leg but you say that I have wait
> that
> > "originate has ended": you mean that I have to wait for "BACKGROUND_JOB"
> > event related to my "bgapi originate ... &park"?
> > I'm already doing "uuid_bridge <inbound_uuid> <outbound_uuid>".
> > I'll try also with intercept and inline originate. Thank you!
> > Stephen
> >
> > On Tue, Feb 15, 2011 at 12:53 AM, Anthony Minessale
> > <anthony.minessale at gmail.com> wrote:
> >>
> >> you need to make sure originate has ended on the outbound leg before
> >> you use it in a bridge etc.
> >> you also need to supply the inbound leg first in uuid_bridge if that
> >> is something you want to do.
> >>
> >> Easier would be to originate the B leg to park inline and tell A leg
> >> to execute intercept on the B leg uuid.
> >>
> >>
> >>
> >> On Mon, Feb 14, 2011 at 5:44 PM, Stephen Wilde <wstephen80 at gmail.com>
> >> wrote:
> >> > Sorry but I have missed something.
> >> > I know that I can solve this problem directly in dialplan with a
> bridge
> >> > but
> >> > what I'm doing is an "Freeswitch ESL learning" because I have to port
> >> > some
> >> > application in Freeswitch and I'm learning how to implement some
> >> > functionality.
> >> > For me it's important to take control of both inbound/outbound in full
> >> > async
> >> > way and I have the necessity to do the complete call control.
> >> > I'm not sure but to me it seems that with a normal bridge I lose the
> >> > control
> >> > of two sessions, for example, an outbound answer is propagated by
> bridge
> >> > application as inbound answer.
> >> > What I want to do is an audio bridging so my application can take
> >> > control of
> >> > "signaling bridging".
> >> >
> >> > I'm wrong? There are other way to do that?
> >> > Stephen
> >> > On Tue, Feb 15, 2011 at 12:19 AM, Michael Collins <msc at freeswitch.org
> >
> >> > wrote:
> >> >>
> >> >> My head is spinning after reading this email. :)
> >> >> It sounds like you just need a simple bridge from the incoming leg to
> >> >> the
> >> >> outgoing leg. Can you pre_answer the A leg then execute a good
> >> >> old-fashioned
> >> >> bridge to the b-leg?
> >> >> -MC
> >> >> On Mon, Feb 14, 2011 at 4:57 PM, Stephen Wilde <wstephen80 at gmail.com
> >
> >> >> wrote:
> >> >>>
> >> >>> The problem I have is to propagate the audio coming from an
> >> >>> "originated"
> >> >>> outbound session to the inbound session when the outbound is in the
> >> >>> PROGRESS
> >> >>> MEDIA phase.
> >> >>> When my application receives the "CHANNEL_PROGRESS_MEDIA" event from
> >> >>> outbound session I can do a "pre_answer" on inbound session but I'm
> >> >>> not
> >> >>> capable to do an audio bridge.
> >> >>> I have tried with "uuid_bridge <outbound_uuid> <inbound_uuid>" with
> no
> >> >>> result probably because this api requires that at least one session
> >> >>> must be
> >> >>> answered.
> >> >>> I don't want to answer to the inbound session to propagate the
> >> >>> outbound
> >> >>> progressing media but I want to answer to inbound only on outbound
> >> >>> answer.
> >> >>> Any way to do that?
> >> >>> Stephen
> >> >>> _______________________________________________
> >> >>> 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
> >> >
> >> >
> >>
> >>
> >>
> >> --
> >> 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
> >>
> >> _______________________________________________
> >> 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
> >
> >
>
>
>
> --
> 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
>
> _______________________________________________
> 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/20110215/83f07060/attachment-0001.html 


More information about the FreeSWITCH-users mailing list