SlideShare uma empresa Scribd logo
Integrando Skype em aplicações DelphiAndreano LanusseTechnical Lead Evangelist, Developer Relations
O que é Skype?P2P Internet Telephone – VOIPComputador para ComputadorComputador para Telefone (SkypeOut)Telefone para  Computador (Skypein)P2P Instant MessengerTópicsHistóricosP2P Application Framework
O que é Skype?Mais de 500 milhões de downloadsMais de 130 milhões de usuários ativos4 a 8 milhões de usuários simultâneos250000 novos usuários por dia
O quão amigável é o SkypeDelphi amigávelWindows Client escrito em DelphiUsa Indy para as comunicações que não são P2PSDK Tools escrito em DelphiAlgumas documentação e interfaces escritas em pascalExemplosDelphiC++C#VBPhyton
Desenvolvendo para SkypeSkype APIMétodo original de integraçãoUsa Windows MessageMuito flexívelSkype4COM / Skype4JavaEasyObjectWrappersMenos flexívelSkype ExtrasPlug-in Framework
O que você precisa para usar Skype APIInstalaçãoSkype: http://www.skype.comNenhum outro arquivo necessárioDocumentaçãoAPI – https://developer.skype.com/Docs/ApiDocDev Notes - https://developer.skype.com/Docs/DevNotesEste apresentaçãoVamos focar no Skype API e Skype4COM
Usando Skype APIConectando ao SkypeRegistrar ‘SkypeControlAPIDiscover’ windows messageRegistrar ‘SkypeControlAPIAttach’ windows messageBroadcast ‘SkypeControlAPIDiscover’ windows messageSkype responde com um  ‘SkypeControlAPIAttach’ messageIdentificao o Protocolo  de referênciaprocedure TSkypeAPI.Connect;beginif IsSkypeInstalled thenbegin    FSkypeAPIDiscover := RegisterWindowMessage('SkypeControlAPIDiscover');    FSkypeAPIAttach := RegisterWindowMessage('SkypeControlAPIAttach');    SendMessage(HWND_BROADCAST, FSkypeAPIDiscover, Handle, 0)end;end;
Definindo Protocolo - Skype APIDefine qual protocolo usarOverride WndProcprocedure TSkypeAPI.WndProc(var Message: TMessage);beginif Message.Msg = FSkypeAPIAttach thenbeginif Message.LParam = 0 thenbegin      FSkypeAPIWindow := Message.WParam;      SendCommand('PROTOCOL '+IntTostr(FProtocol));endelseif Assigned(FOnConnectStatus) thencaseMessage.LParam of          1: FOnConnectStatus(Self,csWaitingForConfirmation);          2: FOnConnectStatus(Self,csDenied);          3: FOnConnectStatus(Self,csNotAvailable);else          FOnConnectStatus(Self,csNotAttached);end;Message.Result := 1end elseinherited;end;
Send Command - Skype APIDefinir parâmetros através da estrutura CopyDataStructprocedure TSkypeAPI.SendCommand(Str: String);var  CopyData: CopyDataStruct;beginif Str <> '' thenbegin    CopyData.dwData := 0;    CopyData.lpData := PChar(Str);    CopyData.cbData := Length(Str)+1;    SendMessage(FSkypeAPIWindow, WM_COPYDATA, Self.Handle,LPARAM(@CopyData));end;end;
Receive Command - Skype APIEspere pelo WM_COPYDATA messagelpData recebe o comando como PAnsiCharprocedure TSkypeAPI.WMCopyData(var Message: TWMCopyData);var  msg : String;beginif (Message.From = FSkypeAPIWindow) and     (FSkypeAPIWindow > 0) thenbegin    msg := PAnsiChar(Message.CopyDataStruct.lpData)    Message.Result := 1end;end;
Skype API WrapperJason Southwell e Dr. Bob criaram o componente TSkypeAPISkype API wrapperCódigo disponível no CodeCentral, facilita o uso do Skype API
Comandos - Skype APIPhone ControlAUDIO IN | OUT, HOOK ON | OFF, MUTE ON | OFF, BTN_PRESSED, BTN_RELEASEDVoice CallsCALL | GET CALL | SET CALL INPROGRESS | SET CALL FINISHED | SET CALL ONHOLD | SET CALL JOIN CONFERENCE | SET CALL DTMF | SET CALL SEEN | ALTER CALL | GET CALL CAN TRANSFER | ALTER CALL TRANSFERManaging call forwardingGET PROFILE CALL APPLY CF | SET PROFILE CALL APPLY CF | GET PROFILE CALL FORWARD RULES | SET PROFILE CALL FORWARD RULES | GET PROFILE CALL NOANSWER TIMEOUT | SET PROFILE CALL NOANSWER TIMEOUT | GET PROFILE CALL SEND TO VM | SET PROFILE CALL SEND TO VM |
Comandos - Skype APISending and managing SMS messagesCREATE SMS | SET SMS BODY | ALTER SMS SEND | SET SMS SEEN | SET SMS REPLY TO NUMBER | SET SMS TARGET NUMBERSCustom Application CommunicationAP2AP CREATE | AP2AP CONNECT | AP2AP WRITE | AP2AP DATAGRAM | AP2AP READ | AP2AP DISCONNECT | AP2AP DELETE Making and managing video callsGET VIDEO IN | SET VIDEO IN | GET CALL VIDEO STATUS | ALTER CALL VIDEO SEND | ALTER CALL VIDEO RECEIVE | GET CALL VIDEO SEND STATUS | GET CALL VIDEO RECEIVE STATUS | IS VIDEO CAPABLE | OPEN VIDEOTEST | OPEN OPTIONS VIDEO
Comandos - Skype APIManaging contacts and groupsGET GROUP USERS | GET GROUP VISIBLE | GET GROUP EXPANDED | GET GROUP DISPLAYNAME | SET GROUP DISPLAYNAME | GET GROUP TYPE | CREATE GROUP | DELETE GROUP | ALTER GROUP ADDUSER | ALTER GROUP REMOVEUSER | SET USER DISPLAYNAMELista completa de comandoshttps://developer.skype.com/Docs/ApiDoc/Commands
Demo Skype API
O que você precisa para usar Skype4COMInstalaçãoSkype: http://www.skype.comSkype4COM.dllhttp://developer.skype.com/accessoriesPrecisa registrar a DLLObjectWrapper para APIAjuda a entender os comandos da API
Objetos principais - Skype4COMSkype (ISkype)Core integration objectFornece acesso a maioria dos objetosComponente “Visual” quando importadoDrop no form o crie em runtimeApplication (IApplication)Crie aplicações p2p usando o Skype frameworkIApplication tem conflito com VCL TApplication, referencie Forms.Application para evitar este problema
Demo Skype4COMUsando VCLUsando TMS Smooth Controls
ExemplosCódigo fonte disponível para downloadhttp://cc.embarcadero.com/Item/27742
PerguntasEDN – Embarcadero Developer Networkhttp://edn.embarcadero.com/br   (Artigos e Vídeos)Trial Downloadhttp://www.embarcadero.com/downloadsCódigo fonte disponível para downloadhttp://cc.embarcadero.com/Item/27742
Dados para ContatoEmail:Andreano.Lanusse@embarcadero.comBlog:http://www.andreanolanusse.comTwitter:http://twitter.com/andreanolanusse

Mais conteúdo relacionado

PDF
Designing IBM MQ deployments for the cloud generation
PPTX
SOLID : les principes à l’origine du succès de Symfony et de vos applications
PDF
DCSF19 Dockerfile Best Practices
PPTX
NGINX Kubernetes Ingress Controller: Getting Started – EMEA
PDF
Software Defined Datacenter with Proxmox
PDF
DNUG HCL Domino 11 First Look
PDF
Understanding Telecom SIM and USIM/ISIM for LTE
PDF
Using Node-RED for building IoT workflows
Designing IBM MQ deployments for the cloud generation
SOLID : les principes à l’origine du succès de Symfony et de vos applications
DCSF19 Dockerfile Best Practices
NGINX Kubernetes Ingress Controller: Getting Started – EMEA
Software Defined Datacenter with Proxmox
DNUG HCL Domino 11 First Look
Understanding Telecom SIM and USIM/ISIM for LTE
Using Node-RED for building IoT workflows

Mais de Andreano Lanusse (10)

PDF
Scaling Agile With SAFe (Scaled Agile Framework)
PDF
Desafios na Gestão de Equipes Virtuais - Agile Brazil 2012
PDF
Delphi Certification
PDF
Certificação Delphi
PDF
Desenvolvendo aplicações para iPhone/iPad e Linux com Delphi Prism XE
PDF
Reasons to migrate to Delphi XE
PDF
Delphi Prism for iPhone/iPad and Linux with Mono and Monotouch
PPTX
Delphi Prism 2011
PPTX
Resolvendo problemas de performance em aplicações Delphi e bancos de dados
PPTX
Testando aplicações DataSnap
Scaling Agile With SAFe (Scaled Agile Framework)
Desafios na Gestão de Equipes Virtuais - Agile Brazil 2012
Delphi Certification
Certificação Delphi
Desenvolvendo aplicações para iPhone/iPad e Linux com Delphi Prism XE
Reasons to migrate to Delphi XE
Delphi Prism for iPhone/iPad and Linux with Mono and Monotouch
Delphi Prism 2011
Resolvendo problemas de performance em aplicações Delphi e bancos de dados
Testando aplicações DataSnap
Anúncio

Último (19)

PDF
Custos e faturamento no SAP S/4HANA Transportation Management, S4TM3 Col26
PPTX
Aula16ManipulaçãoDadosssssssssssssssssssssssssssss
PDF
Custos e liquidação no SAP Transportation Management, TM130 Col18
PDF
Fundamentos de gerenciamento de ordens e planejamento no SAP TransportationMa...
PDF
Processos na gestão de transportes, TM100 Col18
PDF
Mergulho profundo técnico para gestão de transportes no SAP S/4HANA, S4TM6 Col14
PPTX
Gestao-de-Bugs-em-Software-Introducao.pptxxxxxxxx
PDF
Aula04-Academia Heri- Tecnologia Geral 2025
PDF
Apple Pippin Uma breve introdução. - David Glotz
PPTX
BANCO DE DADOS - AULAS INICIAIS-sgbd.pptx
PDF
Fullfilment AI - Forum ecommerce 2025 // Distrito e Total Express
PPTX
Aula 18 - Manipulacao De Arquivos python
PDF
Otimizador de planejamento e execução no SAP Transportation Management, TM120...
PDF
Gestão de transportes básica no SAP S/4HANA, S4611 Col20
PPTX
Como-se-implementa-um-softwareeeeeeeeeeeeeeeeeeeeeeeee.pptx
PDF
COBITxITIL-Entenda as diferença em uso governança TI
PPTX
Programação - Linguagem C - Variáveis, Palavras Reservadas, tipos de dados, c...
PDF
20250805_ServiceNow e a Arquitetura Orientada a Serviços (SOA) A Base para Ap...
PPTX
Informática Aplicada Informática Aplicada Plano de Ensino - estudo de caso NR...
Custos e faturamento no SAP S/4HANA Transportation Management, S4TM3 Col26
Aula16ManipulaçãoDadosssssssssssssssssssssssssssss
Custos e liquidação no SAP Transportation Management, TM130 Col18
Fundamentos de gerenciamento de ordens e planejamento no SAP TransportationMa...
Processos na gestão de transportes, TM100 Col18
Mergulho profundo técnico para gestão de transportes no SAP S/4HANA, S4TM6 Col14
Gestao-de-Bugs-em-Software-Introducao.pptxxxxxxxx
Aula04-Academia Heri- Tecnologia Geral 2025
Apple Pippin Uma breve introdução. - David Glotz
BANCO DE DADOS - AULAS INICIAIS-sgbd.pptx
Fullfilment AI - Forum ecommerce 2025 // Distrito e Total Express
Aula 18 - Manipulacao De Arquivos python
Otimizador de planejamento e execução no SAP Transportation Management, TM120...
Gestão de transportes básica no SAP S/4HANA, S4611 Col20
Como-se-implementa-um-softwareeeeeeeeeeeeeeeeeeeeeeeee.pptx
COBITxITIL-Entenda as diferença em uso governança TI
Programação - Linguagem C - Variáveis, Palavras Reservadas, tipos de dados, c...
20250805_ServiceNow e a Arquitetura Orientada a Serviços (SOA) A Base para Ap...
Informática Aplicada Informática Aplicada Plano de Ensino - estudo de caso NR...
Anúncio

Integrando Skype em aplicações Delphi

  • 1. Integrando Skype em aplicações DelphiAndreano LanusseTechnical Lead Evangelist, Developer Relations
  • 2. O que é Skype?P2P Internet Telephone – VOIPComputador para ComputadorComputador para Telefone (SkypeOut)Telefone para Computador (Skypein)P2P Instant MessengerTópicsHistóricosP2P Application Framework
  • 3. O que é Skype?Mais de 500 milhões de downloadsMais de 130 milhões de usuários ativos4 a 8 milhões de usuários simultâneos250000 novos usuários por dia
  • 4. O quão amigável é o SkypeDelphi amigávelWindows Client escrito em DelphiUsa Indy para as comunicações que não são P2PSDK Tools escrito em DelphiAlgumas documentação e interfaces escritas em pascalExemplosDelphiC++C#VBPhyton
  • 5. Desenvolvendo para SkypeSkype APIMétodo original de integraçãoUsa Windows MessageMuito flexívelSkype4COM / Skype4JavaEasyObjectWrappersMenos flexívelSkype ExtrasPlug-in Framework
  • 6. O que você precisa para usar Skype APIInstalaçãoSkype: http://www.skype.comNenhum outro arquivo necessárioDocumentaçãoAPI – https://developer.skype.com/Docs/ApiDocDev Notes - https://developer.skype.com/Docs/DevNotesEste apresentaçãoVamos focar no Skype API e Skype4COM
  • 7. Usando Skype APIConectando ao SkypeRegistrar ‘SkypeControlAPIDiscover’ windows messageRegistrar ‘SkypeControlAPIAttach’ windows messageBroadcast ‘SkypeControlAPIDiscover’ windows messageSkype responde com um ‘SkypeControlAPIAttach’ messageIdentificao o Protocolo de referênciaprocedure TSkypeAPI.Connect;beginif IsSkypeInstalled thenbegin FSkypeAPIDiscover := RegisterWindowMessage('SkypeControlAPIDiscover'); FSkypeAPIAttach := RegisterWindowMessage('SkypeControlAPIAttach'); SendMessage(HWND_BROADCAST, FSkypeAPIDiscover, Handle, 0)end;end;
  • 8. Definindo Protocolo - Skype APIDefine qual protocolo usarOverride WndProcprocedure TSkypeAPI.WndProc(var Message: TMessage);beginif Message.Msg = FSkypeAPIAttach thenbeginif Message.LParam = 0 thenbegin FSkypeAPIWindow := Message.WParam; SendCommand('PROTOCOL '+IntTostr(FProtocol));endelseif Assigned(FOnConnectStatus) thencaseMessage.LParam of 1: FOnConnectStatus(Self,csWaitingForConfirmation); 2: FOnConnectStatus(Self,csDenied); 3: FOnConnectStatus(Self,csNotAvailable);else FOnConnectStatus(Self,csNotAttached);end;Message.Result := 1end elseinherited;end;
  • 9. Send Command - Skype APIDefinir parâmetros através da estrutura CopyDataStructprocedure TSkypeAPI.SendCommand(Str: String);var CopyData: CopyDataStruct;beginif Str <> '' thenbegin CopyData.dwData := 0; CopyData.lpData := PChar(Str); CopyData.cbData := Length(Str)+1; SendMessage(FSkypeAPIWindow, WM_COPYDATA, Self.Handle,LPARAM(@CopyData));end;end;
  • 10. Receive Command - Skype APIEspere pelo WM_COPYDATA messagelpData recebe o comando como PAnsiCharprocedure TSkypeAPI.WMCopyData(var Message: TWMCopyData);var msg : String;beginif (Message.From = FSkypeAPIWindow) and (FSkypeAPIWindow > 0) thenbegin msg := PAnsiChar(Message.CopyDataStruct.lpData) Message.Result := 1end;end;
  • 11. Skype API WrapperJason Southwell e Dr. Bob criaram o componente TSkypeAPISkype API wrapperCódigo disponível no CodeCentral, facilita o uso do Skype API
  • 12. Comandos - Skype APIPhone ControlAUDIO IN | OUT, HOOK ON | OFF, MUTE ON | OFF, BTN_PRESSED, BTN_RELEASEDVoice CallsCALL | GET CALL | SET CALL INPROGRESS | SET CALL FINISHED | SET CALL ONHOLD | SET CALL JOIN CONFERENCE | SET CALL DTMF | SET CALL SEEN | ALTER CALL | GET CALL CAN TRANSFER | ALTER CALL TRANSFERManaging call forwardingGET PROFILE CALL APPLY CF | SET PROFILE CALL APPLY CF | GET PROFILE CALL FORWARD RULES | SET PROFILE CALL FORWARD RULES | GET PROFILE CALL NOANSWER TIMEOUT | SET PROFILE CALL NOANSWER TIMEOUT | GET PROFILE CALL SEND TO VM | SET PROFILE CALL SEND TO VM |
  • 13. Comandos - Skype APISending and managing SMS messagesCREATE SMS | SET SMS BODY | ALTER SMS SEND | SET SMS SEEN | SET SMS REPLY TO NUMBER | SET SMS TARGET NUMBERSCustom Application CommunicationAP2AP CREATE | AP2AP CONNECT | AP2AP WRITE | AP2AP DATAGRAM | AP2AP READ | AP2AP DISCONNECT | AP2AP DELETE Making and managing video callsGET VIDEO IN | SET VIDEO IN | GET CALL VIDEO STATUS | ALTER CALL VIDEO SEND | ALTER CALL VIDEO RECEIVE | GET CALL VIDEO SEND STATUS | GET CALL VIDEO RECEIVE STATUS | IS VIDEO CAPABLE | OPEN VIDEOTEST | OPEN OPTIONS VIDEO
  • 14. Comandos - Skype APIManaging contacts and groupsGET GROUP USERS | GET GROUP VISIBLE | GET GROUP EXPANDED | GET GROUP DISPLAYNAME | SET GROUP DISPLAYNAME | GET GROUP TYPE | CREATE GROUP | DELETE GROUP | ALTER GROUP ADDUSER | ALTER GROUP REMOVEUSER | SET USER DISPLAYNAMELista completa de comandoshttps://developer.skype.com/Docs/ApiDoc/Commands
  • 16. O que você precisa para usar Skype4COMInstalaçãoSkype: http://www.skype.comSkype4COM.dllhttp://developer.skype.com/accessoriesPrecisa registrar a DLLObjectWrapper para APIAjuda a entender os comandos da API
  • 17. Objetos principais - Skype4COMSkype (ISkype)Core integration objectFornece acesso a maioria dos objetosComponente “Visual” quando importadoDrop no form o crie em runtimeApplication (IApplication)Crie aplicações p2p usando o Skype frameworkIApplication tem conflito com VCL TApplication, referencie Forms.Application para evitar este problema
  • 18. Demo Skype4COMUsando VCLUsando TMS Smooth Controls
  • 19. ExemplosCódigo fonte disponível para downloadhttp://cc.embarcadero.com/Item/27742
  • 20. PerguntasEDN – Embarcadero Developer Networkhttp://edn.embarcadero.com/br (Artigos e Vídeos)Trial Downloadhttp://www.embarcadero.com/downloadsCódigo fonte disponível para downloadhttp://cc.embarcadero.com/Item/27742