|
Windev - Socket central Telefônica IP |
Débuté par adrianoboller, 10 fév. 2016 13:22 - 20 réponses |
| |
| | | |
|
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 13:22 |
Prezados,
Segue abaixo exemplo de código O.O.P. trabalhando com Socket central telefônica IP.
CLASSE CFimChamadaAvancada
CFimChamadaAvancada is a Class inherits from CProtocolo m_Data is string m_Hora is string m_Tronco is string m_Duracao is string m_Ramal is string END
Procedure Constructor(ln_DDD, ln_Telefone are int, ls_Data, ls_Hora, ls_Tronco, ls_Duracao, ls_Ramal) Constructor CProtocolo(ln_DDD, ln_Telefone) m_Data = ls_Data m_Hora = ls_Hora m_Tronco = ls_Tronco m_Duracao = ls_Duracao m_Ramal = ls_Ramal
Procedure Constructor(TextoSocket is string) dbgAssert(TextoSocket <> "", "Construtor Vazio") ls_Argumentos is string = Replace(ExtractString(TextoSocket,3,"|"), "}", "") dbgAssert(StringCount(ls_Argumentos,",",IgnoreCase) = 6) m_Data = ExtractString(ls_Argumentos, 1, ",") m_Hora = ExtractString(ls_Argumentos, 2, ",") m_Tronco = ExtractString(ls_Argumentos, 3, ",") m_Duracao = ExtractString(ls_Argumentos,4, ",") m_Ramal = ExtractString(ls_Argumentos, 5, ",") m_DDD = ExtractString(ls_Argumentos, 6, ",") AlimentaDDDTelefone(ExtractString(ls_Argumentos, 7, ","))
Procedure Destructor()
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 13:46 |
CLASSE CFimChamadaSimples
CFimChamadaSimples is a Class inherits from CProtocolo m_Duracao is string m_GravacaoPath is string END
Procedure Constructor(ln_DDD, ln_Telefone are int,ls_Duracao, ls_GravacaoPath are strings) Constructor CProtocolo(ln_DDD, ln_Telefone) m_Duracao = ls_Duracao m_GravacaoPath = ls_GravacaoPath
Procedure Constructor(TextoSocket is string) dbgAssert(TextoSocket <> "", "Construtor Vazio") ls_Argumentos is string = Replace(ExtractString(TextoSocket,3,"|"), "}", "") dbgAssert(StringCount(ls_Argumentos,",",IgnoreCase) = 2 OR StringCount(ls_Argumentos,",",IgnoreCase) = 3) IF StringCount(ls_Argumentos,",",IgnoreCase) = 2 THEN AlimentaDDDTelefone(ExtractString(ls_Argumentos, 1, ",")) m_Duracao = ExtractString(ls_Argumentos, 2, ",") m_GravacaoPath = ExtractString(ls_Argumentos, 3, ",") ELSE IF StringCount(ls_Argumentos,",",IgnoreCase) = 3 AlimentaDDDTelefone(ExtractString(ls_Argumentos, 2, ",")) m_Duracao = ExtractString(ls_Argumentos, 3, ",") m_GravacaoPath = ExtractString(ls_Argumentos, 4, ",") END
Procedure Destructor()
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 13:48 |
CLASSE CIniciarChamadaAvancada
CIniciarChamadaAvancada is a Class inherits from CProtocolo m_Data is string m_Hora is string m_Tronco is string m_Ramal is string END
Procedure Constructor(ln_DDD, ln_Telefone are int, ls_Data, ls_Hora, ls_Tronco, ls_Ramal are strings) Constructor CProtocolo(ln_DDD, ln_Telefone) m_Data = ls_Data m_Hora = ls_Hora m_Tronco = ls_Tronco m_Ramal = ls_Ramal
Procedure Constructor(TextoSocket is string) dbgAssert(TextoSocket <> "", "Construtor Vazio") ls_Argumentos is string = Replace(ExtractString(TextoSocket,3,"|"), "}", "") dbgAssert(StringCount(ls_Argumentos,",",IgnoreCase) = 5) m_Data = ExtractString(ls_Argumentos, 1, ",") m_Hora = ExtractString(ls_Argumentos, 2, ",") m_Tronco = ExtractString(ls_Argumentos, 3, ",") m_Ramal = ExtractString(ls_Argumentos, 4, ",") m_DDD = ExtractString(ls_Argumentos, 5, ",") AlimentaDDDTelefone(ExtractString(ls_Argumentos, 6, ","))
Procedure Destructor()
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 13:50 |
CLASSE CIniciarChamadaSimples
CIniciarChamadaSimples is a Class inherits from CProtocolo END
Procedure Constructor(ln_DDD, ln_Telefone are int) Constructor CProtocolo(ln_DDD, ln_Telefone)
Procedure Constructor(TextoSocket is string) dbgAssert(TextoSocket <> "", "Construtor Vazio") dbgAssert(StringCount(TextoSocket,",",IgnoreCase) = 0) AlimentaDDDTelefone(Replace(ExtractString(TextoSocket,3,"|"), "}", ""))
Procedure Destructor()
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 13:59 |
CLASSE CKeyboardKeys
CKeyboardKeys is Class
CONSTANT cnNumLock = 0x90 cnScrollLock = 0x91 cnCapsLock = 0x14 cnAltGr = 0xA5 csTABKey = “<TAB>” csEnterKey = “<INPUT>” csNumLockKey = “<NUM_LOCK>” csCapsLockKey = “<CAPS_LOCK>” csScrollLockKey = “<SCROLL_LOCK>” csPauseKey = “<PAUSE>” csWindowsKey1 = “<WINDOWS_1>” csWindowsKey2 = “<WINDOWS_2>” csAltGrKey = “<ALT_GR>” csRightClickKey = “<RIGHT_CLICK>” csEscKey = “<ESC>” csSpaceKey = “<SPACE>” csDeleteKey = “<DELETE>” csControlKey = “<CTRL>” csShiftKey = “<SHIFT>” csLeftArrowKey = “<LEFT_ARROW>” csRightArrowKey = “<RIGHT_ARROW>” csUpArrowKey = “<UP_ARROW>” csDownArrowKey = “<DOWN_ARROW>” csInsertKey = “<INSERT>” csHomeKey = “<HOME>” csPageUpKey = “<PAGE_UP>” csPageDownKey = “<PAGE_DOWN>” csDelKey = “<DEL>” csEndKey = “<END>”
csDivisionKey = “</>” csMultiplicationKey = “<*>” csMinusKey = “<->” csPlusKey = “<+>” csAmpersandKey = “&” csEAcuteAccentKey = “é” csQuotationMarkKey = “""” csQuoteKey = “'” csLeftParenthesisKey = “(” csMinusKeyBis = “-” csEGraveAccentKey = “è” csUnderscoreKey =“_” csCCedillaKey = “ç” csAAcuteAccentKey = “à” csRightParenthesisKey = “)” csEqualKey = “=” csPlusKeyBis = “+” csATKey = “@” csSquareKey = “²” csDegreeKey = “°” csDieresisKey = “¨” csPoundKey = “£” csDollarKey = “$” csAsteriskKey = “¤” csPercentageKey = “%” csUAccentKey = “ù” csTildeKey = “~” csNumberSignKey = “#” csLeftCurlyBraceKey = “{” csLeftSquareBracketKey = “[” csMoreKey = “|” csApostropheKey = “`” csBackslashKey = “\” csCircumflexKey = “^” csCommercialAtKey = “@” csRightSquareBracketKey = “]” csRightCurlyBraceKey = “}” csGreaterThanKey = “>” csLessThanKey = “<” csCommaKey = “<,>” csQuestionMarkKey = “<?>” csSemicolonKey = “<;>” csPeriodKey = “<.>” csSlashKey = “</>” csColonKey = “<:>” csExclamationMarkKey = “<!>” csChapterKey = “<§>” csMuKey = “<µ>” csMultiplicationKeyBis = “<*>” csUnknownKey = “<UNKNOWN>” csInactiveKey = “<DISABLED>” END
END
Procedure Constructor()
Procedure Destructor()
Procedure sReturnKey(nKeyNum=_EVE.wParam)
IF nKeyNum >=65 AND nKeyNum <=90 IF KeyPressed(kpShift,True) OR :bActiveKey(::cnCapsLock) RESULT Charact(Asc(“A”)+nKeyNum-65) ELSE RESULT Charact(Asc(“a”)+nKeyNum-65) END END
IF (nKeyNum >=96 AND nKeyNum <=105) OR nKeyNum = 110 RESULT :_GetNumericKey(nKeyNum) END
IF nKeyNum >= 112 AND nKeyNum <= 123 RESULT “F”+(nKeyNum+1-112) END
IF nKeyNum >=48 AND nKeyNum <=57 RESULT :_GetNumericKeyUp(nKeyNum)
END
IF nKeyNum>=37 AND nKeyNum<=40 IF nKeyNum = 37 RESULT ::csLeftArrowKey IF nKeyNum = 38 RESULT ::csUpArrowKey IF nKeyNum = 39 RESULT ::csRightArrowKey IF nKeyNum = 40 RESULT ::csDownArrowKey END
sKey is string sKey = :_GetPunctuationKey(nKeyNum) IF sKey <> “” RESULT sKey END
sKey = :_GetSpecialKey(nKeyNum) IF sKey <> “” RESULT sKey END
RESULT ::csUnknownKey
Procedure bActiveKey(nValSpecificKey is int)
RESULT BinaryAND(API(“user32”,“GetKeyState”,nValSpecificKey),1)
Procedure _GetNumericKey(nKeyNum)
IF :bActiveKey(::cnNumLock) = True IF nKeyNum = 110 RESULT ::csPeriodKey RESULT Charact(Asc(“0”)+nKeyNum-96) ELSE IF nKeyNum = 96 RESULT ::csInsertKey IF nKeyNum = 97 RESULT ::csEndKey IF nKeyNum = 98 RESULT ::csDownArrowKey IF nKeyNum = 99 RESULT ::csPageDownKey IF nKeyNum = 100 RESULT ::csLeftArrowKey IF nKeyNum = 101 RESULT ::csInactiveKey IF nKeyNum = 102 RESULT ::csRightArrowKey IF nKeyNum = 103 RESULT ::csHomeKey IF nKeyNum = 104 RESULT ::csUpArrowKey IF nKeyNum = 105 RESULT ::csPageUpKey IF nKeyNum = 110 RESULT ::csDelKey END
RESULT “”
Procedure _GetNumericKeyUp(nKeyNum)
IF KeyPressed(::cnAltGr,True) IF nKeyNum = 48 RESULT ::csCommercialAtKey IF nKeyNum = 49 RESULT ::csInactiveKey IF nKeyNum = 50 RESULT ::csTildeKey IF nKeyNum = 51 RESULT ::csNumberSignKey IF nKeyNum = 52 RESULT ::csLeftCurlyBraceKey IF nKeyNum = 53 RESULT ::csLeftSquareBracketKey IF nKeyNum = 54 RESULT ::csMoreKey IF nKeyNum = 55 RESULT ::csApostropheKey IF nKeyNum = 56 RESULT ::csBackslashKey IF nKeyNum = 57 RESULT ::csCircumflexKey END
IF KeyPressed(kpShift,True) OR :bActiveKey(::cnCapsLock) RESULT Charact(Asc(“0”)+nKeyNum-48)+“_BIS” END
IF nKeyNum = 48 RESULT ::csAAcuteAccentKey IF nKeyNum = 49 RESULT ::csAmpersandKey IF nKeyNum = 50 RESULT ::csEAcuteAccentKey IF nKeyNum = 51 RESULT ::csQuotationMarkKey IF nKeyNum = 52 RESULT ::csQuoteKey IF nKeyNum = 53 RESULT ::csLeftParenthesisKey IF nKeyNum = 54 RESULT ::csMinusKeyBis IF nKeyNum = 55 RESULT ::csEGraveAccentKey IF nKeyNum = 56 RESULT ::csUnderscoreKey IF nKeyNum = 57 RESULT ::csCCedillaKey
RESULT “”
Procedure _GetPunctuationKey(nKeyNum)
IF nKeyNum = 188 IF KeyPressed(kpShift,True) OR :bActiveKey(::cnCapsLock) RESULT ::csQuestionMarkKey ELSE RESULT ::csCommaKey END END
IF nKeyNum = 190 IF KeyPressed(kpShift,True) OR :bActiveKey(::cnCapsLock) RESULT ::csPeriodKey ELSE RESULT ::csSemicolonKey END END
IF nKeyNum = 191 IF KeyPressed(kpShift,True) OR :bActiveKey(::cnCapsLock) RESULT ::csSlashKey ELSE RESULT ::csColonKey END END
IF nKeyNum = 226 IF KeyPressed(kpShift,True) OR :bActiveKey(::cnCapsLock) RESULT ::csGreaterThanKey ELSE RESULT ::csLessThanKey END END
IF nKeyNum = 219 IF KeyPressed(::cnAltGr,True) RESULT ::csRightSquareBracketKey END IF KeyPressed(kpShift,True) OR :bActiveKey(::cnCapsLock) RESULT ::csDegreeKey ELSE RESULT ::csRightParenthesisKey END END
IF nKeyNum = 187 IF KeyPressed(::cnAltGr,True) RESULT ::csRightCurlyBraceKey END IF KeyPressed(kpShift,True) OR :bActiveKey(::cnCapsLock) RESULT ::csPlusKeyBis ELSE RESULT ::csEqualKey END END
IF nKeyNum = 221 IF KeyPressed(kpShift,True) OR :bActiveKey(::cnCapsLock) RESULT ::csDieresisKey ELSE RESULT ::csCircumflexKey END END
IF nKeyNum = 186 IF KeyPressed(::cnAltGr,True) RESULT ::csAsteriskKey END IF KeyPressed(kpShift,True) OR :bActiveKey(::cnCapsLock) RESULT ::csPoundKey ELSE RESULT ::csDollarKey END END
IF nKeyNum = 192 IF KeyPressed(kpShift,True) OR :bActiveKey(::cnCapsLock) RESULT ::csPercentageKey ELSE RESULT ::csUAccentKey END END
IF nKeyNum = 220 IF KeyPressed(kpShift,True) OR :bActiveKey(::cnCapsLock) RESULT ::csMuKey ELSE RESULT ::csMultiplicationKeyBis END END
IF nKeyNum = 223 IF KeyPressed(kpShift,True) OR :bActiveKey(::cnCapsLock) RESULT ::csChapterKey ELSE RESULT ::csExclamationMarkKey END END
RESULT “”
Procedure _GetSpecialKey(nKeyNum)
IF nKeyNum = 33 RESULT ::csPageUpKey IF nKeyNum = 34 RESULT ::csPageDownKey IF nKeyNum = 35 RESULT ::csEndKey IF nKeyNum = 36 RESULT ::csHomeKey IF nKeyNum = 45 RESULT ::csInsertKey IF nKeyNum = 46 RESULT ::csDelKey IF nKeyNum = 144 RESULT ::csNumLockKey
IF nKeyNum = 8 RESULT ::csDeleteKey IF nKeyNum = 9 RESULT ::csTABKey IF nKeyNum = 13 RESULT ::csEnterKey IF nKeyNum = 16 RESULT ::csShiftKey IF nKeyNum = 17 RESULT ::csControlKey IF nKeyNum = 18 RESULT ::csAltGrKey IF nKeyNum = 19 RESULT ::csPauseKey IF nKeyNum = 20 RESULT ::csCapsLockKey IF nKeyNum = 27 RESULT ::csEscKey IF nKeyNum = 32 RESULT ::csSpaceKey IF nKeyNum = 91 RESULT ::csWindowsKey1 IF nKeyNum = 92 RESULT ::csWindowsKey2 IF nKeyNum = 93 RESULT ::csRightClickKey IF nKeyNum = 222 RESULT ::csSquareKey
IF nKeyNum = 106 RESULT ::csMultiplicationKey IF nKeyNum = 107 RESULT ::csPlusKey IF nKeyNum = 109 RESULT ::csMinusKey IF nKeyNum = 111 RESULT ::csDivisionKey IF nKeyNum = 144 RESULT ::csNumLockKey IF nKeyNum = 145 RESULT ::csScrollLockKey
RESULT “”
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 14:39 |
CLASSE CNovaLigacao
CNovaLigacao is a Class inherits from CProtocolo m_Atividade is string m_Cidade is string END
Procedure Constructor(ln_DDD, ln_Telefone are int, ls_Atividade is string, ls_Cidade is string) Constructor CProtocolo(ln_DDD, ln_Telefone) m_Atividade = ls_Atividade m_Cidade = ls_Cidade
Procedure Constructor(TextoSocket is string) dbgAssert(TextoSocket <> "", "Construtor Vazio") ls_Argumentos is string = Replace(ExtractString(TextoSocket,3,"|"), "}", "") dbgAssert(StringCount(ls_Argumentos,",",IgnoreCase) = 2) m_Atividade = ExtractString(ls_Argumentos, 1, ",") AlimentaDDDTelefone(ExtractString(ls_Argumentos, 2, ",")) m_Cidade = ExtractString(ls_Argumentos, 3, ",")
Procedure Destructor()
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 14:42 |
CLASSE CProtocolo
CProtocolo is a Class m_DDD, m_Telefone are int END
Procedure Constructor(DDD, Telefone are int) m_DDD = DDD m_Telefone = Telefone
Procedure Constructor()
Procedure Destructor()
Procedure PROTECTED AlimentaDDDTelefone(Telefone is string) DDD is string Telefone = Replace(NoSpace(NoAccent(Telefone)),[" ",",","-"],"") IF Length(Telefone) > 9 IF Telefone[[1]] = "0" AND Telefone <> "" DDD = Telefone[[2 on 2]] Telefone = Telefone[[4 TO]] ELSE IF Telefone[[1]] <> "0" AND Telefone <> "" DDD = Telefone[[TO 2]] Telefone = Telefone[[3 TO]] END IF Val(DDD) > 0 AND Val(Telefone) > 0 AND Length(DDD) >=2 AND Length(Telefone) >= 8 m_Telefone = Val(Telefone) m_DDD = Val(DDD) END ELSE m_Telefone = Val(Telefone) END
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 14:43 |
PROCEDURES GLOBAIS
Procedure Visys_AValidacaoString(TextoSocket,DebugSN)
TextoSocket += "}"
IF DebugSN = "S" ToastDisplay("Avalia String da Central Telefônica.",toastShort,vaTop,haCenter) END
IF TextoSocket = "" OR NOT (TextoSocket [=] "{") THEN RESULT False END
Cabecalho is string = ""
dbgAssert(StringCount(TextoSocket,"{",IgnoreCase) = 1, "String não contem um {")
IF StringCount(TextoSocket,"{",IgnoreCase) = 1 AND StringCount(TextoSocket,"}",IgnoreCase) = 1 IF StringCount(TextoSocket,"|",IgnoreCase) > 1 AND Length(TextoSocket) >= 12 IF TextoSocket = "{599|002|,,}" OR TextoSocket = "{599|003|,,00:00:00,}" TextoSocket = "" RESULT False ELSE Cabecalho = Middle(TextoSocket,2,8) END IF DebugSN = "S" WIN_0002_CallCenter.EDT_Obs_Inf_Interna += "TEXTOSOCKET: " +TextoSocket + CRLF END resultado is dynamic CProtocolo SWITCH Cabecalho CASE "599|001|", "599|002|": resultado = new CNovaLigacao(TextoSocket) CASE "599|010|": resultado = new CIniciarChamadaAvancada(TextoSocket) CASE "599|030|": resultado = new CFimChamadaAvancada(TextoSocket) CASE "598|001|": resultado = new CIniciarChamadaSimples(TextoSocket) CASE "599|003|": resultado = new CFimChamadaSimples(TextoSocket) END dbgAssert(resultado <> Null, "Resultado não esperado") IF resultado is CFimChamadaSimples THEN lcl_Chm is CFimChamadaSimples <- resultado END IF resultado is CNovaLigacao THEN lcl_ChmP is CNovaLigacao <- resultado END IF resultado <> Null AND (resultado.m_DDD > 0 AND resultado.m_Telefone > 0) ExecuteMainThread(WIN_0002_CallCenter.CentralTelefonica,resultado, "S") ToastDisplay("Retorno: "+resultado.m_DDD +" "+ resultado.m_Telefone, toastShort, vaTop,haCenter) WIN_0002_CallCenter.EDT_Obs_Inf_Interna += "Retorno>>>>>: "+resultado.m_DDD +" "+ resultado.m_Telefone + CRLF END RESULT True ELSE IF DebugSN = "S" ToastDisplay("String fora do padrão",toastShort,vaTop,haCenter) END END ELSE IF DebugSN = "S" ToastDisplay("Mais de uma string de socket no retorno",toastShort,vaTop,haCenter) END END
RESULT False
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 14:44 |
Procedure Visys_Socket_Read(DebugSN)
IF gb_SocketStart = True IF DebugSN = "S" ToastDisplay("Socket Read",toastShort,vaTop,haCenter) END RetornoSocket is string = "" WHILE SocketExist("VISYS") = True AND gb_SocketStart = True RetornoSocket = SocketRead("VISYS", True) IF RetornoSocket <> "" AND CT_InicializarAtendimento = True RetornoSocket = NoSpace(RetornoSocket) RetornoSocket = NoAccent(RetornoSocket) RetornoSocket = Replace(RetornoSocket,CRLF,"") RetornoSocket = Replace(RetornoSocket,CR,"") Visys_AValidacaoString(RetornoSocket,DebugSN) RetornoSocket = "" END END END
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 14:44 |
Procedure Visys_Socket_Start(DebugSN)
Socket_IP is string = "" Socket_Porta is int = 0 Socket_TimeOut is int = 0
IF DebugSN = "S" ToastDisplay("Inicializando Conexão com o Socket TCP/IP",toastShort,vaTop,haCenter) END
PathFile_INI is string = fCurrentDir(fCurrentDrive()) +"\Nagyro.ini"
IF fFileExist(PathFile_INI) = True Modo is string = INIRead("Socket", "Socket_Ambiente", "", PathFile_INI) IF ErrorOccurred = True Socket_IP = INIRead("Socket", "Socket_IP", "", PathFile_INI) INIWrite("Socket", "Socket_Ambiente", "TESTE", PathFile_INI) INIWrite("Socket", "Socket_IP", Socket_IP, PathFile_INI) ELSE IF Modo = "PRODUCAO" Socket_IP = NetIPAddress() INIWrite("Socket", "Socket_Ambiente", "PRODUCAO", PathFile_INI) INIWrite("Socket", "Socket_IP", Socket_IP, PathFile_INI) ELSE Socket_IP = INIRead("Socket", "Socket_IP", "", PathFile_INI) INIWrite("Socket", "Socket_Ambiente", "TESTE", PathFile_INI) INIWrite("Socket", "Socket_IP", Socket_IP, PathFile_INI) END END Socket_IP = INIRead("Socket", "Socket_IP", "", PathFile_INI) IF ErrorOccurred = True OR Socket_IP = "" Socket_IP = "192.168.1.20" INIWrite("Socket", "Socket_IP", Socket_IP, PathFile_INI) END Socket_Porta = INIRead("Socket", "Socket_Porta", "", PathFile_INI) IF ErrorOccurred = True OR Socket_Porta = 0 Socket_Porta = 9965 INIWrite("Socket", "Socket_Porta", Socket_Porta, PathFile_INI) END Socket_TimeOut = INIRead("Socket", "Socket_TimeOut", "", PathFile_INI) IF ErrorOccurred = True OR Socket_TimeOut = 0 Socket_TimeOut = 5000 INIWrite("Socket", "Socket_TimeOut", Socket_TimeOut, PathFile_INI) END IF DebugSN = "S" ToastDisplay("Conexão Socket Porta: "+ Socket_Porta +" IP: "+ Socket_IP +" Time Out: "+ Socket_TimeOut,toastShort,vaTop,haCenter) END IF Socket_Porta > 0 AND Socket_IP <> "" AND Socket_TimeOut > 0 IF SocketExist("VISYS") = False IF SocketConnect("VISYS",Socket_Porta,Socket_IP,Socket_TimeOut) = True IF SocketChangeTransmissionMode("VISYS",SocketEndTagBuffer,"}") = True IF DebugSN = "S" ToastDisplay("Conexão com Sucesso com a Central Telefônica!!!!",toastShort,vaTop,haCenter) END gb_SocketStart = True ELSE gb_SocketStart = False IF DebugSN = "S" ToastDisplay("ERRO 02 ao tentar conetar com a Central Telefônica!!!!",toastShort,vaTop,haCenter) END END ELSE gb_SocketStart = False IF DebugSN = "S" ToastDisplay("ERRO 03 de Conexão com a Central Telefônica.",toastShort,vaTop,haCenter) END END END ELSE gb_SocketStart = False IF DebugSN = "S" ToastDisplay("ERRO 04 Informações incompletas!!!!",toastShort,vaTop,haCenter) END END ELSE gb_SocketStart = False IF DebugSN = "S" ToastDisplay("ERRO 05 Path do arquivo nagyro.ini nao existente!!!!",toastShort,vaTop,haCenter) END END
RESULT(gb_SocketStart)
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 14:47 |
INICIAR A CLASSE NO OPEN WINDOW DA JANELA QUE TEM O CAMPO DDD E TELEFONE QUE SERÁ IDENTIFICADO PELA CENTRAL TELEFONICA PANASONIC E SISTEMA VISYS
SocketStartThread("N")
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 14:48 |
AO SAIR DA TELA
SocketConnectedTimerList_End()
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 14:49 |
PROCEDURE LOCAL
Procedure SocketStartThread(DebugSN)
IF Visys_Socket_Start(DebugSN) = True
gbSocketOk = True CT_InicializarAtendimento = True IF DebugSN = "S" ToastDisplay("Conexão com o Socket TCP/IP: OK",toastShort,vaTop,haCenter) END IF gb_SocketStart = True IMG_Status = IMG_Verde ELSE IMG_Status = IMG_Vermelho END SocketConnectedTimerList(DebugSN) ELSE
gbSocketOk = False IF DebugSN = "S" ToastDisplay("ERRO 01: Não foi possivel inicializar a Conexão com o Socket TCP/IP",toastShort,vaTop,haCenter) END END
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 14:50 |
PROCEDURE LOCAL
Procedure SocketConnectedTimerList(DebugSN)
sThreadName is string = "TaskSocketNagyro"+Now() ThreadExecute(sThreadName,threadNormal,Visys_Socket_Read,DebugSN) ThreadPriority(sThreadName,PriorityNormal)
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 14:51 |
PROCEDURE LOCAL
Procedure SocketConnectedTimerList_End()
EndTimerSys(gnIdTimer) gb_SocketStart = False CT_InicializarAtendimento = False ThreadStop("TaskSocketNagyro",500) ThreadStop("TaskSocketNa
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 14:53 |
PROCEDURE LOCAL
Procedure SocketStartThread(DebugSN)
IF Visys_Socket_Start(DebugSN) = True
gbSocketOk = True CT_InicializarAtendimento = True IF DebugSN = "S" ToastDisplay("Conexão com o Socket TCP/IP: OK",toastShort,vaTop,haCenter) END IF gb_SocketStart = True IMG_Status = IMG_Verde ELSE IMG_Status = IMG_Vermelho END SocketConnectedTimerList(DebugSN) ELSE
gbSocketOk = False IF DebugSN = "S" ToastDisplay("ERRO 01: Não foi possivel inicializar a Conexão com o Socket TCP/IP",toastShort,vaTop,haCenter) END END
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 14:58 |
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 15:04 |
PROCEDURE DE LEITURA DO ARQUIVO INI PARA CONFIGURAÇÃO DO SOCKET
Procedure ReadIni()
Socket_IP,Modo is string = "" Socket_Porta is int = 0 Socket_TimeOut is int = 0
PathFile_INI is string = fCurrentDir(fCurrentDrive()) +"\CENTRALTELEFONICA.INI" IF fFileExist(PathFile_INI) = True gsTitulo = "SISEMA CENTRAL TELEFONICA" gsTitulo += " - Servidor: "+ INIRead("CENTRALTELEFONICA", "Server", "", PathFile_INI) IF ErrorOccurred = True Error() END gsTitulo += " - Base de Dados: "+ INIRead("CENTRALTELEFONICA", "BD", "", PathFile_INI) IF ErrorOccurred = True Error() END gsTitulo += " - Usuário: "+ INIRead("CENTRALTELEFONICA", "User", "", PathFile_INI) IF ErrorOccurred = True Error() END gsTitulo += " - Atendimentos: " STC_Desc = gsTitulo Modo = INIRead("Socket", "Socket_Ambiente", "", PathFile_INI) IF ErrorOccurred = True gw_IP4 = INIRead("Socket", "Socket_IP", "", PathFile_INI) INIWrite("Socket", "Socket_Ambiente", "TESTE", PathFile_INI) INIWrite("Socket", "Socket_IP", gw_IP4, PathFile_INI) ELSE IF Modo = "PRODUCAO" gw_IP4 = NetIPAddress() INIWrite("Socket", "Socket_Ambiente", "PRODUCAO", PathFile_INI) INIWrite("Socket", "Socket_IP", gw_IP4, PathFile_INI) ELSE gw_IP4 = INIRead("Socket", "Socket_IP", "", PathFile_INI) INIWrite("Socket", "Socket_Ambiente", "TESTE", PathFile_INI) INIWrite("Socket", "Socket_IP", gw_IP4, PathFile_INI) END END
Socket_IP = INIRead("Socket", "Socket_IP", "", PathFile_INI) IF ErrorOccurred = True OR Socket_IP = "" Socket_IP = "192.168.1.110" INIWrite("Socket", "Socket_IP", Socket_IP, PathFile_INI) END Socket_Porta = INIRead("Socket", "Socket_Porta", "", PathFile_INI) IF ErrorOccurred = True OR Socket_Porta = 0 Socket_Porta = 9965 INIWrite("Socket", "Socket_Porta", Socket_Porta, PathFile_INI) END Socket_TimeOut = INIRead("Socket", "Socket_TimeOut", "", PathFile_INI) IF ErrorOccurred = True OR Socket_TimeOut = 0 Socket_TimeOut = 5000 INIWrite("Socket", "Socket_TimeOut", Socket_TimeOut, PathFile_INI) END END ok is boolean = Titulo_Principal() IF ok =False Nao_Existe() END
CallCenter(gw_num_call_center)
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 15:09 |
PROCEDURE QUE RECEBE DA CLASSE O VALOR LIDO VIA SOCKET DA CENTRAL TELEFONICA
Procedure CentralTelefonica(resultado is dynamic CProtocolo, DebugSN)
IF EDT_Telefone_Origem = "" AND (resultado is CNovaLigacao OR resultado is CIniciarChamadaSimples OR resultado is CIniciarChamadaAvancada) EDT_DDD = resultado.m_DDD EDT_Telefone_Origem = resultado.m_Telefone IF DebugSN = "S" ToastDisplay("Nova Ligacao Numero: "+ EDT_DDD +" - "+ EDT_Telefone_Origem,toastShort,vaTop,haCenter) WIN_0002_CallCenter.EDT_Obs_Inf_Interna += "RESULTADO: Nova Ligacao Numero: "+ EDT_DDD +" - "+ EDT_Telefone_Origem + CRLF END BuscarCliente(EDT_DDD, EDT_Telefone_Origem) ELSE IF EDT_Telefone_Origem <> "" AND (resultado is CFimChamadaSimples OR resultado is CFimChamadaAvancada) IF DebugSN = "S" ToastDisplay("Fim da Chamada",toastShort,vaTop,haCenter) WIN_0002_CallCenter.EDT_Obs_Inf_Interna += "RESULTADO: Final da Chamada" + CRLF ExecuteProcess(BTN_NovoAtendimento,trtClick) SetFocus(EDT_Telefone_Origem) END END
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 15:14 |
CLASSES
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 10 février 2016 - 15:15 |
//Central Telefonica CT_InicializarAtendimento is boolean CT_FinalizarAtendimento is boolean
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | | | |
| | |
|