VoIPGRID / VialerSIPLib

An Objective-c wrapper for PJSIP
GNU General Public License v3.0
133 stars 69 forks source link

How can I stop transmitting data when my microphone is muted ? #216

Closed ludivinefafournoux closed 4 years ago

ludivinefafournoux commented 4 years ago

Version

3.7.1

File / Feature

media.hpp

Expected behavior

Stop transmitting data when microphone is muted

I want to use those methods void startTransmit(const AudioMedia &sink) const throw(Error); & void stopTransmit(const AudioMedia &sink) const throw(Error); when I mute and unmute but I don't know how to do this.

Actual behavior

Data still transmitting when my microphone isn't muted.

ludivinefafournoux commented 4 years ago

Ok, I have new informations. startTransmit method is from PJSUA2 API, and here we use PJSUA.

In fact, when the microphone is muted we use:

pj_status_t pjsua_conf_disconnect (pjsua_conf_port_id source, pjsua_conf_port_id sink)

And in PJSUA2:

void AudioMedia::stopTransmit(const AudioMedia &sink) const PJSUA2_THROW(Error)
{
    PJSUA2_CHECK_EXPR( pjsua_conf_disconnect(id, sink.id) );
}

It's the same thing.