From a very brief look I suspect part of the issue could be that you are not specifying the LOCAL RTP address and port to be used in the ipm_StartMedia call in this case. Also, make sure that match the address of which you had selected in the "default IP address" tab of the HMP device property sheet in the DCM.
Jeff M.