Michael, Venky: First off, I would like to thank you guys for creating and open-sourcing such a great FreeSWITCH API. Cheers!
I have been playing on and off with Plivo for a few months now. Initially, it was just to try a cool new alternative to Asterisk. Then I set it up for my home telephony needs. I am currently using Plivo in a personal project and would love to recommend it to my bosses at work once I gain a little more understanding about how it works.
Although I am not a Python developer, I have worked
hard to troubleshoot an
early media issue. Here's a brief overview of how my web app uses Plivo:
- User X comes to my web app, provides their mobile number and hits call.
- I get a call on my softphone (a freeswitch extension). If I answer, the app proceeds to call the number given by X via a gsmopen channel and bridges the call. Code snippet:
<Dial callerId="9000" callerName="Tony" hangupOnStar="true" dialMusic="none" callbackUrl="<?php echo $dial_callback_url; ?>">
<Number gateways="gsmopen/gsm01/"><?php echo "+1".$number_to_call; ?></Number>
</Dial>
- If X answers, we can talk without any issues.
- The problem is that I am not able to get "early media" to work, i.e. I can not hear the ringtone, busy tone, or any other network message while the call is being tried. I know the default dialMusic plays a ring tone but I don't want that in case the number is wrong, busy, or has other network issues. I want to hear the actual network early media.
This happens only when placing a call via the Plivo API. When I dial an external number via my softphone connected directly to freeswitch, I can hear the "early media" just fine. I can see that Plivo Cloud does have a dialMusic="real" attribute to probably address this particular issue. Unfortunately, that change hasn't been made available in the open source version. So after some debugging, I discovered that ignore_early_media was explicitly being set to true in /src/plivo/src/plivo/rest/freeswitch/inboundsocket.py and /src/plivo/src/plivo/core/freeswitch/commands.py. Also, bridge_early_media was being explicitly set to false in /src/plivo/src/plivo/rest/freeswitch/elements.py. Realizing changing these things could do the job, I made the changes in the Python files and made sure it was recompiled after a restart of Plivo. I also looked at the Plivo and Freeswitch logs to make sure the early media attributes were set correctly.
Unfortunately, the above changes did not do the job. I am at my wit's end. Please help and point me in the right direction. Thanks!
Tony