The RTP Payload Format says:
The offer contains the preferred mode of the offerer. The answerer
may agree to that mode by including the same mode in the answer, or
may include a different mode. The resulting mode used by both
parties SHALL be the lower of the bandwidth modes in the offer and
answer.
That is, an offer of "mode=20" receiving an answer of "mode=30" will
result in "mode=30" being used by both participants. Similarly, an
offer of "mode=30" and an answer of "mode=20" will result in
"mode=30" being used by both participants.
and:
Parameter ptime can not be used for the purpose of specifying iLBC
operating mode, due to fact that for the certain values it will be
impossible to distinguish which mode is about to be used (e.g. when
ptime=60, it would be impossible to distinguish if packet is
carrying 2 frames of 30 ms or 3 frames of 20 ms etc.).
"
So setting "ptime = mode = 20" or somthing like that is wrong
I see al lot of UAs using ptime = 20 and mode = 30 in SDP.
maybe it's why in case that ilbc(mode 30) will be negotiated ptime 30 will be automatically used.