Differentiate btw audio and video call

I have been looking for a solution to differentiate btw audio and video call, but couldn’t found a definite answer.

In the case of most of the mobile sip client like linphone or CSIPsimple, initiating audio call send only audio codec in initial INVITE SDP, and video codecs with video call is originated…But i have observed that Asterisk always INVITE B-party with all the codecs supported in its allow=bla,bla,bla.
And hence, if video codecs are placed in its allow param, B-party always see a video call, no matter party-A has started an audio call.

Above scenario can be resolved when you are using asterisk-realtime. As, you can customize the client end and ask it to call a web service which can ultimately change codecs of caller and callee in database sipppers table before making the call. But asterisk-realtime have other downsides like ‘qualify’ param.
Lets say, we are on asterisk-static, how can we achieve this ? I have seen Set(SIP_CODEC=xxxx) , which only applies to Leg A (as far as i know), and we can set only one codec with it.

Please comment if it has been seen or fixed by anyone.
Thanks