Announcement

Collapse
No announcement yet.

Announce into hsp.speak?

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

    Announce into hsp.speak?

    I have a PBX and do not have a whole house audio (YET).

    I use my paging function of the PBX as a poor mans audio system.

    Can I inject the calling party name (from HS address book) into hsp.speak?

    I am doing it now with this way, but the name is from the PSTN CID name data not HSP Address book.

    Is there a way to do it using my newly installed WAF-NetCallerID?

    sub main()

    dim cname
    dim dial
    dim voice

    cname=hsp.CIDName(1)
    dial=hsp.LINEDial(1,"*70",false,true)

    hsp.waitms 300
    hsp.speak 1,cname,true
    hsp.waitms 1000
    hsp.speak 1,cname,true
    hsp.waitms 1000
    hsp.speak 1,cname,true
    hsp.LINEHangup 1


    end sub

    #2
    Charles,

    Sorry for the long delay. Had a lot of church, cub scouts and family items going on, and no time for our messageboard.

    This is air code, so please treat it that way. I've based what I'm going to give you on an example written by Jim Doolittle and Rustytek that I use for updating the addresses in my address book. I've tried to strip it down to what you need.

    PHP Code:

    Function GetAddressBookName(callnmbr)
      
    Dim i
      Dim adr_count
      Dim contact
      Dim bFound
      Dim x
      Dim Area_code
      Dim City_COde
      Dim Local_Code

      Area_code 
    Mid(callnmbr13)
      
    City_COde Mid(callnmbr43)
      
    Local_Code Mid(callnmbr74)

      
    GetAddressBookName ""

      
    newcallnmbr Area_code "-" city_code "-" local_code

      adr_count 
    hsp.ADRCount
      bFound 
    False

      
    For 1 To adr_count
        Set contact 
    hsp.ADRGet(i)
        
    Select Case newcallnmbr
          
    Case contact.home_phone
            callname 
    contact.first " " contact.last
            bFound 
    True
            
    Exit For
          Case 
    contact.cell_phone
            callname 
    contact.first " " contact.last
            callfrom 
    "Cell Phone"
            
    bFound True
            
    Exit For
          Case 
    contact.business_phone
            callname 
    contact.first " " contact.last
            callfrom 
    "Business Phone"
            
    bFound True
            
    Exit For
        
    End Select
      Next
      
      
    If bFound True Then
            GetAddressBookName 
    callname
      End 
    If
      
    End Function 
    So, in your case, instead of using:

    cname=hsp.CIDName(1)

    You could try:

    cname=GetAddressBookName(hsp.CIDNumber(1)

    Again, I don't know if this will work, but hopefully it will push you in the right direction.

    Best wishes to you, and much thanks for helping me take my wife out to dinner!

    --David

    Comment

    Working...
    X