sipXtapi: sipXmediaLib

improved call recording + old recording fix

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: sipXmediaLib
  • Description:
    Hide
    The old call recording has a bug, it doesnt work at all because of a line in CpPhoneMediaInterface.cpp:

    return mpFlowGraph->record(1, -1, NULL, NULL, szFile) ;

    The first parameter is wrong, it says recording will be done only for 1 ms ...

    This patch changes the type of file sound is written into PCM WAV from RAW PCM, since basic user doesn't know how to play raw pcm (you have to set some parameters to play it properly). The old call recording only recorded speaker sound, without local microphone sound. Thus we only got half of the conversation.

    This patch adds 2 splitters, 1 mixer and 1 new recorder to the flowgraph. 1st splitter is between MprMixer and MprBridge on the mic side, to ensure we get mic + any sound we play to remote party, and 2nd splitter is between MprBridge and MprMixer on the speaker side of the flowgraph so that we get speaker sound too. This gets mixed in new mixer and sent to MprRecorder. This way we can hear full conversation.

    MprRecorder was modified to send a message to flowgraph when it is enabled or disabled. This is necessary to ensure we can enable/disable these 2 splitters and mixer whenever it is needed. Upon reception of these messages in flowgraph, we determine the ID of the recorder, and if its the new callrecorder we enable/disable the splitters/mixer. It is not possible to do this without sending messages, as recording can be stopped automatically in MprRecorder itself after long silence or DTMF.
    Show
    The old call recording has a bug, it doesnt work at all because of a line in CpPhoneMediaInterface.cpp: return mpFlowGraph->record(1, -1, NULL, NULL, szFile) ; The first parameter is wrong, it says recording will be done only for 1 ms ... This patch changes the type of file sound is written into PCM WAV from RAW PCM, since basic user doesn't know how to play raw pcm (you have to set some parameters to play it properly). The old call recording only recorded speaker sound, without local microphone sound. Thus we only got half of the conversation. This patch adds 2 splitters, 1 mixer and 1 new recorder to the flowgraph. 1st splitter is between MprMixer and MprBridge on the mic side, to ensure we get mic + any sound we play to remote party, and 2nd splitter is between MprBridge and MprMixer on the speaker side of the flowgraph so that we get speaker sound too. This gets mixed in new mixer and sent to MprRecorder. This way we can hear full conversation. MprRecorder was modified to send a message to flowgraph when it is enabled or disabled. This is necessary to ensure we can enable/disable these 2 splitters and mixer whenever it is needed. Upon reception of these messages in flowgraph, we determine the ID of the recorder, and if its the new callrecorder we enable/disable the splitters/mixer. It is not possible to do this without sending messages, as recording can be stopped automatically in MprRecorder itself after long silence or DTMF.
  • Environment:
    sipxtapi branch
  1. FullCallRecording.diff
    (20 kB)
    Alexander Chemeris
    2007-06-29 08:06
  2. helppatch.diff
    (1 kB)
    Jaroslav Libak
    2007-03-10 05:47
  3. patch.diff
    (20 kB)
    Jaroslav Libak
    2007-03-15 05:49
  4. patch.diff
    (19 kB)
    Jaroslav Libak
    2007-03-09 18:42

Activity

Hide
Jaroslav Libak added a comment - 2007-03-09 19:07
Also please update the documentation - callrecording is done in flowgraph, therefore after we add such a call to conference it will be stopped. To record conference, recording should be started on 1 call in conference only. When call is removed from conference, recording will stop too, as media connection is destroyed and recreated.
Show
Jaroslav Libak added a comment - 2007-03-09 19:07 Also please update the documentation - callrecording is done in flowgraph, therefore after we add such a call to conference it will be stopped. To record conference, recording should be started on 1 call in conference only. When call is removed from conference, recording will stop too, as media connection is destroyed and recreated.
Hide
Alexander Chemeris added a comment - 2007-03-09 19:11
Please, provide patch for documentation too.
Show
Alexander Chemeris added a comment - 2007-03-09 19:11 Please, provide patch for documentation too.
Hide
Jaroslav Libak added a comment - 2007-03-10 05:47
This patch updates sipxtapi.h and explains better how conference recording behaves.

I originally also wanted to add new events to sipxtapi to inform user when recording really started and stopped, but this will be supplied in a separate patch later. It has to work right and inform the user that call recording on a call stopped when he for example uses conference join to add the call to conference.

So this patch is complete, unless there are objections to documentation level in the source code.
Show
Jaroslav Libak added a comment - 2007-03-10 05:47 This patch updates sipxtapi.h and explains better how conference recording behaves. I originally also wanted to add new events to sipxtapi to inform user when recording really started and stopped, but this will be supplied in a separate patch later. It has to work right and inform the user that call recording on a call stopped when he for example uses conference join to add the call to conference. So this patch is complete, unless there are objections to documentation level in the source code.
Hide
Alexander Chemeris added a comment - 2007-03-12 10:10
Changes to patch, should be done before its check in:

1) Wrap long lines (I saw two lines you're unwrapped)
2) Write documentation to all changes in .h files - new/changed functions, new enum values, etc. We should tend to fully documented code.

Then I'll test it, and commit.
Show
Alexander Chemeris added a comment - 2007-03-12 10:10 Changes to patch, should be done before its check in: 1) Wrap long lines (I saw two lines you're unwrapped) 2) Write documentation to all changes in .h files - new/changed functions, new enum values, etc. We should tend to fully documented code. Then I'll test it, and commit.
Hide
Jaroslav Libak added a comment - 2007-03-15 05:49
New patch.diff file with recommended changes.
Show
Jaroslav Libak added a comment - 2007-03-15 05:49 New patch.diff file with recommended changes.
Hide
Alexander Chemeris added a comment - 2007-06-29 08:06
Patch updated to latest sipXtapi (FullCallRecording.diff).
Show
Alexander Chemeris added a comment - 2007-06-29 08:06 Patch updated to latest sipXtapi (FullCallRecording.diff).
Hide
Keith Kyzivat added a comment - 2007-06-29 15:59
This patch, with slight modifications to the enum values given to ON_MPRRECORDER_ENABLED and ON_MPRRECORDER_DISABLED has been committed to the main branch of sipXtapi, rev 9772.

http://scm.sipfoundry.org/viewsvn/sipX?view=rev&revision=9772
Show
Keith Kyzivat added a comment - 2007-06-29 15:59 This patch, with slight modifications to the enum values given to ON_MPRRECORDER_ENABLED and ON_MPRRECORDER_DISABLED has been committed to the main branch of sipXtapi, rev 9772. http://scm.sipfoundry.org/viewsvn/sipX?view=rev&revision=9772
Hide
Keith Kyzivat added a comment - 2007-07-09 10:36
r9799 has some updated fixes... from my svn commit comment:

"Fix call recording, as initialization was done inside crazy recording defines, but shutdown/destruction was done in all cases, leading to trying to remove a non existant output link from mpCallrecMixer. Now the call recorder exists no matter what defines are present, even without INSERT_RECORDERS and WantRecorders (static int, directly tied to INSERT_RECORDERS) being defined."
Show
Keith Kyzivat added a comment - 2007-07-09 10:36 r9799 has some updated fixes... from my svn commit comment: "Fix call recording, as initialization was done inside crazy recording defines, but shutdown/destruction was done in all cases, leading to trying to remove a non existant output link from mpCallrecMixer. Now the call recorder exists no matter what defines are present, even without INSERT_RECORDERS and WantRecorders (static int, directly tied to INSERT_RECORDERS) being defined."

People

Dates

  • Created:
    2007-03-09 18:42
    Updated:
    2007-07-09 10:36
    Resolved:
    2007-06-29 15:59