move chap-msg-mapping to a function
handle sec by CCS