var socket_connect = function (room) { return io('https://app.gppcloud.com:3111', { query: 'r_var='+room }); } var socket = socket_connect(1); $(function(){ socket.on('LoadChatRecive', function(msg){ //console.log('mensajerecivido'); chattotalGChat(); modalChatMsj(); //console.log(msg); }); socket.on('newMenssageWa', function(msg){ //console.log('mensajerecivido'); var messagephonere = msg.phone; var mostrarNumver = messagephonere.split('@'); var firmeUltimi = mostrarNumver[0].substring(2); if( typeof validatorMsajeRecive !== 'undefined' && jQuery.isFunction( validatorMsajeRecive ) ) { validatorMsajeRecive(msg.instance, firmeUltimi, msg.data); } //console.log(msg); }); socket.on('LoadAllSocket', function(data){ if (data == 'emit_call_') { CallsProccessejecut(); }else if(data == 'end_call'){ if( typeof statusCallComprober !== 'undefined' && jQuery.isFunction( statusCallComprober ) ) { statusCallComprober(); } } else if(data == 'UpdateOdonto'){ if( typeof RecargaLoadTemp !== 'undefined' && jQuery.isFunction( RecargaLoadTemp ) ) { RecargaLoadTemp(); } }else if(data == 'loadCtv'){ if( typeof RecargaLoadTempCtv !== 'undefined' && jQuery.isFunction( RecargaLoadTempCtv ) ) { RecargaLoadTempCtv(); } }else if(data == 'UpdateReceta'){ if( typeof listarRecetas !== 'undefined' && jQuery.isFunction( listarRecetas ) ) { listarRecetas(); } }else if(data == 'reciveDemoSock'){ if( typeof Csadsadas !== 'undefined' && jQuery.isFunction( Csadsadas ) ) { Csadsadas(); } }else if(data == 'loadPatients'){ if( typeof ListPatients !== 'undefined' && jQuery.isFunction( ListPatients ) ) { ListPatients(1); } }else if(data == 'notificationRegister'){ if( typeof LoadNotifications !== 'undefined' && jQuery.isFunction( LoadNotifications ) ) { LoadNotifications(); } } else{ var json = data; if (json.data == 'reset') { if (json.rol == 2) { if( typeof VeryfyPayPatients !== 'undefined' && jQuery.isFunction( VeryfyPayPatients ) ) { VeryfyPayPatients(''); } } }else if(json.data == 'reproductionSonido'){ if( typeof reproducirAviso !== 'undefined' && jQuery.isFunction( reproducirAviso ) ) { reproducirAviso(json.menssage, json.vos); } }else if (json.data == 'pacienteLoadctv') { if( typeof newfyparceverify !== 'undefined' && jQuery.isFunction( newfyparceverify ) ) { newfyparceverify(json.clave, json.claveEquipo); } }else if (json.data == 'loadCtv') { if( typeof RecargaLoadTempCtvClient !== 'undefined' && jQuery.isFunction( RecargaLoadTempCtvClient ) ) { RecargaLoadTempCtvClient(json.clave); } }else if(json.data == 'loadImgChange'){ if( typeof imgChangeCaptureTRASPASE !== 'undefined' && jQuery.isFunction( imgChangeCaptureTRASPASE ) ) { imgChangeCaptureTRASPASE(json.kwy, json.image); } }else if(json.data == 'InitPago'){ if (json.rol == 2) { if( typeof VeryfyPayPatients !== 'undefined' && jQuery.isFunction( VeryfyPayPatients ) ) { VeryfyPayPatients('InitPago'); } } }else if(json.data == 'ConsultingATM'){ if(json.consult == 'veryfi'){ if( typeof veryfyATM !== 'undefined' && jQuery.isFunction( veryfyATM ) ) { veryfyATM(json.token); } }else if(json.consult == 'res'){ if( typeof VerifyRes !== 'undefined' && jQuery.isFunction( VerifyRes ) ) { VerifyRes(json.token); } }else if(json.consult == 'suspended'){ if( typeof suspended !== 'undefined' && jQuery.isFunction( suspended ) ) { suspended(json.token); } }else if(json.consult == 'printTermical'){ if( typeof PrintPdfUrl !== 'undefined' && jQuery.isFunction( PrintPdfUrl ) ) { PrintPdfUrl(json.url, ''); } } } } }) socket.on('CreateNotificationsPago', function(msg){ }); });