voiceip / oreka

OpenSource G711, G722, G729, Opus & Other Format VoIP SIP Recorder
GNU General Public License v3.0
145 stars 76 forks source link

bug: only record one side audio #124

Closed wangduanduan closed 1 year ago

wangduanduan commented 1 year ago

many records only record one side audio, only a few record both side

wangduanduan commented 1 year ago

this is my config

<config>
    <!-- This is an example configuration file for the Oreka orkaudio capture service on Linux -->
    <!-- Copy this to config.xml and modify according to taste -->

    <AudioOutputPath>/var/log/orkaudio/audio</AudioOutputPath>
    <!-- <TapeFileNaming>[trackingid],[localparty],[remoteparty],[nativecallid]</TapeFileNaming> -->

    <!-- Uncomment the plugin you want to use: -->
    <!-- Use libvoip.so for SIP, Cisco Skinny and pure RTP -->
    <!-- Use libh323voip.so for Avaya, Nortel Unistim, H.323 and MGCP -->
    <!-- See in <VoIpPlugin> below for more precise protocol tuning -->
    <CapturePlugin>libvoip.so</CapturePlugin>
    <!--<CapturePlugin>libh323voip.so</CapturePlugin>-->
    <!--<CapturePlugin>liborksipua.so</CapturePlugin>-->

    <CapturePluginPath>/usr/lib</CapturePluginPath>
    <!--<PluginsDirectory>/oreka-src/orkaudio/plugins</PluginsDirectory>-->

    <!-- Audio file storage format: choose from: native, gsm, ulaw, alaw, pcmwav -->
    <StorageAudioFormat>pcmwav</StorageAudioFormat>
    <StereoRecording>true</StereoRecording>
    <TapeNumChannels>2</TapeNumChannels>
    <AudioFileBitRate>8000</AudioFileBitRate>

    <!-- If you want to keep native audio files as well as compressed, change this to "no" -->
    <DeleteNativeFile>yes</DeleteNativeFile>

    <TrackerHostname>TRACK_HOST</TrackerHostname>
    <TrackerTcpPort>TRACK_PORT</TrackerTcpPort>

    <CapturePortFilters></CapturePortFilters>
    <TapeProcessors>BatchProcessing, Reporting</TapeProcessors>

    <BatchProcessingEnhancePriority>true</BatchProcessingEnhancePriority>
    <NumBatchThreads>CF_BATCH_WORKER</NumBatchThreads>

    <AudioFileOwner>tomcat</AudioFileOwner>
    <AudioFileGroup>tomcat</AudioFileGroup>
    <AudioFilePermissions>644</AudioFilePermissions>
    <!--<TapeDurationMinimumSec>3</TapeDurationMinimumSec>-->

    <!-- Uncomment the parameter below and fill in a comma-separated -->
    <!-- list of TCP addresses which you wish to open a connection to. -->
    <!-- For example 192.168.1.250:1721, 192.168.1.1:8091. A TCP -->
    <!-- connection shall be opened and a read-loop shall be entered -->
    <!-- into whereby any data read shall be discarded, and a record -->
    <!-- maintained of the amount of data which has been read. -->
    <!-- <SocketStreamerTargets></SocketStreamerTargets> -->

    <VoIpPlugin>
        <PcapSocketBufferSize>8388608</PcapSocketBufferSize>

        <!--queuemetrics integration, uncomment the following line-->
        <SipExtractFields>X_FIELDS</SipExtractFields>

        <!-- Use this for Nortel proprietary VoIP protocol -->
        <!--<UnistimDetect>yes</UnistimDetect>-->

        <!-- Turn both these on this for Avaya H.323 extensions -->
        <!--<AvayaDetect>yes</AvayaDetect>-->
        <!--<RtcpDetect>yes</RtcpDetect>-->

        <!-- Set the option below to "true" to enable IAX2 support -->
        <!-- the default is that IAX2 support is disabled -->
        <!--<Iax2Support>false</Iax2Support> -->

        <!-- Use this if you want to force capture from a given list of devices. -->
        <!-- All available devices are listed in orkaudio.log when the service is starting -->
        <Devices>__INTERFACE__</Devices>

        <PcapFilter>host __CAPHOST__ and udp</PcapFilter>

        <!--<SipOverTcpSupport>yes</SipOverTcpSupport>-->
        <!--<SipReportFullAddress>yes</SipReportFullAddress>-->
        <!-- <SipRequestUriAsLocalParty>yes</SipRequestUriAsLocalParty> -->
        <!--<SipUse200OkMediaAddress>yes</SipUse200OkMediaAddress>-->

        <!-- Those two parameters are only needed for call direction detection (one or the other) -->
        <!--<SipDomains>company.com, 65.34.25.87</SipDomains>-->
        <!--<SipDirectionRefenceIpAddresses>65.34.98.56, 65.34.98.57</SipDirectionRefenceIpAddresses>-->

        <!-- Sangoma wanpipe RTP tap for TDM boards -->
        <!--<SangomaRxTcpPortStart>9000</SangomaRxTcpPortStart>-->
        <!--<SangomaTxTcpPortStart>11000</SangomaTxTcpPortStart>-->

        <!-- Mitel Communications Platform -->
        <!-- Turn on the parameter below to enable support for Mitel -->
        <!-- <MitelDetect>yes</MitelDetect> -->

        <!-- The parameter below sets the Mitel signalling port. The -->
        <!-- default is 3999 -->
        <!-- <MitelSignallingPort>3999</MitelSignallingPort> -->

        <!-- The parameter below sets the amount of time in seconds -->
        <!-- after which the cached Mitel metadata shall be discarded. -->
        <!-- The default is 60 seconds. -->
        <!-- <MitelMetadataTimeoutSec>60</MitelMetadataTimeoutSec> -->

        <!-- Turn on the parameter below to enable extension Mitel -->
        <!-- extension detection using ARP. Turning on this parameter -->
        <!-- automatically turns on MitelDetect -->
        <!-- <MitelArpExtensionDetect>yes</MitelArpExtensionDetect> -->

        <!-- Set MitelSmdrPort to the port where Mitel SMDR records -->
        <!-- may be accessed. The default is 1752. Note that you -->
        <!-- shall need to configure SocketStreamerTargets with the -->
        <!-- host and this port, in order for Oreka to access the -->
        <!-- SMDR records. See SocketStreamerTargets above for more -->
        <!-- information on how to configure it. -->
        <!-- <MitelSmdrPort>1752</MitelSmdrPort> -->
        <!-- End of Available Configurations for Mitel Communications Platform -->

    </VoIpPlugin>
</config>
kingster commented 1 year ago

This looks more like a issue with the data mirroring. Can you verify using Wireshark that both side audio is reaching till oreka?

There is no special treatment of packets which would cause one sided recording.

wangduanduan commented 1 year ago

I open the recording file use the audacity, i find that two channels have same wave cursor, so may be one channel has wrong data mirroring.

i try use PcapFilter config to fix the problem, and it worked!!

here is my network

hostA ---RTP---HostB---RTP---hostC

I install orkaudio on the hostB, mybe orkaudio capture both hostA--RTP--HostB and hostB---RTP---hostC, so i set PcapFilter to host hostA_IP and udp

kingster commented 1 year ago

Glad that it worked :)

Yes, it all depends on what how the mirroring has been done. Since in your case the recorder is running on the same box as HostB which is passthrough, it might have threated both sides as 2 legs as different sides and lead to that, applying the pcap filter ensured that it only treated recordings from the traffic of hostA.

PS: I am closing this issue as resolved. Please do create a new issue if you face a any other problem.