[Freeswitch-users] event BACKGROUND too late inORIGINATEscenario?

UV uv at talknet.com.au
Mon Apr 14 11:15:37 PDT 2008


Excellent.

So just to clarify, from the “Event-Name: CHANNEL_ORIGINATE” event, every
thereafter will include the custom variable_{vars}. According to this, I’d
only miss the two Event-Names: CHANNEL_CREATE and CHANNEL_OUTGOING (which I
don’t really need).

 

Thanks!

 

   _____  

From: freeswitch-users-bounces at lists.freeswitch.org
[mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Anthony
Minessale
Sent: Tuesday, April 15, 2008 3:31 AM
To: freeswitch-users at lists.freeswitch.org
Subject: Re: [Freeswitch-users] event BACKGROUND too late
inORIGINATEscenario?

 

I looked at the code and there is really only one place i can push the
variables in sooner and that is before the CHANNEL_ORGINATE event.  This
event is fired as soon as the channel is created while it's waiting for it
to ring etc.  I moved the code that adds the variables from the {foo=bar} to
right before this event.  This is the earliest event you will be able to
track an outbound call that you initiated.  Any others that do not contain
your param must be discarded because there is no way to get your information
into the channel any sooner in the lifecycle of the channel.  

The change is in trunk so you will get that along with the other updates
when we commit the fix to windows build.

Note you can also pick your own job-uuid by adding the job-uuid header to
your request using this with the suggestion the other guy gave you you can
sync them

api originate {my_uuid=ABC1234}sofia/default/HYPERLINK
"mailto:1000 at domain.com"1000 at domain.com
job-uuid: ABC1234

This will add the variable_my_uuid line to every event set to ABC1234 and
the final job_uuid in the BACKGROUND event will also be ABC1234







On Mon, Apr 14, 2008 at 12:08 PM, UV <HYPERLINK
"mailto:uv at talknet.com.au"uv at talknet.com.au> wrote:

Thanks, Michael!
Your advise seemed to be a workaround to most events although not all
(missing some new, init and few others).

I'll update to the newest version as soon as there's a fix for the win32
build (doesn't work for me either).

Btw, Will that little race fixing allow me to correlate the BGPAI JOB-UUID
to these missing events? It's not that I don't get those events - I just
don't know what request initiated them...

Cheers,
UV



-----Original Message-----
From: HYPERLINK
"mailto:freeswitch-users-bounces at lists.freeswitch.org"freeswitch-users-bounc
es at lists.freeswitch.org
[mailto:HYPERLINK
"mailto:freeswitch-users-bounces at lists.freeswitch.org"freeswitch-users-bounc
es at lists.freeswitch.org] On Behalf Of Michael
Jerris
Sent: Tuesday, April 15, 2008 2:30 AM
To: HYPERLINK
"mailto:freeswitch-users at lists.freeswitch.org"freeswitch-users at lists.freeswi
tch.org
Subject: Re: [Freeswitch-users] event BACKGROUND too late in
ORIGINATEscenario?

You can set your own unique id reference as a variable to the
originate using the {my_uuid=1234567ABCD} syntax and then track all
events off that variable that should be included on every event.

HYPERLINK "http://wiki.freeswitch.org/wiki/Freeswitch_IVR_Originate"
\nhttp://wiki.freeswitch.org/wiki/Freeswitch_IVR_Originate

Also, we just fixed a little race that might have allowed you to get
events before you got the background uuid so you probably want to
update to most recent code.

Mike


On Apr 14, 2008, at 11:39 AM, UV wrote:

> 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
> HYPERLINK
"mailto:Freeswitch-users at lists.freeswitch.org"Freeswitch-users at lists.freeswi
tch.org
> HYPERLINK "http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
\nhttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:HYPERLINK
"http://lists.freeswitch.org/mailman/options/freeswitch-users"
\nhttp://lists.freeswitch.org/mailman/options/freeswitch-users
> HYPERLINK "http://www.freeswitch.org" \nhttp://www.freeswitch.org


_______________________________________________
Freeswitch-users mailing list
HYPERLINK
"mailto:Freeswitch-users at lists.freeswitch.org"Freeswitch-users at lists.freeswi
tch.org
HYPERLINK "http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
\nhttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:HYPERLINK
"http://lists.freeswitch.org/mailman/options/freeswitch-users"
\nhttp://lists.freeswitch.org/mailman/options/freeswitch-users
HYPERLINK "http://www.freeswitch.org" \nhttp://www.freeswitch.org

No virus found in this incoming message.

Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.12 - Release Date: 10-Apr-08 12:00
AM


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
HYPERLINK
"mailto:Freeswitch-users at lists.freeswitch.org"Freeswitch-users at lists.freeswi
tch.org
HYPERLINK "http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
\nhttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:HYPERLINK
"http://lists.freeswitch.org/mailman/options/freeswitch-users"
\nhttp://lists.freeswitch.org/mailman/options/freeswitch-users
HYPERLINK "http://www.freeswitch.org" \nhttp://www.freeswitch.org




-- 
Anthony Minessale II

FreeSWITCH HYPERLINK "http://www.freeswitch.org/"http://www.freeswitch.org/
ClueCon HYPERLINK "http://www.cluecon.com/"http://www.cluecon.com/

AIM: anthm
HYPERLINK
"mailto:MSN%3Aanthony_minessale at hotmail.com"MSN:anthony_minessale at hotmail.co
m
GTALK/JABBER/HYPERLINK
"mailto:PAYPAL%3Aanthony.minessale at gmail.com"PAYPAL:anthony.minessale at gmail.
com
IRC: HYPERLINK "http://irc.freenode.net"irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
HYPERLINK
"mailto:sip%3A888 at conference.freeswitch.org"sip:888 at conference.freeswitch.or
g
HYPERLINK
"http://iax:guest@conference.freeswitch.org/888"iax:guest@conference.freeswi
tch.org/888
HYPERLINK
"mailto:googletalk%3Aconf%2B888 at conference.freeswitch.org"googletalk:conf+88
8 at conference.freeswitch.org
pstn:213-799-1400 

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.12 - Release Date: 10-Apr-08 12:00
AM


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
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080415/9d5d3b00/attachment-0002.html 


More information about the FreeSWITCH-users mailing list