Asterisk GSM & Voip calls detection

I think it is a bit hard question, but I wish someone knows the right answer.
How to tell if an inbound call is GSM or VoIP?
I know that I can allow and disallow some codecs in [sip.conf], but how asterisk knows the difference between these codecs, I need this kind of data for my project.

Asterisk only knows the codec used on the last hop. In the case of ISDN, that will be fixed. In the case of SIP, every media packet identifies the codec in the packet. It is unlikely that the initial source will determine the codec.

If the last hop is VoIP, which is increasingly the case, there is probably no way of determining the characteristics of the first hop.

1 Like