I am making the following script for freeswitch:
- Create a challenge (a-leg)
- Create another call (b-leg)
- Bridge then together
A two-legged telephone is a subscriber group in another freeswitch mode:
<extension name="EarlyMedia"> <condition field="destination_number" expression="^[+]?[1]?<MY_NUMBER>"> <action application="pre_answer"/> <action application="playback" data="/home/ubuntu/EARLY_MEDIA.wav"/> <action application="sleep" data="1000"/> <action application="answer"/> <action application="playback" data="/home/ubuntu/CALL_MEDIA.wav"/> <action application="sleep" data="1000"/> </condition> </extension>
The sequence of commands sent to freeswitch is as follows:
bgapi originate {ignore_early_media=true,bridge_early_media=false,origination_caller_id_number=sofia/external/<MY_FROM_NUMBER>@<MY_IP>,origination_channel_name=<MY_CHANNEL>,ringback=\'%(2000,4000,440,480)\'}sofia/external/<A-LEG NUMBER>@<MY_IP> &park()
bgapi originate {ignore_early_media=true,bridge_early_media=false,origination_caller_id_number=sofia/external/<MY_FROM_NUMBER>@<MY_IP>,origination_channel_name=<MY_CHANNEL>,ringback=\'%(2000,4000,440,480)\'}sofia/external/<B-LEG NUMBER>@<MY_IP> &park()
bgapi uuid_bridge <A-LEG UUID> <B-LEG UUID>
The problem is that even with ignore_early_media = true, bridge_early_media = false , I hear early media on A-LEG
source share