[Freeswitch-users] verto output device ring is always the default audio

António Silva asilva at wirelessmundi.com
Mon Nov 27 14:29:48 UTC 2017


solved by setting on my js:

switch (dialog.state) {
     // incoming call, verto.js generates the ring, set only sinkid
     case $.verto.enum.state.ringing:
dialog.verto.ringer[0].setSinkId(speakerid).then(function() {
                 console.log("Dialog: " + dialog.callID + ' Success, 
audio output device attached: ' + speakerid);
             }).catch(function(error) {
                 console.error(error);
             });

     //outgoing call, no ring tone is generated..so create a local one
         break;
         case $.verto.enum.state.trying:
             indicateProgress(dialog);
             break;
}

...

function indicateProgress(dialog)
{
     if (dialog.verto.ringer) {
         dialog.verto.ringer.attr('src', 
dialog.verto.options.ringFile)[0].play();
         dialog.verto.ringer[0].setSinkId(speakerid).then(function() {
             console.log("Dialog: " + dialog.callID + ' Success, audio 
output device attached: ' + speakerid);
         }).catch(function(error) {
             console.error(error);
         });

         setTimeout(function() {
             dialog.stopRinging();
             if (dialog.state == $.verto.enum.state.trying) {
                 indicateProgress(dialog);
             }
         }, dialog.verto.options.ringSleep);
     }
}




On 11/24/2017 12:07 AM, António Silva wrote:
> Hi,
>
> I'm use dynamic media tags with verto my problem is that when i set a 
> specific device for output the ring is always played on the default 
> device, during the call switching to different outputs is done perfectly.
>
>
> I've try forcing in verto.js:
>
>   case $.verto.enum.state.ringing:
>             var speaker = dialog.useSpeak;
>             console.info("Using Speaker: ", speaker);
>             if (speaker && speaker !== "any" && speaker !== "none") {
>                 setTimeout(function() {
>                     dialog.setAudioPlaybackDevice(speaker);
>                 }, 500);
>             }
>         break;
>
>
> I do see the message changing it, but doesn't work...  any idea what 
> i'm doing wrong?
>
>
> Log changing the device when ringing:
> jquery.verto.js:2214 Using Speaker: 
> e6208da870143078295d9e309123f2d53ddd5025ea44c915e2133ab7d1aaff36
> jquery.verto.js:2160 Dialog: 134c1362-77af-4f53-9aa8-b4a98655d779 
> Setting speaker: <video id=​"incoming-media-element1511478310478" 
> autoplay=​"autoplay" style=​"width:​ 640px;​ height:​ 480px;​ 
> object-fit:​contain;​">​</video>​ Built-in Audio Digital Stereo (HDMI 2)
>
>
> Thanks.
>

-- 
Saludos / Regards / Cumprimentos
António Silva




More information about the FreeSWITCH-users mailing list