[Freeswitch-users] event BACKGROUND too late in ORIGINATE scenario?

Cesar Cepeda cesar at auronix.com
Mon Apr 14 09:58:29 PDT 2008


Hi

I solved the exact same issue by setting an identifying variable on the
channel when originating the call

   Bgapi originate {myVar=MyID}sofia/profile/dest

You can parse that variable on the CHANNEL_ANSWER event or CHANNEL_HANGUP

Bye.

Cesar Cepeda.


> -----Mensaje original-----
> De: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-
> users-bounces at lists.freeswitch.org] En nombre de UV
> Enviado el: Lunes, 14 de Abril de 2008 10:40
> Para: freeswitch-users at lists.freeswitch.org
> Asunto: [Freeswitch-users] event BACKGROUND too late in ORIGINATE
> scenario?
> 
> We're busy integrating a heavy-duty call-control engine on top of the
> Freeswitch and I'm not sure if what's happening is by design or a bug:
> 
> When originating a call via the "bgapi originate" call (mod_commands)
> the
> BACKGROUND event invoked only AFTER the call successfully terminated
> (answered/rejected).
> Because only the BACKGROUND event has the correlation between the JOB-
> UUID
> of the BGAPI command and the UNIQUE-ID, it's impossible to intercept
> all the
> events until that point (create, outgoing, ring, codec-exchange, etc).
> 
> This becomes a real problem when originating multiple calls in a short
> time.
> It's impossible to distinguish which event belongs to which origination
> request. Resorting to pull that info from the DB or through SHOW
> CHANNELS
> might still cost missing few events.
> 
> Anyone has any ideas on how to track an ORIGINATE call setup flow?
> 
> 
> Here's an extract from the log (just took the relevant parts):
> bgapi originate sofia/default/1001 &park
> 
> Reply-Text: +OK Job-UUID: <UUID-A>
> 
> Channel-State: CS_NEW
> Unique-ID: <UUID-B>
> Event-Name: CHANNEL_CREATE
> 
> Channel-State: CS_INIT
> Unique-ID: <UUID-B>
> Event-Name: CHANNEL_OUTGOING
> 
> Channel-State: CS_INIT
> Unique-ID: <UUID-B>
> Event-Name: CHANNEL_ORIGINATE
> 
> Channel-State: CS_INIT
> Unique-ID: <UUID-B>
> Event-Name: CHANNEL_STATE
> 
> Channel-State: CS_RING
> Unique-ID: <UUID-B>
> Event-Name: PRESENCE_IN
> 
> Channel-State: CS_RING
> Unique-ID: <UUID-B>
> Event-Name: CHANNEL_STATE
> 
> Channel-State: CS_HOLD
> Unique-ID: <UUID-B>
> Event-Name: PRESENCE_IN
> 
> Channel-State: CS_HOLD
> Unique-ID: <UUID-B>
> Event-Name: CHANNEL_STATE
> 
> Channel-State: CS_HOLD
> Unique-ID: <UUID-B>
> Event-Name: CODEC
> 
> Channel-State: CS_HOLD
> Unique-ID: <UUID-B>
> Event-Name: CODEC
> 
> Channel-State: CS_HOLD
> Unique-ID: <UUID-B>
> Event-Name: CHANNEL_ANSWER
> 
> API-Command: originate
> Event-Name: API
> 
> Job-UUID: <UUID-A>
> Job-Command: originate
> Event-Name: BACKGROUND_JOB
> +OK <UUID-B>
> 
> Channel-State: CS_EXECUTE
> Unique-ID: <UUID-B>
> Event-Name: PRESENCE_IN
> 
> Channel-State: CS_EXECUTE
> Unique-ID: <UUID-B>
> Event-Name: CHANNEL_STATE
> 
> Thanks,
> UV
> 
> No virus found in this outgoing message.
> Checked by AVG.
> Version: 7.5.519 / Virus Database: 269.22.12 - Release Date: 10-Apr-08
> 12:00
> AM
> 
> 
> 
> _______________________________________________
> 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





More information about the FreeSWITCH-users mailing list