Listen for ringing tone frequency(hz) and cadence in asterisk

dannyd7139
Joined: Thu 16 of Feb, 2017

Listen for ringing tone frequency(hz) and cadence in asterisk

Posted:Thu 16 of Feb, 2017 (22:59 UTC)
I have the following setup WAN -> Kamailio -> LAN -> Asterisk -> SIP GSM Gateway

When I call out of the gsm trunk to an international number, the gsm carrier plays a short US based ringing tone, followed by switching to the ringing tone of the destination country. Problem is that when this switch happens, the gateway sends a 200 OK back to asterisk, starting billing.

I need to detect if the ringing tone for that dialed country is still present. If so, keep sending 180 Ringing. Can asterisk listen on the rtp stream for this?

Additional information - I've checked call logs on the carrier side and I do not get billed for incomplete international calls. So this is an issue in the GSM -> VOIP translation.