On Mon, Jul 11, 2011 at 9:48 AM, Mathieu Lautram <lautram.mathieu@gmail.com> wrote:
Well, I think I was not very clear beacause of lack of informations about what I wanted to do.
So now, here is the scenario:

I have a big originate string that I send through a socket:

bgapi originate {var=value}[var=value...]sofia/route1/num|[var=value...]sofia/route2/num... '&bridge( {var=value...}[var=value...]sofia/route1/num|[var=value...]sofia/route2/num...)'

So, as you can see, I have pipe between the differents routes. Actually, if I set ignore_early_media to TRUE and if the first route (route1) fails, Freeswitch will go to the next route (route2) because it waits a state "answered" to continue. BUT, the A leg won't hear any ringtone.
On the contrary, if I set ignore_early_media to FALSE and if the first route (route1) fails, Freeswitch will NOT go to the next route (route2) because it considers that the call is successful with the state "ringing".

So what I need is that Freeswitch considers a call successful ONLY when it is "answered" and also that the A leg can hear a ringtone.

Yes, you have a bit of a conundrum here. Since you have multiple possible ring targets there simply is no way to use their early media for ringing. So it looks like you're all the way back to one of the original suggestions which is to supply your own ringback. To do this you will need to look up the tones for each target country you will be calling and then set the ringback variable accordingly. 

Anybody else have thoughts on how else this might be accomplished with the given constraints?
-MC