Announcement

Collapse
No announcement yet.

Skype Connector Plugin Documentation

Collapse
This topic is closed.
X
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Skype Connector Plugin Documentation

    Welcome to the Skype Connector plugin !


    The Skype Connector has features similar to both the Instant Messenging Connector, and the SIP Connector.

    - You can control HomeSeer from Skype Instant Messages, the same way as you can control HomeSeer from Jabber / MSN / Yahoo / ICQ... with the Instant Messenging connector.

    - You can control HomeSeer from Skype Voice over IP phone calls the same way as with the SIP Connector. You just have to call the skype user that is running on your HomeSeer box, and homeseer will start talking to you, and ask you questions about what you want to do. IVR scripts that control call flow are very similar to the SIP Connector scripts, and can access all HomeSeer features. If you subscribed to SkypeIn, you can also get a real phone number to call HomeSeer.

    - HomeSeer can send SMS to mobile phones (If you have enough Skype Credits to send SMS).

    - HomeSeer can call any Skype user, and any PSTN phone if you have enough Skype Credits.



    Voice over IP features

    With the Skype plugin, your Homeseer computer can place and answer calls, can play and record wav files, speak and recognize DTMF tones... but you don't need any voice or analog modem ! You can build all kinds of interactive menus using the HomeSeer VB.NET scripting engine, and interact with HomeSeer devices the way you like.

    - Supports inbound and outbound calls from/to any Skype Voice over IP Client.
    - Supports outbound calls to any PSTN phone as long as you have enough Skype Credit
    - Supports inbound calls from any PSTN phone as long as you subscribed to Skype-In
    - Text to speech
    - Playing and recording wav files
    - DTMF recognition
    - Integration with HomeSeer contact-list (Names, phone numbers, ring count before answer, announce caller, hangup on this caller)
    - Caller-id announcements through HomeSeer Speaker.
    - Integration with homeseer phone mailbox (leaving a message in a HS MailBox)
    - Integration with HomeSeer phone answering machine (reading your messages)
    - New event action added to Place outbound calls easily from any event.
    - Script API to place calls from your scripts.
    - Inband DTMF decoder for inbound and outbound PSTN calls.
    - As the plugin is 100% driven by HomeSeer scripts, you can easily customize the sample IVR and build your own IVR scripts.


    The sample IVR scripts installed with the plugin allow any caller to leave a message on your HomeSeer phone mailboxes. If you type the access code of your mailbox using DTMF keys, you access the admin menu. From there, you can review your messages, control HS devices, or transfer your call.


    Instant messenging features

    - You can fully control HomeSeer from any Skype Client using instant messages.
    - Access level definition for each user
    - Nested menus
    - Macro definition with parameter substitution
    - Device status by device code or device location + device name
    - Can send all X10 commands by device code or device location + device name
    - Thermostat control... etc
    - Real time HomeSeer log forwarding, with filtering capabilities
    - Supports sending Skype instant messages to any contact
    - New event action added to Send a Skype instant message easily from any event.
    - Script API to Send instant messages from your scripts.


    SMS Feature

    - HomeSeer can send a SMS to any mobile phone, if you have enough Skype credit.
    - New event action added to Send a SMS easily from any event.
    - Script API to Send SMS from your scripts.
    - The script /Scripts/skype_sms_status.vb is run each time a SMS is delivered, or failed to deliver, so that you can follow SMS delivery status (See Scripting API for more Info).


    User Online Status Feature

    - A HomeSeer device can be created for each of your Skype contacts to follow their Online Status


    Installing the plugin:

    1) Install the latest version of the Skype Client on your HomeSeer PC, create a SkypeID and connect to the skype network.

    2) Go to the HomeSeer updater, and choose the Skype Voip and SMS Connector plugin.

    3) Once the plugin has been installed, you need to go to Setup/Interface and Enable the plugin.

    To control HomeSeer from Skype Instant Messages, you have to configure the allowed Skype IDs. Go to Setup/Interfaces/Skype Connector/Config, then add allowed user ids and select the access level.

    The sample Call-Flow scripts are also available in French. You can go to Setup/Interfaces/Skype Connector/Config then in the Settings tab choose skype_incoming_fr.vb as the Incoming Call Script.


    Direct Links:

    Skype Connector - Instant Message Command Reference
    Skype Connector - HomeSeer Event Actions
    Skype Connector - HomeSeer Scripting API
    Skype Connector - Call-Flow Scripting API
    Skype Connector - Call-Flow Voice Recognition Scripting API
    Skype Connector - Sample Call-Flow Scripts
    Help: If you don't have HomeSeer Phone...


    Known issues:

    - Problem with 8KHz wav files in your HS mailbox... Skype only works with 16KHz wav files.

    - The plugin may not talk if the default voice is set to a Neospeech voice (Kate16 / Paul16) in the Windows Control Panel TTS applet. This problem is currently under investigation.

    - The plugin cannot connect to old Skype Clients... if you see the SKYPE HomeSeer device with a never ending "Connecting..." status, first try to restart HomeSeer, then please update your Skype Client to the latest version if it still can't connect.

    - On Vista / Windows 7 computers with UAC, if you run HomeSeer as Administrator, you also have to run Skype.exe as Administrator. Otherwise, the 2 applications cannot communicate.

    - If you are running HS as a service, then you need to check the "allow this service to interract with the Desktop" checkbox in the Service configuration control panel applet.
    Last edited by stipus; March 7, 2010, 04:10 AM.
    --
    stipus

    #2
    Access level and menu definition for Skype users.

    Note: All this can now be done using the Web Configuration Interface. This is only kept here as a reference for the .ini format.

    Each user allowed to control HomeSeer from Skype instant messages has to be configured in the [SKYPE Users] section of the ini file.
    The format of the section is SkypeUserId=AccessLevel OptionalMenu

    [SKYPE Users]
    SkypeUser1=ADMIN
    SkypeUser2=GUEST
    SkypeUser3=GUEST main

    Notes:
    Replace SkypeUser1,2,3 ... with real Skype User IDs.
    Access Levels ADMIN and GUEST must be defined.
    MENU main must be defined. This menu will be automatically shown to SkypeUser3.

    Example access levels:

    List of commands allowed for the ADMIN access LEVEL (all basic commands).

    Code:
     
    [LEVEL ADMIN]    
    1=INPUT HELP/Help system
    2=INPUT VERSION/Homeseer and plugin version
    3=INPUT STATUS/Device status
    4=INPUT SET/Device action
    5=INPUT EVENT/Event management
    6=INPUT SCRIPT/Script management
    7=INPUT MENU/Menu management
    8=INPUT PRINT/Print message
    9=INPUT INPUT/Command management
    10=INPUT TEMP/Thermostats management
    11=INPUT LOG/Toggle Homeseer log forwarding
    12=INPUT SPEAK/Send a message to speaker client
    13=INPUT FILE/File transferts
    List of commands allowed for the GUEST access LEVEL. Only the commands HELP, VERSION and STATUS are allowed

    Code:
     
    [LEVEL GUEST]  
    1=INPUT HELP/Help system
    2=INPUT VERSION/Homeseer and plugin version
    3=INPUT STATUS/Device status
    Here is an example of nested menus with the following MENU hierarchy:

    [MENU main]
    --[MENU rooms]
    ----[MENU room1]
    ----[MENU room2]

    Code:
    [MENU main]
    1=PRINT Please type command S, A or R
    2=PRINT
    3=INPUT S/show all lights/STATUS L1/STATUS L2/STATUS L3
    4=INPUT A/stop appliance 1 and 2/SET A1 OFF/SET A2 OFF
    5=PRINT
    6=INPUT R/Room list/MENU rooms
     
    [MENU rooms]
    1=PRINT Room List. Please choose room 1 or 2
    2=PRINT Press B to return to main menu 
    3=PRINT
    4=INPUT 1/Room 1/MENU room1
    5=INPUT 2/Room 2/MENU room2
    6=PRINT
    7=INPUT B/Back to main menu/MENU main
     
    [MENU room1]
    1=PRINT MENU ROOM 1
    2=PRINT
    3=INPUT S/Show room status/SCRIPT status_room.txt room1
    4=PRINT
    5=INPUT FON/Start fan/SET F1 ON
    6=INPUT FOFF/Stop fan/SET F1 OFF
    7=PRINT
    8=INPUT B/Back to room list/MENU rooms
    9=INPUT HOME/Back to main menu/MENU main
     
    [MENU room2]
    1=PRINT MENU ROOM 2.
    2=PRINT
    3=INPUT S/Show room status/SCRIPT status_room.txt room2
    4=PRINT
    5=INPUT FON/Start fan/SET F2 ON
    6=INPUT FOFF/Stop fan/SET F2 OFF
    7=PRINT
    8=INPUT B/Back to room list/MENU rooms
    9=INPUT HOME/Back to main menu/MENU main
    Last edited by stipus; November 21, 2007, 02:07 AM.
    --
    stipus

    Comment


      #3
      SKYPE INSTANT MESSAGES PLUGIN COMMANDS


      QuickRef: Example commands from Skype:

      SET A1+2 ON <-- Device action from device code
      SET Room2 Lamp3 DIM 40 <-- Device action from device name (location + name)
      STATUS A1 <-- Show status from device code
      STATUS Room2 Lamp3 <-- Show status from device name (location + name)
      STATUS <-- Show status for all devices
      LOG <-- Show realtime HomeSeer event log (very usefull!)
      EVENT <-- List all events
      EVENT My event <-- Trigger EVENT 'My event'
      SCRIPT <-- List all scripts
      SCRIPT scr.txt Hello <-- RUN Main(Hello) in script scr.txt
      SPEAK Hello World <-- Speak Hello World


      LOG COMMAND:

      This is a cool feature to be able to watch realtime HomeSeer activity from any authorized Skype Client !
      Syntax:
      LOG [FILTER] [CLEAR | filterstring]

      LOG Without parameter is a toggle.
      If LOG is ON, HomeSeer will forward new log entries to your IM Client
      LOG FILTER will show the active filter list
      To change the active filter list, use
      LOG FILTER filter string 1/Filter string 2/ ... /Filter string n
      LOG FILTER CLEAR will clear the filter list


      EVENT COMMAND:

      EVENT without parameter --> Event list
      EVENT event_name --> Run named Event


      SCRIPT COMMAND:

      SCRIPT without parameter --> Script list
      SCRIPT <script_name> --> Run function or Sub Main() in named script
      SCRIPT <script_name> <parameter> --> Run Function Main( parameter ) in named script
      If Main() is a Function and returns a value, the value will be displayed


      TEMP COMMAND:

      TEMP <device_code> <thermostat_command> [data]
      Thermostat commands:
      GetTemp = Returns the current temperature
      GetSetPoint = Returns the current heat set point
      GetFan = Returns the Fan mode (0=off, 1=on)
      GetMode = Returns the operating mode (0=off, 1=heat, 2=cool, 3=auto)
      SetSetPoint = Sets the current heat set point
      SetFan = Sets the current fan mode
      SetMode = Sets the current operation mode
      SetCoolSetPoint = Sets the current cool set point (if supported by the thermostat)
      TEMP device_code is a shortcut for TEMP device_code GetTemp


      SET COMMAND:

      SET allows you to send X10 commands to your devices
      SET device_code | location+device_name X10Command [DimValue] [Data]
      If you use the set command by name, location and device name
      should be separated by a single space.

      Example:
      Location="My Bedroom"
      Device_name="Lamp 1"
      SET My Bedroom Lamp 1 DIM 60

      Allowed X10 Commands:
      On,Off,Dim,Bright,DDim,NoCmd, All Units Off, All Lights On,
      All Lights Off, Dim to Off, DimAB, DimBF
      Extended, Preset Dim, Status Request, Status On, Status Off

      Please read HomeSeer documentation for ExecX10()

      Examples:
      SET D3+4 ON
      SET D3 DIM 40
      SET Room5 Lamp4 ON


      STATUS COMMAND:

      Print device status

      Syntax: STATUS [ALL | device_code | device_location | device_location+device_name]

      Examples:
      STATUS <-- Show status for all visible devices
      STATUS ALL <-- Show status for all devices (including hidden)
      STATUS A1 <-- Show status fo device A1
      STATUS Room2 Lamp1 <-- Show status from device name (location + name)
      STATUS Room2 <-- Show status for all devices at location Room2


      INPUT COMMAND:

      - With the INPUT Command, any user can define macros.

      For example, the following entry defines a new command 'AO'.

      INPUT AO/My comment/PRINT Appliance 1 ON/SET A1 ON/STATUS A1

      - To review available INPUTS, use the command INPUT without any parameter.
      The command will list the currently defined Access LEVEL inputs, MENU inputs,
      and USER inputs.

      - To save user defined INPUTS, use the command INPUT SAVE
      Note: User INPUTs will be run in the User context, and of course, they cannot include commands that are not available to the user (commands not defined in the user access LEVEL).

      The input command also supports parameter substitution $1, $2, $3... and $*

      INPUT TEST/Test/PRINT $1/PRINT $2/PRINT $*
      TEST
      $1
      $2
      $*
      TEST AA
      AA
      $2
      AA
      TEST AA BB
      AA
      BB
      AA BB

      Another more useful example:
      INPUT Wake/Wake me up/SCRIPT custom_im_script.txt $*
      INPUT SAVE
      Then when you type Wake Tuesday 6:00, the custom_im_script will be run with Tuesday 6:00 as a parameter.

      From V1.17.2.2, the INPUT command supports more substitutions

      $USER --> skype user id
      $DATE --> date
      $TIME --> time
      $ACCESSLEVEL --> user access level
      $MAINMENU --> user main menu

      Example: define a new input macro that prints the curent user id and access level.

      INPUT TEST/test/PRINT $USER has access level $ACCESSLEVEL

      Then run the command: TEST
      stipus has access level ADMIN

      VERSION COMMAND:

      Syntax: VERSION [PLUGIN | HOMESEER]

      Examples:
      VERSION
      Print HomeSeer and Plugin Version
      VERSION HOMESEER
      Print HomeSeer Version
      VERSION PLUGIN
      Print Plugin Version


      HELP COMMAND:

      Print HELP messages on basic commands

      Examples:
      HELP
      Print quick help on all available commands
      HELP INPUT
      Help on the INPUT command
      HELP LOG
      Help on the LOG command
      HELP TEMP
      Help on the TEMP command


      PRINT COMMAND:

      Prints a message. This is usefull to define MENUS or MACROS (with the INPUT command)

      Syntax: PRINT <message>
      Example: PRINT Hello World!


      SPEAK COMMAND:
      Send a message to connected speaker clients

      Syntax: SPEAK [message] [host:instance]

      Without parameter, the command lists the connected speaker instances.
      The host:instance parameter is optional and must contain ":"
      You can use "*" as a joker for instance

      Examples:
      SPEAK
      SPEAK Hello World !
      SPEAK Hello there in the kitchen kitchen:*


      FILE COMMAND:

      Lists of the files in a directory:
      FILE DIR <directory>
      Last edited by stipus; October 13, 2008, 07:41 PM.
      --
      stipus

      Comment


        #4
        PLUGIN SCRIPTING API

        SendMessage API:

        Example test.vb script that sends "Hello World !" to stipus18 skype user:

        Code:
        Sub Main( param )
            Dim skype = hs.plugin("Skype Connector")
            If skype is Nothing then
                hs.WriteLog( "Warning", "Skype Connector not found !")
            Else
                skype.SendMessage( "stipus18", "Hello world !" )
            End If
        End Sub

        PlaceCall API:

        &hs.plugin("Skype Connector").PlaceCall targetUser, callFlowScript
        &hs.plugin("Skype Connector").PlaceCallParam targetUser, callFlowScript, param

        targetUser must be a Skype ID, or a phone number in international format (+...).
        You need Skype credit to place calls to PSTN phone numbers.
        If you use the PlaceCallParam API, the call flow script can get the parameter using SkypeCall.GetContext( "param" )


        Example:
        &hs.plugin("Skype Connector").PlaceCall "stipus18", "skype_talking_clock.vb"


        Send SMS API:

        &hs.plugin("Skype Connector").SendSMS mobilePhoneNumber, message

        The mobile phone number must be specified in international format (+)
        You need Skype credit to send SMS to mobile phones.

        Example:
        &hs.plugin("Skype Connector").SendSMS "+33678563412", "hello from HomeSeer"


        Version API:

        &hs.WriteLog "version", hs.plugin("Skype Connector").Version


        Online API:

        &hs.WriteLog "online", hs.plugin("Skype Connector").Online


        Incoming Script API:

        You can query and change the call-flow incoming script using this API.
        &hs.WriteLog "script", hs.plugin("Skype Connector").IncomingScript
        &hs.plugin("Skype Connector").IncomingScript = "skype_talking_clock.vb"


        SMS Status Script API:

        You can query and change the script that is ran each time a SMS is delivered, or failed to deliver.
        &hs.WriteLog "SMSscript", hs.plugin("Skype Connector").SmsScript
        &hs.plugin("Skype Connector").SmsScript = "skype_sms_status.vb"


        IsBusy API: (Skype Connector 1.31.2.4+)

        Returns true if the Skype Connector is already busy processing an active call.
        Returns false is the Skype Connector is idle.
        &hs.WriteLog "IsBusy", hs.plugin("Skype Connector").IsBusy


        Debug API:

        You can query and change the Debug and DebugSkypeResponse settings using the API
        &hs.WriteLog "debug", hs.plugin("Skype Connector").Debug
        &hs.WriteLog "debug", hs.plugin("Skype Connector").DebugSkypeResponse


        FOLLOWING SMS DELIVERY STATUS

        Each time a SMS is sent to the skype server, is delivered, or failed to deliver, a homeseer script is run. You can change this script to track your SMS the way you need. The default script writes a message to the HomeSeer event log.

        HomeSeer 2/Scripts/skype_sms_status.vb
        Code:
        Imports HSPI_SKYPE
        ' Properties of the SkypeSms object:
        '
        ' sms.Id
        ' sms.Status (COMPOSING, SENDING_TO_SERVER, SENT_TO_SERVER, DELIVERED, SOME_TARGETS_FAILED, FAILED)
        ' sms.TargetNumbers
        ' sms.TargetStatuses
        ' sms.Price
        ' sms.Body
        ' sms.FailureReason
         
        Sub SkypeSmsStatus( ByVal sms As SkypeSms )
          If sms.Status = "DELIVERED" Then
            hs.WriteLog( "SkypeSMS", "SMS " & sms.Id & " delivered to " & sms.TargetNumbers )
          Else If sms.Status = "FAILED" Then
            hs.WriteLog( "SkypeSMS", "SMS " & sms.Id & " failed to be delivered to " & sms.TargetNumbers & " Failure reason: " & sms.FailureReason )
          End If
        End Sub
        Last edited by stipus; April 17, 2010, 06:33 AM.
        --
        stipus

        Comment


          #5
          NEW HOMESEER EVENT ACTIONS:

          The Skype Connector adds 3 new Event actions to HomeSeer:

          - Place Skype Call

          This event action places an outgoing call to the skype user or phone number you provide. (You must have enough Skype credit to call a PSTN phone number).
          A call flow script must be choosen (You can try with skype_talking_clock.vb).
          An optional parameter can be added. The call flow script can get the parameter using c.GetContext( "param" )

          - Send Skype Message

          This event action sends a Skype Instant Message to any Skype User ID

          - Send Skype SMS

          This event action sends a Skype SMS to any mobile phone. (You must have enough Skype credit to send SMS).


          HomeSeer parameter substitutions

          You can use HomeSeer parameter substitutions for the Place Skype Call parameter, and for the message text.

          Example: you can send a text message with the following message: "The status of the Family Room Light is $$DS:B5"

          $$DS:B5 is the HomeSeer parameter substitution to get the Device String for device B5
          (See HomeSeer documentation for more info on parameter substitution)
          Last edited by stipus; October 13, 2008, 07:46 PM.
          --
          stipus

          Comment


            #6
            CALL-FLOW API DOCUMENTATION

            The SKYPE plugin is 100% driven by HomeSeer VB.NET scripts. You can find and edit all the sample scripts (in the HomeSeer 2\Scripts directory) to suit your specific needs.

            Note:

            If you have written special scripts for the SIP Connector, they should be compatible with the Skype Connector.
            Just replace in your scripts:
            - IMPORTS HSPI_SIP with IMPORT HSPI_SKYPE
            - All SipCall object references with SkypeCall object references


            How does it work ?

            Each time there is an event happening on the line, a specific Subroutine will be called in the current active HomeSeer script. A SkypeCall object is passed to the Subroutine as a parameter. You then use the SkypeCall object to send commands to the call (speak, play files...)


            Exemple in skype_incoming.vb :

            PHP Code:
             Imports HSPI_SKYPE 
             
            Sub IncomingCall
            ByVal newCall as SkypeCall )
             
            If 
            newCall.RemoteAddress "unwanted phone number" Then
                 newCall
            .Reject()
                 Exit 
            Sub 
            End 
            if
             
            newCall.Accept()
            End Sub 
            Once the call has been accepted, the Ringing() callback will be called in your code.

            PHP Code:
             Sub RingingByVal newCall as SkypeCall 
                If 
            newCall.RingCount 3 Then
                    newCall
            .LoadScript"skype_unknown.vb" )
                    
            newCall.Answer()
                
            End If
            End Sub 
            The line newCall.LoadScript( "skype_unknown.vb" ) tells the plugin to direct all new call events to the skype_unknown.vb script.

            As the next line is newCall.Answer(), you can expect a CallConnected() event happening within a few milliseconds in skype_unknown.vb

            Exemple in skype_unknown.vb :

            PHP Code:
            Sub CallConnectedByVal c as SkypeCall )
            c.SpeakTextWait"Welcome Unknown. You have not been identified" )
            c.StartInBandDTMFRecognition() 
            Menu)
            End Sub
             
            Sub Menu
            ByVal c as SkypeCall )
            c.SetTimeout10 )
            c.SpeakText"Press STAR if you want to leave a message, or enter your admin code" )
            End Sub 
            As you can see in the previous voice menu, you can easily set timeouts. After 10 seconds have elapsed, the plugin will call the Timeout subroutine in the current script. A TimeoutCount property is available from the SkypeCall object

            In the following TimeOut subroutine (sip_unknown.vb), you can see how the TimeoutCount property is used to repeat the voice menu 3 times maximum, and then hangup the call.

            PHP Code:
            Sub TimeoutByVal c as SkypeCall )
            If 
            c.TimeoutCount 3 Then
                c
            .SpeakTextWait"Bye bye" )
                
            c.Hangup()
            Else
                
            Menu)
            End If
            End Sub 

            LIST OF SKYPE PLUGIN EVENT CALLBACKS


            Sub Init( ByVal c as SkypeCall )

            This event is called when the ExecScript() API has been used. This is where each script initializes.

            PHP Code:
            Sub InitByVal c as SkypeCall )
            c.StartInBandDTMFRecognition()
            Menu)
            End Sub 

            Sub IncomingCall( ByVal c as SkypeCall )

            This event is called in the script skype_incoming.vb when there is an incoming call. You must use the Accept(), Reject() or Redirect() API in this event.

            PHP Code:
            Sub IncomingCallByVal newCall as SkypeCall )
            newCall.Accept()
            End Sub 

            Sub Ringing( ByVal c as SkypeCall )

            This event is called in skype_incoming.vb after the call has been accepted.
            You can use the c.RingCount property to decide when you want the call to be answered. You should use the Answer() API in this event.

            PHP Code:
            Sub RingingByVal newCall as SkypeCall )
            If 
            newCall.RingCount 3 Then
                 newCall
            .LoadScript"skype_unknown.vb" )
                 
            newCall.Answer()
            End If
            End Sub 

            Sub CallConnected( ByVal c as SkypeCall )

            This event is called when the call is connected.

            PHP Code:
            Sub CallConnectedByVal c as SkypeCall )
            c.SpeakTextWait"Welcome Unknown. You have not been identified" )
            c.StartInBandDTMFRecognition() 
            Menu)
            End Sub 

            Sub CallHungup( ByVal c as SkypeCall )

            This event is called when the call is hungup.

            PHP Code:
            Sub CallHungupByVal c as SkypeCall )
            c.StopRecordingWav()
            End Sub 

            Sub Timeout( ByVal c as SkypeCall )

            This event is called when the SetTimeout() API is used. The count is increased
            each time.

            PHP Code:
            Sub TimeoutByVal c as SkypeCall )
            Dim count as Integer c.TimeoutCount
            If count 3 Then
                 c
            .SpeakTextWait"Bye bye" )
                 
            c.Hangup()
            Else
                 
            Menu)
            End If
            End Sub 

            Sub HeardDTMF( ByVal c as SkypeCall )

            This event is called when DTMF is heard on the line.

            PHP Code:
             Sub HeardDTMFByVal c as SkypeCall 
            Dim code as String c.DtmfCode 
            Dim dtmf 
            as String c.DtmfString
             
            If code "*" Then
                 c
            .StopSpeaking()
                 
            c.ExecScript"sip_message.vb" )
            End if
            End Sub 

            Sub WavFinishedPlaying( ByVal c as SkypeCall )

            This event is called when the StartPlayingWav() API has been used, when the file finished playing.

            PHP Code:
            Sub WavFinishedPlayingByVal c as SkypeCall )
                
            c.SpeakTextWait"Press STAR or hangup to save. Press POUND to delete." )
                
            c.SetTimeout10 )
            End Sub 

            Sub TransferFailed( ByVal c as SkypeCall )

            This event is called in case the transfer failed.


            SKYPECALL OBJECT API


            Call management API


            Property RemoteAddress as String

            Address of the remote contact (caller id).


            Property RemoteName as String

            Name of the remote contact (caller id name). Might not always be available.


            Property IsPstn as Boolean Skype Connector V1.21.2.3+

            True if the call is a PSTN call. False if the call is a Skype call.


            Method Accept()

            Use this API to accept a call in the IncomingCall() event callback.


            Method Reject()

            Use this API to decline a call in the IncomingCall() event callback


            Method Redirect( redirectAddress as String )

            Use this API to redirect a call in the IncomingCall() event callback


            Method Answer( )

            Use this API to answer a call in the Ringing() event callback


            Method Transfer( redirectAddress as String )

            Place a new call on the first enabled line, and transfer the current call to the new one. (The caller is then in relation with someone else).


            Method Hangup( )

            Hangup the call on the line. The CallHangup() event will be called in the current
            script.


            Property RingCount as Integer

            Use this property in the Ringing() callback to decide when you want the call to be answered.


            Script management API

            Method LoadScript( Dim script as String )

            The LoadScript API changes the script that handles events on the line.


            Method ExecScript( Dim script as String)

            The ExecScript API changes the script that handles events on the line.
            The Init() event callback in the script is called immediately.


            Method SetTimeout( Dim timeout as Int )

            Set a Timeout on the line. After the specified number of seconds have elapsed, the Timeout() event will be called in the current script. The TimeoutCount property is incremented each time the Timeout() callback is called in the script.


            Method StopTimeout()

            Remove any Timeout set with SetTimeout(). The Timeout() callback won't be called anymore.


            Property TimeoutCount as Integer

            Number of times the Timeout() callback has been called since last call to the ResetTimeoutCount() method.


            Method ResetTimeoutCount()

            Each time the Timeout() event is called, the Timeout count is increased. This API
            allows you to reset the timeout count to 0.


            Method SetContext( Dim key as Object, Dim value as Object )

            Set any context information for the current call. This is the only way to pass call variables between events.

            PHP Code:
            ...
            Dim filename as String "C:\Program Files\HomeSeer 2\sipmessages\test1.wav"
            c.SetContext"rec_filename"filename )
            c.SetTimeout30 )
            c.StartRecordingWavfilename )
            End Sub 

            Method GetContext( Dim key as Object ) As Object

            Get a context value previously set on the call with the SetContext API

            PHP Code:
            Sub InitByVal c as SkypeCall )
                
            Dim filename as String c.GetContext"rec_filename" )
                
            c.StartPlayingWavfilename )
            End Sub 

            Sound management API

            Note: There is no MP3 API, as the MP3 format is not free and subject to licensing. If you want to send music to the line, you must first convert the file to .WAV. The wav file sample rate must be 16KHz, 16 bits.


            Method StartPlayingWav( Dim filepath as String )

            This API starts playing a WAV file on the line.
            This API will cause the WavFinishedPlaying() event to be called in the
            current script

            Method PlayWav( Dim filepath as String ) SkypeConnector V1.21.2.3+

            This API is the same as StartPlayingWav()
            This API starts playing a WAV file on the line.
            This API will cause the WavFinishedPlaying() event to be called in the
            current script

            Method PlayWavWait( Dim filepath as String ) SkypeConnector V1.21.2.3+

            This API starts playing a WAV file on the line and waits (maximum one minute) until the wav file has finished playing.


            Property IsPlayingWav As Boolean

            True if the plugin is currently playing a .Wav file on the line.


            Method StopPlayingWav()

            This API stops any sound currently playing on the line.



            Method StartRecordingWav( Dim filepath as String )

            This API starts recording a WAV file for the specified line.


            Property IsRecording As Boolean

            True if the plugin is currently recording on the line.


            Method StopRecordingWav()

            This API stops any recording for the specified line.


            TextToSpeech API


            Method SpeakText( Dim text as String )

            Speak text without waiting. Usefull for Menu because DTMF recognition can occur
            while the text is still speaking.


            Method SpeakTextWait( Dim text as String )

            Speak text, and does not return until the text has finished speaking.


            Method StopSpeaking()

            Stop speaking on the specified line.


            Property IsSpeaking As Boolean

            True if the plugin is currently speaking on the line.


            Property SpeechVolume As Int

            You can get or set this value. Volume should be between 0 and 100. Default is 75.


            Property SpeechRate As Int

            You can get or set this value. Speech rate should be between -10 and 10. Default is 0.


            Property SpeechVoice As String

            You can get or set this value. SpeechVoice sets the voice name used to speak. Default is an empty string, which selects the default Speech Control panel voice.


            DTMF API

            Method StartInBandDTMFRecognition()

            Starts inband DTMF recognition on the line. The HeardDtmf() callback will be called in the script for any DTMF tone detected. This API is here for compatibility with the SIP Plugin scripts only, as inband DTMF detection is always active with the Skype plugin. This method clears the DTMF string.


            Property IsDetectingDtmf as Boolean

            True if the plugin is currently analysing incoming signal for DTMF tones.


            Property DtmfCode as String

            Last DTMF code heard on the line. "0-9 ABCD*#"
            Each code is appended to the DtmfString property.


            Property DtmfString as String

            DTMF code string, since last call to ClearDtmf() or StartInBandDtmfRecognition()


            Method ClearDtmf()

            Clears the DtmfString property.
            Last edited by stipus; December 21, 2008, 02:56 PM.
            --
            stipus

            Comment


              #7
              CALL FLOW API FOR VOICE RECOGNITION (plugn 2.27.2.4+)

              - SkypeCall.StartVoiceRecognition( wordStringArray as string() )

              Pass an array of words to be recognized. Once a word is recognized, the HearWord() callback subroutine is called in your IVR script

              - SkypeCall.StopVoiceRecognition()

              Stop the voice recognition

              - SkypeCall.LastWordRecognized as string

              This is the last word sequence recognized.


              Sample script:

              The following script is available in your HomeSeer 2\Scripts directory as skype_voicemenu.vb To try it, you can enter skype_voicemenu.vb in the Incoming Call Script textbox in the Settings tab of the plugin configuration.


              Code:
              Imports HSPI_SKYPE
              ' ----------------------------------------------------------------
              ' Init CALLBACK
              ' Gets called when ExecScript("xxx") is executed
              ' from another script.
              ' ----------------------------------------------------------------
              Sub Init( ByVal c as SkypeCall )
              End Sub
              
              ' -----------------------------------------------------------------------
              ' INCOMINGCALL CALLBACK
              ' Accept call.
              ' -----------------------------------------------------------------------
              Sub IncomingCall( ByVal newCall as SkypeCall )
                newCall.Accept()
              End Sub
              
              ' -----------------------------------------------------------------------
              ' RINGING CALLBACK
              ' Gets called when the call has been accepted
              ' Answers the call after the selected number of rings occured
              ' -----------------------------------------------------------------------
              Sub Ringing( ByVal newCall as SkypeCall )
                  newCall.Answer()
              End Sub
              
              ' ----------------------------------------------------------------
              ' CallConnected CALLBACK
              ' Speak a Welcome Message, and start voice recognition
              ' ----------------------------------------------------------------
              Sub CallConnected( ByVal c  as SkypeCall )
               c.SpeakText( "Please Say fruit, transport, or hangup" )
               c.StartVoiceRecognition( new string() {"fruit","transport", "hangup"} )
              End Sub
              
              ' ----------------------------------------------------------------
              ' HeardWord CALLBACK
              ' ----------------------------------------------------------------
              Sub HeardWord( ByVal c as SkypeCall )
               c.SpeakTextWait( "You said " & c.LastWordRecognized )
               If c.LastWordRecognized = "hangup" Then
                   c.Hangup()
               ElseIf c.LastWordRecognized = "fruit" Then
                   c.SpeakTextWait( "Please Say banana, orange or apple" )
                   c.StartVoiceRecognition( new string() {"banana","orange","apple","hangup"} )
               ElseIf c.LastWordRecognized = "transport"  Then
                   c.SpeakTextWait( "Please Say car, train or helicopter" )
                   c.StartVoiceRecognition( new string() {"car","train","helicopter","hangup"} )
               End If
              End Sub
              
              ' ----------------------------------------------------------------
              ' Timeout CALLBACK
              ' ----------------------------------------------------------------
              Sub Timeout( ByVal c as SkypeCall )
              End Sub
               
              ' -----------------------------------------------------------------------
              ' CALL HUNGUP CALLBACK
              ' -----------------------------------------------------------------------
              Sub CallHungup( ByVal c as SkypeCall )
              End Sub
              
              ' ----------------------------------------------------------------
              ' HeardDTMF CALLBACK
              ' ----------------------------------------------------------------
              Sub HeardDTMF( ByVal c as SkypeCall )
              End Sub

              Here is another example to show that you can use complete sentences and a star to replace any word.
              Using this script, you can ask HomeSeer to run event xxx, or launch event xxx, or trigger event xxx

              Code:
              Sub CallConnected( ByVal c  as SkypeCall )
               c.SpeakText( "say run event eventname" )
               c.StartVoiceRecognition( new string() {"run event *", "launch event *", "trigger event *"} )
              End Sub
              
              Sub HeardWord( ByVal c as SkypeCall )
               dim wordArray as string() = Split( c.LastWordRecognized )
               If wordArray(1) = "event" And wordArray.Length = 3 Then
                 If hs.EventExists( wordArray(2) ) Then
                   c.SpeakTextWait( "running event " & wordArray(2) )
                   hs.TriggerEvent( wordArray(2) )
                 Else
                   c.SpeakTextWait( "event " & wordArray(2) & " does not exist" )
                 End If
               End If
              End Sub

              Voice recognition syntax options:

              In the previous sample, the event name must be one word only.

              An other option is to use the syntax *+ (for any number of additional words)

              Code:
              c.StartVoiceRecognition( new string() {"run event *+", "launch event *+", "trigger event *+"}
              An other option is to specify an optional word with a question mark. Here the recognition starts with an optional "please"

              Code:
              c.StartVoiceRecognition( new string() {"?please run event *+", "?please launch event *+", "?please trigger event *+"}
              The last option is to increase or decrease confidence for a specific word using + or - before the word

              In the following sample, the words run, launch and trigger are not necessary well recognized, but the word event must be well recognized

              Code:
              c.StartVoiceRecognition( new string() {"?please -run +event *+", "?please -launch +event *+", "?please -trigger +event *+"}
              Last edited by stipus; December 9, 2009, 06:52 PM.
              --
              stipus

              Comment


                #8
                Attachement in post #1 updated to V0.3.2.2

                Change log since V0.2.2.2

                - The plugin can send SMS to any mobile phone (if you have enough Skype credit). Using Skype is the easiest way to send SMS from HomeSeer !

                - New API added to send SMS.

                - New event action added to send SMS

                - New API added to check if Skype is online from any HomeSeer script

                - IVR script Transfer() API added to transfer an existing call to any other Skype user or any phone number (if your Skype contract allows transfering to phone numbers).

                - New sample IVR script added to transfer calls to any HomeSeer phone contact: skype_transfer.vb

                - New Skype SilentMode option added to .ini file. The Skype client will ask for confirmation. Latest version of the Skype Client (3.5.0.178+) has a check box to stop asking confimation for new silent mode requests from the same program.

                - Event command has been fixed (it was returning the message ERROR instead of OK, and OK instead of ERROR)

                - Script command has been fixed (it was improperly prefixed in hspi_skype.ini)

                Please send me feedback.
                Last edited by stipus; August 8, 2007, 10:30 AM.
                --
                stipus

                Comment


                  #9
                  Stipus,

                  Thanks for new plugin...can't wait to get off holiday and try this out.

                  Cheers,

                  Darren

                  Comment


                    #10
                    Thanks Darren .... that would be good because I'm kind of feedback driven man ... and I didn't get much success with my plugin It seems August is not the good month for feedback

                    However, I know it works very well and features are really good. And as it doesn't use any third party lib, I'm sure I can control all possible bugs. It won't be like the Bluetooth connector (with the never updated third party BT Lib ), and the SIP Connector (With the buggy Sipxtapi ).

                    Regards,
                    --
                    stipus

                    Comment


                      #11
                      If I get chance to try it out remote I will do but they don't have wi-fi on the beach!

                      I am looking forward to using the SMS functions which will be great.

                      Are you using the Skype API?

                      Can you call skype out numbers?

                      Cheers,

                      Darren

                      Comment


                        #12
                        Originally posted by darren-mc View Post
                        If I get chance to try it out remote I will do but they don't have wi-fi on the beach!

                        I am looking forward to using the SMS functions which will be great.
                        The SMS function works very well. I didn't get any missed SMS during my tests.

                        Are you using the Skype API?
                        Yes. But I use the Skype API direct. There are a few libs available (Skype4com..) but because of the problem I experienced with other third party libs, I decided to code everything myself.

                        Can you call skype out numbers?
                        Yes. It works very well, as long as you have enough Skype credit.

                        The only thing I couldn't test is Skype-in... but it should work.
                        --
                        stipus

                        Comment


                          #13
                          Attachement in post #1 updated to V0.4.2.2

                          Change log since V0.3.2.2

                          - Fixed a critical bug with HomeSeer log forwarding, that could cause an endless loop in some cases. I thought I already took care of this problem, but I obviously missed something...

                          - Added nice device graphics for the 3 Skype devices. (Please delete the 3 devices and restart the plugin if you installed a previous version). Thanks to Jim DooLittle for the graphics !
                          --
                          stipus

                          Comment


                            #14
                            Stipus,

                            Is there only 1 skype ID permitted?

                            Cheers,

                            Darren

                            Comment


                              #15
                              Also....

                              1. is there a device for showing the low credit status of the Skype user....for example used to prevent sending text messages when the credit is low

                              2. Is it possible to transfer a Skype inbound call to your SIP connector? (and also outbound from the SIP connector thru to Skype connector)

                              3. When you send a text message do you use the send confirmation into a status device for the connector

                              Sorry about all the questions!

                              Cheers,

                              Darren

                              Comment

                              Working...
                              X