Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding recreation of pjmedia_ports when reinvite causes change in stream port characteristics #91

Open
MayamaTakeshi opened this issue Mar 10, 2024 · 0 comments

Comments

@MayamaTakeshi
Copy link
Owner

MayamaTakeshi commented Mar 10, 2024

If the following stream port characteristics

  • sampling_rate (PJMEDIA_PIA_SRATE)
  • channel_count (PJMEDIA_PIA_CCNT)
  • samples_per_frame (PJMEDIA_PIA_SPF)
  • bits_per_sample (PJMEDIA_PIA_BITS)
    change in a reinvite, we recreate the AudioEndpoint conf (Create conf per AudioEndpoint #74) and add the new stream port and new dtmfdet port to it.
    However the other ports are not recreated/added.
    Let's consider if this would be possible:
  • wav_player: we might need to do this:
    • add a function to permit to check the number of samples that were played so far (well we might get stats from some pjmedia function)
    • recreate the port and seek to the number of samples so that we can continue playing from it
  • wav_writer:
    • when the port is destroyed, ensure the wav file is closed
    • the port create function should be modified with bool parameter 'append' which would indicate to open an existing wav file and append to it.
    • recreate the port with parameter 'append' set to true
  • tonegen (inband dtmf generation):
    • the port needs to provide a function to check the pending digits to be sent
    • when recreating the port, immediately add the pending digits to it (obs: this would be susceptible to a gitch so we might need to indicate if the first digit must be immediately generated if its output was not complete in the previous port
  • fax: this might not be doable as we would be in the middle of fax communication and we cannot open a tiff file for seek-read or append like we would do with wav_player/wav_writer
  • flite: similar to wav_player (seek to number of samples transmitted so far)
  • pocketsphinx (future):
    • need to have a function to permit to flush partial transcripts. But if there is not, just recreate the port

In all cases, a resample_port might need to be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant