It seems commit #9295 on 1.8 branch breaks AVP in certain cases. Opensips starts fine and some avp related stuff works, but certain scenarios cause this:
Nov 14 11:13:40 ip-10-173-81-249 /usr/sbin/opensips: ERROR:core:new_avp: invalid AVP name!
Nov 14 11:13:40 ip-10-173-81-249 /usr/sbin/opensips: ERROR:core:add_avp: Failed to create new avp structure
Script now does not execute as it should and in the end cause failures in call processing. Its possible this also effects trunk (commit #9294) . I have tested by reverting this single commit (#9295) in most resent stable 1.8 and issue is resolved.