As for as I know, the problem with this approach is that then you have to do the whole housekeeping with the sound - stop it if the phone hangs or if the person picks up, see if the silence profile is on and not play it, and such. Even though I think the workaround used in the python script I referred to is far from the ideal - temporarily override the location for the ringtone file - it's the best way I know to deal with it, because the phone app is a closed-source application and can't be changed or debugged.