问题描述:

FreeSWITCH (Version 1.7.0 -907-0b3f776 64bit)

I have been using Freeswitch Python ESL, but I noticed the following:

I created 2 calls using originate command:

originate {ignore_early_media=true,bridge_early_media=false,originate_timeout=24,call_timeout=24,execute_on_answer='sched_hangup 18',origination_uuid=5d56e91e-dfb7-4269-92cd-2967fa2d1d81,origination_caller_id_number=+18623079305}sofia/gateway/asterisk/+14084070000 handle_calls

Each call is created with a new ESL instance.

Flow:

API request -> HTTP -> Celery Task -> New ESL instance -> Send originate request.

I collected packet capture and ESL Logs and when a call is answered:

I started seeing duplicated EVENTS for CHANNEL_ANSWER over the same TCP Socket. I filtered using the SRC port, not the Freeswitch DST port. Further debugs shows that I'm receiving ALL events (The ones I subscribed) for ALL active calls.

When I subscribe to events should I receive ALL events for ALL calls over the same socket? Is this expected behavior?

Or am I supposed to receive only events of the instance of the call used by originate command?

events = "BACKGROUND_JOB " \

"CHANNEL_OUTGOING " \

"CHANNEL_CREATE " \

"CHANNEL_ANSWER " \

"RECORD_START " \

"CHANNEL_HANGUP " \

"CHAN_NOT_IMPLEMENTED "

self.connection.events("plain", events)

Right now I'm filtering using: Channel-Call-UUID, after I receive the event. Is this the best approach?

http://pastebin.com/8jwprN7M

相关阅读:
Top