HMPElements is capable of streaming audio via RTP to various recording devices via RTP. This is useful for storing conversations or sending the audio to a peer device. It is particularly useful for calls that are secure between HMPElements and the carrier or SIP device or when using WebRTC.
Set Aside Ports for MonitorStreams
To configure, you will need to use the advanced configuration mode for HMPE in your config if you are not already.
(Note the POOL below that must be named MonitorStreams — This is what you use to set aside ports for the monitor streams):
<setting name="SipPorts" serializeAs="Xml"> <value> <SipPorts> <SipPort> <LocalIp>192.168.50.145/32</LocalIp> <Port>5070</Port> <ExternalIp>209.180.253.87/32</ExternalIp> <LocalTraffic>192.168.50.145/24</LocalTraffic> <LocalTraffic>192.168.2.0/24</LocalTraffic> <UdpPoolName>DefaultPool</UdpPoolName> <TransportProtocol>UDP</TransportProtocol> </SipPort> </SipPorts> </value> </setting> <setting name="UdpPools" serializeAs="Xml"> <value> <UdpPools> <UdpPool> <Name>DefaultPool</Name> <LocalIp>192.168.50.145</LocalIp> <PortCount>1000</PortCount> <PortBase>49152</PortBase> <ExternalIp>209.180.253.87/32</ExternalIp> <TOSBit>0</TOSBit> </UdpPool> <UdpPool> <Name>MonitorStreams</Name> <LocalIp>192.168.50.145</LocalIp> <PortCount>10</PortCount> <PortBase>59152</PortBase> <ExternalIp></ExternalIp> <TOSBit>0</TOSBit> </UdpPool> </UdpPools> </value> </setting>
Make certain that the port base and count don’t overlap the real ports in the default pool. You can see my streaming ports start at 59142 which is 10000 ports away from 49152.
Then, in your code, the usage is pretty simple:
m_VoiceResource.TerminationDigits = "ANY"; m_VoiceResource.MaximumTime = 60; m_VoiceResource.SetMonitorStream("192.168.2.29", 50000, "RTP"); m_VoiceResource.Record(@"C:\temp\recording1.wav");
This will send a stream to the IP/Port specified for the duration of the next voice activity (in this case the Record).
After that you must set it again for the next record, or record conversation.
This feature requires version 2.2.9.5. or later.
See also:
VoiceResource.TerminationDigits Property
VoiceResource.MaximumTime Property
VoiceResource.SetMonitorStream Method