'Split incoming data into its inputfunc counterparts.
This should be called by the serversession.data_in
as sessionhandler.call_inputfunc(self, **kwargs).
We also intercept OOB communication here.
Args:
sessions (Session): Session.
Kwargs:
kwargs (any): Incoming data from protocol on
the form `{"commandname": ((args), {kwargs}),...}`'

def call_inputfuncs(self, session, **kwargs):

    if session:
        input_debug = session.protocol_flags.get('INPUTDEBUG', False)
        for (cmdname, (cmdargs, cmdkwargs)) in kwargs.iteritems():
            cname = cmdname.strip().lower()
            try:
                cmdkwargs.pop('options', None)
                if (cname in _INPUT_FUNCS):
                    _INPUT_FUNCS[cname](session, *cmdargs, **cmdkwargs)
                else:
                    _INPUT_FUNCS['default'](session, cname, *cmdargs, **cmdkwargs)
            except Exception as err:
                if input_debug:
                    session.msg(err)
                log_trace()
